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

Inherits:
InstanceContext
  • 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, call_sid, sid) ⇒ TranscriptionContext

Initialize the TranscriptionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this Transcription resource.

  • call_sid (String)

    The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with.

  • sid (String)

    The SID of the Transcription resource, or the ‘name` used when creating the resource



120
121
122
123
124
125
126
127
128
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 120

def initialize(version, , call_sid, sid)
    super(version)

    # Path Solution
    @solution = { account_sid: , call_sid: call_sid, sid: sid,  }
    @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Transcriptions/#{@solution[:sid]}.json"

    
end

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation



167
168
169
170
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 167

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.TranscriptionContext #{context}>"
end

#to_sObject

Provide a user friendly representation



160
161
162
163
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 160

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Api.V2010.TranscriptionContext #{context}>"
end

#update(status: nil) ⇒ TranscriptionInstance

Update the TranscriptionInstance

Parameters:

  • status (UpdateStatus) (defaults to: nil)

Returns:



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb', line 133

def update(
    status: nil
)

    data = Twilio::Values.of({
        'Status' => status,
    })

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