Class: Twilio::REST::Fax::V1::FaxInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Fax::V1::FaxInstance
- Defined in:
- lib/twilio-ruby/rest/fax/v1/fax.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
The SID of the Account that created the resource.
-
#api_version ⇒ String
The API version used to transmit the fax.
-
#context ⇒ FaxContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 formatted date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 formatted date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Deletes the FaxInstance.
-
#direction ⇒ fax.Direction
The direction of the fax.
-
#duration ⇒ String
The time it took to transmit the fax.
-
#fetch ⇒ FaxInstance
Fetch a FaxInstance.
-
#from ⇒ String
The number the fax was sent from.
-
#initialize(version, payload, sid: nil) ⇒ FaxInstance
constructor
Initialize the FaxInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The URLs of the fax’s related resources.
-
#media ⇒ media
Access the media.
-
#media_sid ⇒ String
The SID of the FaxMedia resource that is associated with the Fax.
-
#media_url ⇒ String
The Twilio-hosted URL that can be used to download fax media.
-
#num_pages ⇒ String
The number of pages contained in the fax document.
-
#price ⇒ String
The fax transmission price.
-
#price_unit ⇒ String
The ISO 4217 currency used for billing.
-
#quality ⇒ fax.Quality
The quality of the fax.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#status ⇒ fax.Status
The status of the fax.
-
#to ⇒ String
The phone number that received the fax.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: :unset) ⇒ FaxInstance
Update the FaxInstance.
-
#url ⇒ String
The absolute URL of the fax resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ FaxInstance
Initialize the FaxInstance
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 350 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'from' => payload['from'], 'to' => payload['to'], 'quality' => payload['quality'], 'media_sid' => payload['media_sid'], 'media_url' => payload['media_url'], 'num_pages' => payload['num_pages'] == nil ? payload['num_pages'] : payload['num_pages'].to_i, 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i, 'status' => payload['status'], 'direction' => payload['direction'], 'api_version' => payload['api_version'], 'price' => payload['price'].to_f, 'price_unit' => payload['price_unit'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'links' => payload['links'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
399 400 401 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 399 def account_sid @properties['account_sid'] end |
#api_version ⇒ String
Returns The API version used to transmit the fax.
459 460 461 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 459 def api_version @properties['api_version'] end |
#context ⇒ FaxContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
384 385 386 387 388 389 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 384 def context unless @instance_context @instance_context = FaxContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 formatted date and time in GMT when the resource was created.
477 478 479 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 477 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 formatted date and time in GMT when the resource was last updated.
483 484 485 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 483 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the FaxInstance
518 519 520 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 518 def delete context.delete end |
#direction ⇒ fax.Direction
Returns The direction of the fax.
453 454 455 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 453 def direction @properties['direction'] end |
#duration ⇒ String
Returns The time it took to transmit the fax.
441 442 443 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 441 def duration @properties['duration'] end |
#fetch ⇒ FaxInstance
Fetch a FaxInstance
502 503 504 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 502 def fetch context.fetch end |
#from ⇒ String
Returns The number the fax was sent from.
405 406 407 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 405 def from @properties['from'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
538 539 540 541 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 538 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Fax.V1.FaxInstance #{values}>" end |
#links ⇒ String
Returns The URLs of the fax’s related resources.
489 490 491 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 489 def links @properties['links'] end |
#media ⇒ media
Access the media
525 526 527 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 525 def media context.media end |
#media_sid ⇒ String
Returns The SID of the FaxMedia resource that is associated with the Fax.
423 424 425 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 423 def media_sid @properties['media_sid'] end |
#media_url ⇒ String
Returns The Twilio-hosted URL that can be used to download fax media.
429 430 431 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 429 def media_url @properties['media_url'] end |
#num_pages ⇒ String
Returns The number of pages contained in the fax document.
435 436 437 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 435 def num_pages @properties['num_pages'] end |
#price ⇒ String
Returns The fax transmission price.
465 466 467 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 465 def price @properties['price'] end |
#price_unit ⇒ String
Returns The ISO 4217 currency used for billing.
471 472 473 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 471 def price_unit @properties['price_unit'] end |
#quality ⇒ fax.Quality
Returns The quality of the fax.
417 418 419 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 417 def quality @properties['quality'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
393 394 395 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 393 def sid @properties['sid'] end |
#status ⇒ fax.Status
Returns The status of the fax.
447 448 449 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 447 def status @properties['status'] end |
#to ⇒ String
Returns The phone number that received the fax.
411 412 413 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 411 def to @properties['to'] end |
#to_s ⇒ Object
Provide a user friendly representation
531 532 533 534 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 531 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Fax.V1.FaxInstance #{values}>" end |
#update(status: :unset) ⇒ FaxInstance
Update the FaxInstance
511 512 513 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 511 def update(status: :unset) context.update(status: status, ) end |
#url ⇒ String
Returns The absolute URL of the fax resource.
495 496 497 |
# File 'lib/twilio-ruby/rest/fax/v1/fax.rb', line 495 def url @properties['url'] end |