Class: Twilio::REST::Api::V2010::AccountContext::CallContext::TranscriptionList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid: nil, call_sid: nil) ⇒ TranscriptionList

Initialize the TranscriptionList

Parameters:

  • version (Version)

    Version that contains the resource



29
30
31
32
33
34
35
36
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 29

def initialize(version, account_sid: nil, call_sid: nil)
    super(version)
    
    # Path Solution
    @solution = { account_sid: , call_sid: call_sid }
    @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Transcriptions.json"
    
end

Instance Method Details

#create(name: :unset, track: :unset, status_callback_url: :unset, status_callback_method: :unset, inbound_track_label: :unset, outbound_track_label: :unset, partial_results: :unset, language_code: :unset, transcription_engine: :unset, profanity_filter: :unset, speech_model: :unset, hints: :unset, enable_automatic_punctuation: :unset, intelligence_service: :unset, conversation_configuration: :unset, conversation_id: :unset, configuration_id: :unset, enable_provider_data: :unset) ⇒ TranscriptionInstance

Create the TranscriptionInstance

Parameters:

  • name (String) (defaults to: :unset)

    The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription.

  • track (Track) (defaults to: :unset)
  • status_callback_url (String) (defaults to: :unset)

    Absolute URL of the status callback.

  • status_callback_method (String) (defaults to: :unset)

    The http method for the status_callback (one of GET, POST).

  • inbound_track_label (String) (defaults to: :unset)

    Friendly name given to the Inbound Track

  • outbound_track_label (String) (defaults to: :unset)

    Friendly name given to the Outbound Track

  • partial_results (Boolean) (defaults to: :unset)

    Indicates if partial results are going to be sent to the customer

  • language_code (String) (defaults to: :unset)

    Language code used by the transcription engine, specified in [BCP-47](www.rfc-editor.org/rfc/bcp/bcp47.txt) format

  • transcription_engine (String) (defaults to: :unset)

    Definition of the transcription engine to be used, among those supported by Twilio

  • profanity_filter (Boolean) (defaults to: :unset)

    indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks

  • speech_model (String) (defaults to: :unset)

    Recognition model used by the transcription engine, among those supported by the provider

  • hints (String) (defaults to: :unset)

    A Phrase contains words and phrase \"hints\" so that the speech recognition engine is more likely to recognize them.

  • enable_automatic_punctuation (Boolean) (defaults to: :unset)

    The provider will add punctuation to recognition result

  • intelligence_service (String) (defaults to: :unset)

    The SID or unique name of the [Intelligence Service](www.twilio.com/docs/conversational-intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators

  • conversation_configuration (String) (defaults to: :unset)

    The ID of the Conversations Configuration for customizing conversation behavior in Intelligence Service

  • conversation_id (String) (defaults to: :unset)

    The ID of the Conversation for associating this Transcription with an existing Conversation in Intelligence Service

  • configuration_id (String) (defaults to: :unset)

    The ID of the RealTimeTranscription Configuration for configuring all the non-default behaviors in one go.

  • enable_provider_data (Boolean) (defaults to: :unset)

    Whether the callback includes raw provider data.

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 58

def create(
    name: :unset, 
    track: :unset, 
    status_callback_url: :unset, 
    status_callback_method: :unset, 
    inbound_track_label: :unset, 
    outbound_track_label: :unset, 
    partial_results: :unset, 
    language_code: :unset, 
    transcription_engine: :unset, 
    profanity_filter: :unset, 
    speech_model: :unset, 
    hints: :unset, 
    enable_automatic_punctuation: :unset, 
    intelligence_service: :unset, 
    conversation_configuration: :unset, 
    conversation_id: :unset, 
    configuration_id: :unset, 
    enable_provider_data: :unset
)

    data = Twilio::Values.of({
        'Name' => name,
        'Track' => track,
        'StatusCallbackUrl' => status_callback_url,
        'StatusCallbackMethod' => status_callback_method,
        'InboundTrackLabel' => inbound_track_label,
        'OutboundTrackLabel' => outbound_track_label,
        'PartialResults' => partial_results,
        'LanguageCode' => language_code,
        'TranscriptionEngine' => transcription_engine,
        'ProfanityFilter' => profanity_filter,
        'SpeechModel' => speech_model,
        'Hints' => hints,
        'EnableAutomaticPunctuation' => enable_automatic_punctuation,
        'IntelligenceService' => intelligence_service,
        'ConversationConfiguration' => conversation_configuration,
        'ConversationId' => conversation_id,
        'ConfigurationId' => configuration_id,
        'EnableProviderData' => enable_provider_data,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    TranscriptionInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        call_sid: @solution[:call_sid],
    )
end

#create_with_metadata(name: :unset, track: :unset, status_callback_url: :unset, status_callback_method: :unset, inbound_track_label: :unset, outbound_track_label: :unset, partial_results: :unset, language_code: :unset, transcription_engine: :unset, profanity_filter: :unset, speech_model: :unset, hints: :unset, enable_automatic_punctuation: :unset, intelligence_service: :unset, conversation_configuration: :unset, conversation_id: :unset, configuration_id: :unset, enable_provider_data: :unset) ⇒ TranscriptionInstance

Create the TranscriptionInstanceMetadata

Parameters:

  • name (String) (defaults to: :unset)

    The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription.

  • track (Track) (defaults to: :unset)
  • status_callback_url (String) (defaults to: :unset)

    Absolute URL of the status callback.

  • status_callback_method (String) (defaults to: :unset)

    The http method for the status_callback (one of GET, POST).

  • inbound_track_label (String) (defaults to: :unset)

    Friendly name given to the Inbound Track

  • outbound_track_label (String) (defaults to: :unset)

    Friendly name given to the Outbound Track

  • partial_results (Boolean) (defaults to: :unset)

    Indicates if partial results are going to be sent to the customer

  • language_code (String) (defaults to: :unset)

    Language code used by the transcription engine, specified in [BCP-47](www.rfc-editor.org/rfc/bcp/bcp47.txt) format

  • transcription_engine (String) (defaults to: :unset)

    Definition of the transcription engine to be used, among those supported by Twilio

  • profanity_filter (Boolean) (defaults to: :unset)

    indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks

  • speech_model (String) (defaults to: :unset)

    Recognition model used by the transcription engine, among those supported by the provider

  • hints (String) (defaults to: :unset)

    A Phrase contains words and phrase \"hints\" so that the speech recognition engine is more likely to recognize them.

  • enable_automatic_punctuation (Boolean) (defaults to: :unset)

    The provider will add punctuation to recognition result

  • intelligence_service (String) (defaults to: :unset)

    The SID or unique name of the [Intelligence Service](www.twilio.com/docs/conversational-intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators

  • conversation_configuration (String) (defaults to: :unset)

    The ID of the Conversations Configuration for customizing conversation behavior in Intelligence Service

  • conversation_id (String) (defaults to: :unset)

    The ID of the Conversation for associating this Transcription with an existing Conversation in Intelligence Service

  • configuration_id (String) (defaults to: :unset)

    The ID of the RealTimeTranscription Configuration for configuring all the non-default behaviors in one go.

  • enable_provider_data (Boolean) (defaults to: :unset)

    Whether the callback includes raw provider data.

Returns:



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 136

def (
  name: :unset, 
  track: :unset, 
  status_callback_url: :unset, 
  status_callback_method: :unset, 
  inbound_track_label: :unset, 
  outbound_track_label: :unset, 
  partial_results: :unset, 
  language_code: :unset, 
  transcription_engine: :unset, 
  profanity_filter: :unset, 
  speech_model: :unset, 
  hints: :unset, 
  enable_automatic_punctuation: :unset, 
  intelligence_service: :unset, 
  conversation_configuration: :unset, 
  conversation_id: :unset, 
  configuration_id: :unset, 
  enable_provider_data: :unset
)

    data = Twilio::Values.of({
        'Name' => name,
        'Track' => track,
        'StatusCallbackUrl' => status_callback_url,
        'StatusCallbackMethod' => status_callback_method,
        'InboundTrackLabel' => inbound_track_label,
        'OutboundTrackLabel' => outbound_track_label,
        'PartialResults' => partial_results,
        'LanguageCode' => language_code,
        'TranscriptionEngine' => transcription_engine,
        'ProfanityFilter' => profanity_filter,
        'SpeechModel' => speech_model,
        'Hints' => hints,
        'EnableAutomaticPunctuation' => enable_automatic_punctuation,
        'IntelligenceService' => intelligence_service,
        'ConversationConfiguration' => conversation_configuration,
        'ConversationId' => conversation_id,
        'ConfigurationId' => configuration_id,
        'EnableProviderData' => enable_provider_data,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    transcription_instance = TranscriptionInstance.new(
        @version,
        response.body,
        account_sid: @solution[:account_sid],
        call_sid: @solution[:call_sid],
    )
    TranscriptionInstanceMetadata.new(
        @version,
        transcription_instance,
        response.headers,
        response.status_code
    )
end

#to_sObject

Provide a user friendly representation



203
204
205
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 203

def to_s
    '#<Twilio.Api.V2010.TranscriptionList>'
end