pnap_billing_api 2.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -0
  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/PricingPlan.md +2 -2
  13. data/docs/PromoCreditDetails.md +24 -0
  14. data/docs/PublicSubnetRecord.md +4 -2
  15. data/docs/RatedUsageProductCategoryEnum.md +15 -0
  16. data/docs/RatedUsageRecord.md +5 -3
  17. data/docs/ReservationAutoRenewDisableRequest.md +1 -1
  18. data/docs/ServerProductMetadata.md +3 -1
  19. data/docs/ServerRecord.md +4 -2
  20. data/docs/StorageRecord.md +4 -2
  21. data/docs/SystemCreditCauseEnum.md +15 -0
  22. data/docs/SystemCreditDetails.md +22 -0
  23. data/lib/pnap_billing_api/models/bandwidth_record.rb +13 -15
  24. data/lib/pnap_billing_api/models/credit_details.rb +105 -0
  25. data/lib/pnap_billing_api/models/credit_details_base.rb +261 -0
  26. data/lib/pnap_billing_api/models/credit_type_enum.rb +40 -0
  27. data/lib/pnap_billing_api/models/discount_details.rb +1 -14
  28. data/lib/pnap_billing_api/models/discount_type_enum.rb +41 -0
  29. data/lib/pnap_billing_api/models/gpu_configuration_metadata.rb +226 -0
  30. data/lib/pnap_billing_api/models/operating_system_record.rb +13 -15
  31. data/lib/pnap_billing_api/models/promo_credit_details.rb +301 -0
  32. data/lib/pnap_billing_api/models/public_subnet_record.rb +13 -15
  33. data/lib/pnap_billing_api/models/rated_usage_product_category_enum.rb +43 -0
  34. data/lib/pnap_billing_api/models/rated_usage_record.rb +16 -18
  35. data/lib/pnap_billing_api/models/server_product_metadata.rb +16 -4
  36. data/lib/pnap_billing_api/models/server_record.rb +13 -15
  37. data/lib/pnap_billing_api/models/storage_record.rb +13 -15
  38. data/lib/pnap_billing_api/models/system_credit_cause_enum.rb +39 -0
  39. data/lib/pnap_billing_api/models/system_credit_details.rb +283 -0
  40. data/lib/pnap_billing_api.rb +9 -0
  41. data/spec/models/bandwidth_record_spec.rb +6 -4
  42. data/spec/models/credit_details_base_spec.rb +42 -0
  43. data/spec/models/credit_details_spec.rb +32 -0
  44. data/spec/models/credit_type_enum_spec.rb +30 -0
  45. data/spec/models/discount_details_spec.rb +0 -4
  46. data/spec/models/discount_type_enum_spec.rb +30 -0
  47. data/spec/models/gpu_configuration_metadata_spec.rb +42 -0
  48. data/spec/models/operating_system_record_spec.rb +6 -4
  49. data/spec/models/promo_credit_details_spec.rb +54 -0
  50. data/spec/models/public_subnet_record_spec.rb +6 -4
  51. data/spec/models/rated_usage_product_category_enum_spec.rb +30 -0
  52. data/spec/models/rated_usage_record_spec.rb +6 -4
  53. data/spec/models/server_product_metadata_spec.rb +6 -0
  54. data/spec/models/server_record_spec.rb +6 -4
  55. data/spec/models/storage_record_spec.rb +6 -4
  56. data/spec/models/system_credit_cause_enum_spec.rb +30 -0
  57. data/spec/models/system_credit_details_spec.rb +48 -0
  58. metadata +67 -31
@@ -18,7 +18,6 @@ module BillingApi
18
18
  # The unique identifier of the rated usage record.
19
19
  attr_accessor :id
20
20
 
21
- # The category of the product associated with this usage record.
22
21
  attr_accessor :product_category
23
22
 
24
23
  # The code identifying the product associated to this usage record.
@@ -70,6 +69,8 @@ module BillingApi
70
69
 
71
70
  attr_accessor :discount_details
72
71
 
72
+ attr_accessor :credit_details
73
+
73
74
  attr_accessor :metadata
74
75
 
75
76
  class EnumAttributeValidator
