license_manager 0.1.0 → 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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +99 -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/license_manager.gemspec +1 -1
  68. data/openapi.json +566 -32
  69. data/spec/api/integrations_api_spec.rb +13 -0
  70. data/spec/api/licenses_api_spec.rb +16 -3
  71. data/spec/api/machines_api_spec.rb +1 -1
  72. data/spec/api/portal_api_spec.rb +1 -1
  73. data/spec/api/products_api_spec.rb +2 -2
  74. data/spec/models/cancel_license_spec.rb +48 -0
  75. data/spec/models/cancellation_reason_spec.rb +30 -0
  76. data/spec/models/cancellation_stats_by_reason_inner_spec.rb +42 -0
  77. data/spec/models/cancellation_stats_spec.rb +72 -0
  78. data/spec/models/create_license_spec.rb +6 -0
  79. data/spec/models/create_policy_spec.rb +6 -0
  80. data/spec/models/create_token_spec.rb +1 -1
  81. data/spec/models/integration_spec.rb +12 -0
  82. data/spec/models/license_spec.rb +30 -0
  83. data/spec/models/machine_spec.rb +7 -1
  84. data/spec/models/policy_settings_spec.rb +6 -0
  85. data/spec/models/policy_spec.rb +6 -0
  86. data/spec/models/product_spec.rb +6 -0
  87. data/spec/models/product_stats_spec.rb +6 -0
  88. data/spec/models/revenue_spec.rb +12 -0
  89. data/spec/models/stripe_permission_spec.rb +6 -0
  90. data/spec/models/token_spec.rb +1 -1
  91. data/spec/models/update_integration_spec.rb +36 -0
  92. data/spec/models/update_license_spec.rb +6 -0
  93. data/spec/models/update_policy_spec.rb +6 -0
  94. data/spec/models/update_product_spec.rb +6 -0
  95. metadata +23 -2
@@ -8,6 +8,7 @@
8
8
  | **max_machines** | **Integer** | Maximum number of active machines of the licenses created with this policy, copied to each of them. `null` for no limit. Defaults to `null`. | [optional] |
9
9
  | **max_offline_duration_seconds** | **Integer** | Longest the applications can run offline with the licenses created with this policy, in seconds, copied to each of them. At least one hour (`3600`). Defaults to one week. | [optional] |
10
10
  | **max_version** | [**PolicySettingsMaxVersion**](PolicySettingsMaxVersion.md) | | [optional] |
11
+ | **money_back_guarantee_days** | **Integer** | 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`. | [optional] |
11
12
 
12
13
  ## Example
13
14
 
@@ -18,7 +19,8 @@ instance = LicenseManager::PolicySettings.new(
18
19
  duration: null,
19
20
  max_machines: 3,
20
21
  max_offline_duration_seconds: 604800,
21
- max_version: null
22
+ max_version: null,
23
+ money_back_guarantee_days: 30
22
24
  )
23
25
  ```
24
26
 
data/docs/PortalApi.md CHANGED
@@ -16,7 +16,7 @@ All URIs are relative to *https://api.licensemanager.dev*
16
16
 
17
17
  Create a link to the customer portal
18
18
 
19
- Link letting the customer see their licenses and deactivate their machines in the customer portal, without signing in. Anyone with the link can, until it expires or the customer is deleted: it can't be revoked otherwise. The token also works with the API endpoints that accept customer tokens. Links can be created while the product's customer portal is disabled, but the portal answers `404` until it's enabled, and `sendPortalLink` refuses to email them. **Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
19
+ Link letting the customer see their licenses, cancel them during their money back guarantee, and deactivate their machines in the customer portal, without signing in. Anyone with the link can, until it expires or the customer is deleted: it can't be revoked otherwise. The token also works with the API endpoints that accept customer tokens. Links can be created while the product's customer portal is disabled, but the portal answers `404` until it's enabled, and `sendPortalLink` refuses to email them. **Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
20
20
 
21
21
  ### Examples
22
22
 
data/docs/PortalLink.md CHANGED
@@ -5,7 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **url** | **String** | Link to the customer portal, holding the token. | |
8
- | **token** | **String** | Customer token in the link, with the `customer:read`, `license:read` and `machine:write` permissions. | |
8
+ | **token** | **String** | Customer token in the link, with the `customer:read`, `license:read`, `license:cancel` and `machine:write` permissions. | |
9
9
  | **expires_at** | **Time** | When the link stops working. | |
10
10
 
11
11
  ## Example
@@ -14,7 +14,7 @@
14
14
  require 'license_manager'
15
15
 
16
16
  instance = LicenseManager::PortalLink.new(
17
- url: https://app.example.com/portal/x7Kp2QaZ?token=eyJhbGciOi…,
17
+ url: https://app.licensemanager.dev/portal/x7Kp2QaZ?token=eyJhbGciOi…,
18
18
  token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…,
19
19
  expires_at: 2026-01-22T09:30:00.000Z
20
20
  )
data/docs/Product.md CHANGED
@@ -10,6 +10,7 @@
10
10
  | **is_test_from_product_id** | **String** | For test products, id of the live product they're a sandbox of. `null` for live products. | |
11
11
  | **logo_url** | **String** | Public URL of the product's logo, shown in the web app and the customer portal. `null` without a logo. | |
12
12
  | **portal** | [**PortalSettings**](PortalSettings.md) | | |
