license_manager 0.1.1 → 0.2.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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +95 -0
  3. data/README.md +2 -2
  4. data/docs/CancelLicense.md +22 -0
  5. data/docs/CancellationReason.md +15 -0
  6. data/docs/CancellationStats.md +30 -0
  7. data/docs/CancellationStatsByReasonInner.md +20 -0
  8. data/docs/ConnectStripe.md +1 -1
  9. data/docs/CreateLicense.md +2 -0
  10. data/docs/CreatePolicy.md +3 -1
  11. data/docs/CreateProductWithPolicy.md +1 -1
  12. data/docs/CreateToken.md +1 -1
  13. data/docs/EventActorOneOf.md +1 -1
  14. data/docs/Integration.md +5 -1
  15. data/docs/IntegrationsApi.md +74 -0
  16. data/docs/License.md +10 -0
  17. data/docs/LicensesApi.md +80 -3
  18. data/docs/Machine.md +3 -1
  19. data/docs/MachinesApi.md +1 -1
  20. data/docs/Policy.md +2 -0
  21. data/docs/PolicySettings.md +3 -1
  22. data/docs/PortalApi.md +1 -1
  23. data/docs/PortalLink.md +2 -2
  24. data/docs/Product.md +2 -0
  25. data/docs/ProductStats.md +6 -4
  26. data/docs/ProductsApi.md +2 -2
  27. data/docs/Revenue.md +6 -2
  28. data/docs/StripeIntegration.md +1 -1
  29. data/docs/StripePermission.md +3 -1
  30. data/docs/UpdateIntegration.md +18 -0
  31. data/docs/UpdateLicense.md +3 -1
  32. data/docs/UpdatePolicy.md +3 -1
  33. data/docs/UpdateProduct.md +3 -1
  34. data/lib/license_manager/api/integrations_api.rb +74 -0
  35. data/lib/license_manager/api/licenses_api.rb +80 -6
  36. data/lib/license_manager/api/machines_api.rb +3 -3
  37. data/lib/license_manager/api/portal_api.rb +2 -2
  38. data/lib/license_manager/api/products_api.rb +4 -4
  39. data/lib/license_manager/models/cancel_license.rb +238 -0
  40. data/lib/license_manager/models/cancellation_reason.rb +45 -0
  41. data/lib/license_manager/models/cancellation_stats.rb +347 -0
  42. data/lib/license_manager/models/cancellation_stats_by_reason_inner.rb +225 -0
  43. data/lib/license_manager/models/connect_stripe.rb +1 -1
  44. data/lib/license_manager/models/create_license.rb +12 -1
  45. data/lib/license_manager/models/create_policy.rb +40 -5
  46. data/lib/license_manager/models/create_product_with_policy.rb +1 -1
  47. data/lib/license_manager/models/create_token.rb +1 -1
  48. data/lib/license_manager/models/event_type.rb +4 -1
  49. data/lib/license_manager/models/integration.rb +55 -1
  50. data/lib/license_manager/models/license.rb +79 -1
  51. data/lib/license_manager/models/license_status.rb +2 -1
  52. data/lib/license_manager/models/machine.rb +17 -4
  53. data/lib/license_manager/models/policy.rb +14 -1
  54. data/lib/license_manager/models/policy_settings.rb +40 -5
  55. data/lib/license_manager/models/portal_link.rb +1 -1
  56. data/lib/license_manager/models/product.rb +28 -1
  57. data/lib/license_manager/models/product_stats.rb +18 -5
  58. data/lib/license_manager/models/revenue.rb +58 -4
  59. data/lib/license_manager/models/stripe_integration.rb +1 -1
  60. data/lib/license_manager/models/stripe_permission.rb +31 -4
  61. data/lib/license_manager/models/update_integration.rb +161 -0
  62. data/lib/license_manager/models/update_license.rb +16 -5
  63. data/lib/license_manager/models/update_policy.rb +40 -5
  64. data/lib/license_manager/models/update_product.rb +14 -4
  65. data/lib/license_manager/version.rb +1 -1
  66. data/lib/license_manager.rb +5 -0
  67. data/openapi.json +566 -32
  68. data/spec/api/integrations_api_spec.rb +13 -0
  69. data/spec/api/licenses_api_spec.rb +16 -3
  70. data/spec/api/machines_api_spec.rb +1 -1
  71. data/spec/api/portal_api_spec.rb +1 -1
  72. data/spec/api/products_api_spec.rb +2 -2
  73. data/spec/models/cancel_license_spec.rb +48 -0
  74. data/spec/models/cancellation_reason_spec.rb +30 -0
  75. data/spec/models/cancellation_stats_by_reason_inner_spec.rb +42 -0
  76. data/spec/models/cancellation_stats_spec.rb +72 -0
  77. data/spec/models/create_license_spec.rb +6 -0
  78. data/spec/models/create_policy_spec.rb +6 -0
  79. data/spec/models/create_token_spec.rb +1 -1
  80. data/spec/models/integration_spec.rb +12 -0
  81. data/spec/models/license_spec.rb +30 -0
  82. data/spec/models/machine_spec.rb +7 -1
  83. data/spec/models/policy_settings_spec.rb +6 -0
  84. data/spec/models/policy_spec.rb +6 -0
  85. data/spec/models/product_spec.rb +6 -0
  86. data/spec/models/product_stats_spec.rb +6 -0
  87. data/spec/models/revenue_spec.rb +12 -0
  88. data/spec/models/stripe_permission_spec.rb +6 -0
  89. data/spec/models/token_spec.rb +1 -1
  90. data/spec/models/update_integration_spec.rb +36 -0
  91. data/spec/models/update_license_spec.rb +6 -0
  92. data/spec/models/update_policy_spec.rb +6 -0
  93. data/spec/models/update_product_spec.rb +6 -0
  94. metadata +21 -1
