class Twilio::REST::Fax::V1::FaxInstance

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the FaxInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The Twilio-provided string that uniquely identifies the Fax

resource to fetch.

@return [FaxInstance] FaxInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/fax/v1/fax.rb
338 def initialize(version, payload, sid: nil)
339   super(version)
340 
341   # Marshaled Properties
342   @properties = {
343       'sid' => payload['sid'],
344       'account_sid' => payload['account_sid'],
345       'from' => payload['from'],
346       'to' => payload['to'],
347       'quality' => payload['quality'],
348       'media_sid' => payload['media_sid'],
349       'media_url' => payload['media_url'],
350       'num_pages' => payload['num_pages'] == nil ? payload['num_pages'] : payload['num_pages'].to_i,
351       'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
352       'status' => payload['status'],
353       'direction' => payload['direction'],
354       'api_version' => payload['api_version'],
355       'price' => payload['price'].to_f,
356       'price_unit' => payload['price_unit'],
357       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
358       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
359       'links' => payload['links'],
360       'url' => payload['url'],
361   }
362 
363   # Context
364   @instance_context = nil
365   @params = {'sid' => sid || @properties['sid'], }
366 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
387 def account_sid
388   @properties['account_sid']
389 end
api_version() click to toggle source

@return [String] The API version used to transmit the fax

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
447 def api_version
448   @properties['api_version']
449 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [FaxContext] FaxContext for this FaxInstance

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
372 def context
373   unless @instance_context
374     @instance_context = FaxContext.new(@version, @params['sid'], )
375   end
376   @instance_context
377 end
date_created() click to toggle source

@return [Time] The ISO 8601 formatted date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
465 def date_created
466   @properties['date_created']
467 end
date_updated() click to toggle source

@return [Time] The ISO 8601 formatted date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
471 def date_updated
472   @properties['date_updated']
473 end
delete() click to toggle source

Delete the FaxInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
508 def delete
509   context.delete
510 end
direction() click to toggle source

@return [fax.Direction] The direction of the fax

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
441 def direction
442   @properties['direction']
443 end
duration() click to toggle source

@return [String] The time it took to transmit the fax

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
429 def duration
430   @properties['duration']
431 end
fetch() click to toggle source

Fetch the FaxInstance @return [FaxInstance] Fetched FaxInstance

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
490 def fetch
491   context.fetch
492 end
from() click to toggle source

@return [String] The number the fax was sent from

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
393 def from
394   @properties['from']
395 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
528 def inspect
529   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
530   "<Twilio.Fax.V1.FaxInstance #{values}>"
531 end
media() click to toggle source

Access the media @return [media] media

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
515 def media
516   context.media
517 end
media_sid() click to toggle source

@return [String] The SID of the FaxMedia resource that is associated with the Fax

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
411 def media_sid
412   @properties['media_sid']
413 end
media_url() click to toggle source

@return [String] The Twilio-hosted URL that can be used to download fax media

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
417 def media_url
418   @properties['media_url']
419 end
num_pages() click to toggle source

@return [String] The number of pages contained in the fax document

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
423 def num_pages
424   @properties['num_pages']
425 end
price() click to toggle source

@return [String] The fax transmission price

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
453 def price
454   @properties['price']
455 end
price_unit() click to toggle source

@return [String] The ISO 4217 currency used for billing

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
459 def price_unit
460   @properties['price_unit']
461 end
quality() click to toggle source

@return [fax.Quality] The quality of the fax

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
405 def quality
406   @properties['quality']
407 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
381 def sid
382   @properties['sid']
383 end
status() click to toggle source

@return [fax.Status] The status of the fax

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
435 def status
436   @properties['status']
437 end
to() click to toggle source

@return [String] The phone number that received the fax

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
399 def to
400   @properties['to']
401 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
521 def to_s
522   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
523   "<Twilio.Fax.V1.FaxInstance #{values}>"
524 end
update(status: :unset) click to toggle source

Update the FaxInstance @param [fax.UpdateStatus] status The new

{status}[https://www.twilio.com/docs/fax/api/fax-resource#fax-status-values] of
the resource. Can be only `canceled`. This may fail if transmission has already
started.

@return [FaxInstance] Updated FaxInstance

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
501 def update(status: :unset)
502   context.update(status: status, )
503 end
url() click to toggle source

@return [String] The absolute URL of the fax resource

    # File lib/twilio-ruby/rest/fax/v1/fax.rb
483 def url
484   @properties['url']
485 end