13
+ | **auto_machine_change** | **Boolean** | 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`. | |
13
14
  | **created_at** | **Time** | | |
14
15
  | **updated_at** | **Time** | | |
15
16
 
@@ -25,6 +26,7 @@ instance = LicenseManager::Product.new(
25
26
  is_test_from_product_id: null,
26
27
  logo_url: https://cdn.example.com/logos/x7Kp2QaZ/k3f9a2LpQ7xw.webp,
27
28
  portal: null,
29
+ auto_machine_change: true,
28
30
  created_at: 2026-01-15T09:30:00.000Z,
29
31
  updated_at: 2026-01-15T09:30:00.000Z
30
32
  )
data/docs/ProductStats.md CHANGED
@@ -5,13 +5,13 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **license_count** | **Integer** | Number of licenses of the product. | |
8
- | **active_license_count** | **Integer** | Number of licenses that haven't expired, and that a machine validated in the last 90 days. | |
8
+ | **active_license_count** | **Integer** | Number of licenses that haven't expired nor were canceled, and that a machine validated in the last 90 days. | |
9
9
  | **new_license_count** | **Integer** | Number of licenses created in the last 30 days, today included, in UTC. | |
10
- | **expiring_license_count** | **Integer** | Number of licenses expiring in the next 30 days. | |
11
- | **expired_license_count** | **Integer** | Number of licenses that expired in the last 30 days. | |
10
+ | **expiring_license_count** | **Integer** | Number of licenses expiring in the next 30 days, canceled ones left out. | |
11
+ | **expired_license_count** | **Integer** | Number of licenses that expired in the last 30 days, canceled ones left out. | |
12
12
  | **active_machine_count** | **Integer** | Number of active machines of the licenses of the product. | |
13
13
  | **in_use_license_count** | **Integer** | Number of licenses with at least one active machine. | |
14
- | **seat_count** | **Integer** | Sum of the maximum numbers of machines of the licenses that haven't expired. Licenses without a maximum are left out. | |
14
+ | **seat_count** | **Integer** | Sum of the maximum numbers of machines of the licenses that haven't expired nor were canceled. Licenses without a maximum are left out. | |
15
15
  | **used_seat_count** | **Integer** | Number of active machines of the licenses counted in `seatCount`, at most their maximum number of machines each. | |
16
16
  | **full_license_count** | **Integer** | Number of licenses counted in `seatCount` active on their maximum number of machines. | |
17
17
  | **days** | **Array<Date>** | The 30 days covered by the daily stats, from the oldest one, in UTC. | |
@@ -19,6 +19,7 @@
19
19
  | **new_licenses_by_day** | **Array<Integer>** | Number of licenses created each day, aligned on `days`. | |
20
20
  | **new_licenses_by_month** | **Array<Integer>** | Number of licenses created each month, aligned on `months`. | |
21
21
  | **new_licenses_by_policy** | [**Array<ProductStatsNewLicensesByPolicyInner>**](ProductStatsNewLicensesByPolicyInner.md) | Number of licenses of each policy created each day and each month, for the policies with licenses created over the covered months. | |
22
+ | **cancellation** | [**CancellationStats**](CancellationStats.md) | Cancellations of the licenses with a money back guarantee. `null` when no license of the product has one. | |
22
23
  | **revenue** | [**Array<Revenue>**](Revenue.md) | Revenue in each currency licenses were sold in, from the one with the most licenses sold. Amounts aren't converted between currencies. | |
23
24
  | **activations_by_version** | [**Array<ProductStatsActivationsByVersionInner>**](ProductStatsActivationsByVersionInner.md) | Successful activations of the licenses of the product each day, per version of the application, from the most recent one. | |
24
25
  | **active_machines_by_version** | [**Array<ProductStatsActiveMachinesByVersionInner>**](ProductStatsActiveMachinesByVersionInner.md) | Number of active machines running each version of the application, from the most recent one. | |
@@ -45,6 +46,7 @@ instance = LicenseManager::ProductStats.new(
45
46
  new_licenses_by_day: [0, 2, 1],
46
47
  new_licenses_by_month: [4, 9, 12],
47
48
  new_licenses_by_policy: null,
49
+ cancellation: null,
48
50
  revenue: null,
49
51
  activations_by_version: null,
50
52
  active_machines_by_version: null,
data/docs/ProductsApi.md CHANGED
@@ -21,7 +21,7 @@ All URIs are relative to *https://api.licensemanager.dev*
21
21
 
22
22
  Create a product
23
23
 
24
- Without a `slug`, the product gets one derived from its name: lower cased, without accents and special characters (`Élan Pro 2!` becomes `elan-pro-2`). When another product of the organization already uses it, a dash and 3 random lowercase letters or digits are appended (`elan-pro-2-k3f`), until the slug is free. An explicit `slug` is used as is: the request fails with a `409` when it's taken, it's never changed. Slug uniqueness is enforced by the database, so when concurrent requests end up with the same slug, only one succeeds and the others get a `409`, even without an explicit `slug`. Retrying such a request without a `slug` derives a new one. The product is created with its default policy, named `Default policy` with the `default` slug, whose settings are given by `defaultPolicy`. Omitted settings default to licenses that never expire, on a single machine, offline for one week, for every version of the product. Unlike `createPolicy`, where `maxMachines` defaults to no limit. With `isTestFromProductId`, the product is a test product: its id, its slug, and the ids, slugs and license keys of its resources start with `test_` (`TEST-` for license keys), and only test API keys reach it. It starts with copies of the policies, releases and portal settings of the live product, `defaultPolicy` is ignored. Later changes to the live product aren't copied: reset the test product to copy them again. Test API keys can only create test products, live API keys only live ones. **Required role permission**: `product:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
+ Without a `slug`, the product gets one derived from its name: lower cased, without accents and special characters (`Élan Pro 2!` becomes `elan-pro-2`). When another product of the organization already uses it, a dash and 3 random lowercase letters or digits are appended (`elan-pro-2-k3f`), until the slug is free. An explicit `slug` is used as is: the request fails with a `409` when it's taken, it's never changed. Slug uniqueness is enforced by the database, so when concurrent requests end up with the same slug, only one succeeds and the others get a `409`, even without an explicit `slug`. Retrying such a request without a `slug` derives a new one. The product is created with its default policy, named `Default policy` with the `default` slug, whose settings are given by `defaultPolicy`. Omitted settings default to licenses that never expire, on a single machine, offline for one week, for every version of the product. Unlike `createPolicy`, where `maxMachines` defaults to no limit. With `isTestFromProductId`, the product is a test product: its id, its slug, and the ids, slugs and license keys of its resources start with `test_` (`TEST-` for license keys), and only test API keys reach it. It starts with copies of the policies, releases, portal settings and `autoMachineChange` of the live product, `defaultPolicy` is ignored. Later changes to the live product aren't copied: reset the test product to copy them again. Test API keys can only create test products, live API keys only live ones. **Required role permission**: `product:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
25
25
 
26
26
  ### Examples
27
27
 
@@ -454,7 +454,7 @@ end
454
454
 
455
455
  Reset a test product
456
456
 
457
- Deletes the customers, licenses, machines, policies and releases of the test product, with their events, then copies the policies, releases and portal settings of its live product again. Its id, name and slug are kept, but the copied policies get new ids. The tokens of its customers, licenses and machines stop working. **Required role permission**: `product:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
457
+ Deletes the customers, licenses, machines, policies and releases of the test product, with their events, then copies the policies, releases, portal settings and `autoMachineChange` of its live product again. Its id, name and slug are kept, but the copied policies get new ids. The tokens of its customers, licenses and machines stop working. **Required role permission**: `product:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
458
458
 
459
459
  ### Examples
460
460
 
