Class: Twilio::REST::Fax::V1::FaxContext::FaxMediaInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Fax::V1::FaxContext::FaxMediaInstance
- Defined in:
- lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
Account SID.
-
#content_type ⇒ String
Media content type.
-
#context ⇒ FaxMediaContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this fax media was created.
-
#date_updated ⇒ Time
The date this fax media was updated.
-
#delete ⇒ Boolean
Deletes the FaxMediaInstance.
-
#fax_sid ⇒ String
Fax SID.
-
#fetch ⇒ FaxMediaInstance
Fetch a FaxMediaInstance.
-
#initialize(version, payload, fax_sid: nil, sid: nil) ⇒ FaxMediaInstance
constructor
Initialize the FaxMediaInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
A string that uniquely identifies this fax media.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, fax_sid: nil, sid: nil) ⇒ FaxMediaInstance
Initialize the FaxMediaInstance
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 230 def initialize(version, payload, fax_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'fax_sid' => payload['fax_sid'], 'content_type' => payload['content_type'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'fax_sid' => fax_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account SID.
275 276 277 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 275 def account_sid @properties['account_sid'] end |
#content_type ⇒ String
Returns Media content type.
287 288 289 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 287 def content_type @properties['content_type'] end |
#context ⇒ FaxMediaContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
256 257 258 259 260 261 262 263 264 265 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 256 def context unless @instance_context @instance_context = FaxMediaContext.new( @version, @params['fax_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this fax media was created.
293 294 295 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 293 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this fax media was updated.
299 300 301 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 299 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the FaxMediaInstance
319 320 321 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 319 def delete context.delete end |
#fax_sid ⇒ String
Returns Fax SID.
281 282 283 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 281 def fax_sid @properties['fax_sid'] end |
#fetch ⇒ FaxMediaInstance
Fetch a FaxMediaInstance
312 313 314 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 312 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
332 333 334 335 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 332 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Fax.V1.FaxMediaInstance #{values}>" end |
#sid ⇒ String
Returns A string that uniquely identifies this fax media.
269 270 271 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 269 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
325 326 327 328 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 325 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Fax.V1.FaxMediaInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
305 306 307 |
# File 'lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb', line 305 def url @properties['url'] end |