Class: Telnyx::Resources::Legacy::Reporting::UsageReports::NumberLookup

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/legacy/reporting/usage_reports/number_lookup.rb,
sig/telnyx/resources/legacy/reporting/usage_reports/number_lookup.rbs

Overview

Number lookup usage reports

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ NumberLookup

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 NumberLookup.

Parameters:



108
109
110
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/number_lookup.rb', line 108

def initialize(client:)
  @client = client
end

Instance Method Details

#create(aggregation_type: nil, end_date: nil, managed_accounts: nil, start_date: nil, request_options: {}) ⇒ Telnyx::Models::Legacy::Reporting::UsageReports::NumberLookupCreateResponse

Submit a new telco data usage report

Parameters:

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/number_lookup.rb', line 27

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

#delete(id, request_options: {}) ⇒ nil

Delete a specific telco data usage report by its ID

Parameters:

  • id (String)

    Unique identifier of the resource.

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

Returns:

  • (nil)

See Also:



96
97
98
99
100
101
102
103
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/number_lookup.rb', line 96

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["legacy/reporting/usage_reports/number_lookup/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end

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

Retrieve a paginated list of telco data usage reports

Parameters:

  • page (Integer)

    Page number to retrieve (1-based).

  • per_page (Integer)

    Filter results by per page.

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

Returns:

See Also:



72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/number_lookup.rb', line 72

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

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

Retrieve a specific telco data usage report by its ID

Parameters:

  • id (String)

    Unique identifier of the resource.

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

Returns:

See Also:



50
51
52
53
54
55
56
57
# File 'lib/telnyx/resources/legacy/reporting/usage_reports/number_lookup.rb', line 50

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