@@ -55,6 +55,20 @@ module LicenseManager
55
55
 
56
56
  attr_accessor :status
57
57
 
58
+ # End of the money back guarantee: until then, the customer can cancel the license from the customer portal, or with a token. Set from the policy's `moneyBackGuaranteeDays` when the license is created. `null` when the customer can't cancel it.
59
+ attr_accessor :cancellable_until
60
+
61
+ # When the license was canceled: validating its key fails since. `null` when it wasn't.
62
+ attr_accessor :canceled_at
63
+
64
+ attr_accessor :cancellation_reason
65
+
66
+ # Comment given when the license was canceled. `null` when there's none.
67
+ attr_accessor :cancellation_comment
68
+
69
+ # Id of the Stripe refund of the license's payment once it was canceled, through the Stripe integration. `null` otherwise.
70
+ attr_accessor :stripe_refund_id
71
+
58
72
  # Last time the license's settings were edited, not when its key was validated.
59
73
  attr_accessor :updated_at
60
74
 
@@ -99,6 +113,11 @@ module LicenseManager
99
113
  :'max_version' => :'maxVersion',
100
114
  :'price' => :'price',
101
115
  :'status' => :'status',
116
+ :'cancellable_until' => :'cancellableUntil',
117
+ :'canceled_at' => :'canceledAt',
118
+ :'cancellation_reason' => :'cancellationReason',
119
+ :'cancellation_comment' => :'cancellationComment',
120
+ :'stripe_refund_id' => :'stripeRefundId',
102
121
  :'updated_at' => :'updatedAt'
103
122
  }
104
123
  end
@@ -132,6 +151,11 @@ module LicenseManager
132
151
  :'max_version' => :'LicenseMaxVersion',
133
152
  :'price' => :'Price',
134
153
  :'status' => :'LicenseStatus',
154
+ :'cancellable_until' => :'Time',
155
+ :'canceled_at' => :'Time',
156
+ :'cancellation_reason' => :'CancellationReason',
157
+ :'cancellation_comment' => :'String',
158
+ :'stripe_refund_id' => :'String',
135
159
  :'updated_at' => :'Time'
136
160
  }
137
161
  end
@@ -145,6 +169,10 @@ module LicenseManager
145
169
  :'max_machines',
146
170
  :'last_activated_at',
147
171
  :'price',
172
+ :'cancellable_until',
173
+ :'canceled_at',
174
+ :'cancellation_comment',
175
+ :'stripe_refund_id',
148
176
  ])
149
177
  end
150
178
 
@@ -272,6 +300,36 @@ module LicenseManager
272
300
  self.status = nil
273
301
  end
274
302
 
