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,435 @@
|
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module LicenseManager
|
|
17
|
+
class IntegrationMapping < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :integration_id
|
|
21
|
+
|
|
22
|
+
attr_accessor :product_id
|
|
23
|
+
|
|
24
|
+
attr_accessor :policy_id
|
|
25
|
+
|
|
26
|
+
attr_accessor :stripe_product_id
|
|
27
|
+
|
|
28
|
+
attr_accessor :stripe_price_id
|
|
29
|
+
|
|
30
|
+
# Name of the Stripe product when it was mapped.
|
|
31
|
+
attr_accessor :product_name
|
|
32
|
+
|
|
33
|
+
attr_accessor :price
|
|
34
|
+
|
|
35
|
+
# `error` when the price can no longer be paid, explained by `statusReason`.
|
|
36
|
+
attr_accessor :status
|
|
37
|
+
|
|
38
|
+
attr_accessor :status_reason
|
|
39
|
+
|
|
40
|
+
attr_accessor :created_at
|
|
41
|
+
|
|
42
|
+
class EnumAttributeValidator
|
|
43
|
+
attr_reader :datatype
|
|
44
|
+
attr_reader :allowable_values
|
|
45
|
+
|
|
46
|
+
def initialize(datatype, allowable_values)
|
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
|
48
|
+
case datatype.to_s
|
|
49
|
+
when /Integer/i
|
|
50
|
+
value.to_i
|
|
51
|
+
when /Float/i
|
|
52
|
+
value.to_f
|
|
53
|
+
else
|
|
54
|
+
value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def valid?(value)
|
|
60
|
+
!value || allowable_values.include?(value)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
65
|
+
def self.attribute_map
|
|
66
|
+
{
|
|
67
|
+
:'id' => :'id',
|
|
68
|
+
:'integration_id' => :'integrationId',
|
|
69
|
+
:'product_id' => :'productId',
|
|
70
|
+
:'policy_id' => :'policyId',
|
|
71
|
+
:'stripe_product_id' => :'stripeProductId',
|
|
72
|
+
:'stripe_price_id' => :'stripePriceId',
|
|
73
|
+
:'product_name' => :'productName',
|
|
74
|
+
:'price' => :'price',
|
|
75
|
+
:'status' => :'status',
|
|
76
|
+
:'status_reason' => :'statusReason',
|
|
77
|
+
:'created_at' => :'createdAt'
|
|
78
|
+
}
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Returns attribute mapping this model knows about
|
|
82
|
+
def self.acceptable_attribute_map
|
|
83
|
+
attribute_map
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Returns all the JSON keys this model knows about
|
|
87
|
+
def self.acceptable_attributes
|
|
88
|
+
acceptable_attribute_map.values
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Attribute type mapping.
|
|
92
|
+
def self.openapi_types
|
|
93
|
+
{
|
|
94
|
+
:'id' => :'String',
|
|
95
|
+
:'integration_id' => :'String',
|
|
96
|
+
:'product_id' => :'String',
|
|
97
|
+
:'policy_id' => :'String',
|
|
98
|
+
:'stripe_product_id' => :'String',
|
|
99
|
+
:'stripe_price_id' => :'String',
|
|
100
|
+
:'product_name' => :'String',
|
|
101
|
+
:'price' => :'Price',
|
|
102
|
+
:'status' => :'String',
|
|
103
|
+
:'status_reason' => :'String',
|
|
104
|
+
:'created_at' => :'Time'
|
|
105
|
+
}
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# List of attributes with nullable: true
|
|
109
|
+
def self.openapi_nullable
|
|
110
|
+
Set.new([
|
|
111
|
+
:'price',
|
|
112
|
+
:'status_reason',
|
|
113
|
+
])
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Returns attribute type mapping
|
|
117
|
+
def self.acceptable_openapi_types
|
|
118
|
+
openapi_types
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Returns the nullable attributes
|
|
122
|
+
def self.acceptable_openapi_nullable
|
|
123
|
+
openapi_nullable
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Initializes the object
|
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
128
|
+
def initialize(attributes = {})
|
|
129
|
+
if (!attributes.is_a?(Hash))
|
|
130
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `LicenseManager::IntegrationMapping` initialize method"
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
134
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
135
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
136
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
137
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `LicenseManager::IntegrationMapping`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
138
|
+
end
|
|
139
|
+
h[k.to_sym] = v
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'id')
|
|
143
|
+
self.id = attributes[:'id']
|
|
144
|
+
else
|
|
145
|
+
self.id = nil
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'integration_id')
|
|
149
|
+
self.integration_id = attributes[:'integration_id']
|
|
150
|
+
else
|
|
151
|
+
self.integration_id = nil
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'product_id')
|
|
155
|
+
self.product_id = attributes[:'product_id']
|
|
156
|
+
else
|
|
157
|
+
self.product_id = nil
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'policy_id')
|
|
161
|
+
self.policy_id = attributes[:'policy_id']
|
|
162
|
+
else
|
|
163
|
+
self.policy_id = nil
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'stripe_product_id')
|
|
167
|
+
self.stripe_product_id = attributes[:'stripe_product_id']
|
|
168
|
+
else
|
|
169
|
+
self.stripe_product_id = nil
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'stripe_price_id')
|
|
173
|
+
self.stripe_price_id = attributes[:'stripe_price_id']
|
|
174
|
+
else
|
|
175
|
+
self.stripe_price_id = nil
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.key?(:'product_name')
|
|
179
|
+
self.product_name = attributes[:'product_name']
|
|
180
|
+
else
|
|
181
|
+
self.product_name = nil
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if attributes.key?(:'price')
|
|
185
|
+
self.price = attributes[:'price']
|
|
186
|
+
else
|
|
187
|
+
self.price = nil
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if attributes.key?(:'status')
|
|
191
|
+
self.status = attributes[:'status']
|
|
192
|
+
else
|
|
193
|
+
self.status = nil
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if attributes.key?(:'status_reason')
|
|
197
|
+
self.status_reason = attributes[:'status_reason']
|
|
198
|
+
else
|
|
199
|
+
self.status_reason = nil
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if attributes.key?(:'created_at')
|
|
203
|
+
self.created_at = attributes[:'created_at']
|
|
204
|
+
else
|
|
205
|
+
self.created_at = nil
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
210
|
+
# @return Array for valid properties with the reasons
|
|
211
|
+
def list_invalid_properties
|
|
212
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
213
|
+
invalid_properties = Array.new
|
|
214
|
+
if @id.nil?
|
|
215
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
if @integration_id.nil?
|
|
219
|
+
invalid_properties.push('invalid value for "integration_id", integration_id cannot be nil.')
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
if @product_id.nil?
|
|
223
|
+
invalid_properties.push('invalid value for "product_id", product_id cannot be nil.')
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
if @policy_id.nil?
|
|
227
|
+
invalid_properties.push('invalid value for "policy_id", policy_id cannot be nil.')
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
if @stripe_product_id.nil?
|
|
231
|
+
invalid_properties.push('invalid value for "stripe_product_id", stripe_product_id cannot be nil.')
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
if @stripe_price_id.nil?
|
|
235
|
+
invalid_properties.push('invalid value for "stripe_price_id", stripe_price_id cannot be nil.')
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
if @product_name.nil?
|
|
239
|
+
invalid_properties.push('invalid value for "product_name", product_name cannot be nil.')
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if @status.nil?
|
|
243
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
if @created_at.nil?
|
|
247
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
invalid_properties
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Check to see if the all the properties in the model are valid
|
|
254
|
+
# @return true if the model is valid
|
|
255
|
+
def valid?
|
|
256
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
257
|
+
return false if @id.nil?
|
|
258
|
+
return false if @integration_id.nil?
|
|
259
|
+
return false if @product_id.nil?
|
|
260
|
+
return false if @policy_id.nil?
|
|
261
|
+
return false if @stripe_product_id.nil?
|
|
262
|
+
return false if @stripe_price_id.nil?
|
|
263
|
+
return false if @product_name.nil?
|
|
264
|
+
return false if @status.nil?
|
|
265
|
+
status_validator = EnumAttributeValidator.new('String', ["active", "error", "unknown_default_open_api"])
|
|
266
|
+
return false unless status_validator.valid?(@status)
|
|
267
|
+
return false if @created_at.nil?
|
|
268
|
+
true
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Custom attribute writer method with validation
|
|
272
|
+
# @param [Object] id Value to be assigned
|
|
273
|
+
def id=(id)
|
|
274
|
+
if id.nil?
|
|
275
|
+
fail ArgumentError, 'id cannot be nil'
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
@id = id
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Custom attribute writer method with validation
|
|
282
|
+
# @param [Object] integration_id Value to be assigned
|
|
283
|
+
def integration_id=(integration_id)
|
|
284
|
+
if integration_id.nil?
|
|
285
|
+
fail ArgumentError, 'integration_id cannot be nil'
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
@integration_id = integration_id
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Custom attribute writer method with validation
|
|
292
|
+
# @param [Object] product_id Value to be assigned
|
|
293
|
+
def product_id=(product_id)
|
|
294
|
+
if product_id.nil?
|
|
295
|
+
fail ArgumentError, 'product_id cannot be nil'
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
@product_id = product_id
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Custom attribute writer method with validation
|
|
302
|
+
# @param [Object] policy_id Value to be assigned
|
|
303
|
+
def policy_id=(policy_id)
|
|
304
|
+
if policy_id.nil?
|
|
305
|
+
fail ArgumentError, 'policy_id cannot be nil'
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
@policy_id = policy_id
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# Custom attribute writer method with validation
|
|
312
|
+
# @param [Object] stripe_product_id Value to be assigned
|
|
313
|
+
def stripe_product_id=(stripe_product_id)
|
|
314
|
+
if stripe_product_id.nil?
|
|
315
|
+
fail ArgumentError, 'stripe_product_id cannot be nil'
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
@stripe_product_id = stripe_product_id
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# Custom attribute writer method with validation
|
|
322
|
+
# @param [Object] stripe_price_id Value to be assigned
|
|
323
|
+
def stripe_price_id=(stripe_price_id)
|
|
324
|
+
if stripe_price_id.nil?
|
|
325
|
+
fail ArgumentError, 'stripe_price_id cannot be nil'
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
@stripe_price_id = stripe_price_id
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# Custom attribute writer method with validation
|
|
332
|
+
# @param [Object] product_name Value to be assigned
|
|
333
|
+
def product_name=(product_name)
|
|
334
|
+
if product_name.nil?
|
|
335
|
+
fail ArgumentError, 'product_name cannot be nil'
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
@product_name = product_name
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
342
|
+
# @param [Object] status Object to be assigned
|
|
343
|
+
def status=(status)
|
|
344
|
+
validator = EnumAttributeValidator.new('String', ["active", "error", "unknown_default_open_api"])
|
|
345
|
+
unless validator.valid?(status)
|
|
346
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
347
|
+
end
|
|
348
|
+
@status = status
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
# Custom attribute writer method with validation
|
|
352
|
+
# @param [Object] created_at Value to be assigned
|
|
353
|
+
def created_at=(created_at)
|
|
354
|
+
if created_at.nil?
|
|
355
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
@created_at = created_at
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# Checks equality by comparing each attribute.
|
|
362
|
+
# @param [Object] Object to be compared
|
|
363
|
+
def ==(o)
|
|
364
|
+
return true if self.equal?(o)
|
|
365
|
+
self.class == o.class &&
|
|
366
|
+
id == o.id &&
|
|
367
|
+
integration_id == o.integration_id &&
|
|
368
|
+
product_id == o.product_id &&
|
|
369
|
+
policy_id == o.policy_id &&
|
|
370
|
+
stripe_product_id == o.stripe_product_id &&
|
|
371
|
+
stripe_price_id == o.stripe_price_id &&
|
|
372
|
+
product_name == o.product_name &&
|
|
373
|
+
price == o.price &&
|
|
374
|
+
status == o.status &&
|
|
375
|
+
status_reason == o.status_reason &&
|
|
376
|
+
created_at == o.created_at
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# @see the `==` method
|
|
380
|
+
# @param [Object] Object to be compared
|
|
381
|
+
def eql?(o)
|
|
382
|
+
self == o
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# Calculates hash code according to all attributes.
|
|
386
|
+
# @return [Integer] Hash code
|
|
387
|
+
def hash
|
|
388
|
+
[id, integration_id, product_id, policy_id, stripe_product_id, stripe_price_id, product_name, price, status, status_reason, created_at].hash
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# Builds the object from hash
|
|
392
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
393
|
+
# @return [Object] Returns the model itself
|
|
394
|
+
def self.build_from_hash(attributes)
|
|
395
|
+
return nil unless attributes.is_a?(Hash)
|
|
396
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
397
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
398
|
+
map = acceptable_attribute_map
|
|
399
|
+
transformed_hash = {}
|
|
400
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
401
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
402
|
+
transformed_hash["#{key}"] = nil
|
|
403
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
404
|
+
# check to ensure the input is an array given that the attribute
|
|
405
|
+
# is documented as an array but the input is not
|
|
406
|
+
if attributes[map[key]].is_a?(Array)
|
|
407
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
408
|
+
end
|
|
409
|
+
elsif !attributes[map[key]].nil?
|
|
410
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
411
|
+
end
|
|
412
|
+
end
|
|
413
|
+
new(transformed_hash)
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
# Returns the object in the form of hash
|
|
417
|
+
# @return [Hash] Returns the object in the form of hash
|
|
418
|
+
def to_hash
|
|
419
|
+
hash = {}
|
|
420
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
421
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
422
|
+
value = self.send(attr)
|
|
423
|
+
if value.nil?
|
|
424
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
425
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
hash[param] = _to_hash(value)
|
|
429
|
+
end
|
|
430
|
+
hash
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module LicenseManager
|
|
17
|
+
class IntegrationStatus
|
|
18
|
+
ACTIVE = "active".freeze
|
|
19
|
+
ERROR = "error".freeze
|
|
20
|
+
DISCONNECTED = "disconnected".freeze
|
|
21
|
+
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
|
|
22
|
+
|
|
23
|
+
def self.all_vars
|
|
24
|
+
@all_vars ||= [ACTIVE, ERROR, DISCONNECTED, UNKNOWN_DEFAULT_OPEN_API].freeze
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the enum from string
|
|
28
|
+
# @param [String] The enum value in the form of the string
|
|
29
|
+
# @return [String] The enum value
|
|
30
|
+
def self.build_from_hash(value)
|
|
31
|
+
new.build_from_hash(value)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Builds the enum from string
|
|
35
|
+
# @param [String] The enum value in the form of the string
|
|
36
|
+
# @return [String] The enum value
|
|
37
|
+
def build_from_hash(value)
|
|
38
|
+
return value if IntegrationStatus.all_vars.include?(value)
|
|
39
|
+
UNKNOWN_DEFAULT_OPEN_API
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|