pnap_billing_api 2.1.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) 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/LocationAvailabilityDetail.md +1 -1
  6. data/docs/OperatingSystemRecord.md +4 -2
  7. data/docs/PackageDetails.md +20 -0
  8. data/docs/PackageQuantity.md +20 -0
  9. data/docs/PricingPlan.md +3 -1
  10. data/docs/ProductAvailabilityApi.md +4 -4
  11. data/docs/ProductLocationEnum.md +15 -0
  12. data/docs/PublicSubnetRecord.md +4 -2
  13. data/docs/Quantity.md +20 -0
  14. data/docs/QuantityUnitEnum.md +15 -0
  15. data/docs/RatedUsageRecord.md +4 -2
  16. data/docs/Reservation.md +10 -2
  17. data/docs/ReservationDetails.md +20 -0
  18. data/docs/ReservationRequest.md +3 -1
  19. data/docs/ReservationStateEnum.md +15 -0
  20. data/docs/ReservationTerm.md +20 -0
  21. data/docs/ReservationsApi.md +2 -2
  22. data/docs/ServerRecord.md +4 -2
  23. data/docs/StorageDetails.md +5 -5
  24. data/docs/StorageRecord.md +4 -2
  25. data/docs/Utilization.md +20 -0
  26. data/lib/pnap_billing_api/api/billing_configurations_api.rb +2 -2
  27. data/lib/pnap_billing_api/api/product_availability_api.rb +14 -6
  28. data/lib/pnap_billing_api/api/products_api.rb +2 -2
  29. data/lib/pnap_billing_api/api/rated_usage_api.rb +3 -3
  30. data/lib/pnap_billing_api/api/reservations_api.rb +7 -7
  31. data/lib/pnap_billing_api/api_client.rb +17 -14
  32. data/lib/pnap_billing_api/api_error.rb +1 -1
  33. data/lib/pnap_billing_api/api_model_base.rb +88 -0
  34. data/lib/pnap_billing_api/configuration.rb +11 -1
  35. data/lib/pnap_billing_api/models/applicable_discount_details.rb +41 -78
  36. data/lib/pnap_billing_api/models/applicable_discounts.rb +11 -78
  37. data/lib/pnap_billing_api/models/bandwidth_details.rb +31 -78
  38. data/lib/pnap_billing_api/models/bandwidth_record.rb +151 -93
  39. data/lib/pnap_billing_api/models/configuration_details.rb +11 -78
  40. data/lib/pnap_billing_api/models/credit_details.rb +5 -7
  41. data/lib/pnap_billing_api/models/credit_details_base.rb +31 -78
  42. data/lib/pnap_billing_api/models/credit_type_enum.rb +1 -1
  43. data/lib/pnap_billing_api/models/discount_details.rb +41 -78
  44. data/lib/pnap_billing_api/models/discount_type_enum.rb +1 -1
  45. data/lib/pnap_billing_api/models/error.rb +21 -78
  46. data/lib/pnap_billing_api/models/gpu_configuration_metadata.rb +11 -78
  47. data/lib/pnap_billing_api/models/location_availability_detail.rb +52 -79
  48. data/lib/pnap_billing_api/models/location_enum.rb +1 -1
  49. data/lib/pnap_billing_api/models/operating_system_details.rb +31 -78
  50. data/lib/pnap_billing_api/models/operating_system_record.rb +151 -93
  51. data/lib/pnap_billing_api/models/package_details.rb +179 -0
  52. data/lib/pnap_billing_api/models/package_quantity.rb +193 -0
  53. data/lib/pnap_billing_api/models/package_unit_enum.rb +1 -1
  54. data/lib/pnap_billing_api/models/price_unit_enum.rb +3 -2
  55. data/lib/pnap_billing_api/models/pricing_plan.rb +56 -84
  56. data/lib/pnap_billing_api/models/product.rb +31 -78
  57. data/lib/pnap_billing_api/models/product_availability.rb +41 -78
  58. data/lib/pnap_billing_api/models/product_category_enum.rb +1 -1
  59. data/lib/pnap_billing_api/models/product_location_enum.rb +44 -0
  60. data/lib/pnap_billing_api/models/products_get200_response_inner.rb +1 -2
  61. data/lib/pnap_billing_api/models/promo_credit_details.rb +51 -78
  62. data/lib/pnap_billing_api/models/public_subnet_details.rb +31 -78
  63. data/lib/pnap_billing_api/models/public_subnet_record.rb +151 -93
  64. data/lib/pnap_billing_api/models/quantity.rb +223 -0
  65. data/lib/pnap_billing_api/models/quantity_unit_enum.rb +40 -0
  66. data/lib/pnap_billing_api/models/rated_usage_get200_response_inner.rb +1 -2
  67. data/lib/pnap_billing_api/models/rated_usage_product_category_enum.rb +1 -1
  68. data/lib/pnap_billing_api/models/rated_usage_record.rb +141 -93
  69. data/lib/pnap_billing_api/models/reservation.rb +186 -83
  70. data/lib/pnap_billing_api/models/reservation_auto_renew_disable_request.rb +11 -78
  71. data/lib/pnap_billing_api/models/reservation_details.rb +158 -0
  72. data/lib/pnap_billing_api/models/reservation_invoicing_model_enum.rb +1 -1
  73. data/lib/pnap_billing_api/models/reservation_model_enum.rb +3 -2
  74. data/lib/pnap_billing_api/models/reservation_product_category_enum.rb +3 -2
  75. data/lib/pnap_billing_api/models/reservation_request.rb +51 -82
  76. data/lib/pnap_billing_api/models/reservation_state_enum.rb +44 -0
  77. data/lib/pnap_billing_api/models/reservation_term.rb +214 -0
  78. data/lib/pnap_billing_api/models/server_details.rb +31 -78
  79. data/lib/pnap_billing_api/models/server_product.rb +41 -78
  80. data/lib/pnap_billing_api/models/server_product_metadata.rb +81 -78
  81. data/lib/pnap_billing_api/models/server_record.rb +151 -93
  82. data/lib/pnap_billing_api/models/storage_details.rb +21 -113
  83. data/lib/pnap_billing_api/models/storage_record.rb +151 -93
  84. data/lib/pnap_billing_api/models/system_credit_cause_enum.rb +1 -1
  85. data/lib/pnap_billing_api/models/system_credit_details.rb +41 -78
  86. data/lib/pnap_billing_api/models/threshold_configuration_details.rb +21 -78
  87. data/lib/pnap_billing_api/models/utilization.rb +208 -0
  88. data/lib/pnap_billing_api/version.rb +1 -2
  89. data/lib/pnap_billing_api.rb +11 -1
  90. data/pnap_billing_api.gemspec +6 -6
  91. data/spec/api/billing_configurations_api_spec.rb +1 -1
  92. data/spec/api/product_availability_api_spec.rb +3 -3
  93. data/spec/api/products_api_spec.rb +1 -1
  94. data/spec/api/rated_usage_api_spec.rb +1 -1
  95. data/spec/api/reservations_api_spec.rb +1 -1
  96. data/spec/models/applicable_discount_details_spec.rb +2 -2
  97. data/spec/models/applicable_discounts_spec.rb +2 -2
  98. data/spec/models/bandwidth_details_spec.rb +2 -2
  99. data/spec/models/bandwidth_record_spec.rb +8 -2
  100. data/spec/models/configuration_details_spec.rb +2 -2
  101. data/spec/models/credit_details_base_spec.rb +2 -2
  102. data/spec/models/credit_details_spec.rb +1 -1
  103. data/spec/models/credit_type_enum_spec.rb +2 -2
  104. data/spec/models/discount_details_spec.rb +2 -2
  105. data/spec/models/discount_type_enum_spec.rb +2 -2
  106. data/spec/models/error_spec.rb +2 -2
  107. data/spec/models/gpu_configuration_metadata_spec.rb +2 -2
  108. data/spec/models/location_availability_detail_spec.rb +2 -2
  109. data/spec/models/location_enum_spec.rb +2 -2
  110. data/spec/models/operating_system_details_spec.rb +2 -2
  111. data/spec/models/operating_system_record_spec.rb +8 -2
  112. data/spec/models/package_details_spec.rb +42 -0
  113. data/spec/models/package_quantity_spec.rb +42 -0
  114. data/spec/models/package_unit_enum_spec.rb +2 -2
  115. data/spec/models/price_unit_enum_spec.rb +2 -2
  116. data/spec/models/pricing_plan_spec.rb +9 -3
  117. data/spec/models/product_availability_spec.rb +2 -2
  118. data/spec/models/product_category_enum_spec.rb +2 -2
  119. data/spec/models/product_location_enum_spec.rb +30 -0
  120. data/spec/models/product_spec.rb +2 -2
  121. data/spec/models/products_get200_response_inner_spec.rb +1 -1
  122. data/spec/models/promo_credit_details_spec.rb +2 -2
  123. data/spec/models/public_subnet_details_spec.rb +2 -2
  124. data/spec/models/public_subnet_record_spec.rb +8 -2
  125. data/spec/models/quantity_spec.rb +42 -0
  126. data/spec/models/quantity_unit_enum_spec.rb +30 -0
  127. data/spec/models/rated_usage_get200_response_inner_spec.rb +1 -1
  128. data/spec/models/rated_usage_product_category_enum_spec.rb +2 -2
  129. data/spec/models/rated_usage_record_spec.rb +8 -2
  130. data/spec/models/reservation_auto_renew_disable_request_spec.rb +2 -2
  131. data/spec/models/reservation_details_spec.rb +42 -0
  132. data/spec/models/reservation_invoicing_model_enum_spec.rb +2 -2
  133. data/spec/models/reservation_model_enum_spec.rb +2 -2
  134. data/spec/models/reservation_product_category_enum_spec.rb +2 -2
  135. data/spec/models/reservation_request_spec.rb +8 -2
  136. data/spec/models/reservation_spec.rb +26 -2
  137. data/spec/models/reservation_state_enum_spec.rb +30 -0
  138. data/spec/models/reservation_term_spec.rb +42 -0
  139. data/spec/models/server_details_spec.rb +2 -2
  140. data/spec/models/server_product_metadata_spec.rb +2 -2
  141. data/spec/models/server_product_spec.rb +2 -2
  142. data/spec/models/server_record_spec.rb +8 -2
  143. data/spec/models/storage_details_spec.rb +2 -2
  144. data/spec/models/storage_record_spec.rb +8 -2
  145. data/spec/models/system_credit_cause_enum_spec.rb +2 -2
  146. data/spec/models/system_credit_details_spec.rb +2 -2
  147. data/spec/models/threshold_configuration_details_spec.rb +2 -2
  148. data/spec/models/utilization_spec.rb +42 -0
  149. data/spec/spec_helper.rb +1 -1
  150. metadata +82 -41
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module BillingApi
17
17
  # Details of public subnets.
