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,229 @@
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 MrrByPolicyInner < ApiModelBase
18
+ attr_accessor :policy_id
19
+
20
+ attr_accessor :subscription_count
21
+
22
+ attr_accessor :mrr
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'policy_id' => :'policyId',
28
+ :'subscription_count' => :'subscriptionCount',
29
+ :'mrr' => :'mrr'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'policy_id' => :'String',
47
+ :'subscription_count' => :'Integer',
48
+ :'mrr' => :'Float'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Returns attribute type mapping
59
+ def self.acceptable_openapi_types
60
+ openapi_types
61
+ end
62
+
63
+ # Returns the nullable attributes
64
+ def self.acceptable_openapi_nullable
65
+ openapi_nullable
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LicenseManager::MrrByPolicyInner` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LicenseManager::MrrByPolicyInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'policy_id')
85
+ self.policy_id = attributes[:'policy_id']
86
+ else
87
+ self.policy_id = nil
88
+ end
89
+
90
+ if attributes.key?(:'subscription_count')
91
+ self.subscription_count = attributes[:'subscription_count']
92
+ else
93
+ self.subscription_count = nil
94
+ end
95
+
96
+ if attributes.key?(:'mrr')
97
+ self.mrr = attributes[:'mrr']
98
+ else
99
+ self.mrr = nil
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
+ invalid_properties = Array.new
108
+ if @policy_id.nil?
109
+ invalid_properties.push('invalid value for "policy_id", policy_id cannot be nil.')
110
+ end
111
+
112
+ if @subscription_count.nil?
113
+ invalid_properties.push('invalid value for "subscription_count", subscription_count cannot be nil.')
114
+ end
115
+
116
+ if @mrr.nil?
117
+ invalid_properties.push('invalid value for "mrr", mrr cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @policy_id.nil?
128
+ return false if @subscription_count.nil?
129
+ return false if @mrr.nil?
130
+ true
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] policy_id Value to be assigned
135
+ def policy_id=(policy_id)
136
+ if policy_id.nil?
137
+ fail ArgumentError, 'policy_id cannot be nil'
138
+ end
139
+
140
+ @policy_id = policy_id
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] subscription_count Value to be assigned
145
+ def subscription_count=(subscription_count)
146
+ if subscription_count.nil?
147
+ fail ArgumentError, 'subscription_count cannot be nil'
148
+ end
149
+
150
+ @subscription_count = subscription_count
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] mrr Value to be assigned
155
+ def mrr=(mrr)
156
+ if mrr.nil?
157
+ fail ArgumentError, 'mrr cannot be nil'
158
+ end
159
+
160
+ @mrr = mrr
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ policy_id == o.policy_id &&
169
+ subscription_count == o.subscription_count &&
170
+ mrr == o.mrr
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [policy_id, subscription_count, mrr].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ attributes = attributes.transform_keys(&:to_sym)
191
+ # include attributes inherited from allOf parents (the nearest declaration wins)
192
+ map = acceptable_attribute_map
193
+ transformed_hash = {}
194
+ acceptable_openapi_types.each_pair do |key, type|
195
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
196
+ transformed_hash["#{key}"] = nil
197
+ elsif type =~ /\AArray<(.*)>/i
198
+ # check to ensure the input is an array given that the attribute
199
+ # is documented as an array but the input is not
200
+ if attributes[map[key]].is_a?(Array)
201
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
202
+ end
203
+ elsif !attributes[map[key]].nil?
204
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
205
+ end
206
+ end
207
+ new(transformed_hash)
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ # include attributes inherited from allOf parents (the nearest declaration wins)
215
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
216
+ value = self.send(attr)
217
+ if value.nil?
218
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
219
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
+ end
221
+
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ end
228
+
229
+ end
@@ -63,6 +63,9 @@ module LicenseManager
63
63
  # Cancellations of the licenses with a money back guarantee. `null` when no license of the product has one.
64
64
  attr_accessor :cancellation
65
65
 
66
+ # Subscriptions of the product. `null` when it has never had one.
67
+ attr_accessor :subscriptions
68
+
66
69
  # Revenue in each currency licenses were sold in, from the one with the most licenses sold. Amounts aren't converted between currencies.
67
70
  attr_accessor :revenue
68
71
 
@@ -94,6 +97,7 @@ module LicenseManager
94
97
  :'new_licenses_by_month' => :'newLicensesByMonth',
95
98
  :'new_licenses_by_policy' => :'newLicensesByPolicy',
96
99
  :'cancellation' => :'cancellation',
100
+ :'subscriptions' => :'subscriptions',
97
101
  :'revenue' => :'revenue',
98
102
  :'activations_by_version' => :'activationsByVersion',
99
103
  :'active_machines_by_version' => :'activeMachinesByVersion',
@@ -130,6 +134,7 @@ module LicenseManager
130
134
  :'new_licenses_by_month' => :'Array<Integer>',
131
135
  :'new_licenses_by_policy' => :'Array<ProductStatsNewLicensesByPolicyInner>',
132
136
  :'cancellation' => :'CancellationStats',
137
+ :'subscriptions' => :'SubscriptionStats',
133
138
  :'revenue' => :'Array<Revenue>',
134
139
  :'activations_by_version' => :'Array<ProductStatsActivationsByVersionInner>',
135
140
  :'active_machines_by_version' => :'Array<ProductStatsActiveMachinesByVersionInner>',
@@ -141,6 +146,7 @@ module LicenseManager
141
146
  def self.openapi_nullable
142
147
  Set.new([
143
148
  :'cancellation',
149
+ :'subscriptions',
144
150
  ])
145
151
  end
146
152
 
@@ -276,6 +282,12 @@ module LicenseManager
276
282
  self.cancellation = nil
277
283
  end
278
284
 
285
+ if attributes.key?(:'subscriptions')
286
+ self.subscriptions = attributes[:'subscriptions']
287
+ else
288
+ self.subscriptions = nil
289
+ end
290
+
279
291
  if attributes.key?(:'revenue')
280
292
  if (value = attributes[:'revenue']).is_a?(Array)
281
293
  self.revenue = value
@@ -630,6 +642,7 @@ module LicenseManager
630
642
  new_licenses_by_month == o.new_licenses_by_month &&
631
643
  new_licenses_by_policy == o.new_licenses_by_policy &&
632
644
  cancellation == o.cancellation &&
645
+ subscriptions == o.subscriptions &&
633
646
  revenue == o.revenue &&
634
647
  activations_by_version == o.activations_by_version &&
635
648
  active_machines_by_version == o.active_machines_by_version &&
@@ -645,7 +658,7 @@ module LicenseManager
645
658
  # Calculates hash code according to all attributes.
646
659
  # @return [Integer] Hash code
647
660
  def hash
648
- [license_count, active_license_count, new_license_count, expiring_license_count, expired_license_count, active_machine_count, in_use_license_count, seat_count, used_seat_count, full_license_count, days, months, new_licenses_by_day, new_licenses_by_month, new_licenses_by_policy, cancellation, revenue, activations_by_version, active_machines_by_version, active_machines_by_platform].hash
661
+ [license_count, active_license_count, new_license_count, expiring_license_count, expired_license_count, active_machine_count, in_use_license_count, seat_count, used_seat_count, full_license_count, days, months, new_licenses_by_day, new_licenses_by_month, new_licenses_by_policy, cancellation, subscriptions, revenue, activations_by_version, active_machines_by_version, active_machines_by_platform].hash
649
662
  end
650
663
 
651
664
  # Builds the object from hash
@@ -14,21 +14,27 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module LicenseManager
17
- # Revenue of the licenses sold in one currency, each license counting on the day it was created. Licenses without a price are left out, and so are canceled ones, but in `canceledLicenseCount` and `canceledTotal`.
17
+ # Revenue in one currency: the licenses sold once, each counting on the day it was created, and the payments of the subscription licenses, each counting on the day it was paid, with the license's policy. Licenses without a price are left out, and so are canceled ones, but in `canceledLicenseCount` and `canceledTotal`.
18
18
  class Revenue < ApiModelBase
19
19
  # ISO 4217 code of the currency of the revenue.
20
20
  attr_accessor :currency
21
21
 
22
- # Number of licenses sold in the currency, free ones included, canceled ones left out.
22
+ # Number of licenses sold once in the currency, free ones included, canceled ones and subscription licenses left out.
23
23
  attr_accessor :license_count
24
24
 
25
- # Sum of the prices of the licenses sold in the currency, in major units, canceled ones left out.
25
+ # Revenue in the currency, in major units: the prices of the licenses sold once, canceled ones left out, plus the payments of the subscriptions, `subscriptionTotal`.
26
26
  attr_accessor :total
27
27
 
28
- # Number of canceled licenses sold in the currency.
28
+ # Sum of the payments of the subscription licenses in the currency, before taxes, in major units.
29
+ attr_accessor :subscription_total
30
+
31
+ # Number of payments of the subscription licenses in the currency.
32
+ attr_accessor :payment_count
33
+
34
+ # Number of canceled licenses sold once in the currency.
29
35
  attr_accessor :canceled_license_count
30
36
 
31
- # Sum of the prices of the canceled licenses sold in the currency, in major units: revenue lost to cancellations.
37
+ # Sum of the prices of the canceled licenses sold once in the currency, in major units: revenue lost to cancellations.
32
38
  attr_accessor :canceled_total
33
39
 
34
40
  # Revenue of the current month, in UTC.
@@ -55,6 +61,8 @@ module LicenseManager
55
61
  :'currency' => :'currency',
56
62
  :'license_count' => :'licenseCount',
57
63
  :'total' => :'total',
64
+ :'subscription_total' => :'subscriptionTotal',
65
+ :'payment_count' => :'paymentCount',
58
66
  :'canceled_license_count' => :'canceledLicenseCount',
59
67
  :'canceled_total' => :'canceledTotal',
60
68
  :'this_month' => :'thisMonth',
@@ -82,6 +90,8 @@ module LicenseManager
82
90
  :'currency' => :'String',
83
91
  :'license_count' => :'Integer',
84
92
  :'total' => :'Float',
93
+ :'subscription_total' => :'Float',
94
+ :'payment_count' => :'Integer',
85
95
  :'canceled_license_count' => :'Integer',
86
96
  :'canceled_total' => :'Float',
87
97
  :'this_month' => :'Float',
@@ -143,6 +153,18 @@ module LicenseManager
143
153
  self.total = nil
144
154
  end
145
155
 
156
+ if attributes.key?(:'subscription_total')
157
+ self.subscription_total = attributes[:'subscription_total']
158
+ else
159
+ self.subscription_total = nil
160
+ end
161
+
162
+ if attributes.key?(:'payment_count')
163
+ self.payment_count = attributes[:'payment_count']
164
+ else
165
+ self.payment_count = nil
166
+ end
167
+
146
168
  if attributes.key?(:'canceled_license_count')
147
169
  self.canceled_license_count = attributes[:'canceled_license_count']
148
170
  else
@@ -215,6 +237,14 @@ module LicenseManager
215
237
  invalid_properties.push('invalid value for "total", total cannot be nil.')
216
238
  end
217
239
 
240
+ if @subscription_total.nil?
241
+ invalid_properties.push('invalid value for "subscription_total", subscription_total cannot be nil.')
242
+ end
243
+
244
+ if @payment_count.nil?
245
+ invalid_properties.push('invalid value for "payment_count", payment_count cannot be nil.')
246
+ end
247
+
218
248
  if @canceled_license_count.nil?
219
249
  invalid_properties.push('invalid value for "canceled_license_count", canceled_license_count cannot be nil.')
220
250
  end
@@ -257,6 +287,8 @@ module LicenseManager
257
287
  return false if @currency.nil?
258
288
  return false if @license_count.nil?
259
289
  return false if @total.nil?
290
+ return false if @subscription_total.nil?
291
+ return false if @payment_count.nil?
260
292
  return false if @canceled_license_count.nil?
261
293
  return false if @canceled_total.nil?
262
294
  return false if @this_month.nil?
@@ -298,6 +330,26 @@ module LicenseManager
298
330
  @total = total
299
331
  end
300
332
 
333
+ # Custom attribute writer method with validation
334
+ # @param [Object] subscription_total Value to be assigned
335
+ def subscription_total=(subscription_total)
336
+ if subscription_total.nil?
337
+ fail ArgumentError, 'subscription_total cannot be nil'
338
+ end
339
+
340
+ @subscription_total = subscription_total
341
+ end
342
+
343
+ # Custom attribute writer method with validation
344
+ # @param [Object] payment_count Value to be assigned
345
+ def payment_count=(payment_count)
346
+ if payment_count.nil?
347
+ fail ArgumentError, 'payment_count cannot be nil'
348
+ end
349
+
350
+ @payment_count = payment_count
351
+ end
352
+
301
353
  # Custom attribute writer method with validation
302
354
  # @param [Object] canceled_license_count Value to be assigned
303
355
  def canceled_license_count=(canceled_license_count)
@@ -386,6 +438,8 @@ module LicenseManager
386
438
  currency == o.currency &&
387
439
  license_count == o.license_count &&
388
440
  total == o.total &&
441
+ subscription_total == o.subscription_total &&
442
+ payment_count == o.payment_count &&
389
443
  canceled_license_count == o.canceled_license_count &&
390
444
  canceled_total == o.canceled_total &&
391
445
  this_month == o.this_month &&
@@ -405,7 +459,7 @@ module LicenseManager
405
459
  # Calculates hash code according to all attributes.
406
460
  # @return [Integer] Hash code
407
461
  def hash
408
- [currency, license_count, total, canceled_license_count, canceled_total, this_month, last_month, last30_days, by_day, by_month, by_policy].hash
462
+ [currency, license_count, total, subscription_total, payment_count, canceled_license_count, canceled_total, this_month, last_month, last30_days, by_day, by_month, by_policy].hash
409
463
  end
410
464
 
411
465
  # Builds the object from hash
@@ -24,6 +24,9 @@ module LicenseManager
24
24
  # Whether the key can connect without it, losing what it's for, explained by `reason`.
25
25
  attr_accessor :optional
26
26
 
27
+ # Whether it's only needed to sell subscriptions: checked once a recurring price is mapped.
28
+ attr_accessor :subscriptions
29
+
27
30
  class EnumAttributeValidator
28
31
  attr_reader :datatype
29
32
  attr_reader :allowable_values
@@ -52,7 +55,8 @@ module LicenseManager
52
55
  :'resource' => :'resource',
53
56
  :'access' => :'access',
54
57
  :'reason' => :'reason',
55
- :'optional' => :'optional'
58
+ :'optional' => :'optional',
59
+ :'subscriptions' => :'subscriptions'
56
60
  }
57
61
  end
58
62
 
@@ -72,7 +76,8 @@ module LicenseManager
72
76
  :'resource' => :'String',
73
77
  :'access' => :'String',
74
78
  :'reason' => :'String',
75
- :'optional' => :'Boolean'
79
+ :'optional' => :'Boolean',
80
+ :'subscriptions' => :'Boolean'
76
81
  }
77
82
  end
78
83
 
@@ -131,6 +136,12 @@ module LicenseManager
131
136
  else
132
137
  self.optional = nil
133
138
  end
139
+
140
+ if attributes.key?(:'subscriptions')
141
+ self.subscriptions = attributes[:'subscriptions']
142
+ else
143
+ self.subscriptions = nil
144
+ end
134
145
  end
135
146
 
136
147
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -154,6 +165,10 @@ module LicenseManager
154
165
  invalid_properties.push('invalid value for "optional", optional cannot be nil.')
155
166
  end
156
167
 
168
+ if @subscriptions.nil?
169
+ invalid_properties.push('invalid value for "subscriptions", subscriptions cannot be nil.')
170
+ end
171
+
157
172
  invalid_properties
158
173
  end
159
174
 
@@ -167,6 +182,7 @@ module LicenseManager
167
182
  return false unless access_validator.valid?(@access)
168
183
  return false if @reason.nil?
169
184
  return false if @optional.nil?
185
+ return false if @subscriptions.nil?
170
186
  true
171
187
  end
172
188
 
@@ -210,6 +226,16 @@ module LicenseManager
210
226
  @optional = optional
211
227
  end
212
228
 
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] subscriptions Value to be assigned
231
+ def subscriptions=(subscriptions)
232
+ if subscriptions.nil?
233
+ fail ArgumentError, 'subscriptions cannot be nil'
234
+ end
235
+
236
+ @subscriptions = subscriptions
237
+ end
238
+
213
239
  # Checks equality by comparing each attribute.
214
240
  # @param [Object] Object to be compared
215
241
  def ==(o)
@@ -218,7 +244,8 @@ module LicenseManager
218
244
  resource == o.resource &&
219
245
  access == o.access &&
220
246
  reason == o.reason &&
221
- optional == o.optional
247
+ optional == o.optional &&
248
+ subscriptions == o.subscriptions
222
249
  end
223
250
 
224
251
  # @see the `==` method
@@ -230,7 +257,7 @@ module LicenseManager
230
257
  # Calculates hash code according to all attributes.
231
258
  # @return [Integer] Hash code
232
259
  def hash
233
- [resource, access, reason, optional].hash
260
+ [resource, access, reason, optional, subscriptions].hash
234
261
  end
235
262
 
236
263
  # Builds the object from hash
@@ -25,6 +25,8 @@ module LicenseManager
25
25
 
26
26
  attr_accessor :price
27
27
 
28
+ attr_accessor :recurring
29
+
28
30
  # Whether the price already creates licenses of a product.
29
31
  attr_accessor :mapped
30
32
 
@@ -36,6 +38,7 @@ module LicenseManager
36
38
  :'product_name' => :'productName',
37
39
  :'nickname' => :'nickname',
38
40
  :'price' => :'price',
41
+ :'recurring' => :'recurring',
39
42
  :'mapped' => :'mapped'
40
43
  }
41
44
  end
@@ -58,6 +61,7 @@ module LicenseManager
58
61
  :'product_name' => :'String',
59
62
  :'nickname' => :'String',
60
63
  :'price' => :'Price',
64
+ :'recurring' => :'StripePriceRecurring',
61
65
  :'mapped' => :'Boolean'
62
66
  }
63
67
  end
@@ -67,6 +71,7 @@ module LicenseManager
67
71
  Set.new([
68
72
  :'nickname',
69
73
  :'price',
74
+ :'recurring',
70
75
  ])
71
76
  end
72
77
 
@@ -126,6 +131,12 @@ module LicenseManager
126
131
  self.price = nil
127
132
  end
128
133
 
134
+ if attributes.key?(:'recurring')
135
+ self.recurring = attributes[:'recurring']
136
+ else
137
+ self.recurring = nil
138
+ end
139
+
129
140
  if attributes.key?(:'mapped')
130
141
  self.mapped = attributes[:'mapped']
131
142
  else
@@ -218,6 +229,7 @@ module LicenseManager
218
229
  product_name == o.product_name &&
219
230
  nickname == o.nickname &&
220
231
  price == o.price &&
232
+ recurring == o.recurring &&
221
233
  mapped == o.mapped
222
234
  end
223
235
 
@@ -230,7 +242,7 @@ module LicenseManager
230
242
  # Calculates hash code according to all attributes.
231
243
  # @return [Integer] Hash code
232
244
  def hash
233
- [id, product_id, product_name, nickname, price, mapped].hash
245
+ [id, product_id, product_name, nickname, price, recurring, mapped].hash
234
246
  end
235
247
 
236
248
  # Builds the object from hash