Class: Telnyx::Resources::Whatsapp::PhoneNumbers
- Inherits:
-
Object
- Object
- Telnyx::Resources::Whatsapp::PhoneNumbers
- Defined in:
- lib/telnyx/resources/whatsapp/phone_numbers.rb,
lib/telnyx/resources/whatsapp/phone_numbers/profile.rb,
lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb,
lib/telnyx/resources/whatsapp/phone_numbers/calling_settings.rb
Overview
Manage Whatsapp phone numbers
Defined Under Namespace
Classes: CallingSettings, Profile
Instance Attribute Summary collapse
-
#calling_settings ⇒ Telnyx::Resources::Whatsapp::PhoneNumbers::CallingSettings
readonly
Manage Whatsapp phone numbers.
-
#profile ⇒ Telnyx::Resources::Whatsapp::PhoneNumbers::Profile
readonly
Manage Whatsapp phone numbers.
Instance Method Summary collapse
-
#delete(phone_number, request_options: {}) ⇒ nil
Delete a Whatsapp phone number.
-
#initialize(client:) ⇒ PhoneNumbers
constructor
private
A new instance of PhoneNumbers.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Whatsapp::PhoneNumberListResponse>
List Whatsapp phone numbers.
-
#resend_verification(phone_number, verification_method: nil, request_options: {}) ⇒ nil
Resend verification code.
-
#verify(phone_number, code:, request_options: {}) ⇒ nil
Submit verification code for a phone number.
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.
111 112 113 114 115 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 111 def initialize(client:) @client = client @calling_settings = Telnyx::Resources::Whatsapp::PhoneNumbers::CallingSettings.new(client: client) @profile = Telnyx::Resources::Whatsapp::PhoneNumbers::Profile.new(client: client) end |
Instance Attribute Details
#calling_settings ⇒ Telnyx::Resources::Whatsapp::PhoneNumbers::CallingSettings (readonly)
Manage Whatsapp phone numbers
10 11 12 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 10 def calling_settings @calling_settings end |
#profile ⇒ Telnyx::Resources::Whatsapp::PhoneNumbers::Profile (readonly)
Manage Whatsapp phone numbers
14 15 16 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 14 def profile @profile end |
Instance Method Details
#delete(phone_number, request_options: {}) ⇒ nil
Delete a Whatsapp phone number
51 52 53 54 55 56 57 58 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 51 def delete(phone_number, params = {}) @client.request( method: :delete, path: ["v2/whatsapp/phone_numbers/%1$s", phone_number], model: NilClass, options: params[:request_options] ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Whatsapp::PhoneNumberListResponse>
List Whatsapp phone numbers
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 27 def list(params = {}) parsed, = Telnyx::Whatsapp::PhoneNumberListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v2/whatsapp/phone_numbers", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::Whatsapp::PhoneNumberListResponse, options: ) end |
#resend_verification(phone_number, verification_method: nil, request_options: {}) ⇒ nil
Resend verification code
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 73 def resend_verification(phone_number, params = {}) parsed, = Telnyx::Whatsapp::PhoneNumberResendVerificationParams.dump_request(params) @client.request( method: :post, path: ["v2/whatsapp/phone_numbers/%1$s/resend_verification", phone_number], body: parsed, model: NilClass, options: ) end |
#verify(phone_number, code:, request_options: {}) ⇒ nil
Submit verification code for a phone number
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 97 def verify(phone_number, params) parsed, = Telnyx::Whatsapp::PhoneNumberVerifyParams.dump_request(params) @client.request( method: :post, path: ["v2/whatsapp/phone_numbers/%1$s/verify", phone_number], body: parsed, model: NilClass, options: ) end |