18
- class PublicSubnetDetails
18
+ class PublicSubnetDetails < ApiModelBase
19
19
  # Public Subnet identifier as returned by the BMC API.
20
20
  attr_accessor :id
21
21
 
@@ -34,9 +34,14 @@ module BillingApi
34
34
  }
35
35
  end
36
36
 
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
37
42
  # Returns all the JSON keys this model knows about
38
43
  def self.acceptable_attributes
39
- attribute_map.values
44
+ acceptable_attribute_map.values
40
45
  end
41
46
 
42
47
  # Attribute type mapping.
@@ -62,9 +67,10 @@ module BillingApi
62
67
  end
63
68
 
64
69
  # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
71
  attributes = attributes.each_with_object({}) { |(k, v), h|
66
- if (!self.class.attribute_map.key?(k.to_sym))
67
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PublicSubnetDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PublicSubnetDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
74
  end
69
75
  h[k.to_sym] = v
70
76
  }
@@ -111,6 +117,26 @@ module BillingApi
111
117
  true
112
118
  end
113
119
 
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] cidr Value to be assigned
122
+ def cidr=(cidr)
123
+ if cidr.nil?
124
+ fail ArgumentError, 'cidr cannot be nil'
125
+ end
126
+
127
+ @cidr = cidr
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] size Value to be assigned
132
+ def size=(size)
133
+ if size.nil?
134
+ fail ArgumentError, 'size cannot be nil'
135
+ end
136
+
137
+ @size = size
138
+ end
139
+
114
140
  # Checks equality by comparing each attribute.
