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