Class: Telnyx::Resources::Whatsapp::PhoneNumbers::Profile::Photo
- Inherits:
-
Object
- Object
- Telnyx::Resources::Whatsapp::PhoneNumbers::Profile::Photo
- Defined in:
- lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb
Overview
Manage Whatsapp phone numbers
Instance Method Summary collapse
-
#delete(phone_number, request_options: {}) ⇒ nil
Delete Whatsapp profile photo.
-
#initialize(client:) ⇒ Photo
constructor
private
A new instance of Photo.
-
#retrieve(phone_number, request_options: {}) ⇒ Telnyx::Models::Whatsapp::PhoneNumbers::Profile::PhotoRetrieveResponse
Get Whatsapp profile photo.
-
#upload(phone_number, file:, request_options: {}) ⇒ Telnyx::Models::Whatsapp::PhoneNumbers::Profile::PhotoUploadResponse
Upload Whatsapp profile photo.
Constructor Details
#initialize(client:) ⇒ Photo
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 Photo.
78 79 80 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb', line 78 def initialize(client:) @client = client end |
Instance Method Details
#delete(phone_number, request_options: {}) ⇒ nil
Delete Whatsapp profile photo
41 42 43 44 45 46 47 48 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb', line 41 def delete(phone_number, params = {}) @client.request( method: :delete, path: ["v2/whatsapp/phone_numbers/%1$s/profile/photo", phone_number], model: NilClass, options: params[:request_options] ) end |
#retrieve(phone_number, request_options: {}) ⇒ Telnyx::Models::Whatsapp::PhoneNumbers::Profile::PhotoRetrieveResponse
Get Whatsapp profile photo
21 22 23 24 25 26 27 28 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb', line 21 def retrieve(phone_number, params = {}) @client.request( method: :get, path: ["v2/whatsapp/phone_numbers/%1$s/profile/photo", phone_number], model: Telnyx::Models::Whatsapp::PhoneNumbers::Profile::PhotoRetrieveResponse, options: params[:request_options] ) end |
#upload(phone_number, file:, request_options: {}) ⇒ Telnyx::Models::Whatsapp::PhoneNumbers::Profile::PhotoUploadResponse
Upload Whatsapp profile photo
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb', line 63 def upload(phone_number, params) parsed, = Telnyx::Whatsapp::PhoneNumbers::Profile::PhotoUploadParams.dump_request(params) @client.request( method: :post, path: ["v2/whatsapp/phone_numbers/%1$s/profile/photo", phone_number], headers: {"content-type" => "multipart/form-data"}, body: parsed, model: Telnyx::Models::Whatsapp::PhoneNumbers::Profile::PhotoUploadResponse, options: ) end |