@@ -116,6 +117,7 @@ module BillingApi
116
117
  :'correlation_id' => :'correlationId',
117
118
  :'reservation_id' => :'reservationId',
118
119
  :'discount_details' => :'discountDetails',
120
+ :'credit_details' => :'creditDetails',
119
121
  :'metadata' => :'metadata'
120
122
  }
121
123
  end
@@ -129,7 +131,7 @@ module BillingApi
129
131
  def self.openapi_types
130
132
  {
131
133
  :'id' => :'String',
132
- :'product_category' => :'String',
134
+ :'product_category' => :'RatedUsageProductCategoryEnum',
133
135
  :'product_code' => :'String',
134
136
  :'location' => :'LocationEnum',
135
137
  :'year_month' => :'String',
@@ -147,6 +149,7 @@ module BillingApi
147
149
  :'correlation_id' => :'String',
148
150
  :'reservation_id' => :'String',
149
151
  :'discount_details' => :'DiscountDetails',
152
+ :'credit_details' => :'Array<CreditDetails>',
150
153
  :'metadata' => :'PublicSubnetDetails'
151
154
  }
152
155
  end
@@ -283,6 +286,12 @@ module BillingApi
283
286
  self.discount_details = attributes[:'discount_details']
284
287
  end
285
288
 
289
+ if attributes.key?(:'credit_details')
290
+ if (value = attributes[:'credit_details']).is_a?(Array)
291
+ self.credit_details = value
292
+ end
293
+ end
294
+
286
295
  if attributes.key?(:'metadata')
287
296
  self.metadata = attributes[:'metadata']
288
297
  else
@@ -364,8 +373,6 @@ module BillingApi
364
373
  warn '[DEPRECATED] the `valid?` method is obsolete'
365
374
  return false if @id.nil?
366
375
  return false if @product_category.nil?
367
- product_category_validator = EnumAttributeValidator.new('String', ["bmc-server", "bandwidth", "operating-system", "public-ip", "storage"])
368
- return false unless product_category_validator.valid?(@product_category)
369
376
  return false if @product_code.nil?
370
377
  return false if @location.nil?
371
378
  return false if @start_date_time.nil?
@@ -382,16 +389,6 @@ module BillingApi
382
389
  true
383
390
  end
384
391
 
385
- # Custom attribute writer method checking allowed values (enum).
386
- # @param [Object] product_category Object to be assigned
387
- def product_category=(product_category)
388
- validator = EnumAttributeValidator.new('String', ["bmc-server", "bandwidth", "operating-system", "public-ip", "storage"])
389
- unless validator.valid?(product_category)
390
- fail ArgumentError, "invalid value for \"product_category\", must be one of #{validator.allowable_values}."
391
- end
392
- @product_category = product_category
393
- end
394
-
395
392
  # Checks equality by comparing each attribute.
396
393
  # @param [Object] Object to be compared
397
394
  def ==(o)
@@ -416,6 +413,7 @@ module BillingApi
416
413
  correlation_id == o.correlation_id &&
417
414
  reservation_id == o.reservation_id &&
418
415
  discount_details == o.discount_details &&
416
+ credit_details == o.credit_details &&
419
417
  metadata == o.metadata
420
418
  end
421
419
 
@@ -428,7 +426,7 @@ module BillingApi
428
426
  # Calculates hash code according to all attributes.
429
427
  # @return [Integer] Hash code
430
428
  def hash
431
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, metadata].hash
429
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details, metadata].hash
432
430
  end
433
431
 
434
432
  # Builds the object from hash
@@ -0,0 +1,43 @@
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 'date'
14
+ require 'time'
15
+
16
+ module BillingApi
17
+ class RatedUsageProductCategoryEnum
18
+ BMC_SERVER = "bmc-server".freeze
19
+ BANDWIDTH = "bandwidth".freeze
20
+ OPERATING_SYSTEM = "operating-system".freeze
21
+ PUBLIC_IP = "public-ip".freeze
22
+ STORAGE = "storage".freeze
23
+
24
+ def self.all_vars
25
+ @all_vars ||= [BMC_SERVER, BANDWIDTH, OPERATING_SYSTEM, PUBLIC_IP, STORAGE].freeze
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def self.build_from_hash(value)
32
+ new.build_from_hash(value)
33
+ end
34
+
35
+ # Builds the enum from string
36
+ # @param [String] The enum value in the form of the string
37
+ # @return [String] The enum value
38
+ def build_from_hash(value)
39
+ return value if RatedUsageProductCategoryEnum.all_vars.include?(value)
40
+ raise "Invalid ENUM value #{value} for class #RatedUsageProductCategoryEnum"
41
+ end
42
+ end
43
+ end
@@ -19,7 +19,6 @@ module BillingApi
19
19
  # The unique identifier of the rated usage record.
