pnap_billing_api 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90aaa7e94c20034a1a3d60e538f24edeb2df60a101c39455a667c15027a7d9d7
4
- data.tar.gz: 38aa25e461ca137de61053aed52a7bd4674e8a885cad43a48d7866289dc248c5
3
+ metadata.gz: 999eb5be48a625ceef0bf6608b79094d75a012bf629530f7e2b925afaeffd5d3
4
+ data.tar.gz: f807fa97dda2f0a5259a0fc7c453fd68ff02c11b6d944b1f10b2b45b2a04bfb7
5
5
  SHA512:
6
- metadata.gz: f2a8c17c43abe5fa18de55e01fee40786c2c03748c0c019d72523093fe55618120a57ee355416747ff1cc2caba792f70065a786e3aba800ce4345af8e9205cbc
7
- data.tar.gz: ba71acc4a3c4385c3caa409f171d57bc323af26d29165391d505b15f155cbe6c68877f076b33503d542a1d15fbf56dfc3190eaee9fc78f352b132b772a968251
6
+ metadata.gz: 5520f6870ceb9469ef9b8c21a369a37d21ad09bf51779a4b389bb7ddbbca0c833d6d7a6ee16e3d156017c52c83b3ccaadeebc89a65cf98474d18c017f76965b0
7
+ data.tar.gz: 3cdc30553d4f6a1feb8ef943d6c09996d3a386d7c1ae913235ea7f4cd41d65a22427233cd4648bc32527199a001b4fb314e61c367b96ba7cf59ee5322f764fa3
data/README.md CHANGED
@@ -123,16 +123,16 @@ All URIs are relative to *https://api.phoenixnap.com/billing/v1*
123
123
  Class | Method | HTTP request | Description
124
124
  ------------ | ------------- | ------------- | -------------
