Class: Telnyx::Resources::WhatsappMessageTemplates

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/whatsapp_message_templates.rb,
sig/telnyx/resources/whatsapp_message_templates.rbs

Overview

Manage Whatsapp message templates

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ WhatsappMessageTemplates

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

Parameters:



77
78
79
# File 'lib/telnyx/resources/whatsapp_message_templates.rb', line 77

def initialize(client:)
  @client = client
end

Instance Method Details

#delete(id, request_options: {}) ⇒ nil

Deletes the specified WhatsApp message template.

Parameters:

  • id (String)

    Whatsapp message template ID

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

Returns:

  • (nil)

See Also:



65
66
67
68
69
70
71
72
# File 'lib/telnyx/resources/whatsapp_message_templates.rb', line 65

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["v2/whatsapp_message_templates/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::WhatsappMessageTemplateRetrieveResponse

Returns the content, components, language, and current review state of the specified WhatsApp message template.

Parameters:

  • id (String)

    Whatsapp message template ID

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

Returns:

See Also:



19
20
21
22
23
24
25
26
# File 'lib/telnyx/resources/whatsapp_message_templates.rb', line 19

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

#update(id, category: nil, components: nil, request_options: {}) ⇒ Telnyx::Models::WhatsappMessageTemplateUpdateResponse

Updates the editable fields of the specified WhatsApp message template.



43
44
45
46
47
48
49
50
51
52
# File 'lib/telnyx/resources/whatsapp_message_templates.rb', line 43

def update(id, params = {})
  parsed, options = Telnyx::WhatsappMessageTemplateUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v2/whatsapp_message_templates/%1$s", id],
    body: parsed,
    model: Telnyx::Models::WhatsappMessageTemplateUpdateResponse,
    options: options
  )
end