license_manager 0.2.0 → 0.3.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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -0
  3. data/README.md +1 -1
  4. data/docs/BillingPortalSession.md +18 -0
  5. data/docs/CreateBillingPortalSession.md +18 -0
  6. data/docs/CreateIntegrationMapping.md +1 -1
  7. data/docs/Integration.md +6 -0
  8. data/docs/IntegrationMapping.md +2 -0
  9. data/docs/IntegrationMappingRecurring.md +20 -0
  10. data/docs/License.md +2 -0
  11. data/docs/LicenseSubscription.md +34 -0
  12. data/docs/LicensesApi.md +1 -1
  13. data/docs/Mrr.md +26 -0
  14. data/docs/MrrByIntervalInner.md +24 -0
  15. data/docs/MrrByPolicyInner.md +22 -0
  16. data/docs/PortalApi.md +79 -0
  17. data/docs/ProductStats.md +2 -0
  18. data/docs/Revenue.md +8 -4
  19. data/docs/StripePermission.md +3 -1
  20. data/docs/StripePrice.md +2 -0
  21. data/docs/StripePriceRecurring.md +20 -0
  22. data/docs/SubscriptionStats.md +38 -0
  23. data/docs/UpdateIntegration.md +3 -1
  24. data/lib/license_manager/api/licenses_api.rb +2 -2
  25. data/lib/license_manager/api/portal_api.rb +70 -0
  26. data/lib/license_manager/models/billing_portal_session.rb +178 -0
  27. data/lib/license_manager/models/create_billing_portal_session.rb +161 -0
  28. data/lib/license_manager/models/create_integration_mapping.rb +1 -1
  29. data/lib/license_manager/models/event_type.rb +4 -1
  30. data/lib/license_manager/models/integration.rb +82 -1
  31. data/lib/license_manager/models/integration_mapping.rb +13 -1
  32. data/lib/license_manager/models/integration_mapping_recurring.rb +228 -0
  33. data/lib/license_manager/models/license.rb +13 -1
  34. data/lib/license_manager/models/license_subscription.rb +388 -0
  35. data/lib/license_manager/models/mrr.rb +291 -0
  36. data/lib/license_manager/models/mrr_by_interval_inner.rb +279 -0
  37. data/lib/license_manager/models/mrr_by_policy_inner.rb +229 -0
  38. data/lib/license_manager/models/product_stats.rb +14 -1
  39. data/lib/license_manager/models/revenue.rb +60 -6
  40. data/lib/license_manager/models/stripe_permission.rb +31 -4
  41. data/lib/license_manager/models/stripe_price.rb +13 -1
  42. data/lib/license_manager/models/stripe_price_recurring.rb +228 -0
  43. data/lib/license_manager/models/subscription_stats.rb +456 -0
  44. data/lib/license_manager/models/update_integration.rb +42 -4
  45. data/lib/license_manager/version.rb +1 -1
  46. data/lib/license_manager.rb +9 -0
  47. data/openapi.json +563 -10
  48. data/spec/api/licenses_api_spec.rb +1 -1
  49. data/spec/api/portal_api_spec.rb +13 -0
  50. data/spec/models/billing_portal_session_spec.rb +36 -0
  51. data/spec/models/create_billing_portal_session_spec.rb +36 -0
  52. data/spec/models/create_token_spec.rb +1 -1
  53. data/spec/models/integration_mapping_recurring_spec.rb +46 -0
  54. data/spec/models/integration_mapping_spec.rb +6 -0
  55. data/spec/models/integration_spec.rb +18 -0
  56. data/spec/models/license_spec.rb +6 -0
  57. data/spec/models/license_subscription_spec.rb +88 -0
  58. data/spec/models/mrr_by_interval_inner_spec.rb +58 -0
  59. data/spec/models/mrr_by_policy_inner_spec.rb +48 -0
  60. data/spec/models/mrr_spec.rb +60 -0
  61. data/spec/models/product_stats_spec.rb +6 -0
  62. data/spec/models/revenue_spec.rb +12 -0
  63. data/spec/models/stripe_permission_spec.rb +6 -0
  64. data/spec/models/stripe_price_recurring_spec.rb +46 -0
  65. data/spec/models/stripe_price_spec.rb +6 -0
  66. data/spec/models/subscription_stats_spec.rb +96 -0
  67. data/spec/models/token_spec.rb +1 -1
  68. data/spec/models/update_integration_spec.rb +6 -0
  69. metadata +37 -1
