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

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

Overview

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 [email protected]

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

  • sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this HostedNumberOrder.


379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 379

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'].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'].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 Account Sid.

Returns:

  • (String)

    Account Sid.


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

def 
  @properties['account_sid']
end

#address_sidString

Returns Address sid.

Returns:

  • (String)

    Address sid.


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

def address_sid
  @properties['address_sid']
end

#call_delayString

Returns Seconds (0-30) to delay ownership verification call by.

Returns:

  • (String)

    Seconds (0-30) to delay ownership verification call by.


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

def call_delay
  @properties['call_delay']
end

#capabilitiesString

Returns A mapping of phone number capabilities.

Returns:

  • (String)

    A mapping of phone number capabilities.


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

def capabilities
  @properties['capabilities']
end

#cc_emailsArray[String]

Returns A list of emails.

Returns:

  • (Array[String])

    A list of emails.


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

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:


418
419
420
421
422
423
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 418

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

#date_createdTime

Returns The date this HostedNumberOrder was created.

Returns:

  • (Time)

    The date this HostedNumberOrder was created.


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

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this HostedNumberOrder was updated.

Returns:

  • (Time)

    The date this HostedNumberOrder was updated.


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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the HostedNumberOrderInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


573
574
575
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 573

def delete
  context.delete
end

#emailString

Returns Email.

Returns:

  • (String)

    Email.


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

def email
  @properties['email']
end

#extensionString

Returns Phone extension to use for ownership verification call.

Returns:

  • (String)

    Phone extension to use for ownership verification call.


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

def extension
  @properties['extension']
end

#failure_reasonString

Returns Why a hosted_number_order reached status “action-required”.

Returns:

  • (String)

    Why a hosted_number_order reached status “action-required”


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

def failure_reason
  @properties['failure_reason']
end

#fetchHostedNumberOrderInstance

Fetch the HostedNumberOrderInstance

Returns:


566
567
568
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 566

def fetch
  context.fetch
end

#friendly_nameString

Returns A human readable description of this resource.

Returns:

  • (String)

    A human readable description of this resource.


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

def friendly_name
  @properties['friendly_name']
end

#incoming_phone_number_sidString

Returns IncomingPhoneNumber sid.

Returns:

  • (String)

    IncomingPhoneNumber sid.


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

def incoming_phone_number_sid
  @properties['incoming_phone_number_sid']
end

#inspectObject

Provide a detailed, user friendly representation


627
628
629
630
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 627

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

#phone_numberString

Returns An E164 formatted phone number.

Returns:

  • (String)

    An E164 formatted phone number.


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

def phone_number
  @properties['phone_number']
end

#sidString

Returns HostedNumberOrder sid.

Returns:

  • (String)

    HostedNumberOrder sid.


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

def sid
  @properties['sid']
end

#signing_document_sidString

Returns LOA document sid.

Returns:

  • (String)

    LOA document sid.


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

def signing_document_sid
  @properties['signing_document_sid']
end

#statushosted_number_order.Status

Returns The Status of this HostedNumberOrder.

Returns:

  • (hosted_number_order.Status)

    The Status of this HostedNumberOrder.


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

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation


620
621
622
623
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 620

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

#unique_nameString

Returns A unique, developer assigned name of this HostedNumberOrder.

Returns:

  • (String)

    A unique, developer assigned name of this HostedNumberOrder.


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

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 (hosted_number_order.Status) (defaults to: :unset)

    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.

  • 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 (hosted_number_order.VerificationType) (defaults to: :unset)

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

  • 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:


603
604
605
606
607
608
609
610
611
612
613
614
615
616
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 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)
  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.


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

def url
  @properties['url']
end

#verification_attemptsString

Returns The number of attempts made to verify ownership of the phone number.

Returns:

  • (String)

    The number of attempts made to verify ownership of the phone number.


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

def verification_attempts
  @properties['verification_attempts']
end

#verification_call_sidsArray[String]

Returns List of IDs for ownership verification calls.

Returns:

  • (Array[String])

    List of IDs for ownership verification calls.


559
560
561
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 559

def verification_call_sids
  @properties['verification_call_sids']
end

#verification_codeString

Returns The digits passed during the ownership verification call.

Returns:

  • (String)

    The digits passed during the ownership verification call.


553
554
555
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb', line 553

def verification_code
  @properties['verification_code']
end

#verification_document_sidString

Returns Verification Document Sid.

Returns:

  • (String)

    Verification Document Sid.


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

def verification_document_sid
  @properties['verification_document_sid']
end

#verification_typehosted_number_order.VerificationType

Returns The method used for verifying ownership of the number to be hosted.

Returns:

  • (hosted_number_order.VerificationType)

    The method used for verifying ownership of the number to be hosted.


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

def verification_type
  @properties['verification_type']
end