20
20
  attr_accessor :id
21
21
 
22
- # The category of the product associated with this usage record.
23
22
  attr_accessor :product_category
24
23
 
25
24
  # The code identifying the product associated to this usage record.
@@ -71,6 +70,8 @@ module BillingApi
71
70
 
72
71
  attr_accessor :discount_details
73
72
 
73
+ attr_accessor :credit_details
74
+
74
75
  class EnumAttributeValidator
75
76
  attr_reader :datatype
76
77
  attr_reader :allowable_values
@@ -114,7 +115,8 @@ module BillingApi
114
115
  :'usage_session_id' => :'usageSessionId',
115
116
  :'correlation_id' => :'correlationId',
116
117
  :'reservation_id' => :'reservationId',
117
- :'discount_details' => :'discountDetails'
118
+ :'discount_details' => :'discountDetails',
119
+ :'credit_details' => :'creditDetails'
118
120
  }
119
121
  end
120
122
 
@@ -127,7 +129,7 @@ module BillingApi
127
129
  def self.openapi_types
128
130
  {
129
131
  :'id' => :'String',
130
- :'product_category' => :'String',
132
+ :'product_category' => :'RatedUsageProductCategoryEnum',
131
133
  :'product_code' => :'String',
132
134
  :'location' => :'LocationEnum',
133
135
  :'year_month' => :'String',
@@ -144,7 +146,8 @@ module BillingApi
144
146
  :'usage_session_id' => :'String',
145
147
  :'correlation_id' => :'String',
146
148
  :'reservation_id' => :'String',
147
- :'discount_details' => :'DiscountDetails'
149
+ :'discount_details' => :'DiscountDetails',
150
+ :'credit_details' => :'Array<CreditDetails>'
148
151
  }
149
152
  end
150
153
 
@@ -272,6 +275,12 @@ module BillingApi
272
275
  if attributes.key?(:'discount_details')
273
276
  self.discount_details = attributes[:'discount_details']
274
277
  end
278
+
279
+ if attributes.key?(:'credit_details')
280
+ if (value = attributes[:'credit_details']).is_a?(Array)
281
+ self.credit_details = value
282
+ end
283
+ end
275
284
  end
276
285
 
277
286
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -344,8 +353,6 @@ module BillingApi
344
353
  warn '[DEPRECATED] the `valid?` method is obsolete'
345
354
  return false if @id.nil?
346
355
  return false if @product_category.nil?
347
- product_category_validator = EnumAttributeValidator.new('String', ["bmc-server", "bandwidth", "operating-system", "public-ip", "storage"])
348
- return false unless product_category_validator.valid?(@product_category)
349
356
  return false if @product_code.nil?
350
357
  return false if @location.nil?
351
358
  return false if @start_date_time.nil?
@@ -361,16 +368,6 @@ module BillingApi
361
368
  true
362
369
  end
363
370
 
364
- # Custom attribute writer method checking allowed values (enum).
365
- # @param [Object] product_category Object to be assigned
366
- def product_category=(product_category)
367
- validator = EnumAttributeValidator.new('String', ["bmc-server", "bandwidth", "operating-system", "public-ip", "storage"])
368
- unless validator.valid?(product_category)
369
- fail ArgumentError, "invalid value for \"product_category\", must be one of #{validator.allowable_values}."
370
- end
371
- @product_category = product_category
372
- end
373
-
374
371
  # Checks equality by comparing each attribute.
375
372
  # @param [Object] Object to be compared
376
373
  def ==(o)
