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
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 245 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.
285 286 287 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 285 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
276 277 278 279 280 281 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 276 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.
291 292 293 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 291 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.
297 298 299 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 297 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the MediaRecordingInstance
376 377 378 379 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 376 def delete context.delete end |
#duration ⇒ String
Returns The duration of the MediaRecording in seconds.
303 304 305 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 303 def duration @properties['duration'] end |
#fetch ⇒ MediaRecordingInstance
Fetch the MediaRecordingInstance
384 385 386 387 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 384 def fetch context.fetch end |
#format ⇒ Format
309 310 311 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 309 def format @properties['format'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
398 399 400 401 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 398 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.MediaRecordingInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
315 316 317 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 315 def links @properties['links'] end |
#media_size ⇒ String
Returns The size of the recording media in bytes.
345 346 347 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 345 def media_size @properties['media_size'] end |
#processor_sid ⇒ String
Returns The SID of the MediaProcessor resource which produced the MediaRecording.
321 322 323 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 321 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).
327 328 329 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 327 def resolution @properties['resolution'] end |
#sid ⇒ String
Returns The unique string generated to identify the MediaRecording resource.
339 340 341 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 339 def sid @properties['sid'] end |
#source_sid ⇒ String
Returns The SID of the resource that generated the original media track(s) of the MediaRecording.
333 334 335 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 333 def source_sid @properties['source_sid'] end |
#status ⇒ Status
351 352 353 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 351 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.
357 358 359 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 357 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`.
363 364 365 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 363 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
391 392 393 394 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 391 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.
369 370 371 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 369 def url @properties['url'] end |