data/docs/Revenue.md CHANGED
@@ -5,8 +5,10 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **currency** | **String** | ISO 4217 code of the currency of the revenue. | |
8
- | **license_count** | **Integer** | Number of licenses sold in the currency, free ones included. | |
9
- | **total** | **Float** | Sum of the prices of the licenses sold in the currency, in major units. | |
8
+ | **license_count** | **Integer** | Number of licenses sold in the currency, free ones included, canceled ones left out. | |
9
+ | **total** | **Float** | Sum of the prices of the licenses sold in the currency, in major units, canceled ones left out. | |
10
+ | **canceled_license_count** | **Integer** | Number of canceled licenses sold in the currency. | |
11
+ | **canceled_total** | **Float** | Sum of the prices of the canceled licenses sold in the currency, in major units: revenue lost to cancellations. | |
10
12
  | **this_month** | **Float** | Revenue of the current month, in UTC. | |
11
13
  | **last_month** | **Float** | Revenue of the previous month, in UTC. | |
12
14
  | **last30_days** | **Float** | Revenue of the last 30 days, today included, in UTC. | |
@@ -23,6 +25,8 @@ instance = LicenseManager::Revenue.new(
23
25
  currency: USD,
24
26
  license_count: 42,
25
27
  total: 2099.58,
28
+ canceled_license_count: 2,
29
+ canceled_total: 99.98,
26
30
  this_month: 349.93,
27
31
  last_month: 299.94,
28
32
  last30_days: 399.92,
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **livemode** | **Boolean** | Mode of the Stripe connection the product uses: live for live products, test for test products. | |
8
8
  | **webhook_url_reachable** | **Boolean** | 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. | |
9
- | **required_permissions** | [**Array<StripePermission>**](StripePermission.md) | Permissions the restricted API key needs, and why. Every other permission can stay `None`. | |
9
+ | **required_permissions** | [**Array<StripePermission>**](StripePermission.md) | Permissions the restricted API key needs, and why, the `optional` ones included. Every other permission can stay `None`. | |
10
10
  | **integration** | [**Integration**](Integration.md) | The organization's Stripe connection in this mode, `null` when there's none. | |
11
11
  | **mappings** | [**Array<IntegrationMapping>**](IntegrationMapping.md) | Stripe prices creating licenses of the product. | |
12
12
 
@@ -7,6 +7,7 @@
7
7
  | **resource** | **String** | | |
8
8
  | **access** | **String** | | |
9
9
  | **reason** | **String** | | |
10
+ | **optional** | **Boolean** | Whether the key can connect without it, losing what it's for, explained by `reason`. | |
10
11
 
11
12
  ## Example
12
13
 
@@ -16,7 +17,8 @@ require 'license_manager'
16
17
  instance = LicenseManager::StripePermission.new(
17
18
  resource: Prices,
18
19
  access: null,
19
- reason: Lists your prices so you can choose which ones create licenses, and checks they can still be paid.
20
+ reason: Lists your prices so you can choose which ones create licenses, and checks they can still be paid.,
21
+ optional: false
20
22
  )
21
23
  ```
22
24
 
@@ -0,0 +1,18 @@
1
+ # LicenseManager::UpdateIntegration
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **auto_refund** | **Boolean** | 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. | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'license_manager'
13
+
14
+ instance = LicenseManager::UpdateIntegration.new(
15
+ auto_refund: false
16
+ )
17
+ ```
18
+
@@ -10,6 +10,7 @@
10
10
  | **max_offline_duration_seconds** | **Integer** | Longest the applications can run offline with the license, in seconds. At least one hour (`3600`). | [optional] |
11
11
  | **max_version** | [**LicenseMaxVersionInput**](LicenseMaxVersionInput.md) | Latest version of the product the license can use. The values left out are kept. | [optional] |
12
12
  | **price** | [**PriceInput**](PriceInput.md) | | [optional] |
13
+ | **cancellable_until** | **Time** | 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. | [optional] |
13
14
 
14
15
  ## Example
15
16
 
@@ -22,7 +23,8 @@ instance = LicenseManager::UpdateLicense.new(
22
23
  max_machines: 3,
23
24
  max_offline_duration_seconds: 604800,
24
25
  max_version: null,
25
- price: null
26
+ price: null,
27
+ cancellable_until: 2026-02-14T09:30:00.000Z
26
28
  )
27
29
  ```
28
30
 
data/docs/UpdatePolicy.md CHANGED
@@ -11,6 +11,7 @@
11
11
  | **max_machines** | **Integer** | Maximum number of active machines of the licenses created with this policy, copied to each of them. `null` for no limit. Defaults to `null`. | [optional] |
12
12
  | **max_offline_duration_seconds** | **Integer** | Longest the applications can run offline with the licenses created with this policy, in seconds, copied to each of them. At least one hour (`3600`). Defaults to one week. | [optional] |
13
13
  | **max_version** | [**PolicySettingsMaxVersion**](PolicySettingsMaxVersion.md) | | [optional] |
14
+ | **money_back_guarantee_days** | **Integer** | 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`. | [optional] |
14
15
 
15
16
  ## Example
16
17
 
@@ -24,7 +25,8 @@ instance = LicenseManager::UpdatePolicy.new(
24
25
  duration: null,
25
26
  max_machines: 3,
26
27
  max_offline_duration_seconds: 604800,
27
- max_version: null
28
+ max_version: null,
29
+ money_back_guarantee_days: 30
28
30
  )
29
31
  ```
30
32
 
@@ -7,6 +7,7 @@
7
7
  | **name** | **String** | | [optional] |
8
8
  | **slug** | **String** | Unique within the organization. Defaults to the name, lower cased, without accents and special characters. Starts with `test_` in test products, which is added when missing, and removed in live products. | [optional] |
9
9
  | **portal** | [**UpdateProductPortal**](UpdateProductPortal.md) | | [optional] |
10
+ | **auto_machine_change** | **Boolean** | 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`. | [optional] |
10
11
 
11
12
  ## Example
12
13
 
@@ -16,7 +17,8 @@ require 'license_manager'
16
17
  instance = LicenseManager::UpdateProduct.new(
17
18
  name: Acme Pro,
18
19
  slug: acme-pro,
19
- portal: null
20
+ portal: null,
21
+ auto_machine_change: true
20
22
  )
21
23
  ```
22
24
 
@@ -482,6 +482,80 @@ module LicenseManager
482
482
  return data, status_code, headers
483
483
  end
484
484
 
485
+ # Update an integration
486
+ # Changes the settings of the integration, for every product of its mode. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
487
+ # @param id [String]
488
+ # @param update_integration [UpdateIntegration]
489
+ # @param [Hash] opts the optional parameters
490
+ # @return [Integration]
491
+ def update_integration(id, update_integration, opts = {})
492
+ data, _status_code, _headers = update_integration_with_http_info(id, update_integration, opts)
493
+ data
494
+ end
495
+
496
+ # Update an integration
497
+ # Changes the settings of the integration, for every product of its mode. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
498
+ # @param id [String]
499
+ # @param update_integration [UpdateIntegration]
500
+ # @param [Hash] opts the optional parameters
501
+ # @return [Array<(Integration, Integer, Hash)>] Integration data, response status code and response headers
502
+ def update_integration_with_http_info(id, update_integration, opts = {})
503
+ if @api_client.config.debugging
504
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.update_integration ...'
505
+ end
506
+ # verify the required parameter 'id' is set
507
+ if @api_client.config.client_side_validation && id.nil?
508
+ fail ArgumentError, "Missing the required parameter 'id' when calling IntegrationsApi.update_integration"
509
+ end
510
+ # verify the required parameter 'update_integration' is set
511
+ if @api_client.config.client_side_validation && update_integration.nil?
512
+ fail ArgumentError, "Missing the required parameter 'update_integration' when calling IntegrationsApi.update_integration"
513
+ end
514
+ # resource path
515
+ local_var_path = '/v1/integrations/{id}'.sub('{id}', CGI.escape(id.to_s))
516
+
517
+ # query parameters
518
+ query_params = opts[:query_params] || {}
519
+
520
+ # header parameters
521
+ header_params = opts[:header_params] || {}
522
+ # HTTP header 'Accept' (if needed)
523
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
524
+ # HTTP header 'Content-Type'
525
+ content_type = @api_client.select_header_content_type(['application/json'])
526
+ if !content_type.nil?
527
+ header_params['Content-Type'] = content_type
528
+ end
529
+
530
+ # form parameters
531
+ form_params = opts[:form_params] || {}
532
+
533
+ # http body (model)
534
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_integration)
535
+
536
+ # return_type
537
+ return_type = opts[:debug_return_type] || 'Integration'
538
+
539
+ # auth_names
540
+ auth_names = opts[:debug_auth_names] || ['apiKey']
541
+
542
+ new_options = opts.merge(
543
+ :operation => :"IntegrationsApi.update_integration",
544
+ :header_params => header_params,
545
+ :query_params => query_params,
546
+ :form_params => form_params,
547
+ :body => post_body,
548
+ :auth_names => auth_names,
549
+ :return_type => return_type
550
+ )
551
+
552
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
553
+ if @api_client.config.debugging
554
+ @api_client.config.logger.debug "API called: IntegrationsApi#update_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
555
+ end
556
+ return data, status_code, headers
557
+ end
558
+
485
559
  # Change the policy of a mapping
486
560
  # Only affects the licenses created afterwards. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
487
561
  # @param id [String]
@@ -19,8 +19,82 @@ module LicenseManager
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Cancel a license
23
+ # Cancels the license right away: validating its key then fails with `license_expired`, like an expired license, and its status is `canceled`. A cancellation can't be undone. Customers can cancel their licenses until their `cancellableUntil`, the end of their money back guarantee: tokens can't cancel a license past it, or without one. API keys and sessions can cancel any license. When the license was bought through the Stripe integration, its payment is refunded in the background, unless the integration disables `autoRefund`, its API key lacks the optional Refunds: Write permission (`canRefund`), or `refund` is `false`: the refund is its price paid, taxes included, and its id is set as `stripeRefundId`. The customer is emailed a confirmation, and the owners and admins of the organization are told about the cancellation and its refund. In test products, the customer is only emailed when their email is a member's of the organization. Records a `license.canceled` event, then a `license.refunded` or `license.refund_failed` one once the refund is done. **Token access**: customer, license tokens with the `license:cancel` permission (or the matching write one). A token reaches the license it's scoped to, or the licenses of its customer. **Required role permission**: `license:cancel` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
+ # @param id [String]
25
+ # @param cancel_license [CancelLicense]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [License]
28
+ def cancel_license(id, cancel_license, opts = {})
29
+ data, _status_code, _headers = cancel_license_with_http_info(id, cancel_license, opts)
30
+ data
31
+ end
32
+
33
+ # Cancel a license
34
+ # Cancels the license right away: validating its key then fails with &#x60;license_expired&#x60;, like an expired license, and its status is &#x60;canceled&#x60;. A cancellation can&#39;t be undone. Customers can cancel their licenses until their &#x60;cancellableUntil&#x60;, the end of their money back guarantee: tokens can&#39;t cancel a license past it, or without one. API keys and sessions can cancel any license. When the license was bought through the Stripe integration, its payment is refunded in the background, unless the integration disables &#x60;autoRefund&#x60;, its API key lacks the optional Refunds: Write permission (&#x60;canRefund&#x60;), or &#x60;refund&#x60; is &#x60;false&#x60;: the refund is its price paid, taxes included, and its id is set as &#x60;stripeRefundId&#x60;. The customer is emailed a confirmation, and the owners and admins of the organization are told about the cancellation and its refund. In test products, the customer is only emailed when their email is a member&#39;s of the organization. Records a &#x60;license.canceled&#x60; event, then a &#x60;license.refunded&#x60; or &#x60;license.refund_failed&#x60; one once the refund is done. **Token access**: customer, license tokens with the &#x60;license:cancel&#x60; permission (or the matching write one). A token reaches the license it&#39;s scoped to, or the licenses of its customer. **Required role permission**: &#x60;license:cancel&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
35
+ # @param id [String]
36
+ # @param cancel_license [CancelLicense]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(License, Integer, Hash)>] License data, response status code and response headers
39
+ def cancel_license_with_http_info(id, cancel_license, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: LicensesApi.cancel_license ...'
42
+ end
43
+ # verify the required parameter 'id' is set
44
+ if @api_client.config.client_side_validation && id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'id' when calling LicensesApi.cancel_license"
46
+ end
47
+ # verify the required parameter 'cancel_license' is set
48
+ if @api_client.config.client_side_validation && cancel_license.nil?
49
+ fail ArgumentError, "Missing the required parameter 'cancel_license' when calling LicensesApi.cancel_license"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/licenses/{id}/cancel'.sub('{id}', CGI.escape(id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(cancel_license)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'License'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'token']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"LicensesApi.cancel_license",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: LicensesApi#cancel_license\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
22
96
  # Create a license
23
- # Without a `key`, the license gets a random one, like `7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF`: 5 groups of 5 characters separated by dashes, each character an upper case letter or a digit other than `O`, `0`, `I` and `1`. That's 32 possible characters encoding 5 bits each, for 125 random bits. Without a `policyId`, the license follows the product's default policy. Without an `expiresAt`, the license expires after the duration of its policy, or never when the policy has none. `expiresAt: null` makes it never expire. Without a `price`, the price paid for the license is unknown: it's left out of the revenue stats. The values of `maxVersion` left out are taken from the max version of the policy: its hard-coded version, or the times after the creation of the license its versions lock. The license belongs to the product's customer with the given `email`, which is created when there's none. With `sendKey: true`, the key is emailed to the customer once the license is created. The license copies the settings of its policy when it's created: later changes to the policy don't affect it. Its key, policy and customer can't be changed afterwards. **Required role permission**: `license:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
97
+ # Without a `key`, the license gets a random one, like `7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF`: 5 groups of 5 characters separated by dashes, each character an upper case letter or a digit other than `O`, `0`, `I` and `1`. That's 32 possible characters encoding 5 bits each, for 125 random bits. Without a `policyId`, the license follows the product's default policy. Without an `expiresAt`, the license expires after the duration of its policy, or never when the policy has none. `expiresAt: null` makes it never expire. Without a `price`, the price paid for the license is unknown: it's left out of the revenue stats. Without a `cancellableUntil`, the customer can cancel the license during the policy's `moneyBackGuaranteeDays` after its creation, or never when the policy has none. The values of `maxVersion` left out are taken from the max version of the policy: its hard-coded version, or the times after the creation of the license its versions lock. The license belongs to the product's customer with the given `email`, which is created when there's none. With `sendKey: true`, the key is emailed to the customer once the license is created. The license copies the settings of its policy when it's created: later changes to the policy don't affect it. Its key, policy and customer can't be changed afterwards. **Required role permission**: `license:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
98
  # @param product_id [String]
25
99
  # @param create_license [CreateLicense]
26
100
  # @param [Hash] opts the optional parameters
@@ -31,7 +105,7 @@ module LicenseManager
31
105
  end
32
106
 
33
107
  # Create a license
34
- # Without a &#x60;key&#x60;, the license gets a random one, like &#x60;7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF&#x60;: 5 groups of 5 characters separated by dashes, each character an upper case letter or a digit other than &#x60;O&#x60;, &#x60;0&#x60;, &#x60;I&#x60; and &#x60;1&#x60;. That&#39;s 32 possible characters encoding 5 bits each, for 125 random bits. Without a &#x60;policyId&#x60;, the license follows the product&#39;s default policy. Without an &#x60;expiresAt&#x60;, the license expires after the duration of its policy, or never when the policy has none. &#x60;expiresAt: null&#x60; makes it never expire. Without a &#x60;price&#x60;, the price paid for the license is unknown: it&#39;s left out of the revenue stats. The values of &#x60;maxVersion&#x60; left out are taken from the max version of the policy: its hard-coded version, or the times after the creation of the license its versions lock. The license belongs to the product&#39;s customer with the given &#x60;email&#x60;, which is created when there&#39;s none. With &#x60;sendKey: true&#x60;, the key is emailed to the customer once the license is created. The license copies the settings of its policy when it&#39;s created: later changes to the policy don&#39;t affect it. Its key, policy and customer can&#39;t be changed afterwards. **Required role permission**: &#x60;license:create&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
108
+ # Without a &#x60;key&#x60;, the license gets a random one, like &#x60;7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF&#x60;: 5 groups of 5 characters separated by dashes, each character an upper case letter or a digit other than &#x60;O&#x60;, &#x60;0&#x60;, &#x60;I&#x60; and &#x60;1&#x60;. That&#39;s 32 possible characters encoding 5 bits each, for 125 random bits. Without a &#x60;policyId&#x60;, the license follows the product&#39;s default policy. Without an &#x60;expiresAt&#x60;, the license expires after the duration of its policy, or never when the policy has none. &#x60;expiresAt: null&#x60; makes it never expire. Without a &#x60;price&#x60;, the price paid for the license is unknown: it&#39;s left out of the revenue stats. Without a &#x60;cancellableUntil&#x60;, the customer can cancel the license during the policy&#39;s &#x60;moneyBackGuaranteeDays&#x60; after its creation, or never when the policy has none. The values of &#x60;maxVersion&#x60; left out are taken from the max version of the policy: its hard-coded version, or the times after the creation of the license its versions lock. The license belongs to the product&#39;s customer with the given &#x60;email&#x60;, which is created when there&#39;s none. With &#x60;sendKey: true&#x60;, the key is emailed to the customer once the license is created. The license copies the settings of its policy when it&#39;s created: later changes to the policy don&#39;t affect it. Its key, policy and customer can&#39;t be changed afterwards. **Required role permission**: &#x60;license:create&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
35
109
  # @param product_id [String]
36
110
  # @param create_license [CreateLicense]
37
111
  # @param [Hash] opts the optional parameters
@@ -735,7 +809,7 @@ module LicenseManager
735
809
  end
736
810
 
737
811
  # Update a license
738
- # The key, policy and customer of a license can't be changed: sending them does nothing. The changes apply to the next validations of the key, not to the license tokens `validateKey` already returned, which stay valid until they expire. Lowering `maxMachines` doesn't deactivate machines: the ones already active keep validating, and new ones are refused until enough are deactivated. **Required role permission**: `license:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
812
+ # The key, policy and customer of a license can't be changed: sending them does nothing. The changes apply to the next validations of the key, not to the license tokens `validateKey` already returned, which stay valid until they expire. Lowering `maxMachines` doesn't deactivate machines: the ones already active keep validating, and new ones replace them one at a time when the product has `autoMachineChange`, or are refused until enough are deactivated. **Required role permission**: `license:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
739
813
  # @param id [String]
740
814
  # @param update_license [UpdateLicense]
741
815
  # @param [Hash] opts the optional parameters
@@ -746,7 +820,7 @@ module LicenseManager
746
820
  end
747
821
 
748
822
  # Update a license
749
- # The key, policy and customer of a license can&#39;t be changed: sending them does nothing. The changes apply to the next validations of the key, not to the license tokens &#x60;validateKey&#x60; already returned, which stay valid until they expire. Lowering &#x60;maxMachines&#x60; doesn&#39;t deactivate machines: the ones already active keep validating, and new ones are refused until enough are deactivated. **Required role permission**: &#x60;license:update&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
823
+ # The key, policy and customer of a license can&#39;t be changed: sending them does nothing. The changes apply to the next validations of the key, not to the license tokens &#x60;validateKey&#x60; already returned, which stay valid until they expire. Lowering &#x60;maxMachines&#x60; doesn&#39;t deactivate machines: the ones already active keep validating, and new ones replace them one at a time when the product has &#x60;autoMachineChange&#x60;, or are refused until enough are deactivated. **Required role permission**: &#x60;license:update&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
750
824
  # @param id [String]
751
825
  # @param update_license [UpdateLicense]
752
826
  # @param [Hash] opts the optional parameters
@@ -809,7 +883,7 @@ module LicenseManager
809
883
  end
810
884
 
811
885
  # Validate a license key
812
- # Checks the license key of the product on a machine and returns a token the application can verify offline with the organization's public key. Doesn't need authentication. The license must allow the `version`: up to its `maxVersion.version` when it has one, like `\"2.3\"` for every 2.3.z version and older. Its `maxVersion.lockMajorAt` and `maxVersion.lockMinorAt` are enforced once they hard-code `maxVersion.version`, within the hour they're reached. When it doesn't, the error's `latestAllowedVersion` is the latest release of the product the license allows, so the application can offer to install it. The machine with the `fingerprint` is created when the license has none, and activated when it's deactivated, unless the license is already active on its maximum number of machines. A machine that's already active is never refused for the maximum number of machines, even when it was lowered below the number of active machines. Its `version`, and its `name` and `platform` when given, are updated: they can't be cleared. The checks run in this order, and the first one failing answers: the license has expired, then it doesn't allow the version, then it's on its maximum number of machines. Each failure is recorded as a `license.validation_failed` event, except for keys that don't exist. Changes to the license, like deactivating the machine or shortening its expiration, don't revoke the tokens already returned: the application only sees them when it validates its key again, at the latest when its token expires.
886
+ # Checks the license key of the product on a machine and returns a token the application can verify offline with the organization's public key. Doesn't need authentication. The license must allow the `version`: up to its `maxVersion.version` when it has one, like `\"2.3\"` for every 2.3.z version and older. Its `maxVersion.lockMajorAt` and `maxVersion.lockMinorAt` are enforced once they hard-code `maxVersion.version`, within the hour they're reached. When it doesn't, the error's `latestAllowedVersion` is the latest release of the product the license allows, so the application can offer to install it. The machine with the `fingerprint` is created when the license has none, and activated when it's deactivated, unless the license is already active on its maximum number of machines. A machine that's already active is never refused for the maximum number of machines, even when it was lowered below the number of active machines. Its `version`, and its `name` and `platform` when given, are updated: they can't be cleared. Unless the product disables `autoMachineChange`, a new machine isn't refused when the license is on its maximum number of machines: it takes the place of the active machine validated the longest ago, which is deactivated with its `overriddenByMachineId` set to the new machine, and recorded as a `machine.deactivated` event. When a machine deactivated this way is validated again, it takes its place back: the machine that overrode it, and the ones that overrode that one in turn, are locked, with their `overriddenByMachineId` set to the machine coming back. A locked machine is always refused, so two machines can't take turns on one place. The checks run in this order, and the first one failing answers: the license has expired or was canceled, then it doesn't allow the version, then the machine is locked, then it's on its maximum number of machines. Each failure is recorded as a `license.validation_failed` event, except for keys that don't exist. Changes to the license, like deactivating the machine or shortening its expiration, don't revoke the tokens already returned: the application only sees them when it validates its key again, at the latest when its token expires.
813
887
  # @param product_id [String]
814
888
  # @param validate_key [ValidateKey]
815
889
  # @param [Hash] opts the optional parameters
@@ -820,7 +894,7 @@ module LicenseManager
820
894
  end
821
895
 
822
896
  # Validate a license key
823
- # Checks the license key of the product on a machine and returns a token the application can verify offline with the organization&#39;s public key. Doesn&#39;t need authentication. The license must allow the &#x60;version&#x60;: up to its &#x60;maxVersion.version&#x60; when it has one, like &#x60;\&quot;2.3\&quot;&#x60; for every 2.3.z version and older. Its &#x60;maxVersion.lockMajorAt&#x60; and &#x60;maxVersion.lockMinorAt&#x60; are enforced once they hard-code &#x60;maxVersion.version&#x60;, within the hour they&#39;re reached. When it doesn&#39;t, the error&#39;s &#x60;latestAllowedVersion&#x60; is the latest release of the product the license allows, so the application can offer to install it. The machine with the &#x60;fingerprint&#x60; is created when the license has none, and activated when it&#39;s deactivated, unless the license is already active on its maximum number of machines. A machine that&#39;s already active is never refused for the maximum number of machines, even when it was lowered below the number of active machines. Its &#x60;version&#x60;, and its &#x60;name&#x60; and &#x60;platform&#x60; when given, are updated: they can&#39;t be cleared. The checks run in this order, and the first one failing answers: the license has expired, then it doesn&#39;t allow the version, then it&#39;s on its maximum number of machines. Each failure is recorded as a &#x60;license.validation_failed&#x60; event, except for keys that don&#39;t exist. Changes to the license, like deactivating the machine or shortening its expiration, don&#39;t revoke the tokens already returned: the application only sees them when it validates its key again, at the latest when its token expires.
897
+ # Checks the license key of the product on a machine and returns a token the application can verify offline with the organization&#39;s public key. Doesn&#39;t need authentication. The license must allow the &#x60;version&#x60;: up to its &#x60;maxVersion.version&#x60; when it has one, like &#x60;\&quot;2.3\&quot;&#x60; for every 2.3.z version and older. Its &#x60;maxVersion.lockMajorAt&#x60; and &#x60;maxVersion.lockMinorAt&#x60; are enforced once they hard-code &#x60;maxVersion.version&#x60;, within the hour they&#39;re reached. When it doesn&#39;t, the error&#39;s &#x60;latestAllowedVersion&#x60; is the latest release of the product the license allows, so the application can offer to install it. The machine with the &#x60;fingerprint&#x60; is created when the license has none, and activated when it&#39;s deactivated, unless the license is already active on its maximum number of machines. A machine that&#39;s already active is never refused for the maximum number of machines, even when it was lowered below the number of active machines. Its &#x60;version&#x60;, and its &#x60;name&#x60; and &#x60;platform&#x60; when given, are updated: they can&#39;t be cleared. Unless the product disables &#x60;autoMachineChange&#x60;, a new machine isn&#39;t refused when the license is on its maximum number of machines: it takes the place of the active machine validated the longest ago, which is deactivated with its &#x60;overriddenByMachineId&#x60; set to the new machine, and recorded as a &#x60;machine.deactivated&#x60; event. When a machine deactivated this way is validated again, it takes its place back: the machine that overrode it, and the ones that overrode that one in turn, are locked, with their &#x60;overriddenByMachineId&#x60; set to the machine coming back. A locked machine is always refused, so two machines can&#39;t take turns on one place. The checks run in this order, and the first one failing answers: the license has expired or was canceled, then it doesn&#39;t allow the version, then the machine is locked, then it&#39;s on its maximum number of machines. Each failure is recorded as a &#x60;license.validation_failed&#x60; event, except for keys that don&#39;t exist. Changes to the license, like deactivating the machine or shortening its expiration, don&#39;t revoke the tokens already returned: the application only sees them when it validates its key again, at the latest when its token expires.
824
898
  # @param product_id [String]
825
899
  # @param validate_key [ValidateKey]
826
900
  # @param [Hash] opts the optional parameters
@@ -20,7 +20,7 @@ module LicenseManager
20
20
  @api_client = api_client
21
21
  end
22
22
  # Deactivate a machine
23
- # The machine no longer counts as using the license, freeing its place when the license has a maximum number of machines. Validating the license key on the machine activates it again, unless the license is on its maximum number of machines by then. Deactivating a deactivated machine does nothing. The license token `validateKey` returned to the machine isn't revoked: the application can keep running offline until it expires. Machines can't be deleted: they're deleted with their license. **Token access**: customer, license, machine tokens with the `machine:write` permission (or the matching write one). A token reaches the machine it's scoped to, or the machines of its license or customer. **Required role permission**: `machine:deactivate` when called with a session, granted by the member's role. API keys aren't limited by roles.
23
+ # The machine no longer counts as using the license, freeing its place when the license has a maximum number of machines. Validating the license key on the machine activates it again, unless the license is on its maximum number of machines by then. Deactivating a deactivated or locked machine does nothing. The license token `validateKey` returned to the machine isn't revoked: the application can keep running offline until it expires. Machines can't be deleted: they're deleted with their license. **Token access**: customer, license, machine tokens with the `machine:write` permission (or the matching write one). A token reaches the machine it's scoped to, or the machines of its license or customer. **Required role permission**: `machine:deactivate` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
24
  # @param id [String]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [Machine]
@@ -30,7 +30,7 @@ module LicenseManager
30
30
  end
31
31
 
32
32
  # Deactivate a machine
33
- # The machine no longer counts as using the license, freeing its place when the license has a maximum number of machines. Validating the license key on the machine activates it again, unless the license is on its maximum number of machines by then. Deactivating a deactivated machine does nothing. The license token &#x60;validateKey&#x60; returned to the machine isn&#39;t revoked: the application can keep running offline until it expires. Machines can&#39;t be deleted: they&#39;re deleted with their license. **Token access**: customer, license, machine tokens with the &#x60;machine:write&#x60; permission (or the matching write one). A token reaches the machine it&#39;s scoped to, or the machines of its license or customer. **Required role permission**: &#x60;machine:deactivate&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
33
+ # The machine no longer counts as using the license, freeing its place when the license has a maximum number of machines. Validating the license key on the machine activates it again, unless the license is on its maximum number of machines by then. Deactivating a deactivated or locked machine does nothing. The license token &#x60;validateKey&#x60; returned to the machine isn&#39;t revoked: the application can keep running offline until it expires. Machines can&#39;t be deleted: they&#39;re deleted with their license. **Token access**: customer, license, machine tokens with the &#x60;machine:write&#x60; permission (or the matching write one). A token reaches the machine it&#39;s scoped to, or the machines of its license or customer. **Required role permission**: &#x60;machine:deactivate&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
34
34
  # @param id [String]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(Machine, Integer, Hash)>] Machine data, response status code and response headers
@@ -204,7 +204,7 @@ module LicenseManager
204
204
  fail ArgumentError, 'invalid value for "opts[:"search"]" when calling MachinesApi.list_machines, the character length must be greater than or equal to 1.'
205
205
  end
206
206
 
207
- allowable_values = ["active", "deactivated", "unknown_default_open_api"]
207
+ allowable_values = ["active", "deactivated", "locked", "unknown_default_open_api"]
208
208
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
209
209
  fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
210
210
  end
@@ -20,7 +20,7 @@ module LicenseManager
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create a link to the customer portal
23
- # Link letting the customer see their licenses and deactivate their machines in the customer portal, without signing in. Anyone with the link can, until it expires or the customer is deleted: it can't be revoked otherwise. The token also works with the API endpoints that accept customer tokens. Links can be created while the product's customer portal is disabled, but the portal answers `404` until it's enabled, and `sendPortalLink` refuses to email them. **Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
23
+ # Link letting the customer see their licenses, cancel them during their money back guarantee, and deactivate their machines in the customer portal, without signing in. Anyone with the link can, until it expires or the customer is deleted: it can't be revoked otherwise. The token also works with the API endpoints that accept customer tokens. Links can be created while the product's customer portal is disabled, but the portal answers `404` until it's enabled, and `sendPortalLink` refuses to email them. **Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
24
  # @param id [String]
25
25
  # @param create_portal_link [CreatePortalLink]
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module LicenseManager
31
31
  end
32
32
 
33
33
  # Create a link to the customer portal
34
- # Link letting the customer see their licenses and deactivate their machines in the customer portal, without signing in. Anyone with the link can, until it expires or the customer is deleted: it can&#39;t be revoked otherwise. The token also works with the API endpoints that accept customer tokens. Links can be created while the product&#39;s customer portal is disabled, but the portal answers &#x60;404&#x60; until it&#39;s enabled, and &#x60;sendPortalLink&#x60; refuses to email them. **Required role permission**: &#x60;portalLink:create&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
34
+ # Link letting the customer see their licenses, cancel them during their money back guarantee, and deactivate their machines in the customer portal, without signing in. Anyone with the link can, until it expires or the customer is deleted: it can&#39;t be revoked otherwise. The token also works with the API endpoints that accept customer tokens. Links can be created while the product&#39;s customer portal is disabled, but the portal answers &#x60;404&#x60; until it&#39;s enabled, and &#x60;sendPortalLink&#x60; refuses to email them. **Required role permission**: &#x60;portalLink:create&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
35
35
  # @param id [String]
36
36
  # @param create_portal_link [CreatePortalLink]
37
37
  # @param [Hash] opts the optional parameters
@@ -20,7 +20,7 @@ module LicenseManager
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create a product
23
- # Without a `slug`, the product gets one derived from its name: lower cased, without accents and special characters (`Élan Pro 2!` becomes `elan-pro-2`). When another product of the organization already uses it, a dash and 3 random lowercase letters or digits are appended (`elan-pro-2-k3f`), until the slug is free. An explicit `slug` is used as is: the request fails with a `409` when it's taken, it's never changed. Slug uniqueness is enforced by the database, so when concurrent requests end up with the same slug, only one succeeds and the others get a `409`, even without an explicit `slug`. Retrying such a request without a `slug` derives a new one. The product is created with its default policy, named `Default policy` with the `default` slug, whose settings are given by `defaultPolicy`. Omitted settings default to licenses that never expire, on a single machine, offline for one week, for every version of the product. Unlike `createPolicy`, where `maxMachines` defaults to no limit. With `isTestFromProductId`, the product is a test product: its id, its slug, and the ids, slugs and license keys of its resources start with `test_` (`TEST-` for license keys), and only test API keys reach it. It starts with copies of the policies, releases and portal settings of the live product, `defaultPolicy` is ignored. Later changes to the live product aren't copied: reset the test product to copy them again. Test API keys can only create test products, live API keys only live ones. **Required role permission**: `product:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
23
+ # Without a `slug`, the product gets one derived from its name: lower cased, without accents and special characters (`Élan Pro 2!` becomes `elan-pro-2`). When another product of the organization already uses it, a dash and 3 random lowercase letters or digits are appended (`elan-pro-2-k3f`), until the slug is free. An explicit `slug` is used as is: the request fails with a `409` when it's taken, it's never changed. Slug uniqueness is enforced by the database, so when concurrent requests end up with the same slug, only one succeeds and the others get a `409`, even without an explicit `slug`. Retrying such a request without a `slug` derives a new one. The product is created with its default policy, named `Default policy` with the `default` slug, whose settings are given by `defaultPolicy`. Omitted settings default to licenses that never expire, on a single machine, offline for one week, for every version of the product. Unlike `createPolicy`, where `maxMachines` defaults to no limit. With `isTestFromProductId`, the product is a test product: its id, its slug, and the ids, slugs and license keys of its resources start with `test_` (`TEST-` for license keys), and only test API keys reach it. It starts with copies of the policies, releases, portal settings and `autoMachineChange` of the live product, `defaultPolicy` is ignored. Later changes to the live product aren't copied: reset the test product to copy them again. Test API keys can only create test products, live API keys only live ones. **Required role permission**: `product:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
24
  # @param create_product_with_policy [CreateProductWithPolicy]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [Product]
@@ -30,7 +30,7 @@ module LicenseManager
30
30
  end
31
31
 
32
32
  # Create a product
33
- # Without a &#x60;slug&#x60;, the product gets one derived from its name: lower cased, without accents and special characters (&#x60;Élan Pro 2!&#x60; becomes &#x60;elan-pro-2&#x60;). When another product of the organization already uses it, a dash and 3 random lowercase letters or digits are appended (&#x60;elan-pro-2-k3f&#x60;), until the slug is free. An explicit &#x60;slug&#x60; is used as is: the request fails with a &#x60;409&#x60; when it&#39;s taken, it&#39;s never changed. Slug uniqueness is enforced by the database, so when concurrent requests end up with the same slug, only one succeeds and the others get a &#x60;409&#x60;, even without an explicit &#x60;slug&#x60;. Retrying such a request without a &#x60;slug&#x60; derives a new one. The product is created with its default policy, named &#x60;Default policy&#x60; with the &#x60;default&#x60; slug, whose settings are given by &#x60;defaultPolicy&#x60;. Omitted settings default to licenses that never expire, on a single machine, offline for one week, for every version of the product. Unlike &#x60;createPolicy&#x60;, where &#x60;maxMachines&#x60; defaults to no limit. With &#x60;isTestFromProductId&#x60;, the product is a test product: its id, its slug, and the ids, slugs and license keys of its resources start with &#x60;test_&#x60; (&#x60;TEST-&#x60; for license keys), and only test API keys reach it. It starts with copies of the policies, releases and portal settings of the live product, &#x60;defaultPolicy&#x60; is ignored. Later changes to the live product aren&#39;t copied: reset the test product to copy them again. Test API keys can only create test products, live API keys only live ones. **Required role permission**: &#x60;product:create&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
33
+ # Without a &#x60;slug&#x60;, the product gets one derived from its name: lower cased, without accents and special characters (&#x60;Élan Pro 2!&#x60; becomes &#x60;elan-pro-2&#x60;). When another product of the organization already uses it, a dash and 3 random lowercase letters or digits are appended (&#x60;elan-pro-2-k3f&#x60;), until the slug is free. An explicit &#x60;slug&#x60; is used as is: the request fails with a &#x60;409&#x60; when it&#39;s taken, it&#39;s never changed. Slug uniqueness is enforced by the database, so when concurrent requests end up with the same slug, only one succeeds and the others get a &#x60;409&#x60;, even without an explicit &#x60;slug&#x60;. Retrying such a request without a &#x60;slug&#x60; derives a new one. The product is created with its default policy, named &#x60;Default policy&#x60; with the &#x60;default&#x60; slug, whose settings are given by &#x60;defaultPolicy&#x60;. Omitted settings default to licenses that never expire, on a single machine, offline for one week, for every version of the product. Unlike &#x60;createPolicy&#x60;, where &#x60;maxMachines&#x60; defaults to no limit. With &#x60;isTestFromProductId&#x60;, the product is a test product: its id, its slug, and the ids, slugs and license keys of its resources start with &#x60;test_&#x60; (&#x60;TEST-&#x60; for license keys), and only test API keys reach it. It starts with copies of the policies, releases, portal settings and &#x60;autoMachineChange&#x60; of the live product, &#x60;defaultPolicy&#x60; is ignored. Later changes to the live product aren&#39;t copied: reset the test product to copy them again. Test API keys can only create test products, live API keys only live ones. **Required role permission**: &#x60;product:create&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
34
34
  # @param create_product_with_policy [CreateProductWithPolicy]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(Product, Integer, Hash)>] Product data, response status code and response headers
@@ -439,7 +439,7 @@ module LicenseManager
439
439
  end
440
440
 
441
441
  # Reset a test product
442
- # Deletes the customers, licenses, machines, policies and releases of the test product, with their events, then copies the policies, releases and portal settings of its live product again. Its id, name and slug are kept, but the copied policies get new ids. The tokens of its customers, licenses and machines stop working. **Required role permission**: `product:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
442
+ # Deletes the customers, licenses, machines, policies and releases of the test product, with their events, then copies the policies, releases, portal settings and `autoMachineChange` of its live product again. Its id, name and slug are kept, but the copied policies get new ids. The tokens of its customers, licenses and machines stop working. **Required role permission**: `product:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
443
443
  # @param id [String]
444
444
  # @param [Hash] opts the optional parameters
445
445
  # @return [Product]
@@ -449,7 +449,7 @@ module LicenseManager
449
449
  end
450
450
 
451
451
  # Reset a test product
452
- # Deletes the customers, licenses, machines, policies and releases of the test product, with their events, then copies the policies, releases and portal settings of its live product again. Its id, name and slug are kept, but the copied policies get new ids. The tokens of its customers, licenses and machines stop working. **Required role permission**: &#x60;product:update&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
452
+ # Deletes the customers, licenses, machines, policies and releases of the test product, with their events, then copies the policies, releases, portal settings and &#x60;autoMachineChange&#x60; of its live product again. Its id, name and slug are kept, but the copied policies get new ids. The tokens of its customers, licenses and machines stop working. **Required role permission**: &#x60;product:update&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
453
453
  # @param id [String]
454
454
  # @param [Hash] opts the optional parameters
455
455
  # @return [Array<(Product, Integer, Hash)>] Product data, response status code and response headers