@@ -394,7 +391,8 @@ module BillingApi
394
391
  usage_session_id == o.usage_session_id &&
395
392
  correlation_id == o.correlation_id &&
396
393
  reservation_id == o.reservation_id &&
397
- discount_details == o.discount_details
394
+ discount_details == o.discount_details &&
395
+ credit_details == o.credit_details
398
396
  end
399
397
 
400
398
  # @see the `==` method
@@ -406,7 +404,7 @@ module BillingApi
406
404
  # Calculates hash code according to all attributes.
407
405
  # @return [Integer] Hash code
408
406
  def hash
409
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details].hash
407
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details].hash
410
408
  end
411
409
 
412
410
  # Builds the object from hash
@@ -37,6 +37,9 @@ module BillingApi
37
37
  # Server storage.
38
38
  attr_accessor :storage
39
39
 
40
+ # GPU configurations
41
+ attr_accessor :gpu_configurations
42
+
40
43
  # Attribute mapping from ruby-style variable name to JSON key.
41
44
  def self.attribute_map
42
45
  {
@@ -46,7 +49,8 @@ module BillingApi
46
49
  :'cores_per_cpu' => :'coresPerCpu',
47
50
  :'cpu_frequency' => :'cpuFrequency',
48
51
  :'network' => :'network',
49
- :'storage' => :'storage'
52
+ :'storage' => :'storage',
53
+ :'gpu_configurations' => :'gpuConfigurations'
50
54
  }
51
55
  end
52
56
 
@@ -64,7 +68,8 @@ module BillingApi
64
68
  :'cores_per_cpu' => :'Float',
65
69
  :'cpu_frequency' => :'Float',
66
70
  :'network' => :'String',
67
- :'storage' => :'String'
71
+ :'storage' => :'String',
72
+ :'gpu_configurations' => :'Array<GpuConfigurationMetadata>'
68
73
  }
69
74
  end
70
75
 
@@ -130,6 +135,12 @@ module BillingApi
130
135
  else
131
136
  self.storage = nil
132
137
  end
138
+
139
+ if attributes.key?(:'gpu_configurations')
140
+ if (value = attributes[:'gpu_configurations']).is_a?(Array)
141
+ self.gpu_configurations = value
142
+ end
143
+ end
133
144
  end
134
145
 
135
146
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -193,7 +204,8 @@ module BillingApi
193
204
  cores_per_cpu == o.cores_per_cpu &&
194
205
  cpu_frequency == o.cpu_frequency &&
195
206
  network == o.network &&
196
- storage == o.storage
207
+ storage == o.storage &&
208
+ gpu_configurations == o.gpu_configurations
197
209
  end
198
210
 
199
211
  # @see the `==` method
@@ -205,7 +217,7 @@ module BillingApi
205
217
  # Calculates hash code according to all attributes.
206
218
  # @return [Integer] Hash code
207
219
  def hash
208
- [ram_in_gb, cpu, cpu_count, cores_per_cpu, cpu_frequency, network, storage].hash
220
+ [ram_in_gb, cpu, cpu_count, cores_per_cpu, cpu_frequency, network, storage, gpu_configurations].hash
209
221
  end
210
222
 
211
223
  # Builds the object from hash
@@ -18,7 +18,6 @@ module BillingApi
18
18
  # The unique identifier of the rated usage record.
19
19
  attr_accessor :id
20
20
 
21
- # The category of the product associated with this usage record.
22
21
  attr_accessor :product_category
23
22
 
24
23
  # The code identifying the product associated to this usage record.
@@ -70,6 +69,8 @@ module BillingApi
70
69
 
71
70
  attr_accessor :discount_details
72
71
 
72
+ attr_accessor :credit_details
73
+
73
74
  attr_accessor :metadata
74
75
 
75
76
  class EnumAttributeValidator
@@ -116,6 +117,7 @@ module BillingApi
116
117
  :'correlation_id' => :'correlationId',
117
118
  :'reservation_id' => :'reservationId',
118
119
  :'discount_details' => :'discountDetails',
120
+ :'credit_details' => :'creditDetails',
119
121
  :'metadata' => :'metadata'
120
122
  }
121
123
  end
