pnap_billing_api 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +187 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/ApplicableDiscounts.md +20 -0
- data/docs/BandwidthDetails.md +24 -0
- data/docs/BandwidthRecord.md +56 -0
- data/docs/BillingConfigurationsApi.md +74 -0
- data/docs/ConfigurationDetails.md +18 -0
- data/docs/DiscountDetails.md +22 -0
- data/docs/Error.md +20 -0
- data/docs/LocationAvailabilityDetail.md +26 -0
- data/docs/LocationEnum.md +15 -0
- data/docs/OperatingSystemDetails.md +20 -0
- data/docs/OperatingSystemRecord.md +56 -0
- data/docs/PriceUnitEnum.md +15 -0
- data/docs/PricingPlan.md +36 -0
- data/docs/Product.md +22 -0
- data/docs/ProductAvailability.md +22 -0
- data/docs/ProductCategoryEnum.md +15 -0
- data/docs/ProductsApi.md +167 -0
- data/docs/ProductsGet200ResponseInner.md +82 -0
- data/docs/PublicSubnetDetails.md +22 -0
- data/docs/PublicSubnetRecord.md +56 -0
- data/docs/RatedUsageApi.md +155 -0
- data/docs/RatedUsageGet200ResponseInner.md +88 -0
- data/docs/RatedUsageRecord.md +54 -0
- data/docs/Reservation.md +48 -0
- data/docs/ReservationAutoRenewDisableRequest.md +18 -0
- data/docs/ReservationInvoicingModelEnum.md +15 -0
- data/docs/ReservationModelEnum.md +15 -0
- data/docs/ReservationRequest.md +18 -0
- data/docs/ReservationsApi.md +439 -0
- data/docs/ServerDetails.md +20 -0
- data/docs/ServerProduct.md +24 -0
- data/docs/ServerProductMetadata.md +30 -0
- data/docs/ServerRecord.md +56 -0
- data/docs/StorageDetails.md +28 -0
- data/docs/StorageRecord.md +56 -0
- data/docs/ThresholdConfigurationDetails.md +18 -0
- data/lib/pnap_billing_api/api/billing_configurations_api.rb +79 -0
- data/lib/pnap_billing_api/api/products_api.rb +174 -0
- data/lib/pnap_billing_api/api/rated_usage_api.rb +156 -0
- data/lib/pnap_billing_api/api/reservations_api.rb +412 -0
- data/lib/pnap_billing_api/api_client.rb +397 -0
- data/lib/pnap_billing_api/api_error.rb +58 -0
- data/lib/pnap_billing_api/configuration.rb +298 -0
- data/lib/pnap_billing_api/models/applicable_discounts.rb +227 -0
- data/lib/pnap_billing_api/models/bandwidth_details.rb +294 -0
- data/lib/pnap_billing_api/models/bandwidth_record.rb +548 -0
- data/lib/pnap_billing_api/models/configuration_details.rb +215 -0
- data/lib/pnap_billing_api/models/discount_details.rb +291 -0
- data/lib/pnap_billing_api/models/error.rb +234 -0
- data/lib/pnap_billing_api/models/location_availability_detail.rb +314 -0
- data/lib/pnap_billing_api/models/location_enum.rb +45 -0
- data/lib/pnap_billing_api/models/operating_system_details.rb +240 -0
- data/lib/pnap_billing_api/models/operating_system_record.rb +548 -0
- data/lib/pnap_billing_api/models/price_unit_enum.rb +44 -0
- data/lib/pnap_billing_api/models/pricing_plan.rb +397 -0
- data/lib/pnap_billing_api/models/product.rb +252 -0
- data/lib/pnap_billing_api/models/product_availability.rb +258 -0
- data/lib/pnap_billing_api/models/product_category_enum.rb +43 -0
- data/lib/pnap_billing_api/models/products_get200_response_inner.rb +61 -0
- data/lib/pnap_billing_api/models/public_subnet_details.rb +250 -0
- data/lib/pnap_billing_api/models/public_subnet_record.rb +548 -0
- data/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb +64 -0
- data/lib/pnap_billing_api/models/rated_usage_record.rb +526 -0
- data/lib/pnap_billing_api/models/reservation.rb +466 -0
- data/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb +215 -0
- data/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb +40 -0
- data/lib/pnap_billing_api/models/reservation_model_enum.rb +43 -0
- data/lib/pnap_billing_api/models/reservation_request.rb +223 -0
- data/lib/pnap_billing_api/models/server_details.rb +240 -0
- data/lib/pnap_billing_api/models/server_product.rb +274 -0
- data/lib/pnap_billing_api/models/server_product_metadata.rb +325 -0
- data/lib/pnap_billing_api/models/server_record.rb +548 -0
- data/lib/pnap_billing_api/models/storage_details.rb +308 -0
- data/lib/pnap_billing_api/models/storage_record.rb +548 -0
- data/lib/pnap_billing_api/models/threshold_configuration_details.rb +223 -0
- data/lib/pnap_billing_api/version.rb +19 -0
- data/lib/pnap_billing_api.rb +75 -0
- data/pnap_billing_api.gemspec +39 -0
- data/spec/api/billing_configurations_api_spec.rb +46 -0
- data/spec/api/products_api_spec.rb +67 -0
- data/spec/api/rated_usage_api_spec.rb +61 -0
- data/spec/api/reservations_api_spec.rb +109 -0
- data/spec/models/applicable_discounts_spec.rb +42 -0
- data/spec/models/bandwidth_details_spec.rb +58 -0
- data/spec/models/bandwidth_record_spec.rb +154 -0
- data/spec/models/configuration_details_spec.rb +36 -0
- data/spec/models/discount_details_spec.rb +52 -0
- data/spec/models/error_spec.rb +42 -0
- data/spec/models/location_availability_detail_spec.rb +64 -0
- data/spec/models/location_enum_spec.rb +30 -0
- data/spec/models/operating_system_details_spec.rb +42 -0
- data/spec/models/operating_system_record_spec.rb +154 -0
- data/spec/models/price_unit_enum_spec.rb +30 -0
- data/spec/models/pricing_plan_spec.rb +102 -0
- data/spec/models/product_availability_spec.rb +48 -0
- data/spec/models/product_category_enum_spec.rb +30 -0
- data/spec/models/product_spec.rb +48 -0
- data/spec/models/products_get200_response_inner_spec.rb +44 -0
- data/spec/models/public_subnet_details_spec.rb +48 -0
- data/spec/models/public_subnet_record_spec.rb +154 -0
- data/spec/models/rated_usage_get200_response_inner_spec.rb +44 -0
- data/spec/models/rated_usage_record_spec.rb +148 -0
- data/spec/models/reservation_auto_renew_disable_request_spec.rb +36 -0
- data/spec/models/reservation_invoicing_model_enum_spec.rb +30 -0
- data/spec/models/reservation_model_enum_spec.rb +30 -0
- data/spec/models/reservation_request_spec.rb +36 -0
- data/spec/models/reservation_spec.rb +130 -0
- data/spec/models/server_details_spec.rb +42 -0
- data/spec/models/server_product_metadata_spec.rb +72 -0
- data/spec/models/server_product_spec.rb +54 -0
- data/spec/models/server_record_spec.rb +154 -0
- data/spec/models/storage_details_spec.rb +66 -0
- data/spec/models/storage_record_spec.rb +154 -0
- data/spec/models/threshold_configuration_details_spec.rb +36 -0
- data/spec/spec_helper.rb +111 -0
- metadata +240 -0
@@ -0,0 +1,412 @@
|
|
1
|
+
=begin
|
2
|
+
#Billing API
|
3
|
+
|
4
|
+
#Automate your infrastructure billing with the Bare Metal Cloud Billing API. Reserve your server instances to ensure guaranteed resource availability for 12, 24, and 36 months. Retrieve your server’s rated usage for a given period and enable or disable auto-renewals.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/phoenixnap-bare-metal-cloud-billing-models' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/billing/v1/)</b>
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 0.1
|
7
|
+
Contact: support@phoenixnap.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module BillingApi
|
16
|
+
class ReservationsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List all Reservations.
|
23
|
+
# Retrieves all reservations associated with the authenticated account. All date & times are in UTC.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [ProductCategoryEnum] :product_category The product category
|
26
|
+
# @return [Array<Reservation>]
|
27
|
+
def reservations_get(opts = {})
|
28
|
+
data, _status_code, _headers = reservations_get_with_http_info(opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# List all Reservations.
|
33
|
+
# Retrieves all reservations associated with the authenticated account. All date & times are in UTC.
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @option opts [ProductCategoryEnum] :product_category The product category
|
36
|
+
# @return [Array<(Array<Reservation>, Integer, Hash)>] Array<Reservation> data, response status code and response headers
|
37
|
+
def reservations_get_with_http_info(opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.reservations_get ...'
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/reservations'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = opts[:query_params] || {}
|
46
|
+
query_params[:'productCategory'] = opts[:'product_category'] if !opts[:'product_category'].nil?
|
47
|
+
|
48
|
+
# header parameters
|
49
|
+
header_params = opts[:header_params] || {}
|
50
|
+
# HTTP header 'Accept' (if needed)
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
52
|
+
|
53
|
+
# form parameters
|
54
|
+
form_params = opts[:form_params] || {}
|
55
|
+
|
56
|
+
# http body (model)
|
57
|
+
post_body = opts[:debug_body]
|
58
|
+
|
59
|
+
# return_type
|
60
|
+
return_type = opts[:debug_return_type] || 'Array<Reservation>'
|
61
|
+
|
62
|
+
# auth_names
|
63
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
64
|
+
|
65
|
+
new_options = opts.merge(
|
66
|
+
:operation => :"ReservationsApi.reservations_get",
|
67
|
+
:header_params => header_params,
|
68
|
+
:query_params => query_params,
|
69
|
+
:form_params => form_params,
|
70
|
+
:body => post_body,
|
71
|
+
:auth_names => auth_names,
|
72
|
+
:return_type => return_type
|
73
|
+
)
|
74
|
+
|
75
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
76
|
+
if @api_client.config.debugging
|
77
|
+
@api_client.config.logger.debug "API called: ReservationsApi#reservations_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
78
|
+
end
|
79
|
+
return data, status_code, headers
|
80
|
+
end
|
81
|
+
|
82
|
+
# Create a reservation.
|
83
|
+
# Creates new package reservation for authenticated account.
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @option opts [ReservationRequest] :reservation_request
|
86
|
+
# @return [Reservation]
|
87
|
+
def reservations_post(opts = {})
|
88
|
+
data, _status_code, _headers = reservations_post_with_http_info(opts)
|
89
|
+
data
|
90
|
+
end
|
91
|
+
|
92
|
+
# Create a reservation.
|
93
|
+
# Creates new package reservation for authenticated account.
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @option opts [ReservationRequest] :reservation_request
|
96
|
+
# @return [Array<(Reservation, Integer, Hash)>] Reservation data, response status code and response headers
|
97
|
+
def reservations_post_with_http_info(opts = {})
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.reservations_post ...'
|
100
|
+
end
|
101
|
+
# resource path
|
102
|
+
local_var_path = '/reservations'
|
103
|
+
|
104
|
+
# query parameters
|
105
|
+
query_params = opts[:query_params] || {}
|
106
|
+
|
107
|
+
# header parameters
|
108
|
+
header_params = opts[:header_params] || {}
|
109
|
+
# HTTP header 'Accept' (if needed)
|
110
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
111
|
+
# HTTP header 'Content-Type'
|
112
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
113
|
+
if !content_type.nil?
|
114
|
+
header_params['Content-Type'] = content_type
|
115
|
+
end
|
116
|
+
|
117
|
+
# form parameters
|
118
|
+
form_params = opts[:form_params] || {}
|
119
|
+
|
120
|
+
# http body (model)
|
121
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'reservation_request'])
|
122
|
+
|
123
|
+
# return_type
|
124
|
+
return_type = opts[:debug_return_type] || 'Reservation'
|
125
|
+
|
126
|
+
# auth_names
|
127
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
128
|
+
|
129
|
+
new_options = opts.merge(
|
130
|
+
:operation => :"ReservationsApi.reservations_post",
|
131
|
+
:header_params => header_params,
|
132
|
+
:query_params => query_params,
|
133
|
+
:form_params => form_params,
|
134
|
+
:body => post_body,
|
135
|
+
:auth_names => auth_names,
|
136
|
+
:return_type => return_type
|
137
|
+
)
|
138
|
+
|
139
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
140
|
+
if @api_client.config.debugging
|
141
|
+
@api_client.config.logger.debug "API called: ReservationsApi#reservations_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
142
|
+
end
|
143
|
+
return data, status_code, headers
|
144
|
+
end
|
145
|
+
|
146
|
+
# Disable auto-renewal for reservation by id.
|
147
|
+
# Disable auto-renewal for reservation by reservation id.
|
148
|
+
# @param reservation_id [String] The reservation's ID.
|
149
|
+
# @param [Hash] opts the optional parameters
|
150
|
+
# @option opts [ReservationAutoRenewDisableRequest] :reservation_auto_renew_disable_request
|
151
|
+
# @return [Reservation]
|
152
|
+
def reservations_reservation_id_actions_auto_renew_disable_post(reservation_id, opts = {})
|
153
|
+
data, _status_code, _headers = reservations_reservation_id_actions_auto_renew_disable_post_with_http_info(reservation_id, opts)
|
154
|
+
data
|
155
|
+
end
|
156
|
+
|
157
|
+
# Disable auto-renewal for reservation by id.
|
158
|
+
# Disable auto-renewal for reservation by reservation id.
|
159
|
+
# @param reservation_id [String] The reservation's ID.
|
160
|
+
# @param [Hash] opts the optional parameters
|
161
|
+
# @option opts [ReservationAutoRenewDisableRequest] :reservation_auto_renew_disable_request
|
162
|
+
# @return [Array<(Reservation, Integer, Hash)>] Reservation data, response status code and response headers
|
163
|
+
def reservations_reservation_id_actions_auto_renew_disable_post_with_http_info(reservation_id, opts = {})
|
164
|
+
if @api_client.config.debugging
|
165
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.reservations_reservation_id_actions_auto_renew_disable_post ...'
|
166
|
+
end
|
167
|
+
# verify the required parameter 'reservation_id' is set
|
168
|
+
if @api_client.config.client_side_validation && reservation_id.nil?
|
169
|
+
fail ArgumentError, "Missing the required parameter 'reservation_id' when calling ReservationsApi.reservations_reservation_id_actions_auto_renew_disable_post"
|
170
|
+
end
|
171
|
+
# resource path
|
172
|
+
local_var_path = '/reservations/{reservationId}/actions/auto-renew/disable'.sub('{' + 'reservationId' + '}', CGI.escape(reservation_id.to_s))
|
173
|
+
|
174
|
+
# query parameters
|
175
|
+
query_params = opts[:query_params] || {}
|
176
|
+
|
177
|
+
# header parameters
|
178
|
+
header_params = opts[:header_params] || {}
|
179
|
+
# HTTP header 'Accept' (if needed)
|
180
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
181
|
+
# HTTP header 'Content-Type'
|
182
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
183
|
+
if !content_type.nil?
|
184
|
+
header_params['Content-Type'] = content_type
|
185
|
+
end
|
186
|
+
|
187
|
+
# form parameters
|
188
|
+
form_params = opts[:form_params] || {}
|
189
|
+
|
190
|
+
# http body (model)
|
191
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'reservation_auto_renew_disable_request'])
|
192
|
+
|
193
|
+
# return_type
|
194
|
+
return_type = opts[:debug_return_type] || 'Reservation'
|
195
|
+
|
196
|
+
# auth_names
|
197
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
198
|
+
|
199
|
+
new_options = opts.merge(
|
200
|
+
:operation => :"ReservationsApi.reservations_reservation_id_actions_auto_renew_disable_post",
|
201
|
+
:header_params => header_params,
|
202
|
+
:query_params => query_params,
|
203
|
+
:form_params => form_params,
|
204
|
+
:body => post_body,
|
205
|
+
:auth_names => auth_names,
|
206
|
+
:return_type => return_type
|
207
|
+
)
|
208
|
+
|
209
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
210
|
+
if @api_client.config.debugging
|
211
|
+
@api_client.config.logger.debug "API called: ReservationsApi#reservations_reservation_id_actions_auto_renew_disable_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
212
|
+
end
|
213
|
+
return data, status_code, headers
|
214
|
+
end
|
215
|
+
|
216
|
+
# Enable auto-renewal for unexpired reservation by reservation id.
|
217
|
+
# Enable auto-renewal for unexpired reservation by reservation id.
|
218
|
+
# @param reservation_id [String] The reservation's ID.
|
219
|
+
# @param [Hash] opts the optional parameters
|
220
|
+
# @return [Reservation]
|
221
|
+
def reservations_reservation_id_actions_auto_renew_enable_post(reservation_id, opts = {})
|
222
|
+
data, _status_code, _headers = reservations_reservation_id_actions_auto_renew_enable_post_with_http_info(reservation_id, opts)
|
223
|
+
data
|
224
|
+
end
|
225
|
+
|
226
|
+
# Enable auto-renewal for unexpired reservation by reservation id.
|
227
|
+
# Enable auto-renewal for unexpired reservation by reservation id.
|
228
|
+
# @param reservation_id [String] The reservation's ID.
|
229
|
+
# @param [Hash] opts the optional parameters
|
230
|
+
# @return [Array<(Reservation, Integer, Hash)>] Reservation data, response status code and response headers
|
231
|
+
def reservations_reservation_id_actions_auto_renew_enable_post_with_http_info(reservation_id, opts = {})
|
232
|
+
if @api_client.config.debugging
|
233
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.reservations_reservation_id_actions_auto_renew_enable_post ...'
|
234
|
+
end
|
235
|
+
# verify the required parameter 'reservation_id' is set
|
236
|
+
if @api_client.config.client_side_validation && reservation_id.nil?
|
237
|
+
fail ArgumentError, "Missing the required parameter 'reservation_id' when calling ReservationsApi.reservations_reservation_id_actions_auto_renew_enable_post"
|
238
|
+
end
|
239
|
+
# resource path
|
240
|
+
local_var_path = '/reservations/{reservationId}/actions/auto-renew/enable'.sub('{' + 'reservationId' + '}', CGI.escape(reservation_id.to_s))
|
241
|
+
|
242
|
+
# query parameters
|
243
|
+
query_params = opts[:query_params] || {}
|
244
|
+
|
245
|
+
# header parameters
|
246
|
+
header_params = opts[:header_params] || {}
|
247
|
+
# HTTP header 'Accept' (if needed)
|
248
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
249
|
+
|
250
|
+
# form parameters
|
251
|
+
form_params = opts[:form_params] || {}
|
252
|
+
|
253
|
+
# http body (model)
|
254
|
+
post_body = opts[:debug_body]
|
255
|
+
|
256
|
+
# return_type
|
257
|
+
return_type = opts[:debug_return_type] || 'Reservation'
|
258
|
+
|
259
|
+
# auth_names
|
260
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
261
|
+
|
262
|
+
new_options = opts.merge(
|
263
|
+
:operation => :"ReservationsApi.reservations_reservation_id_actions_auto_renew_enable_post",
|
264
|
+
:header_params => header_params,
|
265
|
+
:query_params => query_params,
|
266
|
+
:form_params => form_params,
|
267
|
+
:body => post_body,
|
268
|
+
:auth_names => auth_names,
|
269
|
+
:return_type => return_type
|
270
|
+
)
|
271
|
+
|
272
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
273
|
+
if @api_client.config.debugging
|
274
|
+
@api_client.config.logger.debug "API called: ReservationsApi#reservations_reservation_id_actions_auto_renew_enable_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
275
|
+
end
|
276
|
+
return data, status_code, headers
|
277
|
+
end
|
278
|
+
|
279
|
+
# Convert reservation pricing model by reservation ID.
|
280
|
+
# Convert reservation pricing model by reservation id.
|
281
|
+
# @param reservation_id [String] The reservation's ID.
|
282
|
+
# @param [Hash] opts the optional parameters
|
283
|
+
# @option opts [ReservationRequest] :reservation_request
|
284
|
+
# @return [Reservation]
|
285
|
+
def reservations_reservation_id_actions_convert_post(reservation_id, opts = {})
|
286
|
+
data, _status_code, _headers = reservations_reservation_id_actions_convert_post_with_http_info(reservation_id, opts)
|
287
|
+
data
|
288
|
+
end
|
289
|
+
|
290
|
+
# Convert reservation pricing model by reservation ID.
|
291
|
+
# Convert reservation pricing model by reservation id.
|
292
|
+
# @param reservation_id [String] The reservation's ID.
|
293
|
+
# @param [Hash] opts the optional parameters
|
294
|
+
# @option opts [ReservationRequest] :reservation_request
|
295
|
+
# @return [Array<(Reservation, Integer, Hash)>] Reservation data, response status code and response headers
|
296
|
+
def reservations_reservation_id_actions_convert_post_with_http_info(reservation_id, opts = {})
|
297
|
+
if @api_client.config.debugging
|
298
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.reservations_reservation_id_actions_convert_post ...'
|
299
|
+
end
|
300
|
+
# verify the required parameter 'reservation_id' is set
|
301
|
+
if @api_client.config.client_side_validation && reservation_id.nil?
|
302
|
+
fail ArgumentError, "Missing the required parameter 'reservation_id' when calling ReservationsApi.reservations_reservation_id_actions_convert_post"
|
303
|
+
end
|
304
|
+
# resource path
|
305
|
+
local_var_path = '/reservations/{reservationId}/actions/convert'.sub('{' + 'reservationId' + '}', CGI.escape(reservation_id.to_s))
|
306
|
+
|
307
|
+
# query parameters
|
308
|
+
query_params = opts[:query_params] || {}
|
309
|
+
|
310
|
+
# header parameters
|
311
|
+
header_params = opts[:header_params] || {}
|
312
|
+
# HTTP header 'Accept' (if needed)
|
313
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
314
|
+
# HTTP header 'Content-Type'
|
315
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
316
|
+
if !content_type.nil?
|
317
|
+
header_params['Content-Type'] = content_type
|
318
|
+
end
|
319
|
+
|
320
|
+
# form parameters
|
321
|
+
form_params = opts[:form_params] || {}
|
322
|
+
|
323
|
+
# http body (model)
|
324
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'reservation_request'])
|
325
|
+
|
326
|
+
# return_type
|
327
|
+
return_type = opts[:debug_return_type] || 'Reservation'
|
328
|
+
|
329
|
+
# auth_names
|
330
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
331
|
+
|
332
|
+
new_options = opts.merge(
|
333
|
+
:operation => :"ReservationsApi.reservations_reservation_id_actions_convert_post",
|
334
|
+
:header_params => header_params,
|
335
|
+
:query_params => query_params,
|
336
|
+
:form_params => form_params,
|
337
|
+
:body => post_body,
|
338
|
+
:auth_names => auth_names,
|
339
|
+
:return_type => return_type
|
340
|
+
)
|
341
|
+
|
342
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
343
|
+
if @api_client.config.debugging
|
344
|
+
@api_client.config.logger.debug "API called: ReservationsApi#reservations_reservation_id_actions_convert_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
345
|
+
end
|
346
|
+
return data, status_code, headers
|
347
|
+
end
|
348
|
+
|
349
|
+
# Get a reservation.
|
350
|
+
# Retrieves the reservations with the specified identifier. All date & times are in UTC.
|
351
|
+
# @param reservation_id [String] The reservation's ID.
|
352
|
+
# @param [Hash] opts the optional parameters
|
353
|
+
# @return [Reservation]
|
354
|
+
def reservations_reservation_id_get(reservation_id, opts = {})
|
355
|
+
data, _status_code, _headers = reservations_reservation_id_get_with_http_info(reservation_id, opts)
|
356
|
+
data
|
357
|
+
end
|
358
|
+
|
359
|
+
# Get a reservation.
|
360
|
+
# Retrieves the reservations with the specified identifier. All date & times are in UTC.
|
361
|
+
# @param reservation_id [String] The reservation's ID.
|
362
|
+
# @param [Hash] opts the optional parameters
|
363
|
+
# @return [Array<(Reservation, Integer, Hash)>] Reservation data, response status code and response headers
|
364
|
+
def reservations_reservation_id_get_with_http_info(reservation_id, opts = {})
|
365
|
+
if @api_client.config.debugging
|
366
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.reservations_reservation_id_get ...'
|
367
|
+
end
|
368
|
+
# verify the required parameter 'reservation_id' is set
|
369
|
+
if @api_client.config.client_side_validation && reservation_id.nil?
|
370
|
+
fail ArgumentError, "Missing the required parameter 'reservation_id' when calling ReservationsApi.reservations_reservation_id_get"
|
371
|
+
end
|
372
|
+
# resource path
|
373
|
+
local_var_path = '/reservations/{reservationId}'.sub('{' + 'reservationId' + '}', CGI.escape(reservation_id.to_s))
|
374
|
+
|
375
|
+
# query parameters
|
376
|
+
query_params = opts[:query_params] || {}
|
377
|
+
|
378
|
+
# header parameters
|
379
|
+
header_params = opts[:header_params] || {}
|
380
|
+
# HTTP header 'Accept' (if needed)
|
381
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
382
|
+
|
383
|
+
# form parameters
|
384
|
+
form_params = opts[:form_params] || {}
|
385
|
+
|
386
|
+
# http body (model)
|
387
|
+
post_body = opts[:debug_body]
|
388
|
+
|
389
|
+
# return_type
|
390
|
+
return_type = opts[:debug_return_type] || 'Reservation'
|
391
|
+
|
392
|
+
# auth_names
|
393
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
394
|
+
|
395
|
+
new_options = opts.merge(
|
396
|
+
:operation => :"ReservationsApi.reservations_reservation_id_get",
|
397
|
+
:header_params => header_params,
|
398
|
+
:query_params => query_params,
|
399
|
+
:form_params => form_params,
|
400
|
+
:body => post_body,
|
401
|
+
:auth_names => auth_names,
|
402
|
+
:return_type => return_type
|
403
|
+
)
|
404
|
+
|
405
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
406
|
+
if @api_client.config.debugging
|
407
|
+
@api_client.config.logger.debug "API called: ReservationsApi#reservations_reservation_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
408
|
+
end
|
409
|
+
return data, status_code, headers
|
410
|
+
end
|
411
|
+
end
|
412
|
+
end
|