Class: Telnyx::Resources::Whatsapp::PhoneNumbers::Profile

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/whatsapp/phone_numbers/profile.rb,
lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb

Overview

Manage Whatsapp phone numbers

Defined Under Namespace

Classes: Photo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Profile

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 Profile.

Parameters:



72
73
74
75
# File 'lib/telnyx/resources/whatsapp/phone_numbers/profile.rb', line 72

def initialize(client:)
  @client = client
  @photo = Telnyx::Resources::Whatsapp::PhoneNumbers::Profile::Photo.new(client: client)
end

Instance Attribute Details

#photoTelnyx::Resources::Whatsapp::PhoneNumbers::Profile::Photo (readonly)

Manage Whatsapp phone numbers



11
12
13
# File 'lib/telnyx/resources/whatsapp/phone_numbers/profile.rb', line 11

def photo
  @photo
end

Instance Method Details

#retrieve(phone_number, request_options: {}) ⇒ Telnyx::Models::Whatsapp::PhoneNumbers::ProfileRetrieveResponse

Get phone number business profile

Parameters:

  • phone_number (String)

    Phone number (E.164 format)

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



24
25
26
27
28
29
30
31
# File 'lib/telnyx/resources/whatsapp/phone_numbers/profile.rb', line 24

def retrieve(phone_number, params = {})
  @client.request(
    method: :get,
    path: ["v2/whatsapp/phone_numbers/%1$s/profile", phone_number],
    model: Telnyx::Models::Whatsapp::PhoneNumbers::ProfileRetrieveResponse,
    options: params[:request_options]
  )
end

#update(phone_number, about: nil, address: nil, category: nil, description: nil, display_name: nil, email: nil, website: nil, request_options: {}) ⇒ Telnyx::Models::Whatsapp::PhoneNumbers::ProfileUpdateResponse

Update phone number business profile

Parameters:

  • phone_number (String)

    Phone number (E.164 format)

  • about (String)
  • address (String)
  • category (String)
  • description (String)
  • display_name (String)
  • email (String)
  • website (String)
  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



58
59
60
61
62
63
64
65
66
67
# File 'lib/telnyx/resources/whatsapp/phone_numbers/profile.rb', line 58

def update(phone_number, params = {})
  parsed, options = Telnyx::Whatsapp::PhoneNumbers::ProfileUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v2/whatsapp/phone_numbers/%1$s/profile", phone_number],
    body: parsed,
    model: Telnyx::Models::Whatsapp::PhoneNumbers::ProfileUpdateResponse,
    options: options
  )
end