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
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Recording resource.
- #codec ⇒ Codec
- #container_format ⇒ Format
-
#context ⇒ RecordingContext
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.
-
#delete ⇒ Boolean
Delete the RecordingInstance.
-
#duration ⇒ String
The duration of the recording in seconds rounded to the nearest second.
-
#fetch ⇒ RecordingInstance
Fetch the RecordingInstance.
-
#grouping_sids ⇒ Hash
A list of SIDs related to the recording.
-
#initialize(version, payload, sid: nil) ⇒ RecordingInstance
constructor
Initialize the RecordingInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
-
#media_external_location ⇒ String
The URL of the media file associated with the recording when stored externally.
-
#offset ⇒ String
The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started.
-
#sid ⇒ String
The unique string that we created to identify the Recording resource.
-
#size ⇒ String
The size of the recorded track, in bytes.
-
#source_sid ⇒ String
The SID of the recording source.
- #status ⇒ Status
-
#status_callback ⇒ String
The URL called using the ‘status_callback_method` to send status information on every recording event.
-
#status_callback_method ⇒ String
The HTTP method used to call ‘status_callback`.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#track_name ⇒ String
The name that was given to the source track of the recording.
- #type ⇒ Type
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ RecordingInstance
Initialize the RecordingInstance
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 465 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'], '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'], 'offset' => payload['offset'], 'media_external_location' => payload['media_external_location'], 'status_callback' => payload['status_callback'], 'status_callback_method' => payload['status_callback_method'], 'links' => payload['links'], } # 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 Recording resource.
509 510 511 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 509 def account_sid @properties['account_sid'] end |
#codec ⇒ Codec
569 570 571 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 569 def codec @properties['codec'] end |
#container_format ⇒ Format
563 564 565 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 563 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
500 501 502 503 504 505 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 500 def context unless @instance_context @instance_context = RecordingContext.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.
521 522 523 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 521 def date_created @properties['date_created'] end |
#delete ⇒ Boolean
Delete the RecordingInstance
618 619 620 621 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 618 def delete context.delete end |
#duration ⇒ String
Returns The duration of the recording in seconds rounded to the nearest second. Sub-second tracks have a ‘Duration` property of 1 second.
557 558 559 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 557 def duration @properties['duration'] end |
#fetch ⇒ RecordingInstance
Fetch the RecordingInstance
626 627 628 629 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 626 def fetch context.fetch end |
#grouping_sids ⇒ Hash
Returns A list of SIDs related to the recording. Includes the ‘room_sid` and `participant_sid`.
575 576 577 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 575 def grouping_sids @properties['grouping_sids'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
640 641 642 643 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 640 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.RecordingInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
611 612 613 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 611 def links @properties['links'] end |
#media_external_location ⇒ String
Returns The URL of the media file associated with the recording when stored externally. See [External S3 Recordings](/docs/video/api/external-s3-recordings) for more details.
593 594 595 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 593 def media_external_location @properties['media_external_location'] end |
#offset ⇒ String
Returns The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started. This information provides a synchronization mechanism for recordings belonging to the same room.
587 588 589 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 587 def offset @properties['offset'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Recording resource.
527 528 529 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 527 def sid @properties['sid'] end |
#size ⇒ String
Returns The size of the recorded track, in bytes.
539 540 541 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 539 def size @properties['size'] end |
#source_sid ⇒ String
Returns The SID of the recording source. For a Room Recording, this value is a ‘track_sid`.
533 534 535 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 533 def source_sid @properties['source_sid'] end |
#status ⇒ Status
515 516 517 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 515 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL called using the ‘status_callback_method` to send status information on every recording event.
599 600 601 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 599 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method used to call ‘status_callback`. Can be: `POST` or `GET`, defaults to `POST`.
605 606 607 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 605 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
633 634 635 636 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 633 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 the recording. If no name is given, the ‘source_sid` is used.
581 582 583 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 581 def track_name @properties['track_name'] end |
#type ⇒ Type
551 552 553 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 551 def type @properties['type'] end |
#url ⇒ String
Returns The absolute URL of the resource.
545 546 547 |
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 545 def url @properties['url'] end |