115
141
  # @param [Object] Object to be compared
116
142
  def ==(o)
@@ -156,61 +182,6 @@ module BillingApi
156
182
  new(transformed_hash)
157
183
  end
158
184
 
159
- # Deserializes the data based on type
160
- # @param string type Data type
161
- # @param string value Value to be deserialized
162
- # @return [Object] Deserialized data
163
- def self._deserialize(type, value)
164
- case type.to_sym
165
- when :Time
166
- Time.parse(value)
167
- when :Date
168
- Date.parse(value)
169
- when :String
170
- value.to_s
171
- when :Integer
172
- value.to_i
173
- when :Float
174
- value.to_f
175
- when :Boolean
176
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
- true
178
- else
179
- false
180
- end
181
- when :Object
182
- # generic object (usually a Hash), return directly
183
- value
184
- when /\AArray<(?<inner_type>.+)>\z/
185
- inner_type = Regexp.last_match[:inner_type]
186
- value.map { |v| _deserialize(inner_type, v) }
187
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
- k_type = Regexp.last_match[:k_type]
189
- v_type = Regexp.last_match[:v_type]
190
- {}.tap do |hash|
191
- value.each do |k, v|
192
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
- end
194
- end
195
- else # model
196
- # models (e.g. Pet) or oneOf
197
- klass = BillingApi.const_get(type)
198
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
- end
200
- end
201
-
202
- # Returns the string representation of the object
203
- # @return [String] String presentation of the object
204
- def to_s
205
- to_hash.to_s
206
- end
207
-
208
- # to_body is an alias to to_hash (backward compatibility)
209
- # @return [Hash] Returns the object in the form of hash
210
- def to_body
211
- to_hash
212
- end
213
-
214
185
  # Returns the object in the form of hash
