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
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
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
@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
@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
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
@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
@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 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
@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
@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 the FaxInstance
@return [FaxInstance] Fetched FaxInstance
# File lib/twilio-ruby/rest/fax/v1/fax.rb 490 def fetch 491 context.fetch 492 end
@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
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
@return [String] The URLs of the fax's related resources
# File lib/twilio-ruby/rest/fax/v1/fax.rb 477 def links 478 @properties['links'] 479 end
Access the media @return [media] media
# File lib/twilio-ruby/rest/fax/v1/fax.rb 515 def media 516 context.media 517 end
@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
@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
@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
@return [String] The fax transmission price
# File lib/twilio-ruby/rest/fax/v1/fax.rb 453 def price 454 @properties['price'] 455 end
@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
@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
@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
@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
@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
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 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
@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