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

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

Overview

Speech to text usage reports

Defined Under Namespace

Classes: Messaging, NumberLookup, Voice

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ UsageReports

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

Parameters:



48
49
50
51
52
53
# File 'lib/telnyx/resources/legacy/reporting/usage_reports.rb', line 48

def initialize(client:)
  @client = client
  @messaging = Telnyx::Resources::Legacy::Reporting::UsageReports::Messaging.new(client: client)
  @number_lookup = Telnyx::Resources::Legacy::Reporting::UsageReports::NumberLookup.new(client: client)
  @voice = Telnyx::Resources::Legacy::Reporting::UsageReports::Voice.new(client: client)
end

Instance Attribute Details

#messagingTelnyx::Resources::Legacy::Reporting::UsageReports::Messaging (readonly)

Messaging usage reports



11
12
13
# File 'lib/telnyx/resources/legacy/reporting/usage_reports.rb', line 11

def messaging
  @messaging
end

#number_lookupTelnyx::Resources::Legacy::Reporting::UsageReports::NumberLookup (readonly)

Number lookup usage reports



15
16
17
# File 'lib/telnyx/resources/legacy/reporting/usage_reports.rb', line 15

def number_lookup
  @number_lookup
end

#voiceTelnyx::Resources::Legacy::Reporting::UsageReports::Voice (readonly)

Voice usage reports



19
20
21
# File 'lib/telnyx/resources/legacy/reporting/usage_reports.rb', line 19

def voice
  @voice
end

Instance Method Details

#retrieve_speech_to_text(end_date: nil, start_date: nil, request_options: {}) ⇒ Telnyx::Models::Legacy::Reporting::UsageReportRetrieveSpeechToTextResponse

Generate and fetch speech to text usage report synchronously. This endpoint will both generate and fetch the speech to text report over a specified time period.

Parameters:

Returns:

See Also:



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/telnyx/resources/legacy/reporting/usage_reports.rb', line 33

def retrieve_speech_to_text(params = {})
  parsed, options = Telnyx::Legacy::Reporting::UsageReportRetrieveSpeechToTextParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "legacy/reporting/usage_reports/speech_to_text",
    query: query,
    model: Telnyx::Models::Legacy::Reporting::UsageReportRetrieveSpeechToTextResponse,
    options: options
  )
end