@@ -0,0 +1,291 @@
1
+ =begin
2
+ #LicenseManager API
3
+
4
+ #Public API. Authenticate with an organization API key, or with a token scoped to a customer, license or machine on the endpoints that accept one. ## Conventions - **Errors** answer `{ \"error\": { \"code\", \"message\" } }`. Branch on `code`, which is stable, not on `message`. Each response lists the codes it can return, except `404`, which answers `not_found` unless it says otherwise. Unexpected errors answer `500` with `internal_error`. - **Validation** errors answer `422`, not `400`, with the `validation_error` code and an `issues` array giving the `path` and `message` of each invalid value. - **Unknown body fields are ignored**, not rejected: sending a field an endpoint doesn't accept, like `policyId` to `updateLicense`, changes nothing and doesn't fail. - **Strings** are trimmed before they're validated and stored. Emails are stored lower cased. - **Updates** only change the fields that are sent. A field sent as `null` is cleared, when it can be. - **Dates** can be sent with any offset, and are always returned in UTC, like `2026-01-15T09:30:00.000Z`. Calendar months and days are counted in UTC. - **Ids** are 8 letters and digits, after `test_` for test products and their resources. - **Lists** are paginated with `page` and `pageSize`. Items with the same value for the `sort` field are ordered by id, so pages are stable, but items created or deleted between two requests shift the pages. Items without a value for the `sort` field come last in ascending order, and first in descending order, unless the endpoint says otherwise. - **Test products** are sandboxes of a live product. Test API keys only reach test products, live API keys only live ones: the others answer `404`, as if they didn't exist. Sessions and tokens reach both.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module LicenseManager
17
+ class Mrr < ApiModelBase
18
+ attr_accessor :currency
19
+
20
+ # Monthly recurring revenue: the price of every ongoing subscription in the currency, times its quantity, brought to one month (a year counts for a twelfth), before taxes and discounts.
21
+ attr_accessor :mrr
22
+
23
+ # Ongoing subscriptions and MRR of each billing period, like monthly and yearly, from the highest MRR.
24
+ attr_accessor :by_interval
25
+
26
+ # MRR of each policy, from the highest.
27
+ attr_accessor :by_policy
28
+
29
+ # MRR at the end of each month, aligned on `months`, today for this month, at the current prices of the subscriptions.
30
+ attr_accessor :by_month
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'currency' => :'currency',
36
+ :'mrr' => :'mrr',
37
+ :'by_interval' => :'byInterval',
38
+ :'by_policy' => :'byPolicy',
39
+ :'by_month' => :'byMonth'
40
+ }
41
+ end
42
+
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ acceptable_attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'currency' => :'String',
57
+ :'mrr' => :'Float',
58
+ :'by_interval' => :'Array<MrrByIntervalInner>',
59
+ :'by_policy' => :'Array<MrrByPolicyInner>',
60
+ :'by_month' => :'Array<Float>'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Returns attribute type mapping
71
+ def self.acceptable_openapi_types
72
+ openapi_types
73
+ end
74
+
75
+ # Returns the nullable attributes
76
+ def self.acceptable_openapi_nullable
77
+ openapi_nullable
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LicenseManager::Mrr` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!acceptable_attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LicenseManager::Mrr`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'currency')
97
+ self.currency = attributes[:'currency']
98
+ else
99
+ self.currency = nil
100
+ end
101
+
102
+ if attributes.key?(:'mrr')
103
+ self.mrr = attributes[:'mrr']
104
+ else
105
+ self.mrr = nil
106
+ end
107
+
108
+ if attributes.key?(:'by_interval')
109
+ if (value = attributes[:'by_interval']).is_a?(Array)
110
+ self.by_interval = value
111
+ end
112
+ else
113
+ self.by_interval = nil
114
+ end
115
+
116
+ if attributes.key?(:'by_policy')
117
+ if (value = attributes[:'by_policy']).is_a?(Array)
118
+ self.by_policy = value
119
+ end
120
+ else
121
+ self.by_policy = nil
122
+ end
123
+
124
+ if attributes.key?(:'by_month')
125
+ if (value = attributes[:'by_month']).is_a?(Array)
126
+ self.by_month = value
127
+ end
128
+ else
129
+ self.by_month = nil
130
+ end
131
+ end
132
+
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properties with the reasons
135
+ def list_invalid_properties
136
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
137
+ invalid_properties = Array.new
138
+ if @currency.nil?
139
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
140
+ end
141
+
142
+ if @mrr.nil?
143
+ invalid_properties.push('invalid value for "mrr", mrr cannot be nil.')
144
+ end
145
+
146
+ if @by_interval.nil?
147
+ invalid_properties.push('invalid value for "by_interval", by_interval cannot be nil.')
148
+ end
149
+
150
+ if @by_policy.nil?
151
+ invalid_properties.push('invalid value for "by_policy", by_policy cannot be nil.')
152
+ end
153
+
154
+ if @by_month.nil?
155
+ invalid_properties.push('invalid value for "by_month", by_month cannot be nil.')
156
+ end
157
+
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ warn '[DEPRECATED] the `valid?` method is obsolete'
165
+ return false if @currency.nil?
166
+ return false if @mrr.nil?
167
+ return false if @by_interval.nil?
168
+ return false if @by_policy.nil?
169
+ return false if @by_month.nil?
170
+ true
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] currency Value to be assigned
175
+ def currency=(currency)
176
+ if currency.nil?
177
+ fail ArgumentError, 'currency cannot be nil'
178
+ end
179
+
180
+ @currency = currency
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] mrr Value to be assigned
185
+ def mrr=(mrr)
186
+ if mrr.nil?
187
+ fail ArgumentError, 'mrr cannot be nil'
188
+ end
189
+
190
+ @mrr = mrr
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] by_interval Value to be assigned
195
+ def by_interval=(by_interval)
196
+ if by_interval.nil?
197
+ fail ArgumentError, 'by_interval cannot be nil'
198
+ end
199
+
200
+ @by_interval = by_interval
201
+ end
202
+
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] by_policy Value to be assigned
205
+ def by_policy=(by_policy)
206
+ if by_policy.nil?
207
+ fail ArgumentError, 'by_policy cannot be nil'
208
+ end
209
+
210
+ @by_policy = by_policy
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] by_month Value to be assigned
215
+ def by_month=(by_month)
216
+ if by_month.nil?
217
+ fail ArgumentError, 'by_month cannot be nil'
218
+ end
219
+
220
+ @by_month = by_month
221
+ end
222
+
223
+ # Checks equality by comparing each attribute.
224
+ # @param [Object] Object to be compared
225
+ def ==(o)
226
+ return true if self.equal?(o)
227
+ self.class == o.class &&
228
+ currency == o.currency &&
229
+ mrr == o.mrr &&
230
+ by_interval == o.by_interval &&
231
+ by_policy == o.by_policy &&
232
+ by_month == o.by_month
233
+ end
234
+
235
+ # @see the `==` method
236
+ # @param [Object] Object to be compared
237
+ def eql?(o)
238
+ self == o
239
+ end
240
+
241
+ # Calculates hash code according to all attributes.
242
+ # @return [Integer] Hash code
243
+ def hash
244
+ [currency, mrr, by_interval, by_policy, by_month].hash
245
+ end
246
+
247
+ # Builds the object from hash
248
+ # @param [Hash] attributes Model attributes in the form of hash
249
+ # @return [Object] Returns the model itself
250
+ def self.build_from_hash(attributes)
251
+ return nil unless attributes.is_a?(Hash)
252
+ attributes = attributes.transform_keys(&:to_sym)
253
+ # include attributes inherited from allOf parents (the nearest declaration wins)
254
+ map = acceptable_attribute_map
255
+ transformed_hash = {}
256
+ acceptable_openapi_types.each_pair do |key, type|
257
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
258
+ transformed_hash["#{key}"] = nil
259
+ elsif type =~ /\AArray<(.*)>/i
260
+ # check to ensure the input is an array given that the attribute
261
+ # is documented as an array but the input is not
262
+ if attributes[map[key]].is_a?(Array)
263
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
264
+ end
265
+ elsif !attributes[map[key]].nil?
266
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
267
+ end
268
+ end
269
+ new(transformed_hash)
270
+ end
271
+
272
+ # Returns the object in the form of hash
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_hash
275
+ hash = {}
276
+ # include attributes inherited from allOf parents (the nearest declaration wins)
277
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ end
290
+
291
+ end
@@ -0,0 +1,279 @@
1
+ =begin
2
+ #LicenseManager API
3
+
4
+ #Public API. Authenticate with an organization API key, or with a token scoped to a customer, license or machine on the endpoints that accept one. ## Conventions - **Errors** answer `{ \"error\": { \"code\", \"message\" } }`. Branch on `code`, which is stable, not on `message`. Each response lists the codes it can return, except `404`, which answers `not_found` unless it says otherwise. Unexpected errors answer `500` with `internal_error`. - **Validation** errors answer `422`, not `400`, with the `validation_error` code and an `issues` array giving the `path` and `message` of each invalid value. - **Unknown body fields are ignored**, not rejected: sending a field an endpoint doesn't accept, like `policyId` to `updateLicense`, changes nothing and doesn't fail. - **Strings** are trimmed before they're validated and stored. Emails are stored lower cased. - **Updates** only change the fields that are sent. A field sent as `null` is cleared, when it can be. - **Dates** can be sent with any offset, and are always returned in UTC, like `2026-01-15T09:30:00.000Z`. Calendar months and days are counted in UTC. - **Ids** are 8 letters and digits, after `test_` for test products and their resources. - **Lists** are paginated with `page` and `pageSize`. Items with the same value for the `sort` field are ordered by id, so pages are stable, but items created or deleted between two requests shift the pages. Items without a value for the `sort` field come last in ascending order, and first in descending order, unless the endpoint says otherwise. - **Test products** are sandboxes of a live product. Test API keys only reach test products, live API keys only live ones: the others answer `404`, as if they didn't exist. Sessions and tokens reach both.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module LicenseManager
17
+ class MrrByIntervalInner < ApiModelBase
18
+ attr_accessor :interval
19
+
20
+ attr_accessor :interval_count
21
+
22
+ attr_accessor :subscription_count
23
+
24
+ attr_accessor :mrr
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'interval' => :'interval',
52
+ :'interval_count' => :'intervalCount',
53
+ :'subscription_count' => :'subscriptionCount',
54
+ :'mrr' => :'mrr'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'interval' => :'String',
72
+ :'interval_count' => :'Integer',
73
+ :'subscription_count' => :'Integer',
74
+ :'mrr' => :'Float'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
84
+ # Returns attribute type mapping
85
+ def self.acceptable_openapi_types
86
+ openapi_types
87
+ end
88
+
89
+ # Returns the nullable attributes
90
+ def self.acceptable_openapi_nullable
91
+ openapi_nullable
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LicenseManager::MrrByIntervalInner` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ acceptable_attribute_map = self.class.acceptable_attribute_map
103
+ attributes = attributes.each_with_object({}) { |(k, v), h|
104
+ if (!acceptable_attribute_map.key?(k.to_sym))
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LicenseManager::MrrByIntervalInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
106
+ end
107
+ h[k.to_sym] = v
108
+ }
109
+
110
+ if attributes.key?(:'interval')
111
+ self.interval = attributes[:'interval']
112
+ else
113
+ self.interval = nil
114
+ end
115
+
116
+ if attributes.key?(:'interval_count')
117
+ self.interval_count = attributes[:'interval_count']
118
+ else
119
+ self.interval_count = nil
120
+ end
121
+
122
+ if attributes.key?(:'subscription_count')
123
+ self.subscription_count = attributes[:'subscription_count']
124
+ else
125
+ self.subscription_count = nil
126
+ end
127
+
128
+ if attributes.key?(:'mrr')
129
+ self.mrr = attributes[:'mrr']
130
+ else
131
+ self.mrr = nil
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
+ invalid_properties = Array.new
140
+ if @interval.nil?
141
+ invalid_properties.push('invalid value for "interval", interval cannot be nil.')
142
+ end
143
+
144
+ if @interval_count.nil?
145
+ invalid_properties.push('invalid value for "interval_count", interval_count cannot be nil.')
146
+ end
147
+
148
+ if @subscription_count.nil?
149
+ invalid_properties.push('invalid value for "subscription_count", subscription_count cannot be nil.')
150
+ end
151
+
152
+ if @mrr.nil?
153
+ invalid_properties.push('invalid value for "mrr", mrr cannot be nil.')
154
+ end
155
+
156
+ invalid_properties
157
+ end
158
+
159
+ # Check to see if the all the properties in the model are valid
160
+ # @return true if the model is valid
161
+ def valid?
162
+ warn '[DEPRECATED] the `valid?` method is obsolete'
163
+ return false if @interval.nil?
164
+ interval_validator = EnumAttributeValidator.new('String', ["day", "week", "month", "year", "unknown_default_open_api"])
165
+ return false unless interval_validator.valid?(@interval)
166
+ return false if @interval_count.nil?
167
+ return false if @subscription_count.nil?
168
+ return false if @mrr.nil?
169
+ true
170
+ end
171
+
172
+ # Custom attribute writer method checking allowed values (enum).
173
+ # @param [Object] interval Object to be assigned
174
+ def interval=(interval)
175
+ validator = EnumAttributeValidator.new('String', ["day", "week", "month", "year", "unknown_default_open_api"])
176
+ unless validator.valid?(interval)
177
+ fail ArgumentError, "invalid value for \"interval\", must be one of #{validator.allowable_values}."
178
+ end
179
+ @interval = interval
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] interval_count Value to be assigned
184
+ def interval_count=(interval_count)
185
+ if interval_count.nil?
186
+ fail ArgumentError, 'interval_count cannot be nil'
187
+ end
188
+
189
+ @interval_count = interval_count
190
+ end
191
+
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] subscription_count Value to be assigned
194
+ def subscription_count=(subscription_count)
195
+ if subscription_count.nil?
196
+ fail ArgumentError, 'subscription_count cannot be nil'
197
+ end
198
+
199
+ @subscription_count = subscription_count
200
+ end
201
+
202
+ # Custom attribute writer method with validation
203
+ # @param [Object] mrr Value to be assigned
204
+ def mrr=(mrr)
205
+ if mrr.nil?
206
+ fail ArgumentError, 'mrr cannot be nil'
207
+ end
208
+
209
+ @mrr = mrr
210
+ end
211
+
212
+ # Checks equality by comparing each attribute.
213
+ # @param [Object] Object to be compared
214
+ def ==(o)
215
+ return true if self.equal?(o)
216
+ self.class == o.class &&
217
+ interval == o.interval &&
218
+ interval_count == o.interval_count &&
219
+ subscription_count == o.subscription_count &&
220
+ mrr == o.mrr
221
+ end
222
+
223
+ # @see the `==` method
224
+ # @param [Object] Object to be compared
225
+ def eql?(o)
226
+ self == o
227
+ end
228
+
229
+ # Calculates hash code according to all attributes.
230
+ # @return [Integer] Hash code
231
+ def hash
232
+ [interval, interval_count, subscription_count, mrr].hash
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def self.build_from_hash(attributes)
239
+ return nil unless attributes.is_a?(Hash)
240
+ attributes = attributes.transform_keys(&:to_sym)
241
+ # include attributes inherited from allOf parents (the nearest declaration wins)
242
+ map = acceptable_attribute_map
243
+ transformed_hash = {}
244
+ acceptable_openapi_types.each_pair do |key, type|
245
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
246
+ transformed_hash["#{key}"] = nil
247
+ elsif type =~ /\AArray<(.*)>/i
248
+ # check to ensure the input is an array given that the attribute
249
+ # is documented as an array but the input is not
250
+ if attributes[map[key]].is_a?(Array)
251
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
252
+ end
253
+ elsif !attributes[map[key]].nil?
254
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
255
+ end
256
+ end
257
+ new(transformed_hash)
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ # include attributes inherited from allOf parents (the nearest declaration wins)
265
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ end
278
+
279
+ end