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
@@ -14,17 +14,23 @@ 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.
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`.
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.
22
+ # Number of licenses sold in the currency, free ones included, canceled ones 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.
25
+ # Sum of the prices of the licenses sold in the currency, in major units, canceled ones left out.
26
26
  attr_accessor :total
27
27
 
28
+ # Number of canceled licenses sold in the currency.
29
+ attr_accessor :canceled_license_count
30
+
31
+ # Sum of the prices of the canceled licenses sold in the currency, in major units: revenue lost to cancellations.
32
+ attr_accessor :canceled_total
33
+
28
34
  # Revenue of the current month, in UTC.
29
35
  attr_accessor :this_month
30
36
 
@@ -49,6 +55,8 @@ module LicenseManager
49
55
  :'currency' => :'currency',
50
56
  :'license_count' => :'licenseCount',
51
57
  :'total' => :'total',
58
+ :'canceled_license_count' => :'canceledLicenseCount',
59
+ :'canceled_total' => :'canceledTotal',
52
60
  :'this_month' => :'thisMonth',
53
61
  :'last_month' => :'lastMonth',
54
62
  :'last30_days' => :'last30Days',
@@ -74,6 +82,8 @@ module LicenseManager
74
82
  :'currency' => :'String',
75
83
  :'license_count' => :'Integer',
76
84
  :'total' => :'Float',
85
+ :'canceled_license_count' => :'Integer',
86
+ :'canceled_total' => :'Float',
77
87
  :'this_month' => :'Float',
78
88
  :'last_month' => :'Float',
79
89
  :'last30_days' => :'Float',
@@ -133,6 +143,18 @@ module LicenseManager
133
143
  self.total = nil
134
144
  end
135
145
 
146
+ if attributes.key?(:'canceled_license_count')
147
+ self.canceled_license_count = attributes[:'canceled_license_count']
148
+ else
149
+ self.canceled_license_count = nil
150
+ end
151
+
152
+ if attributes.key?(:'canceled_total')
153
+ self.canceled_total = attributes[:'canceled_total']
154
+ else
155
+ self.canceled_total = nil
156
+ end
157
+
136
158
  if attributes.key?(:'this_month')
137
159
  self.this_month = attributes[:'this_month']
138
160
  else
@@ -193,6 +215,14 @@ module LicenseManager
193
215
  invalid_properties.push('invalid value for "total", total cannot be nil.')
194
216
  end
195
217
 
218
+ if @canceled_license_count.nil?
219
+ invalid_properties.push('invalid value for "canceled_license_count", canceled_license_count cannot be nil.')
220
+ end
221
+
222
+ if @canceled_total.nil?
223
+ invalid_properties.push('invalid value for "canceled_total", canceled_total cannot be nil.')
224
+ end
225
+
196
226
  if @this_month.nil?
197
227
  invalid_properties.push('invalid value for "this_month", this_month cannot be nil.')
198
228
  end
@@ -227,6 +257,8 @@ module LicenseManager
227
257
  return false if @currency.nil?
228
258
  return false if @license_count.nil?
229
259
  return false if @total.nil?
260
+ return false if @canceled_license_count.nil?
261
+ return false if @canceled_total.nil?
230
262
  return false if @this_month.nil?
231
263
  return false if @last_month.nil?
232
264
  return false if @last30_days.nil?
@@ -266,6 +298,26 @@ module LicenseManager
266
298
  @total = total
267
299
  end
268
300
 
301
+ # Custom attribute writer method with validation
302
+ # @param [Object] canceled_license_count Value to be assigned
303
+ def canceled_license_count=(canceled_license_count)
304
+ if canceled_license_count.nil?
305
+ fail ArgumentError, 'canceled_license_count cannot be nil'
306
+ end
307
+
308
+ @canceled_license_count = canceled_license_count
309
+ end
310
+
311
+ # Custom attribute writer method with validation
312
+ # @param [Object] canceled_total Value to be assigned
313
+ def canceled_total=(canceled_total)
314
+ if canceled_total.nil?
315
+ fail ArgumentError, 'canceled_total cannot be nil'
316
+ end
317
+
318
+ @canceled_total = canceled_total
319
+ end
320
+
269
321
  # Custom attribute writer method with validation
270
322
  # @param [Object] this_month Value to be assigned
271
323
  def this_month=(this_month)
@@ -334,6 +386,8 @@ module LicenseManager
334
386
  currency == o.currency &&
335
387
  license_count == o.license_count &&
336
388
  total == o.total &&
389
+ canceled_license_count == o.canceled_license_count &&
390
+ canceled_total == o.canceled_total &&
337
391
  this_month == o.this_month &&
338
392
  last_month == o.last_month &&
339
393
  last30_days == o.last30_days &&
@@ -351,7 +405,7 @@ module LicenseManager
351
405
  # Calculates hash code according to all attributes.
352
406
  # @return [Integer] Hash code
353
407
  def hash
354
- [currency, license_count, total, this_month, last_month, last30_days, by_day, by_month, by_policy].hash
408
+ [currency, license_count, total, canceled_license_count, canceled_total, this_month, last_month, last30_days, by_day, by_month, by_policy].hash
355
409
  end
356
410
 
357
411
  # Builds the object from hash
@@ -21,7 +21,7 @@ module LicenseManager
21
21
  # Whether Stripe can reach the API's webhook URL. A local URL can't be: set `WEBHOOK_URL` on the server, like to a tunnel in development.
22
22
  attr_accessor :webhook_url_reachable
23
23
 
24
- # Permissions the restricted API key needs, and why. Every other permission can stay `None`.
24
+ # Permissions the restricted API key needs, and why, the `optional` ones included. Every other permission can stay `None`.
25
25
  attr_accessor :required_permissions
26
26
 
27
27
  # The organization's Stripe connection in this mode, `null` when there's none.
@@ -21,6 +21,9 @@ module LicenseManager
21
21
 
22
22
  attr_accessor :reason
23
23
 
24
+ # Whether the key can connect without it, losing what it's for, explained by `reason`.
25
+ attr_accessor :optional
26
+
24
27
  class EnumAttributeValidator
25
28
  attr_reader :datatype
26
29
  attr_reader :allowable_values
@@ -48,7 +51,8 @@ module LicenseManager
48
51
  {
49
52
  :'resource' => :'resource',
50
53
  :'access' => :'access',
51
- :'reason' => :'reason'
54
+ :'reason' => :'reason',
55
+ :'optional' => :'optional'
52
56
  }
53
57
  end
54
58
 
@@ -67,7 +71,8 @@ module LicenseManager
67
71
  {
68
72
  :'resource' => :'String',
69
73
  :'access' => :'String',
70
- :'reason' => :'String'
74
+ :'reason' => :'String',
75
+ :'optional' => :'Boolean'
71
76
  }
72
77
  end
73
78
 
@@ -120,6 +125,12 @@ module LicenseManager
120
125
  else
121
126
  self.reason = nil
122
127
  end
128
+
129
+ if attributes.key?(:'optional')
130
+ self.optional = attributes[:'optional']
131
+ else
132
+ self.optional = nil
133
+ end
123
134
  end
124
135
 
125
136
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -139,6 +150,10 @@ module LicenseManager
139
150
  invalid_properties.push('invalid value for "reason", reason cannot be nil.')
140
151
  end
141
152
 
153
+ if @optional.nil?
154
+ invalid_properties.push('invalid value for "optional", optional cannot be nil.')
155
+ end
156
+
142
157
  invalid_properties
143
158
  end
144
159
 
@@ -151,6 +166,7 @@ module LicenseManager
151
166
  access_validator = EnumAttributeValidator.new('String', ["Read", "Write", "unknown_default_open_api"])
152
167
  return false unless access_validator.valid?(@access)
153
168
  return false if @reason.nil?
169
+ return false if @optional.nil?
154
170
  true
155
171
  end
156
172
 
@@ -184,6 +200,16 @@ module LicenseManager
184
200
  @reason = reason
185
201
  end
186
202
 
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] optional Value to be assigned
205
+ def optional=(optional)
206
+ if optional.nil?
207
+ fail ArgumentError, 'optional cannot be nil'
208
+ end
209
+
210
+ @optional = optional
211
+ end
212
+
187
213
  # Checks equality by comparing each attribute.
188
214
  # @param [Object] Object to be compared
189
215
  def ==(o)
@@ -191,7 +217,8 @@ module LicenseManager
191
217
  self.class == o.class &&
192
218
  resource == o.resource &&
193
219
  access == o.access &&
194
- reason == o.reason
220
+ reason == o.reason &&
221
+ optional == o.optional
195
222
  end
196
223
 
197
224
  # @see the `==` method
@@ -203,7 +230,7 @@ module LicenseManager
203
230
  # Calculates hash code according to all attributes.
204
231
  # @return [Integer] Hash code
205
232
  def hash
206
- [resource, access, reason].hash
233
+ [resource, access, reason, optional].hash
207
234
  end
208
235
 
209
236
  # Builds the object from hash
@@ -0,0 +1,161 @@
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 UpdateIntegration < ApiModelBase
18
+ # Whether canceling a license bought through Stripe refunds its payment. Can only be turned on when the integration's `canRefund` is true: the API key has the Refunds: Write permission.
19
+ attr_accessor :auto_refund
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'auto_refund' => :'autoRefund'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'auto_refund' => :'Boolean'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Returns attribute type mapping
52
+ def self.acceptable_openapi_types
53
+ openapi_types
54
+ end
55
+
56
+ # Returns the nullable attributes
57
+ def self.acceptable_openapi_nullable
58
+ openapi_nullable
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `LicenseManager::UpdateIntegration` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `LicenseManager::UpdateIntegration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'auto_refund')
78
+ self.auto_refund = attributes[:'auto_refund']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ auto_refund == o.auto_refund
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [auto_refund].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ # include attributes inherited from allOf parents (the nearest declaration wins)
124
+ map = acceptable_attribute_map
125
+ transformed_hash = {}
126
+ acceptable_openapi_types.each_pair do |key, type|
127
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
134
+ end
135
+ elsif !attributes[map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
137
+ end
138
+ end
139
+ new(transformed_hash)
140
+ end
141
+
142
+ # Returns the object in the form of hash
143
+ # @return [Hash] Returns the object in the form of hash
144
+ def to_hash
145
+ hash = {}
146
+ # include attributes inherited from allOf parents (the nearest declaration wins)
147
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
148
+ value = self.send(attr)
149
+ if value.nil?
150
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
151
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
152
+ end
153
+
154
+ hash[param] = _to_hash(value)
155
+ end
156
+ hash
157
+ end
158
+
159
+ end
160
+
161
+ end
@@ -32,6 +32,9 @@ module LicenseManager
32
32
 
33
33
  attr_accessor :price
34
34
 
35
+ # End of the money back guarantee: until then, the customer can cancel the license from the customer portal, or with a token. `null` to not let them.
36
+ attr_accessor :cancellable_until
37
+
35
38
  # Attribute mapping from ruby-style variable name to JSON key.
36
39
  def self.attribute_map
37
40
  {
@@ -40,7 +43,8 @@ module LicenseManager
40
43
  :'max_machines' => :'maxMachines',
41
44
  :'max_offline_duration_seconds' => :'maxOfflineDurationSeconds',
42
45
  :'max_version' => :'maxVersion',
43
- :'price' => :'price'
46
+ :'price' => :'price',
47
+ :'cancellable_until' => :'cancellableUntil'
44
48
  }
45
49
  end
46
50
 
@@ -62,7 +66,8 @@ module LicenseManager
62
66
  :'max_machines' => :'Integer',
63
67
  :'max_offline_duration_seconds' => :'Integer',
64
68
  :'max_version' => :'LicenseMaxVersionInput',
65
- :'price' => :'PriceInput'
69
+ :'price' => :'PriceInput',
70
+ :'cancellable_until' => :'Time'
66
71
  }
