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 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, enable_provider_data: :unset) ⇒ TranscriptionInstance

Create the TranscriptionInstance

Parameters:

  • (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.

  • (defaults to: :unset)
  • (defaults to: :unset)

    Absolute URL of the status callback.

  • (defaults to: :unset)

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

  • (defaults to: :unset)

    Friendly name given to the Inbound Track

  • (defaults to: :unset)

    Friendly name given to the Outbound Track

  • (defaults to: :unset)

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

  • (defaults to: :unset)

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

  • (defaults to: :unset)

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

  • (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

  • (defaults to: :unset)

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

  • (defaults to: :unset)

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

  • (defaults to: :unset)

    The provider will add punctuation to recognition result

  • (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

  • (defaults to: :unset)

    Whether the callback includes raw provider data.

Returns:

  • Created TranscriptionInstance



55
56
57
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
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 55

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, 
    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,
        '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, enable_provider_data: :unset) ⇒ TranscriptionInstance

Create the TranscriptionInstanceMetadata

Parameters:

  • (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.

  • (defaults to: :unset)
  • (defaults to: :unset)

    Absolute URL of the status callback.

  • (defaults to: :unset)

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

  • (defaults to: :unset)

    Friendly name given to the Inbound Track

  • (defaults to: :unset)

    Friendly name given to the Outbound Track

  • (defaults to: :unset)

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

  • (defaults to: :unset)

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

  • (defaults to: :unset)

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

  • (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

  • (defaults to: :unset)

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

  • (defaults to: :unset)

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

  • (defaults to: :unset)

    The provider will add punctuation to recognition result

  • (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

  • (defaults to: :unset)

    Whether the callback includes raw provider data.

Returns:

  • Created TranscriptionInstance



124
125
126
127
128
129
130
131
132
133
134
135
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
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 124

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, 
  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,
        '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],
    )
    .new(
        @version,
        transcription_instance,
        response.headers,
        response.status_code
    )
end

#to_sObject

Provide a user friendly representation



185
186
187
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 185

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