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
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#context ⇒ MediaRecordingContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Delete the MediaRecordingInstance.
-
#duration ⇒ String
The duration of the MediaRecording.
-
#fetch ⇒ MediaRecordingInstance
Fetch the MediaRecordingInstance.
-
#format ⇒ media_recording.Format
The format of the MediaRecording.
-
#initialize(version, payload, sid: nil) ⇒ MediaRecordingInstance
constructor
Initialize the MediaRecordingInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The URLs of related resources.
-
#media_size ⇒ String
The size of the recording media.
-
#processor_sid ⇒ String
The SID of the MediaProcessor.
-
#resolution ⇒ String
The dimensions of the video image in pixels.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#source_sid ⇒ String
The SID of the resource that generated the original media.
-
#status ⇒ media_recording.Status
The status of the MediaRecording.
-
#status_callback ⇒ String
The URL to which Twilio will send MediaRecording event updates.
-
#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
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 240 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'] == nil ? payload['media_size'] : payload['media_size'].to_i, '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 that created the resource.
280 281 282 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 280 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
271 272 273 274 275 276 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 271 def context unless @instance_context @instance_context = MediaRecordingContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
286 287 288 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 286 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated.
292 293 294 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 292 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the MediaRecordingInstance
371 372 373 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 371 def delete context.delete end |
#duration ⇒ String
Returns The duration of the MediaRecording.
298 299 300 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 298 def duration @properties['duration'] end |
#fetch ⇒ MediaRecordingInstance
Fetch the MediaRecordingInstance
378 379 380 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 378 def fetch context.fetch end |
#format ⇒ media_recording.Format
Returns The format of the MediaRecording.
304 305 306 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 304 def format @properties['format'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
391 392 393 394 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 391 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Media.V1.MediaRecordingInstance #{values}>" end |
#links ⇒ String
Returns The URLs of related resources.
310 311 312 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 310 def links @properties['links'] end |
#media_size ⇒ String
Returns The size of the recording media.
340 341 342 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 340 def media_size @properties['media_size'] end |
#processor_sid ⇒ String
Returns The SID of the MediaProcessor.
316 317 318 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 316 def processor_sid @properties['processor_sid'] end |
#resolution ⇒ String
Returns The dimensions of the video image in pixels.
322 323 324 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 322 def resolution @properties['resolution'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
334 335 336 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 334 def sid @properties['sid'] end |
#source_sid ⇒ String
Returns The SID of the resource that generated the original media.
328 329 330 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 328 def source_sid @properties['source_sid'] end |
#status ⇒ media_recording.Status
Returns The status of the MediaRecording.
346 347 348 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 346 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL to which Twilio will send MediaRecording event updates.
352 353 354 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 352 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method Twilio should use to call the ‘status_callback` URL.
358 359 360 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 358 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
384 385 386 387 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 384 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.
364 365 366 |
# File 'lib/twilio-ruby/rest/media/v1/media_recording.rb', line 364 def url @properties['url'] end |