67
72
  end
68
73
 
@@ -72,7 +77,8 @@ module LicenseManager
72
77
  :'expires_at',
73
78
  :'meta',
74
79
  :'max_machines',
75
- :'price'
80
+ :'price',
81
+ :'cancellable_until'
76
82
  ])
77
83
  end
78
84
 
@@ -127,6 +133,10 @@ module LicenseManager
127
133
  if attributes.key?(:'price')
128
134
  self.price = attributes[:'price']
129
135
  end
136
+
137
+ if attributes.key?(:'cancellable_until')
138
+ self.cancellable_until = attributes[:'cancellable_until']
139
+ end
130
140
  end
131
141
 
132
142
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -206,7 +216,8 @@ module LicenseManager
206
216
  max_machines == o.max_machines &&
207
217
  max_offline_duration_seconds == o.max_offline_duration_seconds &&
208
218
  max_version == o.max_version &&
209
- price == o.price
219
+ price == o.price &&
220
+ cancellable_until == o.cancellable_until
210
221
  end
211
222
 
212
223
  # @see the `==` method
@@ -218,7 +229,7 @@ module LicenseManager
218
229
  # Calculates hash code according to all attributes.
219
230
  # @return [Integer] Hash code
220
231
  def hash
221
- [expires_at, meta, max_machines, max_offline_duration_seconds, max_version, price].hash
232
+ [expires_at, meta, max_machines, max_offline_duration_seconds, max_version, price, cancellable_until].hash
222
233
  end
