Class: Telnyx::Resources::Reports

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/reports.rb,
lib/telnyx/resources/reports/cdr_usage_reports.rb,
lib/telnyx/resources/reports/mdr_usage_reports.rb

Defined Under Namespace

Classes: CdrUsageReports, MdrUsageReports

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Reports

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

Parameters:



107
108
109
110
111
# File 'lib/telnyx/resources/reports.rb', line 107

def initialize(client:)
  @client = client
  @cdr_usage_reports = Telnyx::Resources::Reports::CdrUsageReports.new(client: client)
  @mdr_usage_reports = Telnyx::Resources::Reports::MdrUsageReports.new(client: client)
end

Instance Attribute Details

#cdr_usage_reportsTelnyx::Resources::Reports::CdrUsageReports (readonly)

Voice usage reports



8
9
10
# File 'lib/telnyx/resources/reports.rb', line 8

def cdr_usage_reports
  @cdr_usage_reports
end

#mdr_usage_reportsTelnyx::Resources::Reports::MdrUsageReports (readonly)

Messaging usage reports



12
13
14
# File 'lib/telnyx/resources/reports.rb', line 12

def mdr_usage_reports
  @mdr_usage_reports
end

Instance Method Details

#list_mdrs(id: nil, cld: nil, cli: nil, direction: nil, end_date: nil, message_type: nil, profile: nil, start_date: nil, status: nil, request_options: {}) ⇒ Telnyx::Models::ReportListMdrsResponse

Fetch all Mdr records

Parameters:

Returns:

See Also:



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/telnyx/resources/reports.rb', line 41

def list_mdrs(params = {})
  parsed, options = Telnyx::ReportListMdrsParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "reports/mdrs",
    query: query,
    model: Telnyx::Models::ReportListMdrsResponse,
    options: options
  )
end

#list_wdrs(id: nil, end_date: nil, imsi: nil, mcc: nil, mnc: nil, page_number: nil, page_size: nil, phone_number: nil, sim_card_id: nil, sim_group_id: nil, sim_group_name: nil, sort: nil, start_date: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ReportListWdrsResponse>

Some parameter documentations has been truncated, see Models::ReportListWdrsParams for more details.

Fetch all Wdr records

Parameters:

  • id (String)

    WDR uuid

  • end_date (String)

    End date

  • imsi (String)

    International mobile subscriber identity

  • mcc (String)

    Mobile country code

  • mnc (String)

    Mobile network code

  • page_number (Integer)
  • page_size (Integer)
  • phone_number (String)

    Phone number

  • sim_card_id (String)

    Sim card unique identifier

  • sim_group_id (String)

    Sim group unique identifier

  • sim_group_name (String)

    Sim group name

  • sort (Array<String>)

    Field used to order the data. If no field is specified, default value is ‘create

  • start_date (String)

    Start date

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

Returns:

See Also:



91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/telnyx/resources/reports.rb', line 91

def list_wdrs(params = {})
  parsed, options = Telnyx::ReportListWdrsParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "reports/wdrs",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Models::ReportListWdrsResponse,
    options: options
  )
end