Class: Twilio::REST::Api::V2010::AccountInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the AccountInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 708

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'auth_token' => payload['auth_token'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'friendly_name' => payload['friendly_name'],
        'owner_account_sid' => payload['owner_account_sid'],
        'sid' => payload['sid'],
        'status' => payload['status'],
        'subresource_uris' => payload['subresource_uris'],
        'type' => payload['type'],
        'uri' => payload['uri'],
    }

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

Instance Method Details

#addressesaddresses

Access the addresses

Returns:



954
955
956
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 954

def addresses
    context.addresses
end

#applicationsapplications

Access the applications

Returns:



877
878
879
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 877

def applications
    context.applications
end

#auth_tokenString

Returns The authorization token for this account. This token should be kept a secret, so no sharing.

Returns:

  • (String)

    The authorization token for this account. This token should be kept a secret, so no sharing.



743
744
745
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 743

def auth_token
    @properties['auth_token']
end

#authorized_connect_appsauthorized_connect_apps

Access the authorized_connect_apps

Returns:



940
941
942
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 940

def authorized_connect_apps
    context.authorized_connect_apps
end

#available_phone_numbersavailable_phone_numbers

Access the available_phone_numbers

Returns:



947
948
949
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 947

def available_phone_numbers
    context.available_phone_numbers
end

#balancebalance

Access the balance

Returns:



856
857
858
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 856

def balance
    context.balance
end

#callscalls

Access the calls

Returns:



898
899
900
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 898

def calls
    context.calls
end

#conferencesconferences

Access the conferences

Returns:



968
969
970
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 968

def conferences
    context.conferences
end

#connect_appsconnect_apps

Access the connect_apps

Returns:



891
892
893
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 891

def connect_apps
    context.connect_apps
end

#contextAccountContext

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

Returns:



734
735
736
737
738
739
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 734

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

#date_createdTime

Returns The date that this account was created, in GMT in RFC 2822 format.

Returns:

  • (Time)

    The date that this account was created, in GMT in RFC 2822 format



749
750
751
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 749

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this account was last updated, in GMT in RFC 2822 format.

Returns:

  • (Time)

    The date that this account was last updated, in GMT in RFC 2822 format.



755
756
757
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 755

def date_updated
    @properties['date_updated']
end

#fetchAccountInstance

Fetch the AccountInstance

Returns:



804
805
806
807
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 804

def fetch

    context.fetch
end

#friendly_nameString

Returns A human readable description of this account, up to 64 characters long. By default the FriendlyName is your email address.

Returns:

  • (String)

    A human readable description of this account, up to 64 characters long. By default the FriendlyName is your email address.



761
762
763
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 761

def friendly_name
    @properties['friendly_name']
end

#incoming_phone_numbersincoming_phone_numbers

Access the incoming_phone_numbers

Returns:



926
927
928
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 926

def incoming_phone_numbers
    context.incoming_phone_numbers
end

#inspectObject

Provide a detailed, user friendly representation



1002
1003
1004
1005
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 1002

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

#keyskeys

Access the keys

Returns:



975
976
977
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 975

def keys
    context.keys
end

#messagesmessages

Access the messages

Returns:



989
990
991
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 989

def messages
    context.messages
end

#new_keysnew_keys

Access the new_keys

Returns:



835
836
837
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 835

def new_keys
    context.new_keys
end

#new_signing_keysnew_signing_keys

Access the new_signing_keys

Returns:



870
871
872
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 870

def new_signing_keys
    context.new_signing_keys
end

#notificationsnotifications

Access the notifications

Returns:



982
983
984
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 982

def notifications
    context.notifications
end

#outgoing_caller_idsoutgoing_caller_ids

Access the outgoing_caller_ids

Returns:



912
913
914
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 912

def outgoing_caller_ids
    context.outgoing_caller_ids
end

#owner_account_sidString

Returns The unique 34 character id that represents the parent of this account. The OwnerAccountSid of a parent account is it’s own sid.

Returns:

  • (String)

    The unique 34 character id that represents the parent of this account. The OwnerAccountSid of a parent account is it’s own sid.



767
768
769
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 767

def 
    @properties['owner_account_sid']
end

#queuesqueues

Access the queues

Returns:



933
934
935
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 933

def queues
    context.queues
end

#recordingsrecordings

Access the recordings

Returns:



884
885
886
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 884

def recordings
    context.recordings
end

#short_codesshort_codes

Access the short_codes

Returns:



919
920
921
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 919

def short_codes
    context.short_codes
end

#sidString

Returns A 34 character string that uniquely identifies this resource.

Returns:

  • (String)

    A 34 character string that uniquely identifies this resource.



773
774
775
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 773

def sid
    @properties['sid']
end

#signing_keyssigning_keys

Access the signing_keys

Returns:



905
906
907
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 905

def signing_keys
    context.signing_keys
end

#sipsip

Access the sip

Returns:

  • (sip)

    sip



863
864
865
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 863

def sip
    context.sip
end

#statusStatus

Returns:

  • (Status)


779
780
781
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 779

def status
    @properties['status']
end

#subresource_urisHash

Returns A Map of various subresources available for the given Account Instance.

Returns:

  • (Hash)

    A Map of various subresources available for the given Account Instance



785
786
787
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 785

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



995
996
997
998
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 995

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

#tokenstokens

Access the tokens

Returns:



849
850
851
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 849

def tokens
    context.tokens
end

#transcriptionstranscriptions

Access the transcriptions

Returns:



961
962
963
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 961

def transcriptions
    context.transcriptions
end

#typeType

Returns:

  • (Type)


791
792
793
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 791

def type
    @properties['type']
end

#update(friendly_name: :unset, status: :unset) ⇒ AccountInstance

Update the AccountInstance

Parameters:

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

    Update the human-readable description of this Account

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

Returns:



814
815
816
817
818
819
820
821
822
823
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 814

def update(
    friendly_name: :unset, 
    status: :unset
)

    context.update(
        friendly_name: friendly_name, 
        status: status, 
    )
end

#uriString

Returns The URI for this resource, relative to ‘api.twilio.com`.

Returns:

  • (String)

    The URI for this resource, relative to ‘api.twilio.com`



797
798
799
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 797

def uri
    @properties['uri']
end

#usageusage

Access the usage

Returns:



828
829
830
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 828

def usage
    context.usage
end

#validation_requestsvalidation_requests

Access the validation_requests

Returns:



842
843
844
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 842

def validation_requests
    context.validation_requests
end