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

  • sid (String) (defaults to: nil)

    The Account Sid that uniquely identifies the account to fetch


656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 656

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:


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

def addresses
  context.addresses
end

#applicationsapplications

Access the applications

Returns:


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

def applications
  context.applications
end

#auth_tokenString

Returns The authorization token for this account.

Returns:

  • (String)

    The authorization token for this account


691
692
693
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 691

def auth_token
  @properties['auth_token']
end

#authorized_connect_appsauthorized_connect_apps

Access the authorized_connect_apps

Returns:


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

def authorized_connect_apps
  context.authorized_connect_apps
end

#available_phone_numbersavailable_phone_numbers

Access the available_phone_numbers

Returns:


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

def available_phone_numbers
  context.available_phone_numbers
end

#balancebalance

Access the balance

Returns:


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

def balance
  context.balance
end

#callscalls

Access the calls

Returns:


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

def calls
  context.calls
end

#conferencesconferences

Access the conferences

Returns:


813
814
815
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 813

def conferences
  context.conferences
end

#connect_appsconnect_apps

Access the connect_apps

Returns:


820
821
822
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 820

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:


682
683
684
685
686
687
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 682

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

#date_createdTime

Returns The date this account was created.

Returns:

  • (Time)

    The date this account was created


697
698
699
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 697

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this account was last updated.

Returns:

  • (Time)

    The date this account was last updated


703
704
705
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 703

def date_updated
  @properties['date_updated']
end

#fetchAccountInstance

Fetch the AccountInstance

Returns:


752
753
754
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 752

def fetch
  context.fetch
end

#friendly_nameString

Returns A human readable description of this account.

Returns:

  • (String)

    A human readable description of this account


709
710
711
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 709

def friendly_name
  @properties['friendly_name']
end

#incoming_phone_numbersincoming_phone_numbers

Access the incoming_phone_numbers

Returns:


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

def incoming_phone_numbers
  context.incoming_phone_numbers
end

#inspectObject

Provide a detailed, user friendly representation


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

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

#keyskeys

Access the keys

Returns:


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

def keys
  context.keys
end

#messagesmessages

Access the messages

Returns:


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

def messages
  context.messages
end

#new_keysnew_keys

Access the new_keys

Returns:


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

def new_keys
  context.new_keys
end

#new_signing_keysnew_signing_keys

Access the new_signing_keys

Returns:


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

def new_signing_keys
  context.new_signing_keys
end

#notificationsnotifications

Access the notifications

Returns:


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

def notifications
  context.notifications
end

#outgoing_caller_idsoutgoing_caller_ids

Access the outgoing_caller_ids

Returns:


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

def outgoing_caller_ids
  context.outgoing_caller_ids
end

#owner_account_sidString

Returns The unique 34 character id representing the parent of this account.

Returns:

  • (String)

    The unique 34 character id representing the parent of this account


715
716
717
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 715

def 
  @properties['owner_account_sid']
end

#queuesqueues

Access the queues

Returns:


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

def queues
  context.queues
end

#recordingsrecordings

Access the recordings

Returns:


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

def recordings
  context.recordings
end

#short_codesshort_codes

Access the short_codes

Returns:


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

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.


721
722
723
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 721

def sid
  @properties['sid']
end

#signing_keyssigning_keys

Access the signing_keys

Returns:


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

def signing_keys
  context.signing_keys
end

#sipsip

Access the sip

Returns:

  • (sip)

    sip


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

def sip
  context.sip
end

#statusaccount.Status

Returns The status of this account.

Returns:

  • (account.Status)

    The status of this account


727
728
729
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 727

def status
  @properties['status']
end

#subresource_urisString

Returns Account Instance Subresources.

Returns:

  • (String)

    Account Instance Subresources


733
734
735
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 733

def subresource_uris
  @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation


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

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

#tokenstokens

Access the tokens

Returns:


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

def tokens
  context.tokens
end

#transcriptionstranscriptions

Access the transcriptions

Returns:


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

def transcriptions
  context.transcriptions
end

#typeaccount.Type

Returns The type of this account.

Returns:

  • (account.Type)

    The type of this account


739
740
741
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 739

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

    Alter the status of this account: use `closed` to irreversibly close this account, `suspended` to temporarily suspend it, or `active` to reactivate it.

Returns:


764
765
766
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 764

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`


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

def uri
  @properties['uri']
end

#usageusage

Access the usage

Returns:


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

def usage
  context.usage
end

#validation_requestsvalidation_requests

Access the validation_requests

Returns:


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

def validation_requests
  context.validation_requests
end