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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +61 -0
- data/lib/smspool/api/business_api.rb +300 -0
- data/lib/smspool/api/carrier_api.rb +91 -0
- data/lib/smspool/api/esims_api.rb +637 -0
- data/lib/smspool/api/information_api.rb +479 -0
- data/lib/smspool/api/preorders_api.rb +385 -0
- data/lib/smspool/api/pricing_api.rb +174 -0
- data/lib/smspool/api/rental_api.rb +1115 -0
- data/lib/smspool/api/sms_api.rb +1214 -0
- data/lib/smspool/api/voucher_api.rb +285 -0
- data/lib/smspool/api_client.rb +397 -0
- data/lib/smspool/api_error.rb +58 -0
- data/lib/smspool/api_model_base.rb +88 -0
- data/lib/smspool/configuration.rb +308 -0
- data/lib/smspool/version.rb +15 -0
- data/lib/smspool.rb +49 -0
- metadata +100 -0
|
@@ -0,0 +1,1115 @@
|
|
|
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 RentalApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Order Rental
|
|
23
|
+
# @param id [Integer] Rental ID retrieved from Retrieve Rental IDs
|
|
24
|
+
# @param days [Integer]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [Integer] :service_id Optional value on which service you'd purchase the rental for
|
|
27
|
+
# @option opts [Integer] :create_token Create a rental token which allows you to share this specific rental
|
|
28
|
+
# @option opts [String] :city
|
|
29
|
+
# @option opts [String] :state
|
|
30
|
+
# @option opts [String] :zipcode
|
|
31
|
+
# @return [Object]
|
|
32
|
+
def purchase_rental(id, days, opts = {})
|
|
33
|
+
data, _status_code, _headers = purchase_rental_with_http_info(id, days, opts)
|
|
34
|
+
data
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Order Rental
|
|
38
|
+
# @param id [Integer] Rental ID retrieved from Retrieve Rental IDs
|
|
39
|
+
# @param days [Integer]
|
|
40
|
+
# @param [Hash] opts the optional parameters
|
|
41
|
+
# @option opts [Integer] :service_id Optional value on which service you'd purchase the rental for
|
|
42
|
+
# @option opts [Integer] :create_token Create a rental token which allows you to share this specific rental
|
|
43
|
+
# @option opts [String] :city
|
|
44
|
+
# @option opts [String] :state
|
|
45
|
+
# @option opts [String] :zipcode
|
|
46
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
47
|
+
def purchase_rental_with_http_info(id, days, opts = {})
|
|
48
|
+
if @api_client.config.debugging
|
|
49
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.purchase_rental ...'
|
|
50
|
+
end
|
|
51
|
+
# verify the required parameter 'id' is set
|
|
52
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
53
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RentalApi.purchase_rental"
|
|
54
|
+
end
|
|
55
|
+
# verify the required parameter 'days' is set
|
|
56
|
+
if @api_client.config.client_side_validation && days.nil?
|
|
57
|
+
fail ArgumentError, "Missing the required parameter 'days' when calling RentalApi.purchase_rental"
|
|
58
|
+
end
|
|
59
|
+
# resource path
|
|
60
|
+
local_var_path = '/purchase/rental'
|
|
61
|
+
|
|
62
|
+
# query parameters
|
|
63
|
+
query_params = opts[:query_params] || {}
|
|
64
|
+
|
|
65
|
+
# header parameters
|
|
66
|
+
header_params = opts[:header_params] || {}
|
|
67
|
+
# HTTP header 'Accept' (if needed)
|
|
68
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
69
|
+
# HTTP header 'Content-Type'
|
|
70
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
71
|
+
if !content_type.nil?
|
|
72
|
+
header_params['Content-Type'] = content_type
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# form parameters
|
|
76
|
+
form_params = opts[:form_params] || {}
|
|
77
|
+
form_params['id'] = id
|
|
78
|
+
form_params['days'] = days
|
|
79
|
+
form_params['service_id'] = opts[:'service_id'] if !opts[:'service_id'].nil?
|
|
80
|
+
form_params['create_token'] = opts[:'create_token'] if !opts[:'create_token'].nil?
|
|
81
|
+
form_params['city'] = opts[:'city'] if !opts[:'city'].nil?
|
|
82
|
+
form_params['state'] = opts[:'state'] if !opts[:'state'].nil?
|
|
83
|
+
form_params['zipcode'] = opts[:'zipcode'] if !opts[:'zipcode'].nil?
|
|
84
|
+
|
|
85
|
+
# http body (model)
|
|
86
|
+
post_body = opts[:debug_body]
|
|
87
|
+
|
|
88
|
+
# return_type
|
|
89
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
90
|
+
|
|
91
|
+
# auth_names
|
|
92
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
93
|
+
|
|
94
|
+
new_options = opts.merge(
|
|
95
|
+
:operation => :"RentalApi.purchase_rental",
|
|
96
|
+
:header_params => header_params,
|
|
97
|
+
:query_params => query_params,
|
|
98
|
+
:form_params => form_params,
|
|
99
|
+
:body => post_body,
|
|
100
|
+
:auth_names => auth_names,
|
|
101
|
+
:return_type => return_type
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
105
|
+
if @api_client.config.debugging
|
|
106
|
+
@api_client.config.logger.debug "API called: RentalApi#purchase_rental\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
107
|
+
end
|
|
108
|
+
return data, status_code, headers
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Enable Auto Extend Rental
|
|
112
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
113
|
+
# @param [Hash] opts the optional parameters
|
|
114
|
+
# @return [Object]
|
|
115
|
+
def rental_auto_extend(rental_code, opts = {})
|
|
116
|
+
data, _status_code, _headers = rental_auto_extend_with_http_info(rental_code, opts)
|
|
117
|
+
data
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Enable Auto Extend Rental
|
|
121
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
122
|
+
# @param [Hash] opts the optional parameters
|
|
123
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
124
|
+
def rental_auto_extend_with_http_info(rental_code, opts = {})
|
|
125
|
+
if @api_client.config.debugging
|
|
126
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_auto_extend ...'
|
|
127
|
+
end
|
|
128
|
+
# verify the required parameter 'rental_code' is set
|
|
129
|
+
if @api_client.config.client_side_validation && rental_code.nil?
|
|
130
|
+
fail ArgumentError, "Missing the required parameter 'rental_code' when calling RentalApi.rental_auto_extend"
|
|
131
|
+
end
|
|
132
|
+
# resource path
|
|
133
|
+
local_var_path = '/rental/auto_extend'
|
|
134
|
+
|
|
135
|
+
# query parameters
|
|
136
|
+
query_params = opts[:query_params] || {}
|
|
137
|
+
|
|
138
|
+
# header parameters
|
|
139
|
+
header_params = opts[:header_params] || {}
|
|
140
|
+
# HTTP header 'Accept' (if needed)
|
|
141
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
142
|
+
# HTTP header 'Content-Type'
|
|
143
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
144
|
+
if !content_type.nil?
|
|
145
|
+
header_params['Content-Type'] = content_type
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# form parameters
|
|
149
|
+
form_params = opts[:form_params] || {}
|
|
150
|
+
form_params['rental_code'] = rental_code
|
|
151
|
+
|
|
152
|
+
# http body (model)
|
|
153
|
+
post_body = opts[:debug_body]
|
|
154
|
+
|
|
155
|
+
# return_type
|
|
156
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
157
|
+
|
|
158
|
+
# auth_names
|
|
159
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
160
|
+
|
|
161
|
+
new_options = opts.merge(
|
|
162
|
+
:operation => :"RentalApi.rental_auto_extend",
|
|
163
|
+
:header_params => header_params,
|
|
164
|
+
:query_params => query_params,
|
|
165
|
+
:form_params => form_params,
|
|
166
|
+
:body => post_body,
|
|
167
|
+
:auth_names => auth_names,
|
|
168
|
+
:return_type => return_type
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
172
|
+
if @api_client.config.debugging
|
|
173
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_auto_extend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
174
|
+
end
|
|
175
|
+
return data, status_code, headers
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Extend Rental
|
|
179
|
+
# @param days [Integer]
|
|
180
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
181
|
+
# @param [Hash] opts the optional parameters
|
|
182
|
+
# @return [Object]
|
|
183
|
+
def rental_extend(days, rental_code, opts = {})
|
|
184
|
+
data, _status_code, _headers = rental_extend_with_http_info(days, rental_code, opts)
|
|
185
|
+
data
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Extend Rental
|
|
189
|
+
# @param days [Integer]
|
|
190
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
191
|
+
# @param [Hash] opts the optional parameters
|
|
192
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
193
|
+
def rental_extend_with_http_info(days, rental_code, opts = {})
|
|
194
|
+
if @api_client.config.debugging
|
|
195
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_extend ...'
|
|
196
|
+
end
|
|
197
|
+
# verify the required parameter 'days' is set
|
|
198
|
+
if @api_client.config.client_side_validation && days.nil?
|
|
199
|
+
fail ArgumentError, "Missing the required parameter 'days' when calling RentalApi.rental_extend"
|
|
200
|
+
end
|
|
201
|
+
# verify the required parameter 'rental_code' is set
|
|
202
|
+
if @api_client.config.client_side_validation && rental_code.nil?
|
|
203
|
+
fail ArgumentError, "Missing the required parameter 'rental_code' when calling RentalApi.rental_extend"
|
|
204
|
+
end
|
|
205
|
+
# resource path
|
|
206
|
+
local_var_path = '/rental/extend'
|
|
207
|
+
|
|
208
|
+
# query parameters
|
|
209
|
+
query_params = opts[:query_params] || {}
|
|
210
|
+
|
|
211
|
+
# header parameters
|
|
212
|
+
header_params = opts[:header_params] || {}
|
|
213
|
+
# HTTP header 'Accept' (if needed)
|
|
214
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
215
|
+
# HTTP header 'Content-Type'
|
|
216
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
217
|
+
if !content_type.nil?
|
|
218
|
+
header_params['Content-Type'] = content_type
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# form parameters
|
|
222
|
+
form_params = opts[:form_params] || {}
|
|
223
|
+
form_params['days'] = days
|
|
224
|
+
form_params['rental_code'] = rental_code
|
|
225
|
+
|
|
226
|
+
# http body (model)
|
|
227
|
+
post_body = opts[:debug_body]
|
|
228
|
+
|
|
229
|
+
# return_type
|
|
230
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
231
|
+
|
|
232
|
+
# auth_names
|
|
233
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
234
|
+
|
|
235
|
+
new_options = opts.merge(
|
|
236
|
+
:operation => :"RentalApi.rental_extend",
|
|
237
|
+
:header_params => header_params,
|
|
238
|
+
:query_params => query_params,
|
|
239
|
+
:form_params => form_params,
|
|
240
|
+
:body => post_body,
|
|
241
|
+
:auth_names => auth_names,
|
|
242
|
+
:return_type => return_type
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
246
|
+
if @api_client.config.debugging
|
|
247
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_extend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
248
|
+
end
|
|
249
|
+
return data, status_code, headers
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Rental History
|
|
253
|
+
# Retrieve a history of all your rental actions.
|
|
254
|
+
# @param [Hash] opts the optional parameters
|
|
255
|
+
# @return [Object]
|
|
256
|
+
def rental_history(opts = {})
|
|
257
|
+
data, _status_code, _headers = rental_history_with_http_info(opts)
|
|
258
|
+
data
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Rental History
|
|
262
|
+
# Retrieve a history of all your rental actions.
|
|
263
|
+
# @param [Hash] opts the optional parameters
|
|
264
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
265
|
+
def rental_history_with_http_info(opts = {})
|
|
266
|
+
if @api_client.config.debugging
|
|
267
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_history ...'
|
|
268
|
+
end
|
|
269
|
+
# resource path
|
|
270
|
+
local_var_path = '/rental/history'
|
|
271
|
+
|
|
272
|
+
# query parameters
|
|
273
|
+
query_params = opts[:query_params] || {}
|
|
274
|
+
|
|
275
|
+
# header parameters
|
|
276
|
+
header_params = opts[:header_params] || {}
|
|
277
|
+
# HTTP header 'Accept' (if needed)
|
|
278
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
279
|
+
|
|
280
|
+
# form parameters
|
|
281
|
+
form_params = opts[:form_params] || {}
|
|
282
|
+
|
|
283
|
+
# http body (model)
|
|
284
|
+
post_body = opts[:debug_body]
|
|
285
|
+
|
|
286
|
+
# return_type
|
|
287
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
288
|
+
|
|
289
|
+
# auth_names
|
|
290
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
291
|
+
|
|
292
|
+
new_options = opts.merge(
|
|
293
|
+
:operation => :"RentalApi.rental_history",
|
|
294
|
+
:header_params => header_params,
|
|
295
|
+
:query_params => query_params,
|
|
296
|
+
:form_params => form_params,
|
|
297
|
+
:body => post_body,
|
|
298
|
+
:auth_names => auth_names,
|
|
299
|
+
:return_type => return_type
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
303
|
+
if @api_client.config.debugging
|
|
304
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
305
|
+
end
|
|
306
|
+
return data, status_code, headers
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Retrieve Rental Info
|
|
310
|
+
# Retrieve rental information
|
|
311
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
312
|
+
# @param [Hash] opts the optional parameters
|
|
313
|
+
# @return [Object]
|
|
314
|
+
def rental_info(rental_code, opts = {})
|
|
315
|
+
data, _status_code, _headers = rental_info_with_http_info(rental_code, opts)
|
|
316
|
+
data
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# Retrieve Rental Info
|
|
320
|
+
# Retrieve rental information
|
|
321
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
322
|
+
# @param [Hash] opts the optional parameters
|
|
323
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
324
|
+
def rental_info_with_http_info(rental_code, opts = {})
|
|
325
|
+
if @api_client.config.debugging
|
|
326
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_info ...'
|
|
327
|
+
end
|
|
328
|
+
# verify the required parameter 'rental_code' is set
|
|
329
|
+
if @api_client.config.client_side_validation && rental_code.nil?
|
|
330
|
+
fail ArgumentError, "Missing the required parameter 'rental_code' when calling RentalApi.rental_info"
|
|
331
|
+
end
|
|
332
|
+
# resource path
|
|
333
|
+
local_var_path = '/rental/info'
|
|
334
|
+
|
|
335
|
+
# query parameters
|
|
336
|
+
query_params = opts[:query_params] || {}
|
|
337
|
+
|
|
338
|
+
# header parameters
|
|
339
|
+
header_params = opts[:header_params] || {}
|
|
340
|
+
# HTTP header 'Accept' (if needed)
|
|
341
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
342
|
+
# HTTP header 'Content-Type'
|
|
343
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
344
|
+
if !content_type.nil?
|
|
345
|
+
header_params['Content-Type'] = content_type
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# form parameters
|
|
349
|
+
form_params = opts[:form_params] || {}
|
|
350
|
+
form_params['rental_code'] = rental_code
|
|
351
|
+
|
|
352
|
+
# http body (model)
|
|
353
|
+
post_body = opts[:debug_body]
|
|
354
|
+
|
|
355
|
+
# return_type
|
|
356
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
357
|
+
|
|
358
|
+
# auth_names
|
|
359
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
360
|
+
|
|
361
|
+
new_options = opts.merge(
|
|
362
|
+
:operation => :"RentalApi.rental_info",
|
|
363
|
+
:header_params => header_params,
|
|
364
|
+
:query_params => query_params,
|
|
365
|
+
:form_params => form_params,
|
|
366
|
+
:body => post_body,
|
|
367
|
+
:auth_names => auth_names,
|
|
368
|
+
:return_type => return_type
|
|
369
|
+
)
|
|
370
|
+
|
|
371
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
372
|
+
if @api_client.config.debugging
|
|
373
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
374
|
+
end
|
|
375
|
+
return data, status_code, headers
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Refund Rental
|
|
379
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
380
|
+
# @param [Hash] opts the optional parameters
|
|
381
|
+
# @return [Object]
|
|
382
|
+
def rental_refund(rental_code, opts = {})
|
|
383
|
+
data, _status_code, _headers = rental_refund_with_http_info(rental_code, opts)
|
|
384
|
+
data
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# Refund Rental
|
|
388
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
389
|
+
# @param [Hash] opts the optional parameters
|
|
390
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
391
|
+
def rental_refund_with_http_info(rental_code, opts = {})
|
|
392
|
+
if @api_client.config.debugging
|
|
393
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_refund ...'
|
|
394
|
+
end
|
|
395
|
+
# verify the required parameter 'rental_code' is set
|
|
396
|
+
if @api_client.config.client_side_validation && rental_code.nil?
|
|
397
|
+
fail ArgumentError, "Missing the required parameter 'rental_code' when calling RentalApi.rental_refund"
|
|
398
|
+
end
|
|
399
|
+
# resource path
|
|
400
|
+
local_var_path = '/rental/refund'
|
|
401
|
+
|
|
402
|
+
# query parameters
|
|
403
|
+
query_params = opts[:query_params] || {}
|
|
404
|
+
|
|
405
|
+
# header parameters
|
|
406
|
+
header_params = opts[:header_params] || {}
|
|
407
|
+
# HTTP header 'Accept' (if needed)
|
|
408
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
409
|
+
# HTTP header 'Content-Type'
|
|
410
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
411
|
+
if !content_type.nil?
|
|
412
|
+
header_params['Content-Type'] = content_type
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
# form parameters
|
|
416
|
+
form_params = opts[:form_params] || {}
|
|
417
|
+
form_params['rental_code'] = rental_code
|
|
418
|
+
|
|
419
|
+
# http body (model)
|
|
420
|
+
post_body = opts[:debug_body]
|
|
421
|
+
|
|
422
|
+
# return_type
|
|
423
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
424
|
+
|
|
425
|
+
# auth_names
|
|
426
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
427
|
+
|
|
428
|
+
new_options = opts.merge(
|
|
429
|
+
:operation => :"RentalApi.rental_refund",
|
|
430
|
+
:header_params => header_params,
|
|
431
|
+
:query_params => query_params,
|
|
432
|
+
:form_params => form_params,
|
|
433
|
+
:body => post_body,
|
|
434
|
+
:auth_names => auth_names,
|
|
435
|
+
:return_type => return_type
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
439
|
+
if @api_client.config.debugging
|
|
440
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
441
|
+
end
|
|
442
|
+
return data, status_code, headers
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
# Reset Rental
|
|
446
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
447
|
+
# @param [Hash] opts the optional parameters
|
|
448
|
+
# @return [Object]
|
|
449
|
+
def rental_reset(rental_code, opts = {})
|
|
450
|
+
data, _status_code, _headers = rental_reset_with_http_info(rental_code, opts)
|
|
451
|
+
data
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
# Reset Rental
|
|
455
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
456
|
+
# @param [Hash] opts the optional parameters
|
|
457
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
458
|
+
def rental_reset_with_http_info(rental_code, opts = {})
|
|
459
|
+
if @api_client.config.debugging
|
|
460
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_reset ...'
|
|
461
|
+
end
|
|
462
|
+
# verify the required parameter 'rental_code' is set
|
|
463
|
+
if @api_client.config.client_side_validation && rental_code.nil?
|
|
464
|
+
fail ArgumentError, "Missing the required parameter 'rental_code' when calling RentalApi.rental_reset"
|
|
465
|
+
end
|
|
466
|
+
# resource path
|
|
467
|
+
local_var_path = '/rental/reset'
|
|
468
|
+
|
|
469
|
+
# query parameters
|
|
470
|
+
query_params = opts[:query_params] || {}
|
|
471
|
+
|
|
472
|
+
# header parameters
|
|
473
|
+
header_params = opts[:header_params] || {}
|
|
474
|
+
# HTTP header 'Accept' (if needed)
|
|
475
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
476
|
+
# HTTP header 'Content-Type'
|
|
477
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
478
|
+
if !content_type.nil?
|
|
479
|
+
header_params['Content-Type'] = content_type
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
# form parameters
|
|
483
|
+
form_params = opts[:form_params] || {}
|
|
484
|
+
form_params['rental_code'] = rental_code
|
|
485
|
+
|
|
486
|
+
# http body (model)
|
|
487
|
+
post_body = opts[:debug_body]
|
|
488
|
+
|
|
489
|
+
# return_type
|
|
490
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
491
|
+
|
|
492
|
+
# auth_names
|
|
493
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
494
|
+
|
|
495
|
+
new_options = opts.merge(
|
|
496
|
+
:operation => :"RentalApi.rental_reset",
|
|
497
|
+
:header_params => header_params,
|
|
498
|
+
:query_params => query_params,
|
|
499
|
+
:form_params => form_params,
|
|
500
|
+
:body => post_body,
|
|
501
|
+
:auth_names => auth_names,
|
|
502
|
+
:return_type => return_type
|
|
503
|
+
)
|
|
504
|
+
|
|
505
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
506
|
+
if @api_client.config.debugging
|
|
507
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
508
|
+
end
|
|
509
|
+
return data, status_code, headers
|
|
510
|
+
end
|
|
511
|
+
|
|
512
|
+
# Retrieve Active Rentals
|
|
513
|
+
# Retrieve a history of all your rental actions.
|
|
514
|
+
# @param [Hash] opts the optional parameters
|
|
515
|
+
# @return [Object]
|
|
516
|
+
def rental_retrieve(opts = {})
|
|
517
|
+
data, _status_code, _headers = rental_retrieve_with_http_info(opts)
|
|
518
|
+
data
|
|
519
|
+
end
|
|
520
|
+
|
|
521
|
+
# Retrieve Active Rentals
|
|
522
|
+
# Retrieve a history of all your rental actions.
|
|
523
|
+
# @param [Hash] opts the optional parameters
|
|
524
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
525
|
+
def rental_retrieve_with_http_info(opts = {})
|
|
526
|
+
if @api_client.config.debugging
|
|
527
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_retrieve ...'
|
|
528
|
+
end
|
|
529
|
+
# resource path
|
|
530
|
+
local_var_path = '/rental/retrieve'
|
|
531
|
+
|
|
532
|
+
# query parameters
|
|
533
|
+
query_params = opts[:query_params] || {}
|
|
534
|
+
|
|
535
|
+
# header parameters
|
|
536
|
+
header_params = opts[:header_params] || {}
|
|
537
|
+
# HTTP header 'Accept' (if needed)
|
|
538
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
539
|
+
|
|
540
|
+
# form parameters
|
|
541
|
+
form_params = opts[:form_params] || {}
|
|
542
|
+
|
|
543
|
+
# http body (model)
|
|
544
|
+
post_body = opts[:debug_body]
|
|
545
|
+
|
|
546
|
+
# return_type
|
|
547
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
548
|
+
|
|
549
|
+
# auth_names
|
|
550
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
551
|
+
|
|
552
|
+
new_options = opts.merge(
|
|
553
|
+
:operation => :"RentalApi.rental_retrieve",
|
|
554
|
+
:header_params => header_params,
|
|
555
|
+
:query_params => query_params,
|
|
556
|
+
:form_params => form_params,
|
|
557
|
+
:body => post_body,
|
|
558
|
+
:auth_names => auth_names,
|
|
559
|
+
:return_type => return_type
|
|
560
|
+
)
|
|
561
|
+
|
|
562
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
563
|
+
if @api_client.config.debugging
|
|
564
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
565
|
+
end
|
|
566
|
+
return data, status_code, headers
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
# Retrieve Rental IDs
|
|
570
|
+
# Retrieve available rental products. Each listing includes `is_refundable` (`0` or `1`), `refund_within` (hours after purchase a refund is allowed; `0` when not refundable), and `refund_min_days` (minimum duration that is eligible for a refund; `0` when there is no duration floor or the rental is never refundable). Refunds also require that no messages have been received.
|
|
571
|
+
# @param type [Integer] Choose whether the rental is extendable or not with a 0 or 1
|
|
572
|
+
# @param [Hash] opts the optional parameters
|
|
573
|
+
# @return [Object]
|
|
574
|
+
def rental_retrieve_all(type, opts = {})
|
|
575
|
+
data, _status_code, _headers = rental_retrieve_all_with_http_info(type, opts)
|
|
576
|
+
data
|
|
577
|
+
end
|
|
578
|
+
|
|
579
|
+
# Retrieve Rental IDs
|
|
580
|
+
# Retrieve available rental products. Each listing includes `is_refundable` (`0` or `1`), `refund_within` (hours after purchase a refund is allowed; `0` when not refundable), and `refund_min_days` (minimum duration that is eligible for a refund; `0` when there is no duration floor or the rental is never refundable). Refunds also require that no messages have been received.
|
|
581
|
+
# @param type [Integer] Choose whether the rental is extendable or not with a 0 or 1
|
|
582
|
+
# @param [Hash] opts the optional parameters
|
|
583
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
584
|
+
def rental_retrieve_all_with_http_info(type, opts = {})
|
|
585
|
+
if @api_client.config.debugging
|
|
586
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_retrieve_all ...'
|
|
587
|
+
end
|
|
588
|
+
# verify the required parameter 'type' is set
|
|
589
|
+
if @api_client.config.client_side_validation && type.nil?
|
|
590
|
+
fail ArgumentError, "Missing the required parameter 'type' when calling RentalApi.rental_retrieve_all"
|
|
591
|
+
end
|
|
592
|
+
# resource path
|
|
593
|
+
local_var_path = '/rental/retrieve_all'
|
|
594
|
+
|
|
595
|
+
# query parameters
|
|
596
|
+
query_params = opts[:query_params] || {}
|
|
597
|
+
|
|
598
|
+
# header parameters
|
|
599
|
+
header_params = opts[:header_params] || {}
|
|
600
|
+
# HTTP header 'Accept' (if needed)
|
|
601
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
602
|
+
# HTTP header 'Content-Type'
|
|
603
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
604
|
+
if !content_type.nil?
|
|
605
|
+
header_params['Content-Type'] = content_type
|
|
606
|
+
end
|
|
607
|
+
|
|
608
|
+
# form parameters
|
|
609
|
+
form_params = opts[:form_params] || {}
|
|
610
|
+
form_params['type'] = type
|
|
611
|
+
|
|
612
|
+
# http body (model)
|
|
613
|
+
post_body = opts[:debug_body]
|
|
614
|
+
|
|
615
|
+
# return_type
|
|
616
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
617
|
+
|
|
618
|
+
# auth_names
|
|
619
|
+
auth_names = opts[:debug_auth_names] || []
|
|
620
|
+
|
|
621
|
+
new_options = opts.merge(
|
|
622
|
+
:operation => :"RentalApi.rental_retrieve_all",
|
|
623
|
+
:header_params => header_params,
|
|
624
|
+
:query_params => query_params,
|
|
625
|
+
:form_params => form_params,
|
|
626
|
+
:body => post_body,
|
|
627
|
+
:auth_names => auth_names,
|
|
628
|
+
:return_type => return_type
|
|
629
|
+
)
|
|
630
|
+
|
|
631
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
632
|
+
if @api_client.config.debugging
|
|
633
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_retrieve_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
634
|
+
end
|
|
635
|
+
return data, status_code, headers
|
|
636
|
+
end
|
|
637
|
+
|
|
638
|
+
# Retrieve your rentals
|
|
639
|
+
# List every rental on your account that was not refunded, including expired ones. For the actions taken on your rentals (activations, extensions, refunds) use **Rental History** instead. - `rental`: the rental ID from **Retrieve Rental IDs** - `rental_code`: use it with the other rental endpoints, such as **Retrieve Rental Messages** - `expiration_date`: Unix timestamp - `source`: the pool the number comes from - `state`: the US state of the number, or `Unknown`
|
|
640
|
+
# @param [Hash] opts the optional parameters
|
|
641
|
+
# @return [Object]
|
|
642
|
+
def rental_retrieve_history(opts = {})
|
|
643
|
+
data, _status_code, _headers = rental_retrieve_history_with_http_info(opts)
|
|
644
|
+
data
|
|
645
|
+
end
|
|
646
|
+
|
|
647
|
+
# Retrieve your rentals
|
|
648
|
+
# List every rental on your account that was not refunded, including expired ones. For the actions taken on your rentals (activations, extensions, refunds) use **Rental History** instead. - `rental`: the rental ID from **Retrieve Rental IDs** - `rental_code`: use it with the other rental endpoints, such as **Retrieve Rental Messages** - `expiration_date`: Unix timestamp - `source`: the pool the number comes from - `state`: the US state of the number, or `Unknown`
|
|
649
|
+
# @param [Hash] opts the optional parameters
|
|
650
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
651
|
+
def rental_retrieve_history_with_http_info(opts = {})
|
|
652
|
+
if @api_client.config.debugging
|
|
653
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_retrieve_history ...'
|
|
654
|
+
end
|
|
655
|
+
# resource path
|
|
656
|
+
local_var_path = '/rental/retrieve_history'
|
|
657
|
+
|
|
658
|
+
# query parameters
|
|
659
|
+
query_params = opts[:query_params] || {}
|
|
660
|
+
|
|
661
|
+
# header parameters
|
|
662
|
+
header_params = opts[:header_params] || {}
|
|
663
|
+
# HTTP header 'Accept' (if needed)
|
|
664
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
665
|
+
|
|
666
|
+
# form parameters
|
|
667
|
+
form_params = opts[:form_params] || {}
|
|
668
|
+
|
|
669
|
+
# http body (model)
|
|
670
|
+
post_body = opts[:debug_body]
|
|
671
|
+
|
|
672
|
+
# return_type
|
|
673
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
674
|
+
|
|
675
|
+
# auth_names
|
|
676
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
677
|
+
|
|
678
|
+
new_options = opts.merge(
|
|
679
|
+
:operation => :"RentalApi.rental_retrieve_history",
|
|
680
|
+
:header_params => header_params,
|
|
681
|
+
:query_params => query_params,
|
|
682
|
+
:form_params => form_params,
|
|
683
|
+
:body => post_body,
|
|
684
|
+
:auth_names => auth_names,
|
|
685
|
+
:return_type => return_type
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
689
|
+
if @api_client.config.debugging
|
|
690
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_retrieve_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
691
|
+
end
|
|
692
|
+
return data, status_code, headers
|
|
693
|
+
end
|
|
694
|
+
|
|
695
|
+
# Retrieve Rental Messages
|
|
696
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
697
|
+
# @param [Hash] opts the optional parameters
|
|
698
|
+
# @return [Object]
|
|
699
|
+
def rental_retrieve_messages(rental_code, opts = {})
|
|
700
|
+
data, _status_code, _headers = rental_retrieve_messages_with_http_info(rental_code, opts)
|
|
701
|
+
data
|
|
702
|
+
end
|
|
703
|
+
|
|
704
|
+
# Retrieve Rental Messages
|
|
705
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
706
|
+
# @param [Hash] opts the optional parameters
|
|
707
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
708
|
+
def rental_retrieve_messages_with_http_info(rental_code, opts = {})
|
|
709
|
+
if @api_client.config.debugging
|
|
710
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_retrieve_messages ...'
|
|
711
|
+
end
|
|
712
|
+
# verify the required parameter 'rental_code' is set
|
|
713
|
+
if @api_client.config.client_side_validation && rental_code.nil?
|
|
714
|
+
fail ArgumentError, "Missing the required parameter 'rental_code' when calling RentalApi.rental_retrieve_messages"
|
|
715
|
+
end
|
|
716
|
+
# resource path
|
|
717
|
+
local_var_path = '/rental/retrieve_messages'
|
|
718
|
+
|
|
719
|
+
# query parameters
|
|
720
|
+
query_params = opts[:query_params] || {}
|
|
721
|
+
|
|
722
|
+
# header parameters
|
|
723
|
+
header_params = opts[:header_params] || {}
|
|
724
|
+
# HTTP header 'Accept' (if needed)
|
|
725
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
726
|
+
# HTTP header 'Content-Type'
|
|
727
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
728
|
+
if !content_type.nil?
|
|
729
|
+
header_params['Content-Type'] = content_type
|
|
730
|
+
end
|
|
731
|
+
|
|
732
|
+
# form parameters
|
|
733
|
+
form_params = opts[:form_params] || {}
|
|
734
|
+
form_params['rental_code'] = rental_code
|
|
735
|
+
|
|
736
|
+
# http body (model)
|
|
737
|
+
post_body = opts[:debug_body]
|
|
738
|
+
|
|
739
|
+
# return_type
|
|
740
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
741
|
+
|
|
742
|
+
# auth_names
|
|
743
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
744
|
+
|
|
745
|
+
new_options = opts.merge(
|
|
746
|
+
:operation => :"RentalApi.rental_retrieve_messages",
|
|
747
|
+
:header_params => header_params,
|
|
748
|
+
:query_params => query_params,
|
|
749
|
+
:form_params => form_params,
|
|
750
|
+
:body => post_body,
|
|
751
|
+
:auth_names => auth_names,
|
|
752
|
+
:return_type => return_type
|
|
753
|
+
)
|
|
754
|
+
|
|
755
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
756
|
+
if @api_client.config.debugging
|
|
757
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_retrieve_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
758
|
+
end
|
|
759
|
+
return data, status_code, headers
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
# Retrieve Rental Pricing
|
|
763
|
+
# @param id [Integer] The rental ID retrieved from `Retrieve Rental IDs`
|
|
764
|
+
# @param [Hash] opts the optional parameters
|
|
765
|
+
# @option opts [String] :service Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
|
|
766
|
+
# @return [Object]
|
|
767
|
+
def rental_retrieve_pricing(id, opts = {})
|
|
768
|
+
data, _status_code, _headers = rental_retrieve_pricing_with_http_info(id, opts)
|
|
769
|
+
data
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
# Retrieve Rental Pricing
|
|
773
|
+
# @param id [Integer] The rental ID retrieved from `Retrieve Rental IDs`
|
|
774
|
+
# @param [Hash] opts the optional parameters
|
|
775
|
+
# @option opts [String] :service Service name or service ID which can be retrieved at the /service/retrieve_all endpoint
|
|
776
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
777
|
+
def rental_retrieve_pricing_with_http_info(id, opts = {})
|
|
778
|
+
if @api_client.config.debugging
|
|
779
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_retrieve_pricing ...'
|
|
780
|
+
end
|
|
781
|
+
# verify the required parameter 'id' is set
|
|
782
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
783
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RentalApi.rental_retrieve_pricing"
|
|
784
|
+
end
|
|
785
|
+
# resource path
|
|
786
|
+
local_var_path = '/rental/retrieve_pricing'
|
|
787
|
+
|
|
788
|
+
# query parameters
|
|
789
|
+
query_params = opts[:query_params] || {}
|
|
790
|
+
|
|
791
|
+
# header parameters
|
|
792
|
+
header_params = opts[:header_params] || {}
|
|
793
|
+
# HTTP header 'Accept' (if needed)
|
|
794
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
795
|
+
# HTTP header 'Content-Type'
|
|
796
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
797
|
+
if !content_type.nil?
|
|
798
|
+
header_params['Content-Type'] = content_type
|
|
799
|
+
end
|
|
800
|
+
|
|
801
|
+
# form parameters
|
|
802
|
+
form_params = opts[:form_params] || {}
|
|
803
|
+
form_params['id'] = id
|
|
804
|
+
form_params['service'] = opts[:'service'] if !opts[:'service'].nil?
|
|
805
|
+
|
|
806
|
+
# http body (model)
|
|
807
|
+
post_body = opts[:debug_body]
|
|
808
|
+
|
|
809
|
+
# return_type
|
|
810
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
811
|
+
|
|
812
|
+
# auth_names
|
|
813
|
+
auth_names = opts[:debug_auth_names] || []
|
|
814
|
+
|
|
815
|
+
new_options = opts.merge(
|
|
816
|
+
:operation => :"RentalApi.rental_retrieve_pricing",
|
|
817
|
+
:header_params => header_params,
|
|
818
|
+
:query_params => query_params,
|
|
819
|
+
:form_params => form_params,
|
|
820
|
+
:body => post_body,
|
|
821
|
+
:auth_names => auth_names,
|
|
822
|
+
:return_type => return_type
|
|
823
|
+
)
|
|
824
|
+
|
|
825
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
826
|
+
if @api_client.config.debugging
|
|
827
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_retrieve_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
828
|
+
end
|
|
829
|
+
return data, status_code, headers
|
|
830
|
+
end
|
|
831
|
+
|
|
832
|
+
# Retrieve Rental Services
|
|
833
|
+
# @param [Hash] opts the optional parameters
|
|
834
|
+
# @option opts [Integer] :rental The rental ID retrieved from `Retrieve Rental IDs`
|
|
835
|
+
# @return [Object]
|
|
836
|
+
def rental_retrieve_services(opts = {})
|
|
837
|
+
data, _status_code, _headers = rental_retrieve_services_with_http_info(opts)
|
|
838
|
+
data
|
|
839
|
+
end
|
|
840
|
+
|
|
841
|
+
# Retrieve Rental Services
|
|
842
|
+
# @param [Hash] opts the optional parameters
|
|
843
|
+
# @option opts [Integer] :rental The rental ID retrieved from `Retrieve Rental IDs`
|
|
844
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
845
|
+
def rental_retrieve_services_with_http_info(opts = {})
|
|
846
|
+
if @api_client.config.debugging
|
|
847
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_retrieve_services ...'
|
|
848
|
+
end
|
|
849
|
+
# resource path
|
|
850
|
+
local_var_path = '/rental/retrieve_services'
|
|
851
|
+
|
|
852
|
+
# query parameters
|
|
853
|
+
query_params = opts[:query_params] || {}
|
|
854
|
+
|
|
855
|
+
# header parameters
|
|
856
|
+
header_params = opts[:header_params] || {}
|
|
857
|
+
# HTTP header 'Accept' (if needed)
|
|
858
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
859
|
+
# HTTP header 'Content-Type'
|
|
860
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
861
|
+
if !content_type.nil?
|
|
862
|
+
header_params['Content-Type'] = content_type
|
|
863
|
+
end
|
|
864
|
+
|
|
865
|
+
# form parameters
|
|
866
|
+
form_params = opts[:form_params] || {}
|
|
867
|
+
form_params['rental'] = opts[:'rental'] if !opts[:'rental'].nil?
|
|
868
|
+
|
|
869
|
+
# http body (model)
|
|
870
|
+
post_body = opts[:debug_body]
|
|
871
|
+
|
|
872
|
+
# return_type
|
|
873
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
874
|
+
|
|
875
|
+
# auth_names
|
|
876
|
+
auth_names = opts[:debug_auth_names] || []
|
|
877
|
+
|
|
878
|
+
new_options = opts.merge(
|
|
879
|
+
:operation => :"RentalApi.rental_retrieve_services",
|
|
880
|
+
:header_params => header_params,
|
|
881
|
+
:query_params => query_params,
|
|
882
|
+
:form_params => form_params,
|
|
883
|
+
:body => post_body,
|
|
884
|
+
:auth_names => auth_names,
|
|
885
|
+
:return_type => return_type
|
|
886
|
+
)
|
|
887
|
+
|
|
888
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
889
|
+
if @api_client.config.debugging
|
|
890
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_retrieve_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
891
|
+
end
|
|
892
|
+
return data, status_code, headers
|
|
893
|
+
end
|
|
894
|
+
|
|
895
|
+
# Retrieve Rental Status
|
|
896
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
897
|
+
# @param [Hash] opts the optional parameters
|
|
898
|
+
# @return [Object]
|
|
899
|
+
def rental_retrieve_status(rental_code, opts = {})
|
|
900
|
+
data, _status_code, _headers = rental_retrieve_status_with_http_info(rental_code, opts)
|
|
901
|
+
data
|
|
902
|
+
end
|
|
903
|
+
|
|
904
|
+
# Retrieve Rental Status
|
|
905
|
+
# @param rental_code [String] The retrieved rental code from the `Order rental` endpoint.
|
|
906
|
+
# @param [Hash] opts the optional parameters
|
|
907
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
908
|
+
def rental_retrieve_status_with_http_info(rental_code, opts = {})
|
|
909
|
+
if @api_client.config.debugging
|
|
910
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_retrieve_status ...'
|
|
911
|
+
end
|
|
912
|
+
# verify the required parameter 'rental_code' is set
|
|
913
|
+
if @api_client.config.client_side_validation && rental_code.nil?
|
|
914
|
+
fail ArgumentError, "Missing the required parameter 'rental_code' when calling RentalApi.rental_retrieve_status"
|
|
915
|
+
end
|
|
916
|
+
# resource path
|
|
917
|
+
local_var_path = '/rental/retrieve_status'
|
|
918
|
+
|
|
919
|
+
# query parameters
|
|
920
|
+
query_params = opts[:query_params] || {}
|
|
921
|
+
|
|
922
|
+
# header parameters
|
|
923
|
+
header_params = opts[:header_params] || {}
|
|
924
|
+
# HTTP header 'Accept' (if needed)
|
|
925
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
926
|
+
# HTTP header 'Content-Type'
|
|
927
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
928
|
+
if !content_type.nil?
|
|
929
|
+
header_params['Content-Type'] = content_type
|
|
930
|
+
end
|
|
931
|
+
|
|
932
|
+
# form parameters
|
|
933
|
+
form_params = opts[:form_params] || {}
|
|
934
|
+
form_params['rental_code'] = rental_code
|
|
935
|
+
|
|
936
|
+
# http body (model)
|
|
937
|
+
post_body = opts[:debug_body]
|
|
938
|
+
|
|
939
|
+
# return_type
|
|
940
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
941
|
+
|
|
942
|
+
# auth_names
|
|
943
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
944
|
+
|
|
945
|
+
new_options = opts.merge(
|
|
946
|
+
:operation => :"RentalApi.rental_retrieve_status",
|
|
947
|
+
:header_params => header_params,
|
|
948
|
+
:query_params => query_params,
|
|
949
|
+
:form_params => form_params,
|
|
950
|
+
:body => post_body,
|
|
951
|
+
:auth_names => auth_names,
|
|
952
|
+
:return_type => return_type
|
|
953
|
+
)
|
|
954
|
+
|
|
955
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
956
|
+
if @api_client.config.debugging
|
|
957
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_retrieve_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
958
|
+
end
|
|
959
|
+
return data, status_code, headers
|
|
960
|
+
end
|
|
961
|
+
|
|
962
|
+
# Retrieve rental service price
|
|
963
|
+
# Some rentals are bound to a single service. This returns the price of a rental for that service, with the custom pricing on your account applied.
|
|
964
|
+
# @param id [Integer] The rental ID retrieved from `Retrieve Rental IDs`
|
|
965
|
+
# @param service_id [Integer] The service ID retrieved from `Retrieve Rental Services`
|
|
966
|
+
# @param [Hash] opts the optional parameters
|
|
967
|
+
# @return [Object]
|
|
968
|
+
def rental_service_price(id, service_id, opts = {})
|
|
969
|
+
data, _status_code, _headers = rental_service_price_with_http_info(id, service_id, opts)
|
|
970
|
+
data
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
# Retrieve rental service price
|
|
974
|
+
# Some rentals are bound to a single service. This returns the price of a rental for that service, with the custom pricing on your account applied.
|
|
975
|
+
# @param id [Integer] The rental ID retrieved from `Retrieve Rental IDs`
|
|
976
|
+
# @param service_id [Integer] The service ID retrieved from `Retrieve Rental Services`
|
|
977
|
+
# @param [Hash] opts the optional parameters
|
|
978
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
979
|
+
def rental_service_price_with_http_info(id, service_id, opts = {})
|
|
980
|
+
if @api_client.config.debugging
|
|
981
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_service_price ...'
|
|
982
|
+
end
|
|
983
|
+
# verify the required parameter 'id' is set
|
|
984
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
985
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RentalApi.rental_service_price"
|
|
986
|
+
end
|
|
987
|
+
# verify the required parameter 'service_id' is set
|
|
988
|
+
if @api_client.config.client_side_validation && service_id.nil?
|
|
989
|
+
fail ArgumentError, "Missing the required parameter 'service_id' when calling RentalApi.rental_service_price"
|
|
990
|
+
end
|
|
991
|
+
# resource path
|
|
992
|
+
local_var_path = '/rental/service_price'
|
|
993
|
+
|
|
994
|
+
# query parameters
|
|
995
|
+
query_params = opts[:query_params] || {}
|
|
996
|
+
|
|
997
|
+
# header parameters
|
|
998
|
+
header_params = opts[:header_params] || {}
|
|
999
|
+
# HTTP header 'Accept' (if needed)
|
|
1000
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1001
|
+
# HTTP header 'Content-Type'
|
|
1002
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
1003
|
+
if !content_type.nil?
|
|
1004
|
+
header_params['Content-Type'] = content_type
|
|
1005
|
+
end
|
|
1006
|
+
|
|
1007
|
+
# form parameters
|
|
1008
|
+
form_params = opts[:form_params] || {}
|
|
1009
|
+
form_params['id'] = id
|
|
1010
|
+
form_params['service_id'] = service_id
|
|
1011
|
+
|
|
1012
|
+
# http body (model)
|
|
1013
|
+
post_body = opts[:debug_body]
|
|
1014
|
+
|
|
1015
|
+
# return_type
|
|
1016
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1017
|
+
|
|
1018
|
+
# auth_names
|
|
1019
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
1020
|
+
|
|
1021
|
+
new_options = opts.merge(
|
|
1022
|
+
:operation => :"RentalApi.rental_service_price",
|
|
1023
|
+
:header_params => header_params,
|
|
1024
|
+
:query_params => query_params,
|
|
1025
|
+
:form_params => form_params,
|
|
1026
|
+
:body => post_body,
|
|
1027
|
+
:auth_names => auth_names,
|
|
1028
|
+
:return_type => return_type
|
|
1029
|
+
)
|
|
1030
|
+
|
|
1031
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1032
|
+
if @api_client.config.debugging
|
|
1033
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_service_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1034
|
+
end
|
|
1035
|
+
return data, status_code, headers
|
|
1036
|
+
end
|
|
1037
|
+
|
|
1038
|
+
# Retrieve Rental Stock
|
|
1039
|
+
# @param id [Integer] The rental ID retrieved from `Retrieve Rental IDs`
|
|
1040
|
+
# @param days [Integer]
|
|
1041
|
+
# @param [Hash] opts the optional parameters
|
|
1042
|
+
# @option opts [Integer] :service_id
|
|
1043
|
+
# @return [Object]
|
|
1044
|
+
def rental_stock(id, days, opts = {})
|
|
1045
|
+
data, _status_code, _headers = rental_stock_with_http_info(id, days, opts)
|
|
1046
|
+
data
|
|
1047
|
+
end
|
|
1048
|
+
|
|
1049
|
+
# Retrieve Rental Stock
|
|
1050
|
+
# @param id [Integer] The rental ID retrieved from `Retrieve Rental IDs`
|
|
1051
|
+
# @param days [Integer]
|
|
1052
|
+
# @param [Hash] opts the optional parameters
|
|
1053
|
+
# @option opts [Integer] :service_id
|
|
1054
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
1055
|
+
def rental_stock_with_http_info(id, days, opts = {})
|
|
1056
|
+
if @api_client.config.debugging
|
|
1057
|
+
@api_client.config.logger.debug 'Calling API: RentalApi.rental_stock ...'
|
|
1058
|
+
end
|
|
1059
|
+
# verify the required parameter 'id' is set
|
|
1060
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1061
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RentalApi.rental_stock"
|
|
1062
|
+
end
|
|
1063
|
+
# verify the required parameter 'days' is set
|
|
1064
|
+
if @api_client.config.client_side_validation && days.nil?
|
|
1065
|
+
fail ArgumentError, "Missing the required parameter 'days' when calling RentalApi.rental_stock"
|
|
1066
|
+
end
|
|
1067
|
+
# resource path
|
|
1068
|
+
local_var_path = '/rental/stock'
|
|
1069
|
+
|
|
1070
|
+
# query parameters
|
|
1071
|
+
query_params = opts[:query_params] || {}
|
|
1072
|
+
|
|
1073
|
+
# header parameters
|
|
1074
|
+
header_params = opts[:header_params] || {}
|
|
1075
|
+
# HTTP header 'Accept' (if needed)
|
|
1076
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1077
|
+
# HTTP header 'Content-Type'
|
|
1078
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
1079
|
+
if !content_type.nil?
|
|
1080
|
+
header_params['Content-Type'] = content_type
|
|
1081
|
+
end
|
|
1082
|
+
|
|
1083
|
+
# form parameters
|
|
1084
|
+
form_params = opts[:form_params] || {}
|
|
1085
|
+
form_params['id'] = id
|
|
1086
|
+
form_params['days'] = days
|
|
1087
|
+
form_params['service_id'] = opts[:'service_id'] if !opts[:'service_id'].nil?
|
|
1088
|
+
|
|
1089
|
+
# http body (model)
|
|
1090
|
+
post_body = opts[:debug_body]
|
|
1091
|
+
|
|
1092
|
+
# return_type
|
|
1093
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
1094
|
+
|
|
1095
|
+
# auth_names
|
|
1096
|
+
auth_names = opts[:debug_auth_names] || []
|
|
1097
|
+
|
|
1098
|
+
new_options = opts.merge(
|
|
1099
|
+
:operation => :"RentalApi.rental_stock",
|
|
1100
|
+
:header_params => header_params,
|
|
1101
|
+
:query_params => query_params,
|
|
1102
|
+
:form_params => form_params,
|
|
1103
|
+
:body => post_body,
|
|
1104
|
+
:auth_names => auth_names,
|
|
1105
|
+
:return_type => return_type
|
|
1106
|
+
)
|
|
1107
|
+
|
|
1108
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1109
|
+
if @api_client.config.debugging
|
|
1110
|
+
@api_client.config.logger.debug "API called: RentalApi#rental_stock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1111
|
+
end
|
|
1112
|
+
return data, status_code, headers
|
|
1113
|
+
end
|
|
1114
|
+
end
|
|
1115
|
+
end
|