303
+ if attributes.key?(:'cancellable_until')
304
+ self.cancellable_until = attributes[:'cancellable_until']
305
+ else
306
+ self.cancellable_until = nil
307
+ end
308
+
309
+ if attributes.key?(:'canceled_at')
310
+ self.canceled_at = attributes[:'canceled_at']
311
+ else
312
+ self.canceled_at = nil
313
+ end
314
+
315
+ if attributes.key?(:'cancellation_reason')
316
+ self.cancellation_reason = attributes[:'cancellation_reason']
317
+ else
318
+ self.cancellation_reason = nil
319
+ end
320
+
321
+ if attributes.key?(:'cancellation_comment')
322
+ self.cancellation_comment = attributes[:'cancellation_comment']
323
+ else
324
+ self.cancellation_comment = nil
325
+ end
326
+
327
+ if attributes.key?(:'stripe_refund_id')
328
+ self.stripe_refund_id = attributes[:'stripe_refund_id']
329
+ else
330
+ self.stripe_refund_id = nil
331
+ end
332
+
275
333
  if attributes.key?(:'updated_at')
276
334
  self.updated_at = attributes[:'updated_at']
277
335
  else
@@ -324,6 +382,10 @@ module LicenseManager
324
382
  invalid_properties.push('invalid value for "status", status cannot be nil.')
325
383
  end
326
384
 
385
+ if @cancellation_reason.nil?
386
+ invalid_properties.push('invalid value for "cancellation_reason", cancellation_reason cannot be nil.')
387
+ end
388
+
327
389
  if @updated_at.nil?
328
390
  invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
329
391
  end
@@ -345,6 +407,7 @@ module LicenseManager
345
407
  return false if @active_machine_count.nil?
346
408
  return false if @max_version.nil?
347
409
  return false if @status.nil?
410
+ return false if @cancellation_reason.nil?
348
411
  return false if @updated_at.nil?
349
412
  true
350
413
  end
@@ -449,6 +512,16 @@ module LicenseManager
449
512
  @status = status
450
513
  end
451
514
 
515
+ # Custom attribute writer method with validation
516
+ # @param [Object] cancellation_reason Value to be assigned
517
+ def cancellation_reason=(cancellation_reason)
518
+ if cancellation_reason.nil?
519
+ fail ArgumentError, 'cancellation_reason cannot be nil'
520
+ end
521
+
522
+ @cancellation_reason = cancellation_reason
523
+ end
524
+
452
525
  # Custom attribute writer method with validation
453
526
  # @param [Object] updated_at Value to be assigned
454
527
  def updated_at=(updated_at)
@@ -480,6 +553,11 @@ module LicenseManager
480
553
  max_version == o.max_version &&
481
554
  price == o.price &&
482
555
  status == o.status &&
556
+ cancellable_until == o.cancellable_until &&
557
+ canceled_at == o.canceled_at &&
558
+ cancellation_reason == o.cancellation_reason &&
559
+ cancellation_comment == o.cancellation_comment &&
560
+ stripe_refund_id == o.stripe_refund_id &&
483
561
  updated_at == o.updated_at
484
562
  end
485
563
 
@@ -492,7 +570,7 @@ module LicenseManager
492
570
  # Calculates hash code according to all attributes.
493
571
  # @return [Integer] Hash code
494
572
  def hash
495
- [id, product_id, policy_id, customer_id, key, created_at, expires_at, meta, stripe_payment_intent_id, max_machines, max_offline_duration_seconds, active_machine_count, last_activated_at, max_version, price, status, updated_at].hash
573
+ [id, product_id, policy_id, customer_id, key, created_at, expires_at, meta, stripe_payment_intent_id, max_machines, max_offline_duration_seconds, active_machine_count, last_activated_at, max_version, price, status, cancellable_until, canceled_at, cancellation_reason, cancellation_comment, stripe_refund_id, updated_at].hash
496
574
  end
497
575
 
498
576
  # Builds the object from hash
@@ -18,10 +18,11 @@ module LicenseManager
18
18
  ACTIVE = "active".freeze
19
19
  INACTIVE = "inactive".freeze
20
20
  EXPIRED = "expired".freeze
21
+ CANCELED = "canceled".freeze
21
22
  UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
22
23
 
23
24
  def self.all_vars
24
- @all_vars ||= [ACTIVE, INACTIVE, EXPIRED, UNKNOWN_DEFAULT_OPEN_API].freeze
25
+ @all_vars ||= [ACTIVE, INACTIVE, EXPIRED, CANCELED, UNKNOWN_DEFAULT_OPEN_API].freeze
25
26
  end
26
27
 
27
28
  # Builds the enum from string
@@ -26,12 +26,15 @@ module LicenseManager
26
26
 
27
27
  attr_accessor :name
28
28
 