215
186
  # @return [Hash] Returns the object in the form of hash
216
187
  def to_hash
@@ -227,24 +198,6 @@ module BillingApi
227
198
  hash
228
199
  end
229
200
 
230
- # Outputs non-array value in the form of hash
231
- # For object, use to_hash. Otherwise, just return the value
232
- # @param [Object] value Any valid value
233
- # @return [Hash] Returns the value in the form of hash
234
- def _to_hash(value)
235
- if value.is_a?(Array)
236
- value.compact.map { |v| _to_hash(v) }
237
- elsif value.is_a?(Hash)
238
- {}.tap do |hash|
239
- value.each { |k, v| hash[k] = _to_hash(v) }
240
- end
241
- elsif value.respond_to? :to_hash
242
- value.to_hash
243
- else
244
- value
245
- end
246
- end
247
-
248
201
  end
249
202
 
250
203
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module BillingApi
17
- class PublicSubnetRecord
17
+ class PublicSubnetRecord < ApiModelBase
18
18
  # The unique identifier of the rated usage record.
19
19
  attr_accessor :id
20
20
 
@@ -67,6 +67,8 @@ module BillingApi
67
67
  # Reservation id associated with this rated usage record.
68
68
  attr_accessor :reservation_id
69
69
 
70
+ attr_accessor :reservation_details
71
+
70
72
  attr_accessor :discount_details
