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
# 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) ⇒ 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 the unique name of the [IntelligentService](www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription.

Returns:



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

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
)

    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,
    })

    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

#to_sObject

Provide a user friendly representation



106
107
108
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 106

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