29
- # Whether the machine counts as using the license.
29
+ # Whether the machine counts as using the license. A `locked` machine doesn't, and its validations are refused with `machine_locked`: it overrode a machine that came back. See `validateKey`.
30
30
  attr_accessor :status
31
31
 
32
32
  # Version of the application last validated on the machine.
33
33
  attr_accessor :version
34
34
 
35
+ # For a machine deactivated or locked by automatic machine changes, the machine that took its place. Validating the key on a deactivated machine that has one takes its place back. `null` otherwise.
36
+ attr_accessor :overridden_by_machine_id
37
+
35
38
  # When the license was last validated on the machine.
36
39
  attr_accessor :last_validated_at
37
40
 
@@ -71,6 +74,7 @@ module LicenseManager
71
74
  :'name' => :'name',
72
75
  :'status' => :'status',
73
76
  :'version' => :'version',
77
+ :'overridden_by_machine_id' => :'overriddenByMachineId',
74
78
  :'last_validated_at' => :'lastValidatedAt',
75
79
  :'created_at' => :'createdAt',
76
80
  :'updated_at' => :'updatedAt'
@@ -97,6 +101,7 @@ module LicenseManager
97
101
  :'name' => :'String',
98
102
  :'status' => :'String',
99
103
  :'version' => :'String',
104
+ :'overridden_by_machine_id' => :'String',
100
105
  :'last_validated_at' => :'Time',
101
106
  :'created_at' => :'Time',
102
107
  :'updated_at' => :'Time'
@@ -109,6 +114,7 @@ module LicenseManager
109
114
  :'platform',
110
115
  :'name',
111
116
  :'version',
117
+ :'overridden_by_machine_id',
112
118
  :'last_validated_at',
113
119
  ])
114
120
  end
@@ -181,6 +187,12 @@ module LicenseManager
181
187
  self.version = nil
182
188
  end
183
189
 
190
+ if attributes.key?(:'overridden_by_machine_id')
191
+ self.overridden_by_machine_id = attributes[:'overridden_by_machine_id']
192
+ else
193
+ self.overridden_by_machine_id = nil
194
+ end
195
+
184
196
  if attributes.key?(:'last_validated_at')
185
197
  self.last_validated_at = attributes[:'last_validated_at']
186
198
  else
@@ -240,7 +252,7 @@ module LicenseManager
240
252
  return false if @license_id.nil?
241
253
  return false if @fingerprint.nil?
242
254
  return false if @status.nil?
243
- status_validator = EnumAttributeValidator.new('String', ["active", "deactivated", "unknown_default_open_api"])
255
+ status_validator = EnumAttributeValidator.new('String', ["active", "deactivated", "locked", "unknown_default_open_api"])
244
256
  return false unless status_validator.valid?(@status)
245
257
  return false if @created_at.nil?
246
258
  return false if @updated_at.nil?
@@ -280,7 +292,7 @@ module LicenseManager
280
292
  # Custom attribute writer method checking allowed values (enum).
281
293
  # @param [Object] status Object to be assigned
282
294
  def status=(status)
283
- validator = EnumAttributeValidator.new('String', ["active", "deactivated", "unknown_default_open_api"])
295
+ validator = EnumAttributeValidator.new('String', ["active", "deactivated", "locked", "unknown_default_open_api"])
284
296
  unless validator.valid?(status)
285
297
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
286
298
  end
@@ -319,6 +331,7 @@ module LicenseManager
319
331
  name == o.name &&
320
332
  status == o.status &&
321
333
  version == o.version &&
334
+ overridden_by_machine_id == o.overridden_by_machine_id &&
322
335
  last_validated_at == o.last_validated_at &&
323
336
  created_at == o.created_at &&
324
337
  updated_at == o.updated_at
@@ -333,7 +346,7 @@ module LicenseManager
333
346
  # Calculates hash code according to all attributes.
334
347
  # @return [Integer] Hash code
335
348
  def hash
336
- [id, license_id, fingerprint, platform, name, status, version, last_validated_at, created_at, updated_at].hash
349
+ [id, license_id, fingerprint, platform, name, status, version, overridden_by_machine_id, last_validated_at, created_at, updated_at].hash
337
350
  end
338
351
 
339
352
  # Builds the object from hash
@@ -36,6 +36,9 @@ module LicenseManager
36
36
 
37
37
  attr_accessor :max_version
38
38
 