71
73
 
72
74
  attr_accessor :credit_details
@@ -116,15 +118,21 @@ module BillingApi
116
118
  :'usage_session_id' => :'usageSessionId',
117
119
  :'correlation_id' => :'correlationId',
118
120
  :'reservation_id' => :'reservationId',
121
+ :'reservation_details' => :'reservationDetails',
119
122
  :'discount_details' => :'discountDetails',
120
123
  :'credit_details' => :'creditDetails',
121
124
  :'metadata' => :'metadata'
122
125
  }
123
126
  end
124
127
 
128
+ # Returns attribute mapping this model knows about
129
+ def self.acceptable_attribute_map
130
+ attribute_map
131
+ end
132
+
125
133
  # Returns all the JSON keys this model knows about
126
134
  def self.acceptable_attributes
127
- attribute_map.values
135
+ acceptable_attribute_map.values
128
136
  end
129
137
 
130
138
  # Attribute type mapping.
@@ -148,6 +156,7 @@ module BillingApi
148
156
  :'usage_session_id' => :'String',
149
157
  :'correlation_id' => :'String',
150
158
  :'reservation_id' => :'String',
159
+ :'reservation_details' => :'ReservationDetails',
151
160
  :'discount_details' => :'ApplicableDiscountDetails',
152
161
  :'credit_details' => :'Array<CreditDetails>',
153
162
  :'metadata' => :'PublicSubnetDetails'
@@ -175,9 +184,10 @@ module BillingApi
175
184
  end
176
185
 
177
186
  # check to see if the attribute exists and convert string to symbol for hash key
