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
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#LicenseManager API
|
|
3
|
+
|
|
4
|
+
#Public API. Authenticate with an organization API key, or with a token scoped to a customer, license or machine on the endpoints that accept one. ## Conventions - **Errors** answer `{ \"error\": { \"code\", \"message\" } }`. Branch on `code`, which is stable, not on `message`. Each response lists the codes it can return, except `404`, which answers `not_found` unless it says otherwise. Unexpected errors answer `500` with `internal_error`. - **Validation** errors answer `422`, not `400`, with the `validation_error` code and an `issues` array giving the `path` and `message` of each invalid value. - **Unknown body fields are ignored**, not rejected: sending a field an endpoint doesn't accept, like `policyId` to `updateLicense`, changes nothing and doesn't fail. - **Strings** are trimmed before they're validated and stored. Emails are stored lower cased. - **Updates** only change the fields that are sent. A field sent as `null` is cleared, when it can be. - **Dates** can be sent with any offset, and are always returned in UTC, like `2026-01-15T09:30:00.000Z`. Calendar months and days are counted in UTC. - **Ids** are 8 letters and digits, after `test_` for test products and their resources. - **Lists** are paginated with `page` and `pageSize`. Items with the same value for the `sort` field are ordered by id, so pages are stable, but items created or deleted between two requests shift the pages. Items without a value for the `sort` field come last in ascending order, and first in descending order, unless the endpoint says otherwise. - **Test products** are sandboxes of a live product. Test API keys only reach test products, live API keys only live ones: the others answer `404`, as if they didn't exist. Sessions and tokens reach both.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.26.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module LicenseManager
|
|
16
|
+
class ReleasesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a release
|
|
23
|
+
# Releases don't restrict which versions `validateKey` accepts: a machine can run a version without a release. They give the `latestAllowedVersion` of its `version_not_allowed` errors, among the stable releases already released, and the number of active machines running each version. **Required role permission**: `release:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
24
|
+
# @param product_id [String]
|
|
25
|
+
# @param create_release [CreateRelease]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [Release]
|
|
28
|
+
def create_release(product_id, create_release, opts = {})
|
|
29
|
+
data, _status_code, _headers = create_release_with_http_info(product_id, create_release, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Create a release
|
|
34
|
+
# Releases don't restrict which versions `validateKey` accepts: a machine can run a version without a release. They give the `latestAllowedVersion` of its `version_not_allowed` errors, among the stable releases already released, and the number of active machines running each version. **Required role permission**: `release:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
35
|
+
# @param product_id [String]
|
|
36
|
+
# @param create_release [CreateRelease]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(Release, Integer, Hash)>] Release data, response status code and response headers
|
|
39
|
+
def create_release_with_http_info(product_id, create_release, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: ReleasesApi.create_release ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'product_id' is set
|
|
44
|
+
if @api_client.config.client_side_validation && product_id.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'product_id' when calling ReleasesApi.create_release"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'create_release' is set
|
|
48
|
+
if @api_client.config.client_side_validation && create_release.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'create_release' when calling ReleasesApi.create_release"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/v1/products/{productId}/releases'.sub('{productId}', CGI.escape(product_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(create_release)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'Release'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"ReleasesApi.create_release",
|
|
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: ReleasesApi#create_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Delete a release
|
|
97
|
+
# **Required role permission**: `release:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
98
|
+
# @param id [String]
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @return [nil]
|
|
101
|
+
def delete_release(id, opts = {})
|
|
102
|
+
delete_release_with_http_info(id, opts)
|
|
103
|
+
nil
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Delete a release
|
|
107
|
+
# **Required role permission**: `release:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
108
|
+
# @param id [String]
|
|
109
|
+
# @param [Hash] opts the optional parameters
|
|
110
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
111
|
+
def delete_release_with_http_info(id, opts = {})
|
|
112
|
+
if @api_client.config.debugging
|
|
113
|
+
@api_client.config.logger.debug 'Calling API: ReleasesApi.delete_release ...'
|
|
114
|
+
end
|
|
115
|
+
# verify the required parameter 'id' is set
|
|
116
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
117
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ReleasesApi.delete_release"
|
|
118
|
+
end
|
|
119
|
+
# resource path
|
|
120
|
+
local_var_path = '/v1/releases/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
121
|
+
|
|
122
|
+
# query parameters
|
|
123
|
+
query_params = opts[:query_params] || {}
|
|
124
|
+
|
|
125
|
+
# header parameters
|
|
126
|
+
header_params = opts[:header_params] || {}
|
|
127
|
+
# HTTP header 'Accept' (if needed)
|
|
128
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
129
|
+
|
|
130
|
+
# form parameters
|
|
131
|
+
form_params = opts[:form_params] || {}
|
|
132
|
+
|
|
133
|
+
# http body (model)
|
|
134
|
+
post_body = opts[:debug_body]
|
|
135
|
+
|
|
136
|
+
# return_type
|
|
137
|
+
return_type = opts[:debug_return_type]
|
|
138
|
+
|
|
139
|
+
# auth_names
|
|
140
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
141
|
+
|
|
142
|
+
new_options = opts.merge(
|
|
143
|
+
:operation => :"ReleasesApi.delete_release",
|
|
144
|
+
:header_params => header_params,
|
|
145
|
+
:query_params => query_params,
|
|
146
|
+
:form_params => form_params,
|
|
147
|
+
:body => post_body,
|
|
148
|
+
:auth_names => auth_names,
|
|
149
|
+
:return_type => return_type
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
153
|
+
if @api_client.config.debugging
|
|
154
|
+
@api_client.config.logger.debug "API called: ReleasesApi#delete_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
155
|
+
end
|
|
156
|
+
return data, status_code, headers
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Get a release
|
|
160
|
+
# @param id [String]
|
|
161
|
+
# @param [Hash] opts the optional parameters
|
|
162
|
+
# @return [Release]
|
|
163
|
+
def get_release(id, opts = {})
|
|
164
|
+
data, _status_code, _headers = get_release_with_http_info(id, opts)
|
|
165
|
+
data
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Get a release
|
|
169
|
+
# @param id [String]
|
|
170
|
+
# @param [Hash] opts the optional parameters
|
|
171
|
+
# @return [Array<(Release, Integer, Hash)>] Release data, response status code and response headers
|
|
172
|
+
def get_release_with_http_info(id, opts = {})
|
|
173
|
+
if @api_client.config.debugging
|
|
174
|
+
@api_client.config.logger.debug 'Calling API: ReleasesApi.get_release ...'
|
|
175
|
+
end
|
|
176
|
+
# verify the required parameter 'id' is set
|
|
177
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
178
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ReleasesApi.get_release"
|
|
179
|
+
end
|
|
180
|
+
# resource path
|
|
181
|
+
local_var_path = '/v1/releases/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
182
|
+
|
|
183
|
+
# query parameters
|
|
184
|
+
query_params = opts[:query_params] || {}
|
|
185
|
+
|
|
186
|
+
# header parameters
|
|
187
|
+
header_params = opts[:header_params] || {}
|
|
188
|
+
# HTTP header 'Accept' (if needed)
|
|
189
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
190
|
+
|
|
191
|
+
# form parameters
|
|
192
|
+
form_params = opts[:form_params] || {}
|
|
193
|
+
|
|
194
|
+
# http body (model)
|
|
195
|
+
post_body = opts[:debug_body]
|
|
196
|
+
|
|
197
|
+
# return_type
|
|
198
|
+
return_type = opts[:debug_return_type] || 'Release'
|
|
199
|
+
|
|
200
|
+
# auth_names
|
|
201
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
202
|
+
|
|
203
|
+
new_options = opts.merge(
|
|
204
|
+
:operation => :"ReleasesApi.get_release",
|
|
205
|
+
:header_params => header_params,
|
|
206
|
+
:query_params => query_params,
|
|
207
|
+
:form_params => form_params,
|
|
208
|
+
:body => post_body,
|
|
209
|
+
:auth_names => auth_names,
|
|
210
|
+
:return_type => return_type
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
214
|
+
if @api_client.config.debugging
|
|
215
|
+
@api_client.config.logger.debug "API called: ReleasesApi#get_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
216
|
+
end
|
|
217
|
+
return data, status_code, headers
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# List the releases of a product
|
|
221
|
+
# Sorting by `version` compares the major, minor and patch numbers as numbers, then puts a pre-release before its stable release. Pre-releases of the same version compare as text, unlike semantic versioning: `2.0.0-beta.10` comes before `2.0.0-beta.2`. Build metadata is ignored.
|
|
222
|
+
# @param product_id [String]
|
|
223
|
+
# @param [Hash] opts the optional parameters
|
|
224
|
+
# @option opts [Integer] :page 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`. (default to 1)
|
|
225
|
+
# @option opts [Integer] :page_size 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`. (default to 20)
|
|
226
|
+
# @option opts [String] :sort Field to sort by, prefixed with `-` for descending order. Defaults to `-version`. (default to '-version')
|
|
227
|
+
# @option opts [String] :search Case-insensitive text the version contains.
|
|
228
|
+
# @option opts [Time] :released_from Only returns the releases released at or after this date.
|
|
229
|
+
# @option opts [Time] :released_to Only returns the releases released at or before this date.
|
|
230
|
+
# @option opts [Integer] :active_machine_count Only returns the releases running on exactly this number of active machines.
|
|
231
|
+
# @option opts [Integer] :active_machine_count_min Only returns the releases running on at least this number of active machines.
|
|
232
|
+
# @option opts [Integer] :active_machine_count_max Only returns the releases running on at most this number of active machines.
|
|
233
|
+
# @return [ReleaseList]
|
|
234
|
+
def list_releases(product_id, opts = {})
|
|
235
|
+
data, _status_code, _headers = list_releases_with_http_info(product_id, opts)
|
|
236
|
+
data
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# List the releases of a product
|
|
240
|
+
# Sorting by `version` compares the major, minor and patch numbers as numbers, then puts a pre-release before its stable release. Pre-releases of the same version compare as text, unlike semantic versioning: `2.0.0-beta.10` comes before `2.0.0-beta.2`. Build metadata is ignored.
|
|
241
|
+
# @param product_id [String]
|
|
242
|
+
# @param [Hash] opts the optional parameters
|
|
243
|
+
# @option opts [Integer] :page 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`. (default to 1)
|
|
244
|
+
# @option opts [Integer] :page_size 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`. (default to 20)
|
|
245
|
+
# @option opts [String] :sort Field to sort by, prefixed with `-` for descending order. Defaults to `-version`. (default to '-version')
|
|
246
|
+
# @option opts [String] :search Case-insensitive text the version contains.
|
|
247
|
+
# @option opts [Time] :released_from Only returns the releases released at or after this date.
|
|
248
|
+
# @option opts [Time] :released_to Only returns the releases released at or before this date.
|
|
249
|
+
# @option opts [Integer] :active_machine_count Only returns the releases running on exactly this number of active machines.
|
|
250
|
+
# @option opts [Integer] :active_machine_count_min Only returns the releases running on at least this number of active machines.
|
|
251
|
+
# @option opts [Integer] :active_machine_count_max Only returns the releases running on at most this number of active machines.
|
|
252
|
+
# @return [Array<(ReleaseList, Integer, Hash)>] ReleaseList data, response status code and response headers
|
|
253
|
+
def list_releases_with_http_info(product_id, opts = {})
|
|
254
|
+
if @api_client.config.debugging
|
|
255
|
+
@api_client.config.logger.debug 'Calling API: ReleasesApi.list_releases ...'
|
|
256
|
+
end
|
|
257
|
+
# verify the required parameter 'product_id' is set
|
|
258
|
+
if @api_client.config.client_side_validation && product_id.nil?
|
|
259
|
+
fail ArgumentError, "Missing the required parameter 'product_id' when calling ReleasesApi.list_releases"
|
|
260
|
+
end
|
|
261
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
262
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ReleasesApi.list_releases, must be greater than or equal to 1.'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
|
266
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ReleasesApi.list_releases, must be smaller than or equal to 100.'
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
|
270
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ReleasesApi.list_releases, must be greater than or equal to 1.'
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
allowable_values = ["version", "-version", "releasedAt", "-releasedAt", "createdAt", "-createdAt", "activeMachineCount", "-activeMachineCount", "unknown_default_open_api"]
|
|
274
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
|
275
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
|
276
|
+
end
|
|
277
|
+
if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 200
|
|
278
|
+
fail ArgumentError, 'invalid value for "opts[:"search"]" when calling ReleasesApi.list_releases, the character length must be smaller than or equal to 200.'
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length < 1
|
|
282
|
+
fail ArgumentError, 'invalid value for "opts[:"search"]" when calling ReleasesApi.list_releases, the character length must be greater than or equal to 1.'
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# resource path
|
|
286
|
+
local_var_path = '/v1/products/{productId}/releases'.sub('{productId}', CGI.escape(product_id.to_s))
|
|
287
|
+
|
|
288
|
+
# query parameters
|
|
289
|
+
query_params = opts[:query_params] || {}
|
|
290
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
291
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
292
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
293
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
|
294
|
+
query_params[:'releasedFrom'] = opts[:'released_from'] if !opts[:'released_from'].nil?
|
|
295
|
+
query_params[:'releasedTo'] = opts[:'released_to'] if !opts[:'released_to'].nil?
|
|
296
|
+
query_params[:'activeMachineCount'] = opts[:'active_machine_count'] if !opts[:'active_machine_count'].nil?
|
|
297
|
+
query_params[:'activeMachineCountMin'] = opts[:'active_machine_count_min'] if !opts[:'active_machine_count_min'].nil?
|
|
298
|
+
query_params[:'activeMachineCountMax'] = opts[:'active_machine_count_max'] if !opts[:'active_machine_count_max'].nil?
|
|
299
|
+
|
|
300
|
+
# header parameters
|
|
301
|
+
header_params = opts[:header_params] || {}
|
|
302
|
+
# HTTP header 'Accept' (if needed)
|
|
303
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
304
|
+
|
|
305
|
+
# form parameters
|
|
306
|
+
form_params = opts[:form_params] || {}
|
|
307
|
+
|
|
308
|
+
# http body (model)
|
|
309
|
+
post_body = opts[:debug_body]
|
|
310
|
+
|
|
311
|
+
# return_type
|
|
312
|
+
return_type = opts[:debug_return_type] || 'ReleaseList'
|
|
313
|
+
|
|
314
|
+
# auth_names
|
|
315
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
316
|
+
|
|
317
|
+
new_options = opts.merge(
|
|
318
|
+
:operation => :"ReleasesApi.list_releases",
|
|
319
|
+
:header_params => header_params,
|
|
320
|
+
:query_params => query_params,
|
|
321
|
+
:form_params => form_params,
|
|
322
|
+
:body => post_body,
|
|
323
|
+
:auth_names => auth_names,
|
|
324
|
+
:return_type => return_type
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
328
|
+
if @api_client.config.debugging
|
|
329
|
+
@api_client.config.logger.debug "API called: ReleasesApi#list_releases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
330
|
+
end
|
|
331
|
+
return data, status_code, headers
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Update a release
|
|
335
|
+
# **Required role permission**: `release:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
336
|
+
# @param id [String]
|
|
337
|
+
# @param update_release [UpdateRelease]
|
|
338
|
+
# @param [Hash] opts the optional parameters
|
|
339
|
+
# @return [Release]
|
|
340
|
+
def update_release(id, update_release, opts = {})
|
|
341
|
+
data, _status_code, _headers = update_release_with_http_info(id, update_release, opts)
|
|
342
|
+
data
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Update a release
|
|
346
|
+
# **Required role permission**: `release:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
347
|
+
# @param id [String]
|
|
348
|
+
# @param update_release [UpdateRelease]
|
|
349
|
+
# @param [Hash] opts the optional parameters
|
|
350
|
+
# @return [Array<(Release, Integer, Hash)>] Release data, response status code and response headers
|
|
351
|
+
def update_release_with_http_info(id, update_release, opts = {})
|
|
352
|
+
if @api_client.config.debugging
|
|
353
|
+
@api_client.config.logger.debug 'Calling API: ReleasesApi.update_release ...'
|
|
354
|
+
end
|
|
355
|
+
# verify the required parameter 'id' is set
|
|
356
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
357
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ReleasesApi.update_release"
|
|
358
|
+
end
|
|
359
|
+
# verify the required parameter 'update_release' is set
|
|
360
|
+
if @api_client.config.client_side_validation && update_release.nil?
|
|
361
|
+
fail ArgumentError, "Missing the required parameter 'update_release' when calling ReleasesApi.update_release"
|
|
362
|
+
end
|
|
363
|
+
# resource path
|
|
364
|
+
local_var_path = '/v1/releases/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
365
|
+
|
|
366
|
+
# query parameters
|
|
367
|
+
query_params = opts[:query_params] || {}
|
|
368
|
+
|
|
369
|
+
# header parameters
|
|
370
|
+
header_params = opts[:header_params] || {}
|
|
371
|
+
# HTTP header 'Accept' (if needed)
|
|
372
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
373
|
+
# HTTP header 'Content-Type'
|
|
374
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
375
|
+
if !content_type.nil?
|
|
376
|
+
header_params['Content-Type'] = content_type
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# form parameters
|
|
380
|
+
form_params = opts[:form_params] || {}
|
|
381
|
+
|
|
382
|
+
# http body (model)
|
|
383
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_release)
|
|
384
|
+
|
|
385
|
+
# return_type
|
|
386
|
+
return_type = opts[:debug_return_type] || 'Release'
|
|
387
|
+
|
|
388
|
+
# auth_names
|
|
389
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
390
|
+
|
|
391
|
+
new_options = opts.merge(
|
|
392
|
+
:operation => :"ReleasesApi.update_release",
|
|
393
|
+
:header_params => header_params,
|
|
394
|
+
:query_params => query_params,
|
|
395
|
+
:form_params => form_params,
|
|
396
|
+
:body => post_body,
|
|
397
|
+
:auth_names => auth_names,
|
|
398
|
+
:return_type => return_type
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
402
|
+
if @api_client.config.debugging
|
|
403
|
+
@api_client.config.logger.debug "API called: ReleasesApi#update_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
404
|
+
end
|
|
405
|
+
return data, status_code, headers
|
|
406
|
+
end
|
|
407
|
+
end
|
|
408
|
+
end
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#LicenseManager API
|
|
3
|
+
|
|
4
|
+
#Public API. Authenticate with an organization API key, or with a token scoped to a customer, license or machine on the endpoints that accept one. ## Conventions - **Errors** answer `{ \"error\": { \"code\", \"message\" } }`. Branch on `code`, which is stable, not on `message`. Each response lists the codes it can return, except `404`, which answers `not_found` unless it says otherwise. Unexpected errors answer `500` with `internal_error`. - **Validation** errors answer `422`, not `400`, with the `validation_error` code and an `issues` array giving the `path` and `message` of each invalid value. - **Unknown body fields are ignored**, not rejected: sending a field an endpoint doesn't accept, like `policyId` to `updateLicense`, changes nothing and doesn't fail. - **Strings** are trimmed before they're validated and stored. Emails are stored lower cased. - **Updates** only change the fields that are sent. A field sent as `null` is cleared, when it can be. - **Dates** can be sent with any offset, and are always returned in UTC, like `2026-01-15T09:30:00.000Z`. Calendar months and days are counted in UTC. - **Ids** are 8 letters and digits, after `test_` for test products and their resources. - **Lists** are paginated with `page` and `pageSize`. Items with the same value for the `sort` field are ordered by id, so pages are stable, but items created or deleted between two requests shift the pages. Items without a value for the `sort` field come last in ascending order, and first in descending order, unless the endpoint says otherwise. - **Test products** are sandboxes of a live product. Test API keys only reach test products, live API keys only live ones: the others answer `404`, as if they didn't exist. Sessions and tokens reach both.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.26.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module LicenseManager
|
|
16
|
+
class TokensApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a customer token
|
|
23
|
+
# Creates a token scoped to the customer, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches. A token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted. **Required role permission**: `token: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 create_token [CreateToken]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [Token]
|
|
28
|
+
def create_customer_token(id, create_token, opts = {})
|
|
29
|
+
data, _status_code, _headers = create_customer_token_with_http_info(id, create_token, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Create a customer token
|
|
34
|
+
# Creates a token scoped to the customer, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches. A token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted. **Required role permission**: `token: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 create_token [CreateToken]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(Token, Integer, Hash)>] Token data, response status code and response headers
|
|
39
|
+
def create_customer_token_with_http_info(id, create_token, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.create_customer_token ...'
|
|
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 TokensApi.create_customer_token"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'create_token' is set
|
|
48
|
+
if @api_client.config.client_side_validation && create_token.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'create_token' when calling TokensApi.create_customer_token"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/v1/customers/{id}/tokens'.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(create_token)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'Token'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"TokensApi.create_customer_token",
|
|
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: TokensApi#create_customer_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Create a license token
|
|
97
|
+
# Creates a token scoped to the license, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches. A token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted. **Token access**: customer tokens. A customer token creates tokens for its customer's licenses, with the permissions and at most the expiration it has. **Required role permission**: `token:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
98
|
+
# @param id [String]
|
|
99
|
+
# @param create_token [CreateToken]
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @return [Token]
|
|
102
|
+
def create_license_token(id, create_token, opts = {})
|
|
103
|
+
data, _status_code, _headers = create_license_token_with_http_info(id, create_token, opts)
|
|
104
|
+
data
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Create a license token
|
|
108
|
+
# Creates a token scoped to the license, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches. A token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted. **Token access**: customer tokens. A customer token creates tokens for its customer's licenses, with the permissions and at most the expiration it has. **Required role permission**: `token:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
109
|
+
# @param id [String]
|
|
110
|
+
# @param create_token [CreateToken]
|
|
111
|
+
# @param [Hash] opts the optional parameters
|
|
112
|
+
# @return [Array<(Token, Integer, Hash)>] Token data, response status code and response headers
|
|
113
|
+
def create_license_token_with_http_info(id, create_token, opts = {})
|
|
114
|
+
if @api_client.config.debugging
|
|
115
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.create_license_token ...'
|
|
116
|
+
end
|
|
117
|
+
# verify the required parameter 'id' is set
|
|
118
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
119
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TokensApi.create_license_token"
|
|
120
|
+
end
|
|
121
|
+
# verify the required parameter 'create_token' is set
|
|
122
|
+
if @api_client.config.client_side_validation && create_token.nil?
|
|
123
|
+
fail ArgumentError, "Missing the required parameter 'create_token' when calling TokensApi.create_license_token"
|
|
124
|
+
end
|
|
125
|
+
# resource path
|
|
126
|
+
local_var_path = '/v1/licenses/{id}/tokens'.sub('{id}', CGI.escape(id.to_s))
|
|
127
|
+
|
|
128
|
+
# query parameters
|
|
129
|
+
query_params = opts[:query_params] || {}
|
|
130
|
+
|
|
131
|
+
# header parameters
|
|
132
|
+
header_params = opts[:header_params] || {}
|
|
133
|
+
# HTTP header 'Accept' (if needed)
|
|
134
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
135
|
+
# HTTP header 'Content-Type'
|
|
136
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
137
|
+
if !content_type.nil?
|
|
138
|
+
header_params['Content-Type'] = content_type
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# form parameters
|
|
142
|
+
form_params = opts[:form_params] || {}
|
|
143
|
+
|
|
144
|
+
# http body (model)
|
|
145
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_token)
|
|
146
|
+
|
|
147
|
+
# return_type
|
|
148
|
+
return_type = opts[:debug_return_type] || 'Token'
|
|
149
|
+
|
|
150
|
+
# auth_names
|
|
151
|
+
auth_names = opts[:debug_auth_names] || ['apiKey', 'token']
|
|
152
|
+
|
|
153
|
+
new_options = opts.merge(
|
|
154
|
+
:operation => :"TokensApi.create_license_token",
|
|
155
|
+
:header_params => header_params,
|
|
156
|
+
:query_params => query_params,
|
|
157
|
+
:form_params => form_params,
|
|
158
|
+
:body => post_body,
|
|
159
|
+
:auth_names => auth_names,
|
|
160
|
+
:return_type => return_type
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
164
|
+
if @api_client.config.debugging
|
|
165
|
+
@api_client.config.logger.debug "API called: TokensApi#create_license_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
166
|
+
end
|
|
167
|
+
return data, status_code, headers
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Create a machine token
|
|
171
|
+
# Creates a token scoped to the machine, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches. A token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted. **Token access**: customer, license tokens. A customer or license token creates tokens for the machines it reaches, with the permissions and at most the expiration it has. **Required role permission**: `token:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
172
|
+
# @param id [String]
|
|
173
|
+
# @param create_token [CreateToken]
|
|
174
|
+
# @param [Hash] opts the optional parameters
|
|
175
|
+
# @return [Token]
|
|
176
|
+
def create_machine_token(id, create_token, opts = {})
|
|
177
|
+
data, _status_code, _headers = create_machine_token_with_http_info(id, create_token, opts)
|
|
178
|
+
data
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Create a machine token
|
|
182
|
+
# Creates a token scoped to the machine, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches. A token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted. **Token access**: customer, license tokens. A customer or license token creates tokens for the machines it reaches, with the permissions and at most the expiration it has. **Required role permission**: `token:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
|
|
183
|
+
# @param id [String]
|
|
184
|
+
# @param create_token [CreateToken]
|
|
185
|
+
# @param [Hash] opts the optional parameters
|
|
186
|
+
# @return [Array<(Token, Integer, Hash)>] Token data, response status code and response headers
|
|
187
|
+
def create_machine_token_with_http_info(id, create_token, opts = {})
|
|
188
|
+
if @api_client.config.debugging
|
|
189
|
+
@api_client.config.logger.debug 'Calling API: TokensApi.create_machine_token ...'
|
|
190
|
+
end
|
|
191
|
+
# verify the required parameter 'id' is set
|
|
192
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
193
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TokensApi.create_machine_token"
|
|
194
|
+
end
|
|
195
|
+
# verify the required parameter 'create_token' is set
|
|
196
|
+
if @api_client.config.client_side_validation && create_token.nil?
|
|
197
|
+
fail ArgumentError, "Missing the required parameter 'create_token' when calling TokensApi.create_machine_token"
|
|
198
|
+
end
|
|
199
|
+
# resource path
|
|
200
|
+
local_var_path = '/v1/machines/{id}/tokens'.sub('{id}', CGI.escape(id.to_s))
|
|
201
|
+
|
|
202
|
+
# query parameters
|
|
203
|
+
query_params = opts[:query_params] || {}
|
|
204
|
+
|
|
205
|
+
# header parameters
|
|
206
|
+
header_params = opts[:header_params] || {}
|
|
207
|
+
# HTTP header 'Accept' (if needed)
|
|
208
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
209
|
+
# HTTP header 'Content-Type'
|
|
210
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
211
|
+
if !content_type.nil?
|
|
212
|
+
header_params['Content-Type'] = content_type
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# form parameters
|
|
216
|
+
form_params = opts[:form_params] || {}
|
|
217
|
+
|
|
218
|
+
# http body (model)
|
|
219
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_token)
|
|
220
|
+
|
|
221
|
+
# return_type
|
|
222
|
+
return_type = opts[:debug_return_type] || 'Token'
|
|
223
|
+
|
|
224
|
+
# auth_names
|
|
225
|
+
auth_names = opts[:debug_auth_names] || ['apiKey', 'token']
|
|
226
|
+
|
|
227
|
+
new_options = opts.merge(
|
|
228
|
+
:operation => :"TokensApi.create_machine_token",
|
|
229
|
+
:header_params => header_params,
|
|
230
|
+
:query_params => query_params,
|
|
231
|
+
:form_params => form_params,
|
|
232
|
+
:body => post_body,
|
|
233
|
+
:auth_names => auth_names,
|
|
234
|
+
:return_type => return_type
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
238
|
+
if @api_client.config.debugging
|
|
239
|
+
@api_client.config.logger.debug "API called: TokensApi#create_machine_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
240
|
+
end
|
|
241
|
+
return data, status_code, headers
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
end
|