39
+ # Number of days after their creation during which customers can cancel the licenses created with this policy, from the customer portal or with `cancelLicense`. `null` when they can't.
40
+ attr_accessor :money_back_guarantee_days
41
+
39
42
  # Number of licenses following this policy.
40
43
  attr_accessor :license_count
41
44
 
@@ -55,6 +58,7 @@ module LicenseManager
55
58
  :'max_machines' => :'maxMachines',
56
59
  :'max_offline_duration_seconds' => :'maxOfflineDurationSeconds',
57
60
  :'max_version' => :'maxVersion',
61
+ :'money_back_guarantee_days' => :'moneyBackGuaranteeDays',
58
62
  :'license_count' => :'licenseCount',
59
63
  :'created_at' => :'createdAt',
60
64
  :'updated_at' => :'updatedAt'
@@ -83,6 +87,7 @@ module LicenseManager
83
87
  :'max_machines' => :'Integer',
84
88
  :'max_offline_duration_seconds' => :'Integer',
85
89
  :'max_version' => :'PolicyMaxVersion',
90
+ :'money_back_guarantee_days' => :'Integer',
86
91
  :'license_count' => :'Integer',
87
92
  :'created_at' => :'Time',
88
93
  :'updated_at' => :'Time'
@@ -95,6 +100,7 @@ module LicenseManager
95
100
  :'duration',
96
101
  :'max_machines',
97
102
  :'max_version',
103
+ :'money_back_guarantee_days',
98
104
  ])
99
105
  end
100
106
 
@@ -178,6 +184,12 @@ module LicenseManager
178
184
  self.max_version = nil
179
185
  end
180
186
 
187
+ if attributes.key?(:'money_back_guarantee_days')
188
+ self.money_back_guarantee_days = attributes[:'money_back_guarantee_days']
189
+ else
190
+ self.money_back_guarantee_days = nil
191
+ end
192
+
181
193
  if attributes.key?(:'license_count')
182
194
  self.license_count = attributes[:'license_count']
183
195
  else
@@ -361,6 +373,7 @@ module LicenseManager
361
373
  max_machines == o.max_machines &&
362
374
  max_offline_duration_seconds == o.max_offline_duration_seconds &&
363
375
  max_version == o.max_version &&
376
+ money_back_guarantee_days == o.money_back_guarantee_days &&
364
377
  license_count == o.license_count &&
365
378
  created_at == o.created_at &&
366
379
  updated_at == o.updated_at
@@ -375,7 +388,7 @@ module LicenseManager
375
388
  # Calculates hash code according to all attributes.
376
389
  # @return [Integer] Hash code
377
390
  def hash
378
- [id, product_id, slug, name, is_default, duration, max_machines, max_offline_duration_seconds, max_version, license_count, created_at, updated_at].hash
391
+ [id, product_id, slug, name, is_default, duration, max_machines, max_offline_duration_seconds, max_version, money_back_guarantee_days, license_count, created_at, updated_at].hash
379
392
  end
380
393
 
381
394
  # Builds the object from hash
@@ -25,13 +25,17 @@ module LicenseManager
25
25
 
26
26
  attr_accessor :max_version
27
27
 
28
+ # Number of days after their creation during which customers can cancel the licenses created with this policy, from the customer portal or with `cancelLicense`, which refunds their Stripe payment. Each license keeps the end of its own period as `cancellableUntil`. `null` for no money back guarantee. Defaults to `null`.
29
+ attr_accessor :money_back_guarantee_days
30
+
28
31
  # Attribute mapping from ruby-style variable name to JSON key.
29
32
  def self.attribute_map
30
33
  {
31
34
  :'duration' => :'duration',
32
35
  :'max_machines' => :'maxMachines',
33
36
  :'max_offline_duration_seconds' => :'maxOfflineDurationSeconds',
34
- :'max_version' => :'maxVersion'
37
+ :'max_version' => :'maxVersion',
38
+ :'money_back_guarantee_days' => :'moneyBackGuaranteeDays'
35
39
  }
36
40
  end
37
41
 
@@ -51,7 +55,8 @@ module LicenseManager
51
55
  :'duration' => :'PolicySettingsDuration',
52
56
  :'max_machines' => :'Integer',
53
57
  :'max_offline_duration_seconds' => :'Integer',
54
- :'max_version' => :'PolicySettingsMaxVersion'
58
+ :'max_version' => :'PolicySettingsMaxVersion',
59
+ :'money_back_guarantee_days' => :'Integer'
55
60
  }
56
61
  end
57
62
 
