Class: Twilio::REST::Api::V2010::AccountContext::TranscriptionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::TranscriptionInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/transcription.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#api_version ⇒ String
The API version used to create the transcription.
-
#context ⇒ TranscriptionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT that the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT that the resource was last updated.
-
#delete ⇒ Boolean
Deletes the TranscriptionInstance.
-
#duration ⇒ String
The duration of the transcribed audio in seconds.
-
#fetch ⇒ TranscriptionInstance
Fetch a TranscriptionInstance.
-
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ TranscriptionInstance
constructor
Initialize the TranscriptionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#price ⇒ String
The charge for the transcription.
-
#price_unit ⇒ String
The currency in which price is measured.
-
#recording_sid ⇒ String
The SID that identifies the transcription’s recording.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#status ⇒ transcription.Status
The status of the transcription.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transcription_text ⇒ String
The text content of the transcription.
-
#type ⇒ String
The transcription type.
-
#uri ⇒ String
The URI of the resource, relative to ‘api.twilio.com`.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ TranscriptionInstance
Initialize the TranscriptionInstance
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 219 def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'api_version' => payload['api_version'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'duration' => payload['duration'], 'price' => payload['price'].to_f, 'price_unit' => payload['price_unit'], 'recording_sid' => payload['recording_sid'], 'sid' => payload['sid'], 'status' => payload['status'], 'transcription_text' => payload['transcription_text'], 'type' => payload['type'], 'uri' => payload['uri'], } # Context @instance_context = nil @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
257 258 259 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 257 def account_sid @properties['account_sid'] end |
#api_version ⇒ String
Returns The API version used to create the transcription.
263 264 265 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 263 def api_version @properties['api_version'] end |
#context ⇒ TranscriptionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
248 249 250 251 252 253 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 248 def context unless @instance_context @instance_context = TranscriptionContext.new(@version, @params['account_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT that the resource was created.
269 270 271 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 269 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The RFC 2822 date and time in GMT that the resource was last updated.
275 276 277 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 275 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the TranscriptionInstance
343 344 345 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 343 def delete context.delete end |
#duration ⇒ String
Returns The duration of the transcribed audio in seconds.
281 282 283 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 281 def duration @properties['duration'] end |
#fetch ⇒ TranscriptionInstance
Fetch a TranscriptionInstance
336 337 338 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 336 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
356 357 358 359 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 356 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.TranscriptionInstance #{values}>" end |
#price ⇒ String
Returns The charge for the transcription.
287 288 289 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 287 def price @properties['price'] end |
#price_unit ⇒ String
Returns The currency in which price is measured.
293 294 295 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 293 def price_unit @properties['price_unit'] end |
#recording_sid ⇒ String
Returns The SID that identifies the transcription’s recording.
299 300 301 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 299 def recording_sid @properties['recording_sid'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
305 306 307 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 305 def sid @properties['sid'] end |
#status ⇒ transcription.Status
Returns The status of the transcription.
311 312 313 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 311 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
349 350 351 352 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 349 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.TranscriptionInstance #{values}>" end |
#transcription_text ⇒ String
Returns The text content of the transcription.
317 318 319 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 317 def transcription_text @properties['transcription_text'] end |
#type ⇒ String
Returns The transcription type.
323 324 325 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 323 def type @properties['type'] end |
#uri ⇒ String
Returns The URI of the resource, relative to ‘api.twilio.com`.
329 330 331 |
# File 'lib/twilio-ruby/rest/api/v2010/account/transcription.rb', line 329 def uri @properties['uri'] end |