Class: Twilio::REST::Preview::HostedNumbers::AuthorizationDocumentInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the AuthorizationDocumentInstance

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 AuthorizationDocument resource.

  • sid (String) (defaults to: nil) —

    The SID of the Call resource to fetch.



623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 623

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'address_sid' => payload['address_sid'],
        'status' => payload['status'],
        'email' => payload['email'],
        'cc_emails' => payload['cc_emails'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

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

Instance Method Details

#address_sid ⇒ String

Returns A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.

Returns:

  • (String) —

    A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.



664
665
666
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 664

def address_sid
    @properties['address_sid']
end

#cc_emails ⇒ Array<String>

Returns Email recipients who will be informed when an Authorization Document has been sent and signed.

Returns:

  • (Array<String>) —

    Email recipients who will be informed when an Authorization Document has been sent and signed.



682
683
684
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 682

def cc_emails
    @properties['cc_emails']
end

#context ⇒ AuthorizationDocumentContext

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

Returns:



649
650
651
652
653
654
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 649

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

#date_created ⇒ Time

Returns The date this resource was created, given as GMT RFC 2822 format.

Returns:

  • (Time) —

    The date this resource was created, given as GMT RFC 2822 format.



688
689
690
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 688

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date that this resource was updated, given as GMT RFC 2822 format.

Returns:

  • (Time) —

    The date that this resource was updated, given as GMT RFC 2822 format.



694
695
696
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 694

def date_updated
    @properties['date_updated']
end

#delete ⇒ Boolean

Delete the AuthorizationDocumentInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



713
714
715
716
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 713

def delete

    context.delete
end

#dependent_hosted_number_orders ⇒ dependent_hosted_number_orders

Access the dependent_hosted_number_orders

Returns:



760
761
762
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 760

def dependent_hosted_number_orders
    context.dependent_hosted_number_orders
end

#email ⇒ String

Returns Email that this AuthorizationDocument will be sent to for signing.

Returns:

  • (String) —

    Email that this AuthorizationDocument will be sent to for signing.



676
677
678
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 676

def email
    @properties['email']
end

#fetch ⇒ AuthorizationDocumentInstance

Fetch the AuthorizationDocumentInstance

Returns:



721
722
723
724
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 721

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



773
774
775
776
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 773

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

Returns:

  • (Hash)


706
707
708
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 706

def links
    @properties['links']
end

#sid ⇒ String

Returns A 34 character string that uniquely identifies this AuthorizationDocument.

Returns:

  • (String) —

    A 34 character string that uniquely identifies this AuthorizationDocument.



658
659
660
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 658

def sid
    @properties['sid']
end

#status ⇒ Status

Returns:

  • (Status)


670
671
672
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 670

def status
    @properties['status']
end

#to_s ⇒ Object

Provide a user friendly representation



766
767
768
769
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 766

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

#update(hosted_number_order_sids: :unset, address_sid: :unset, email: :unset, cc_emails: :unset, status: :unset, contact_title: :unset, contact_phone_number: :unset) ⇒ AuthorizationDocumentInstance

Update the AuthorizationDocumentInstance

Parameters:

  • hosted_number_order_sids (Array[String]) (defaults to: :unset) —

    A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform.

  • address_sid (String) (defaults to: :unset) —

    A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.

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

    Email that this AuthorizationDocument will be sent to for signing.

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

    Email recipients who will be informed when an Authorization Document has been sent and signed

  • status (Status) (defaults to: :unset)
  • contact_title (String) (defaults to: :unset) —

    The title of the person authorized to sign the Authorization Document for this phone number.

  • contact_phone_number (String) (defaults to: :unset) —

    The contact phone number of the person authorized to sign the Authorization Document.

Returns:



736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 736

def update(
  hosted_number_order_sids: :unset, 
  address_sid: :unset, 
  email: :unset, 
  cc_emails: :unset, 
  status: :unset, 
  contact_title: :unset, 
  contact_phone_number: :unset
)

    context.update(
        hosted_number_order_sids: hosted_number_order_sids, 
        address_sid: address_sid, 
        email: email, 
        cc_emails: cc_emails, 
        status: status, 
        contact_title: contact_title, 
        contact_phone_number: contact_phone_number, 
    )
end

#url ⇒ String

Returns:

  • (String)


700
701
702
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 700

def url
    @properties['url']
end