@@ -60,7 +65,8 @@ module LicenseManager
60
65
  Set.new([
61
66
  :'duration',
62
67
  :'max_machines',
63
- :'max_version'
68
+ :'max_version',
69
+ :'money_back_guarantee_days'
64
70
  ])
65
71
  end
66
72
 
@@ -105,6 +111,10 @@ module LicenseManager
105
111
  if attributes.key?(:'max_version')
106
112
  self.max_version = attributes[:'max_version']
107
113
  end
114
+
115
+ if attributes.key?(:'money_back_guarantee_days')
116
+ self.money_back_guarantee_days = attributes[:'money_back_guarantee_days']
117
+ end
108
118
  end
109
119
 
110
120
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -128,6 +138,14 @@ module LicenseManager
128
138
  invalid_properties.push('invalid value for "max_offline_duration_seconds", must be greater than or equal to 3600.')
129
139
  end
130
140
 
141
+ if !@money_back_guarantee_days.nil? && @money_back_guarantee_days > 3650
142
+ invalid_properties.push('invalid value for "money_back_guarantee_days", must be smaller than or equal to 3650.')
143
+ end
144
+
145
+ if !@money_back_guarantee_days.nil? && @money_back_guarantee_days <= 0
146
+ invalid_properties.push('invalid value for "money_back_guarantee_days", must be greater than 0.')
147
+ end
148
+
131
149
  invalid_properties
132
150
  end
133
151
 
@@ -139,6 +157,8 @@ module LicenseManager
139
157
  return false if !@max_machines.nil? && @max_machines <= 0
140
158
  return false if !@max_offline_duration_seconds.nil? && @max_offline_duration_seconds > 2147483647
141
159
  return false if !@max_offline_duration_seconds.nil? && @max_offline_duration_seconds < 3600
160
+ return false if !@money_back_guarantee_days.nil? && @money_back_guarantee_days > 3650
161
+ return false if !@money_back_guarantee_days.nil? && @money_back_guarantee_days <= 0
142
162
  true
143
163
  end
144
164
 
@@ -174,6 +194,20 @@ module LicenseManager
174
194
  @max_offline_duration_seconds = max_offline_duration_seconds
175
195
  end
176
196
 
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] money_back_guarantee_days Value to be assigned
199
+ def money_back_guarantee_days=(money_back_guarantee_days)
200
+ if !money_back_guarantee_days.nil? && money_back_guarantee_days > 3650
201
+ fail ArgumentError, 'invalid value for "money_back_guarantee_days", must be smaller than or equal to 3650.'
202
+ end
203
+
204
+ if !money_back_guarantee_days.nil? && money_back_guarantee_days <= 0
205
+ fail ArgumentError, 'invalid value for "money_back_guarantee_days", must be greater than 0.'
206
+ end
207
+
208
+ @money_back_guarantee_days = money_back_guarantee_days
209
+ end
210
+
177
211
  # Checks equality by comparing each attribute.
178
212
  # @param [Object] Object to be compared
179
213
  def ==(o)
@@ -182,7 +216,8 @@ module LicenseManager
182
216
  duration == o.duration &&
183
217
  max_machines == o.max_machines &&
184
218
  max_offline_duration_seconds == o.max_offline_duration_seconds &&
185
- max_version == o.max_version
219
+ max_version == o.max_version &&
220
+ money_back_guarantee_days == o.money_back_guarantee_days
186
221
  end
187
222
 
188
223
  # @see the `==` method
@@ -194,7 +229,7 @@ module LicenseManager
194
229
  # Calculates hash code according to all attributes.
195
230
  # @return [Integer] Hash code
196
231
  def hash
197
- [duration, max_machines, max_offline_duration_seconds, max_version].hash
232
+ [duration, max_machines, max_offline_duration_seconds, max_version, money_back_guarantee_days].hash
198
233
  end
199
234
 
200
235
  # Builds the object from hash
@@ -18,7 +18,7 @@ module LicenseManager
18
18
  # Link to the customer portal, holding the token.
19
19
  attr_accessor :url
20
20
 
21
- # Customer token in the link, with the `customer:read`, `license:read` and `machine:write` permissions.
21
+ # Customer token in the link, with the `customer:read`, `license:read`, `license:cancel` and `machine:write` permissions.
22
22
  attr_accessor :token
23
23
 
24
24
  # When the link stops working.
@@ -29,6 +29,9 @@ module LicenseManager
29
29
 
30
30
  attr_accessor :portal