223
234
 
224
235
  # Builds the object from hash
@@ -33,6 +33,9 @@ module LicenseManager
33
33
 
34
34
  attr_accessor :max_version
35
35
 
36
+ # 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`.
37
+ attr_accessor :money_back_guarantee_days
38
+
36
39
  # Attribute mapping from ruby-style variable name to JSON key.
37
40
  def self.attribute_map
38
41
  {
@@ -42,7 +45,8 @@ module LicenseManager
42
45
  :'duration' => :'duration',
43
46
  :'max_machines' => :'maxMachines',
44
47
  :'max_offline_duration_seconds' => :'maxOfflineDurationSeconds',
45
- :'max_version' => :'maxVersion'
48
+ :'max_version' => :'maxVersion',
49
+ :'money_back_guarantee_days' => :'moneyBackGuaranteeDays'
46
50
  }
47
51
  end
48
52
 
@@ -65,7 +69,8 @@ module LicenseManager
65
69
  :'duration' => :'PolicySettingsDuration',
66
70
  :'max_machines' => :'Integer',
67
71
  :'max_offline_duration_seconds' => :'Integer',
68
- :'max_version' => :'PolicySettingsMaxVersion'
72
+ :'max_version' => :'PolicySettingsMaxVersion',
73
+ :'money_back_guarantee_days' => :'Integer'
69
74
  }
