smspool 0.1.1

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.
@@ -0,0 +1,479 @@
1
+ =begin
2
+ #SMSPool API
3
+
4
+ #Every endpoint accepts its parameters as form fields (POST) or query parameters (GET). Authenticate with your API key from https://www.smspool.net/my/settings, either as a bearer token (`Authorization: Bearer <key>`) or as a `key` parameter.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module SMSPool
16
+ class InformationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Country list
23
+ # This API endpoint is used to retrieve the full country list for SMSPool requests. It sends an HTTP GET request to the URL `https://api.smspool.net/country/retrieve_all`.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :show_all
26
+ # @return [Object]
27
+ def country_retrieve_all(opts = {})
28
+ data, _status_code, _headers = country_retrieve_all_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Country list
33
+ # This API endpoint is used to retrieve the full country list for SMSPool requests. It sends an HTTP GET request to the URL &#x60;https://api.smspool.net/country/retrieve_all&#x60;.
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :show_all
36
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
37
+ def country_retrieve_all_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: InformationApi.country_retrieve_all ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/country/retrieve_all'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+ query_params[:'show_all'] = opts[:'show_all'] if !opts[:'show_all'].nil?
47
+
48
+ # header parameters
49
+ header_params = opts[:header_params] || {}
50
+ # HTTP header 'Accept' (if needed)
51
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
52
+
53
+ # form parameters
54
+ form_params = opts[:form_params] || {}
55
+
56
+ # http body (model)
57
+ post_body = opts[:debug_body]
58
+
59
+ # return_type
60
+ return_type = opts[:debug_return_type] || 'Object'
61
+
62
+ # auth_names
63
+ auth_names = opts[:debug_auth_names] || []
64
+
65
+ new_options = opts.merge(
66
+ :operation => :"InformationApi.country_retrieve_all",
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => return_type
73
+ )
74
+
75
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: InformationApi#country_retrieve_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+
82
+ # Pool list
83
+ # This API endpoint is used to retrieve a list of our active pools for SMSPool requests. It sends an HTTP POST request to the URL `https://api.smspool.net/pool/retrieve_all`.
84
+ # @param [Hash] opts the optional parameters
85
+ # @return [Object]
86
+ def pool_retrieve_all(opts = {})
87
+ data, _status_code, _headers = pool_retrieve_all_with_http_info(opts)
88
+ data
89
+ end
90
+
91
+ # Pool list
92
+ # This API endpoint is used to retrieve a list of our active pools for SMSPool requests. It sends an HTTP POST request to the URL &#x60;https://api.smspool.net/pool/retrieve_all&#x60;.
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
95
+ def pool_retrieve_all_with_http_info(opts = {})
96
+ if @api_client.config.debugging
97
+ @api_client.config.logger.debug 'Calling API: InformationApi.pool_retrieve_all ...'
98
+ end
99
+ # resource path
100
+ local_var_path = '/pool/retrieve_all'
101
+
102
+ # query parameters
103
+ query_params = opts[:query_params] || {}
104
+
105
+ # header parameters
106
+ header_params = opts[:header_params] || {}
107
+ # HTTP header 'Accept' (if needed)
108
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
109
+
110
+ # form parameters
111
+ form_params = opts[:form_params] || {}
112
+
113
+ # http body (model)
114
+ post_body = opts[:debug_body]
115
+
116
+ # return_type
117
+ return_type = opts[:debug_return_type] || 'Object'
118
+
119
+ # auth_names
120
+ auth_names = opts[:debug_auth_names] || []
121
+
122
+ new_options = opts.merge(
123
+ :operation => :"InformationApi.pool_retrieve_all",
124
+ :header_params => header_params,
125
+ :query_params => query_params,
126
+ :form_params => form_params,
127
+ :body => post_body,
128
+ :auth_names => auth_names,
129
+ :return_type => return_type
130
+ )
131
+
132
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
133
+ if @api_client.config.debugging
134
+ @api_client.config.logger.debug "API called: InformationApi#pool_retrieve_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
135
+ end
136
+ return data, status_code, headers
137
+ end
138
+
139
+ # Suggested Pools
140
+ # This API endpoint is used to retrieve suggested pools for SMSPool requests. It sends an HTTP POST request to the URL `https://api.smspool.net/pool/retrieve_valid`. Please use either the service ID, or the service name as service param.
141
+ # @param service [String] Service retrieved from &#39;&#39;Service list\\\&quot; endpoint
142
+ # @param country [String] Country retrieved from &#39;&#39;Country list\\\&quot; endpoint
143
+ # @param [Hash] opts the optional parameters
144
+ # @option opts [String] :web Return array format
145
+ # @option opts [String] :include_stock
146
+ # @return [Object]
147
+ def pool_retrieve_valid(service, country, opts = {})
148
+ data, _status_code, _headers = pool_retrieve_valid_with_http_info(service, country, opts)
149
+ data
150
+ end
151
+
152
+ # Suggested Pools
153
+ # This API endpoint is used to retrieve suggested pools for SMSPool requests. It sends an HTTP POST request to the URL &#x60;https://api.smspool.net/pool/retrieve_valid&#x60;. Please use either the service ID, or the service name as service param.
154
+ # @param service [String] Service retrieved from &#39;&#39;Service list\\\&quot; endpoint
155
+ # @param country [String] Country retrieved from &#39;&#39;Country list\\\&quot; endpoint
156
+ # @param [Hash] opts the optional parameters
157
+ # @option opts [String] :web Return array format
158
+ # @option opts [String] :include_stock
159
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
160
+ def pool_retrieve_valid_with_http_info(service, country, opts = {})
161
+ if @api_client.config.debugging
162
+ @api_client.config.logger.debug 'Calling API: InformationApi.pool_retrieve_valid ...'
163
+ end
164
+ # verify the required parameter 'service' is set
165
+ if @api_client.config.client_side_validation && service.nil?
166
+ fail ArgumentError, "Missing the required parameter 'service' when calling InformationApi.pool_retrieve_valid"
167
+ end
168
+ # verify the required parameter 'country' is set
169
+ if @api_client.config.client_side_validation && country.nil?
170
+ fail ArgumentError, "Missing the required parameter 'country' when calling InformationApi.pool_retrieve_valid"
171
+ end
172
+ # resource path
173
+ local_var_path = '/pool/retrieve_valid'
174
+
175
+ # query parameters
176
+ query_params = opts[:query_params] || {}
177
+
178
+ # header parameters
179
+ header_params = opts[:header_params] || {}
180
+ # HTTP header 'Accept' (if needed)
181
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
182
+ # HTTP header 'Content-Type'
183
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
184
+ if !content_type.nil?
185
+ header_params['Content-Type'] = content_type
186
+ end
187
+
188
+ # form parameters
189
+ form_params = opts[:form_params] || {}
190
+ form_params['service'] = service
191
+ form_params['country'] = country
192
+ form_params['web'] = opts[:'web'] if !opts[:'web'].nil?
193
+ form_params['include_stock'] = opts[:'include_stock'] if !opts[:'include_stock'].nil?
194
+
195
+ # http body (model)
196
+ post_body = opts[:debug_body]
197
+
198
+ # return_type
199
+ return_type = opts[:debug_return_type] || 'Object'
200
+
201
+ # auth_names
202
+ auth_names = opts[:debug_auth_names] || []
203
+
204
+ new_options = opts.merge(
205
+ :operation => :"InformationApi.pool_retrieve_valid",
206
+ :header_params => header_params,
207
+ :query_params => query_params,
208
+ :form_params => form_params,
209
+ :body => post_body,
210
+ :auth_names => auth_names,
211
+ :return_type => return_type
212
+ )
213
+
214
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
215
+ if @api_client.config.debugging
216
+ @api_client.config.logger.debug "API called: InformationApi#pool_retrieve_valid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
217
+ end
218
+ return data, status_code, headers
219
+ end
220
+
221
+ # Balance
222
+ # This HTTP POST request is used to retrieve the balance for a specific SMSPool. The request is sent to the URL `https://api.smspool.net/request/balance`. ### Request Parameters This request require the \\`key\\` param which is your API key ### Response The response to this request will have a status code of 200 if the request is successful. The response body will be in JSON format and will include a `balance` field. However, the last execution of this request returned an empty string for the `balance` field. Please note that the actual value of the `balance` field may vary depending on the user and its configuration.
223
+ # @param [Hash] opts the optional parameters
224
+ # @return [Object]
225
+ def request_balance(opts = {})
226
+ data, _status_code, _headers = request_balance_with_http_info(opts)
227
+ data
228
+ end
229
+
230
+ # Balance
231
+ # This HTTP POST request is used to retrieve the balance for a specific SMSPool. The request is sent to the URL &#x60;https://api.smspool.net/request/balance&#x60;. ### Request Parameters This request require the \\&#x60;key\\&#x60; param which is your API key ### Response The response to this request will have a status code of 200 if the request is successful. The response body will be in JSON format and will include a &#x60;balance&#x60; field. However, the last execution of this request returned an empty string for the &#x60;balance&#x60; field. Please note that the actual value of the &#x60;balance&#x60; field may vary depending on the user and its configuration.
232
+ # @param [Hash] opts the optional parameters
233
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
234
+ def request_balance_with_http_info(opts = {})
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug 'Calling API: InformationApi.request_balance ...'
237
+ end
238
+ # resource path
239
+ local_var_path = '/request/balance'
240
+
241
+ # query parameters
242
+ query_params = opts[:query_params] || {}
243
+
244
+ # header parameters
245
+ header_params = opts[:header_params] || {}
246
+ # HTTP header 'Accept' (if needed)
247
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
248
+
249
+ # form parameters
250
+ form_params = opts[:form_params] || {}
251
+
252
+ # http body (model)
253
+ post_body = opts[:debug_body]
254
+
255
+ # return_type
256
+ return_type = opts[:debug_return_type] || 'Object'
257
+
258
+ # auth_names
259
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
260
+
261
+ new_options = opts.merge(
262
+ :operation => :"InformationApi.request_balance",
263
+ :header_params => header_params,
264
+ :query_params => query_params,
265
+ :form_params => form_params,
266
+ :body => post_body,
267
+ :auth_names => auth_names,
268
+ :return_type => return_type
269
+ )
270
+
271
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
272
+ if @api_client.config.debugging
273
+ @api_client.config.logger.debug "API called: InformationApi#request_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
274
+ end
275
+ return data, status_code, headers
276
+ end
277
+
278
+ # Retrieve country success rates per service
279
+ # This API endpoint is used to retrieve success per country for SMSPool requests. It sends an HTTP POST request to the URL `https://api.smspool.net/request/success_rate`. Please use either the service ID, or the service name as service param.
280
+ # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
281
+ # @param [Hash] opts the optional parameters
282
+ # @option opts [String] :country Country name or country ID which can be retrieved at the /country/retrieve_all endpoint
283
+ # @return [Object]
284
+ def request_success_rate(service, opts = {})
285
+ data, _status_code, _headers = request_success_rate_with_http_info(service, opts)
286
+ data
287
+ end
288
+
289
+ # Retrieve country success rates per service
290
+ # This API endpoint is used to retrieve success per country for SMSPool requests. It sends an HTTP POST request to the URL &#x60;https://api.smspool.net/request/success_rate&#x60;. Please use either the service ID, or the service name as service param.
291
+ # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
292
+ # @param [Hash] opts the optional parameters
293
+ # @option opts [String] :country Country name or country ID which can be retrieved at the /country/retrieve_all endpoint
294
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
295
+ def request_success_rate_with_http_info(service, opts = {})
296
+ if @api_client.config.debugging
297
+ @api_client.config.logger.debug 'Calling API: InformationApi.request_success_rate ...'
298
+ end
299
+ # verify the required parameter 'service' is set
300
+ if @api_client.config.client_side_validation && service.nil?
301
+ fail ArgumentError, "Missing the required parameter 'service' when calling InformationApi.request_success_rate"
302
+ end
303
+ # resource path
304
+ local_var_path = '/request/success_rate'
305
+
306
+ # query parameters
307
+ query_params = opts[:query_params] || {}
308
+
309
+ # header parameters
310
+ header_params = opts[:header_params] || {}
311
+ # HTTP header 'Accept' (if needed)
312
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
313
+ # HTTP header 'Content-Type'
314
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
315
+ if !content_type.nil?
316
+ header_params['Content-Type'] = content_type
317
+ end
318
+
319
+ # form parameters
320
+ form_params = opts[:form_params] || {}
321
+ form_params['service'] = service
322
+ form_params['country'] = opts[:'country'] if !opts[:'country'].nil?
323
+
324
+ # http body (model)
325
+ post_body = opts[:debug_body]
326
+
327
+ # return_type
328
+ return_type = opts[:debug_return_type] || 'Object'
329
+
330
+ # auth_names
331
+ auth_names = opts[:debug_auth_names] || []
332
+
333
+ new_options = opts.merge(
334
+ :operation => :"InformationApi.request_success_rate",
335
+ :header_params => header_params,
336
+ :query_params => query_params,
337
+ :form_params => form_params,
338
+ :body => post_body,
339
+ :auth_names => auth_names,
340
+ :return_type => return_type
341
+ )
342
+
343
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
344
+ if @api_client.config.debugging
345
+ @api_client.config.logger.debug "API called: InformationApi#request_success_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
346
+ end
347
+ return data, status_code, headers
348
+ end
349
+
350
+ # Suggested Countries
351
+ # This API endpoint is used to retrieve suggested countries for SMS pool requests. It sends an HTTP POST request to the URL `https://api.smspool.net/request/suggested_countries`. Please use either the service ID, or the service name as service param.
352
+ # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
353
+ # @param [Hash] opts the optional parameters
354
+ # @return [Object]
355
+ def request_suggested_countries(service, opts = {})
356
+ data, _status_code, _headers = request_suggested_countries_with_http_info(service, opts)
357
+ data
358
+ end
359
+
360
+ # Suggested Countries
361
+ # This API endpoint is used to retrieve suggested countries for SMS pool requests. It sends an HTTP POST request to the URL &#x60;https://api.smspool.net/request/suggested_countries&#x60;. Please use either the service ID, or the service name as service param.
362
+ # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
363
+ # @param [Hash] opts the optional parameters
364
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
365
+ def request_suggested_countries_with_http_info(service, opts = {})
366
+ if @api_client.config.debugging
367
+ @api_client.config.logger.debug 'Calling API: InformationApi.request_suggested_countries ...'
368
+ end
369
+ # verify the required parameter 'service' is set
370
+ if @api_client.config.client_side_validation && service.nil?
371
+ fail ArgumentError, "Missing the required parameter 'service' when calling InformationApi.request_suggested_countries"
372
+ end
373
+ # resource path
374
+ local_var_path = '/request/suggested_countries'
375
+
376
+ # query parameters
377
+ query_params = opts[:query_params] || {}
378
+
379
+ # header parameters
380
+ header_params = opts[:header_params] || {}
381
+ # HTTP header 'Accept' (if needed)
382
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
383
+ # HTTP header 'Content-Type'
384
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
385
+ if !content_type.nil?
386
+ header_params['Content-Type'] = content_type
387
+ end
388
+
389
+ # form parameters
390
+ form_params = opts[:form_params] || {}
391
+ form_params['service'] = service
392
+
393
+ # http body (model)
394
+ post_body = opts[:debug_body]
395
+
396
+ # return_type
397
+ return_type = opts[:debug_return_type] || 'Object'
398
+
399
+ # auth_names
400
+ auth_names = opts[:debug_auth_names] || []
401
+
402
+ new_options = opts.merge(
403
+ :operation => :"InformationApi.request_suggested_countries",
404
+ :header_params => header_params,
405
+ :query_params => query_params,
406
+ :form_params => form_params,
407
+ :body => post_body,
408
+ :auth_names => auth_names,
409
+ :return_type => return_type
410
+ )
411
+
412
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
413
+ if @api_client.config.debugging
414
+ @api_client.config.logger.debug "API called: InformationApi#request_suggested_countries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
415
+ end
416
+ return data, status_code, headers
417
+ end
418
+
419
+ # Service list
420
+ # This API endpoint is used to retrieve the full service list for SMSPool requests. It sends an HTTP GET request to the URL `https://api.smspool.net/service/retrieve_all`.
421
+ # @param [Hash] opts the optional parameters
422
+ # @option opts [String] :country
423
+ # @return [Object]
424
+ def service_retrieve_all(opts = {})
425
+ data, _status_code, _headers = service_retrieve_all_with_http_info(opts)
426
+ data
427
+ end
428
+
429
+ # Service list
430
+ # This API endpoint is used to retrieve the full service list for SMSPool requests. It sends an HTTP GET request to the URL &#x60;https://api.smspool.net/service/retrieve_all&#x60;.
431
+ # @param [Hash] opts the optional parameters
432
+ # @option opts [String] :country
433
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
434
+ def service_retrieve_all_with_http_info(opts = {})
435
+ if @api_client.config.debugging
436
+ @api_client.config.logger.debug 'Calling API: InformationApi.service_retrieve_all ...'
437
+ end
438
+ # resource path
439
+ local_var_path = '/service/retrieve_all'
440
+
441
+ # query parameters
442
+ query_params = opts[:query_params] || {}
443
+ query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
444
+
445
+ # header parameters
446
+ header_params = opts[:header_params] || {}
447
+ # HTTP header 'Accept' (if needed)
448
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
449
+
450
+ # form parameters
451
+ form_params = opts[:form_params] || {}
452
+
453
+ # http body (model)
454
+ post_body = opts[:debug_body]
455
+
456
+ # return_type
457
+ return_type = opts[:debug_return_type] || 'Object'
458
+
459
+ # auth_names
460
+ auth_names = opts[:debug_auth_names] || []
461
+
462
+ new_options = opts.merge(
463
+ :operation => :"InformationApi.service_retrieve_all",
464
+ :header_params => header_params,
465
+ :query_params => query_params,
466
+ :form_params => form_params,
467
+ :body => post_body,
468
+ :auth_names => auth_names,
469
+ :return_type => return_type
470
+ )
471
+
472
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
473
+ if @api_client.config.debugging
474
+ @api_client.config.logger.debug "API called: InformationApi#service_retrieve_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
475
+ end
476
+ return data, status_code, headers
477
+ end
478
+ end
479
+ end