pnap_billing_api 1.0.0 → 2.1.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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -5
  3. data/VERSION +1 -1
  4. data/docs/BandwidthRecord.md +4 -2
  5. data/docs/CreditDetails.md +49 -0
  6. data/docs/CreditDetailsBase.md +20 -0
  7. data/docs/CreditTypeEnum.md +15 -0
  8. data/docs/DiscountDetails.md +2 -2
  9. data/docs/DiscountTypeEnum.md +15 -0
  10. data/docs/GpuConfigurationMetadata.md +20 -0
  11. data/docs/OperatingSystemRecord.md +4 -2
  12. data/docs/PackageUnitEnum.md +15 -0
  13. data/docs/PricingPlan.md +3 -3
  14. data/docs/ProductAvailabilityApi.md +89 -0
  15. data/docs/ProductsApi.md +0 -82
  16. data/docs/PromoCreditDetails.md +24 -0
  17. data/docs/PublicSubnetRecord.md +4 -2
  18. data/docs/RatedUsageProductCategoryEnum.md +15 -0
  19. data/docs/RatedUsageRecord.md +5 -3
  20. data/docs/Reservation.md +2 -2
  21. data/docs/ReservationAutoRenewDisableRequest.md +1 -1
  22. data/docs/ReservationProductCategoryEnum.md +15 -0
  23. data/docs/ReservationsApi.md +30 -30
  24. data/docs/ServerProductMetadata.md +3 -1
  25. data/docs/ServerRecord.md +4 -2
  26. data/docs/StorageRecord.md +4 -2
  27. data/docs/SystemCreditCauseEnum.md +15 -0
  28. data/docs/SystemCreditDetails.md +22 -0
  29. data/lib/pnap_billing_api/api/product_availability_api.rb +105 -0
  30. data/lib/pnap_billing_api/api/products_api.rb +0 -83
  31. data/lib/pnap_billing_api/api/reservations_api.rb +38 -38
  32. data/lib/pnap_billing_api/api_client.rb +2 -2
  33. data/lib/pnap_billing_api/models/bandwidth_record.rb +13 -15
  34. data/lib/pnap_billing_api/models/credit_details.rb +105 -0
  35. data/lib/pnap_billing_api/models/credit_details_base.rb +261 -0
  36. data/lib/pnap_billing_api/models/credit_type_enum.rb +40 -0
  37. data/lib/pnap_billing_api/models/discount_details.rb +1 -14
  38. data/lib/pnap_billing_api/models/discount_type_enum.rb +41 -0
  39. data/lib/pnap_billing_api/models/gpu_configuration_metadata.rb +226 -0
  40. data/lib/pnap_billing_api/models/operating_system_record.rb +13 -15
  41. data/lib/pnap_billing_api/models/package_unit_enum.rb +40 -0
  42. data/lib/pnap_billing_api/models/pricing_plan.rb +1 -14
  43. data/lib/pnap_billing_api/models/promo_credit_details.rb +301 -0
  44. data/lib/pnap_billing_api/models/public_subnet_record.rb +13 -15
  45. data/lib/pnap_billing_api/models/rated_usage_product_category_enum.rb +43 -0
  46. data/lib/pnap_billing_api/models/rated_usage_record.rb +16 -18
  47. data/lib/pnap_billing_api/models/reservation.rb +1 -14
  48. data/lib/pnap_billing_api/models/reservation_product_category_enum.rb +40 -0
  49. data/lib/pnap_billing_api/models/server_product_metadata.rb +16 -4
  50. data/lib/pnap_billing_api/models/server_record.rb +13 -15
  51. data/lib/pnap_billing_api/models/storage_record.rb +13 -15
  52. data/lib/pnap_billing_api/models/system_credit_cause_enum.rb +39 -0
  53. data/lib/pnap_billing_api/models/system_credit_details.rb +283 -0
  54. data/lib/pnap_billing_api.rb +12 -0
  55. data/spec/api/product_availability_api_spec.rb +52 -0
  56. data/spec/api/products_api_spec.rb +0 -17
  57. data/spec/api/reservations_api_spec.rb +5 -5
  58. data/spec/models/bandwidth_record_spec.rb +6 -4
  59. data/spec/models/credit_details_base_spec.rb +42 -0
  60. data/spec/models/credit_details_spec.rb +32 -0
  61. data/spec/models/credit_type_enum_spec.rb +30 -0
  62. data/spec/models/discount_details_spec.rb +0 -4
  63. data/spec/models/discount_type_enum_spec.rb +30 -0
  64. data/spec/models/gpu_configuration_metadata_spec.rb +42 -0
  65. data/spec/models/operating_system_record_spec.rb +6 -4
  66. data/spec/models/package_unit_enum_spec.rb +30 -0
  67. data/spec/models/pricing_plan_spec.rb +0 -4
  68. data/spec/models/promo_credit_details_spec.rb +54 -0
  69. data/spec/models/public_subnet_record_spec.rb +6 -4
  70. data/spec/models/rated_usage_product_category_enum_spec.rb +30 -0
  71. data/spec/models/rated_usage_record_spec.rb +6 -4
  72. data/spec/models/reservation_product_category_enum_spec.rb +30 -0
  73. data/spec/models/reservation_spec.rb +0 -4
  74. data/spec/models/server_product_metadata_spec.rb +6 -0
  75. data/spec/models/server_record_spec.rb +6 -4
  76. data/spec/models/storage_record_spec.rb +6 -4
  77. data/spec/models/system_credit_cause_enum_spec.rb +30 -0
  78. data/spec/models/system_credit_details_spec.rb +48 -0
  79. metadata +77 -29
