license_manager 0.1.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 +7 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +9 -0
- data/LICENSE +201 -0
- data/README.md +96 -0
- data/Rakefile +10 -0
- data/docs/ConnectStripe.md +18 -0
- data/docs/CreateCustomer.md +20 -0
- data/docs/CreateIntegrationMapping.md +20 -0
- data/docs/CreateLicense.md +36 -0
- data/docs/CreatePolicy.md +30 -0
- data/docs/CreatePortalLink.md +18 -0
- data/docs/CreateProduct.md +20 -0
- data/docs/CreateProductWithPolicy.md +24 -0
- data/docs/CreateRelease.md +20 -0
- data/docs/CreateToken.md +20 -0
- data/docs/Customer.md +30 -0
- data/docs/CustomerList.md +20 -0
- data/docs/CustomersApi.md +385 -0
- data/docs/Error.md +18 -0
- data/docs/ErrorError.md +22 -0
- data/docs/ErrorErrorIssuesInner.md +20 -0
- data/docs/ErrorErrorIssuesInnerPathInner.md +15 -0
- data/docs/Event.md +34 -0
- data/docs/EventActor.md +55 -0
- data/docs/EventActorOneOf.md +26 -0
- data/docs/EventActorOneOf1.md +24 -0
- data/docs/EventActorOneOf2.md +22 -0
- data/docs/EventActorOneOf3.md +18 -0
- data/docs/EventActorOneOf4.md +22 -0
- data/docs/EventList.md +20 -0
- data/docs/EventMachine.md +22 -0
- data/docs/EventType.md +15 -0
- data/docs/EventsApi.md +173 -0
- data/docs/FixedMaxVersion.md +20 -0
- data/docs/Integration.md +38 -0
- data/docs/IntegrationMapping.md +38 -0
- data/docs/IntegrationStatus.md +15 -0
- data/docs/IntegrationsApi.md +587 -0
- data/docs/License.md +50 -0
- data/docs/LicenseList.md +20 -0
- data/docs/LicenseMaxVersion.md +22 -0
- data/docs/LicenseMaxVersionInput.md +22 -0
- data/docs/LicenseStats.md +26 -0
- data/docs/LicenseStatsActivationsByMachineInner.md +24 -0
- data/docs/LicenseStatsActivationsByVersionInner.md +20 -0
- data/docs/LicenseStatus.md +15 -0
- data/docs/LicenseToken.md +18 -0
- data/docs/LicensesApi.md +817 -0
- data/docs/ListPolicyEventsTypeParameter.md +15 -0
- data/docs/ListStripePrices200Response.md +18 -0
- data/docs/LockMaxVersion.md +22 -0
- data/docs/LockMaxVersionMajorAfter.md +49 -0
- data/docs/LockMaxVersionMajorAfterOneOf.md +20 -0
- data/docs/LockMaxVersionMajorAfterOneOf1.md +20 -0
- data/docs/LockMaxVersionMinorAfter.md +20 -0
- data/docs/Machine.md +36 -0
- data/docs/MachineList.md +20 -0
- data/docs/MachinesApi.md +246 -0
- data/docs/Pagination.md +24 -0
- data/docs/PoliciesApi.md +388 -0
- data/docs/Policy.md +40 -0
- data/docs/PolicyDuration.md +20 -0
- data/docs/PolicyList.md +20 -0
- data/docs/PolicyMaxVersion.md +24 -0
- data/docs/PolicySettings.md +24 -0
- data/docs/PolicySettingsDuration.md +20 -0
- data/docs/PolicySettingsDurationAnyOf.md +20 -0
- data/docs/PolicySettingsDurationAnyOf1.md +20 -0
- data/docs/PolicySettingsMaxVersion.md +24 -0
- data/docs/Portal.md +30 -0
- data/docs/PortalApi.md +289 -0
- data/docs/PortalLink.md +22 -0
- data/docs/PortalNotFound.md +22 -0
- data/docs/PortalSettings.md +26 -0
- data/docs/Price.md +20 -0
- data/docs/PriceInput.md +20 -0
- data/docs/Product.md +32 -0
- data/docs/ProductList.md +20 -0
- data/docs/ProductStats.md +54 -0
- data/docs/ProductStatsActivationsByVersionInner.md +20 -0
- data/docs/ProductStatsActiveMachinesByPlatformInner.md +20 -0
- data/docs/ProductStatsActiveMachinesByVersionInner.md +20 -0
- data/docs/ProductStatsNewLicensesByPolicyInner.md +22 -0
- data/docs/ProductsApi.md +666 -0
- data/docs/Release.md +28 -0
- data/docs/ReleaseList.md +20 -0
- data/docs/ReleasesApi.md +388 -0
- data/docs/RequestPortalLink.md +20 -0
- data/docs/Revenue.md +34 -0
- data/docs/SendLicenseKeys.md +18 -0
- data/docs/SendPortalLink.md +18 -0
- data/docs/SigningKey.md +27 -0
- data/docs/StripeIntegration.md +26 -0
- data/docs/StripePermission.md +22 -0
- data/docs/StripePrice.md +28 -0
- data/docs/Token.md +24 -0
- data/docs/TokensApi.md +235 -0
- data/docs/UpdateCustomer.md +20 -0
- data/docs/UpdateIntegrationMapping.md +18 -0
- data/docs/UpdateLicense.md +28 -0
- data/docs/UpdatePolicy.md +30 -0
- data/docs/UpdateProduct.md +22 -0
- data/docs/UpdateProductPortal.md +26 -0
- data/docs/UpdateRelease.md +20 -0
- data/docs/ValidateKey.md +26 -0
- data/docs/ValidateKeyError.md +18 -0
- data/docs/ValidateKeyErrorError.md +24 -0
- data/git_push.sh +54 -0
- data/lib/license_manager/api/customers_api.rb +398 -0
- data/lib/license_manager/api/events_api.rb +207 -0
- data/lib/license_manager/api/integrations_api.rb +559 -0
- data/lib/license_manager/api/licenses_api.rb +885 -0
- data/lib/license_manager/api/machines_api.rb +257 -0
- data/lib/license_manager/api/policies_api.rb +412 -0
- data/lib/license_manager/api/portal_api.rb +310 -0
- data/lib/license_manager/api/products_api.rb +653 -0
- data/lib/license_manager/api/releases_api.rb +408 -0
- data/lib/license_manager/api/tokens_api.rb +244 -0
- data/lib/license_manager/api_client.rb +441 -0
- data/lib/license_manager/api_error.rb +58 -0
- data/lib/license_manager/api_model_base.rb +88 -0
- data/lib/license_manager/configuration.rb +400 -0
- data/lib/license_manager/models/connect_stripe.rb +187 -0
- data/lib/license_manager/models/create_customer.rb +222 -0
- data/lib/license_manager/models/create_integration_mapping.rb +222 -0
- data/lib/license_manager/models/create_license.rb +361 -0
- data/lib/license_manager/models/create_policy.rb +347 -0
- data/lib/license_manager/models/create_portal_link.rb +196 -0
- data/lib/license_manager/models/create_product.rb +244 -0
- data/lib/license_manager/models/create_product_with_policy.rb +270 -0
- data/lib/license_manager/models/create_release.rb +208 -0
- data/lib/license_manager/models/create_token.rb +237 -0
- data/lib/license_manager/models/customer.rb +308 -0
- data/lib/license_manager/models/customer_list.rb +206 -0
- data/lib/license_manager/models/error.rb +177 -0
- data/lib/license_manager/models/error_error.rb +215 -0
- data/lib/license_manager/models/error_error_issues_inner.rb +205 -0
- data/lib/license_manager/models/error_error_issues_inner_path_inner.rb +103 -0
- data/lib/license_manager/models/event.rb +340 -0
- data/lib/license_manager/models/event_actor.rb +108 -0
- data/lib/license_manager/models/event_actor_one_of.rb +251 -0
- data/lib/license_manager/models/event_actor_one_of1.rb +239 -0
- data/lib/license_manager/models/event_actor_one_of2.rb +257 -0
- data/lib/license_manager/models/event_actor_one_of3.rb +201 -0
- data/lib/license_manager/models/event_actor_one_of4.rb +243 -0
- data/lib/license_manager/models/event_list.rb +206 -0
- data/lib/license_manager/models/event_machine.rb +216 -0
- data/lib/license_manager/models/event_type.rb +46 -0
- data/lib/license_manager/models/fixed_max_version.rb +240 -0
- data/lib/license_manager/models/integration.rb +412 -0
- data/lib/license_manager/models/integration_mapping.rb +435 -0
- data/lib/license_manager/models/integration_status.rb +42 -0
- data/lib/license_manager/models/license.rb +542 -0
- data/lib/license_manager/models/license_list.rb +206 -0
- data/lib/license_manager/models/license_max_version.rb +208 -0
- data/lib/license_manager/models/license_max_version_input.rb +202 -0
- data/lib/license_manager/models/license_stats.rb +292 -0
- data/lib/license_manager/models/license_stats_activations_by_machine_inner.rb +244 -0
- data/lib/license_manager/models/license_stats_activations_by_version_inner.rb +206 -0
- data/lib/license_manager/models/license_status.rb +42 -0
- data/lib/license_manager/models/license_token.rb +178 -0
- data/lib/license_manager/models/list_policy_events_type_parameter.rb +104 -0
- data/lib/license_manager/models/list_stripe_prices200_response.rb +179 -0
- data/lib/license_manager/models/lock_max_version.rb +240 -0
- data/lib/license_manager/models/lock_max_version_major_after.rb +105 -0
- data/lib/license_manager/models/lock_max_version_major_after_one_of.rb +245 -0
- data/lib/license_manager/models/lock_max_version_major_after_one_of1.rb +246 -0
- data/lib/license_manager/models/lock_max_version_minor_after.rb +104 -0
- data/lib/license_manager/models/machine.rb +383 -0
- data/lib/license_manager/models/machine_list.rb +206 -0
- data/lib/license_manager/models/pagination.rb +260 -0
- data/lib/license_manager/models/policy.rb +425 -0
- data/lib/license_manager/models/policy_duration.rb +104 -0
- data/lib/license_manager/models/policy_list.rb +206 -0
- data/lib/license_manager/models/policy_max_version.rb +104 -0
- data/lib/license_manager/models/policy_settings.rb +244 -0
- data/lib/license_manager/models/policy_settings_duration.rb +104 -0
- data/lib/license_manager/models/policy_settings_duration_any_of.rb +245 -0
- data/lib/license_manager/models/policy_settings_duration_any_of1.rb +246 -0
- data/lib/license_manager/models/policy_settings_max_version.rb +104 -0
- data/lib/license_manager/models/portal.rb +281 -0
- data/lib/license_manager/models/portal_link.rb +232 -0
- data/lib/license_manager/models/portal_not_found.rb +204 -0
- data/lib/license_manager/models/portal_settings.rb +304 -0
- data/lib/license_manager/models/price.rb +206 -0
- data/lib/license_manager/models/price_input.rb +224 -0
- data/lib/license_manager/models/product.rb +333 -0
- data/lib/license_manager/models/product_list.rb +206 -0
- data/lib/license_manager/models/product_stats.rb +682 -0
- data/lib/license_manager/models/product_stats_activations_by_version_inner.rb +193 -0
- data/lib/license_manager/models/product_stats_active_machines_by_platform_inner.rb +190 -0
- data/lib/license_manager/models/product_stats_active_machines_by_version_inner.rb +190 -0
- data/lib/license_manager/models/product_stats_new_licenses_by_policy_inner.rb +235 -0
- data/lib/license_manager/models/release.rb +308 -0
- data/lib/license_manager/models/release_list.rb +206 -0
- data/lib/license_manager/models/request_portal_link.rb +216 -0
- data/lib/license_manager/models/revenue.rb +401 -0
- data/lib/license_manager/models/send_license_keys.rb +198 -0
- data/lib/license_manager/models/send_portal_link.rb +187 -0
- data/lib/license_manager/models/signing_key.rb +282 -0
- data/lib/license_manager/models/stripe_integration.rb +276 -0
- data/lib/license_manager/models/stripe_permission.rb +253 -0
- data/lib/license_manager/models/stripe_price.rb +280 -0
- data/lib/license_manager/models/token.rb +274 -0
- data/lib/license_manager/models/update_customer.rb +215 -0
- data/lib/license_manager/models/update_integration_mapping.rb +186 -0
- data/lib/license_manager/models/update_license.rb +268 -0
- data/lib/license_manager/models/update_policy.rb +340 -0
- data/lib/license_manager/models/update_product.rb +246 -0
- data/lib/license_manager/models/update_product_portal.rb +274 -0
- data/lib/license_manager/models/update_release.rb +201 -0
- data/lib/license_manager/models/validate_key.rb +362 -0
- data/lib/license_manager/models/validate_key_error.rb +177 -0
- data/lib/license_manager/models/validate_key_error_error.rb +226 -0
- data/lib/license_manager/version.rb +15 -0
- data/lib/license_manager.rb +142 -0
- data/license_manager.gemspec +41 -0
- data/openapi.json +9825 -0
- data/spec/api/customers_api_spec.rb +102 -0
- data/spec/api/events_api_spec.rb +68 -0
- data/spec/api/integrations_api_spec.rb +134 -0
- data/spec/api/licenses_api_spec.rb +200 -0
- data/spec/api/machines_api_spec.rb +77 -0
- data/spec/api/policies_api_spec.rb +105 -0
- data/spec/api/portal_api_spec.rb +87 -0
- data/spec/api/products_api_spec.rb +148 -0
- data/spec/api/releases_api_spec.rb +105 -0
- data/spec/api/tokens_api_spec.rb +74 -0
- data/spec/models/connect_stripe_spec.rb +36 -0
- data/spec/models/create_customer_spec.rb +42 -0
- data/spec/models/create_integration_mapping_spec.rb +42 -0
- data/spec/models/create_license_spec.rb +90 -0
- data/spec/models/create_policy_spec.rb +72 -0
- data/spec/models/create_portal_link_spec.rb +36 -0
- data/spec/models/create_product_spec.rb +42 -0
- data/spec/models/create_product_with_policy_spec.rb +54 -0
- data/spec/models/create_release_spec.rb +42 -0
- data/spec/models/create_token_spec.rb +46 -0
- data/spec/models/customer_list_spec.rb +42 -0
- data/spec/models/customer_spec.rb +72 -0
- data/spec/models/error_error_issues_inner_path_inner_spec.rb +21 -0
- data/spec/models/error_error_issues_inner_spec.rb +42 -0
- data/spec/models/error_error_spec.rb +48 -0
- data/spec/models/error_spec.rb +36 -0
- data/spec/models/event_actor_one_of1_spec.rb +58 -0
- data/spec/models/event_actor_one_of2_spec.rb +56 -0
- data/spec/models/event_actor_one_of3_spec.rb +40 -0
- data/spec/models/event_actor_one_of4_spec.rb +56 -0
- data/spec/models/event_actor_one_of_spec.rb +64 -0
- data/spec/models/event_actor_spec.rb +32 -0
- data/spec/models/event_list_spec.rb +42 -0
- data/spec/models/event_machine_spec.rb +48 -0
- data/spec/models/event_spec.rb +84 -0
- data/spec/models/event_type_spec.rb +30 -0
- data/spec/models/fixed_max_version_spec.rb +46 -0
- data/spec/models/integration_mapping_spec.rb +100 -0
- data/spec/models/integration_spec.rb +100 -0
- data/spec/models/integration_status_spec.rb +30 -0
- data/spec/models/license_list_spec.rb +42 -0
- data/spec/models/license_max_version_input_spec.rb +48 -0
- data/spec/models/license_max_version_spec.rb +48 -0
- data/spec/models/license_spec.rb +132 -0
- data/spec/models/license_stats_activations_by_machine_inner_spec.rb +54 -0
- data/spec/models/license_stats_activations_by_version_inner_spec.rb +42 -0
- data/spec/models/license_stats_spec.rb +60 -0
- data/spec/models/license_status_spec.rb +30 -0
- data/spec/models/license_token_spec.rb +36 -0
- data/spec/models/list_policy_events_type_parameter_spec.rb +21 -0
- data/spec/models/list_stripe_prices200_response_spec.rb +36 -0
- data/spec/models/lock_max_version_major_after_one_of1_spec.rb +46 -0
- data/spec/models/lock_max_version_major_after_one_of_spec.rb +46 -0
- data/spec/models/lock_max_version_major_after_spec.rb +32 -0
- data/spec/models/lock_max_version_minor_after_spec.rb +21 -0
- data/spec/models/lock_max_version_spec.rb +52 -0
- data/spec/models/machine_list_spec.rb +42 -0
- data/spec/models/machine_spec.rb +94 -0
- data/spec/models/pagination_spec.rb +54 -0
- data/spec/models/policy_duration_spec.rb +21 -0
- data/spec/models/policy_list_spec.rb +42 -0
- data/spec/models/policy_max_version_spec.rb +21 -0
- data/spec/models/policy_settings_duration_any_of1_spec.rb +46 -0
- data/spec/models/policy_settings_duration_any_of_spec.rb +46 -0
- data/spec/models/policy_settings_duration_spec.rb +21 -0
- data/spec/models/policy_settings_max_version_spec.rb +21 -0
- data/spec/models/policy_settings_spec.rb +54 -0
- data/spec/models/policy_spec.rb +102 -0
- data/spec/models/portal_link_spec.rb +48 -0
- data/spec/models/portal_not_found_spec.rb +48 -0
- data/spec/models/portal_settings_spec.rb +60 -0
- data/spec/models/portal_spec.rb +72 -0
- data/spec/models/price_input_spec.rb +42 -0
- data/spec/models/price_spec.rb +42 -0
- data/spec/models/product_list_spec.rb +42 -0
- data/spec/models/product_spec.rb +78 -0
- data/spec/models/product_stats_activations_by_version_inner_spec.rb +42 -0
- data/spec/models/product_stats_active_machines_by_platform_inner_spec.rb +42 -0
- data/spec/models/product_stats_active_machines_by_version_inner_spec.rb +42 -0
- data/spec/models/product_stats_new_licenses_by_policy_inner_spec.rb +48 -0
- data/spec/models/product_stats_spec.rb +144 -0
- data/spec/models/release_list_spec.rb +42 -0
- data/spec/models/release_spec.rb +66 -0
- data/spec/models/request_portal_link_spec.rb +42 -0
- data/spec/models/revenue_spec.rb +84 -0
- data/spec/models/send_license_keys_spec.rb +36 -0
- data/spec/models/send_portal_link_spec.rb +36 -0
- data/spec/models/signing_key_spec.rb +58 -0
- data/spec/models/stripe_integration_spec.rb +60 -0
- data/spec/models/stripe_permission_spec.rb +52 -0
- data/spec/models/stripe_price_spec.rb +66 -0
- data/spec/models/token_spec.rb +62 -0
- data/spec/models/update_customer_spec.rb +42 -0
- data/spec/models/update_integration_mapping_spec.rb +36 -0
- data/spec/models/update_license_spec.rb +66 -0
- data/spec/models/update_policy_spec.rb +72 -0
- data/spec/models/update_product_portal_spec.rb +60 -0
- data/spec/models/update_product_spec.rb +48 -0
- data/spec/models/update_release_spec.rb +42 -0
- data/spec/models/validate_key_error_error_spec.rb +54 -0
- data/spec/models/validate_key_error_spec.rb +36 -0
- data/spec/models/validate_key_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- metadata +532 -0
data/docs/LicensesApi.md
ADDED
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
# LicenseManager::LicensesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.licensemanager.dev*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**create_license**](LicensesApi.md#create_license) | **POST** /v1/products/{productId}/licenses | Create a license |
|
|
8
|
+
| [**delete_license**](LicensesApi.md#delete_license) | **DELETE** /v1/licenses/{id} | Delete a license |
|
|
9
|
+
| [**get_license**](LicensesApi.md#get_license) | **GET** /v1/licenses/{id} | Get a license |
|
|
10
|
+
| [**get_license_stats**](LicensesApi.md#get_license_stats) | **GET** /v1/licenses/{id}/stats | Get the stats of a license |
|
|
11
|
+
| [**get_signing_key**](LicensesApi.md#get_signing_key) | **GET** /v1/signing-key | Get the organization's signing key |
|
|
12
|
+
| [**list_customer_licenses**](LicensesApi.md#list_customer_licenses) | **GET** /v1/customers/{customerId}/licenses | List the licenses of a customer |
|
|
13
|
+
| [**list_licenses**](LicensesApi.md#list_licenses) | **GET** /v1/products/{productId}/licenses | List the licenses of a product |
|
|
14
|
+
| [**send_license_keys**](LicensesApi.md#send_license_keys) | **POST** /v1/licenses/send-keys | Email license keys to their customers |
|
|
15
|
+
| [**update_license**](LicensesApi.md#update_license) | **PATCH** /v1/licenses/{id} | Update a license |
|
|
16
|
+
| [**validate_key**](LicensesApi.md#validate_key) | **POST** /v1/products/{productId}/validate-key | Validate a license key |
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## create_license
|
|
20
|
+
|
|
21
|
+
> <License> create_license(product_id, create_license)
|
|
22
|
+
|
|
23
|
+
Create a license
|
|
24
|
+
|
|
25
|
+
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.
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
require 'time'
|
|
31
|
+
require 'license_manager'
|
|
32
|
+
# setup authorization
|
|
33
|
+
LicenseManager.configure do |config|
|
|
34
|
+
# Configure API key authorization: apiKey
|
|
35
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
36
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
37
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
41
|
+
product_id = 'x7Kp2QaZ' # String |
|
|
42
|
+
create_license = LicenseManager::CreateLicense.new({email: 'jane@example.com'}) # CreateLicense |
|
|
43
|
+
|
|
44
|
+
begin
|
|
45
|
+
# Create a license
|
|
46
|
+
result = api_instance.create_license(product_id, create_license)
|
|
47
|
+
p result
|
|
48
|
+
rescue LicenseManager::ApiError => e
|
|
49
|
+
puts "Error when calling LicensesApi->create_license: #{e}"
|
|
50
|
+
end
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### Using the create_license_with_http_info variant
|
|
54
|
+
|
|
55
|
+
This returns an Array which contains the response data, status code and headers.
|
|
56
|
+
|
|
57
|
+
> <Array(<License>, Integer, Hash)> create_license_with_http_info(product_id, create_license)
|
|
58
|
+
|
|
59
|
+
```ruby
|
|
60
|
+
begin
|
|
61
|
+
# Create a license
|
|
62
|
+
data, status_code, headers = api_instance.create_license_with_http_info(product_id, create_license)
|
|
63
|
+
p status_code # => 2xx
|
|
64
|
+
p headers # => { ... }
|
|
65
|
+
p data # => <License>
|
|
66
|
+
rescue LicenseManager::ApiError => e
|
|
67
|
+
puts "Error when calling LicensesApi->create_license_with_http_info: #{e}"
|
|
68
|
+
end
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Parameters
|
|
72
|
+
|
|
73
|
+
| Name | Type | Description | Notes |
|
|
74
|
+
| ---- | ---- | ----------- | ----- |
|
|
75
|
+
| **product_id** | **String** | | |
|
|
76
|
+
| **create_license** | [**CreateLicense**](CreateLicense.md) | | |
|
|
77
|
+
|
|
78
|
+
### Return type
|
|
79
|
+
|
|
80
|
+
[**License**](License.md)
|
|
81
|
+
|
|
82
|
+
### Authorization
|
|
83
|
+
|
|
84
|
+
[apiKey](../README.md#apiKey)
|
|
85
|
+
|
|
86
|
+
### HTTP request headers
|
|
87
|
+
|
|
88
|
+
- **Content-Type**: application/json
|
|
89
|
+
- **Accept**: application/json
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## delete_license
|
|
93
|
+
|
|
94
|
+
> delete_license(id)
|
|
95
|
+
|
|
96
|
+
Delete a license
|
|
97
|
+
|
|
98
|
+
Deletes the license along with its deactivated machines. A license used on active machines can't be deleted: deactivate them first. The tokens scoped to the license or its machines stop working, but the license tokens `validateKey` already returned stay valid until they expire. Its events can no longer be listed. **Required role permission**: `license:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
99
|
+
|
|
100
|
+
### Examples
|
|
101
|
+
|
|
102
|
+
```ruby
|
|
103
|
+
require 'time'
|
|
104
|
+
require 'license_manager'
|
|
105
|
+
# setup authorization
|
|
106
|
+
LicenseManager.configure do |config|
|
|
107
|
+
# Configure API key authorization: apiKey
|
|
108
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
109
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
110
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
114
|
+
id = 'l3Nv8KwB' # String |
|
|
115
|
+
|
|
116
|
+
begin
|
|
117
|
+
# Delete a license
|
|
118
|
+
api_instance.delete_license(id)
|
|
119
|
+
rescue LicenseManager::ApiError => e
|
|
120
|
+
puts "Error when calling LicensesApi->delete_license: #{e}"
|
|
121
|
+
end
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Using the delete_license_with_http_info variant
|
|
125
|
+
|
|
126
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
127
|
+
|
|
128
|
+
> <Array(nil, Integer, Hash)> delete_license_with_http_info(id)
|
|
129
|
+
|
|
130
|
+
```ruby
|
|
131
|
+
begin
|
|
132
|
+
# Delete a license
|
|
133
|
+
data, status_code, headers = api_instance.delete_license_with_http_info(id)
|
|
134
|
+
p status_code # => 2xx
|
|
135
|
+
p headers # => { ... }
|
|
136
|
+
p data # => nil
|
|
137
|
+
rescue LicenseManager::ApiError => e
|
|
138
|
+
puts "Error when calling LicensesApi->delete_license_with_http_info: #{e}"
|
|
139
|
+
end
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Parameters
|
|
143
|
+
|
|
144
|
+
| Name | Type | Description | Notes |
|
|
145
|
+
| ---- | ---- | ----------- | ----- |
|
|
146
|
+
| **id** | **String** | | |
|
|
147
|
+
|
|
148
|
+
### Return type
|
|
149
|
+
|
|
150
|
+
nil (empty response body)
|
|
151
|
+
|
|
152
|
+
### Authorization
|
|
153
|
+
|
|
154
|
+
[apiKey](../README.md#apiKey)
|
|
155
|
+
|
|
156
|
+
### HTTP request headers
|
|
157
|
+
|
|
158
|
+
- **Content-Type**: Not defined
|
|
159
|
+
- **Accept**: application/json
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## get_license
|
|
163
|
+
|
|
164
|
+
> <License> get_license(id)
|
|
165
|
+
|
|
166
|
+
Get a license
|
|
167
|
+
|
|
168
|
+
**Token access**: customer, license, machine tokens with the `license:read` permission (or the matching write one). A token reaches the license it's scoped to, the licenses of its customer, or the license of its machine.
|
|
169
|
+
|
|
170
|
+
### Examples
|
|
171
|
+
|
|
172
|
+
```ruby
|
|
173
|
+
require 'time'
|
|
174
|
+
require 'license_manager'
|
|
175
|
+
# setup authorization
|
|
176
|
+
LicenseManager.configure do |config|
|
|
177
|
+
# Configure API key authorization: apiKey
|
|
178
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
179
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
180
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
181
|
+
|
|
182
|
+
# Configure Bearer authorization (JWT): token
|
|
183
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
187
|
+
id = 'l3Nv8KwB' # String |
|
|
188
|
+
|
|
189
|
+
begin
|
|
190
|
+
# Get a license
|
|
191
|
+
result = api_instance.get_license(id)
|
|
192
|
+
p result
|
|
193
|
+
rescue LicenseManager::ApiError => e
|
|
194
|
+
puts "Error when calling LicensesApi->get_license: #{e}"
|
|
195
|
+
end
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
#### Using the get_license_with_http_info variant
|
|
199
|
+
|
|
200
|
+
This returns an Array which contains the response data, status code and headers.
|
|
201
|
+
|
|
202
|
+
> <Array(<License>, Integer, Hash)> get_license_with_http_info(id)
|
|
203
|
+
|
|
204
|
+
```ruby
|
|
205
|
+
begin
|
|
206
|
+
# Get a license
|
|
207
|
+
data, status_code, headers = api_instance.get_license_with_http_info(id)
|
|
208
|
+
p status_code # => 2xx
|
|
209
|
+
p headers # => { ... }
|
|
210
|
+
p data # => <License>
|
|
211
|
+
rescue LicenseManager::ApiError => e
|
|
212
|
+
puts "Error when calling LicensesApi->get_license_with_http_info: #{e}"
|
|
213
|
+
end
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Parameters
|
|
217
|
+
|
|
218
|
+
| Name | Type | Description | Notes |
|
|
219
|
+
| ---- | ---- | ----------- | ----- |
|
|
220
|
+
| **id** | **String** | | |
|
|
221
|
+
|
|
222
|
+
### Return type
|
|
223
|
+
|
|
224
|
+
[**License**](License.md)
|
|
225
|
+
|
|
226
|
+
### Authorization
|
|
227
|
+
|
|
228
|
+
[apiKey](../README.md#apiKey), [token](../README.md#token)
|
|
229
|
+
|
|
230
|
+
### HTTP request headers
|
|
231
|
+
|
|
232
|
+
- **Content-Type**: Not defined
|
|
233
|
+
- **Accept**: application/json
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
## get_license_stats
|
|
237
|
+
|
|
238
|
+
> <LicenseStats> get_license_stats(id)
|
|
239
|
+
|
|
240
|
+
Get the stats of a license
|
|
241
|
+
|
|
242
|
+
Daily number of successful activations of the license over the last 90 days, today included, per machine and per version of the application. Days are in UTC.
|
|
243
|
+
|
|
244
|
+
### Examples
|
|
245
|
+
|
|
246
|
+
```ruby
|
|
247
|
+
require 'time'
|
|
248
|
+
require 'license_manager'
|
|
249
|
+
# setup authorization
|
|
250
|
+
LicenseManager.configure do |config|
|
|
251
|
+
# Configure API key authorization: apiKey
|
|
252
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
253
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
254
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
258
|
+
id = 'l3Nv8KwB' # String |
|
|
259
|
+
|
|
260
|
+
begin
|
|
261
|
+
# Get the stats of a license
|
|
262
|
+
result = api_instance.get_license_stats(id)
|
|
263
|
+
p result
|
|
264
|
+
rescue LicenseManager::ApiError => e
|
|
265
|
+
puts "Error when calling LicensesApi->get_license_stats: #{e}"
|
|
266
|
+
end
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### Using the get_license_stats_with_http_info variant
|
|
270
|
+
|
|
271
|
+
This returns an Array which contains the response data, status code and headers.
|
|
272
|
+
|
|
273
|
+
> <Array(<LicenseStats>, Integer, Hash)> get_license_stats_with_http_info(id)
|
|
274
|
+
|
|
275
|
+
```ruby
|
|
276
|
+
begin
|
|
277
|
+
# Get the stats of a license
|
|
278
|
+
data, status_code, headers = api_instance.get_license_stats_with_http_info(id)
|
|
279
|
+
p status_code # => 2xx
|
|
280
|
+
p headers # => { ... }
|
|
281
|
+
p data # => <LicenseStats>
|
|
282
|
+
rescue LicenseManager::ApiError => e
|
|
283
|
+
puts "Error when calling LicensesApi->get_license_stats_with_http_info: #{e}"
|
|
284
|
+
end
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Parameters
|
|
288
|
+
|
|
289
|
+
| Name | Type | Description | Notes |
|
|
290
|
+
| ---- | ---- | ----------- | ----- |
|
|
291
|
+
| **id** | **String** | | |
|
|
292
|
+
|
|
293
|
+
### Return type
|
|
294
|
+
|
|
295
|
+
[**LicenseStats**](LicenseStats.md)
|
|
296
|
+
|
|
297
|
+
### Authorization
|
|
298
|
+
|
|
299
|
+
[apiKey](../README.md#apiKey)
|
|
300
|
+
|
|
301
|
+
### HTTP request headers
|
|
302
|
+
|
|
303
|
+
- **Content-Type**: Not defined
|
|
304
|
+
- **Accept**: application/json
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
## get_signing_key
|
|
308
|
+
|
|
309
|
+
> <SigningKey> get_signing_key
|
|
310
|
+
|
|
311
|
+
Get the organization's signing key
|
|
312
|
+
|
|
313
|
+
Public key verifying the license tokens returned by `validateKey`, to embed in applications. Created the first time it's needed, and never rotated. The organization has a single key, signing the tokens of its live and test products alike: check the tokens' `aud` to tell them apart.
|
|
314
|
+
|
|
315
|
+
### Examples
|
|
316
|
+
|
|
317
|
+
```ruby
|
|
318
|
+
require 'time'
|
|
319
|
+
require 'license_manager'
|
|
320
|
+
# setup authorization
|
|
321
|
+
LicenseManager.configure do |config|
|
|
322
|
+
# Configure API key authorization: apiKey
|
|
323
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
324
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
325
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
329
|
+
|
|
330
|
+
begin
|
|
331
|
+
# Get the organization's signing key
|
|
332
|
+
result = api_instance.get_signing_key
|
|
333
|
+
p result
|
|
334
|
+
rescue LicenseManager::ApiError => e
|
|
335
|
+
puts "Error when calling LicensesApi->get_signing_key: #{e}"
|
|
336
|
+
end
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
#### Using the get_signing_key_with_http_info variant
|
|
340
|
+
|
|
341
|
+
This returns an Array which contains the response data, status code and headers.
|
|
342
|
+
|
|
343
|
+
> <Array(<SigningKey>, Integer, Hash)> get_signing_key_with_http_info
|
|
344
|
+
|
|
345
|
+
```ruby
|
|
346
|
+
begin
|
|
347
|
+
# Get the organization's signing key
|
|
348
|
+
data, status_code, headers = api_instance.get_signing_key_with_http_info
|
|
349
|
+
p status_code # => 2xx
|
|
350
|
+
p headers # => { ... }
|
|
351
|
+
p data # => <SigningKey>
|
|
352
|
+
rescue LicenseManager::ApiError => e
|
|
353
|
+
puts "Error when calling LicensesApi->get_signing_key_with_http_info: #{e}"
|
|
354
|
+
end
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Parameters
|
|
358
|
+
|
|
359
|
+
This endpoint does not need any parameter.
|
|
360
|
+
|
|
361
|
+
### Return type
|
|
362
|
+
|
|
363
|
+
[**SigningKey**](SigningKey.md)
|
|
364
|
+
|
|
365
|
+
### Authorization
|
|
366
|
+
|
|
367
|
+
[apiKey](../README.md#apiKey)
|
|
368
|
+
|
|
369
|
+
### HTTP request headers
|
|
370
|
+
|
|
371
|
+
- **Content-Type**: Not defined
|
|
372
|
+
- **Accept**: application/json
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
## list_customer_licenses
|
|
376
|
+
|
|
377
|
+
> <LicenseList> list_customer_licenses(customer_id, opts)
|
|
378
|
+
|
|
379
|
+
List the licenses of a customer
|
|
380
|
+
|
|
381
|
+
Sorting by `lastActivatedAt` puts the licenses never activated last in both orders. Sorting by `price` compares the amounts whatever their currency, and puts the licenses without a price last in both orders. **Token access**: customer tokens with the `license:read` permission (or the matching write one). A customer token reaches its own licenses.
|
|
382
|
+
|
|
383
|
+
### Examples
|
|
384
|
+
|
|
385
|
+
```ruby
|
|
386
|
+
require 'time'
|
|
387
|
+
require 'license_manager'
|
|
388
|
+
# setup authorization
|
|
389
|
+
LicenseManager.configure do |config|
|
|
390
|
+
# Configure API key authorization: apiKey
|
|
391
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
392
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
393
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
394
|
+
|
|
395
|
+
# Configure Bearer authorization (JWT): token
|
|
396
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
400
|
+
customer_id = 'c9Wd3RtE' # String |
|
|
401
|
+
opts = {
|
|
402
|
+
page: 1, # Integer | Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.
|
|
403
|
+
page_size: 20, # Integer | Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.
|
|
404
|
+
sort: 'key', # String | Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.
|
|
405
|
+
search: 'X9ZPA', # String | Case-insensitive text the key contains.
|
|
406
|
+
key: '7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF', # String | Only returns the license with this exact key, case included. Keys of test products start with `TEST-`.
|
|
407
|
+
policy_id: 'p4Rt8LmQ', # String | Only returns the licenses following this policy.
|
|
408
|
+
machine_version: '2.3.1', # String | Only returns the licenses with at least one active machine running this version of the product.
|
|
409
|
+
status: LicenseManager::LicenseStatus::ACTIVE, # LicenseStatus | Only returns the licenses with this status.
|
|
410
|
+
created_from: Time.parse('2026-01-01T00:00:00.000Z'), # Time | Only returns the licenses created at or after this date.
|
|
411
|
+
created_to: Time.parse('2026-02-01T00:00:00.000Z'), # Time | Only returns the licenses created at or before this date.
|
|
412
|
+
last_activated_from: Time.parse('2026-01-01T00:00:00.000Z'), # Time | Only returns the licenses last activated at or after this date. Licenses never activated are left out.
|
|
413
|
+
last_activated_to: Time.parse('2026-02-01T00:00:00.000Z'), # Time | Only returns the licenses last activated at or before this date. Licenses never activated are left out.
|
|
414
|
+
never_activated: 'true', # String | `true` only returns the licenses never activated, `false` only the ones activated at least once.
|
|
415
|
+
expires_from: Time.parse('2026-01-01T00:00:00.000Z'), # Time | Only returns the licenses expiring at or after this date. Licenses that never expire are left out.
|
|
416
|
+
expires_to: Time.parse('2026-02-01T00:00:00.000Z'), # Time | Only returns the licenses expiring at or before this date. Licenses that never expire are left out.
|
|
417
|
+
never_expires: 'true', # String | `true` only returns the licenses that never expire, `false` only the ones with an expiration date.
|
|
418
|
+
currency: 'USD', # String | Only returns the licenses paid in this currency.
|
|
419
|
+
price: 49.99, # Float | Only returns the licenses paid exactly this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.
|
|
420
|
+
price_min: 49.99, # Float | Only returns the licenses paid at least this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.
|
|
421
|
+
price_max: 49.99, # Float | Only returns the licenses paid at most this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.
|
|
422
|
+
has_price: 'true' # String | `true` only returns the licenses with a price, `false` only the ones without.
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
begin
|
|
426
|
+
# List the licenses of a customer
|
|
427
|
+
result = api_instance.list_customer_licenses(customer_id, opts)
|
|
428
|
+
p result
|
|
429
|
+
rescue LicenseManager::ApiError => e
|
|
430
|
+
puts "Error when calling LicensesApi->list_customer_licenses: #{e}"
|
|
431
|
+
end
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
#### Using the list_customer_licenses_with_http_info variant
|
|
435
|
+
|
|
436
|
+
This returns an Array which contains the response data, status code and headers.
|
|
437
|
+
|
|
438
|
+
> <Array(<LicenseList>, Integer, Hash)> list_customer_licenses_with_http_info(customer_id, opts)
|
|
439
|
+
|
|
440
|
+
```ruby
|
|
441
|
+
begin
|
|
442
|
+
# List the licenses of a customer
|
|
443
|
+
data, status_code, headers = api_instance.list_customer_licenses_with_http_info(customer_id, opts)
|
|
444
|
+
p status_code # => 2xx
|
|
445
|
+
p headers # => { ... }
|
|
446
|
+
p data # => <LicenseList>
|
|
447
|
+
rescue LicenseManager::ApiError => e
|
|
448
|
+
puts "Error when calling LicensesApi->list_customer_licenses_with_http_info: #{e}"
|
|
449
|
+
end
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Parameters
|
|
453
|
+
|
|
454
|
+
| Name | Type | Description | Notes |
|
|
455
|
+
| ---- | ---- | ----------- | ----- |
|
|
456
|
+
| **customer_id** | **String** | | |
|
|
457
|
+
| **page** | **Integer** | Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`. | [optional][default to 1] |
|
|
458
|
+
| **page_size** | **Integer** | Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`. | [optional][default to 20] |
|
|
459
|
+
| **sort** | **String** | Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`. | [optional][default to '-createdAt'] |
|
|
460
|
+
| **search** | **String** | Case-insensitive text the key contains. | [optional] |
|
|
461
|
+
| **key** | **String** | Only returns the license with this exact key, case included. Keys of test products start with `TEST-`. | [optional] |
|
|
462
|
+
| **policy_id** | **String** | Only returns the licenses following this policy. | [optional] |
|
|
463
|
+
| **machine_version** | **String** | Only returns the licenses with at least one active machine running this version of the product. | [optional] |
|
|
464
|
+
| **status** | [**LicenseStatus**](.md) | Only returns the licenses with this status. | [optional] |
|
|
465
|
+
| **created_from** | **Time** | Only returns the licenses created at or after this date. | [optional] |
|
|
466
|
+
| **created_to** | **Time** | Only returns the licenses created at or before this date. | [optional] |
|
|
467
|
+
| **last_activated_from** | **Time** | Only returns the licenses last activated at or after this date. Licenses never activated are left out. | [optional] |
|
|
468
|
+
| **last_activated_to** | **Time** | Only returns the licenses last activated at or before this date. Licenses never activated are left out. | [optional] |
|
|
469
|
+
| **never_activated** | **String** | `true` only returns the licenses never activated, `false` only the ones activated at least once. | [optional] |
|
|
470
|
+
| **expires_from** | **Time** | Only returns the licenses expiring at or after this date. Licenses that never expire are left out. | [optional] |
|
|
471
|
+
| **expires_to** | **Time** | Only returns the licenses expiring at or before this date. Licenses that never expire are left out. | [optional] |
|
|
472
|
+
| **never_expires** | **String** | `true` only returns the licenses that never expire, `false` only the ones with an expiration date. | [optional] |
|
|
473
|
+
| **currency** | **String** | Only returns the licenses paid in this currency. | [optional] |
|
|
474
|
+
| **price** | **Float** | Only returns the licenses paid exactly this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out. | [optional] |
|
|
475
|
+
| **price_min** | **Float** | Only returns the licenses paid at least this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out. | [optional] |
|
|
476
|
+
| **price_max** | **Float** | Only returns the licenses paid at most this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out. | [optional] |
|
|
477
|
+
| **has_price** | **String** | `true` only returns the licenses with a price, `false` only the ones without. | [optional] |
|
|
478
|
+
|
|
479
|
+
### Return type
|
|
480
|
+
|
|
481
|
+
[**LicenseList**](LicenseList.md)
|
|
482
|
+
|
|
483
|
+
### Authorization
|
|
484
|
+
|
|
485
|
+
[apiKey](../README.md#apiKey), [token](../README.md#token)
|
|
486
|
+
|
|
487
|
+
### HTTP request headers
|
|
488
|
+
|
|
489
|
+
- **Content-Type**: Not defined
|
|
490
|
+
- **Accept**: application/json
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
## list_licenses
|
|
494
|
+
|
|
495
|
+
> <LicenseList> list_licenses(product_id, opts)
|
|
496
|
+
|
|
497
|
+
List the licenses of a product
|
|
498
|
+
|
|
499
|
+
Sorting by `lastActivatedAt` puts the licenses never activated last in both orders. Sorting by `price` compares the amounts whatever their currency, and puts the licenses without a price last in both orders.
|
|
500
|
+
|
|
501
|
+
### Examples
|
|
502
|
+
|
|
503
|
+
```ruby
|
|
504
|
+
require 'time'
|
|
505
|
+
require 'license_manager'
|
|
506
|
+
# setup authorization
|
|
507
|
+
LicenseManager.configure do |config|
|
|
508
|
+
# Configure API key authorization: apiKey
|
|
509
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
510
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
511
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
515
|
+
product_id = 'x7Kp2QaZ' # String |
|
|
516
|
+
opts = {
|
|
517
|
+
page: 1, # Integer | Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.
|
|
518
|
+
page_size: 20, # Integer | Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.
|
|
519
|
+
sort: 'key', # String | Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.
|
|
520
|
+
search: 'X9ZPA', # String | Case-insensitive text the key contains.
|
|
521
|
+
key: '7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF', # String | Only returns the license with this exact key, case included. Keys of test products start with `TEST-`.
|
|
522
|
+
policy_id: 'p4Rt8LmQ', # String | Only returns the licenses following this policy.
|
|
523
|
+
customer_id: 'c9Wd3RtE', # String | Only returns the licenses of this customer.
|
|
524
|
+
machine_version: '2.3.1', # String | Only returns the licenses with at least one active machine running this version of the product.
|
|
525
|
+
status: LicenseManager::LicenseStatus::ACTIVE, # LicenseStatus | Only returns the licenses with this status.
|
|
526
|
+
created_from: Time.parse('2026-01-01T00:00:00.000Z'), # Time | Only returns the licenses created at or after this date.
|
|
527
|
+
created_to: Time.parse('2026-02-01T00:00:00.000Z'), # Time | Only returns the licenses created at or before this date.
|
|
528
|
+
last_activated_from: Time.parse('2026-01-01T00:00:00.000Z'), # Time | Only returns the licenses last activated at or after this date. Licenses never activated are left out.
|
|
529
|
+
last_activated_to: Time.parse('2026-02-01T00:00:00.000Z'), # Time | Only returns the licenses last activated at or before this date. Licenses never activated are left out.
|
|
530
|
+
never_activated: 'true', # String | `true` only returns the licenses never activated, `false` only the ones activated at least once.
|
|
531
|
+
expires_from: Time.parse('2026-01-01T00:00:00.000Z'), # Time | Only returns the licenses expiring at or after this date. Licenses that never expire are left out.
|
|
532
|
+
expires_to: Time.parse('2026-02-01T00:00:00.000Z'), # Time | Only returns the licenses expiring at or before this date. Licenses that never expire are left out.
|
|
533
|
+
never_expires: 'true', # String | `true` only returns the licenses that never expire, `false` only the ones with an expiration date.
|
|
534
|
+
currency: 'USD', # String | Only returns the licenses paid in this currency.
|
|
535
|
+
price: 49.99, # Float | Only returns the licenses paid exactly this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.
|
|
536
|
+
price_min: 49.99, # Float | Only returns the licenses paid at least this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.
|
|
537
|
+
price_max: 49.99, # Float | Only returns the licenses paid at most this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.
|
|
538
|
+
has_price: 'true' # String | `true` only returns the licenses with a price, `false` only the ones without.
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
begin
|
|
542
|
+
# List the licenses of a product
|
|
543
|
+
result = api_instance.list_licenses(product_id, opts)
|
|
544
|
+
p result
|
|
545
|
+
rescue LicenseManager::ApiError => e
|
|
546
|
+
puts "Error when calling LicensesApi->list_licenses: #{e}"
|
|
547
|
+
end
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
#### Using the list_licenses_with_http_info variant
|
|
551
|
+
|
|
552
|
+
This returns an Array which contains the response data, status code and headers.
|
|
553
|
+
|
|
554
|
+
> <Array(<LicenseList>, Integer, Hash)> list_licenses_with_http_info(product_id, opts)
|
|
555
|
+
|
|
556
|
+
```ruby
|
|
557
|
+
begin
|
|
558
|
+
# List the licenses of a product
|
|
559
|
+
data, status_code, headers = api_instance.list_licenses_with_http_info(product_id, opts)
|
|
560
|
+
p status_code # => 2xx
|
|
561
|
+
p headers # => { ... }
|
|
562
|
+
p data # => <LicenseList>
|
|
563
|
+
rescue LicenseManager::ApiError => e
|
|
564
|
+
puts "Error when calling LicensesApi->list_licenses_with_http_info: #{e}"
|
|
565
|
+
end
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Parameters
|
|
569
|
+
|
|
570
|
+
| Name | Type | Description | Notes |
|
|
571
|
+
| ---- | ---- | ----------- | ----- |
|
|
572
|
+
| **product_id** | **String** | | |
|
|
573
|
+
| **page** | **Integer** | Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`. | [optional][default to 1] |
|
|
574
|
+
| **page_size** | **Integer** | Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`. | [optional][default to 20] |
|
|
575
|
+
| **sort** | **String** | Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`. | [optional][default to '-createdAt'] |
|
|
576
|
+
| **search** | **String** | Case-insensitive text the key contains. | [optional] |
|
|
577
|
+
| **key** | **String** | Only returns the license with this exact key, case included. Keys of test products start with `TEST-`. | [optional] |
|
|
578
|
+
| **policy_id** | **String** | Only returns the licenses following this policy. | [optional] |
|
|
579
|
+
| **customer_id** | **String** | Only returns the licenses of this customer. | [optional] |
|
|
580
|
+
| **machine_version** | **String** | Only returns the licenses with at least one active machine running this version of the product. | [optional] |
|
|
581
|
+
| **status** | [**LicenseStatus**](.md) | Only returns the licenses with this status. | [optional] |
|
|
582
|
+
| **created_from** | **Time** | Only returns the licenses created at or after this date. | [optional] |
|
|
583
|
+
| **created_to** | **Time** | Only returns the licenses created at or before this date. | [optional] |
|
|
584
|
+
| **last_activated_from** | **Time** | Only returns the licenses last activated at or after this date. Licenses never activated are left out. | [optional] |
|
|
585
|
+
| **last_activated_to** | **Time** | Only returns the licenses last activated at or before this date. Licenses never activated are left out. | [optional] |
|
|
586
|
+
| **never_activated** | **String** | `true` only returns the licenses never activated, `false` only the ones activated at least once. | [optional] |
|
|
587
|
+
| **expires_from** | **Time** | Only returns the licenses expiring at or after this date. Licenses that never expire are left out. | [optional] |
|
|
588
|
+
| **expires_to** | **Time** | Only returns the licenses expiring at or before this date. Licenses that never expire are left out. | [optional] |
|
|
589
|
+
| **never_expires** | **String** | `true` only returns the licenses that never expire, `false` only the ones with an expiration date. | [optional] |
|
|
590
|
+
| **currency** | **String** | Only returns the licenses paid in this currency. | [optional] |
|
|
591
|
+
| **price** | **Float** | Only returns the licenses paid exactly this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out. | [optional] |
|
|
592
|
+
| **price_min** | **Float** | Only returns the licenses paid at least this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out. | [optional] |
|
|
593
|
+
| **price_max** | **Float** | Only returns the licenses paid at most this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out. | [optional] |
|
|
594
|
+
| **has_price** | **String** | `true` only returns the licenses with a price, `false` only the ones without. | [optional] |
|
|
595
|
+
|
|
596
|
+
### Return type
|
|
597
|
+
|
|
598
|
+
[**LicenseList**](LicenseList.md)
|
|
599
|
+
|
|
600
|
+
### Authorization
|
|
601
|
+
|
|
602
|
+
[apiKey](../README.md#apiKey)
|
|
603
|
+
|
|
604
|
+
### HTTP request headers
|
|
605
|
+
|
|
606
|
+
- **Content-Type**: Not defined
|
|
607
|
+
- **Accept**: application/json
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
## send_license_keys
|
|
611
|
+
|
|
612
|
+
> send_license_keys(send_license_keys)
|
|
613
|
+
|
|
614
|
+
Email license keys to their customers
|
|
615
|
+
|
|
616
|
+
Emails each customer the keys of its licenses among `ids`, with their expiration date: one email per customer, whatever their number of licenses. The licenses can belong to different products of the organization. Test products only email the members of the organization, so testing never emails real customers: nothing is sent when a license of a test product belongs to a customer whose email isn't a member's. **Required role permission**: `license:send` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
617
|
+
|
|
618
|
+
### Examples
|
|
619
|
+
|
|
620
|
+
```ruby
|
|
621
|
+
require 'time'
|
|
622
|
+
require 'license_manager'
|
|
623
|
+
# setup authorization
|
|
624
|
+
LicenseManager.configure do |config|
|
|
625
|
+
# Configure API key authorization: apiKey
|
|
626
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
627
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
628
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
629
|
+
end
|
|
630
|
+
|
|
631
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
632
|
+
send_license_keys = LicenseManager::SendLicenseKeys.new({ids: [l3Nv8KwB]}) # SendLicenseKeys |
|
|
633
|
+
|
|
634
|
+
begin
|
|
635
|
+
# Email license keys to their customers
|
|
636
|
+
api_instance.send_license_keys(send_license_keys)
|
|
637
|
+
rescue LicenseManager::ApiError => e
|
|
638
|
+
puts "Error when calling LicensesApi->send_license_keys: #{e}"
|
|
639
|
+
end
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
#### Using the send_license_keys_with_http_info variant
|
|
643
|
+
|
|
644
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
645
|
+
|
|
646
|
+
> <Array(nil, Integer, Hash)> send_license_keys_with_http_info(send_license_keys)
|
|
647
|
+
|
|
648
|
+
```ruby
|
|
649
|
+
begin
|
|
650
|
+
# Email license keys to their customers
|
|
651
|
+
data, status_code, headers = api_instance.send_license_keys_with_http_info(send_license_keys)
|
|
652
|
+
p status_code # => 2xx
|
|
653
|
+
p headers # => { ... }
|
|
654
|
+
p data # => nil
|
|
655
|
+
rescue LicenseManager::ApiError => e
|
|
656
|
+
puts "Error when calling LicensesApi->send_license_keys_with_http_info: #{e}"
|
|
657
|
+
end
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
### Parameters
|
|
661
|
+
|
|
662
|
+
| Name | Type | Description | Notes |
|
|
663
|
+
| ---- | ---- | ----------- | ----- |
|
|
664
|
+
| **send_license_keys** | [**SendLicenseKeys**](SendLicenseKeys.md) | | |
|
|
665
|
+
|
|
666
|
+
### Return type
|
|
667
|
+
|
|
668
|
+
nil (empty response body)
|
|
669
|
+
|
|
670
|
+
### Authorization
|
|
671
|
+
|
|
672
|
+
[apiKey](../README.md#apiKey)
|
|
673
|
+
|
|
674
|
+
### HTTP request headers
|
|
675
|
+
|
|
676
|
+
- **Content-Type**: application/json
|
|
677
|
+
- **Accept**: application/json
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
## update_license
|
|
681
|
+
|
|
682
|
+
> <License> update_license(id, update_license)
|
|
683
|
+
|
|
684
|
+
Update a license
|
|
685
|
+
|
|
686
|
+
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.
|
|
687
|
+
|
|
688
|
+
### Examples
|
|
689
|
+
|
|
690
|
+
```ruby
|
|
691
|
+
require 'time'
|
|
692
|
+
require 'license_manager'
|
|
693
|
+
# setup authorization
|
|
694
|
+
LicenseManager.configure do |config|
|
|
695
|
+
# Configure API key authorization: apiKey
|
|
696
|
+
config.api_key['x-api-key'] = 'YOUR API KEY'
|
|
697
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
698
|
+
# config.api_key_prefix['x-api-key'] = 'Bearer'
|
|
699
|
+
end
|
|
700
|
+
|
|
701
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
702
|
+
id = 'l3Nv8KwB' # String |
|
|
703
|
+
update_license = LicenseManager::UpdateLicense.new # UpdateLicense |
|
|
704
|
+
|
|
705
|
+
begin
|
|
706
|
+
# Update a license
|
|
707
|
+
result = api_instance.update_license(id, update_license)
|
|
708
|
+
p result
|
|
709
|
+
rescue LicenseManager::ApiError => e
|
|
710
|
+
puts "Error when calling LicensesApi->update_license: #{e}"
|
|
711
|
+
end
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
#### Using the update_license_with_http_info variant
|
|
715
|
+
|
|
716
|
+
This returns an Array which contains the response data, status code and headers.
|
|
717
|
+
|
|
718
|
+
> <Array(<License>, Integer, Hash)> update_license_with_http_info(id, update_license)
|
|
719
|
+
|
|
720
|
+
```ruby
|
|
721
|
+
begin
|
|
722
|
+
# Update a license
|
|
723
|
+
data, status_code, headers = api_instance.update_license_with_http_info(id, update_license)
|
|
724
|
+
p status_code # => 2xx
|
|
725
|
+
p headers # => { ... }
|
|
726
|
+
p data # => <License>
|
|
727
|
+
rescue LicenseManager::ApiError => e
|
|
728
|
+
puts "Error when calling LicensesApi->update_license_with_http_info: #{e}"
|
|
729
|
+
end
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
### Parameters
|
|
733
|
+
|
|
734
|
+
| Name | Type | Description | Notes |
|
|
735
|
+
| ---- | ---- | ----------- | ----- |
|
|
736
|
+
| **id** | **String** | | |
|
|
737
|
+
| **update_license** | [**UpdateLicense**](UpdateLicense.md) | | |
|
|
738
|
+
|
|
739
|
+
### Return type
|
|
740
|
+
|
|
741
|
+
[**License**](License.md)
|
|
742
|
+
|
|
743
|
+
### Authorization
|
|
744
|
+
|
|
745
|
+
[apiKey](../README.md#apiKey)
|
|
746
|
+
|
|
747
|
+
### HTTP request headers
|
|
748
|
+
|
|
749
|
+
- **Content-Type**: application/json
|
|
750
|
+
- **Accept**: application/json
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
## validate_key
|
|
754
|
+
|
|
755
|
+
> <LicenseToken> validate_key(product_id, validate_key)
|
|
756
|
+
|
|
757
|
+
Validate a license key
|
|
758
|
+
|
|
759
|
+
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.
|
|
760
|
+
|
|
761
|
+
### Examples
|
|
762
|
+
|
|
763
|
+
```ruby
|
|
764
|
+
require 'time'
|
|
765
|
+
require 'license_manager'
|
|
766
|
+
|
|
767
|
+
api_instance = LicenseManager::LicensesApi.new
|
|
768
|
+
product_id = 'x7Kp2QaZ' # String |
|
|
769
|
+
validate_key = LicenseManager::ValidateKey.new({key: '7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF', fingerprint: '4c:32:75:8f:9a:1e', version: '1.4.2'}) # ValidateKey |
|
|
770
|
+
|
|
771
|
+
begin
|
|
772
|
+
# Validate a license key
|
|
773
|
+
result = api_instance.validate_key(product_id, validate_key)
|
|
774
|
+
p result
|
|
775
|
+
rescue LicenseManager::ApiError => e
|
|
776
|
+
puts "Error when calling LicensesApi->validate_key: #{e}"
|
|
777
|
+
end
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
#### Using the validate_key_with_http_info variant
|
|
781
|
+
|
|
782
|
+
This returns an Array which contains the response data, status code and headers.
|
|
783
|
+
|
|
784
|
+
> <Array(<LicenseToken>, Integer, Hash)> validate_key_with_http_info(product_id, validate_key)
|
|
785
|
+
|
|
786
|
+
```ruby
|
|
787
|
+
begin
|
|
788
|
+
# Validate a license key
|
|
789
|
+
data, status_code, headers = api_instance.validate_key_with_http_info(product_id, validate_key)
|
|
790
|
+
p status_code # => 2xx
|
|
791
|
+
p headers # => { ... }
|
|
792
|
+
p data # => <LicenseToken>
|
|
793
|
+
rescue LicenseManager::ApiError => e
|
|
794
|
+
puts "Error when calling LicensesApi->validate_key_with_http_info: #{e}"
|
|
795
|
+
end
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
### Parameters
|
|
799
|
+
|
|
800
|
+
| Name | Type | Description | Notes |
|
|
801
|
+
| ---- | ---- | ----------- | ----- |
|
|
802
|
+
| **product_id** | **String** | | |
|
|
803
|
+
| **validate_key** | [**ValidateKey**](ValidateKey.md) | | |
|
|
804
|
+
|
|
805
|
+
### Return type
|
|
806
|
+
|
|
807
|
+
[**LicenseToken**](LicenseToken.md)
|
|
808
|
+
|
|
809
|
+
### Authorization
|
|
810
|
+
|
|
811
|
+
No authorization required
|
|
812
|
+
|
|
813
|
+
### HTTP request headers
|
|
814
|
+
|
|
815
|
+
- **Content-Type**: application/json
|
|
816
|
+
- **Accept**: application/json
|
|
817
|
+
|