class Twilio::REST::Preview::HostedNumbers::HostedNumberOrderInstance

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.

Public Class Methods

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

Initialize the HostedNumberOrderInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid A 34 character string that uniquely identifies this

HostedNumberOrder.

@return [HostedNumberOrderInstance] HostedNumberOrderInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
379 def initialize(version, payload, sid: nil)
380   super(version)
381 
382   # Marshaled Properties
383   @properties = {
384       'sid' => payload['sid'],
385       'account_sid' => payload['account_sid'],
386       'incoming_phone_number_sid' => payload['incoming_phone_number_sid'],
387       'address_sid' => payload['address_sid'],
388       'signing_document_sid' => payload['signing_document_sid'],
389       'phone_number' => payload['phone_number'],
390       'capabilities' => payload['capabilities'],
391       'friendly_name' => payload['friendly_name'],
392       'unique_name' => payload['unique_name'],
393       'status' => payload['status'],
394       'failure_reason' => payload['failure_reason'],
395       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
396       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
397       'verification_attempts' => payload['verification_attempts'].to_i,
398       'email' => payload['email'],
399       'cc_emails' => payload['cc_emails'],
400       'url' => payload['url'],
401       'verification_type' => payload['verification_type'],
402       'verification_document_sid' => payload['verification_document_sid'],
403       'extension' => payload['extension'],
404       'call_delay' => payload['call_delay'].to_i,
405       'verification_code' => payload['verification_code'],
406       'verification_call_sids' => payload['verification_call_sids'],
407   }
408 
409   # Context
410   @instance_context = nil
411   @params = {'sid' => sid || @properties['sid'], }
412 end

Public Instance Methods

account_sid() click to toggle source

@return [String] Account Sid.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
433 def account_sid
434   @properties['account_sid']
435 end
address_sid() click to toggle source

@return [String] Address sid.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
445 def address_sid
446   @properties['address_sid']
447 end
call_delay() click to toggle source

@return [String] Seconds (0-30) to delay ownership verification call by.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
547 def call_delay
548   @properties['call_delay']
549 end
capabilities() click to toggle source

@return [String] A mapping of phone number capabilities.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
463 def capabilities
464   @properties['capabilities']
465 end
cc_emails() click to toggle source

@return [Array] A list of emails.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
517 def cc_emails
518   @properties['cc_emails']
519 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 [HostedNumberOrderContext] HostedNumberOrderContext for this HostedNumberOrderInstance

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
418 def context
419   unless @instance_context
420     @instance_context = HostedNumberOrderContext.new(@version, @params['sid'], )
421   end
422   @instance_context
423 end
date_created() click to toggle source

@return [Time] The date this HostedNumberOrder was created.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
493 def date_created
494   @properties['date_created']
495 end
date_updated() click to toggle source

@return [Time] The date this HostedNumberOrder was updated.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
499 def date_updated
500   @properties['date_updated']
501 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
573 def delete
574   context.delete
575 end
email() click to toggle source

@return [String] Email.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
511 def email
512   @properties['email']
513 end
extension() click to toggle source

@return [String] Phone extension to use for ownership verification call.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
541 def extension
542   @properties['extension']
543 end
failure_reason() click to toggle source

@return [String] Why a hosted_number_order reached status “action-required”

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
487 def failure_reason
488   @properties['failure_reason']
489 end
fetch() click to toggle source

Fetch the HostedNumberOrderInstance @return [HostedNumberOrderInstance] Fetched HostedNumberOrderInstance

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
566 def fetch
567   context.fetch
568 end
friendly_name() click to toggle source

@return [String] A human readable description of this resource.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
469 def friendly_name
470   @properties['friendly_name']
471 end
incoming_phone_number_sid() click to toggle source

@return [String] IncomingPhoneNumber sid.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
439 def incoming_phone_number_sid
440   @properties['incoming_phone_number_sid']
441 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
627 def inspect
628   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
629   "<Twilio.Preview.HostedNumbers.HostedNumberOrderInstance #{values}>"
630 end
phone_number() click to toggle source

@return [String] An E164 formatted phone number.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
457 def phone_number
458   @properties['phone_number']
459 end
sid() click to toggle source

@return [String] HostedNumberOrder sid.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
427 def sid
428   @properties['sid']
429 end
signing_document_sid() click to toggle source

@return [String] LOA document sid.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
451 def signing_document_sid
452   @properties['signing_document_sid']
453 end
status() click to toggle source

@return [hosted_number_order.Status] The Status of this HostedNumberOrder.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
481 def status
482   @properties['status']
483 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
620 def to_s
621   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
622   "<Twilio.Preview.HostedNumbers.HostedNumberOrderInstance #{values}>"
623 end
unique_name() click to toggle source

@return [String] A unique, developer assigned name of this HostedNumberOrder.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
475 def unique_name
476   @properties['unique_name']
477 end
update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset, verification_type: :unset, verification_document_sid: :unset, extension: :unset, call_delay: :unset) click to toggle source

Update the HostedNumberOrderInstance @param [String] friendly_name A 64 character string that is a human readable

text that describes this resource.

@param [String] unique_name Provides a unique and addressable name to be

assigned to this HostedNumberOrder, assigned by the developer, to be optionally
used in addition to SID.

@param [String] email Email of the owner of this phone number that is being

hosted.

@param [Array] cc_emails Optional. A list of emails that LOA document

for this HostedNumberOrder will be carbon copied to.

@param [hosted_number_order.Status] status User can only post to

`pending-verification` status to transition the HostedNumberOrder to initiate a
verification call or verification of ownership with a copy of a phone bill.

@param [String] verification_code A verification code that is given to the user

via a phone call to the phone number that is being hosted.

@param [hosted_number_order.VerificationType] verification_type Optional. The

method used for verifying ownership of the number to be hosted. One of
phone-call (default) or phone-bill.

@param [String] verification_document_sid Optional. The unique sid identifier of

the Identity Document that represents the document for verifying ownership of
the number to be hosted. Required when VerificationType is phone-bill.

@param [String] extension Digits to dial after connecting the verification call. @param [String] call_delay The number of seconds, between 0 and 60, to delay

before initiating the verification call. Defaults to 0

@return [HostedNumberOrderInstance] Updated HostedNumberOrderInstance

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
603 def update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset, verification_type: :unset, verification_document_sid: :unset, extension: :unset, call_delay: :unset)
604   context.update(
605       friendly_name: friendly_name,
606       unique_name: unique_name,
607       email: email,
608       cc_emails: cc_emails,
609       status: status,
610       verification_code: verification_code,
611       verification_type: verification_type,
612       verification_document_sid: verification_document_sid,
613       extension: extension,
614       call_delay: call_delay,
615   )
616 end
url() click to toggle source

@return [String] The URL of this HostedNumberOrder.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
523 def url
524   @properties['url']
525 end
verification_attempts() click to toggle source

@return [String] The number of attempts made to verify ownership of the phone number.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
505 def verification_attempts
506   @properties['verification_attempts']
507 end
verification_call_sids() click to toggle source

@return [Array] List of IDs for ownership verification calls.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
559 def verification_call_sids
560   @properties['verification_call_sids']
561 end
verification_code() click to toggle source

@return [String] The digits passed during the ownership verification call.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
553 def verification_code
554   @properties['verification_code']
555 end
verification_document_sid() click to toggle source

@return [String] Verification Document Sid.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
535 def verification_document_sid
536   @properties['verification_document_sid']
537 end
verification_type() click to toggle source

@return [hosted_number_order.VerificationType] The method used for verifying ownership of the number to be hosted.

    # File lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb
529 def verification_type
530   @properties['verification_type']
531 end