Class: Twilio::REST::Api::V2010::AccountContext::MessageContext::MediaInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::MessageContext::MediaInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/message/media.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) associated with this Media resource.
-
#content_type ⇒ String
The default [MIME type](en.wikipedia.org/wiki/Internet_media_type) of the media, for example
image/jpeg,image/png, orimage/gif. -
#context ⇒ MediaContext
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 this Media resource was created, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT when this Media resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the MediaInstance.
-
#fetch ⇒ MediaInstance
Fetch the MediaInstance.
-
#initialize(version, payload, account_sid: nil, message_sid: nil, sid: nil) ⇒ MediaInstance
constructor
Initialize the MediaInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#parent_sid ⇒ String
The SID of the Message resource that is associated with this Media resource.
-
#sid ⇒ String
The unique string that identifies this Media resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#uri ⇒ String
The URI of this Media resource, relative to
https://api.twilio.com.
Constructor Details
#initialize(version, payload, account_sid: nil, message_sid: nil, sid: nil) ⇒ MediaInstance
Initialize the MediaInstance
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 440 def initialize(version, payload , account_sid: nil, message_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'content_type' => payload['content_type'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'parent_sid' => payload['parent_sid'], 'sid' => payload['sid'], 'uri' => payload['uri'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'message_sid' => || @properties['message_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) associated with this Media resource.
473 474 475 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 473 def account_sid @properties['account_sid'] end |
#content_type ⇒ String
Returns The default [MIME type](en.wikipedia.org/wiki/Internet_media_type) of the media, for example image/jpeg, image/png, or image/gif.
479 480 481 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 479 def content_type @properties['content_type'] end |
#context ⇒ MediaContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
464 465 466 467 468 469 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 464 def context unless @instance_context @instance_context = MediaContext.new(@version , @params['account_sid'], @params['message_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when this Media resource was created, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
485 486 487 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 485 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when this Media resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
491 492 493 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 491 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the MediaInstance
516 517 518 519 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 516 def delete context.delete end |
#fetch ⇒ MediaInstance
Fetch the MediaInstance
524 525 526 527 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 524 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
538 539 540 541 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 538 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.MediaInstance #{values}>" end |
#parent_sid ⇒ String
Returns The SID of the Message resource that is associated with this Media resource.
497 498 499 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 497 def parent_sid @properties['parent_sid'] end |
#sid ⇒ String
Returns The unique string that identifies this Media resource.
503 504 505 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 503 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
531 532 533 534 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 531 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.MediaInstance #{values}>" end |
#uri ⇒ String
Returns The URI of this Media resource, relative to https://api.twilio.com.
509 510 511 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 509 def uri @properties['uri'] end |