Class: Telnyx::Resources::Whatsapp::BusinessAccounts
- Inherits:
-
Object
- Object
- Telnyx::Resources::Whatsapp::BusinessAccounts
- Defined in:
- lib/telnyx/resources/whatsapp/business_accounts.rb,
lib/telnyx/resources/whatsapp/business_accounts/settings.rb,
lib/telnyx/resources/whatsapp/business_accounts/phone_numbers.rb
Overview
Manage Whatsapp business accounts
Defined Under Namespace
Classes: PhoneNumbers, Settings
Instance Attribute Summary collapse
- #phone_numbers ⇒ Telnyx::Resources::Whatsapp::BusinessAccounts::PhoneNumbers readonly
-
#settings ⇒ Telnyx::Resources::Whatsapp::BusinessAccounts::Settings
readonly
Manage Whatsapp business accounts.
Instance Method Summary collapse
-
#delete(id, request_options: {}) ⇒ nil
Delete a Whatsapp Business Account.
-
#initialize(client:) ⇒ BusinessAccounts
constructor
private
A new instance of BusinessAccounts.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Whatsapp::BusinessAccountListResponse>
List Whatsapp Business Accounts.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Whatsapp::BusinessAccountRetrieveResponse
Get a single Whatsapp Business Account.
Constructor Details
#initialize(client:) ⇒ BusinessAccounts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of BusinessAccounts.
82 83 84 85 86 |
# File 'lib/telnyx/resources/whatsapp/business_accounts.rb', line 82 def initialize(client:) @client = client @phone_numbers = Telnyx::Resources::Whatsapp::BusinessAccounts::PhoneNumbers.new(client: client) @settings = Telnyx::Resources::Whatsapp::BusinessAccounts::Settings.new(client: client) end |
Instance Attribute Details
#phone_numbers ⇒ Telnyx::Resources::Whatsapp::BusinessAccounts::PhoneNumbers (readonly)
9 10 11 |
# File 'lib/telnyx/resources/whatsapp/business_accounts.rb', line 9 def phone_numbers @phone_numbers end |
#settings ⇒ Telnyx::Resources::Whatsapp::BusinessAccounts::Settings (readonly)
Manage Whatsapp business accounts
13 14 15 |
# File 'lib/telnyx/resources/whatsapp/business_accounts.rb', line 13 def settings @settings end |
Instance Method Details
#delete(id, request_options: {}) ⇒ nil
Delete a Whatsapp Business Account
70 71 72 73 74 75 76 77 |
# File 'lib/telnyx/resources/whatsapp/business_accounts.rb', line 70 def delete(id, params = {}) @client.request( method: :delete, path: ["v2/whatsapp/business_accounts/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Whatsapp::BusinessAccountListResponse>
List Whatsapp Business Accounts
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/telnyx/resources/whatsapp/business_accounts.rb', line 46 def list(params = {}) parsed, = Telnyx::Whatsapp::BusinessAccountListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v2/whatsapp/business_accounts", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::Whatsapp::BusinessAccountListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Whatsapp::BusinessAccountRetrieveResponse
Get a single Whatsapp Business Account
26 27 28 29 30 31 32 33 |
# File 'lib/telnyx/resources/whatsapp/business_accounts.rb', line 26 def retrieve(id, params = {}) @client.request( method: :get, path: ["v2/whatsapp/business_accounts/%1$s", id], model: Telnyx::Models::Whatsapp::BusinessAccountRetrieveResponse, options: params[:request_options] ) end |