70
75
  end
71
76
 
@@ -74,7 +79,8 @@ module LicenseManager
74
79
  Set.new([
75
80
  :'duration',
76
81
  :'max_machines',
77
- :'max_version'
82
+ :'max_version',
83
+ :'money_back_guarantee_days'
78
84
  ])
79
85
  end
80
86
 
@@ -131,6 +137,10 @@ module LicenseManager
131
137
  if attributes.key?(:'max_version')
132
138
  self.max_version = attributes[:'max_version']
133
139
  end
140
+
141
+ if attributes.key?(:'money_back_guarantee_days')
142
+ self.money_back_guarantee_days = attributes[:'money_back_guarantee_days']
143
+ end
134
144
  end
135
145
 
136
146
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -175,6 +185,14 @@ module LicenseManager
175
185
  invalid_properties.push('invalid value for "max_offline_duration_seconds", must be greater than or equal to 3600.')
176
186
  end
177
187
 
188
+ if !@money_back_guarantee_days.nil? && @money_back_guarantee_days > 3650
189
+ invalid_properties.push('invalid value for "money_back_guarantee_days", must be smaller than or equal to 3650.')
190
+ end
191
+
192
+ if !@money_back_guarantee_days.nil? && @money_back_guarantee_days <= 0
193
+ invalid_properties.push('invalid value for "money_back_guarantee_days", must be greater than 0.')
194
+ end
195
+
178
196
  invalid_properties
179
197
  end
180
198
 
@@ -191,6 +209,8 @@ module LicenseManager
191
209
  return false if !@max_machines.nil? && @max_machines <= 0
192
210
  return false if !@max_offline_duration_seconds.nil? && @max_offline_duration_seconds > 2147483647
193
211
  return false if !@max_offline_duration_seconds.nil? && @max_offline_duration_seconds < 3600
212
+ return false if !@money_back_guarantee_days.nil? && @money_back_guarantee_days > 3650
213
+ return false if !@money_back_guarantee_days.nil? && @money_back_guarantee_days <= 0
194
214
  true
195
215
  end
196
216
 
@@ -267,6 +287,20 @@ module LicenseManager
267
287
  @max_offline_duration_seconds = max_offline_duration_seconds
268
288
  end
269
289
 
290
+ # Custom attribute writer method with validation
291
+ # @param [Object] money_back_guarantee_days Value to be assigned
292
+ def money_back_guarantee_days=(money_back_guarantee_days)
293
+ if !money_back_guarantee_days.nil? && money_back_guarantee_days > 3650
294
+ fail ArgumentError, 'invalid value for "money_back_guarantee_days", must be smaller than or equal to 3650.'
295
+ end
296
+
297
+ if !money_back_guarantee_days.nil? && money_back_guarantee_days <= 0
298
+ fail ArgumentError, 'invalid value for "money_back_guarantee_days", must be greater than 0.'
299
+ end
300
+
301
+ @money_back_guarantee_days = money_back_guarantee_days
302
+ end
303
+
270
304
  # Checks equality by comparing each attribute.
