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,217 @@
|
|
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 NumberVerificationApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# verify number
|
23
|
+
# @param username [String] The API username
|
24
|
+
# @param password [String] The API password
|
25
|
+
# @param to [String] Receiver's phone number with the country code
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @option opts [String] :template Template of the message, including PIN code. Placeholder for PIN code is <PIN>. When not set, default template is used: \"Your Verification PIN code is <PIN>\".
|
28
|
+
# @option opts [String] :pin_length Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4.
|
29
|
+
# @option opts [String] :from Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand.
|
30
|
+
# @option opts [String] :max_tries Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled.
|
31
|
+
# @option opts [String] :retry_delay For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds.
|
32
|
+
# @option opts [String] :validity For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds).
|
33
|
+
# @option opts [String] :ip IP address of the client making verification request.
|
34
|
+
# @option opts [String] :browser User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".
|
35
|
+
# @option opts [String] :cookie Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.
|
36
|
+
# @return [String]
|
37
|
+
def verify_number(username, password, to, opts = {})
|
38
|
+
data, _status_code, _headers = verify_number_with_http_info(username, password, to, opts)
|
39
|
+
data
|
40
|
+
end
|
41
|
+
|
42
|
+
# verify number
|
43
|
+
# @param username [String] The API username
|
44
|
+
# @param password [String] The API password
|
45
|
+
# @param to [String] Receiver's phone number with the country code
|
46
|
+
# @param [Hash] opts the optional parameters
|
47
|
+
# @option opts [String] :template Template of the message, including PIN code. Placeholder for PIN code is <PIN>. When not set, default template is used: \"Your Verification PIN code is <PIN>\".
|
48
|
+
# @option opts [String] :pin_length Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4.
|
49
|
+
# @option opts [String] :from Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand.
|
50
|
+
# @option opts [String] :max_tries Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled.
|
51
|
+
# @option opts [String] :retry_delay For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds.
|
52
|
+
# @option opts [String] :validity For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds).
|
53
|
+
# @option opts [String] :ip IP address of the client making verification request.
|
54
|
+
# @option opts [String] :browser User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".
|
55
|
+
# @option opts [String] :cookie Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.
|
56
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
57
|
+
def verify_number_with_http_info(username, password, to, opts = {})
|
58
|
+
if @api_client.config.debugging
|
59
|
+
@api_client.config.logger.debug 'Calling API: NumberVerificationApi.verify_number ...'
|
60
|
+
end
|
61
|
+
# verify the required parameter 'username' is set
|
62
|
+
if @api_client.config.client_side_validation && username.nil?
|
63
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling NumberVerificationApi.verify_number"
|
64
|
+
end
|
65
|
+
# verify the required parameter 'password' is set
|
66
|
+
if @api_client.config.client_side_validation && password.nil?
|
67
|
+
fail ArgumentError, "Missing the required parameter 'password' when calling NumberVerificationApi.verify_number"
|
68
|
+
end
|
69
|
+
# verify the required parameter 'to' is set
|
70
|
+
if @api_client.config.client_side_validation && to.nil?
|
71
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling NumberVerificationApi.verify_number"
|
72
|
+
end
|
73
|
+
# resource path
|
74
|
+
local_var_path = '/verify/start'
|
75
|
+
|
76
|
+
# query parameters
|
77
|
+
query_params = opts[:query_params] || {}
|
78
|
+
query_params[:'username'] = username
|
79
|
+
query_params[:'password'] = password
|
80
|
+
query_params[:'to'] = to
|
81
|
+
query_params[:'template'] = opts[:'template'] if !opts[:'template'].nil?
|
82
|
+
query_params[:'pin_length'] = opts[:'pin_length'] if !opts[:'pin_length'].nil?
|
83
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
84
|
+
query_params[:'max_tries'] = opts[:'max_tries'] if !opts[:'max_tries'].nil?
|
85
|
+
query_params[:'retry_delay'] = opts[:'retry_delay'] if !opts[:'retry_delay'].nil?
|
86
|
+
query_params[:'validity'] = opts[:'validity'] if !opts[:'validity'].nil?
|
87
|
+
query_params[:'ip'] = opts[:'ip'] if !opts[:'ip'].nil?
|
88
|
+
query_params[:'browser'] = opts[:'browser'] if !opts[:'browser'].nil?
|
89
|
+
query_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
|
90
|
+
|
91
|
+
# header parameters
|
92
|
+
header_params = opts[:header_params] || {}
|
93
|
+
# HTTP header 'Accept' (if needed)
|
94
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept']
|
95
|
+
|
96
|
+
# form parameters
|
97
|
+
form_params = opts[:form_params] || {}
|
98
|
+
|
99
|
+
# http body (model)
|
100
|
+
post_body = opts[:debug_body]
|
101
|
+
|
102
|
+
# return_type
|
103
|
+
return_type = opts[:debug_return_type] || 'String'
|
104
|
+
|
105
|
+
# auth_names
|
106
|
+
auth_names = opts[:debug_auth_names] || ['apiPassword', 'apiUsername']
|
107
|
+
|
108
|
+
new_options = opts.merge(
|
109
|
+
:operation => :"NumberVerificationApi.verify_number",
|
110
|
+
:header_params => header_params,
|
111
|
+
:query_params => query_params,
|
112
|
+
:form_params => form_params,
|
113
|
+
:body => post_body,
|
114
|
+
:auth_names => auth_names,
|
115
|
+
:return_type => return_type
|
116
|
+
)
|
117
|
+
|
118
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
119
|
+
if @api_client.config.debugging
|
120
|
+
@api_client.config.logger.debug "API called: NumberVerificationApi#verify_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
121
|
+
end
|
122
|
+
return data, status_code, headers
|
123
|
+
end
|
124
|
+
|
125
|
+
# verified the PIN code entered by the user.
|
126
|
+
# @param username [String] The API username
|
127
|
+
# @param password [String] The API password
|
128
|
+
# @param verification_id [String] Verification ID returned by the successful verification request.
|
129
|
+
# @param pin [String] PIN code entered by the user.
|
130
|
+
# @param [Hash] opts the optional parameters
|
131
|
+
# @option opts [String] :ip IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match.
|
132
|
+
# @option opts [String] :browser User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".
|
133
|
+
# @option opts [String] :cookie Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.
|
134
|
+
# @return [String]
|
135
|
+
def verify_pin(username, password, verification_id, pin, opts = {})
|
136
|
+
data, _status_code, _headers = verify_pin_with_http_info(username, password, verification_id, pin, opts)
|
137
|
+
data
|
138
|
+
end
|
139
|
+
|
140
|
+
# verified the PIN code entered by the user.
|
141
|
+
# @param username [String] The API username
|
142
|
+
# @param password [String] The API password
|
143
|
+
# @param verification_id [String] Verification ID returned by the successful verification request.
|
144
|
+
# @param pin [String] PIN code entered by the user.
|
145
|
+
# @param [Hash] opts the optional parameters
|
146
|
+
# @option opts [String] :ip IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match.
|
147
|
+
# @option opts [String] :browser User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".
|
148
|
+
# @option opts [String] :cookie Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.
|
149
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
150
|
+
def verify_pin_with_http_info(username, password, verification_id, pin, opts = {})
|
151
|
+
if @api_client.config.debugging
|
152
|
+
@api_client.config.logger.debug 'Calling API: NumberVerificationApi.verify_pin ...'
|
153
|
+
end
|
154
|
+
# verify the required parameter 'username' is set
|
155
|
+
if @api_client.config.client_side_validation && username.nil?
|
156
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling NumberVerificationApi.verify_pin"
|
157
|
+
end
|
158
|
+
# verify the required parameter 'password' is set
|
159
|
+
if @api_client.config.client_side_validation && password.nil?
|
160
|
+
fail ArgumentError, "Missing the required parameter 'password' when calling NumberVerificationApi.verify_pin"
|
161
|
+
end
|
162
|
+
# verify the required parameter 'verification_id' is set
|
163
|
+
if @api_client.config.client_side_validation && verification_id.nil?
|
164
|
+
fail ArgumentError, "Missing the required parameter 'verification_id' when calling NumberVerificationApi.verify_pin"
|
165
|
+
end
|
166
|
+
# verify the required parameter 'pin' is set
|
167
|
+
if @api_client.config.client_side_validation && pin.nil?
|
168
|
+
fail ArgumentError, "Missing the required parameter 'pin' when calling NumberVerificationApi.verify_pin"
|
169
|
+
end
|
170
|
+
# resource path
|
171
|
+
local_var_path = '/verify/pin'
|
172
|
+
|
173
|
+
# query parameters
|
174
|
+
query_params = opts[:query_params] || {}
|
175
|
+
query_params[:'username'] = username
|
176
|
+
query_params[:'password'] = password
|
177
|
+
query_params[:'verification_id'] = verification_id
|
178
|
+
query_params[:'pin'] = pin
|
179
|
+
query_params[:'ip'] = opts[:'ip'] if !opts[:'ip'].nil?
|
180
|
+
query_params[:'browser'] = opts[:'browser'] if !opts[:'browser'].nil?
|
181
|
+
query_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
|
182
|
+
|
183
|
+
# header parameters
|
184
|
+
header_params = opts[:header_params] || {}
|
185
|
+
# HTTP header 'Accept' (if needed)
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept']
|
187
|
+
|
188
|
+
# form parameters
|
189
|
+
form_params = opts[:form_params] || {}
|
190
|
+
|
191
|
+
# http body (model)
|
192
|
+
post_body = opts[:debug_body]
|
193
|
+
|
194
|
+
# return_type
|
195
|
+
return_type = opts[:debug_return_type] || 'String'
|
196
|
+
|
197
|
+
# auth_names
|
198
|
+
auth_names = opts[:debug_auth_names] || ['apiPassword', 'apiUsername']
|
199
|
+
|
200
|
+
new_options = opts.merge(
|
201
|
+
:operation => :"NumberVerificationApi.verify_pin",
|
202
|
+
:header_params => header_params,
|
203
|
+
:query_params => query_params,
|
204
|
+
:form_params => form_params,
|
205
|
+
:body => post_body,
|
206
|
+
:auth_names => auth_names,
|
207
|
+
:return_type => return_type
|
208
|
+
)
|
209
|
+
|
210
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
211
|
+
if @api_client.config.debugging
|
212
|
+
@api_client.config.logger.debug "API called: NumberVerificationApi#verify_pin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
213
|
+
end
|
214
|
+
return data, status_code, headers
|
215
|
+
end
|
216
|
+
end
|
217
|
+
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
|
|
@@ -49,7 +49,7 @@ module MessenteApi
|
|
49
49
|
# header parameters
|
50
50
|
header_params = opts[:header_params] || {}
|
51
51
|
# HTTP header 'Accept' (if needed)
|
52
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
53
53
|
|
54
54
|
# form parameters
|
55
55
|
form_params = opts[:form_params] || {}
|
@@ -110,7 +110,7 @@ module MessenteApi
|
|
110
110
|
# header parameters
|
111
111
|
header_params = opts[:header_params] || {}
|
112
112
|
# HTTP header 'Accept' (if needed)
|
113
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
113
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
114
114
|
# HTTP header 'Content-Type'
|
115
115
|
content_type = @api_client.select_header_content_type(['application/json'])
|
116
116
|
if !content_type.nil?
|
@@ -0,0 +1,170 @@
|
|
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 PricingApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get pricelist for account
|
23
|
+
# @param username [String] The API username
|
24
|
+
# @param password [String] The API password
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [String]
|
27
|
+
def get_pricelist(username, password, opts = {})
|
28
|
+
data, _status_code, _headers = get_pricelist_with_http_info(username, password, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get pricelist for account
|
33
|
+
# @param username [String] The API username
|
34
|
+
# @param password [String] The API password
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
37
|
+
def get_pricelist_with_http_info(username, password, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: PricingApi.get_pricelist ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'username' is set
|
42
|
+
if @api_client.config.client_side_validation && username.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling PricingApi.get_pricelist"
|
44
|
+
end
|
45
|
+
# verify the required parameter 'password' is set
|
46
|
+
if @api_client.config.client_side_validation && password.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'password' when calling PricingApi.get_pricelist"
|
48
|
+
end
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/pricelist'
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
query_params[:'username'] = username
|
55
|
+
query_params[:'password'] = password
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept']
|
61
|
+
|
62
|
+
# form parameters
|
63
|
+
form_params = opts[:form_params] || {}
|
64
|
+
|
65
|
+
# http body (model)
|
66
|
+
post_body = opts[:debug_body]
|
67
|
+
|
68
|
+
# return_type
|
69
|
+
return_type = opts[:debug_return_type] || 'String'
|
70
|
+
|
71
|
+
# auth_names
|
72
|
+
auth_names = opts[:debug_auth_names] || ['apiPassword', 'apiUsername']
|
73
|
+
|
74
|
+
new_options = opts.merge(
|
75
|
+
:operation => :"PricingApi.get_pricelist",
|
76
|
+
:header_params => header_params,
|
77
|
+
:query_params => query_params,
|
78
|
+
:form_params => form_params,
|
79
|
+
:body => post_body,
|
80
|
+
:auth_names => auth_names,
|
81
|
+
:return_type => return_type
|
82
|
+
)
|
83
|
+
|
84
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
85
|
+
if @api_client.config.debugging
|
86
|
+
@api_client.config.logger.debug "API called: PricingApi#get_pricelist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
87
|
+
end
|
88
|
+
return data, status_code, headers
|
89
|
+
end
|
90
|
+
|
91
|
+
# Get pricing for a specific country
|
92
|
+
# @param username [String] The API username
|
93
|
+
# @param password [String] The API password
|
94
|
+
# @param country [String] The country code, for which to get the prices
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @option opts [String] :format The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'.
|
97
|
+
# @return [Price]
|
98
|
+
def get_prices(username, password, country, opts = {})
|
99
|
+
data, _status_code, _headers = get_prices_with_http_info(username, password, country, opts)
|
100
|
+
data
|
101
|
+
end
|
102
|
+
|
103
|
+
# Get pricing for a specific country
|
104
|
+
# @param username [String] The API username
|
105
|
+
# @param password [String] The API password
|
106
|
+
# @param country [String] The country code, for which to get the prices
|
107
|
+
# @param [Hash] opts the optional parameters
|
108
|
+
# @option opts [String] :format The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'.
|
109
|
+
# @return [Array<(Price, Integer, Hash)>] Price data, response status code and response headers
|
110
|
+
def get_prices_with_http_info(username, password, country, opts = {})
|
111
|
+
if @api_client.config.debugging
|
112
|
+
@api_client.config.logger.debug 'Calling API: PricingApi.get_prices ...'
|
113
|
+
end
|
114
|
+
# verify the required parameter 'username' is set
|
115
|
+
if @api_client.config.client_side_validation && username.nil?
|
116
|
+
fail ArgumentError, "Missing the required parameter 'username' when calling PricingApi.get_prices"
|
117
|
+
end
|
118
|
+
# verify the required parameter 'password' is set
|
119
|
+
if @api_client.config.client_side_validation && password.nil?
|
120
|
+
fail ArgumentError, "Missing the required parameter 'password' when calling PricingApi.get_prices"
|
121
|
+
end
|
122
|
+
# verify the required parameter 'country' is set
|
123
|
+
if @api_client.config.client_side_validation && country.nil?
|
124
|
+
fail ArgumentError, "Missing the required parameter 'country' when calling PricingApi.get_prices"
|
125
|
+
end
|
126
|
+
# resource path
|
127
|
+
local_var_path = '/prices'
|
128
|
+
|
129
|
+
# query parameters
|
130
|
+
query_params = opts[:query_params] || {}
|
131
|
+
query_params[:'username'] = username
|
132
|
+
query_params[:'password'] = password
|
133
|
+
query_params[:'country'] = country
|
134
|
+
query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
|
135
|
+
|
136
|
+
# header parameters
|
137
|
+
header_params = opts[:header_params] || {}
|
138
|
+
# HTTP header 'Accept' (if needed)
|
139
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'text/plain; charset=utf-8']) unless header_params['Accept']
|
140
|
+
|
141
|
+
# form parameters
|
142
|
+
form_params = opts[:form_params] || {}
|
143
|
+
|
144
|
+
# http body (model)
|
145
|
+
post_body = opts[:debug_body]
|
146
|
+
|
147
|
+
# return_type
|
148
|
+
return_type = opts[:debug_return_type] || 'Price'
|
149
|
+
|
150
|
+
# auth_names
|
151
|
+
auth_names = opts[:debug_auth_names] || ['apiPassword', 'apiUsername']
|
152
|
+
|
153
|
+
new_options = opts.merge(
|
154
|
+
:operation => :"PricingApi.get_prices",
|
155
|
+
:header_params => header_params,
|
156
|
+
:query_params => query_params,
|
157
|
+
:form_params => form_params,
|
158
|
+
:body => post_body,
|
159
|
+
:auth_names => auth_names,
|
160
|
+
:return_type => return_type
|
161
|
+
)
|
162
|
+
|
163
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
164
|
+
if @api_client.config.debugging
|
165
|
+
@api_client.config.logger.debug "API called: PricingApi#get_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
166
|
+
end
|
167
|
+
return data, status_code, headers
|
168
|
+
end
|
169
|
+
end
|
170
|
+
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
|
|
@@ -49,7 +49,7 @@ module MessenteApi
|
|
49
49
|
# header parameters
|
50
50
|
header_params = opts[:header_params] || {}
|
51
51
|
# HTTP header 'Accept' (if needed)
|
52
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
53
53
|
# HTTP header 'Content-Type'
|
54
54
|
content_type = @api_client.select_header_content_type(['application/json'])
|
55
55
|
if !content_type.nil?
|