31
31
 
32
+ # Whether a new machine validating a license already on its max machines takes the place of the license's machine validated the longest ago, rather than being refused with `machine_limit_reached`. When the replaced machine is validated again, it takes its place back and the machine that replaced it is locked. See `validateKey`.
33
+ attr_accessor :auto_machine_change
34
+
32
35
  attr_accessor :created_at
33
36
 
34
37
  attr_accessor :updated_at
@@ -42,6 +45,7 @@ module LicenseManager
42
45
  :'is_test_from_product_id' => :'isTestFromProductId',
43
46
  :'logo_url' => :'logoUrl',
44
47
  :'portal' => :'portal',
48
+ :'auto_machine_change' => :'autoMachineChange',
45
49
  :'created_at' => :'createdAt',
46
50
  :'updated_at' => :'updatedAt'
47
51
  }
@@ -66,6 +70,7 @@ module LicenseManager
66
70
  :'is_test_from_product_id' => :'String',
67
71
  :'logo_url' => :'String',
68
72
  :'portal' => :'PortalSettings',
73
+ :'auto_machine_change' => :'Boolean',
69
74
  :'created_at' => :'Time',
70
75
  :'updated_at' => :'Time'
71
76
  }
@@ -141,6 +146,12 @@ module LicenseManager
141
146
  self.portal = nil
142
147
  end
143
148
 
149
+ if attributes.key?(:'auto_machine_change')
150
+ self.auto_machine_change = attributes[:'auto_machine_change']
151
+ else
152
+ self.auto_machine_change = nil
153
+ end
154
+
144
155
  if attributes.key?(:'created_at')
145
156
  self.created_at = attributes[:'created_at']
146
157
  else
@@ -175,6 +186,10 @@ module LicenseManager
175
186
  invalid_properties.push('invalid value for "portal", portal cannot be nil.')
176
187
  end
177
188
 
189
+ if @auto_machine_change.nil?
190
+ invalid_properties.push('invalid value for "auto_machine_change", auto_machine_change cannot be nil.')
191
+ end
192
+
178
193
  if @created_at.nil?
179
194
  invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
180
195
  end
@@ -194,6 +209,7 @@ module LicenseManager
194
209
  return false if @slug.nil?
195
210
  return false if @name.nil?
196
211
  return false if @portal.nil?
212
+ return false if @auto_machine_change.nil?
197
213
  return false if @created_at.nil?
198
214
  return false if @updated_at.nil?
199
215
  true
@@ -239,6 +255,16 @@ module LicenseManager
239
255
  @portal = portal
240
256
  end
241
257
 
258
+ # Custom attribute writer method with validation
259
+ # @param [Object] auto_machine_change Value to be assigned
260
+ def auto_machine_change=(auto_machine_change)
261
+ if auto_machine_change.nil?
262
+ fail ArgumentError, 'auto_machine_change cannot be nil'
263
+ end
264
+
265
+ @auto_machine_change = auto_machine_change
266
+ end
267
+
242
268
  # Custom attribute writer method with validation
243
269
  # @param [Object] created_at Value to be assigned
244
270
  def created_at=(created_at)
@@ -270,6 +296,7 @@ module LicenseManager
270
296
  is_test_from_product_id == o.is_test_from_product_id &&
271
297
  logo_url == o.logo_url &&
272
298
  portal == o.portal &&
299
+ auto_machine_change == o.auto_machine_change &&
273
300
  created_at == o.created_at &&
274
301
  updated_at == o.updated_at
275
302
  end
@@ -283,7 +310,7 @@ module LicenseManager
283
310
  # Calculates hash code according to all attributes.
284
311
  # @return [Integer] Hash code
285
312
  def hash
286
- [id, slug, name, is_test_from_product_id, logo_url, portal, created_at, updated_at].hash
313
+ [id, slug, name, is_test_from_product_id, logo_url, portal, auto_machine_change, created_at, updated_at].hash
287
314
  end
288
315
 
289
316
  # Builds the object from hash
@@ -18,16 +18,16 @@ module LicenseManager
18
18
  # Number of licenses of the product.
19
19
  attr_accessor :license_count
20
20
 
21
- # Number of licenses that haven't expired, and that a machine validated in the last 90 days.
21
+ # Number of licenses that haven't expired nor were canceled, and that a machine validated in the last 90 days.
22
22
  attr_accessor :active_license_count
23
23
 
24
24
  # Number of licenses created in the last 30 days, today included, in UTC.
