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