125
125
  *BillingApi::BillingConfigurationsApi* | [**account_billing_configuration_me_get**](docs/BillingConfigurationsApi.md#account_billing_configuration_me_get) | **GET** /account-billing-configurations/me | Retrieves billing configuration associated with the authenticated account.
126
- *BillingApi::ProductsApi* | [**product_availability_get**](docs/ProductsApi.md#product_availability_get) | **GET** /product-availability | List all Product availabilities.
126
+ *BillingApi::ProductAvailabilityApi* | [**product_availability_get**](docs/ProductAvailabilityApi.md#product_availability_get) | **GET** /product-availability | List all Product availabilities.
127
127
  *BillingApi::ProductsApi* | [**products_get**](docs/ProductsApi.md#products_get) | **GET** /products | List all Products.
128
128
  *BillingApi::RatedUsageApi* | [**rated_usage_get**](docs/RatedUsageApi.md#rated_usage_get) | **GET** /rated-usage | List the rated usage.
129
129
  *BillingApi::RatedUsageApi* | [**rated_usage_month_to_date_get**](docs/RatedUsageApi.md#rated_usage_month_to_date_get) | **GET** /rated-usage/month-to-date | List the rated usage records for the current calendar month.
130
130
  *BillingApi::ReservationsApi* | [**reservations_get**](docs/ReservationsApi.md#reservations_get) | **GET** /reservations | List all Reservations.
131
131
  *BillingApi::ReservationsApi* | [**reservations_post**](docs/ReservationsApi.md#reservations_post) | **POST** /reservations | Create a reservation.
132
- *BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_auto_renew_disable_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_auto_renew_disable_post) | **POST** /reservations/{reservationId}/actions/auto-renew/disable | Disable auto-renewal for reservation by id.
133
- *BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_auto_renew_enable_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_auto_renew_enable_post) | **POST** /reservations/{reservationId}/actions/auto-renew/enable | Enable auto-renewal for unexpired reservation by reservation id.
134
- *BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_convert_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_convert_post) | **POST** /reservations/{reservationId}/actions/convert | Convert reservation pricing model by reservation ID.
135
- *BillingApi::ReservationsApi* | [**reservations_reservation_id_get**](docs/ReservationsApi.md#reservations_reservation_id_get) | **GET** /reservations/{reservationId} | Get a reservation.
132
+ *BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_auto_renew_disable_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_auto_renew_disable_post) | **POST** /reservations/{id}/actions/auto-renew/disable | Disable auto-renewal for reservation by id.
133
+ *BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_auto_renew_enable_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_auto_renew_enable_post) | **POST** /reservations/{id}/actions/auto-renew/enable | Enable auto-renewal for unexpired reservation by reservation id.
134
+ *BillingApi::ReservationsApi* | [**reservations_reservation_id_actions_convert_post**](docs/ReservationsApi.md#reservations_reservation_id_actions_convert_post) | **POST** /reservations/{id}/actions/convert | Convert reservation pricing model by reservation ID.
135
+ *BillingApi::ReservationsApi* | [**reservations_reservation_id_get**](docs/ReservationsApi.md#reservations_reservation_id_get) | **GET** /reservations/{id} | Get a reservation.
136
136
 
137
137
 
138
138
  ## Documentation for Models
@@ -147,6 +147,7 @@ Class | Method | HTTP request | Description
147
147
  - [BillingApi::LocationEnum](docs/LocationEnum.md)
148
148
  - [BillingApi::OperatingSystemDetails](docs/OperatingSystemDetails.md)
149
149
  - [BillingApi::OperatingSystemRecord](docs/OperatingSystemRecord.md)
150
+ - [BillingApi::PackageUnitEnum](docs/PackageUnitEnum.md)
150
151
  - [BillingApi::PriceUnitEnum](docs/PriceUnitEnum.md)
151
152
  - [BillingApi::PricingPlan](docs/PricingPlan.md)
152
153
  - [BillingApi::Product](docs/Product.md)
@@ -161,6 +162,7 @@ Class | Method | HTTP request | Description
161
162
  - [BillingApi::ReservationAutoRenewDisableRequest](docs/ReservationAutoRenewDisableRequest.md)
162
163
  - [BillingApi::ReservationInvoicingModelEnum](docs/ReservationInvoicingModelEnum.md)
163
164
  - [BillingApi::ReservationModelEnum](docs/ReservationModelEnum.md)
165
+ - [BillingApi::ReservationProductCategoryEnum](docs/ReservationProductCategoryEnum.md)
164
166
  - [BillingApi::ReservationRequest](docs/ReservationRequest.md)
165
167
  - [BillingApi::ServerDetails](docs/ServerDetails.md)
166
168
  - [BillingApi::ServerProduct](docs/ServerProduct.md)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 2.0.0
@@ -0,0 +1,15 @@
1
+ # BillingApi::PackageUnitEnum
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'pnap_billing_api'
12
+
13
+ instance = BillingApi::PackageUnitEnum.new()
14
+ ```
15
+
data/docs/PricingPlan.md CHANGED
@@ -13,7 +13,7 @@
13
13
  | **applicable_discounts** | [**ApplicableDiscounts**](ApplicableDiscounts.md) | | [optional] |
14
14
  | **correlated_product_code** | **String** | Product code of the product this product is correlated with | [optional] |
15
15
  | **package_quantity** | **Float** | Package size per month. | [optional] |
16
- | **package_unit** | **String** | Package size unit. | [optional] |
16
+ | **package_unit** | [**PackageUnitEnum**](PackageUnitEnum.md) | | [optional] |
17
17
 
18
18
  ## Example
19
19
 
@@ -0,0 +1,89 @@
1
+ # BillingApi::ProductAvailabilityApi
2
+
3
+ All URIs are relative to *https://api.phoenixnap.com/billing/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**product_availability_get**](ProductAvailabilityApi.md#product_availability_get) | **GET** /product-availability | List all Product availabilities. |
8
+
9
+
10
+ ## product_availability_get
11
+
12
+ > <Array<ProductAvailability>> product_availability_get(opts)
13
+
14
+ List all Product availabilities.
15
+
16
+ Retrieves the list of product availability details.
17
+
18
+ ### Examples
19
+
20
+ ```ruby
21
+ require 'time'
22
+ require 'pnap_billing_api'
23
+ # setup authorization
24
+ BillingApi.configure do |config|
25
+ # Configure OAuth2 access token for authorization: OAuth2
26
+ config.access_token = 'YOUR ACCESS TOKEN'
27
+ end
28
+
29
+ api_instance = BillingApi::ProductAvailabilityApi.new
30
+ opts = {
31
+ product_category: ['SERVER'], # Array<String> | Product category. Currently only SERVER category is supported.
32
+ product_code: ['inner_example'], # Array<String> |
33
+ show_only_min_quantity_available: true, # Boolean | Show only locations where product with requested quantity is available or all locations where product is offered.
34
+ location: [BillingApi::LocationEnum::PHX], # Array<LocationEnum> |
35
+ solution: ['SERVER_RANCHER'], # Array<String> |
36
+ min_quantity: 2 # Float | Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
37
+ }
38
+
39
+ begin
40
+ # List all Product availabilities.
41
+ result = api_instance.product_availability_get(opts)
42
+ p result
43
+ rescue BillingApi::ApiError => e
44
+ puts "Error when calling ProductAvailabilityApi->product_availability_get: #{e}"
45
+ end
46
+ ```
47
+
48
+ #### Using the product_availability_get_with_http_info variant
49
+
50
+ This returns an Array which contains the response data, status code and headers.
51
+
52
+ > <Array(<Array<ProductAvailability>>, Integer, Hash)> product_availability_get_with_http_info(opts)
53
+
54
+ ```ruby
55
+ begin
56
+ # List all Product availabilities.
57
+ data, status_code, headers = api_instance.product_availability_get_with_http_info(opts)
58
+ p status_code # => 2xx
59
+ p headers # => { ... }
60
+ p data # => <Array<ProductAvailability>>
61
+ rescue BillingApi::ApiError => e
62
+ puts "Error when calling ProductAvailabilityApi->product_availability_get_with_http_info: #{e}"
63
+ end
64
+ ```
65
+
66
+ ### Parameters
67
+
68
+ | Name | Type | Description | Notes |
69
+ | ---- | ---- | ----------- | ----- |
70
+ | **product_category** | [**Array&lt;String&gt;**](String.md) | Product category. Currently only SERVER category is supported. | [optional] |
71
+ | **product_code** | [**Array&lt;String&gt;**](String.md) | | [optional] |
72
+ | **show_only_min_quantity_available** | **Boolean** | Show only locations where product with requested quantity is available or all locations where product is offered. | [optional][default to true] |
73
+ | **location** | [**Array&lt;LocationEnum&gt;**](LocationEnum.md) | | [optional] |
74
+ | **solution** | [**Array&lt;String&gt;**](String.md) | | [optional] |
75
+ | **min_quantity** | **Float** | Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively. | [optional] |
76
+
77
+ ### Return type
78
+
79
+ [**Array&lt;ProductAvailability&gt;**](ProductAvailability.md)
80
+
81
+ ### Authorization
82
+
83
+ [OAuth2](../README.md#OAuth2)
84
+
85
+ ### HTTP request headers
86
+
87
+ - **Content-Type**: Not defined
88
+ - **Accept**: application/json
89
+
data/docs/ProductsApi.md CHANGED
@@ -4,91 +4,9 @@ All URIs are relative to *https://api.phoenixnap.com/billing/v1*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
- | [**product_availability_get**](ProductsApi.md#product_availability_get) | **GET** /product-availability | List all Product availabilities. |
8
7
  | [**products_get**](ProductsApi.md#products_get) | **GET** /products | List all Products. |
9
8
 
10
9
 
11
- ## product_availability_get
12
-
13
- > <Array<ProductAvailability>> product_availability_get(opts)
14
-
15
- List all Product availabilities.
16
-
17
- Retrieves the list of product availability details.
18
-
19
- ### Examples
20
-
21
- ```ruby
22
- require 'time'
23
- require 'pnap_billing_api'
24
- # setup authorization
25
- BillingApi.configure do |config|
26
- # Configure OAuth2 access token for authorization: OAuth2
27
- config.access_token = 'YOUR ACCESS TOKEN'
28
- end
29
-
30
- api_instance = BillingApi::ProductsApi.new
31
- opts = {
32
- product_category: ['SERVER'], # Array<String> | Product category. Currently only SERVER category is supported.
33
- product_code: ['inner_example'], # Array<String> |
34
- show_only_min_quantity_available: true, # Boolean | Show only locations where product with requested quantity is available or all locations where product is offered.
35
- location: [BillingApi::LocationEnum::PHX], # Array<LocationEnum> |
36
- solution: ['SERVER_RANCHER'], # Array<String> |
37
- min_quantity: 2 # Float | Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
38
- }
39
-
40
- begin
41
- # List all Product availabilities.
42
- result = api_instance.product_availability_get(opts)
43
- p result
44
- rescue BillingApi::ApiError => e
45
- puts "Error when calling ProductsApi->product_availability_get: #{e}"
46
- end
47
- ```
48
-
49
- #### Using the product_availability_get_with_http_info variant
50
-
51
- This returns an Array which contains the response data, status code and headers.
52
-
53
- > <Array(<Array<ProductAvailability>>, Integer, Hash)> product_availability_get_with_http_info(opts)
54
-
55
- ```ruby
56
- begin
57
- # List all Product availabilities.
58
- data, status_code, headers = api_instance.product_availability_get_with_http_info(opts)
59
- p status_code # => 2xx
60
- p headers # => { ... }
61
- p data # => <Array<ProductAvailability>>
62
- rescue BillingApi::ApiError => e
63
- puts "Error when calling ProductsApi->product_availability_get_with_http_info: #{e}"
64
- end
65
- ```
66
-
67
- ### Parameters
68
-
69
- | Name | Type | Description | Notes |
70
- | ---- | ---- | ----------- | ----- |
71
- | **product_category** | [**Array&lt;String&gt;**](String.md) | Product category. Currently only SERVER category is supported. | [optional] |
72
- | **product_code** | [**Array&lt;String&gt;**](String.md) | | [optional] |
73
- | **show_only_min_quantity_available** | **Boolean** | Show only locations where product with requested quantity is available or all locations where product is offered. | [optional][default to true] |
74
- | **location** | [**Array&lt;LocationEnum&gt;**](LocationEnum.md) | | [optional] |
75
- | **solution** | [**Array&lt;String&gt;**](String.md) | | [optional] |
76
- | **min_quantity** | **Float** | Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively. | [optional] |
77
-
78
- ### Return type
79
-
80
- [**Array&lt;ProductAvailability&gt;**](ProductAvailability.md)
81
-
82
- ### Authorization
83
-
84
- [OAuth2](../README.md#OAuth2)
85
-
86
- ### HTTP request headers
87
-
88
- - **Content-Type**: Not defined
89
- - **Accept**: application/json
90
-
91
-
92
10
  ## products_get
93
11
 
94
12
  > <Array<ProductsGet200ResponseInner>> products_get(opts)
data/docs/Reservation.md CHANGED
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id** | **String** | The reservation identifier. | |
8
8
  | **product_code** | **String** | The code identifying the product. This code has significant across all locations. | |
9
- | **product_category** | **String** | The product category. | |
9
+ | **product_category** | [**ReservationProductCategoryEnum**](ReservationProductCategoryEnum.md) | | |
10
10
  | **location** | [**LocationEnum**](LocationEnum.md) | | |
11
11
  | **reservation_model** | [**ReservationModelEnum**](ReservationModelEnum.md) | | |
12
12
  | **initial_invoice_model** | [**ReservationInvoicingModelEnum**](ReservationInvoicingModelEnum.md) | | [optional] |
@@ -29,7 +29,7 @@ require 'pnap_billing_api'
29
29
  instance = BillingApi::Reservation.new(
30
30
  id: 83604275-bdba-490a-b87a-978e8dffdb14,
31
31
  product_code: s1.c1.small,
32
- product_category: server,
32
+ product_category: null,
33
33
  location: null,
34
34
  reservation_model: null,
35
35
  initial_invoice_model: null,
@@ -0,0 +1,15 @@
1
+ # BillingApi::ReservationProductCategoryEnum
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'pnap_billing_api'
12
+
13
+ instance = BillingApi::ReservationProductCategoryEnum.new()
14
+ ```
15
+
@@ -6,10 +6,10 @@ All URIs are relative to *https://api.phoenixnap.com/billing/v1*
6
6
  | ------ | ------------ | ----------- |
7
7
  | [**reservations_get**](ReservationsApi.md#reservations_get) | **GET** /reservations | List all Reservations. |
8
8
  | [**reservations_post**](ReservationsApi.md#reservations_post) | **POST** /reservations | Create a reservation. |
9
- | [**reservations_reservation_id_actions_auto_renew_disable_post**](ReservationsApi.md#reservations_reservation_id_actions_auto_renew_disable_post) | **POST** /reservations/{reservationId}/actions/auto-renew/disable | Disable auto-renewal for reservation by id. |
10
- | [**reservations_reservation_id_actions_auto_renew_enable_post**](ReservationsApi.md#reservations_reservation_id_actions_auto_renew_enable_post) | **POST** /reservations/{reservationId}/actions/auto-renew/enable | Enable auto-renewal for unexpired reservation by reservation id. |
11
- | [**reservations_reservation_id_actions_convert_post**](ReservationsApi.md#reservations_reservation_id_actions_convert_post) | **POST** /reservations/{reservationId}/actions/convert | Convert reservation pricing model by reservation ID. |
12
- | [**reservations_reservation_id_get**](ReservationsApi.md#reservations_reservation_id_get) | **GET** /reservations/{reservationId} | Get a reservation. |
9
+ | [**reservations_reservation_id_actions_auto_renew_disable_post**](ReservationsApi.md#reservations_reservation_id_actions_auto_renew_disable_post) | **POST** /reservations/{id}/actions/auto-renew/disable | Disable auto-renewal for reservation by id. |
10
+ | [**reservations_reservation_id_actions_auto_renew_enable_post**](ReservationsApi.md#reservations_reservation_id_actions_auto_renew_enable_post) | **POST** /reservations/{id}/actions/auto-renew/enable | Enable auto-renewal for unexpired reservation by reservation id. |
11
+ | [**reservations_reservation_id_actions_convert_post**](ReservationsApi.md#reservations_reservation_id_actions_convert_post) | **POST** /reservations/{id}/actions/convert | Convert reservation pricing model by reservation ID. |
12
+ | [**reservations_reservation_id_get**](ReservationsApi.md#reservations_reservation_id_get) | **GET** /reservations/{id} | Get a reservation. |
13
13
 
14
14
 
15
15
  ## reservations_get
@@ -33,7 +33,7 @@ end
33
33
 
34
34
  api_instance = BillingApi::ReservationsApi.new
35
35
  opts = {
36
- product_category: BillingApi::ProductCategoryEnum::SERVER # ProductCategoryEnum | The product category
36
+ product_category: BillingApi::ReservationProductCategoryEnum::SERVER # ReservationProductCategoryEnum | The product category
37
37
  }
38
38
 
39
39
  begin
@@ -67,7 +67,7 @@ end
67
67
 
68
68
  | Name | Type | Description | Notes |
69
69
  | ---- | ---- | ----------- | ----- |
70
- | **product_category** | [**ProductCategoryEnum**](.md) | The product category | [optional] |
70
+ | **product_category** | [**ReservationProductCategoryEnum**](.md) | The product category | [optional] |
71
71
 
72
72
  ### Return type
73
73
 
@@ -156,7 +156,7 @@ end
156
156
 
157
157
  ## reservations_reservation_id_actions_auto_renew_disable_post
158
158
 
159
- > <Reservation> reservations_reservation_id_actions_auto_renew_disable_post(reservation_id, opts)
159
+ > <Reservation> reservations_reservation_id_actions_auto_renew_disable_post(id, opts)
160
160
 
161
161
  Disable auto-renewal for reservation by id.
162
162
 
@@ -174,14 +174,14 @@ BillingApi.configure do |config|
174
174
  end
175
175
 
176
176
  api_instance = BillingApi::ReservationsApi.new
177
- reservation_id = 'e6afba51-7de8-4080-83ab-0f915570659c' # String | The reservation's ID.
177
+ id = 'd90bbea9-5725-47ce-879e-d3905bafac2a' # String | Resource id.
178
178
  opts = {
179
179
  reservation_auto_renew_disable_request: BillingApi::ReservationAutoRenewDisableRequest.new # ReservationAutoRenewDisableRequest |
180
180
  }
181
181
 
182
182
  begin
183
183
  # Disable auto-renewal for reservation by id.
184
- result = api_instance.reservations_reservation_id_actions_auto_renew_disable_post(reservation_id, opts)
184
+ result = api_instance.reservations_reservation_id_actions_auto_renew_disable_post(id, opts)
185
185
  p result
186
186
  rescue BillingApi::ApiError => e
187
187
  puts "Error when calling ReservationsApi->reservations_reservation_id_actions_auto_renew_disable_post: #{e}"
@@ -192,12 +192,12 @@ end
192
192
 
193
193
  This returns an Array which contains the response data, status code and headers.
194
194
 
195
- > <Array(<Reservation>, Integer, Hash)> reservations_reservation_id_actions_auto_renew_disable_post_with_http_info(reservation_id, opts)
195
+ > <Array(<Reservation>, Integer, Hash)> reservations_reservation_id_actions_auto_renew_disable_post_with_http_info(id, opts)
196
196
 
197
197
  ```ruby
198
198
  begin
199
199
  # Disable auto-renewal for reservation by id.
200
- data, status_code, headers = api_instance.reservations_reservation_id_actions_auto_renew_disable_post_with_http_info(reservation_id, opts)
200
+ data, status_code, headers = api_instance.reservations_reservation_id_actions_auto_renew_disable_post_with_http_info(id, opts)
201
201
  p status_code # => 2xx
202
202
  p headers # => { ... }
203
203
  p data # => <Reservation>
@@ -210,7 +210,7 @@ end
210
210
 
211
211
  | Name | Type | Description | Notes |
212
212
  | ---- | ---- | ----------- | ----- |
213
- | **reservation_id** | **String** | The reservation&#39;s ID. | |
213
+ | **id** | **String** | Resource id. | |
214
214
  | **reservation_auto_renew_disable_request** | [**ReservationAutoRenewDisableRequest**](ReservationAutoRenewDisableRequest.md) | | [optional] |
215
215
 
216
216
  ### Return type
@@ -229,7 +229,7 @@ end
229
229
 
230
230
  ## reservations_reservation_id_actions_auto_renew_enable_post
231
231
 
232
- > <Reservation> reservations_reservation_id_actions_auto_renew_enable_post(reservation_id)
232
+ > <Reservation> reservations_reservation_id_actions_auto_renew_enable_post(id)
233
233
 
234
234
  Enable auto-renewal for unexpired reservation by reservation id.
235
235
 
@@ -247,11 +247,11 @@ BillingApi.configure do |config|
247
247
  end
248
248
 
249
249
  api_instance = BillingApi::ReservationsApi.new
250
- reservation_id = 'e6afba51-7de8-4080-83ab-0f915570659c' # String | The reservation's ID.
250
+ id = 'd90bbea9-5725-47ce-879e-d3905bafac2a' # String | Resource id.
251
251
 
252
252
  begin
253
253
  # Enable auto-renewal for unexpired reservation by reservation id.
254
- result = api_instance.reservations_reservation_id_actions_auto_renew_enable_post(reservation_id)
254
+ result = api_instance.reservations_reservation_id_actions_auto_renew_enable_post(id)
255
255
  p result
256
256
  rescue BillingApi::ApiError => e
257
257
  puts "Error when calling ReservationsApi->reservations_reservation_id_actions_auto_renew_enable_post: #{e}"
@@ -262,12 +262,12 @@ end
262
262
 
263
263
  This returns an Array which contains the response data, status code and headers.
264
264
 
265
- > <Array(<Reservation>, Integer, Hash)> reservations_reservation_id_actions_auto_renew_enable_post_with_http_info(reservation_id)
265
+ > <Array(<Reservation>, Integer, Hash)> reservations_reservation_id_actions_auto_renew_enable_post_with_http_info(id)
266
266
 
267
267
  ```ruby
268
268
  begin
269
269
  # Enable auto-renewal for unexpired reservation by reservation id.
270
- data, status_code, headers = api_instance.reservations_reservation_id_actions_auto_renew_enable_post_with_http_info(reservation_id)
270
+ data, status_code, headers = api_instance.reservations_reservation_id_actions_auto_renew_enable_post_with_http_info(id)
271
271
  p status_code # => 2xx
272
272
  p headers # => { ... }
273
273
  p data # => <Reservation>
@@ -280,7 +280,7 @@ end
280
280
 
281
281
  | Name | Type | Description | Notes |
282
282
  | ---- | ---- | ----------- | ----- |
283
- | **reservation_id** | **String** | The reservation&#39;s ID. | |
283
+ | **id** | **String** | Resource id. | |
284
284
 
285
285
  ### Return type
286
286
 
@@ -298,7 +298,7 @@ end
298
298
 
299
299
  ## reservations_reservation_id_actions_convert_post
300
300
 
301
- > <Reservation> reservations_reservation_id_actions_convert_post(reservation_id, opts)
301
+ > <Reservation> reservations_reservation_id_actions_convert_post(id, opts)
302
302
 
303
303
  Convert reservation pricing model by reservation ID.
304
304
 
@@ -316,14 +316,14 @@ BillingApi.configure do |config|
316
316
  end
317
317
 
318
318
  api_instance = BillingApi::ReservationsApi.new
319
- reservation_id = 'e6afba51-7de8-4080-83ab-0f915570659c' # String | The reservation's ID.
319
+ id = 'd90bbea9-5725-47ce-879e-d3905bafac2a' # String | Resource id.
320
320
  opts = {
321
321
  reservation_request: BillingApi::ReservationRequest.new({sku: 'XXX-XXX-XXX'}) # ReservationRequest |
322
322
  }
323
323
 
324
324
  begin
325
325
  # Convert reservation pricing model by reservation ID.
326
- result = api_instance.reservations_reservation_id_actions_convert_post(reservation_id, opts)
326
+ result = api_instance.reservations_reservation_id_actions_convert_post(id, opts)
327
327
  p result
328
328
  rescue BillingApi::ApiError => e
329
329
  puts "Error when calling ReservationsApi->reservations_reservation_id_actions_convert_post: #{e}"
@@ -334,12 +334,12 @@ end
334
334
 
335
335
  This returns an Array which contains the response data, status code and headers.
336
336
 
337
- > <Array(<Reservation>, Integer, Hash)> reservations_reservation_id_actions_convert_post_with_http_info(reservation_id, opts)
337
+ > <Array(<Reservation>, Integer, Hash)> reservations_reservation_id_actions_convert_post_with_http_info(id, opts)
338
338
 
339
339
  ```ruby
340
340
  begin
341
341
  # Convert reservation pricing model by reservation ID.
342
- data, status_code, headers = api_instance.reservations_reservation_id_actions_convert_post_with_http_info(reservation_id, opts)
342
+ data, status_code, headers = api_instance.reservations_reservation_id_actions_convert_post_with_http_info(id, opts)
343
343
  p status_code # => 2xx
344
344
  p headers # => { ... }
345
345
  p data # => <Reservation>
@@ -352,7 +352,7 @@ end
352
352
 
353
353
  | Name | Type | Description | Notes |
354
354
  | ---- | ---- | ----------- | ----- |
355
- | **reservation_id** | **String** | The reservation&#39;s ID. | |
355
+ | **id** | **String** | Resource id. | |
356
356
  | **reservation_request** | [**ReservationRequest**](ReservationRequest.md) | | [optional] |
357
357
 
358
358
  ### Return type
@@ -371,7 +371,7 @@ end
371
371
 
372
372
  ## reservations_reservation_id_get
373
373
 
374
- > <Reservation> reservations_reservation_id_get(reservation_id)
374
+ > <Reservation> reservations_reservation_id_get(id)
375
375
 
376
376
  Get a reservation.
377
377
 
@@ -389,11 +389,11 @@ BillingApi.configure do |config|
389
389
  end
390
390
 
391
391
  api_instance = BillingApi::ReservationsApi.new
392
- reservation_id = 'e6afba51-7de8-4080-83ab-0f915570659c' # String | The reservation's ID.
392
+ id = 'd90bbea9-5725-47ce-879e-d3905bafac2a' # String | Resource id.
393
393
 
394
394
  begin
395
395
  # Get a reservation.
396
- result = api_instance.reservations_reservation_id_get(reservation_id)
396
+ result = api_instance.reservations_reservation_id_get(id)
397
397
  p result
398
398
  rescue BillingApi::ApiError => e
399
399
  puts "Error when calling ReservationsApi->reservations_reservation_id_get: #{e}"
@@ -404,12 +404,12 @@ end
404
404
 
405
405
  This returns an Array which contains the response data, status code and headers.
406
406
 
407
- > <Array(<Reservation>, Integer, Hash)> reservations_reservation_id_get_with_http_info(reservation_id)
407
+ > <Array(<Reservation>, Integer, Hash)> reservations_reservation_id_get_with_http_info(id)
408
408
 
409
409
  ```ruby
410
410
  begin
411
411
  # Get a reservation.
412
- data, status_code, headers = api_instance.reservations_reservation_id_get_with_http_info(reservation_id)
412
+ data, status_code, headers = api_instance.reservations_reservation_id_get_with_http_info(id)
413
413
  p status_code # => 2xx
414
414
  p headers # => { ... }
415
415
  p data # => <Reservation>
@@ -422,7 +422,7 @@ end
422
422
 
423
423
  | Name | Type | Description | Notes |
424
424
  | ---- | ---- | ----------- | ----- |
425
- | **reservation_id** | **String** | The reservation&#39;s ID. | |
425
+ | **id** | **String** | Resource id. | |
426
426
 
427
427
  ### Return type
428
428
 
@@ -0,0 +1,105 @@
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 ProductAvailabilityApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List all Product availabilities.
23
+ # Retrieves the list of product availability details.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [Array<String>] :product_category Product category. Currently only SERVER category is supported.
26
+ # @option opts [Array<String>] :product_code
27
+ # @option opts [Boolean] :show_only_min_quantity_available Show only locations where product with requested quantity is available or all locations where product is offered. (default to true)
28
+ # @option opts [Array<LocationEnum>] :location
29
+ # @option opts [Array<String>] :solution
30
+ # @option opts [Float] :min_quantity Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
31
+ # @return [Array<ProductAvailability>]
32
+ def product_availability_get(opts = {})
33
+ data, _status_code, _headers = product_availability_get_with_http_info(opts)
34
+ data
35
+ end
36
+
37
+ # List all Product availabilities.
38
+ # Retrieves the list of product availability details.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [Array<String>] :product_category Product category. Currently only SERVER category is supported.
41
+ # @option opts [Array<String>] :product_code
42
+ # @option opts [Boolean] :show_only_min_quantity_available Show only locations where product with requested quantity is available or all locations where product is offered. (default to true)
43
+ # @option opts [Array<LocationEnum>] :location
44
+ # @option opts [Array<String>] :solution
45
+ # @option opts [Float] :min_quantity Minimal quantity of product needed. Minimum, maximum and default values might differ for different products. For servers, they are 1, 10 and 1 respectively.
46
+ # @return [Array<(Array<ProductAvailability>, Integer, Hash)>] Array<ProductAvailability> data, response status code and response headers
47
+ def product_availability_get_with_http_info(opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: ProductAvailabilityApi.product_availability_get ...'
50
+ end
51
+ allowable_values = ["SERVER"]
52
+ if @api_client.config.client_side_validation && opts[:'product_category'] && !opts[:'product_category'].all? { |item| allowable_values.include?(item) }
53
+ fail ArgumentError, "invalid value for \"product_category\", must include one of #{allowable_values}"
54
+ end
55
+ allowable_values = ["SERVER_RANCHER"]
56
+ if @api_client.config.client_side_validation && opts[:'solution'] && !opts[:'solution'].all? { |item| allowable_values.include?(item) }
57
+ fail ArgumentError, "invalid value for \"solution\", must include one of #{allowable_values}"
58
+ end
59
+ # resource path
60
+ local_var_path = '/product-availability'
61
+
62
+ # query parameters
63
+ query_params = opts[:query_params] || {}
64
+ query_params[:'productCategory'] = @api_client.build_collection_param(opts[:'product_category'], :multi) if !opts[:'product_category'].nil?
65
+ query_params[:'productCode'] = @api_client.build_collection_param(opts[:'product_code'], :multi) if !opts[:'product_code'].nil?
66
+ query_params[:'showOnlyMinQuantityAvailable'] = opts[:'show_only_min_quantity_available'] if !opts[:'show_only_min_quantity_available'].nil?
67
+ query_params[:'location'] = @api_client.build_collection_param(opts[:'location'], :multi) if !opts[:'location'].nil?
68
+ query_params[:'solution'] = @api_client.build_collection_param(opts[:'solution'], :multi) if !opts[:'solution'].nil?
69
+ query_params[:'minQuantity'] = opts[:'min_quantity'] if !opts[:'min_quantity'].nil?
70
+
71
+ # header parameters
72
+ header_params = opts[:header_params] || {}
73
+ # HTTP header 'Accept' (if needed)
74
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
75
+
76
+ # form parameters
77
+ form_params = opts[:form_params] || {}
78
+
79
+ # http body (model)
80
+ post_body = opts[:debug_body]
81
+
82
+ # return_type
83
+ return_type = opts[:debug_return_type] || 'Array<ProductAvailability>'
84
+
85
+ # auth_names
86
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
87
+
88
+ new_options = opts.merge(
89
+ :operation => :"ProductAvailabilityApi.product_availability_get",
90
+ :header_params => header_params,
91
+ :query_params => query_params,
92
+ :form_params => form_params,
93
+ :body => post_body,
94
+ :auth_names => auth_names,
95
+ :return_type => return_type
96
+ )
97
+
98
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
99
+ if @api_client.config.debugging
100
+ @api_client.config.logger.debug "API called: ProductAvailabilityApi#product_availability_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
101
+ end
102
+ return data, status_code, headers
103
+ end
104
+ end
105
+ end