class MuxRuby::DeliveryUsageApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/mux_ruby/api/delivery_usage_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

list_delivery_usage(opts = {}) click to toggle source

List Usage Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs. @param [Hash] opts the optional parameters @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60; (default to 1) @option opts [Integer] :limit Number of items to include in the response (default to 100) @option opts [String] :asset_id Filter response to return delivery usage for this asset only. @option opts [Array<String>] :timeframe Time window to get delivery usage information. timeframe indicates the start time, timeframe indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. @return [ListDeliveryUsageResponse]

# File lib/mux_ruby/api/delivery_usage_api.rb, line 30
def list_delivery_usage(opts = {})
  data, _status_code, _headers = list_delivery_usage_with_http_info(opts)
  data
end
list_delivery_usage_with_http_info(opts = {}) click to toggle source

List Usage Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs. @param [Hash] opts the optional parameters @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60; @option opts [Integer] :limit Number of items to include in the response @option opts [String] :asset_id Filter response to return delivery usage for this asset only. @option opts [Array<String>] :timeframe Time window to get delivery usage information. timeframe indicates the start time, timeframe indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. @return [Array<(ListDeliveryUsageResponse, Integer, Hash)>] ListDeliveryUsageResponse data, response status code and response headers

# File lib/mux_ruby/api/delivery_usage_api.rb, line 43
def list_delivery_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeliveryUsageApi.list_delivery_usage ...'
  end
  # resource path
  local_var_path = '/video/v1/delivery-usage'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'asset_id'] = opts[:'asset_id'] if !opts[:'asset_id'].nil?
  query_params[:'timeframe[]'] = @api_client.build_collection_param(opts[:'timeframe'], :multi) if !opts[:'timeframe'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListDeliveryUsageResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"DeliveryUsageApi.list_delivery_usage",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeliveryUsageApi#list_delivery_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end