Class: Telnyx::Resources::Whatsapp::BusinessAccounts::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/whatsapp/business_accounts/settings.rb

Overview

Manage Whatsapp business accounts

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Settings

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

Parameters:



66
67
68
# File 'lib/telnyx/resources/whatsapp/business_accounts/settings.rb', line 66

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Whatsapp::BusinessAccounts::SettingRetrieveResponse

Get WABA settings

Parameters:

  • id (String)

    Whatsapp Business Account ID

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

Returns:

See Also:



20
21
22
23
24
25
26
27
# File 'lib/telnyx/resources/whatsapp/business_accounts/settings.rb', line 20

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["v2/whatsapp/business_accounts/%1$s/settings", id],
    model: Telnyx::Models::Whatsapp::BusinessAccounts::SettingRetrieveResponse,
    options: params[:request_options]
  )
end

#update(id, name: nil, timezone: nil, webhook_enabled: nil, webhook_events: nil, webhook_failover_url: nil, webhook_url: nil, request_options: {}) ⇒ Telnyx::Models::Whatsapp::BusinessAccounts::SettingUpdateResponse

Update WABA settings

Parameters:

  • id (String)

    Whatsapp Business Account ID

  • name (String)
  • timezone (String)

    IANA timezone identifier

  • webhook_enabled (Boolean)

    Enable/disable receiving Whatsapp events

  • webhook_events (Array<String>)
  • webhook_failover_url (String)

    Failover URL to send Whatsapp events

  • webhook_url (String)

    URL to send Whatsapp events

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

Returns:

See Also:



52
53
54
55
56
57
58
59
60
61
# File 'lib/telnyx/resources/whatsapp/business_accounts/settings.rb', line 52

def update(id, params = {})
  parsed, options = Telnyx::Whatsapp::BusinessAccounts::SettingUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v2/whatsapp/business_accounts/%1$s/settings", id],
    body: parsed,
    model: Telnyx::Models::Whatsapp::BusinessAccounts::SettingUpdateResponse,
    options: options
  )
end