@@ -129,7 +131,7 @@ module BillingApi
129
131
  def self.openapi_types
130
132
  {
131
133
  :'id' => :'String',
132
- :'product_category' => :'String',
134
+ :'product_category' => :'RatedUsageProductCategoryEnum',
133
135
  :'product_code' => :'String',
134
136
  :'location' => :'LocationEnum',
135
137
  :'year_month' => :'String',
@@ -147,6 +149,7 @@ module BillingApi
147
149
  :'correlation_id' => :'String',
148
150
  :'reservation_id' => :'String',
149
151
  :'discount_details' => :'DiscountDetails',
152
+ :'credit_details' => :'Array<CreditDetails>',
150
153
  :'metadata' => :'ServerDetails'
151
154
  }
152
155
  end
@@ -283,6 +286,12 @@ module BillingApi
283
286
  self.discount_details = attributes[:'discount_details']
284
287
  end
285
288
 
289
+ if attributes.key?(:'credit_details')
290
+ if (value = attributes[:'credit_details']).is_a?(Array)
291
+ self.credit_details = value
292
+ end
293
+ end
294
+
286
295
  if attributes.key?(:'metadata')
287
296
  self.metadata = attributes[:'metadata']
288
297
  else
@@ -364,8 +373,6 @@ module BillingApi
364
373
  warn '[DEPRECATED] the `valid?` method is obsolete'
365
374
  return false if @id.nil?
366
375
  return false if @product_category.nil?
367
- product_category_validator = EnumAttributeValidator.new('String', ["bmc-server", "bandwidth", "operating-system", "public-ip", "storage"])
368
- return false unless product_category_validator.valid?(@product_category)
369
376
  return false if @product_code.nil?
370
377
  return false if @location.nil?
371
378
  return false if @start_date_time.nil?
@@ -382,16 +389,6 @@ module BillingApi
382
389
  true
383
390
  end
384
391
 
385
- # Custom attribute writer method checking allowed values (enum).
386
- # @param [Object] product_category Object to be assigned
387
- def product_category=(product_category)
388
- validator = EnumAttributeValidator.new('String', ["bmc-server", "bandwidth", "operating-system", "public-ip", "storage"])
389
- unless validator.valid?(product_category)
390
- fail ArgumentError, "invalid value for \"product_category\", must be one of #{validator.allowable_values}."
391
- end
392
- @product_category = product_category
393
- end
394
-
395
392
  # Checks equality by comparing each attribute.
396
393
  # @param [Object] Object to be compared
397
394
  def ==(o)
@@ -416,6 +413,7 @@ module BillingApi
416
413
  correlation_id == o.correlation_id &&
417
414
  reservation_id == o.reservation_id &&
418
415
  discount_details == o.discount_details &&
416
+ credit_details == o.credit_details &&
419
417
  metadata == o.metadata
420
418
  end
421
419
 
@@ -428,7 +426,7 @@ module BillingApi
428
426
  # Calculates hash code according to all attributes.
429
427
  # @return [Integer] Hash code
430
428
  def hash
431
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, metadata].hash
429
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details, metadata].hash
432
430
  end
433
431
 
434
432
  # Builds the object from hash
@@ -18,7 +18,6 @@ module BillingApi
18
18
  # The unique identifier of the rated usage record.
19
19
  attr_accessor :id
20
20
 
21
- # The category of the product associated with this usage record.
22
21
  attr_accessor :product_category
23
22
 
24
23
  # The code identifying the product associated to this usage record.
@@ -70,6 +69,8 @@ module BillingApi
70
69
 
71
70
  attr_accessor :discount_details
72
71
 
72
+ attr_accessor :credit_details
73
+
73
74
  attr_accessor :metadata
74
75
 
75
76
  class EnumAttributeValidator
@@ -116,6 +117,7 @@ module BillingApi
116
117
  :'correlation_id' => :'correlationId',
117
118
  :'reservation_id' => :'reservationId',
118
119
  :'discount_details' => :'discountDetails',
120
+ :'credit_details' => :'creditDetails',
119
121
  :'metadata' => :'metadata'
120
122
  }
121
123
  end
@@ -129,7 +131,7 @@ module BillingApi
129
131
  def self.openapi_types