@@ -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
 
@@ -11,6 +11,7 @@
11
11
  | **cpu_frequency** | **Float** | CPU frequency in GHz. | |
12
12
  | **network** | **String** | Server network. | |
13
13
  | **storage** | **String** | Server storage. | |
14
+ | **gpu_configurations** | [**Array&lt;GpuConfigurationMetadata&gt;**](GpuConfigurationMetadata.md) | GPU configurations | [optional] |
14
15
 
15
16
  ## Example
16
17
 
@@ -24,7 +25,8 @@ instance = BillingApi::ServerProductMetadata.new(
24
25
  cores_per_cpu: 2,
25
26
  cpu_frequency: 2.7,
26
27
  network: 2x 25Gbps,
27
- storage: 2x 2TB NVMe
28
+ storage: 2x 2TB NVMe,
29
+ gpu_configurations: null
28
30
  )
29
31
  ```
30
32
 
data/docs/ServerRecord.md CHANGED
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id** | **String** | The unique identifier of the rated usage record. | |
8
- | **product_category** | **String** | The category of the product associated with this usage record. | |
8
+ | **product_category** | [**RatedUsageProductCategoryEnum**](RatedUsageProductCategoryEnum.md) | | |
9
9
  | **product_code** | **String** | The code identifying the product associated to this usage record. | |
10
10
  | **location** | [**LocationEnum**](LocationEnum.md) | | |
11
11
  | **year_month** | **String** | Year and month of the usage record. | [optional] |
@@ -23,6 +23,7 @@
23
23
  | **correlation_id** | **String** | Holds usage record id | |
24
24
  | **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
25
25
  | **discount_details** | [**DiscountDetails**](DiscountDetails.md) | | [optional] |
26
+ | **credit_details** | [**Array&lt;CreditDetails&gt;**](CreditDetails.md) | | [optional] |
26
27
  | **metadata** | [**ServerDetails**](ServerDetails.md) | | |
27
28
 
28
29
  ## Example
@@ -32,7 +33,7 @@ require 'pnap_billing_api'
32
33
 
33
34
  instance = BillingApi::ServerRecord.new(
34
35
  id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
35
- product_category: bmc-server,
36
+ product_category: null,
36
37
  product_code: s1.c1.small,
37
38
  location: null,
38
39
  year_month: 2020-03,
@@ -50,6 +51,7 @@ instance = BillingApi::ServerRecord.new(
50
51
  correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
51
52
  reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
52
53
  discount_details: null,
54
+ credit_details: null,
53
55
  metadata: null
54
56
  )
55
57
  ```
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id** | **String** | The unique identifier of the rated usage record. | |
8
- | **product_category** | **String** | The category of the product associated with this usage record. | |
8
+ | **product_category** | [**RatedUsageProductCategoryEnum**](RatedUsageProductCategoryEnum.md) | | |
9
9
  | **product_code** | **String** | The code identifying the product associated to this usage record. | |
10
10
  | **location** | [**LocationEnum**](LocationEnum.md) | | |
11
11
  | **year_month** | **String** | Year and month of the usage record. | [optional] |
@@ -23,6 +23,7 @@
23
23
  | **correlation_id** | **String** | Holds usage record id | |
24
24
  | **reservation_id** | **String** | Reservation id associated with this rated usage record. | [optional] |
25
25
  | **discount_details** | [**DiscountDetails**](DiscountDetails.md) | | [optional] |
26
+ | **credit_details** | [**Array&lt;CreditDetails&gt;**](CreditDetails.md) | | [optional] |
26
27
  | **metadata** | [**StorageDetails**](StorageDetails.md) | | |
27
28
 
28
29
  ## Example
@@ -32,7 +33,7 @@ require 'pnap_billing_api'
32
33
 
33
34
  instance = BillingApi::StorageRecord.new(
34
35
  id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
35
- product_category: bmc-server,
36
+ product_category: null,
36
37
  product_code: s1.c1.small,
37
38
  location: null,
38
39
  year_month: 2020-03,
@@ -50,6 +51,7 @@ instance = BillingApi::StorageRecord.new(
50
51
  correlation_id: ec4a9d49-1cef-49e9-b85e-b560f88bcd26,
51
52
  reservation_id: c32a24a1-5949-4b60-99c0-c8aaa3a92b04,
52
53
  discount_details: null,
54
+ credit_details: null,
53
55
  metadata: null
54
56
  )
55
57
  ```
@@ -0,0 +1,15 @@
1
+ # BillingApi::SystemCreditCauseEnum
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::SystemCreditCauseEnum.new()
14
+ ```
15
+
@@ -0,0 +1,22 @@
1
+ # BillingApi::SystemCreditDetails
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **applied_amount** | **Float** | Amount applied. | |
8
+ | **type** | [**CreditTypeEnum**](CreditTypeEnum.md) | | |
9
+ | **cause** | [**SystemCreditCauseEnum**](SystemCreditCauseEnum.md) | | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'pnap_billing_api'
15
+
16
+ instance = BillingApi::SystemCreditDetails.new(
17
+ applied_amount: 50,
18
+ type: null,
19
+ cause: null
20
+ )
21
+ ```
22
+
@@ -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
@@ -19,89 +19,6 @@ module BillingApi
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
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: ProductsApi.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 => :"ProductsApi.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: ProductsApi#product_availability_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
101
- end
102
- return data, status_code, headers
103
- end
104
-
105
22
  # List all Products.
106
23
  # Retrieves all Products.
107
24
  # @param [Hash] opts the optional parameters