Class: Telnyx::Resources::Whatsapp::BusinessAccounts::PhoneNumbers
- Inherits:
-
Object
- Object
- Telnyx::Resources::Whatsapp::BusinessAccounts::PhoneNumbers
- Defined in:
- lib/telnyx/resources/whatsapp/business_accounts/phone_numbers.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ PhoneNumbers
constructor
private
A new instance of PhoneNumbers.
-
#initialize_verification(id, display_name:, phone_number:, language: nil, verification_method: nil, request_options: {}) ⇒ nil
Initialize Whatsapp phone number verification.
-
#list(id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Whatsapp::BusinessAccounts::PhoneNumberListResponse>
List phone numbers for a WABA.
Constructor Details
#initialize(client:) ⇒ PhoneNumbers
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 PhoneNumbers.
70 71 72 |
# File 'lib/telnyx/resources/whatsapp/business_accounts/phone_numbers.rb', line 70 def initialize(client:) @client = client end |
Instance Method Details
#initialize_verification(id, display_name:, phone_number:, language: nil, verification_method: nil, request_options: {}) ⇒ nil
Initialize Whatsapp phone number verification
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/telnyx/resources/whatsapp/business_accounts/phone_numbers.rb', line 55 def initialize_verification(id, params) parsed, = Telnyx::Whatsapp::BusinessAccounts::PhoneNumberInitializeVerificationParams.dump_request(params) @client.request( method: :post, path: ["v2/whatsapp/business_accounts/%1$s/phone_numbers", id], body: parsed, model: NilClass, options: ) end |
#list(id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Whatsapp::BusinessAccounts::PhoneNumberListResponse>
List phone numbers for a WABA
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/telnyx/resources/whatsapp/business_accounts/phone_numbers.rb', line 23 def list(id, params = {}) parsed, = Telnyx::Whatsapp::BusinessAccounts::PhoneNumberListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v2/whatsapp/business_accounts/%1$s/phone_numbers", id], query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::Whatsapp::BusinessAccounts::PhoneNumberListResponse, options: ) end |