187
+ acceptable_attribute_map = self.class.acceptable_attribute_map
178
188
  attributes = attributes.each_with_object({}) { |(k, v), h|
179
- if (!self.class.attribute_map.key?(k.to_sym))
180
- fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PublicSubnetRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
189
+ if (!acceptable_attribute_map.key?(k.to_sym))
190
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BillingApi::PublicSubnetRecord`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
181
191
  end
182
192
  h[k.to_sym] = v
183
193
  }
@@ -268,20 +278,20 @@ module BillingApi
268
278
 
269
279
  if attributes.key?(:'usage_session_id')
270
280
  self.usage_session_id = attributes[:'usage_session_id']
271
- else
272
- self.usage_session_id = nil
273
281
  end
274
282
 
275
283
  if attributes.key?(:'correlation_id')
276
284
  self.correlation_id = attributes[:'correlation_id']
277
- else
278
- self.correlation_id = nil
279
285
  end
280
286
 
281
287
  if attributes.key?(:'reservation_id')
282
288
  self.reservation_id = attributes[:'reservation_id']
283
289
  end
284
290
 
291
+ if attributes.key?(:'reservation_details')
292
+ self.reservation_details = attributes[:'reservation_details']
293
+ end
294
+
285
295
  if attributes.key?(:'discount_details')
286
296
  self.discount_details = attributes[:'discount_details']
287
297
  end
@@ -352,14 +362,6 @@ module BillingApi
352
362
  invalid_properties.push('invalid value for "active", active cannot be nil.')
353
363
  end
354
364
 
355
- if @usage_session_id.nil?
356
- invalid_properties.push('invalid value for "usage_session_id", usage_session_id cannot be nil.')
357
- end
358
-
359
- if @correlation_id.nil?
360
- invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
361
- end
362
-
363
365
  if @metadata.nil?
364
366
  invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
365
367
  end
@@ -383,12 +385,140 @@ module BillingApi
383
385
  return false if @unit_price_description.nil?
384
386
  return false if @quantity.nil?
385
387
  return false if @active.nil?
386
- return false if @usage_session_id.nil?
387
- return false if @correlation_id.nil?
388
388
  return false if @metadata.nil?
389
389
  true
390
390
  end
391
391
 
392
+ # Custom attribute writer method with validation
393
+ # @param [Object] id Value to be assigned
394
+ def id=(id)
395
+ if id.nil?
396
+ fail ArgumentError, 'id cannot be nil'
397
+ end
398
+
399
+ @id = id
400
+ end
401
+
402
+ # Custom attribute writer method with validation
403
+ # @param [Object] product_category Value to be assigned
404
+ def product_category=(product_category)
405
+ if product_category.nil?
406
+ fail ArgumentError, 'product_category cannot be nil'
407
+ end
408
+
409
+ @product_category = product_category
410
+ end
411
+
412
+ # Custom attribute writer method with validation
413
+ # @param [Object] product_code Value to be assigned
414
+ def product_code=(product_code)
415
+ if product_code.nil?
416
+ fail ArgumentError, 'product_code cannot be nil'
417
+ end
418
+
419
+ @product_code = product_code
420
+ end
421
+
422
+ # Custom attribute writer method with validation
423
+ # @param [Object] location Value to be assigned
424
+ def location=(location)
425
+ if location.nil?
426
+ fail ArgumentError, 'location cannot be nil'
427
+ end
428
+
429
+ @location = location
430
+ end
431
+
432
+ # Custom attribute writer method with validation
433
+ # @param [Object] start_date_time Value to be assigned
434
+ def start_date_time=(start_date_time)
435
+ if start_date_time.nil?
436
+ fail ArgumentError, 'start_date_time cannot be nil'
437
+ end
438
+
439
+ @start_date_time = start_date_time
440
+ end
441
+
442
+ # Custom attribute writer method with validation
443
+ # @param [Object] end_date_time Value to be assigned
444
+ def end_date_time=(end_date_time)
445
+ if end_date_time.nil?
446
+ fail ArgumentError, 'end_date_time cannot be nil'
447
+ end
448
+
449
+ @end_date_time = end_date_time
450
+ end
451
+
452
+ # Custom attribute writer method with validation
453
+ # @param [Object] cost Value to be assigned
454
+ def cost=(cost)
455
+ if cost.nil?
456
+ fail ArgumentError, 'cost cannot be nil'
457
+ end
458
+
459
+ @cost = cost
460
+ end
461
+
462
+ # Custom attribute writer method with validation
463
+ # @param [Object] price_model Value to be assigned
464
+ def price_model=(price_model)
465
+ if price_model.nil?
466
+ fail ArgumentError, 'price_model cannot be nil'
467
+ end
468
+
469
+ @price_model = price_model
470
+ end
471
+
472
+ # Custom attribute writer method with validation
473
+ # @param [Object] unit_price Value to be assigned
474
+ def unit_price=(unit_price)
475
+ if unit_price.nil?
476
+ fail ArgumentError, 'unit_price cannot be nil'
477
+ end
478
+
479
+ @unit_price = unit_price
480
+ end
481
+
482
+ # Custom attribute writer method with validation
483
+ # @param [Object] unit_price_description Value to be assigned
484
+ def unit_price_description=(unit_price_description)
485
+ if unit_price_description.nil?
486
+ fail ArgumentError, 'unit_price_description cannot be nil'
487
+ end
488
+
489
+ @unit_price_description = unit_price_description
490
+ end
491
+
492
+ # Custom attribute writer method with validation
493
+ # @param [Object] quantity Value to be assigned
494
+ def quantity=(quantity)
495
+ if quantity.nil?
496
+ fail ArgumentError, 'quantity cannot be nil'
497
+ end
498
+
499
+ @quantity = quantity
500
+ end
501
+
502
+ # Custom attribute writer method with validation
503
+ # @param [Object] active Value to be assigned
504
+ def active=(active)
505
+ if active.nil?
506
+ fail ArgumentError, 'active cannot be nil'
507
+ end
508
+
509
+ @active = active
510
+ end
511
+
512
+ # Custom attribute writer method with validation
513
+ # @param [Object] metadata Value to be assigned
514
+ def metadata=(metadata)
515
+ if metadata.nil?
516
+ fail ArgumentError, 'metadata cannot be nil'
517
+ end
518
+
519
+ @metadata = metadata
520
+ end
521
+
392
522
  # Checks equality by comparing each attribute.
393
523
  # @param [Object] Object to be compared
394
524
  def ==(o)
@@ -412,6 +542,7 @@ module BillingApi
412
542
  usage_session_id == o.usage_session_id &&
413
543
  correlation_id == o.correlation_id &&
414
544
  reservation_id == o.reservation_id &&
545
+ reservation_details == o.reservation_details &&
415
546
  discount_details == o.discount_details &&
416
547
  credit_details == o.credit_details &&
417
548
  metadata == o.metadata
@@ -426,7 +557,7 @@ module BillingApi
426
557
  # Calculates hash code according to all attributes.
427
558
  # @return [Integer] Hash code
428
559
  def 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
560
+ [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, reservation_details, discount_details, credit_details, metadata].hash
430
561
  end
431
562
 
432
563
  # Builds the object from hash
@@ -452,61 +583,6 @@ module BillingApi
452
583
  new(transformed_hash)
453
584
  end
454
585
 
455
- # Deserializes the data based on type
456
- # @param string type Data type
457
- # @param string value Value to be deserialized
458
- # @return [Object] Deserialized data
459
- def self._deserialize(type, value)
460
- case type.to_sym
461
- when :Time
462
- Time.parse(value)
463
- when :Date
464
- Date.parse(value)
465
- when :String
466
- value.to_s
467
- when :Integer
468
- value.to_i
469
- when :Float
470
- value.to_f
471
- when :Boolean
472
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
473
- true
474
- else
475
- false
476
- end
477
- when :Object
478
- # generic object (usually a Hash), return directly
479
- value
480
- when /\AArray<(?<inner_type>.+)>\z/
481
- inner_type = Regexp.last_match[:inner_type]
482
- value.map { |v| _deserialize(inner_type, v) }
483
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
484
- k_type = Regexp.last_match[:k_type]
485
- v_type = Regexp.last_match[:v_type]
486
- {}.tap do |hash|
487
- value.each do |k, v|
488
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
489
- end
490
- end
491
- else # model
492
- # models (e.g. Pet) or oneOf
493
- klass = BillingApi.const_get(type)
494
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
495
- end
496
- end
497
-
498
- # Returns the string representation of the object
499
- # @return [String] String presentation of the object
500
- def to_s
501
- to_hash.to_s
502
- end
503
-
504
- # to_body is an alias to to_hash (backward compatibility)
505
- # @return [Hash] Returns the object in the form of hash
506
- def to_body
507
- to_hash
508
- end
509
-
510
586
  # Returns the object in the form of hash
511
587
  # @return [Hash] Returns the object in the form of hash
512
588
  def to_hash
@@ -523,24 +599,6 @@ module BillingApi
523
599
  hash
524
600
  end
525
601
 
526
- # Outputs non-array value in the form of hash
527
- # For object, use to_hash. Otherwise, just return the value
528
- # @param [Object] value Any valid value
529
- # @return [Hash] Returns the value in the form of hash
530
- def _to_hash(value)
531
- if value.is_a?(Array)
532
- value.compact.map { |v| _to_hash(v) }
533
- elsif value.is_a?(Hash)
534
- {}.tap do |hash|
535
- value.each { |k, v| hash[k] = _to_hash(v) }
536
- end
537
- elsif value.respond_to? :to_hash
538
- value.to_hash
539
- else
540
- value
541
- end
542
- end
543
-
544
602
  end
545
603
 
546
604
  end