Class: Telnyx::Resources::Whatsapp::Templates
- Inherits:
-
Object
- Object
- Telnyx::Resources::Whatsapp::Templates
- Defined in:
- lib/telnyx/resources/whatsapp/templates.rb
Overview
Manage Whatsapp message templates
Instance Method Summary collapse
-
#create(category:, components:, language:, name:, waba_id:, request_options: {}) ⇒ Telnyx::Models::Whatsapp::TemplateCreateResponse
Some parameter documentations has been truncated, see Models::Whatsapp::TemplateCreateParams for more details.
-
#initialize(client:) ⇒ Templates
constructor
private
A new instance of Templates.
-
#list(filter_category: nil, filter_search: nil, filter_status: nil, filter_waba_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::WhatsappTemplateData>
List Whatsapp message templates.
Constructor Details
#initialize(client:) ⇒ Templates
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 Templates.
85 86 87 |
# File 'lib/telnyx/resources/whatsapp/templates.rb', line 85 def initialize(client:) @client = client end |
Instance Method Details
#create(category:, components:, language:, name:, waba_id:, request_options: {}) ⇒ Telnyx::Models::Whatsapp::TemplateCreateResponse
Some parameter documentations has been truncated, see Models::Whatsapp::TemplateCreateParams for more details.
Create a Whatsapp message template
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/telnyx/resources/whatsapp/templates.rb', line 30 def create(params) parsed, = Telnyx::Whatsapp::TemplateCreateParams.dump_request(params) @client.request( method: :post, path: "v2/whatsapp/message_templates", body: parsed, model: Telnyx::Models::Whatsapp::TemplateCreateResponse, options: ) end |
#list(filter_category: nil, filter_search: nil, filter_status: nil, filter_waba_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::WhatsappTemplateData>
List Whatsapp message templates
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/telnyx/resources/whatsapp/templates.rb', line 62 def list(params = {}) parsed, = Telnyx::Whatsapp::TemplateListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v2/whatsapp/message_templates", query: query.transform_keys( filter_category: "filter[category]", filter_search: "filter[search]", filter_status: "filter[status]", filter_waba_id: "filter[waba_id]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::WhatsappTemplateData, options: ) end |