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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +152 -0
- data/README.md +3 -3
- data/docs/BillingPortalSession.md +18 -0
- data/docs/CancelLicense.md +22 -0
- data/docs/CancellationReason.md +15 -0
- data/docs/CancellationStats.md +30 -0
- data/docs/CancellationStatsByReasonInner.md +20 -0
- data/docs/ConnectStripe.md +1 -1
- data/docs/CreateBillingPortalSession.md +18 -0
- data/docs/CreateIntegrationMapping.md +1 -1
- data/docs/CreateLicense.md +2 -0
- data/docs/CreatePolicy.md +3 -1
- data/docs/CreateProductWithPolicy.md +1 -1
- data/docs/CreateToken.md +1 -1
- data/docs/EventActorOneOf.md +1 -1
- data/docs/Integration.md +11 -1
- data/docs/IntegrationMapping.md +2 -0
- data/docs/IntegrationMappingRecurring.md +20 -0
- data/docs/IntegrationsApi.md +74 -0
- data/docs/License.md +12 -0
- data/docs/LicenseSubscription.md +34 -0
- data/docs/LicensesApi.md +80 -3
- data/docs/Machine.md +3 -1
- data/docs/MachinesApi.md +1 -1
- data/docs/Mrr.md +26 -0
- data/docs/MrrByIntervalInner.md +24 -0
- data/docs/MrrByPolicyInner.md +22 -0
- data/docs/Policy.md +2 -0
- data/docs/PolicySettings.md +3 -1
- data/docs/PortalApi.md +80 -1
- data/docs/PortalLink.md +2 -2
- data/docs/Product.md +2 -0
- data/docs/ProductStats.md +8 -4
- data/docs/ProductsApi.md +2 -2
- data/docs/Revenue.md +10 -2
- data/docs/StripeIntegration.md +1 -1
- data/docs/StripePermission.md +5 -1
- data/docs/StripePrice.md +2 -0
- data/docs/StripePriceRecurring.md +20 -0
- data/docs/SubscriptionStats.md +38 -0
- data/docs/UpdateIntegration.md +20 -0
- data/docs/UpdateLicense.md +3 -1
- data/docs/UpdatePolicy.md +3 -1
- data/docs/UpdateProduct.md +3 -1
- data/lib/license_manager/api/integrations_api.rb +74 -0
- data/lib/license_manager/api/licenses_api.rb +80 -6
- data/lib/license_manager/api/machines_api.rb +3 -3
- data/lib/license_manager/api/portal_api.rb +72 -2
- data/lib/license_manager/api/products_api.rb +4 -4
- data/lib/license_manager/models/billing_portal_session.rb +178 -0
- data/lib/license_manager/models/cancel_license.rb +238 -0
- data/lib/license_manager/models/cancellation_reason.rb +45 -0
- data/lib/license_manager/models/cancellation_stats.rb +347 -0
- data/lib/license_manager/models/cancellation_stats_by_reason_inner.rb +225 -0
- data/lib/license_manager/models/connect_stripe.rb +1 -1
- data/lib/license_manager/models/create_billing_portal_session.rb +161 -0
- data/lib/license_manager/models/create_integration_mapping.rb +1 -1
- data/lib/license_manager/models/create_license.rb +12 -1
- data/lib/license_manager/models/create_policy.rb +40 -5
- data/lib/license_manager/models/create_product_with_policy.rb +1 -1
- data/lib/license_manager/models/create_token.rb +1 -1
- data/lib/license_manager/models/event_type.rb +7 -1
- data/lib/license_manager/models/integration.rb +136 -1
- data/lib/license_manager/models/integration_mapping.rb +13 -1
- data/lib/license_manager/models/integration_mapping_recurring.rb +228 -0
- data/lib/license_manager/models/license.rb +91 -1
- data/lib/license_manager/models/license_status.rb +2 -1
- data/lib/license_manager/models/license_subscription.rb +388 -0
- data/lib/license_manager/models/machine.rb +17 -4
- data/lib/license_manager/models/mrr.rb +291 -0
- data/lib/license_manager/models/mrr_by_interval_inner.rb +279 -0
- data/lib/license_manager/models/mrr_by_policy_inner.rb +229 -0
- data/lib/license_manager/models/policy.rb +14 -1
- data/lib/license_manager/models/policy_settings.rb +40 -5
- data/lib/license_manager/models/portal_link.rb +1 -1
- data/lib/license_manager/models/product.rb +28 -1
- data/lib/license_manager/models/product_stats.rb +31 -5
- data/lib/license_manager/models/revenue.rb +112 -4
- data/lib/license_manager/models/stripe_integration.rb +1 -1
- data/lib/license_manager/models/stripe_permission.rb +58 -4
- data/lib/license_manager/models/stripe_price.rb +13 -1
- data/lib/license_manager/models/stripe_price_recurring.rb +228 -0
- data/lib/license_manager/models/subscription_stats.rb +456 -0
- data/lib/license_manager/models/update_integration.rb +199 -0
- data/lib/license_manager/models/update_license.rb +16 -5
- data/lib/license_manager/models/update_policy.rb +40 -5
- data/lib/license_manager/models/update_product.rb +14 -4
- data/lib/license_manager/version.rb +1 -1
- data/lib/license_manager.rb +14 -0
- data/openapi.json +1146 -59
- data/spec/api/integrations_api_spec.rb +13 -0
- data/spec/api/licenses_api_spec.rb +16 -3
- data/spec/api/machines_api_spec.rb +1 -1
- data/spec/api/portal_api_spec.rb +14 -1
- data/spec/api/products_api_spec.rb +2 -2
- data/spec/models/billing_portal_session_spec.rb +36 -0
- data/spec/models/cancel_license_spec.rb +48 -0
- data/spec/models/cancellation_reason_spec.rb +30 -0
- data/spec/models/cancellation_stats_by_reason_inner_spec.rb +42 -0
- data/spec/models/cancellation_stats_spec.rb +72 -0
- data/spec/models/create_billing_portal_session_spec.rb +36 -0
- data/spec/models/create_license_spec.rb +6 -0
- data/spec/models/create_policy_spec.rb +6 -0
- data/spec/models/create_token_spec.rb +1 -1
- data/spec/models/integration_mapping_recurring_spec.rb +46 -0
- data/spec/models/integration_mapping_spec.rb +6 -0
- data/spec/models/integration_spec.rb +30 -0
- data/spec/models/license_spec.rb +36 -0
- data/spec/models/license_subscription_spec.rb +88 -0
- data/spec/models/machine_spec.rb +7 -1
- data/spec/models/mrr_by_interval_inner_spec.rb +58 -0
- data/spec/models/mrr_by_policy_inner_spec.rb +48 -0
- data/spec/models/mrr_spec.rb +60 -0
- data/spec/models/policy_settings_spec.rb +6 -0
- data/spec/models/policy_spec.rb +6 -0
- data/spec/models/product_spec.rb +6 -0
- data/spec/models/product_stats_spec.rb +12 -0
- data/spec/models/revenue_spec.rb +24 -0
- data/spec/models/stripe_permission_spec.rb +12 -0
- data/spec/models/stripe_price_recurring_spec.rb +46 -0
- data/spec/models/stripe_price_spec.rb +6 -0
- data/spec/models/subscription_stats_spec.rb +96 -0
- data/spec/models/token_spec.rb +1 -1
- data/spec/models/update_integration_spec.rb +42 -0
- data/spec/models/update_license_spec.rb +6 -0
- data/spec/models/update_policy_spec.rb +6 -0
- data/spec/models/update_product_spec.rb +6 -0
- metadata +57 -1
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
| **subscription_grace_days** | **Integer** | Days a subscription license stays valid after its period ends while its renewal is unpaid, as Stripe retries the payment. | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'license_manager'
|
|
14
|
+
|
|
15
|
+
instance = LicenseManager::UpdateIntegration.new(
|
|
16
|
+
auto_refund: false,
|
|
17
|
+
subscription_grace_days: 7
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
data/docs/UpdateLicense.md
CHANGED
|
@@ -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
|
|
data/docs/UpdateProduct.md
CHANGED
|
@@ -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. A subscription license isn't refunded: its Stripe subscription is canceled at once, without proration, which needs the integration's `canManageSubscriptions`. 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 `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. A subscription license isn't refunded: its Stripe subscription is canceled at once, without proration, which needs the integration's `canManageSubscriptions`. 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.
|
|
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 `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.
|
|
108
|
+
# 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.
|
|
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'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.
|
|
823
|
+
# 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.
|
|
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'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.
|
|
897
|
+
# 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.
|
|
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 `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.
|
|
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 `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.
|
|
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
|
|
@@ -19,8 +19,78 @@ module LicenseManager
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Open the Stripe customer portal of a customer
|
|
23
|
+
# Link to the Stripe customer portal of the customer's Stripe customer, where they manage their subscriptions: change their plan or payment method, see their invoices, cancel. Needs the Stripe integration's `canBillingPortal`, and the customer portal configured in the Stripe account's settings. The changes come back through the integration's webhook, keeping the subscription licenses in line. **Token access**: customer tokens with the `customer:billing` permission (or the matching write one). A customer token reaches its own customer. **Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
24
|
+
# @param id [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [CreateBillingPortalSession] :create_billing_portal_session
|
|
27
|
+
# @return [BillingPortalSession]
|
|
28
|
+
def create_billing_portal_session(id, opts = {})
|
|
29
|
+
data, _status_code, _headers = create_billing_portal_session_with_http_info(id, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Open the Stripe customer portal of a customer
|
|
34
|
+
# Link to the Stripe customer portal of the customer's Stripe customer, where they manage their subscriptions: change their plan or payment method, see their invoices, cancel. Needs the Stripe integration's `canBillingPortal`, and the customer portal configured in the Stripe account's settings. The changes come back through the integration's webhook, keeping the subscription licenses in line. **Token access**: customer tokens with the `customer:billing` permission (or the matching write one). A customer token reaches its own customer. **Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
35
|
+
# @param id [String]
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [CreateBillingPortalSession] :create_billing_portal_session
|
|
38
|
+
# @return [Array<(BillingPortalSession, Integer, Hash)>] BillingPortalSession data, response status code and response headers
|
|
39
|
+
def create_billing_portal_session_with_http_info(id, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: PortalApi.create_billing_portal_session ...'
|
|
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 PortalApi.create_billing_portal_session"
|
|
46
|
+
end
|
|
47
|
+
# resource path
|
|
48
|
+
local_var_path = '/v1/customers/{id}/billing-portal-sessions'.sub('{id}', CGI.escape(id.to_s))
|
|
49
|
+
|
|
50
|
+
# query parameters
|
|
51
|
+
query_params = opts[:query_params] || {}
|
|
52
|
+
|
|
53
|
+
# header parameters
|
|
54
|
+
header_params = opts[:header_params] || {}
|
|
55
|
+
# HTTP header 'Accept' (if needed)
|
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
57
|
+
# HTTP header 'Content-Type'
|
|
58
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
59
|
+
if !content_type.nil?
|
|
60
|
+
header_params['Content-Type'] = content_type
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# form parameters
|
|
64
|
+
form_params = opts[:form_params] || {}
|
|
65
|
+
|
|
66
|
+
# http body (model)
|
|
67
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_billing_portal_session'])
|
|
68
|
+
|
|
69
|
+
# return_type
|
|
70
|
+
return_type = opts[:debug_return_type] || 'BillingPortalSession'
|
|
71
|
+
|
|
72
|
+
# auth_names
|
|
73
|
+
auth_names = opts[:debug_auth_names] || ['apiKey', 'token']
|
|
74
|
+
|
|
75
|
+
new_options = opts.merge(
|
|
76
|
+
:operation => :"PortalApi.create_billing_portal_session",
|
|
77
|
+
:header_params => header_params,
|
|
78
|
+
:query_params => query_params,
|
|
79
|
+
:form_params => form_params,
|
|
80
|
+
:body => post_body,
|
|
81
|
+
:auth_names => auth_names,
|
|
82
|
+
:return_type => return_type
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
86
|
+
if @api_client.config.debugging
|
|
87
|
+
@api_client.config.logger.debug "API called: PortalApi#create_billing_portal_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
88
|
+
end
|
|
89
|
+
return data, status_code, headers
|
|
90
|
+
end
|
|
91
|
+
|
|
22
92
|
# 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.
|
|
93
|
+
# 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
94
|
# @param id [String]
|
|
25
95
|
# @param create_portal_link [CreatePortalLink]
|
|
26
96
|
# @param [Hash] opts the optional parameters
|
|
@@ -31,7 +101,7 @@ module LicenseManager
|
|
|
31
101
|
end
|
|
32
102
|
|
|
33
103
|
# 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'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.
|
|
104
|
+
# 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.
|
|
35
105
|
# @param id [String]
|
|
36
106
|
# @param create_portal_link [CreatePortalLink]
|
|
37
107
|
# @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
|
|
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 `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
|
|
33
|
+
# 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.
|
|
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
|
|
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
|
|
452
|
+
# 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.
|
|
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
|