messente_api 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +24 -1
- data/docs/AccountBalanceApi.md +161 -0
- data/docs/NumberVerificationApi.md +195 -0
- data/docs/Price.md +24 -0
- data/docs/PriceNetworksInner.md +22 -0
- data/docs/PricingApi.md +167 -0
- data/docs/WhatsApp.md +13 -1
- data/docs/WhatsAppAudio.md +22 -0
- data/docs/WhatsAppDocument.md +26 -0
- data/docs/WhatsAppImage.md +24 -0
- data/docs/WhatsAppParameter.md +5 -1
- data/docs/WhatsAppSticker.md +24 -0
- data/docs/WhatsAppTemplate.md +1 -1
- data/docs/WhatsAppTemplatesApi.md +384 -0
- data/docs/WhatsAppText.md +20 -0
- data/docs/WhatsAppVideo.md +24 -0
- data/docs/WhatsappButtonType.md +15 -0
- data/docs/WhatsappComponentType.md +15 -0
- data/docs/WhatsappCreateTemplateRequest.md +24 -0
- data/docs/WhatsappCreateTemplateResponse.md +22 -0
- data/docs/WhatsappHeaderFormat.md +15 -0
- data/docs/WhatsappListTemplatesResponse.md +20 -0
- data/docs/WhatsappOtpButtonType.md +15 -0
- data/docs/WhatsappPagination.md +22 -0
- data/docs/WhatsappPagingCursors.md +20 -0
- data/docs/WhatsappSupportedApp.md +20 -0
- data/docs/WhatsappTemplateButton.md +30 -0
- data/docs/WhatsappTemplateCategory.md +15 -0
- data/docs/WhatsappTemplateComponent.md +26 -0
- data/docs/WhatsappTemplateExample.md +20 -0
- data/docs/WhatsappTemplateResponse.md +28 -0
- data/docs/WhatsappTemplateStatus.md +15 -0
- data/docs/WhatsappUpdateTemplateRequest.md +20 -0
- data/lib/messente_api/api/account_balance_api.rb +160 -0
- data/lib/messente_api/api/blacklist_api.rb +5 -5
- data/lib/messente_api/api/bulk_messaging_api.rb +2 -2
- data/lib/messente_api/api/contacts_api.rb +9 -9
- data/lib/messente_api/api/delivery_report_api.rb +2 -2
- data/lib/messente_api/api/groups_api.rb +6 -6
- data/lib/messente_api/api/number_lookup_api.rb +2 -2
- data/lib/messente_api/api/number_verification_api.rb +217 -0
- data/lib/messente_api/api/omnimessage_api.rb +3 -3
- data/lib/messente_api/api/pricing_api.rb +170 -0
- data/lib/messente_api/api/statistics_api.rb +2 -2
- data/lib/messente_api/api/whats_app_templates_api.rb +399 -0
- data/lib/messente_api/api_client.rb +1 -1
- data/lib/messente_api/api_error.rb +1 -1
- data/lib/messente_api/configuration.rb +61 -1
- data/lib/messente_api/models/bulk_omni_message_create_success_response.rb +1 -1
- data/lib/messente_api/models/bulk_omni_message_create_success_response_messages_inner.rb +1 -1
- data/lib/messente_api/models/bulk_omnimessage.rb +1 -1
- data/lib/messente_api/models/channel.rb +1 -1
- data/lib/messente_api/models/contact_envelope.rb +1 -1
- data/lib/messente_api/models/contact_fields.rb +1 -1
- data/lib/messente_api/models/contact_list_envelope.rb +1 -1
- data/lib/messente_api/models/contact_response_fields.rb +1 -1
- data/lib/messente_api/models/contact_update_fields.rb +1 -1
- data/lib/messente_api/models/delivery_report_response.rb +1 -1
- data/lib/messente_api/models/delivery_result.rb +1 -1
- data/lib/messente_api/models/error_code_omnichannel.rb +1 -1
- data/lib/messente_api/models/error_code_omnichannel_machine.rb +1 -1
- data/lib/messente_api/models/error_code_phonebook.rb +1 -1
- data/lib/messente_api/models/error_code_statistics.rb +1 -1
- data/lib/messente_api/models/error_item_number_lookup.rb +1 -1
- data/lib/messente_api/models/error_item_number_lookup_error.rb +1 -1
- data/lib/messente_api/models/error_item_omnichannel.rb +1 -1
- data/lib/messente_api/models/error_item_phonebook.rb +1 -1
- data/lib/messente_api/models/error_item_statistics.rb +1 -1
- data/lib/messente_api/models/error_number_lookup.rb +1 -1
- data/lib/messente_api/models/error_omnichannel.rb +1 -1
- data/lib/messente_api/models/error_phonebook.rb +1 -1
- data/lib/messente_api/models/error_statistics.rb +1 -1
- data/lib/messente_api/models/error_title_omnichannel.rb +1 -1
- data/lib/messente_api/models/error_title_phonebook.rb +1 -1
- data/lib/messente_api/models/fetch_blacklist_success.rb +1 -1
- data/lib/messente_api/models/group_envelope.rb +1 -1
- data/lib/messente_api/models/group_list_envelope.rb +1 -1
- data/lib/messente_api/models/group_name.rb +1 -1
- data/lib/messente_api/models/group_response_fields.rb +1 -1
- data/lib/messente_api/models/message_result.rb +1 -1
- data/lib/messente_api/models/mobile_network.rb +1 -1
- data/lib/messente_api/models/number_to_blacklist.rb +1 -1
- data/lib/messente_api/models/numbers_to_investigate.rb +1 -1
- data/lib/messente_api/models/omni_message_create_success_response.rb +1 -1
- data/lib/messente_api/models/omnimessage.rb +1 -1
- data/lib/messente_api/models/omnimessage_messages_inner.rb +1 -1
- data/lib/messente_api/models/price.rb +276 -0
- data/lib/messente_api/models/price_info.rb +1 -1
- data/lib/messente_api/models/price_networks_inner.rb +257 -0
- data/lib/messente_api/models/priority.rb +1 -1
- data/lib/messente_api/models/sms.rb +1 -1
- data/lib/messente_api/models/statistics_report.rb +1 -1
- data/lib/messente_api/models/statistics_report_settings.rb +1 -1
- data/lib/messente_api/models/statistics_report_success.rb +1 -1
- data/lib/messente_api/models/status.rb +1 -1
- data/lib/messente_api/models/sync_number_lookup_result.rb +1 -1
- data/lib/messente_api/models/sync_number_lookup_success.rb +1 -1
- data/lib/messente_api/models/telegram.rb +1 -1
- data/lib/messente_api/models/text_store.rb +1 -1
- data/lib/messente_api/models/viber.rb +1 -1
- data/lib/messente_api/models/viber_video.rb +1 -1
- data/lib/messente_api/models/whats_app.rb +59 -5
- data/lib/messente_api/models/whats_app_audio.rb +239 -0
- data/lib/messente_api/models/whats_app_component.rb +2 -1
- data/lib/messente_api/models/whats_app_currency.rb +1 -1
- data/lib/messente_api/models/whats_app_datetime.rb +1 -1
- data/lib/messente_api/models/whats_app_document.rb +261 -0
- data/lib/messente_api/models/whats_app_image.rb +250 -0
- data/lib/messente_api/models/whats_app_language.rb +1 -1
- data/lib/messente_api/models/whats_app_media.rb +1 -1
- data/lib/messente_api/models/whats_app_parameter.rb +25 -5
- data/lib/messente_api/models/whats_app_sticker.rb +250 -0
- data/lib/messente_api/models/whats_app_template.rb +8 -1
- data/lib/messente_api/models/whats_app_text.rb +235 -0
- data/lib/messente_api/models/whats_app_video.rb +250 -0
- data/lib/messente_api/models/whatsapp_button_type.rb +45 -0
- data/lib/messente_api/models/whatsapp_component_type.rb +42 -0
- data/lib/messente_api/models/whatsapp_create_template_request.rb +297 -0
- data/lib/messente_api/models/whatsapp_create_template_response.rb +277 -0
- data/lib/messente_api/models/whatsapp_header_format.rb +39 -0
- data/lib/messente_api/models/whatsapp_list_templates_response.rb +241 -0
- data/lib/messente_api/models/whatsapp_otp_button_type.rb +41 -0
- data/lib/messente_api/models/whatsapp_pagination.rb +242 -0
- data/lib/messente_api/models/whatsapp_paging_cursors.rb +226 -0
- data/lib/messente_api/models/whatsapp_supported_app.rb +240 -0
- data/lib/messente_api/models/whatsapp_template_button.rb +355 -0
- data/lib/messente_api/models/whatsapp_template_category.rb +41 -0
- data/lib/messente_api/models/whatsapp_template_component.rb +277 -0
- data/lib/messente_api/models/whatsapp_template_example.rb +230 -0
- data/lib/messente_api/models/whatsapp_template_response.rb +330 -0
- data/lib/messente_api/models/whatsapp_template_status.rb +47 -0
- data/lib/messente_api/models/whatsapp_update_template_request.rb +227 -0
- data/lib/messente_api/version.rb +2 -2
- data/lib/messente_api.rb +30 -1
- data/messente_api.gemspec +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +60 -2
@@ -0,0 +1,399 @@
|
|
1
|
+
=begin
|
2
|
+
#Messente API
|
3
|
+
|
4
|
+
#[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
7
|
+
Contact: messente@messente.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.11.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module MessenteApi
|
16
|
+
class WhatsAppTemplatesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Creates a WhatsApp template
|
23
|
+
# @param waba_id [String] The ID of the WABA
|
24
|
+
# @param whatsapp_create_template_request [WhatsappCreateTemplateRequest] The WhatsApp template to create
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [WhatsappCreateTemplateResponse]
|
27
|
+
def create_whatsapp_template(waba_id, whatsapp_create_template_request, opts = {})
|
28
|
+
data, _status_code, _headers = create_whatsapp_template_with_http_info(waba_id, whatsapp_create_template_request, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Creates a WhatsApp template
|
33
|
+
# @param waba_id [String] The ID of the WABA
|
34
|
+
# @param whatsapp_create_template_request [WhatsappCreateTemplateRequest] The WhatsApp template to create
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(WhatsappCreateTemplateResponse, Integer, Hash)>] WhatsappCreateTemplateResponse data, response status code and response headers
|
37
|
+
def create_whatsapp_template_with_http_info(waba_id, whatsapp_create_template_request, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppTemplatesApi.create_whatsapp_template ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'waba_id' is set
|
42
|
+
if @api_client.config.client_side_validation && waba_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'waba_id' when calling WhatsAppTemplatesApi.create_whatsapp_template"
|
44
|
+
end
|
45
|
+
# verify the required parameter 'whatsapp_create_template_request' is set
|
46
|
+
if @api_client.config.client_side_validation && whatsapp_create_template_request.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'whatsapp_create_template_request' when calling WhatsAppTemplatesApi.create_whatsapp_template"
|
48
|
+
end
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/whatsapp/wabas/{wabaId}/templates'.sub('{' + 'wabaId' + '}', CGI.escape(waba_id.to_s))
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
|
55
|
+
# header parameters
|
56
|
+
header_params = opts[:header_params] || {}
|
57
|
+
# HTTP header 'Accept' (if needed)
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
59
|
+
# HTTP header 'Content-Type'
|
60
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
61
|
+
if !content_type.nil?
|
62
|
+
header_params['Content-Type'] = content_type
|
63
|
+
end
|
64
|
+
|
65
|
+
# form parameters
|
66
|
+
form_params = opts[:form_params] || {}
|
67
|
+
|
68
|
+
# http body (model)
|
69
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(whatsapp_create_template_request)
|
70
|
+
|
71
|
+
# return_type
|
72
|
+
return_type = opts[:debug_return_type] || 'WhatsappCreateTemplateResponse'
|
73
|
+
|
74
|
+
# auth_names
|
75
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
76
|
+
|
77
|
+
new_options = opts.merge(
|
78
|
+
:operation => :"WhatsAppTemplatesApi.create_whatsapp_template",
|
79
|
+
:header_params => header_params,
|
80
|
+
:query_params => query_params,
|
81
|
+
:form_params => form_params,
|
82
|
+
:body => post_body,
|
83
|
+
:auth_names => auth_names,
|
84
|
+
:return_type => return_type
|
85
|
+
)
|
86
|
+
|
87
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
88
|
+
if @api_client.config.debugging
|
89
|
+
@api_client.config.logger.debug "API called: WhatsAppTemplatesApi#create_whatsapp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
90
|
+
end
|
91
|
+
return data, status_code, headers
|
92
|
+
end
|
93
|
+
|
94
|
+
# Deletes a WhatsApp template
|
95
|
+
# @param waba_id [String] The ID of the WABA
|
96
|
+
# @param name [String] The name of the template to delete
|
97
|
+
# @param [Hash] opts the optional parameters
|
98
|
+
# @option opts [String] :hsm_id The ID of the template to delete
|
99
|
+
# @return [Object]
|
100
|
+
def delete_whatsapp_template(waba_id, name, opts = {})
|
101
|
+
data, _status_code, _headers = delete_whatsapp_template_with_http_info(waba_id, name, opts)
|
102
|
+
data
|
103
|
+
end
|
104
|
+
|
105
|
+
# Deletes a WhatsApp template
|
106
|
+
# @param waba_id [String] The ID of the WABA
|
107
|
+
# @param name [String] The name of the template to delete
|
108
|
+
# @param [Hash] opts the optional parameters
|
109
|
+
# @option opts [String] :hsm_id The ID of the template to delete
|
110
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
111
|
+
def delete_whatsapp_template_with_http_info(waba_id, name, opts = {})
|
112
|
+
if @api_client.config.debugging
|
113
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppTemplatesApi.delete_whatsapp_template ...'
|
114
|
+
end
|
115
|
+
# verify the required parameter 'waba_id' is set
|
116
|
+
if @api_client.config.client_side_validation && waba_id.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'waba_id' when calling WhatsAppTemplatesApi.delete_whatsapp_template"
|
118
|
+
end
|
119
|
+
# verify the required parameter 'name' is set
|
120
|
+
if @api_client.config.client_side_validation && name.nil?
|
121
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling WhatsAppTemplatesApi.delete_whatsapp_template"
|
122
|
+
end
|
123
|
+
# resource path
|
124
|
+
local_var_path = '/whatsapp/wabas/{wabaId}/templates'.sub('{' + 'wabaId' + '}', CGI.escape(waba_id.to_s))
|
125
|
+
|
126
|
+
# query parameters
|
127
|
+
query_params = opts[:query_params] || {}
|
128
|
+
query_params[:'name'] = name
|
129
|
+
query_params[:'hsmId'] = opts[:'hsm_id'] if !opts[:'hsm_id'].nil?
|
130
|
+
|
131
|
+
# header parameters
|
132
|
+
header_params = opts[:header_params] || {}
|
133
|
+
# HTTP header 'Accept' (if needed)
|
134
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
135
|
+
|
136
|
+
# form parameters
|
137
|
+
form_params = opts[:form_params] || {}
|
138
|
+
|
139
|
+
# http body (model)
|
140
|
+
post_body = opts[:debug_body]
|
141
|
+
|
142
|
+
# return_type
|
143
|
+
return_type = opts[:debug_return_type] || 'Object'
|
144
|
+
|
145
|
+
# auth_names
|
146
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
147
|
+
|
148
|
+
new_options = opts.merge(
|
149
|
+
:operation => :"WhatsAppTemplatesApi.delete_whatsapp_template",
|
150
|
+
:header_params => header_params,
|
151
|
+
:query_params => query_params,
|
152
|
+
:form_params => form_params,
|
153
|
+
:body => post_body,
|
154
|
+
:auth_names => auth_names,
|
155
|
+
:return_type => return_type
|
156
|
+
)
|
157
|
+
|
158
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
159
|
+
if @api_client.config.debugging
|
160
|
+
@api_client.config.logger.debug "API called: WhatsAppTemplatesApi#delete_whatsapp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
161
|
+
end
|
162
|
+
return data, status_code, headers
|
163
|
+
end
|
164
|
+
|
165
|
+
# Requests a WhatsApp template with the given ID
|
166
|
+
# @param waba_id [String] The ID of the WABA
|
167
|
+
# @param template_id [String] The ID of the template to retrieve
|
168
|
+
# @param [Hash] opts the optional parameters
|
169
|
+
# @return [WhatsappTemplateResponse]
|
170
|
+
def get_whatsapp_template_by_id(waba_id, template_id, opts = {})
|
171
|
+
data, _status_code, _headers = get_whatsapp_template_by_id_with_http_info(waba_id, template_id, opts)
|
172
|
+
data
|
173
|
+
end
|
174
|
+
|
175
|
+
# Requests a WhatsApp template with the given ID
|
176
|
+
# @param waba_id [String] The ID of the WABA
|
177
|
+
# @param template_id [String] The ID of the template to retrieve
|
178
|
+
# @param [Hash] opts the optional parameters
|
179
|
+
# @return [Array<(WhatsappTemplateResponse, Integer, Hash)>] WhatsappTemplateResponse data, response status code and response headers
|
180
|
+
def get_whatsapp_template_by_id_with_http_info(waba_id, template_id, opts = {})
|
181
|
+
if @api_client.config.debugging
|
182
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppTemplatesApi.get_whatsapp_template_by_id ...'
|
183
|
+
end
|
184
|
+
# verify the required parameter 'waba_id' is set
|
185
|
+
if @api_client.config.client_side_validation && waba_id.nil?
|
186
|
+
fail ArgumentError, "Missing the required parameter 'waba_id' when calling WhatsAppTemplatesApi.get_whatsapp_template_by_id"
|
187
|
+
end
|
188
|
+
# verify the required parameter 'template_id' is set
|
189
|
+
if @api_client.config.client_side_validation && template_id.nil?
|
190
|
+
fail ArgumentError, "Missing the required parameter 'template_id' when calling WhatsAppTemplatesApi.get_whatsapp_template_by_id"
|
191
|
+
end
|
192
|
+
# resource path
|
193
|
+
local_var_path = '/whatsapp/wabas/{wabaId}/templates/{templateId}'.sub('{' + 'wabaId' + '}', CGI.escape(waba_id.to_s)).sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
|
194
|
+
|
195
|
+
# query parameters
|
196
|
+
query_params = opts[:query_params] || {}
|
197
|
+
|
198
|
+
# header parameters
|
199
|
+
header_params = opts[:header_params] || {}
|
200
|
+
# HTTP header 'Accept' (if needed)
|
201
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
202
|
+
|
203
|
+
# form parameters
|
204
|
+
form_params = opts[:form_params] || {}
|
205
|
+
|
206
|
+
# http body (model)
|
207
|
+
post_body = opts[:debug_body]
|
208
|
+
|
209
|
+
# return_type
|
210
|
+
return_type = opts[:debug_return_type] || 'WhatsappTemplateResponse'
|
211
|
+
|
212
|
+
# auth_names
|
213
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
214
|
+
|
215
|
+
new_options = opts.merge(
|
216
|
+
:operation => :"WhatsAppTemplatesApi.get_whatsapp_template_by_id",
|
217
|
+
:header_params => header_params,
|
218
|
+
:query_params => query_params,
|
219
|
+
:form_params => form_params,
|
220
|
+
:body => post_body,
|
221
|
+
:auth_names => auth_names,
|
222
|
+
:return_type => return_type
|
223
|
+
)
|
224
|
+
|
225
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
226
|
+
if @api_client.config.debugging
|
227
|
+
@api_client.config.logger.debug "API called: WhatsAppTemplatesApi#get_whatsapp_template_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
228
|
+
end
|
229
|
+
return data, status_code, headers
|
230
|
+
end
|
231
|
+
|
232
|
+
# Requests a list of WhatsApp templates
|
233
|
+
# @param waba_id [String] The ID of the WABA
|
234
|
+
# @param [Hash] opts the optional parameters
|
235
|
+
# @option opts [Integer] :limit The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25. (default to 25)
|
236
|
+
# @option opts [String] :before A cursor point used for a paginated request to indicate the template to paginate backwards from.
|
237
|
+
# @option opts [String] :after A cursor point used for a paginated request to indicate the template to paginate forwards from.
|
238
|
+
# @option opts [WhatsappTemplateCategory] :category A filter for returning only templates matching a specific category.
|
239
|
+
# @option opts [String] :content A search filter representing the content of a template. Only matching templates will be returned in the list.
|
240
|
+
# @option opts [String] :language A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/)
|
241
|
+
# @option opts [String] :name A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list.
|
242
|
+
# @option opts [WhatsappTemplateStatus] :status A filter for returning only templates matching a specific status.
|
243
|
+
# @return [WhatsappListTemplatesResponse]
|
244
|
+
def list_whatsapp_templates(waba_id, opts = {})
|
245
|
+
data, _status_code, _headers = list_whatsapp_templates_with_http_info(waba_id, opts)
|
246
|
+
data
|
247
|
+
end
|
248
|
+
|
249
|
+
# Requests a list of WhatsApp templates
|
250
|
+
# @param waba_id [String] The ID of the WABA
|
251
|
+
# @param [Hash] opts the optional parameters
|
252
|
+
# @option opts [Integer] :limit The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25. (default to 25)
|
253
|
+
# @option opts [String] :before A cursor point used for a paginated request to indicate the template to paginate backwards from.
|
254
|
+
# @option opts [String] :after A cursor point used for a paginated request to indicate the template to paginate forwards from.
|
255
|
+
# @option opts [WhatsappTemplateCategory] :category A filter for returning only templates matching a specific category.
|
256
|
+
# @option opts [String] :content A search filter representing the content of a template. Only matching templates will be returned in the list.
|
257
|
+
# @option opts [String] :language A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/)
|
258
|
+
# @option opts [String] :name A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list.
|
259
|
+
# @option opts [WhatsappTemplateStatus] :status A filter for returning only templates matching a specific status.
|
260
|
+
# @return [Array<(WhatsappListTemplatesResponse, Integer, Hash)>] WhatsappListTemplatesResponse data, response status code and response headers
|
261
|
+
def list_whatsapp_templates_with_http_info(waba_id, opts = {})
|
262
|
+
if @api_client.config.debugging
|
263
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppTemplatesApi.list_whatsapp_templates ...'
|
264
|
+
end
|
265
|
+
# verify the required parameter 'waba_id' is set
|
266
|
+
if @api_client.config.client_side_validation && waba_id.nil?
|
267
|
+
fail ArgumentError, "Missing the required parameter 'waba_id' when calling WhatsAppTemplatesApi.list_whatsapp_templates"
|
268
|
+
end
|
269
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
270
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WhatsAppTemplatesApi.list_whatsapp_templates, must be smaller than or equal to 500.'
|
271
|
+
end
|
272
|
+
|
273
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
274
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WhatsAppTemplatesApi.list_whatsapp_templates, must be greater than or equal to 1.'
|
275
|
+
end
|
276
|
+
|
277
|
+
# resource path
|
278
|
+
local_var_path = '/whatsapp/wabas/{wabaId}/templates'.sub('{' + 'wabaId' + '}', CGI.escape(waba_id.to_s))
|
279
|
+
|
280
|
+
# query parameters
|
281
|
+
query_params = opts[:query_params] || {}
|
282
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
283
|
+
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
|
284
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
285
|
+
query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil?
|
286
|
+
query_params[:'content'] = opts[:'content'] if !opts[:'content'].nil?
|
287
|
+
query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
|
288
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
289
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
290
|
+
|
291
|
+
# header parameters
|
292
|
+
header_params = opts[:header_params] || {}
|
293
|
+
# HTTP header 'Accept' (if needed)
|
294
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
295
|
+
|
296
|
+
# form parameters
|
297
|
+
form_params = opts[:form_params] || {}
|
298
|
+
|
299
|
+
# http body (model)
|
300
|
+
post_body = opts[:debug_body]
|
301
|
+
|
302
|
+
# return_type
|
303
|
+
return_type = opts[:debug_return_type] || 'WhatsappListTemplatesResponse'
|
304
|
+
|
305
|
+
# auth_names
|
306
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
307
|
+
|
308
|
+
new_options = opts.merge(
|
309
|
+
:operation => :"WhatsAppTemplatesApi.list_whatsapp_templates",
|
310
|
+
:header_params => header_params,
|
311
|
+
:query_params => query_params,
|
312
|
+
:form_params => form_params,
|
313
|
+
:body => post_body,
|
314
|
+
:auth_names => auth_names,
|
315
|
+
:return_type => return_type
|
316
|
+
)
|
317
|
+
|
318
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
319
|
+
if @api_client.config.debugging
|
320
|
+
@api_client.config.logger.debug "API called: WhatsAppTemplatesApi#list_whatsapp_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
321
|
+
end
|
322
|
+
return data, status_code, headers
|
323
|
+
end
|
324
|
+
|
325
|
+
# Updates a WhatsApp template
|
326
|
+
# @param waba_id [String] The ID of the WABA
|
327
|
+
# @param template_id [String] The ID of the template to update
|
328
|
+
# @param whatsapp_update_template_request [WhatsappUpdateTemplateRequest] The template data to be updated
|
329
|
+
# @param [Hash] opts the optional parameters
|
330
|
+
# @return [Object]
|
331
|
+
def update_whatsapp_template(waba_id, template_id, whatsapp_update_template_request, opts = {})
|
332
|
+
data, _status_code, _headers = update_whatsapp_template_with_http_info(waba_id, template_id, whatsapp_update_template_request, opts)
|
333
|
+
data
|
334
|
+
end
|
335
|
+
|
336
|
+
# Updates a WhatsApp template
|
337
|
+
# @param waba_id [String] The ID of the WABA
|
338
|
+
# @param template_id [String] The ID of the template to update
|
339
|
+
# @param whatsapp_update_template_request [WhatsappUpdateTemplateRequest] The template data to be updated
|
340
|
+
# @param [Hash] opts the optional parameters
|
341
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
342
|
+
def update_whatsapp_template_with_http_info(waba_id, template_id, whatsapp_update_template_request, opts = {})
|
343
|
+
if @api_client.config.debugging
|
344
|
+
@api_client.config.logger.debug 'Calling API: WhatsAppTemplatesApi.update_whatsapp_template ...'
|
345
|
+
end
|
346
|
+
# verify the required parameter 'waba_id' is set
|
347
|
+
if @api_client.config.client_side_validation && waba_id.nil?
|
348
|
+
fail ArgumentError, "Missing the required parameter 'waba_id' when calling WhatsAppTemplatesApi.update_whatsapp_template"
|
349
|
+
end
|
350
|
+
# verify the required parameter 'template_id' is set
|
351
|
+
if @api_client.config.client_side_validation && template_id.nil?
|
352
|
+
fail ArgumentError, "Missing the required parameter 'template_id' when calling WhatsAppTemplatesApi.update_whatsapp_template"
|
353
|
+
end
|
354
|
+
# resource path
|
355
|
+
local_var_path = '/whatsapp/wabas/{wabaId}/templates/{templateId}'.sub('{' + 'wabaId' + '}', CGI.escape(waba_id.to_s)).sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s))
|
356
|
+
|
357
|
+
# query parameters
|
358
|
+
query_params = opts[:query_params] || {}
|
359
|
+
|
360
|
+
# header parameters
|
361
|
+
header_params = opts[:header_params] || {}
|
362
|
+
# HTTP header 'Accept' (if needed)
|
363
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
364
|
+
# HTTP header 'Content-Type'
|
365
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
366
|
+
if !content_type.nil?
|
367
|
+
header_params['Content-Type'] = content_type
|
368
|
+
end
|
369
|
+
|
370
|
+
# form parameters
|
371
|
+
form_params = opts[:form_params] || {}
|
372
|
+
|
373
|
+
# http body (model)
|
374
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(whatsapp_update_template_request)
|
375
|
+
|
376
|
+
# return_type
|
377
|
+
return_type = opts[:debug_return_type] || 'Object'
|
378
|
+
|
379
|
+
# auth_names
|
380
|
+
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
381
|
+
|
382
|
+
new_options = opts.merge(
|
383
|
+
:operation => :"WhatsAppTemplatesApi.update_whatsapp_template",
|
384
|
+
:header_params => header_params,
|
385
|
+
:query_params => query_params,
|
386
|
+
:form_params => form_params,
|
387
|
+
:body => post_body,
|
388
|
+
:auth_names => auth_names,
|
389
|
+
:return_type => return_type
|
390
|
+
)
|
391
|
+
|
392
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
393
|
+
if @api_client.config.debugging
|
394
|
+
@api_client.config.logger.debug "API called: WhatsAppTemplatesApi#update_whatsapp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
395
|
+
end
|
396
|
+
return data, status_code, headers
|
397
|
+
end
|
398
|
+
end
|
399
|
+
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 2.0.0
|
7
7
|
Contact: messente@messente.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.11.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -79,6 +79,14 @@ module MessenteApi
|
|
79
79
|
# @return [true, false]
|
80
80
|
attr_accessor :debugging
|
81
81
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
86
|
+
# Default to false.
|
87
|
+
# @return [true, false]
|
88
|
+
attr_accessor :ignore_operation_servers
|
89
|
+
|
82
90
|
# Defines the logger used for debugging.
|
83
91
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
84
92
|
#
|
@@ -166,6 +174,7 @@ module MessenteApi
|
|
166
174
|
@timeout = 0
|
167
175
|
@params_encoding = nil
|
168
176
|
@debugging = false
|
177
|
+
@ignore_operation_servers = false
|
169
178
|
@inject_format = false
|
170
179
|
@force_ending_format = false
|
171
180
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
@@ -200,6 +209,7 @@ module MessenteApi
|
|
200
209
|
|
201
210
|
# Returns base URL for specified operation based on server settings
|
202
211
|
def base_url(operation = nil)
|
212
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
203
213
|
if operation_server_settings.key?(operation) then
|
204
214
|
index = server_operation_index.fetch(operation, server_index)
|
205
215
|
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
@@ -241,6 +251,20 @@ module MessenteApi
|
|
241
251
|
key: 'Authorization',
|
242
252
|
value: basic_auth_token
|
243
253
|
},
|
254
|
+
'apiUsername' =>
|
255
|
+
{
|
256
|
+
type: 'api_key',
|
257
|
+
in: 'query',
|
258
|
+
key: 'username',
|
259
|
+
value: api_key_with_prefix('username')
|
260
|
+
},
|
261
|
+
'apiPassword' =>
|
262
|
+
{
|
263
|
+
type: 'api_key',
|
264
|
+
in: 'query',
|
265
|
+
key: 'password',
|
266
|
+
value: api_key_with_prefix('password')
|
267
|
+
},
|
244
268
|
}
|
245
269
|
end
|
246
270
|
|
@@ -256,6 +280,42 @@ module MessenteApi
|
|
256
280
|
|
257
281
|
def operation_server_settings
|
258
282
|
{
|
283
|
+
"AccountBalanceApi.get_account_balance": [
|
284
|
+
{
|
285
|
+
url: "https://api2.messente.com",
|
286
|
+
description: "Override base path for account balance API",
|
287
|
+
}
|
288
|
+
],
|
289
|
+
"AccountBalanceApi.get_account_balance_using_post": [
|
290
|
+
{
|
291
|
+
url: "https://api2.messente.com",
|
292
|
+
description: "Override base path for account balance API",
|
293
|
+
}
|
294
|
+
],
|
295
|
+
"NumberVerificationApi.verify_number": [
|
296
|
+
{
|
297
|
+
url: "https://api2.messente.com",
|
298
|
+
description: "Override base path for number verification API",
|
299
|
+
}
|
300
|
+
],
|
301
|
+
"NumberVerificationApi.verify_pin": [
|
302
|
+
{
|
303
|
+
url: "https://api2.messente.com",
|
304
|
+
description: "Override base path for number verification API",
|
305
|
+
}
|
306
|
+
],
|
307
|
+
"PricingApi.get_pricelist": [
|
308
|
+
{
|
309
|
+
url: "https://api2.messente.com",
|
310
|
+
description: "Override base path for pricing API",
|
311
|
+
}
|
312
|
+
],
|
313
|
+
"PricingApi.get_prices": [
|
314
|
+
{
|
315
|
+
url: "https://api2.messente.com",
|
316
|
+
description: "Override base path for pricing API",
|
317
|
+
}
|
318
|
+
],
|
259
319
|
}
|
260
320
|
end
|
261
321
|
|