Class: Twilio::REST::Video::V1::RecordingInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Video::V1::RecordingInstance
- Defined in:
- lib/twilio-ruby/rest/video/v1/recording.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Twilio Account SID.
-
#codec ⇒ recording.Codec
The codec used to encode the track.
-
#container_format ⇒ recording.Format
The file format for this Recording.
-
#context ⇒ RecordingContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
Date when the media recording began writing.
-
#delete ⇒ Boolean
Deletes the RecordingInstance.
-
#duration ⇒ String
Duration of the Recording in seconds.
-
#fetch ⇒ RecordingInstance
Fetch a RecordingInstance.
-
#grouping_sids ⇒ Hash
A list of Sids related to this Recording.
-
#initialize(version, payload, sid: nil) ⇒ RecordingInstance
constructor
Initialize the RecordingInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#sid ⇒ String
A 34-character string that uniquely identifies this Recording.
-
#size ⇒ String
Size of the recorded track, in bytes.
-
#source_sid ⇒ String
A 34-character string that uniquely identifies the source of this Recording.
-
#status ⇒ recording.Status
The status of the Recording.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#track_name ⇒ String
The name that was given to the source track of this recording.
-
#type ⇒ recording.Type
Indicates the media type for this recording.
-
#url ⇒ String
The absolute URL for this resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ RecordingInstance
Initialize the RecordingInstance
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 244 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'status' => payload['status'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'sid' => payload['sid'], 'source_sid' => payload['source_sid'], 'size' => payload['size'].to_i, 'url' => payload['url'], 'type' => payload['type'], 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i, 'container_format' => payload['container_format'], 'codec' => payload['codec'], 'grouping_sids' => payload['grouping_sids'], 'track_name' => payload['track_name'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Twilio Account SID.
283 284 285 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 283 def account_sid @properties['account_sid'] end |
#codec ⇒ recording.Codec
Returns The codec used to encode the track.
343 344 345 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 343 def codec @properties['codec'] end |
#container_format ⇒ recording.Format
Returns The file format for this Recording.
337 338 339 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 337 def container_format @properties['container_format'] end |
#context ⇒ RecordingContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
274 275 276 277 278 279 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 274 def context unless @instance_context @instance_context = RecordingContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns Date when the media recording began writing.
295 296 297 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 295 def date_created @properties['date_created'] end |
#delete ⇒ Boolean
Deletes the RecordingInstance
375 376 377 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 375 def delete context.delete end |
#duration ⇒ String
Returns Duration of the Recording in seconds.
331 332 333 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 331 def duration @properties['duration'] end |
#fetch ⇒ RecordingInstance
Fetch a RecordingInstance
368 369 370 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 368 def fetch context.fetch end |
#grouping_sids ⇒ Hash
Returns A list of Sids related to this Recording.
349 350 351 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 349 def grouping_sids @properties['grouping_sids'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
388 389 390 391 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 388 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RecordingInstance #{values}>" end |
#links ⇒ String
Returns The links.
361 362 363 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 361 def links @properties['links'] end |
#sid ⇒ String
Returns A 34-character string that uniquely identifies this Recording.
301 302 303 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 301 def sid @properties['sid'] end |
#size ⇒ String
Returns Size of the recorded track, in bytes.
313 314 315 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 313 def size @properties['size'] end |
#source_sid ⇒ String
Returns A 34-character string that uniquely identifies the source of this Recording.
307 308 309 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 307 def source_sid @properties['source_sid'] end |
#status ⇒ recording.Status
Returns The status of the Recording.
289 290 291 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 289 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
381 382 383 384 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 381 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RecordingInstance #{values}>" end |
#track_name ⇒ String
Returns The name that was given to the source track of this recording.
355 356 357 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 355 def track_name @properties['track_name'] end |
#type ⇒ recording.Type
Returns Indicates the media type for this recording.
325 326 327 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 325 def type @properties['type'] end |
#url ⇒ String
Returns The absolute URL for this resource.
319 320 321 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 319 def url @properties['url'] end |