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
@@ -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.3.0'
15
15
  end
@@ -18,7 +18,13 @@ require 'license_manager/version'
18
18
  require 'license_manager/configuration'
19
19
 
20
20
  # Models
21
+ require 'license_manager/models/billing_portal_session'
22
+ require 'license_manager/models/cancel_license'
23
+ require 'license_manager/models/cancellation_reason'
24
+ require 'license_manager/models/cancellation_stats'
25
+ require 'license_manager/models/cancellation_stats_by_reason_inner'
21
26
  require 'license_manager/models/connect_stripe'
27
+ require 'license_manager/models/create_billing_portal_session'
22
28
  require 'license_manager/models/create_customer'
23
29
  require 'license_manager/models/create_integration_mapping'
24
30
  require 'license_manager/models/create_license'
@@ -47,6 +53,7 @@ require 'license_manager/models/event_type'
47
53
  require 'license_manager/models/fixed_max_version'
48
54
  require 'license_manager/models/integration'
49
55
  require 'license_manager/models/integration_mapping'
56
+ require 'license_manager/models/integration_mapping_recurring'
50
57
  require 'license_manager/models/integration_status'
51
58
  require 'license_manager/models/license'
52
59
  require 'license_manager/models/license_list'
@@ -56,6 +63,7 @@ require 'license_manager/models/license_stats'
56
63
  require 'license_manager/models/license_stats_activations_by_machine_inner'
57
64
  require 'license_manager/models/license_stats_activations_by_version_inner'
58
65
  require 'license_manager/models/license_status'
66
+ require 'license_manager/models/license_subscription'
59
67
  require 'license_manager/models/license_token'
60
68
  require 'license_manager/models/list_policy_events_type_parameter'
61
69
  require 'license_manager/models/list_stripe_prices200_response'
@@ -66,6 +74,9 @@ require 'license_manager/models/lock_max_version_major_after_one_of1'
66
74
  require 'license_manager/models/lock_max_version_minor_after'
67
75
  require 'license_manager/models/machine'
68
76
  require 'license_manager/models/machine_list'
77
+ require 'license_manager/models/mrr'
78
+ require 'license_manager/models/mrr_by_interval_inner'
79
+ require 'license_manager/models/mrr_by_policy_inner'
69
80
  require 'license_manager/models/pagination'
70
81
  require 'license_manager/models/policy'
71
82
  require 'license_manager/models/policy_duration'
@@ -99,8 +110,11 @@ require 'license_manager/models/signing_key'
99
110
  require 'license_manager/models/stripe_integration'
100
111
  require 'license_manager/models/stripe_permission'
101
112
  require 'license_manager/models/stripe_price'
113
+ require 'license_manager/models/stripe_price_recurring'
114
+ require 'license_manager/models/subscription_stats'
102
115
  require 'license_manager/models/token'
103
116
  require 'license_manager/models/update_customer'
117
+ require 'license_manager/models/update_integration'
104
118
  require 'license_manager/models/update_integration_mapping'
105
119
  require 'license_manager/models/update_license'
106
120
  require 'license_manager/models/update_policy'