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 unique sid that identifies this account.
-
#content_type ⇒ String
The default mime-type of the media.
-
#context ⇒ MediaContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this resource was created.
-
#date_updated ⇒ Time
The date this resource was last updated.
-
#delete ⇒ Boolean
Deletes the MediaInstance.
-
#fetch ⇒ MediaInstance
Fetch a 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 unique id of the resource that created the media.
-
#sid ⇒ String
A string that uniquely identifies this media.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#uri ⇒ String
The URI for this resource.
Constructor Details
#initialize(version, payload, account_sid: nil, message_sid: nil, sid: nil) ⇒ MediaInstance
Initialize the MediaInstance
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 243 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' => , 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique sid that identifies this account.
284 285 286 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 284 def account_sid @properties['account_sid'] end |
#content_type ⇒ String
Returns The default mime-type of the media.
290 291 292 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 290 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
270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 270 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 this resource was created.
296 297 298 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 296 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this resource was last updated.
302 303 304 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 302 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the MediaInstance
327 328 329 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 327 def delete context.delete end |
#fetch ⇒ MediaInstance
Fetch a MediaInstance
334 335 336 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 334 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
347 348 349 350 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 347 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.MediaInstance #{values}>" end |
#parent_sid ⇒ String
Returns The unique id of the resource that created the media.
308 309 310 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 308 def parent_sid @properties['parent_sid'] end |
#sid ⇒ String
Returns A string that uniquely identifies this media.
314 315 316 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 314 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
340 341 342 343 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 340 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.MediaInstance #{values}>" end |
#uri ⇒ String
Returns The URI for this resource.
320 321 322 |
# File 'lib/twilio-ruby/rest/api/v2010/account/message/media.rb', line 320 def uri @properties['uri'] end |