Class: Twilio::REST::Preview::HostedNumbers::HostedNumberOrderInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ HostedNumberOrderInstance

Initialize the HostedNumberOrderInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this HostedNumberOrder resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 368

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'incoming_phone_number_sid' => payload['incoming_phone_number_sid'],
        'address_sid' => payload['address_sid'],
        'signing_document_sid' => payload['signing_document_sid'],
        'phone_number' => payload['phone_number'],
        'capabilities' => payload['capabilities'],
        'friendly_name' => payload['friendly_name'],
        'unique_name' => payload['unique_name'],
        'status' => payload['status'],
        'failure_reason' => payload['failure_reason'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'verification_attempts' => payload['verification_attempts'] == nil ? payload['verification_attempts'] : payload['verification_attempts'].to_i,
        'email' => payload['email'],
        'cc_emails' => payload['cc_emails'],
        'url' => payload['url'],
        'verification_type' => payload['verification_type'],
        'verification_document_sid' => payload['verification_document_sid'],
        'extension' => payload['extension'],
        'call_delay' => payload['call_delay'] == nil ? payload['call_delay'] : payload['call_delay'].to_i,
        'verification_code' => payload['verification_code'],
        'verification_call_sids' => payload['verification_call_sids'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns A 34 character string that uniquely identifies the account.

Returns:

  • (String)

    A 34 character string that uniquely identifies the account.



422
423
424
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 422

def 
    @properties['account_sid']
end

#address_sidString

Returns A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.

Returns:

  • (String)

    A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.



434
435
436
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 434

def address_sid
    @properties['address_sid']
end

#call_delayString

Returns A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call.

Returns:

  • (String)

    A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call.



536
537
538
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 536

def call_delay
    @properties['call_delay']
end

#capabilitiesPreviewHostedNumbersHostedNumberOrderCapabilities

Returns:

  • (PreviewHostedNumbersHostedNumberOrderCapabilities)


452
453
454
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 452

def capabilities
    @properties['capabilities']
end

#cc_emailsArray<String>

Returns A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.

Returns:

  • (Array<String>)

    A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.



506
507
508
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 506

def cc_emails
    @properties['cc_emails']
end

#contextHostedNumberOrderContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



407
408
409
410
411
412
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 407

def context
    unless @instance_context
        @instance_context = HostedNumberOrderContext.new(@version , @params['sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date this resource was created, given as [GMT RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



482
483
484
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 482

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this resource was updated, given as [GMT RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



488
489
490
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 488

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the HostedNumberOrderInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



555
556
557
558
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 555

def delete

    context.delete
end

#emailString

Returns Email of the owner of this phone number that is being hosted.

Returns:

  • (String)

    Email of the owner of this phone number that is being hosted.



500
501
502
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 500

def email
    @properties['email']
end

#extensionString

Returns A numerical extension to be used when making the ownership verification call.

Returns:

  • (String)

    A numerical extension to be used when making the ownership verification call.



530
531
532
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 530

def extension
    @properties['extension']
end

#failure_reasonString

Returns A message that explains why a hosted_number_order went to status "action-required".

Returns:

  • (String)

    A message that explains why a hosted_number_order went to status "action-required"



476
477
478
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 476

def failure_reason
    @properties['failure_reason']
end

#fetchHostedNumberOrderInstance

Fetch the HostedNumberOrderInstance

Returns:



563
564
565
566
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 563

def fetch

    context.fetch
end

#friendly_nameString

Returns A 64 character string that is a human-readable text that describes this resource.

Returns:

  • (String)

    A 64 character string that is a human-readable text that describes this resource.



458
459
460
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 458

def friendly_name
    @properties['friendly_name']
end

#incoming_phone_number_sidString

Returns A 34 character string that uniquely identifies the [IncomingPhoneNumber](www.twilio.com/docs/api/rest/incoming-phone-numbers) resource that represents the phone number being hosted.

Returns:



428
429
430
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 428

def incoming_phone_number_sid
    @properties['incoming_phone_number_sid']
end

#inspectObject

Provide a detailed, user friendly representation



617
618
619
620
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 617

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Preview.HostedNumbers.HostedNumberOrderInstance #{values}>"
end

#phone_numberString

Returns Phone number to be hosted. This must be in [E.164](en.wikipedia.org/wiki/E.164) format, e.g., +16175551212.

Returns:



446
447
448
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 446

def phone_number
    @properties['phone_number']
end

#sidString

Returns A 34 character string that uniquely identifies this HostedNumberOrder.

Returns:

  • (String)

    A 34 character string that uniquely identifies this HostedNumberOrder.



416
417
418
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 416

def sid
    @properties['sid']
end

#signing_document_sidString

Returns A 34 character string that uniquely identifies the [Authorization Document](www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents) the user needs to sign.

Returns:



440
441
442
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 440

def signing_document_sid
    @properties['signing_document_sid']
end

#statusStatus

Returns:

  • (Status)


470
471
472
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 470

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



610
611
612
613
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 610

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Preview.HostedNumbers.HostedNumberOrderInstance #{values}>"
end

#unique_nameString

Returns Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.

Returns:

  • (String)

    Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.



464
465
466
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 464

def unique_name
    @properties['unique_name']
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) ⇒ HostedNumberOrderInstance

Update the HostedNumberOrderInstance

Parameters:

  • friendly_name (String) (defaults to: :unset)

    A 64 character string that is a human readable text that describes this resource.

  • unique_name (String) (defaults to: :unset)

    Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.

  • email (String) (defaults to: :unset)

    Email of the owner of this phone number that is being hosted.

  • cc_emails (Array[String]) (defaults to: :unset)

    Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.

  • status (Status) (defaults to: :unset)
  • verification_code (String) (defaults to: :unset)

    A verification code that is given to the user via a phone call to the phone number that is being hosted.

  • verification_type (VerificationType) (defaults to: :unset)
  • verification_document_sid (String) (defaults to: :unset)

    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.

  • extension (String) (defaults to: :unset)

    Digits to dial after connecting the verification call.

  • call_delay (String) (defaults to: :unset)

    The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0.

Returns:



581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 581

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
)

    context.update(
        friendly_name: friendly_name, 
        unique_name: unique_name, 
        email: email, 
        cc_emails: cc_emails, 
        status: status, 
        verification_code: verification_code, 
        verification_type: verification_type, 
        verification_document_sid: verification_document_sid, 
        extension: extension, 
        call_delay: call_delay, 
    )
end

#urlString

Returns The URL of this HostedNumberOrder.

Returns:

  • (String)

    The URL of this HostedNumberOrder.



512
513
514
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 512

def url
    @properties['url']
end

#verification_attemptsString

Returns The number of attempts made to verify ownership of the phone number that is being hosted.

Returns:

  • (String)

    The number of attempts made to verify ownership of the phone number that is being hosted.



494
495
496
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 494

def verification_attempts
    @properties['verification_attempts']
end

#verification_call_sidsArray<String>

Returns A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification.

Returns:

  • (Array<String>)

    A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification.



548
549
550
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 548

def verification_call_sids
    @properties['verification_call_sids']
end

#verification_codeString

Returns A verification code provided in the response for a user to enter when they pick up the phone call.

Returns:

  • (String)

    A verification code provided in the response for a user to enter when they pick up the phone call.



542
543
544
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 542

def verification_code
    @properties['verification_code']
end

#verification_document_sidString

Returns A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted.

Returns:

  • (String)

    A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted.



524
525
526
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 524

def verification_document_sid
    @properties['verification_document_sid']
end

#verification_typeVerificationType

Returns:

  • (VerificationType)


518
519
520
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 518

def verification_type
    @properties['verification_type']
end