license_manager 0.1.1 → 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 (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +152 -0
  3. data/README.md +3 -3
  4. data/docs/BillingPortalSession.md +18 -0
  5. data/docs/CancelLicense.md +22 -0
  6. data/docs/CancellationReason.md +15 -0
  7. data/docs/CancellationStats.md +30 -0
  8. data/docs/CancellationStatsByReasonInner.md +20 -0
  9. data/docs/ConnectStripe.md +1 -1
  10. data/docs/CreateBillingPortalSession.md +18 -0
  11. data/docs/CreateIntegrationMapping.md +1 -1
  12. data/docs/CreateLicense.md +2 -0
  13. data/docs/CreatePolicy.md +3 -1
  14. data/docs/CreateProductWithPolicy.md +1 -1
  15. data/docs/CreateToken.md +1 -1
  16. data/docs/EventActorOneOf.md +1 -1
  17. data/docs/Integration.md +11 -1
  18. data/docs/IntegrationMapping.md +2 -0
  19. data/docs/IntegrationMappingRecurring.md +20 -0
  20. data/docs/IntegrationsApi.md +74 -0
  21. data/docs/License.md +12 -0
  22. data/docs/LicenseSubscription.md +34 -0
  23. data/docs/LicensesApi.md +80 -3
  24. data/docs/Machine.md +3 -1
  25. data/docs/MachinesApi.md +1 -1
  26. data/docs/Mrr.md +26 -0
  27. data/docs/MrrByIntervalInner.md +24 -0
  28. data/docs/MrrByPolicyInner.md +22 -0
  29. data/docs/Policy.md +2 -0
  30. data/docs/PolicySettings.md +3 -1
  31. data/docs/PortalApi.md +80 -1
  32. data/docs/PortalLink.md +2 -2
  33. data/docs/Product.md +2 -0
  34. data/docs/ProductStats.md +8 -4
  35. data/docs/ProductsApi.md +2 -2
  36. data/docs/Revenue.md +10 -2
  37. data/docs/StripeIntegration.md +1 -1
  38. data/docs/StripePermission.md +5 -1
  39. data/docs/StripePrice.md +2 -0
  40. data/docs/StripePriceRecurring.md +20 -0
  41. data/docs/SubscriptionStats.md +38 -0
  42. data/docs/UpdateIntegration.md +20 -0
  43. data/docs/UpdateLicense.md +3 -1
  44. data/docs/UpdatePolicy.md +3 -1
  45. data/docs/UpdateProduct.md +3 -1
  46. data/lib/license_manager/api/integrations_api.rb +74 -0
  47. data/lib/license_manager/api/licenses_api.rb +80 -6
  48. data/lib/license_manager/api/machines_api.rb +3 -3
  49. data/lib/license_manager/api/portal_api.rb +72 -2
  50. data/lib/license_manager/api/products_api.rb +4 -4
  51. data/lib/license_manager/models/billing_portal_session.rb +178 -0
  52. data/lib/license_manager/models/cancel_license.rb +238 -0
  53. data/lib/license_manager/models/cancellation_reason.rb +45 -0
  54. data/lib/license_manager/models/cancellation_stats.rb +347 -0
  55. data/lib/license_manager/models/cancellation_stats_by_reason_inner.rb +225 -0
  56. data/lib/license_manager/models/connect_stripe.rb +1 -1
  57. data/lib/license_manager/models/create_billing_portal_session.rb +161 -0
  58. data/lib/license_manager/models/create_integration_mapping.rb +1 -1
  59. data/lib/license_manager/models/create_license.rb +12 -1
  60. data/lib/license_manager/models/create_policy.rb +40 -5
  61. data/lib/license_manager/models/create_product_with_policy.rb +1 -1
  62. data/lib/license_manager/models/create_token.rb +1 -1
  63. data/lib/license_manager/models/event_type.rb +7 -1
  64. data/lib/license_manager/models/integration.rb +136 -1
  65. data/lib/license_manager/models/integration_mapping.rb +13 -1
  66. data/lib/license_manager/models/integration_mapping_recurring.rb +228 -0
  67. data/lib/license_manager/models/license.rb +91 -1
  68. data/lib/license_manager/models/license_status.rb +2 -1
  69. data/lib/license_manager/models/license_subscription.rb +388 -0
  70. data/lib/license_manager/models/machine.rb +17 -4
  71. data/lib/license_manager/models/mrr.rb +291 -0
  72. data/lib/license_manager/models/mrr_by_interval_inner.rb +279 -0
  73. data/lib/license_manager/models/mrr_by_policy_inner.rb +229 -0
  74. data/lib/license_manager/models/policy.rb +14 -1
  75. data/lib/license_manager/models/policy_settings.rb +40 -5
  76. data/lib/license_manager/models/portal_link.rb +1 -1
  77. data/lib/license_manager/models/product.rb +28 -1
  78. data/lib/license_manager/models/product_stats.rb +31 -5
  79. data/lib/license_manager/models/revenue.rb +112 -4
  80. data/lib/license_manager/models/stripe_integration.rb +1 -1
  81. data/lib/license_manager/models/stripe_permission.rb +58 -4
  82. data/lib/license_manager/models/stripe_price.rb +13 -1
  83. data/lib/license_manager/models/stripe_price_recurring.rb +228 -0
  84. data/lib/license_manager/models/subscription_stats.rb +456 -0
  85. data/lib/license_manager/models/update_integration.rb +199 -0
  86. data/lib/license_manager/models/update_license.rb +16 -5
  87. data/lib/license_manager/models/update_policy.rb +40 -5
  88. data/lib/license_manager/models/update_product.rb +14 -4
  89. data/lib/license_manager/version.rb +1 -1
  90. data/lib/license_manager.rb +14 -0
  91. data/openapi.json +1146 -59
  92. data/spec/api/integrations_api_spec.rb +13 -0
  93. data/spec/api/licenses_api_spec.rb +16 -3
  94. data/spec/api/machines_api_spec.rb +1 -1
  95. data/spec/api/portal_api_spec.rb +14 -1
  96. data/spec/api/products_api_spec.rb +2 -2
  97. data/spec/models/billing_portal_session_spec.rb +36 -0
  98. data/spec/models/cancel_license_spec.rb +48 -0
  99. data/spec/models/cancellation_reason_spec.rb +30 -0
  100. data/spec/models/cancellation_stats_by_reason_inner_spec.rb +42 -0
  101. data/spec/models/cancellation_stats_spec.rb +72 -0
  102. data/spec/models/create_billing_portal_session_spec.rb +36 -0
  103. data/spec/models/create_license_spec.rb +6 -0
  104. data/spec/models/create_policy_spec.rb +6 -0
  105. data/spec/models/create_token_spec.rb +1 -1
  106. data/spec/models/integration_mapping_recurring_spec.rb +46 -0
  107. data/spec/models/integration_mapping_spec.rb +6 -0
  108. data/spec/models/integration_spec.rb +30 -0
  109. data/spec/models/license_spec.rb +36 -0
  110. data/spec/models/license_subscription_spec.rb +88 -0
  111. data/spec/models/machine_spec.rb +7 -1
  112. data/spec/models/mrr_by_interval_inner_spec.rb +58 -0
  113. data/spec/models/mrr_by_policy_inner_spec.rb +48 -0
  114. data/spec/models/mrr_spec.rb +60 -0
  115. data/spec/models/policy_settings_spec.rb +6 -0
  116. data/spec/models/policy_spec.rb +6 -0
  117. data/spec/models/product_spec.rb +6 -0
  118. data/spec/models/product_stats_spec.rb +12 -0
  119. data/spec/models/revenue_spec.rb +24 -0
  120. data/spec/models/stripe_permission_spec.rb +12 -0
  121. data/spec/models/stripe_price_recurring_spec.rb +46 -0
  122. data/spec/models/stripe_price_spec.rb +6 -0
  123. data/spec/models/subscription_stats_spec.rb +96 -0
  124. data/spec/models/token_spec.rb +1 -1
  125. data/spec/models/update_integration_spec.rb +42 -0
  126. data/spec/models/update_license_spec.rb +6 -0
  127. data/spec/models/update_policy_spec.rb +6 -0
  128. data/spec/models/update_product_spec.rb +6 -0
  129. metadata +57 -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
@@ -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,12 @@ 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
+
66
+ # Subscriptions of the product. `null` when it has never had one.
67
+ attr_accessor :subscriptions
68
+
63
69
  # Revenue in each currency licenses were sold in, from the one with the most licenses sold. Amounts aren't converted between currencies.
64
70
  attr_accessor :revenue
65
71
 
@@ -90,6 +96,8 @@ module LicenseManager
90
96
  :'new_licenses_by_day' => :'newLicensesByDay',
91
97
  :'new_licenses_by_month' => :'newLicensesByMonth',
92
98
  :'new_licenses_by_policy' => :'newLicensesByPolicy',
99
+ :'cancellation' => :'cancellation',
100
+ :'subscriptions' => :'subscriptions',
93
101
  :'revenue' => :'revenue',
94
102
  :'activations_by_version' => :'activationsByVersion',
95
103
  :'active_machines_by_version' => :'activeMachinesByVersion',
@@ -125,6 +133,8 @@ module LicenseManager
125
133
  :'new_licenses_by_day' => :'Array<Integer>',
126
134
  :'new_licenses_by_month' => :'Array<Integer>',
127
135
  :'new_licenses_by_policy' => :'Array<ProductStatsNewLicensesByPolicyInner>',
136
+ :'cancellation' => :'CancellationStats',
137
+ :'subscriptions' => :'SubscriptionStats',
128
138
  :'revenue' => :'Array<Revenue>',
129
139
  :'activations_by_version' => :'Array<ProductStatsActivationsByVersionInner>',
130
140
  :'active_machines_by_version' => :'Array<ProductStatsActiveMachinesByVersionInner>',
@@ -135,6 +145,8 @@ module LicenseManager
135
145
  # List of attributes with nullable: true
136
146
  def self.openapi_nullable
137
147
  Set.new([
148
+ :'cancellation',
149
+ :'subscriptions',
138
150
  ])
139
151
  end
140
152
 
@@ -264,6 +276,18 @@ module LicenseManager
264
276
  self.new_licenses_by_policy = nil
265
277
  end
266
278
 
279
+ if attributes.key?(:'cancellation')
280
+ self.cancellation = attributes[:'cancellation']
281
+ else
282
+ self.cancellation = nil
283
+ end
284
+
285
+ if attributes.key?(:'subscriptions')
286
+ self.subscriptions = attributes[:'subscriptions']
287
+ else
288
+ self.subscriptions = nil
289
+ end
290
+
267
291
  if attributes.key?(:'revenue')
268
292
  if (value = attributes[:'revenue']).is_a?(Array)
269
293
  self.revenue = value
@@ -617,6 +641,8 @@ module LicenseManager
617
641
  new_licenses_by_day == o.new_licenses_by_day &&
618
642
  new_licenses_by_month == o.new_licenses_by_month &&
619
643
  new_licenses_by_policy == o.new_licenses_by_policy &&
644
+ cancellation == o.cancellation &&
645
+ subscriptions == o.subscriptions &&
620
646
  revenue == o.revenue &&
621
647
  activations_by_version == o.activations_by_version &&
622
648
  active_machines_by_version == o.active_machines_by_version &&
@@ -632,7 +658,7 @@ module LicenseManager
632
658
  # Calculates hash code according to all attributes.
633
659
  # @return [Integer] Hash code
634
660
  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
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
636
662
  end
637
663
 
638
664
  # Builds the object from hash