Class: Twilio::REST::Media::V1::MediaRecordingInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Media::V1::MediaRecordingInstance
- Defined in:
- lib/twilio-ruby/rest/media/v1/media_recording.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the MediaRecording resource.
-
#context ⇒ MediaRecordingContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the MediaRecordingInstance.
-
#duration ⇒ String
The duration of the MediaRecording in seconds.
-
#fetch ⇒ MediaRecordingInstance
Fetch the MediaRecordingInstance.
- #format ⇒ Format
-
#initialize(version, payload, sid: nil) ⇒ MediaRecordingInstance
constructor
Initialize the MediaRecordingInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
-
#media_size ⇒ String
The size of the recording media in bytes.
-
#processor_sid ⇒ String
The SID of the MediaProcessor resource which produced the MediaRecording.
-
#resolution ⇒ String
The dimensions of the video image in pixels expressed as columns (width) and rows (height).
-
#sid ⇒ String
The unique string generated to identify the MediaRecording resource.
-
#source_sid ⇒ String
The SID of the resource that generated the original media track(s) of the MediaRecording.
- #status ⇒ Status
-
#status_callback ⇒ String
The URL to which Twilio will send asynchronous webhook requests for every MediaRecording event.
-
#status_callback_method ⇒ String
The HTTP method Twilio should use to call the ‘status_callback` URL.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ MediaRecordingInstance
Initialize the MediaRecordingInstance
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 242 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i, 'format' => payload['format'], 'links' => payload['links'], 'processor_sid' => payload['processor_sid'], 'resolution' => payload['resolution'], 'source_sid' => payload['source_sid'], 'sid' => payload['sid'], 'media_size' => payload['media_size'], 'status' => payload['status'], 'status_callback' => payload['status_callback'], 'status_callback_method' => payload['status_callback_method'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the MediaRecording resource.
282 283 284 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 282 def account_sid @properties['account_sid'] end |
#context ⇒ MediaRecordingContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 273 def context unless @instance_context @instance_context = MediaRecordingContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
288 289 290 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 288 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
294 295 296 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 294 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the MediaRecordingInstance
373 374 375 376 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 373 def delete context.delete end |
#duration ⇒ String
Returns The duration of the MediaRecording in seconds.
300 301 302 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 300 def duration @properties['duration'] end |
#fetch ⇒ MediaRecordingInstance
Fetch the MediaRecordingInstance
381 382 383 384 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 381 def fetch context.fetch end |
#format ⇒ Format
306 307 308 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 306 def format @properties['format'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
395 396 397 398 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 395 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.MediaRecordingInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
312 313 314 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 312 def links @properties['links'] end |
#media_size ⇒ String
Returns The size of the recording media in bytes.
342 343 344 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 342 def media_size @properties['media_size'] end |
#processor_sid ⇒ String
Returns The SID of the MediaProcessor resource which produced the MediaRecording.
318 319 320 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 318 def processor_sid @properties['processor_sid'] end |
#resolution ⇒ String
Returns The dimensions of the video image in pixels expressed as columns (width) and rows (height).
324 325 326 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 324 def resolution @properties['resolution'] end |
#sid ⇒ String
Returns The unique string generated to identify the MediaRecording resource.
336 337 338 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 336 def sid @properties['sid'] end |
#source_sid ⇒ String
Returns The SID of the resource that generated the original media track(s) of the MediaRecording.
330 331 332 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 330 def source_sid @properties['source_sid'] end |
#status ⇒ Status
348 349 350 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 348 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL to which Twilio will send asynchronous webhook requests for every MediaRecording event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details.
354 355 356 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 354 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method Twilio should use to call the ‘status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
360 361 362 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 360 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
388 389 390 391 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 388 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.MediaRecordingInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource.
366 367 368 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 366 def url @properties['url'] end |