130
132
  {
131
133
  :'id' => :'String',
132
- :'product_category' => :'String',
134
+ :'product_category' => :'RatedUsageProductCategoryEnum',
133
135
  :'product_code' => :'String',
134
136
  :'location' => :'LocationEnum',
135
137
  :'year_month' => :'String',
@@ -147,6 +149,7 @@ module BillingApi
147
149
  :'correlation_id' => :'String',
148
150
  :'reservation_id' => :'String',
149
151
  :'discount_details' => :'DiscountDetails',
152
+ :'credit_details' => :'Array<CreditDetails>',
150
153
  :'metadata' => :'StorageDetails'
151
154
  }
152
155
  end
@@ -283,6 +286,12 @@ module BillingApi
283
286
  self.discount_details = attributes[:'discount_details']
284
287
  end
285
288
 
289
+ if attributes.key?(:'credit_details')
290
+ if (value = attributes[:'credit_details']).is_a?(Array)
291
+ self.credit_details = value
292
+ end
293
+ end
294
+
286
295
  if attributes.key?(:'metadata')
287
296
  self.metadata = attributes[:'metadata']
288
297
  else
@@ -364,8 +373,6 @@ module BillingApi
364
373
  warn '[DEPRECATED] the `valid?` method is obsolete'
365
374
  return false if @id.nil?
366
375
  return false if @product_category.nil?
367
- product_category_validator = EnumAttributeValidator.new('String', ["bmc-server", "bandwidth", "operating-system", "public-ip", "storage"])
368
- return false unless product_category_validator.valid?(@product_category)
369
376
  return false if @product_code.nil?
370
377
  return false if @location.nil?
371
378
  return false if @start_date_time.nil?
@@ -382,16 +389,6 @@ module BillingApi
382
389
  true
383
390
  end
384
391
 
385
- # Custom attribute writer method checking allowed values (enum).
386
- # @param [Object] product_category Object to be assigned
387
- def product_category=(product_category)
388
- validator = EnumAttributeValidator.new('String', ["bmc-server", "bandwidth", "operating-system", "public-ip", "storage"])
389
- unless validator.valid?(product_category)
390
- fail ArgumentError, "invalid value for \"product_category\", must be one of #{validator.allowable_values}."
391
- end
392
- @product_category = product_category
393
- end
394
-
395
392
  # Checks equality by comparing each attribute.
396
393
  # @param [Object] Object to be compared
397
394
  def ==(o)
@@ -416,6 +413,7 @@ module BillingApi
416
413
  correlation_id == o.correlation_id &&
417
414
  reservation_id == o.reservation_id &&
418
415
  discount_details == o.discount_details &&
416
+ credit_details == o.credit_details &&
419
417
  metadata == o.metadata
420
418
  end
421
419
 
@@ -428,7 +426,7 @@ module BillingApi
428
426
  # Calculates hash code according to all attributes.
429
427
  # @return [Integer] Hash code
430
428
  def hash
431
- [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, metadata].hash
429
+ [id, product_category, product_code, location, year_month, start_date_time, end_date_time, cost, cost_before_discount, cost_description, price_model, unit_price, unit_price_description, quantity, active, usage_session_id, correlation_id, reservation_id, discount_details, credit_details, metadata].hash
432
430
  end
433
431
 
434
432
  # Builds the object from hash
@@ -0,0 +1,39 @@
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 'date'
14
+ require 'time'
15
+
16
+ module BillingApi
17
+ class SystemCreditCauseEnum
18
+ RESERVATION_UPGRADE = "RESERVATION_UPGRADE".freeze
19
+
20
+ def self.all_vars
21
+ @all_vars ||= [RESERVATION_UPGRADE].freeze
22
+ end
23
+
24
+ # Builds the enum from string
25
+ # @param [String] The enum value in the form of the string
26
+ # @return [String] The enum value
27
+ def self.build_from_hash(value)
28
+ new.build_from_hash(value)
29
+ end
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ return value if SystemCreditCauseEnum.all_vars.include?(value)
36
+ raise "Invalid ENUM value #{value} for class #SystemCreditCauseEnum"
37
+ end
38
+ end
39
+ end