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,385 @@
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 PreordersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Cancel
23
+ # @param orderid [String]
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Object]
26
+ def preorder_cancel(orderid, opts = {})
27
+ data, _status_code, _headers = preorder_cancel_with_http_info(orderid, opts)
28
+ data
29
+ end
30
+
31
+ # Cancel
32
+ # @param orderid [String]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
35
+ def preorder_cancel_with_http_info(orderid, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: PreordersApi.preorder_cancel ...'
38
+ end
39
+ # verify the required parameter 'orderid' is set
40
+ if @api_client.config.client_side_validation && orderid.nil?
41
+ fail ArgumentError, "Missing the required parameter 'orderid' when calling PreordersApi.preorder_cancel"
42
+ end
43
+ # resource path
44
+ local_var_path = '/preorder/cancel'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+ # HTTP header 'Content-Type'
54
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
55
+ if !content_type.nil?
56
+ header_params['Content-Type'] = content_type
57
+ end
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+ form_params['orderid'] = orderid
62
+
63
+ # http body (model)
64
+ post_body = opts[:debug_body]
65
+
66
+ # return_type
67
+ return_type = opts[:debug_return_type] || 'Object'
68
+
69
+ # auth_names
70
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
71
+
72
+ new_options = opts.merge(
73
+ :operation => :"PreordersApi.preorder_cancel",
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => return_type
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: PreordersApi#preorder_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # Check
90
+ # @param orderid [String]
91
+ # @param [Hash] opts the optional parameters
92
+ # @return [Object]
93
+ def preorder_check(orderid, opts = {})
94
+ data, _status_code, _headers = preorder_check_with_http_info(orderid, opts)
95
+ data
96
+ end
97
+
98
+ # Check
99
+ # @param orderid [String]
100
+ # @param [Hash] opts the optional parameters
101
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
102
+ def preorder_check_with_http_info(orderid, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: PreordersApi.preorder_check ...'
105
+ end
106
+ # verify the required parameter 'orderid' is set
107
+ if @api_client.config.client_side_validation && orderid.nil?
108
+ fail ArgumentError, "Missing the required parameter 'orderid' when calling PreordersApi.preorder_check"
109
+ end
110
+ # resource path
111
+ local_var_path = '/preorder/check'
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+
116
+ # header parameters
117
+ header_params = opts[:header_params] || {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
120
+ # HTTP header 'Content-Type'
121
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
122
+ if !content_type.nil?
123
+ header_params['Content-Type'] = content_type
124
+ end
125
+
126
+ # form parameters
127
+ form_params = opts[:form_params] || {}
128
+ form_params['orderid'] = orderid
129
+
130
+ # http body (model)
131
+ post_body = opts[:debug_body]
132
+
133
+ # return_type
134
+ return_type = opts[:debug_return_type] || 'Object'
135
+
136
+ # auth_names
137
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
138
+
139
+ new_options = opts.merge(
140
+ :operation => :"PreordersApi.preorder_check",
141
+ :header_params => header_params,
142
+ :query_params => query_params,
143
+ :form_params => form_params,
144
+ :body => post_body,
145
+ :auth_names => auth_names,
146
+ :return_type => return_type
147
+ )
148
+
149
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug "API called: PreordersApi#preorder_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
152
+ end
153
+ return data, status_code, headers
154
+ end
155
+
156
+ # Create
157
+ # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
158
+ # @param country [String] Country name or country ID which can be retrieved at the /country/retrieve_all endpoint
159
+ # @param pool [String]
160
+ # @param max_price [Float]
161
+ # @param [Hash] opts the optional parameters
162
+ # @option opts [String] :areacode
163
+ # @return [Object]
164
+ def preorder_create(service, country, pool, max_price, opts = {})
165
+ data, _status_code, _headers = preorder_create_with_http_info(service, country, pool, max_price, opts)
166
+ data
167
+ end
168
+
169
+ # Create
170
+ # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
171
+ # @param country [String] Country name or country ID which can be retrieved at the /country/retrieve_all endpoint
172
+ # @param pool [String]
173
+ # @param max_price [Float]
174
+ # @param [Hash] opts the optional parameters
175
+ # @option opts [String] :areacode
176
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
177
+ def preorder_create_with_http_info(service, country, pool, max_price, opts = {})
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug 'Calling API: PreordersApi.preorder_create ...'
180
+ end
181
+ # verify the required parameter 'service' is set
182
+ if @api_client.config.client_side_validation && service.nil?
183
+ fail ArgumentError, "Missing the required parameter 'service' when calling PreordersApi.preorder_create"
184
+ end
185
+ # verify the required parameter 'country' is set
186
+ if @api_client.config.client_side_validation && country.nil?
187
+ fail ArgumentError, "Missing the required parameter 'country' when calling PreordersApi.preorder_create"
188
+ end
189
+ # verify the required parameter 'pool' is set
190
+ if @api_client.config.client_side_validation && pool.nil?
191
+ fail ArgumentError, "Missing the required parameter 'pool' when calling PreordersApi.preorder_create"
192
+ end
193
+ # verify the required parameter 'max_price' is set
194
+ if @api_client.config.client_side_validation && max_price.nil?
195
+ fail ArgumentError, "Missing the required parameter 'max_price' when calling PreordersApi.preorder_create"
196
+ end
197
+ # resource path
198
+ local_var_path = '/preorder/create'
199
+
200
+ # query parameters
201
+ query_params = opts[:query_params] || {}
202
+
203
+ # header parameters
204
+ header_params = opts[:header_params] || {}
205
+ # HTTP header 'Accept' (if needed)
206
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
207
+ # HTTP header 'Content-Type'
208
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
209
+ if !content_type.nil?
210
+ header_params['Content-Type'] = content_type
211
+ end
212
+
213
+ # form parameters
214
+ form_params = opts[:form_params] || {}
215
+ form_params['service'] = service
216
+ form_params['country'] = country
217
+ form_params['pool'] = pool
218
+ form_params['max_price'] = max_price
219
+ form_params['areacode'] = opts[:'areacode'] if !opts[:'areacode'].nil?
220
+
221
+ # http body (model)
222
+ post_body = opts[:debug_body]
223
+
224
+ # return_type
225
+ return_type = opts[:debug_return_type] || 'Object'
226
+
227
+ # auth_names
228
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
229
+
230
+ new_options = opts.merge(
231
+ :operation => :"PreordersApi.preorder_create",
232
+ :header_params => header_params,
233
+ :query_params => query_params,
234
+ :form_params => form_params,
235
+ :body => post_body,
236
+ :auth_names => auth_names,
237
+ :return_type => return_type
238
+ )
239
+
240
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug "API called: PreordersApi#preorder_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
+ end
244
+ return data, status_code, headers
245
+ end
246
+
247
+ # Price
248
+ # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
249
+ # @param country [String] Country name or country ID which can be retrieved at the /country/retrieve_all endpoint
250
+ # @param pool [String]
251
+ # @param [Hash] opts the optional parameters
252
+ # @return [Object]
253
+ def preorder_price(service, country, pool, opts = {})
254
+ data, _status_code, _headers = preorder_price_with_http_info(service, country, pool, opts)
255
+ data
256
+ end
257
+
258
+ # Price
259
+ # @param service [String] Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
260
+ # @param country [String] Country name or country ID which can be retrieved at the /country/retrieve_all endpoint
261
+ # @param pool [String]
262
+ # @param [Hash] opts the optional parameters
263
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
264
+ def preorder_price_with_http_info(service, country, pool, opts = {})
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug 'Calling API: PreordersApi.preorder_price ...'
267
+ end
268
+ # verify the required parameter 'service' is set
269
+ if @api_client.config.client_side_validation && service.nil?
270
+ fail ArgumentError, "Missing the required parameter 'service' when calling PreordersApi.preorder_price"
271
+ end
272
+ # verify the required parameter 'country' is set
273
+ if @api_client.config.client_side_validation && country.nil?
274
+ fail ArgumentError, "Missing the required parameter 'country' when calling PreordersApi.preorder_price"
275
+ end
276
+ # verify the required parameter 'pool' is set
277
+ if @api_client.config.client_side_validation && pool.nil?
278
+ fail ArgumentError, "Missing the required parameter 'pool' when calling PreordersApi.preorder_price"
279
+ end
280
+ # resource path
281
+ local_var_path = '/preorder/price'
282
+
283
+ # query parameters
284
+ query_params = opts[:query_params] || {}
285
+
286
+ # header parameters
287
+ header_params = opts[:header_params] || {}
288
+ # HTTP header 'Accept' (if needed)
289
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
290
+ # HTTP header 'Content-Type'
291
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
292
+ if !content_type.nil?
293
+ header_params['Content-Type'] = content_type
294
+ end
295
+
296
+ # form parameters
297
+ form_params = opts[:form_params] || {}
298
+ form_params['service'] = service
299
+ form_params['country'] = country
300
+ form_params['pool'] = pool
301
+
302
+ # http body (model)
303
+ post_body = opts[:debug_body]
304
+
305
+ # return_type
306
+ return_type = opts[:debug_return_type] || 'Object'
307
+
308
+ # auth_names
309
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
310
+
311
+ new_options = opts.merge(
312
+ :operation => :"PreordersApi.preorder_price",
313
+ :header_params => header_params,
314
+ :query_params => query_params,
315
+ :form_params => form_params,
316
+ :body => post_body,
317
+ :auth_names => auth_names,
318
+ :return_type => return_type
319
+ )
320
+
321
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
322
+ if @api_client.config.debugging
323
+ @api_client.config.logger.debug "API called: PreordersApi#preorder_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
324
+ end
325
+ return data, status_code, headers
326
+ end
327
+
328
+ # Retrieve
329
+ # This API endpoint allows you to retrieve preorders from the SMS Pool system. It is an HTTP POST request sent to the URL `https://api.smspool.net/preorder/retrieve`. ### Request Parameters This endpoint requires the \\`key\\` parameter which is your API key.
330
+ # @param [Hash] opts the optional parameters
331
+ # @return [Object]
332
+ def preorder_retrieve(opts = {})
333
+ data, _status_code, _headers = preorder_retrieve_with_http_info(opts)
334
+ data
335
+ end
336
+
337
+ # Retrieve
338
+ # This API endpoint allows you to retrieve preorders from the SMS Pool system. It is an HTTP POST request sent to the URL &#x60;https://api.smspool.net/preorder/retrieve&#x60;. ### Request Parameters This endpoint requires the \\&#x60;key\\&#x60; parameter which is your API key.
339
+ # @param [Hash] opts the optional parameters
340
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
341
+ def preorder_retrieve_with_http_info(opts = {})
342
+ if @api_client.config.debugging
343
+ @api_client.config.logger.debug 'Calling API: PreordersApi.preorder_retrieve ...'
344
+ end
345
+ # resource path
346
+ local_var_path = '/preorder/retrieve'
347
+
348
+ # query parameters
349
+ query_params = opts[:query_params] || {}
350
+
351
+ # header parameters
352
+ header_params = opts[:header_params] || {}
353
+ # HTTP header 'Accept' (if needed)
354
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
355
+
356
+ # form parameters
357
+ form_params = opts[:form_params] || {}
358
+
359
+ # http body (model)
360
+ post_body = opts[:debug_body]
361
+
362
+ # return_type
363
+ return_type = opts[:debug_return_type] || 'Object'
364
+
365
+ # auth_names
366
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
367
+
368
+ new_options = opts.merge(
369
+ :operation => :"PreordersApi.preorder_retrieve",
370
+ :header_params => header_params,
371
+ :query_params => query_params,
372
+ :form_params => form_params,
373
+ :body => post_body,
374
+ :auth_names => auth_names,
375
+ :return_type => return_type
376
+ )
377
+
378
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
379
+ if @api_client.config.debugging
380
+ @api_client.config.logger.debug "API called: PreordersApi#preorder_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
381
+ end
382
+ return data, status_code, headers
383
+ end
384
+ end
385
+ end
@@ -0,0 +1,174 @@
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 PricingApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Retrieve specific price & Success Rate
23
+ # @param country [String] Country retrieved from &#39;&#39;Country list\\\&quot; endpoint
24
+ # @param service [String] Service retrieved from &#39;&#39;Service list\\\&quot; endpoint
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :pool Pool retrieved from &#39;&#39;Pool list\\\&quot; endpoint
27
+ # @option opts [String] :skip_success_rate
28
+ # @return [Object]
29
+ def request_price(country, service, opts = {})
30
+ data, _status_code, _headers = request_price_with_http_info(country, service, opts)
31
+ data
32
+ end
33
+
34
+ # Retrieve specific price &amp; Success Rate
35
+ # @param country [String] Country retrieved from &#39;&#39;Country list\\\&quot; endpoint
36
+ # @param service [String] Service retrieved from &#39;&#39;Service list\\\&quot; endpoint
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [String] :pool Pool retrieved from &#39;&#39;Pool list\\\&quot; endpoint
39
+ # @option opts [String] :skip_success_rate
40
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
41
+ def request_price_with_http_info(country, service, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: PricingApi.request_price ...'
44
+ end
45
+ # verify the required parameter 'country' is set
46
+ if @api_client.config.client_side_validation && country.nil?
47
+ fail ArgumentError, "Missing the required parameter 'country' when calling PricingApi.request_price"
48
+ end
49
+ # verify the required parameter 'service' is set
50
+ if @api_client.config.client_side_validation && service.nil?
51
+ fail ArgumentError, "Missing the required parameter 'service' when calling PricingApi.request_price"
52
+ end
53
+ # resource path
54
+ local_var_path = '/request/price'
55
+
56
+ # query parameters
57
+ query_params = opts[:query_params] || {}
58
+
59
+ # header parameters
60
+ header_params = opts[:header_params] || {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
63
+ # HTTP header 'Content-Type'
64
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
65
+ if !content_type.nil?
66
+ header_params['Content-Type'] = content_type
67
+ end
68
+
69
+ # form parameters
70
+ form_params = opts[:form_params] || {}
71
+ form_params['country'] = country
72
+ form_params['service'] = service
73
+ form_params['pool'] = opts[:'pool'] if !opts[:'pool'].nil?
74
+ form_params['skip_success_rate'] = opts[:'skip_success_rate'] if !opts[:'skip_success_rate'].nil?
75
+
76
+ # http body (model)
77
+ post_body = opts[:debug_body]
78
+
79
+ # return_type
80
+ return_type = opts[:debug_return_type] || 'Object'
81
+
82
+ # auth_names
83
+ auth_names = opts[:debug_auth_names] || []
84
+
85
+ new_options = opts.merge(
86
+ :operation => :"PricingApi.request_price",
87
+ :header_params => header_params,
88
+ :query_params => query_params,
89
+ :form_params => form_params,
90
+ :body => post_body,
91
+ :auth_names => auth_names,
92
+ :return_type => return_type
93
+ )
94
+
95
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
96
+ if @api_client.config.debugging
97
+ @api_client.config.logger.debug "API called: PricingApi#request_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
+ end
99
+ return data, status_code, headers
100
+ end
101
+
102
+ # Retrieve all pricing
103
+ # @param [Hash] opts the optional parameters
104
+ # @option opts [String] :country Optional parameter to request services per country
105
+ # @option opts [String] :service Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
106
+ # @option opts [String] :pool
107
+ # @option opts [Float] :max_price
108
+ # @return [Object]
109
+ def request_pricing(opts = {})
110
+ data, _status_code, _headers = request_pricing_with_http_info(opts)
111
+ data
112
+ end
113
+
114
+ # Retrieve all pricing
115
+ # @param [Hash] opts the optional parameters
116
+ # @option opts [String] :country Optional parameter to request services per country
117
+ # @option opts [String] :service Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
118
+ # @option opts [String] :pool
119
+ # @option opts [Float] :max_price
120
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
121
+ def request_pricing_with_http_info(opts = {})
122
+ if @api_client.config.debugging
123
+ @api_client.config.logger.debug 'Calling API: PricingApi.request_pricing ...'
124
+ end
125
+ # resource path
126
+ local_var_path = '/request/pricing'
127
+
128
+ # query parameters
129
+ query_params = opts[:query_params] || {}
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
+ # HTTP header 'Content-Type'
136
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
137
+ if !content_type.nil?
138
+ header_params['Content-Type'] = content_type
139
+ end
140
+
141
+ # form parameters
142
+ form_params = opts[:form_params] || {}
143
+ form_params['country'] = opts[:'country'] if !opts[:'country'].nil?
144
+ form_params['service'] = opts[:'service'] if !opts[:'service'].nil?
145
+ form_params['pool'] = opts[:'pool'] if !opts[:'pool'].nil?
146
+ form_params['max_price'] = opts[:'max_price'] if !opts[:'max_price'].nil?
147
+
148
+ # http body (model)
149
+ post_body = opts[:debug_body]
150
+
151
+ # return_type
152
+ return_type = opts[:debug_return_type] || 'Object'
153
+
154
+ # auth_names
155
+ auth_names = opts[:debug_auth_names] || []
156
+
157
+ new_options = opts.merge(
158
+ :operation => :"PricingApi.request_pricing",
159
+ :header_params => header_params,
160
+ :query_params => query_params,
161
+ :form_params => form_params,
162
+ :body => post_body,
163
+ :auth_names => auth_names,
164
+ :return_type => return_type
165
+ )
166
+
167
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug "API called: PricingApi#request_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
170
+ end
171
+ return data, status_code, headers
172
+ end
173
+ end
174
+ end