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,
lib/telnyx/resources/whatsapp/phone_numbers/conversational_components.rb,
sig/telnyx/resources/whatsapp/phone_numbers.rbs,
sig/telnyx/resources/whatsapp/phone_numbers/profile.rbs,
sig/telnyx/resources/whatsapp/phone_numbers/profile/photo.rbs,
sig/telnyx/resources/whatsapp/phone_numbers/calling_settings.rbs,
sig/telnyx/resources/whatsapp/phone_numbers/conversational_components.rbs
Overview
Manage Whatsapp phone numbers
Defined Under Namespace
Classes: CallingSettings, ConversationalComponents, Profile
Instance Attribute Summary collapse
-
#calling_settings ⇒ Telnyx::Resources::Whatsapp::PhoneNumbers::CallingSettings
readonly
Manage Whatsapp phone numbers.
-
#conversational_components ⇒ Telnyx::Resources::Whatsapp::PhoneNumbers::ConversationalComponents
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.
-
#retrieve_conversation_window(phone_number, destination_number:, request_options: {}) ⇒ Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse
Returns whether the 24-hour conversation window is currently open for a given source/destination pair.
-
#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.
142 143 144 145 146 147 148 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 142 def initialize(client:) @client = client @calling_settings = Telnyx::Resources::Whatsapp::PhoneNumbers::CallingSettings.new(client: client) @profile = Telnyx::Resources::Whatsapp::PhoneNumbers::Profile.new(client: client) @conversational_components = Telnyx::Resources::Whatsapp::PhoneNumbers::ConversationalComponents.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 |
#conversational_components ⇒ Telnyx::Resources::Whatsapp::PhoneNumbers::ConversationalComponents (readonly)
Manage Whatsapp phone numbers
18 19 20 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 18 def conversational_components @conversational_components 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
55 56 57 58 59 60 61 62 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 55 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
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 31 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
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 77 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 |
#retrieve_conversation_window(phone_number, destination_number:, request_options: {}) ⇒ Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse
Returns whether the 24-hour conversation window is currently open for a given source/destination pair. If window_active is false, only template messages may be sent.
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 103 def retrieve_conversation_window(phone_number, params) parsed, = Telnyx::Whatsapp::PhoneNumberRetrieveConversationWindowParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v2/whatsapp/phone_numbers/%1$s/conversation_window", phone_number], query: query, model: Telnyx::Models::Whatsapp::PhoneNumberRetrieveConversationWindowResponse, options: ) end |
#verify(phone_number, code:, request_options: {}) ⇒ nil
Submit verification code for a phone number
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers.rb', line 128 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 |