25
25
  attr_accessor :new_license_count
26
26
 
27
- # Number of licenses expiring in the next 30 days.
27
+ # Number of licenses expiring in the next 30 days, canceled ones left out.
28
28
  attr_accessor :expiring_license_count
29
29
 
30
- # Number of licenses that expired in the last 30 days.
30
+ # Number of licenses that expired in the last 30 days, canceled ones left out.
31
31
  attr_accessor :expired_license_count
32
32
 
33
33
  # Number of active machines of the licenses of the product.
@@ -36,7 +36,7 @@ module LicenseManager
36
36
  # Number of licenses with at least one active machine.
37
37
  attr_accessor :in_use_license_count
38
38
 
39
- # Sum of the maximum numbers of machines of the licenses that haven't expired. Licenses without a maximum are left out.
39
+ # Sum of the maximum numbers of machines of the licenses that haven't expired nor were canceled. Licenses without a maximum are left out.
40
40
  attr_accessor :seat_count
41
41
 
42
42
  # Number of active machines of the licenses counted in `seatCount`, at most their maximum number of machines each.
@@ -60,6 +60,9 @@ module LicenseManager
60
60
  # Number of licenses of each policy created each day and each month, for the policies with licenses created over the covered months.
61
61
  attr_accessor :new_licenses_by_policy
62
62
 
63
+ # Cancellations of the licenses with a money back guarantee. `null` when no license of the product has one.
64
+ attr_accessor :cancellation
65
+
63
66
  # Revenue in each currency licenses were sold in, from the one with the most licenses sold. Amounts aren't converted between currencies.
64
67
  attr_accessor :revenue
65
68
 
@@ -90,6 +93,7 @@ module LicenseManager
90
93
  :'new_licenses_by_day' => :'newLicensesByDay',
91
94
  :'new_licenses_by_month' => :'newLicensesByMonth',
92
95
  :'new_licenses_by_policy' => :'newLicensesByPolicy',
96
+ :'cancellation' => :'cancellation',
93
97
  :'revenue' => :'revenue',
94
98
  :'activations_by_version' => :'activationsByVersion',
95
99
  :'active_machines_by_version' => :'activeMachinesByVersion',
@@ -125,6 +129,7 @@ module LicenseManager
125
129
  :'new_licenses_by_day' => :'Array<Integer>',
126
130
  :'new_licenses_by_month' => :'Array<Integer>',
127
131
  :'new_licenses_by_policy' => :'Array<ProductStatsNewLicensesByPolicyInner>',
132
+ :'cancellation' => :'CancellationStats',
128
133
  :'revenue' => :'Array<Revenue>',
129
134
  :'activations_by_version' => :'Array<ProductStatsActivationsByVersionInner>',
130
135
  :'active_machines_by_version' => :'Array<ProductStatsActiveMachinesByVersionInner>',
@@ -135,6 +140,7 @@ module LicenseManager
135
140
  # List of attributes with nullable: true
136
141
  def self.openapi_nullable
137
142
  Set.new([
143
+ :'cancellation',
138
144
  ])
139
145
  end
140
146
 
@@ -264,6 +270,12 @@ module LicenseManager
264
270
  self.new_licenses_by_policy = nil
265
271
  end
266
272
 
273
+ if attributes.key?(:'cancellation')
274
+ self.cancellation = attributes[:'cancellation']
275
+ else
276
+ self.cancellation = nil
277
+ end
278
+
267
279
  if attributes.key?(:'revenue')
268
280
  if (value = attributes[:'revenue']).is_a?(Array)
269
281
  self.revenue = value
@@ -617,6 +629,7 @@ module LicenseManager
617
629
  new_licenses_by_day == o.new_licenses_by_day &&
618
630
  new_licenses_by_month == o.new_licenses_by_month &&
619
631
  new_licenses_by_policy == o.new_licenses_by_policy &&
632
+ cancellation == o.cancellation &&
620
633
  revenue == o.revenue &&
621
634
  activations_by_version == o.activations_by_version &&
622
635
  active_machines_by_version == o.active_machines_by_version &&
@@ -632,7 +645,7 @@ module LicenseManager
632
645
  # Calculates hash code according to all attributes.
633
646
  # @return [Integer] Hash code
634
647
  def hash
635
- [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, revenue, activations_by_version, active_machines_by_version, active_machines_by_platform].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
636
649
  end
637
650
 
638
651
  # Builds the object from hash