271
305
  # @param [Object] Object to be compared
272
306
  def ==(o)
@@ -278,7 +312,8 @@ module LicenseManager
278
312
  duration == o.duration &&
279
313
  max_machines == o.max_machines &&
280
314
  max_offline_duration_seconds == o.max_offline_duration_seconds &&
281
- max_version == o.max_version
315
+ max_version == o.max_version &&
316
+ money_back_guarantee_days == o.money_back_guarantee_days
282
317
  end
283
318
 
284
319
  # @see the `==` method
@@ -290,7 +325,7 @@ module LicenseManager
290
325
  # Calculates hash code according to all attributes.
291
326
  # @return [Integer] Hash code
292
327
  def hash
293
- [name, slug, is_default, duration, max_machines, max_offline_duration_seconds, max_version].hash
328
+ [name, slug, is_default, duration, max_machines, max_offline_duration_seconds, max_version, money_back_guarantee_days].hash
294
329
  end
295
330
 
296
331
  # Builds the object from hash
@@ -22,12 +22,16 @@ module LicenseManager
22
22
 
23
23
  attr_accessor :portal
24
24
 
25
+ # 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`.
26
+ attr_accessor :auto_machine_change
27
+
25
28
  # Attribute mapping from ruby-style variable name to JSON key.
26
29
  def self.attribute_map
27
30
  {
28
31
  :'name' => :'name',
29
32
  :'slug' => :'slug',
30
- :'portal' => :'portal'
33
+ :'portal' => :'portal',
34
+ :'auto_machine_change' => :'autoMachineChange'
31
35
  }
32
36
  end
33
37
 
@@ -46,7 +50,8 @@ module LicenseManager
46
50
  {
47
51
  :'name' => :'String',
48
52
  :'slug' => :'String',
49
- :'portal' => :'UpdateProductPortal'
53
+ :'portal' => :'UpdateProductPortal',
54
+ :'auto_machine_change' => :'Boolean'
50
55
  }
51
56
  end
52
57
 
@@ -93,6 +98,10 @@ module LicenseManager
93
98
  if attributes.key?(:'portal')
94
99
  self.portal = attributes[:'portal']
95
100
  end
101
+
102
+ if attributes.key?(:'auto_machine_change')
103
+ self.auto_machine_change = attributes[:'auto_machine_change']
104
+ end
96
105
  end
97
106
 
98
107
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -184,7 +193,8 @@ module LicenseManager
184
193
  self.class == o.class &&
185
194
  name == o.name &&
186
195
  slug == o.slug &&
187
- portal == o.portal
196
+ portal == o.portal &&
197
+ auto_machine_change == o.auto_machine_change
188
198
  end
189
199
 
190
200
  # @see the `==` method
@@ -196,7 +206,7 @@ module LicenseManager
196
206
  # Calculates hash code according to all attributes.
197
207
  # @return [Integer] Hash code
198
208
  def hash
199
- [name, slug, portal].hash
209
+ [name, slug, portal, auto_machine_change].hash
200
210
  end
201
211
 
202
212
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.26.0
11
11
  =end
12
12
 
13
13
  module LicenseManager
14
- VERSION = '0.1.1'
14
+ VERSION = '0.2.0'
15
15
  end
@@ -18,6 +18,10 @@ require 'license_manager/version'
18
18
  require 'license_manager/configuration'
19
19
 
20
20
  # Models
21
+ require 'license_manager/models/cancel_license'
22
+ require 'license_manager/models/cancellation_reason'
23
+ require 'license_manager/models/cancellation_stats'
24
+ require 'license_manager/models/cancellation_stats_by_reason_inner'
21
25
  require 'license_manager/models/connect_stripe'
22
26
  require 'license_manager/models/create_customer'
23
27
  require 'license_manager/models/create_integration_mapping'
@@ -101,6 +105,7 @@ require 'license_manager/models/stripe_permission'
101
105
  require 'license_manager/models/stripe_price'
102
106
  require 'license_manager/models/token'
103
107
  require 'license_manager/models/update_customer'
108
+ require 'license_manager/models/update_integration'
104
109
  require 'license_manager/models/update_integration_mapping'
105
110
  require 'license_manager/models/update_license'
106
111
  require 'license_manager/models/update_policy'