Class: Telnyx::Resources::Legacy::Reporting::UsageReports::Voice

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/legacy/reporting/usage_reports/voice.rb

Overview

Voice usage reports

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Voice

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Voice.

Parameters:



116
117
118
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/voice.rb', line 116

def initialize(client:)
  @client = client
end

Instance Method Details

#create(end_time:, start_time:, aggregation_type: nil, connections: nil, managed_accounts: nil, product_breakdown: nil, select_all_managed_accounts: nil, request_options: {}) ⇒ Telnyx::Models::Legacy::Reporting::UsageReports::VoiceCreateResponse

Some parameter documentations has been truncated, see Models::Legacy::Reporting::UsageReports::VoiceCreateParams for more details.

Creates a new legacy usage V2 CDR report request with the specified filters

Parameters:

  • end_time (Time)

    End time in ISO format

  • start_time (Time)

    Start time in ISO format

  • aggregation_type (Integer)

    Aggregation type: All = 0, By Connections = 1, By Tags = 2, By Billing Group = 3

  • connections (Array<Integer>)

    List of connections to filter by

  • managed_accounts (Array<String>)

    List of managed accounts to include

  • product_breakdown (Integer)

    Product breakdown type: No breakdown = 0, DID vs Toll-free = 1, Country = 2, DID

  • select_all_managed_accounts (Boolean)

    Whether to select all managed accounts

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/voice.rb', line 37

def create(params)
  parsed, options = Telnyx::Legacy::Reporting::UsageReports::VoiceCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "legacy/reporting/usage_reports/voice",
    headers: {"content-type" => "*/*"},
    body: parsed,
    model: Telnyx::Models::Legacy::Reporting::UsageReports::VoiceCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Telnyx::Models::Legacy::Reporting::UsageReports::VoiceDeleteResponse

Deletes a specific V2 legacy usage CDR report request by ID



104
105
106
107
108
109
110
111
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/voice.rb', line 104

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["legacy/reporting/usage_reports/voice/%1$s", id],
    model: Telnyx::Models::Legacy::Reporting::UsageReports::VoiceDeleteResponse,
    options: params[:request_options]
  )
end

#list(page: nil, per_page: nil, request_options: {}) ⇒ Telnyx::Internal::PerPagePagination<Telnyx::Models::Legacy::Reporting::UsageReports::CdrUsageReportResponseLegacy>

Fetch all previous requests for cdr usage reports.

Parameters:

  • page (Integer)

    Page number

  • per_page (Integer)

    Size of the page

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/voice.rb', line 81

def list(params = {})
  parsed, options = Telnyx::Legacy::Reporting::UsageReports::VoiceListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "legacy/reporting/usage_reports/voice",
    query: query,
    page: Telnyx::Internal::PerPagePagination,
    model: Telnyx::Legacy::Reporting::UsageReports::CdrUsageReportResponseLegacy,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Legacy::Reporting::UsageReports::VoiceRetrieveResponse

Fetch single cdr usage report by id.



59
60
61
62
63
64
65
66
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/voice.rb', line 59

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["legacy/reporting/usage_reports/voice/%1$s", id],
    model: Telnyx::Models::Legacy::Reporting::UsageReports::VoiceRetrieveResponse,
    options: params[:request_options]
  )
end