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,637 @@
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 ESIMsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete eSIM
23
+ # @param transaction_id [String] transactionId retrieved from /esim/purchase
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Object]
26
+ def esim_delete(transaction_id, opts = {})
27
+ data, _status_code, _headers = esim_delete_with_http_info(transaction_id, opts)
28
+ data
29
+ end
30
+
31
+ # Delete eSIM
32
+ # @param transaction_id [String] transactionId retrieved from /esim/purchase
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
35
+ def esim_delete_with_http_info(transaction_id, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_delete ...'
38
+ end
39
+ # verify the required parameter 'transaction_id' is set
40
+ if @api_client.config.client_side_validation && transaction_id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling ESIMsApi.esim_delete"
42
+ end
43
+ # resource path
44
+ local_var_path = '/esim/delete'
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['transactionId'] = transaction_id
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 => :"ESIMsApi.esim_delete",
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: ESIMsApi#esim_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # View eSIM history
90
+ # @param [Hash] opts the optional parameters
91
+ # @option opts [Integer] :start Start page
92
+ # @option opts [Integer] :length Amount of rows per page
93
+ # @option opts [String] :search Alphanumeric search
94
+ # @return [Object]
95
+ def esim_history(opts = {})
96
+ data, _status_code, _headers = esim_history_with_http_info(opts)
97
+ data
98
+ end
99
+
100
+ # View eSIM history
101
+ # @param [Hash] opts the optional parameters
102
+ # @option opts [Integer] :start Start page
103
+ # @option opts [Integer] :length Amount of rows per page
104
+ # @option opts [String] :search Alphanumeric search
105
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
106
+ def esim_history_with_http_info(opts = {})
107
+ if @api_client.config.debugging
108
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_history ...'
109
+ end
110
+ # resource path
111
+ local_var_path = '/esim/history'
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['start'] = opts[:'start'] if !opts[:'start'].nil?
129
+ form_params['length'] = opts[:'length'] if !opts[:'length'].nil?
130
+ form_params['search'] = opts[:'search'] if !opts[:'search'].nil?
131
+
132
+ # http body (model)
133
+ post_body = opts[:debug_body]
134
+
135
+ # return_type
136
+ return_type = opts[:debug_return_type] || 'Object'
137
+
138
+ # auth_names
139
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
140
+
141
+ new_options = opts.merge(
142
+ :operation => :"ESIMsApi.esim_history",
143
+ :header_params => header_params,
144
+ :query_params => query_params,
145
+ :form_params => form_params,
146
+ :body => post_body,
147
+ :auth_names => auth_names,
148
+ :return_type => return_type
149
+ )
150
+
151
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
152
+ if @api_client.config.debugging
153
+ @api_client.config.logger.debug "API called: ESIMsApi#esim_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
154
+ end
155
+ return data, status_code, headers
156
+ end
157
+
158
+ # Update eSIM label
159
+ # Set or clear the label of one of your eSIMs. The label is returned as `label` by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave `label` out, or send it empty, to remove the label.
160
+ # @param transaction_id [String] transactionId retrieved from /esim/purchase
161
+ # @param [Hash] opts the optional parameters
162
+ # @option opts [String] :label The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label.
163
+ # @return [Object]
164
+ def esim_label_update(transaction_id, opts = {})
165
+ data, _status_code, _headers = esim_label_update_with_http_info(transaction_id, opts)
166
+ data
167
+ end
168
+
169
+ # Update eSIM label
170
+ # Set or clear the label of one of your eSIMs. The label is returned as &#x60;label&#x60; by **View eSIM history**, so you can use it to tell your eSIMs apart. A label can be up to 30 characters long and may only contain letters, numbers and spaces. Leave &#x60;label&#x60; out, or send it empty, to remove the label.
171
+ # @param transaction_id [String] transactionId retrieved from /esim/purchase
172
+ # @param [Hash] opts the optional parameters
173
+ # @option opts [String] :label The new label: letters, numbers and spaces, at most 30 characters. Empty or left out removes the label.
174
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
175
+ def esim_label_update_with_http_info(transaction_id, opts = {})
176
+ if @api_client.config.debugging
177
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_label_update ...'
178
+ end
179
+ # verify the required parameter 'transaction_id' is set
180
+ if @api_client.config.client_side_validation && transaction_id.nil?
181
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling ESIMsApi.esim_label_update"
182
+ end
183
+ # resource path
184
+ local_var_path = '/esim/label/update'
185
+
186
+ # query parameters
187
+ query_params = opts[:query_params] || {}
188
+
189
+ # header parameters
190
+ header_params = opts[:header_params] || {}
191
+ # HTTP header 'Accept' (if needed)
192
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
193
+ # HTTP header 'Content-Type'
194
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
195
+ if !content_type.nil?
196
+ header_params['Content-Type'] = content_type
197
+ end
198
+
199
+ # form parameters
200
+ form_params = opts[:form_params] || {}
201
+ form_params['transactionId'] = transaction_id
202
+ form_params['label'] = opts[:'label'] if !opts[:'label'].nil?
203
+
204
+ # http body (model)
205
+ post_body = opts[:debug_body]
206
+
207
+ # return_type
208
+ return_type = opts[:debug_return_type] || 'Object'
209
+
210
+ # auth_names
211
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
212
+
213
+ new_options = opts.merge(
214
+ :operation => :"ESIMsApi.esim_label_update",
215
+ :header_params => header_params,
216
+ :query_params => query_params,
217
+ :form_params => form_params,
218
+ :body => post_body,
219
+ :auth_names => auth_names,
220
+ :return_type => return_type
221
+ )
222
+
223
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
224
+ if @api_client.config.debugging
225
+ @api_client.config.logger.debug "API called: ESIMsApi#esim_label_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
226
+ end
227
+ return data, status_code, headers
228
+ end
229
+
230
+ # View eSIM plans per country
231
+ # @param country [String] ISO 3166 country code
232
+ # @param [Hash] opts the optional parameters
233
+ # @return [Object]
234
+ def esim_plans(country, opts = {})
235
+ data, _status_code, _headers = esim_plans_with_http_info(country, opts)
236
+ data
237
+ end
238
+
239
+ # View eSIM plans per country
240
+ # @param country [String] ISO 3166 country code
241
+ # @param [Hash] opts the optional parameters
242
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
243
+ def esim_plans_with_http_info(country, opts = {})
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_plans ...'
246
+ end
247
+ # verify the required parameter 'country' is set
248
+ if @api_client.config.client_side_validation && country.nil?
249
+ fail ArgumentError, "Missing the required parameter 'country' when calling ESIMsApi.esim_plans"
250
+ end
251
+ # resource path
252
+ local_var_path = '/esim/plans'
253
+
254
+ # query parameters
255
+ query_params = opts[:query_params] || {}
256
+
257
+ # header parameters
258
+ header_params = opts[:header_params] || {}
259
+ # HTTP header 'Accept' (if needed)
260
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
261
+ # HTTP header 'Content-Type'
262
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
263
+ if !content_type.nil?
264
+ header_params['Content-Type'] = content_type
265
+ end
266
+
267
+ # form parameters
268
+ form_params = opts[:form_params] || {}
269
+ form_params['country'] = country
270
+
271
+ # http body (model)
272
+ post_body = opts[:debug_body]
273
+
274
+ # return_type
275
+ return_type = opts[:debug_return_type] || 'Object'
276
+
277
+ # auth_names
278
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
279
+
280
+ new_options = opts.merge(
281
+ :operation => :"ESIMsApi.esim_plans",
282
+ :header_params => header_params,
283
+ :query_params => query_params,
284
+ :form_params => form_params,
285
+ :body => post_body,
286
+ :auth_names => auth_names,
287
+ :return_type => return_type
288
+ )
289
+
290
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
291
+ if @api_client.config.debugging
292
+ @api_client.config.logger.debug "API called: ESIMsApi#esim_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
293
+ end
294
+ return data, status_code, headers
295
+ end
296
+
297
+ # View eSIM countries
298
+ # @param [Hash] opts the optional parameters
299
+ # @option opts [Integer] :start Start page
300
+ # @option opts [Integer] :length Amount of rows per page
301
+ # @option opts [String] :search Search query for country
302
+ # @return [Object]
303
+ def esim_pricing(opts = {})
304
+ data, _status_code, _headers = esim_pricing_with_http_info(opts)
305
+ data
306
+ end
307
+
308
+ # View eSIM countries
309
+ # @param [Hash] opts the optional parameters
310
+ # @option opts [Integer] :start Start page
311
+ # @option opts [Integer] :length Amount of rows per page
312
+ # @option opts [String] :search Search query for country
313
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
314
+ def esim_pricing_with_http_info(opts = {})
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_pricing ...'
317
+ end
318
+ # resource path
319
+ local_var_path = '/esim/pricing'
320
+
321
+ # query parameters
322
+ query_params = opts[:query_params] || {}
323
+
324
+ # header parameters
325
+ header_params = opts[:header_params] || {}
326
+ # HTTP header 'Accept' (if needed)
327
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
328
+ # HTTP header 'Content-Type'
329
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
330
+ if !content_type.nil?
331
+ header_params['Content-Type'] = content_type
332
+ end
333
+
334
+ # form parameters
335
+ form_params = opts[:form_params] || {}
336
+ form_params['start'] = opts[:'start'] if !opts[:'start'].nil?
337
+ form_params['length'] = opts[:'length'] if !opts[:'length'].nil?
338
+ form_params['search'] = opts[:'search'] if !opts[:'search'].nil?
339
+
340
+ # http body (model)
341
+ post_body = opts[:debug_body]
342
+
343
+ # return_type
344
+ return_type = opts[:debug_return_type] || 'Object'
345
+
346
+ # auth_names
347
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
348
+
349
+ new_options = opts.merge(
350
+ :operation => :"ESIMsApi.esim_pricing",
351
+ :header_params => header_params,
352
+ :query_params => query_params,
353
+ :form_params => form_params,
354
+ :body => post_body,
355
+ :auth_names => auth_names,
356
+ :return_type => return_type
357
+ )
358
+
359
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
360
+ if @api_client.config.debugging
361
+ @api_client.config.logger.debug "API called: ESIMsApi#esim_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
362
+ end
363
+ return data, status_code, headers
364
+ end
365
+
366
+ # View eSIM profile
367
+ # @param [Hash] opts the optional parameters
368
+ # @option opts [String] :transaction_id transactionId retrieved from /esim/purchase
369
+ # @return [Object]
370
+ def esim_profile(opts = {})
371
+ data, _status_code, _headers = esim_profile_with_http_info(opts)
372
+ data
373
+ end
374
+
375
+ # View eSIM profile
376
+ # @param [Hash] opts the optional parameters
377
+ # @option opts [String] :transaction_id transactionId retrieved from /esim/purchase
378
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
379
+ def esim_profile_with_http_info(opts = {})
380
+ if @api_client.config.debugging
381
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_profile ...'
382
+ end
383
+ # resource path
384
+ local_var_path = '/esim/profile'
385
+
386
+ # query parameters
387
+ query_params = opts[:query_params] || {}
388
+
389
+ # header parameters
390
+ header_params = opts[:header_params] || {}
391
+ # HTTP header 'Accept' (if needed)
392
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
393
+ # HTTP header 'Content-Type'
394
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
395
+ if !content_type.nil?
396
+ header_params['Content-Type'] = content_type
397
+ end
398
+
399
+ # form parameters
400
+ form_params = opts[:form_params] || {}
401
+ form_params['transactionId'] = opts[:'transaction_id'] if !opts[:'transaction_id'].nil?
402
+
403
+ # http body (model)
404
+ post_body = opts[:debug_body]
405
+
406
+ # return_type
407
+ return_type = opts[:debug_return_type] || 'Object'
408
+
409
+ # auth_names
410
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
411
+
412
+ new_options = opts.merge(
413
+ :operation => :"ESIMsApi.esim_profile",
414
+ :header_params => header_params,
415
+ :query_params => query_params,
416
+ :form_params => form_params,
417
+ :body => post_body,
418
+ :auth_names => auth_names,
419
+ :return_type => return_type
420
+ )
421
+
422
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
423
+ if @api_client.config.debugging
424
+ @api_client.config.logger.debug "API called: ESIMsApi#esim_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
425
+ end
426
+ return data, status_code, headers
427
+ end
428
+
429
+ # Purchase eSIM
430
+ # @param plan [Integer] The plan ID which is obtained from /esim/pricing
431
+ # @param [Hash] opts the optional parameters
432
+ # @return [Object]
433
+ def esim_purchase(plan, opts = {})
434
+ data, _status_code, _headers = esim_purchase_with_http_info(plan, opts)
435
+ data
436
+ end
437
+
438
+ # Purchase eSIM
439
+ # @param plan [Integer] The plan ID which is obtained from /esim/pricing
440
+ # @param [Hash] opts the optional parameters
441
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
442
+ def esim_purchase_with_http_info(plan, opts = {})
443
+ if @api_client.config.debugging
444
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_purchase ...'
445
+ end
446
+ # verify the required parameter 'plan' is set
447
+ if @api_client.config.client_side_validation && plan.nil?
448
+ fail ArgumentError, "Missing the required parameter 'plan' when calling ESIMsApi.esim_purchase"
449
+ end
450
+ # resource path
451
+ local_var_path = '/esim/purchase'
452
+
453
+ # query parameters
454
+ query_params = opts[:query_params] || {}
455
+
456
+ # header parameters
457
+ header_params = opts[:header_params] || {}
458
+ # HTTP header 'Accept' (if needed)
459
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
460
+ # HTTP header 'Content-Type'
461
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
462
+ if !content_type.nil?
463
+ header_params['Content-Type'] = content_type
464
+ end
465
+
466
+ # form parameters
467
+ form_params = opts[:form_params] || {}
468
+ form_params['plan'] = plan
469
+
470
+ # http body (model)
471
+ post_body = opts[:debug_body]
472
+
473
+ # return_type
474
+ return_type = opts[:debug_return_type] || 'Object'
475
+
476
+ # auth_names
477
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
478
+
479
+ new_options = opts.merge(
480
+ :operation => :"ESIMsApi.esim_purchase",
481
+ :header_params => header_params,
482
+ :query_params => query_params,
483
+ :form_params => form_params,
484
+ :body => post_body,
485
+ :auth_names => auth_names,
486
+ :return_type => return_type
487
+ )
488
+
489
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
490
+ if @api_client.config.debugging
491
+ @api_client.config.logger.debug "API called: ESIMsApi#esim_purchase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
492
+ end
493
+ return data, status_code, headers
494
+ end
495
+
496
+ # Top up eSIM
497
+ # @param transaction_id [String] Transaction ID retrieved from eSIM history
498
+ # @param plan [Integer] Topup plan retrieved from \\\&quot;Top Up Plans\\\&quot;
499
+ # @param [Hash] opts the optional parameters
500
+ # @return [Object]
501
+ def esim_topup(transaction_id, plan, opts = {})
502
+ data, _status_code, _headers = esim_topup_with_http_info(transaction_id, plan, opts)
503
+ data
504
+ end
505
+
506
+ # Top up eSIM
507
+ # @param transaction_id [String] Transaction ID retrieved from eSIM history
508
+ # @param plan [Integer] Topup plan retrieved from \\\&quot;Top Up Plans\\\&quot;
509
+ # @param [Hash] opts the optional parameters
510
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
511
+ def esim_topup_with_http_info(transaction_id, plan, opts = {})
512
+ if @api_client.config.debugging
513
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_topup ...'
514
+ end
515
+ # verify the required parameter 'transaction_id' is set
516
+ if @api_client.config.client_side_validation && transaction_id.nil?
517
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling ESIMsApi.esim_topup"
518
+ end
519
+ # verify the required parameter 'plan' is set
520
+ if @api_client.config.client_side_validation && plan.nil?
521
+ fail ArgumentError, "Missing the required parameter 'plan' when calling ESIMsApi.esim_topup"
522
+ end
523
+ # resource path
524
+ local_var_path = '/esim/topup'
525
+
526
+ # query parameters
527
+ query_params = opts[:query_params] || {}
528
+
529
+ # header parameters
530
+ header_params = opts[:header_params] || {}
531
+ # HTTP header 'Accept' (if needed)
532
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
533
+ # HTTP header 'Content-Type'
534
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
535
+ if !content_type.nil?
536
+ header_params['Content-Type'] = content_type
537
+ end
538
+
539
+ # form parameters
540
+ form_params = opts[:form_params] || {}
541
+ form_params['transactionId'] = transaction_id
542
+ form_params['plan'] = plan
543
+
544
+ # http body (model)
545
+ post_body = opts[:debug_body]
546
+
547
+ # return_type
548
+ return_type = opts[:debug_return_type] || 'Object'
549
+
550
+ # auth_names
551
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
552
+
553
+ new_options = opts.merge(
554
+ :operation => :"ESIMsApi.esim_topup",
555
+ :header_params => header_params,
556
+ :query_params => query_params,
557
+ :form_params => form_params,
558
+ :body => post_body,
559
+ :auth_names => auth_names,
560
+ :return_type => return_type
561
+ )
562
+
563
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
564
+ if @api_client.config.debugging
565
+ @api_client.config.logger.debug "API called: ESIMsApi#esim_topup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
566
+ end
567
+ return data, status_code, headers
568
+ end
569
+
570
+ # Top Up Plans
571
+ # @param plan [Integer] &#x60;plan&#x60; retrieved from eSIM history
572
+ # @param [Hash] opts the optional parameters
573
+ # @return [Object]
574
+ def esim_topup_plans(plan, opts = {})
575
+ data, _status_code, _headers = esim_topup_plans_with_http_info(plan, opts)
576
+ data
577
+ end
578
+
579
+ # Top Up Plans
580
+ # @param plan [Integer] &#x60;plan&#x60; retrieved from eSIM history
581
+ # @param [Hash] opts the optional parameters
582
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
583
+ def esim_topup_plans_with_http_info(plan, opts = {})
584
+ if @api_client.config.debugging
585
+ @api_client.config.logger.debug 'Calling API: ESIMsApi.esim_topup_plans ...'
586
+ end
587
+ # verify the required parameter 'plan' is set
588
+ if @api_client.config.client_side_validation && plan.nil?
589
+ fail ArgumentError, "Missing the required parameter 'plan' when calling ESIMsApi.esim_topup_plans"
590
+ end
591
+ # resource path
592
+ local_var_path = '/esim/topup_plans'
593
+
594
+ # query parameters
595
+ query_params = opts[:query_params] || {}
596
+
597
+ # header parameters
598
+ header_params = opts[:header_params] || {}
599
+ # HTTP header 'Accept' (if needed)
600
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
601
+ # HTTP header 'Content-Type'
602
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
603
+ if !content_type.nil?
604
+ header_params['Content-Type'] = content_type
605
+ end
606
+
607
+ # form parameters
608
+ form_params = opts[:form_params] || {}
609
+ form_params['plan'] = plan
610
+
611
+ # http body (model)
612
+ post_body = opts[:debug_body]
613
+
614
+ # return_type
615
+ return_type = opts[:debug_return_type] || 'Object'
616
+
617
+ # auth_names
618
+ auth_names = opts[:debug_auth_names] || []
619
+
620
+ new_options = opts.merge(
621
+ :operation => :"ESIMsApi.esim_topup_plans",
622
+ :header_params => header_params,
623
+ :query_params => query_params,
624
+ :form_params => form_params,
625
+ :body => post_body,
626
+ :auth_names => auth_names,
627
+ :return_type => return_type
628
+ )
629
+
630
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
631
+ if @api_client.config.debugging
632
+ @api_client.config.logger.debug "API called: ESIMsApi#esim_topup_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
633
+ end
634
+ return data, status_code, headers
635
+ end
636
+ end
637
+ end