clerk-http-client 0.0.1
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/Gemfile +9 -0
- data/Gemfile.lock +87 -0
- data/README.md +360 -0
- data/Rakefile +10 -0
- data/bin/fmt +5 -0
- data/bin/generate +8 -0
- data/bin/setup +7 -0
- data/clerk-http-client.gemspec +41 -0
- data/docs/ActorToken.md +34 -0
- data/docs/ActorTokensApi.md +147 -0
- data/docs/AddDomainRequest.md +22 -0
- data/docs/Admin.md +24 -0
- data/docs/AllowListBlockListApi.md +421 -0
- data/docs/AllowlistIdentifier.md +32 -0
- data/docs/BetaFeaturesApi.md +217 -0
- data/docs/BlocklistIdentifier.md +30 -0
- data/docs/BlocklistIdentifiers.md +20 -0
- data/docs/CNameTarget.md +22 -0
- data/docs/ChangeProductionInstanceDomainRequest.md +20 -0
- data/docs/ClerkError.md +26 -0
- data/docs/ClerkErrors.md +20 -0
- data/docs/Client.md +34 -0
- data/docs/ClientsApi.md +221 -0
- data/docs/CreateActorTokenRequest.md +24 -0
- data/docs/CreateAllowlistIdentifierRequest.md +20 -0
- data/docs/CreateBlocklistIdentifierRequest.md +18 -0
- data/docs/CreateEmailAddressRequest.md +24 -0
- data/docs/CreateInvitationRequest.md +28 -0
- data/docs/CreateJWTTemplateRequest.md +30 -0
- data/docs/CreateOAuthApplicationRequest.md +24 -0
- data/docs/CreateOrganizationDomainRequest.md +22 -0
- data/docs/CreateOrganizationInvitationBulkRequestInner.md +28 -0
- data/docs/CreateOrganizationInvitationRequest.md +28 -0
- data/docs/CreateOrganizationMembershipRequest.md +20 -0
- data/docs/CreateOrganizationRequest.md +30 -0
- data/docs/CreatePhoneNumberRequest.md +26 -0
- data/docs/CreateRedirectURLRequest.md +18 -0
- data/docs/CreateSAMLConnectionRequest.md +34 -0
- data/docs/CreateSAMLConnectionRequestAttributeMapping.md +24 -0
- data/docs/CreateSessionTokenFromTemplate200Response.md +20 -0
- data/docs/CreateSignInTokenRequest.md +20 -0
- data/docs/CreateUserRequest.md +62 -0
- data/docs/DeletedObject.md +24 -0
- data/docs/DisableMFA200Response.md +18 -0
- data/docs/Domain.md +34 -0
- data/docs/Domains.md +20 -0
- data/docs/DomainsApi.md +286 -0
- data/docs/EmailAddress.md +32 -0
- data/docs/EmailAddressVerification.md +51 -0
- data/docs/EmailAddressesApi.md +289 -0
- data/docs/EmailSMSTemplatesApi.md +449 -0
- data/docs/GetOAuthAccessToken200ResponseInner.md +34 -0
- data/docs/IdentificationLink.md +20 -0
- data/docs/InstanceRestrictions.md +26 -0
- data/docs/InstanceSettingsApi.md +216 -0
- data/docs/Invitation.md +36 -0
- data/docs/InvitationsApi.md +223 -0
- data/docs/JWKSApi.md +74 -0
- data/docs/JWTTemplate.md +36 -0
- data/docs/JWTTemplatesApi.md +354 -0
- data/docs/MergeOrganizationMetadataRequest.md +20 -0
- data/docs/MiscellaneousApi.md +75 -0
- data/docs/OAuthApplication.md +42 -0
- data/docs/OAuthApplicationWithSecret.md +44 -0
- data/docs/OAuthApplications.md +20 -0
- data/docs/OAuthApplicationsApi.md +433 -0
- data/docs/OTP.md +24 -0
- data/docs/Oauth.md +28 -0
- data/docs/OauthError.md +47 -0
- data/docs/Organization.md +40 -0
- data/docs/OrganizationDomain.md +38 -0
- data/docs/OrganizationDomainApi.md +81 -0
- data/docs/OrganizationDomainVerification.md +24 -0
- data/docs/OrganizationDomains.md +20 -0
- data/docs/OrganizationDomainsApi.md +231 -0
- data/docs/OrganizationInvitation.md +38 -0
- data/docs/OrganizationInvitationWithPublicOrganizationData.md +40 -0
- data/docs/OrganizationInvitationWithPublicOrganizationDataPublicOrganizationData.md +26 -0
- data/docs/OrganizationInvitations.md +20 -0
- data/docs/OrganizationInvitationsApi.md +533 -0
- data/docs/OrganizationInvitationsWithPublicOrganizationData.md +20 -0
- data/docs/OrganizationMembership.md +38 -0
- data/docs/OrganizationMembershipPublicUserData.md +30 -0
- data/docs/OrganizationMemberships.md +20 -0
- data/docs/OrganizationMembershipsApi.md +453 -0
- data/docs/OrganizationSettings.md +36 -0
- data/docs/OrganizationWithLogo.md +46 -0
- data/docs/Organizations.md +20 -0
- data/docs/OrganizationsApi.md +591 -0
- data/docs/Passkey.md +26 -0
- data/docs/PhoneNumber.md +38 -0
- data/docs/PhoneNumberVerification.md +49 -0
- data/docs/PhoneNumbersApi.md +289 -0
- data/docs/PreviewTemplateRequest.md +24 -0
- data/docs/ProxyCheck.md +32 -0
- data/docs/ProxyChecksApi.md +77 -0
- data/docs/RedirectURL.md +26 -0
- data/docs/RedirectURLsApi.md +284 -0
- data/docs/RevokeInvitation200Response.md +36 -0
- data/docs/RevokeOrganizationInvitationRequest.md +18 -0
- data/docs/SAML.md +28 -0
- data/docs/SAMLAccount.md +38 -0
- data/docs/SAMLAccountSamlConnection.md +47 -0
- data/docs/SAMLAccountVerification.md +49 -0
- data/docs/SAMLConnection.md +38 -0
- data/docs/SAMLConnections.md +20 -0
- data/docs/SAMLConnectionsApi.md +363 -0
- data/docs/SchemasPasskey.md +26 -0
- data/docs/SchemasPasskeyVerification.md +47 -0
- data/docs/SchemasSAMLConnection.md +60 -0
- data/docs/SchemasSAMLConnectionAttributeMapping.md +24 -0
- data/docs/Session.md +42 -0
- data/docs/SessionLatestActivity.md +34 -0
- data/docs/SessionsApi.md +373 -0
- data/docs/SignInToken.md +32 -0
- data/docs/SignInTokensApi.md +147 -0
- data/docs/SignUp.md +62 -0
- data/docs/SignUpsApi.md +79 -0
- data/docs/SvixURL.md +18 -0
- data/docs/TOTP.md +28 -0
- data/docs/Template.md +60 -0
- data/docs/TestingToken.md +22 -0
- data/docs/TestingTokensApi.md +74 -0
- data/docs/Ticket.md +24 -0
- data/docs/ToggleTemplateDeliveryRequest.md +18 -0
- data/docs/TotalCount.md +20 -0
- data/docs/UpdateDomainRequest.md +22 -0
- data/docs/UpdateEmailAddressRequest.md +20 -0
- data/docs/UpdateInstanceAuthConfig200Response.md +28 -0
- data/docs/UpdateInstanceAuthConfigRequest.md +28 -0
- data/docs/UpdateInstanceOrganizationSettingsRequest.md +30 -0
- data/docs/UpdateInstanceRequest.md +34 -0
- data/docs/UpdateInstanceRestrictionsRequest.md +26 -0
- data/docs/UpdateOAuthApplicationRequest.md +22 -0
- data/docs/UpdateOrganizationDomainRequest.md +20 -0
- data/docs/UpdateOrganizationMembershipMetadataRequest.md +20 -0
- data/docs/UpdateOrganizationMembershipRequest.md +18 -0
- data/docs/UpdateOrganizationRequest.md +30 -0
- data/docs/UpdatePhoneNumberRequest.md +22 -0
- data/docs/UpdateProductionInstanceDomainRequest.md +18 -0
- data/docs/UpdateSAMLConnectionRequest.md +42 -0
- data/docs/UpdateSAMLConnectionRequestAttributeMapping.md +24 -0
- data/docs/UpdateSignUpRequest.md +18 -0
- data/docs/UpdateUserMetadataRequest.md +22 -0
- data/docs/UpdateUserRequest.md +66 -0
- data/docs/UpsertTemplateRequest.md +30 -0
- data/docs/User.md +94 -0
- data/docs/UsersApi.md +1829 -0
- data/docs/VerifyClientRequest.md +18 -0
- data/docs/VerifyDomainProxyRequest.md +20 -0
- data/docs/VerifyPassword200Response.md +18 -0
- data/docs/VerifyPasswordRequest.md +18 -0
- data/docs/VerifySessionRequest.md +18 -0
- data/docs/VerifyTOTP200Response.md +20 -0
- data/docs/VerifyTOTPRequest.md +18 -0
- data/docs/Web3Signature.md +28 -0
- data/docs/Web3Wallet.md +28 -0
- data/docs/Web3WalletVerification.md +49 -0
- data/docs/WebhooksApi.md +207 -0
- data/docs/WellKnownJWKS.md +18 -0
- data/docs/WellKnownJWKSKeysInner.md +28 -0
- data/git_push.sh +57 -0
- data/lib/clerk-http-client/api/actor_tokens_api.rb +157 -0
- data/lib/clerk-http-client/api/allow_list_block_list_api.rb +410 -0
- data/lib/clerk-http-client/api/beta_features_api.rb +228 -0
- data/lib/clerk-http-client/api/clients_api.rb +234 -0
- data/lib/clerk-http-client/api/domains_api.rb +292 -0
- data/lib/clerk-http-client/api/email_addresses_api.rb +298 -0
- data/lib/clerk-http-client/api/email_sms_templates_api.rb +488 -0
- data/lib/clerk-http-client/api/instance_settings_api.rb +232 -0
- data/lib/clerk-http-client/api/invitations_api.rb +241 -0
- data/lib/clerk-http-client/api/jwks_api.rb +81 -0
- data/lib/clerk-http-client/api/jwt_templates_api.rb +355 -0
- data/lib/clerk-http-client/api/miscellaneous_api.rb +85 -0
- data/lib/clerk-http-client/api/o_auth_applications_api.rb +440 -0
- data/lib/clerk-http-client/api/organization_domain_api.rb +104 -0
- data/lib/clerk-http-client/api/organization_domains_api.rb +258 -0
- data/lib/clerk-http-client/api/organization_invitations_api.rb +586 -0
- data/lib/clerk-http-client/api/organization_memberships_api.rb +499 -0
- data/lib/clerk-http-client/api/organizations_api.rb +606 -0
- data/lib/clerk-http-client/api/phone_numbers_api.rb +298 -0
- data/lib/clerk-http-client/api/proxy_checks_api.rb +92 -0
- data/lib/clerk-http-client/api/redirect_urls_api.rb +281 -0
- data/lib/clerk-http-client/api/saml_connections_api.rb +375 -0
- data/lib/clerk-http-client/api/sessions_api.rb +385 -0
- data/lib/clerk-http-client/api/sign_in_tokens_api.rb +157 -0
- data/lib/clerk-http-client/api/sign_ups_api.rb +98 -0
- data/lib/clerk-http-client/api/testing_tokens_api.rb +81 -0
- data/lib/clerk-http-client/api/users_api.rb +1828 -0
- data/lib/clerk-http-client/api/webhooks_api.rb +199 -0
- data/lib/clerk-http-client/api_client.rb +437 -0
- data/lib/clerk-http-client/api_error.rb +58 -0
- data/lib/clerk-http-client/configuration.rb +393 -0
- data/lib/clerk-http-client/models/actor_token.rb +385 -0
- data/lib/clerk-http-client/models/add_domain_request.rb +249 -0
- data/lib/clerk-http-client/models/admin.rb +303 -0
- data/lib/clerk-http-client/models/allowlist_identifier.rb +327 -0
- data/lib/clerk-http-client/models/blocklist_identifier.rb +318 -0
- data/lib/clerk-http-client/models/blocklist_identifiers.rb +240 -0
- data/lib/clerk-http-client/models/c_name_target.rb +254 -0
- data/lib/clerk-http-client/models/change_production_instance_domain_request.rb +225 -0
- data/lib/clerk-http-client/models/clerk_error.rb +271 -0
- data/lib/clerk-http-client/models/clerk_errors.rb +232 -0
- data/lib/clerk-http-client/models/client.rb +380 -0
- data/lib/clerk-http-client/models/create_actor_token_request.rb +263 -0
- data/lib/clerk-http-client/models/create_allowlist_identifier_request.rb +234 -0
- data/lib/clerk-http-client/models/create_blocklist_identifier_request.rb +222 -0
- data/lib/clerk-http-client/models/create_email_address_request.rb +247 -0
- data/lib/clerk-http-client/models/create_invitation_request.rb +303 -0
- data/lib/clerk-http-client/models/create_jwt_template_request.rb +327 -0
- data/lib/clerk-http-client/models/create_o_auth_application_request.rb +261 -0
- data/lib/clerk-http-client/models/create_organization_domain_request.rb +236 -0
- data/lib/clerk-http-client/models/create_organization_invitation_bulk_request_inner.rb +280 -0
- data/lib/clerk-http-client/models/create_organization_invitation_request.rb +280 -0
- data/lib/clerk-http-client/models/create_organization_membership_request.rb +239 -0
- data/lib/clerk-http-client/models/create_organization_request.rb +289 -0
- data/lib/clerk-http-client/models/create_phone_number_request.rb +258 -0
- data/lib/clerk-http-client/models/create_redirect_url_request.rb +215 -0
- data/lib/clerk-http-client/models/create_saml_connection_request.rb +355 -0
- data/lib/clerk-http-client/models/create_saml_connection_request_attribute_mapping.rb +242 -0
- data/lib/clerk-http-client/models/create_session_token_from_template200_response.rb +257 -0
- data/lib/clerk-http-client/models/create_sign_in_token_request.rb +227 -0
- data/lib/clerk-http-client/models/create_user_request.rb +453 -0
- data/lib/clerk-http-client/models/deleted_object.rb +255 -0
- data/lib/clerk-http-client/models/disable_mfa200_response.rb +214 -0
- data/lib/clerk-http-client/models/domain.rb +368 -0
- data/lib/clerk-http-client/models/domains.rb +240 -0
- data/lib/clerk-http-client/models/email_address.rb +361 -0
- data/lib/clerk-http-client/models/email_address_verification.rb +106 -0
- data/lib/clerk-http-client/models/get_o_auth_access_token200_response_inner.rb +295 -0
- data/lib/clerk-http-client/models/identification_link.rb +271 -0
- data/lib/clerk-http-client/models/instance_restrictions.rb +285 -0
- data/lib/clerk-http-client/models/invitation.rb +388 -0
- data/lib/clerk-http-client/models/jwt_template.rb +387 -0
- data/lib/clerk-http-client/models/merge_organization_metadata_request.rb +225 -0
- data/lib/clerk-http-client/models/o_auth_application.rb +449 -0
- data/lib/clerk-http-client/models/o_auth_application_with_secret.rb +466 -0
- data/lib/clerk-http-client/models/o_auth_applications.rb +240 -0
- data/lib/clerk-http-client/models/oauth.rb +328 -0
- data/lib/clerk-http-client/models/oauth_error.rb +104 -0
- data/lib/clerk-http-client/models/organization.rb +413 -0
- data/lib/clerk-http-client/models/organization_domain.rb +364 -0
- data/lib/clerk-http-client/models/organization_domain_verification.rb +281 -0
- data/lib/clerk-http-client/models/organization_domains.rb +240 -0
- data/lib/clerk-http-client/models/organization_invitation.rb +342 -0
- data/lib/clerk-http-client/models/organization_invitation_with_public_organization_data.rb +351 -0
- data/lib/clerk-http-client/models/organization_invitation_with_public_organization_data_public_organization_data.rb +250 -0
- data/lib/clerk-http-client/models/organization_invitations.rb +240 -0
- data/lib/clerk-http-client/models/organization_invitations_with_public_organization_data.rb +240 -0
- data/lib/clerk-http-client/models/organization_membership.rb +346 -0
- data/lib/clerk-http-client/models/organization_membership_public_user_data.rb +272 -0
- data/lib/clerk-http-client/models/organization_memberships.rb +240 -0
- data/lib/clerk-http-client/models/organization_settings.rb +391 -0
- data/lib/clerk-http-client/models/organization_with_logo.rb +454 -0
- data/lib/clerk-http-client/models/organizations.rb +240 -0
- data/lib/clerk-http-client/models/otp.rb +315 -0
- data/lib/clerk-http-client/models/passkey.rb +324 -0
- data/lib/clerk-http-client/models/phone_number.rb +391 -0
- data/lib/clerk-http-client/models/phone_number_verification.rb +105 -0
- data/lib/clerk-http-client/models/preview_template_request.rb +246 -0
- data/lib/clerk-http-client/models/proxy_check.rb +367 -0
- data/lib/clerk-http-client/models/redirect_url.rb +321 -0
- data/lib/clerk-http-client/models/revoke_invitation200_response.rb +395 -0
- data/lib/clerk-http-client/models/revoke_organization_invitation_request.rb +216 -0
- data/lib/clerk-http-client/models/saml.rb +331 -0
- data/lib/clerk-http-client/models/saml_account.rb +381 -0
- data/lib/clerk-http-client/models/saml_account_saml_connection.rb +104 -0
- data/lib/clerk-http-client/models/saml_account_verification.rb +105 -0
- data/lib/clerk-http-client/models/saml_connection.rb +362 -0
- data/lib/clerk-http-client/models/saml_connections.rb +240 -0
- data/lib/clerk-http-client/models/schemas_passkey.rb +310 -0
- data/lib/clerk-http-client/models/schemas_passkey_verification.rb +104 -0
- data/lib/clerk-http-client/models/schemas_saml_connection.rb +541 -0
- data/lib/clerk-http-client/models/schemas_saml_connection_attribute_mapping.rb +241 -0
- data/lib/clerk-http-client/models/session.rb +444 -0
- data/lib/clerk-http-client/models/session_latest_activity.rb +300 -0
- data/lib/clerk-http-client/models/sign_in_token.rb +368 -0
- data/lib/clerk-http-client/models/sign_up.rb +517 -0
- data/lib/clerk-http-client/models/svix_url.rb +221 -0
- data/lib/clerk-http-client/models/template.rb +460 -0
- data/lib/clerk-http-client/models/testing_token.rb +289 -0
- data/lib/clerk-http-client/models/ticket.rb +303 -0
- data/lib/clerk-http-client/models/toggle_template_delivery_request.rb +216 -0
- data/lib/clerk-http-client/models/total_count.rb +272 -0
- data/lib/clerk-http-client/models/totp.rb +289 -0
- data/lib/clerk-http-client/models/update_domain_request.rb +238 -0
- data/lib/clerk-http-client/models/update_email_address_request.rb +227 -0
- data/lib/clerk-http-client/models/update_instance_auth_config200_response.rb +294 -0
- data/lib/clerk-http-client/models/update_instance_auth_config_request.rb +273 -0
- data/lib/clerk-http-client/models/update_instance_organization_settings_request.rb +277 -0
- data/lib/clerk-http-client/models/update_instance_request.rb +300 -0
- data/lib/clerk-http-client/models/update_instance_restrictions_request.rb +255 -0
- data/lib/clerk-http-client/models/update_o_auth_application_request.rb +237 -0
- data/lib/clerk-http-client/models/update_organization_domain_request.rb +227 -0
- data/lib/clerk-http-client/models/update_organization_membership_metadata_request.rb +225 -0
- data/lib/clerk-http-client/models/update_organization_membership_request.rb +222 -0
- data/lib/clerk-http-client/models/update_organization_request.rb +279 -0
- data/lib/clerk-http-client/models/update_phone_number_request.rb +238 -0
- data/lib/clerk-http-client/models/update_production_instance_domain_request.rb +215 -0
- data/lib/clerk-http-client/models/update_saml_connection_request.rb +347 -0
- data/lib/clerk-http-client/models/update_saml_connection_request_attribute_mapping.rb +242 -0
- data/lib/clerk-http-client/models/update_sign_up_request.rb +216 -0
- data/lib/clerk-http-client/models/update_user_metadata_request.rb +241 -0
- data/lib/clerk-http-client/models/update_user_request.rb +472 -0
- data/lib/clerk-http-client/models/upsert_template_request.rb +278 -0
- data/lib/clerk-http-client/models/user.rb +633 -0
- data/lib/clerk-http-client/models/verify_client_request.rb +215 -0
- data/lib/clerk-http-client/models/verify_domain_proxy_request.rb +225 -0
- data/lib/clerk-http-client/models/verify_password200_response.rb +214 -0
- data/lib/clerk-http-client/models/verify_password_request.rb +222 -0
- data/lib/clerk-http-client/models/verify_session_request.rb +215 -0
- data/lib/clerk-http-client/models/verify_totp200_response.rb +257 -0
- data/lib/clerk-http-client/models/verify_totp_request.rb +222 -0
- data/lib/clerk-http-client/models/web3_signature.rb +323 -0
- data/lib/clerk-http-client/models/web3_wallet.rb +327 -0
- data/lib/clerk-http-client/models/web3_wallet_verification.rb +105 -0
- data/lib/clerk-http-client/models/well_known_jwks.rb +216 -0
- data/lib/clerk-http-client/models/well_known_jwks_keys_inner.rb +259 -0
- data/lib/clerk-http-client/version.rb +15 -0
- data/lib/clerk-http-client.rb +321 -0
- data/openapitools.json +7 -0
- data/pkg/clerk-http-client-1.0.0.gem +0 -0
- data/resources/.DS_Store +0 -0
- data/resources/oas/bapi-2024-10-01.yml +7238 -0
- data/resources/templates/Gemfile.mustache +9 -0
- data/resources/templates/README.mustache +163 -0
- data/resources/templates/Rakefile.mustache +10 -0
- data/resources/templates/api.mustache +257 -0
- data/resources/templates/api_client.mustache +246 -0
- data/resources/templates/api_client_faraday_partial.mustache +200 -0
- data/resources/templates/api_client_httpx_partial.mustache +134 -0
- data/resources/templates/api_client_typhoeus_partial.mustache +161 -0
- data/resources/templates/api_doc.mustache +132 -0
- data/resources/templates/api_error.mustache +50 -0
- data/resources/templates/api_info.mustache +12 -0
- data/resources/templates/api_test.mustache +47 -0
- data/resources/templates/base_object.mustache +114 -0
- data/resources/templates/configuration.mustache +491 -0
- data/resources/templates/configuration_faraday_partial.mustache +40 -0
- data/resources/templates/configuration_httpx_partial.mustache +11 -0
- data/resources/templates/configuration_typhoeus_partial.mustache +41 -0
- data/resources/templates/gem.mustache +89 -0
- data/resources/templates/gemspec.mustache +41 -0
- data/resources/templates/git_push.sh.mustache +57 -0
- data/resources/templates/gitignore.mustache +39 -0
- data/resources/templates/gitlab-ci.mustache +26 -0
- data/resources/templates/model.mustache +33 -0
- data/resources/templates/model_doc.mustache +12 -0
- data/resources/templates/model_test.mustache +82 -0
- data/resources/templates/partial_anyof_module.mustache +94 -0
- data/resources/templates/partial_model_enum_class.mustache +23 -0
- data/resources/templates/partial_model_generic.mustache +377 -0
- data/resources/templates/partial_model_generic_doc.mustache +28 -0
- data/resources/templates/partial_oneof_module.mustache +137 -0
- data/resources/templates/partial_oneof_module_doc.mustache +93 -0
- data/resources/templates/rspec.mustache +2 -0
- data/resources/templates/rubocop.mustache +148 -0
- data/resources/templates/spec_helper.mustache +103 -0
- data/resources/templates/travis.mustache +11 -0
- data/resources/templates/version.mustache +7 -0
- data/sdk-generator-config.json +20 -0
- data/spec/api/actor_tokens_api_spec.rb +59 -0
- data/spec/api/allow_list_block_list_api_spec.rb +105 -0
- data/spec/api/beta_features_api_spec.rb +71 -0
- data/spec/api/clients_api_spec.rb +72 -0
- data/spec/api/domains_api_spec.rb +83 -0
- data/spec/api/email_addresses_api_spec.rb +84 -0
- data/spec/api/email_sms_templates_api_spec.rb +115 -0
- data/spec/api/instance_settings_api_spec.rb +71 -0
- data/spec/api/invitations_api_spec.rb +73 -0
- data/spec/api/jwks_api_spec.rb +46 -0
- data/spec/api/jwt_templates_api_spec.rb +94 -0
- data/spec/api/miscellaneous_api_spec.rb +48 -0
- data/spec/api/o_auth_applications_api_spec.rb +109 -0
- data/spec/api/organization_domain_api_spec.rb +49 -0
- data/spec/api/organization_domains_api_spec.rb +77 -0
- data/spec/api/organization_invitations_api_spec.rb +133 -0
- data/spec/api/organization_memberships_api_spec.rb +118 -0
- data/spec/api/organizations_api_spec.rb +139 -0
- data/spec/api/phone_numbers_api_spec.rb +84 -0
- data/spec/api/proxy_checks_api_spec.rb +47 -0
- data/spec/api/redirect_urls_api_spec.rb +82 -0
- data/spec/api/saml_connections_api_spec.rb +97 -0
- data/spec/api/sessions_api_spec.rb +101 -0
- data/spec/api/sign_in_tokens_api_spec.rb +59 -0
- data/spec/api/sign_ups_api_spec.rb +48 -0
- data/spec/api/testing_tokens_api_spec.rb +46 -0
- data/spec/api/users_api_spec.rb +366 -0
- data/spec/api/webhooks_api_spec.rb +68 -0
- data/spec/models/actor_token_spec.rb +92 -0
- data/spec/models/add_domain_request_spec.rb +48 -0
- data/spec/models/admin_spec.rb +62 -0
- data/spec/models/allowlist_identifier_spec.rb +86 -0
- data/spec/models/blocklist_identifier_spec.rb +80 -0
- data/spec/models/blocklist_identifiers_spec.rb +42 -0
- data/spec/models/c_name_target_spec.rb +48 -0
- data/spec/models/change_production_instance_domain_request_spec.rb +42 -0
- data/spec/models/clerk_error_spec.rb +60 -0
- data/spec/models/clerk_errors_spec.rb +42 -0
- data/spec/models/client_spec.rb +88 -0
- data/spec/models/create_actor_token_request_spec.rb +54 -0
- data/spec/models/create_allowlist_identifier_request_spec.rb +42 -0
- data/spec/models/create_blocklist_identifier_request_spec.rb +36 -0
- data/spec/models/create_email_address_request_spec.rb +54 -0
- data/spec/models/create_invitation_request_spec.rb +66 -0
- data/spec/models/create_jwt_template_request_spec.rb +72 -0
- data/spec/models/create_o_auth_application_request_spec.rb +54 -0
- data/spec/models/create_organization_domain_request_spec.rb +48 -0
- data/spec/models/create_organization_invitation_bulk_request_inner_spec.rb +66 -0
- data/spec/models/create_organization_invitation_request_spec.rb +66 -0
- data/spec/models/create_organization_membership_request_spec.rb +42 -0
- data/spec/models/create_organization_request_spec.rb +72 -0
- data/spec/models/create_phone_number_request_spec.rb +60 -0
- data/spec/models/create_redirect_url_request_spec.rb +36 -0
- data/spec/models/create_saml_connection_request_attribute_mapping_spec.rb +54 -0
- data/spec/models/create_saml_connection_request_spec.rb +88 -0
- data/spec/models/create_session_token_from_template200_response_spec.rb +46 -0
- data/spec/models/create_sign_in_token_request_spec.rb +42 -0
- data/spec/models/create_user_request_spec.rb +168 -0
- data/spec/models/deleted_object_spec.rb +54 -0
- data/spec/models/disable_mfa200_response_spec.rb +36 -0
- data/spec/models/domain_spec.rb +88 -0
- data/spec/models/domains_spec.rb +42 -0
- data/spec/models/email_address_spec.rb +82 -0
- data/spec/models/email_address_verification_spec.rb +32 -0
- data/spec/models/get_o_auth_access_token200_response_inner_spec.rb +84 -0
- data/spec/models/identification_link_spec.rb +46 -0
- data/spec/models/instance_restrictions_spec.rb +64 -0
- data/spec/models/invitation_spec.rb +98 -0
- data/spec/models/jwt_template_spec.rb +94 -0
- data/spec/models/merge_organization_metadata_request_spec.rb +42 -0
- data/spec/models/o_auth_application_spec.rb +112 -0
- data/spec/models/o_auth_application_with_secret_spec.rb +118 -0
- data/spec/models/o_auth_applications_spec.rb +42 -0
- data/spec/models/oauth_error_spec.rb +32 -0
- data/spec/models/oauth_spec.rb +74 -0
- data/spec/models/organization_domain_spec.rb +104 -0
- data/spec/models/organization_domain_verification_spec.rb +58 -0
- data/spec/models/organization_domains_spec.rb +42 -0
- data/spec/models/organization_invitation_spec.rb +100 -0
- data/spec/models/organization_invitation_with_public_organization_data_public_organization_data_spec.rb +60 -0
- data/spec/models/organization_invitation_with_public_organization_data_spec.rb +106 -0
- data/spec/models/organization_invitations_spec.rb +42 -0
- data/spec/models/organization_invitations_with_public_organization_data_spec.rb +42 -0
- data/spec/models/organization_membership_public_user_data_spec.rb +72 -0
- data/spec/models/organization_membership_spec.rb +100 -0
- data/spec/models/organization_memberships_spec.rb +42 -0
- data/spec/models/organization_settings_spec.rb +98 -0
- data/spec/models/organization_spec.rb +106 -0
- data/spec/models/organization_with_logo_spec.rb +124 -0
- data/spec/models/organizations_spec.rb +42 -0
- data/spec/models/otp_spec.rb +62 -0
- data/spec/models/passkey_spec.rb +72 -0
- data/spec/models/phone_number_spec.rb +100 -0
- data/spec/models/phone_number_verification_spec.rb +32 -0
- data/spec/models/preview_template_request_spec.rb +54 -0
- data/spec/models/proxy_check_spec.rb +82 -0
- data/spec/models/redirect_url_spec.rb +64 -0
- data/spec/models/revoke_invitation200_response_spec.rb +98 -0
- data/spec/models/revoke_organization_invitation_request_spec.rb +36 -0
- data/spec/models/saml_account_saml_connection_spec.rb +32 -0
- data/spec/models/saml_account_spec.rb +100 -0
- data/spec/models/saml_account_verification_spec.rb +32 -0
- data/spec/models/saml_connection_spec.rb +96 -0
- data/spec/models/saml_connections_spec.rb +42 -0
- data/spec/models/saml_spec.rb +74 -0
- data/spec/models/schemas_passkey_spec.rb +64 -0
- data/spec/models/schemas_passkey_verification_spec.rb +32 -0
- data/spec/models/schemas_saml_connection_attribute_mapping_spec.rb +54 -0
- data/spec/models/schemas_saml_connection_spec.rb +166 -0
- data/spec/models/session_latest_activity_spec.rb +84 -0
- data/spec/models/session_spec.rb +116 -0
- data/spec/models/sign_in_token_spec.rb +86 -0
- data/spec/models/sign_up_spec.rb +176 -0
- data/spec/models/svix_url_spec.rb +36 -0
- data/spec/models/template_spec.rb +166 -0
- data/spec/models/testing_token_spec.rb +52 -0
- data/spec/models/ticket_spec.rb +62 -0
- data/spec/models/toggle_template_delivery_request_spec.rb +36 -0
- data/spec/models/total_count_spec.rb +46 -0
- data/spec/models/totp_spec.rb +66 -0
- data/spec/models/update_domain_request_spec.rb +48 -0
- data/spec/models/update_email_address_request_spec.rb +42 -0
- data/spec/models/update_instance_auth_config200_response_spec.rb +70 -0
- data/spec/models/update_instance_auth_config_request_spec.rb +66 -0
- data/spec/models/update_instance_organization_settings_request_spec.rb +72 -0
- data/spec/models/update_instance_request_spec.rb +84 -0
- data/spec/models/update_instance_restrictions_request_spec.rb +60 -0
- data/spec/models/update_o_auth_application_request_spec.rb +48 -0
- data/spec/models/update_organization_domain_request_spec.rb +42 -0
- data/spec/models/update_organization_membership_metadata_request_spec.rb +42 -0
- data/spec/models/update_organization_membership_request_spec.rb +36 -0
- data/spec/models/update_organization_request_spec.rb +72 -0
- data/spec/models/update_phone_number_request_spec.rb +48 -0
- data/spec/models/update_production_instance_domain_request_spec.rb +36 -0
- data/spec/models/update_saml_connection_request_attribute_mapping_spec.rb +54 -0
- data/spec/models/update_saml_connection_request_spec.rb +108 -0
- data/spec/models/update_sign_up_request_spec.rb +36 -0
- data/spec/models/update_user_metadata_request_spec.rb +48 -0
- data/spec/models/update_user_request_spec.rb +180 -0
- data/spec/models/upsert_template_request_spec.rb +72 -0
- data/spec/models/user_spec.rb +268 -0
- data/spec/models/verify_client_request_spec.rb +36 -0
- data/spec/models/verify_domain_proxy_request_spec.rb +42 -0
- data/spec/models/verify_password200_response_spec.rb +36 -0
- data/spec/models/verify_password_request_spec.rb +36 -0
- data/spec/models/verify_session_request_spec.rb +36 -0
- data/spec/models/verify_totp200_response_spec.rb +46 -0
- data/spec/models/verify_totp_request_spec.rb +36 -0
- data/spec/models/web3_signature_spec.rb +74 -0
- data/spec/models/web3_wallet_spec.rb +70 -0
- data/spec/models/web3_wallet_verification_spec.rb +32 -0
- data/spec/models/well_known_jwks_keys_inner_spec.rb +66 -0
- data/spec/models/well_known_jwks_spec.rb +36 -0
- data/spec/spec_helper.rb +111 -0
- data/test.rb +2 -0
- metadata +782 -0
@@ -0,0 +1,377 @@
|
|
1
|
+
{{#description}}
|
2
|
+
# {{{.}}}
|
3
|
+
{{/description}}
|
4
|
+
class {{classname}}{{#parent}} < {{{.}}}{{/parent}}
|
5
|
+
{{#vars}}
|
6
|
+
{{#description}}
|
7
|
+
# {{{.}}}
|
8
|
+
{{/description}}
|
9
|
+
attr_accessor :{{{name}}}
|
10
|
+
|
11
|
+
{{/vars}}
|
12
|
+
{{#hasEnums}}
|
13
|
+
class EnumAttributeValidator
|
14
|
+
attr_reader :datatype
|
15
|
+
attr_reader :allowable_values
|
16
|
+
|
17
|
+
def initialize(datatype, allowable_values)
|
18
|
+
@allowable_values = allowable_values.map do |value|
|
19
|
+
case datatype.to_s
|
20
|
+
when /Integer/i
|
21
|
+
value.to_i
|
22
|
+
when /Float/i
|
23
|
+
value.to_f
|
24
|
+
else
|
25
|
+
value
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def valid?(value)
|
31
|
+
!value || allowable_values.include?(value)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
{{/hasEnums}}
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
37
|
+
def self.attribute_map
|
38
|
+
{
|
39
|
+
{{#vars}}
|
40
|
+
:'{{{name}}}' => :'{{{baseName}}}'{{^-last}},{{/-last}}
|
41
|
+
{{/vars}}
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns all the JSON keys this model knows about{{#parent}}, including the ones defined in its parent(s){{/parent}}
|
46
|
+
def self.acceptable_attributes
|
47
|
+
{{^parent}}
|
48
|
+
attribute_map.values
|
49
|
+
{{/parent}}
|
50
|
+
{{#parent}}
|
51
|
+
attribute_map.values.concat(superclass.acceptable_attributes)
|
52
|
+
{{/parent}}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Attribute type mapping.
|
56
|
+
def self.openapi_types
|
57
|
+
{
|
58
|
+
{{#vars}}
|
59
|
+
:'{{{name}}}' => :'{{{dataType}}}'{{^-last}},{{/-last}}
|
60
|
+
{{/vars}}
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
# List of attributes with nullable: true
|
65
|
+
def self.openapi_nullable
|
66
|
+
Set.new([
|
67
|
+
{{#vars}}
|
68
|
+
{{#isNullable}}
|
69
|
+
:'{{{name}}}'{{^-last}},{{/-last}}
|
70
|
+
{{/isNullable}}
|
71
|
+
{{/vars}}
|
72
|
+
])
|
73
|
+
end
|
74
|
+
|
75
|
+
{{#anyOf}}
|
76
|
+
{{#-first}}
|
77
|
+
# List of class defined in anyOf (OpenAPI v3)
|
78
|
+
def self.openapi_any_of
|
79
|
+
[
|
80
|
+
{{/-first}}
|
81
|
+
:'{{{.}}}'{{^-last}},{{/-last}}
|
82
|
+
{{#-last}}
|
83
|
+
]
|
84
|
+
end
|
85
|
+
|
86
|
+
{{/-last}}
|
87
|
+
{{/anyOf}}
|
88
|
+
{{#allOf}}
|
89
|
+
{{#-first}}
|
90
|
+
# List of class defined in allOf (OpenAPI v3)
|
91
|
+
def self.openapi_all_of
|
92
|
+
[
|
93
|
+
{{/-first}}
|
94
|
+
:'{{{.}}}'{{^-last}},{{/-last}}
|
95
|
+
{{#-last}}
|
96
|
+
]
|
97
|
+
end
|
98
|
+
|
99
|
+
{{/-last}}
|
100
|
+
{{/allOf}}
|
101
|
+
{{#discriminator}}
|
102
|
+
{{#propertyName}}
|
103
|
+
# discriminator's property name in OpenAPI v3
|
104
|
+
def self.openapi_discriminator_name
|
105
|
+
:'{{{.}}}'
|
106
|
+
end
|
107
|
+
|
108
|
+
{{/propertyName}}
|
109
|
+
{{/discriminator}}
|
110
|
+
# Initializes the object
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
def initialize(attributes = {})
|
113
|
+
if (!attributes.is_a?(Hash))
|
114
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `{{{moduleName}}}::{{{classname}}}` initialize method"
|
115
|
+
end
|
116
|
+
|
117
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
118
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
119
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
120
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `{{{moduleName}}}::{{{classname}}}`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
121
|
+
end
|
122
|
+
h[k.to_sym] = v
|
123
|
+
}
|
124
|
+
{{#parent}}
|
125
|
+
|
126
|
+
# call parent's initialize
|
127
|
+
super(attributes)
|
128
|
+
{{/parent}}
|
129
|
+
{{#vars}}
|
130
|
+
|
131
|
+
if attributes.key?(:'{{{name}}}')
|
132
|
+
{{#isArray}}
|
133
|
+
if (value = attributes[:'{{{name}}}']).is_a?(Array)
|
134
|
+
self.{{{name}}} = value
|
135
|
+
end
|
136
|
+
{{/isArray}}
|
137
|
+
{{#isMap}}
|
138
|
+
if (value = attributes[:'{{{name}}}']).is_a?(Hash)
|
139
|
+
self.{{{name}}} = value
|
140
|
+
end
|
141
|
+
{{/isMap}}
|
142
|
+
{{^isContainer}}
|
143
|
+
self.{{{name}}} = attributes[:'{{{name}}}']
|
144
|
+
{{/isContainer}}
|
145
|
+
{{#defaultValue}}
|
146
|
+
else
|
147
|
+
self.{{{name}}} = {{{defaultValue}}}
|
148
|
+
{{/defaultValue}}
|
149
|
+
{{^defaultValue}}
|
150
|
+
{{#required}}
|
151
|
+
else
|
152
|
+
self.{{{name}}} = nil
|
153
|
+
{{/required}}
|
154
|
+
{{/defaultValue}}
|
155
|
+
end
|
156
|
+
{{/vars}}
|
157
|
+
end
|
158
|
+
|
159
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
160
|
+
# @return Array for valid properties with the reasons
|
161
|
+
def list_invalid_properties
|
162
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
163
|
+
invalid_properties = {{^parent}}Array.new{{/parent}}{{#parent}}super{{/parent}}
|
164
|
+
{{#vars}}
|
165
|
+
{{^isNullable}}
|
166
|
+
{{#required}}
|
167
|
+
if @{{{name}}}.nil?
|
168
|
+
invalid_properties.push('invalid value for "{{{name}}}", {{{name}}} cannot be nil.')
|
169
|
+
end
|
170
|
+
|
171
|
+
{{/required}}
|
172
|
+
{{/isNullable}}
|
173
|
+
{{#hasValidation}}
|
174
|
+
{{#maxLength}}
|
175
|
+
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length > {{{maxLength}}}
|
176
|
+
invalid_properties.push('invalid value for "{{{name}}}", the character length must be smaller than or equal to {{{maxLength}}}.')
|
177
|
+
end
|
178
|
+
|
179
|
+
{{/maxLength}}
|
180
|
+
{{#minLength}}
|
181
|
+
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length < {{{minLength}}}
|
182
|
+
invalid_properties.push('invalid value for "{{{name}}}", the character length must be great than or equal to {{{minLength}}}.')
|
183
|
+
end
|
184
|
+
|
185
|
+
{{/minLength}}
|
186
|
+
{{#maximum}}
|
187
|
+
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
|
188
|
+
invalid_properties.push('invalid value for "{{{name}}}", must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.')
|
189
|
+
end
|
190
|
+
|
191
|
+
{{/maximum}}
|
192
|
+
{{#minimum}}
|
193
|
+
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}}
|
194
|
+
invalid_properties.push('invalid value for "{{{name}}}", must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.')
|
195
|
+
end
|
196
|
+
|
197
|
+
{{/minimum}}
|
198
|
+
{{#pattern}}
|
199
|
+
pattern = Regexp.new({{{pattern}}})
|
200
|
+
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} !~ pattern
|
201
|
+
invalid_properties.push("invalid value for \"{{{name}}}\", must conform to the pattern #{pattern}.")
|
202
|
+
end
|
203
|
+
|
204
|
+
{{/pattern}}
|
205
|
+
{{#maxItems}}
|
206
|
+
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length > {{{maxItems}}}
|
207
|
+
invalid_properties.push('invalid value for "{{{name}}}", number of items must be less than or equal to {{{maxItems}}}.')
|
208
|
+
end
|
209
|
+
|
210
|
+
{{/maxItems}}
|
211
|
+
{{#minItems}}
|
212
|
+
if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length < {{{minItems}}}
|
213
|
+
invalid_properties.push('invalid value for "{{{name}}}", number of items must be greater than or equal to {{{minItems}}}.')
|
214
|
+
end
|
215
|
+
|
216
|
+
{{/minItems}}
|
217
|
+
{{/hasValidation}}
|
218
|
+
{{/vars}}
|
219
|
+
invalid_properties
|
220
|
+
end
|
221
|
+
|
222
|
+
# Check to see if the all the properties in the model are valid
|
223
|
+
# @return true if the model is valid
|
224
|
+
def valid?
|
225
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
226
|
+
{{#vars}}
|
227
|
+
{{^isNullable}}
|
228
|
+
{{#required}}
|
229
|
+
return false if @{{{name}}}.nil?
|
230
|
+
{{/required}}
|
231
|
+
{{/isNullable}}
|
232
|
+
{{#isEnum}}
|
233
|
+
{{^isContainer}}
|
234
|
+
{{{name}}}_validator = EnumAttributeValidator.new('{{{dataType}}}', [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}])
|
235
|
+
return false unless {{{name}}}_validator.valid?(@{{{name}}})
|
236
|
+
{{/isContainer}}
|
237
|
+
{{/isEnum}}
|
238
|
+
{{#hasValidation}}
|
239
|
+
{{#maxLength}}
|
240
|
+
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length > {{{maxLength}}}
|
241
|
+
{{/maxLength}}
|
242
|
+
{{#minLength}}
|
243
|
+
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.to_s.length < {{{minLength}}}
|
244
|
+
{{/minLength}}
|
245
|
+
{{#maximum}}
|
246
|
+
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
|
247
|
+
{{/maximum}}
|
248
|
+
{{#minimum}}
|
249
|
+
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}}
|
250
|
+
{{/minimum}}
|
251
|
+
{{#pattern}}
|
252
|
+
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}} !~ Regexp.new({{{pattern}}})
|
253
|
+
{{/pattern}}
|
254
|
+
{{#maxItems}}
|
255
|
+
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length > {{{maxItems}}}
|
256
|
+
{{/maxItems}}
|
257
|
+
{{#minItems}}
|
258
|
+
return false if {{^required}}!@{{{name}}}.nil? && {{/required}}@{{{name}}}.length < {{{minItems}}}
|
259
|
+
{{/minItems}}
|
260
|
+
{{/hasValidation}}
|
261
|
+
{{/vars}}
|
262
|
+
{{#anyOf}}
|
263
|
+
{{#-first}}
|
264
|
+
_any_of_found = false
|
265
|
+
self.class.openapi_any_of.each do |_class|
|
266
|
+
_any_of = {{moduleName}}.const_get(_class).build_from_hash(self.to_hash)
|
267
|
+
if _any_of.valid?
|
268
|
+
_any_of_found = true
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
if !_any_of_found
|
273
|
+
return false
|
274
|
+
end
|
275
|
+
|
276
|
+
{{/-first}}
|
277
|
+
{{/anyOf}}
|
278
|
+
true{{#parent}} && super{{/parent}}
|
279
|
+
end
|
280
|
+
|
281
|
+
{{#vars}}
|
282
|
+
{{#isEnum}}
|
283
|
+
{{^isContainer}}
|
284
|
+
# Custom attribute writer method checking allowed values (enum).
|
285
|
+
# @param [Object] {{{name}}} Object to be assigned
|
286
|
+
def {{{name}}}=({{{name}}})
|
287
|
+
validator = EnumAttributeValidator.new('{{{dataType}}}', [{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}])
|
288
|
+
unless validator.valid?({{{name}}})
|
289
|
+
fail ArgumentError, "invalid value for \"{{{name}}}\", must be one of #{validator.allowable_values}."
|
290
|
+
end
|
291
|
+
@{{{name}}} = {{{name}}}
|
292
|
+
end
|
293
|
+
|
294
|
+
{{/isContainer}}
|
295
|
+
{{/isEnum}}
|
296
|
+
{{^isEnum}}
|
297
|
+
{{#hasValidation}}
|
298
|
+
# Custom attribute writer method with validation
|
299
|
+
# @param [Object] {{{name}}} Value to be assigned
|
300
|
+
def {{{name}}}=({{{name}}})
|
301
|
+
{{^isNullable}}
|
302
|
+
if {{{name}}}.nil?
|
303
|
+
fail ArgumentError, '{{{name}}} cannot be nil'
|
304
|
+
end
|
305
|
+
|
306
|
+
{{/isNullable}}
|
307
|
+
{{#maxLength}}
|
308
|
+
if {{#isNullable}}!{{{name}}}.nil? && {{/isNullable}}{{{name}}}.to_s.length > {{{maxLength}}}
|
309
|
+
fail ArgumentError, 'invalid value for "{{{name}}}", the character length must be smaller than or equal to {{{maxLength}}}.'
|
310
|
+
end
|
311
|
+
|
312
|
+
{{/maxLength}}
|
313
|
+
{{#minLength}}
|
314
|
+
if {{#isNullable}}!{{{name}}}.nil? && {{/isNullable}}{{{name}}}.to_s.length < {{{minLength}}}
|
315
|
+
fail ArgumentError, 'invalid value for "{{{name}}}", the character length must be great than or equal to {{{minLength}}}.'
|
316
|
+
end
|
317
|
+
|
318
|
+
{{/minLength}}
|
319
|
+
{{#maximum}}
|
320
|
+
if {{#isNullable}}!{{{name}}}.nil? && {{/isNullable}}{{{name}}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{{maximum}}}
|
321
|
+
fail ArgumentError, 'invalid value for "{{{name}}}", must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}.'
|
322
|
+
end
|
323
|
+
|
324
|
+
{{/maximum}}
|
325
|
+
{{#minimum}}
|
326
|
+
if {{#isNullable}}!{{{name}}}.nil? && {{/isNullable}}{{{name}}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{{minimum}}}
|
327
|
+
fail ArgumentError, 'invalid value for "{{{name}}}", must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}.'
|
328
|
+
end
|
329
|
+
|
330
|
+
{{/minimum}}
|
331
|
+
{{#pattern}}
|
332
|
+
pattern = Regexp.new({{{pattern}}})
|
333
|
+
if {{#isNullable}}!{{{name}}}.nil? && {{/isNullable}}{{{name}}} !~ pattern
|
334
|
+
fail ArgumentError, "invalid value for \"{{{name}}}\", must conform to the pattern #{pattern}."
|
335
|
+
end
|
336
|
+
|
337
|
+
{{/pattern}}
|
338
|
+
{{#maxItems}}
|
339
|
+
if {{#isNullable}}!{{{name}}}.nil? && {{/isNullable}}{{{name}}}.length > {{{maxItems}}}
|
340
|
+
fail ArgumentError, 'invalid value for "{{{name}}}", number of items must be less than or equal to {{{maxItems}}}.'
|
341
|
+
end
|
342
|
+
|
343
|
+
{{/maxItems}}
|
344
|
+
{{#minItems}}
|
345
|
+
if {{#isNullable}}!{{{name}}}.nil? && {{/isNullable}}{{{name}}}.length < {{{minItems}}}
|
346
|
+
fail ArgumentError, 'invalid value for "{{{name}}}", number of items must be greater than or equal to {{{minItems}}}.'
|
347
|
+
end
|
348
|
+
|
349
|
+
{{/minItems}}
|
350
|
+
@{{{name}}} = {{{name}}}
|
351
|
+
end
|
352
|
+
|
353
|
+
{{/hasValidation}}
|
354
|
+
{{/isEnum}}
|
355
|
+
{{/vars}}
|
356
|
+
# Checks equality by comparing each attribute.
|
357
|
+
# @param [Object] Object to be compared
|
358
|
+
def ==(o)
|
359
|
+
return true if self.equal?(o)
|
360
|
+
self.class == o.class{{#vars}} &&
|
361
|
+
{{name}} == o.{{name}}{{/vars}}{{#parent}} && super(o){{/parent}}
|
362
|
+
end
|
363
|
+
|
364
|
+
# @see the `==` method
|
365
|
+
# @param [Object] Object to be compared
|
366
|
+
def eql?(o)
|
367
|
+
self == o
|
368
|
+
end
|
369
|
+
|
370
|
+
# Calculates hash code according to all attributes.
|
371
|
+
# @return [Integer] Hash code
|
372
|
+
def hash
|
373
|
+
[{{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}}].hash
|
374
|
+
end
|
375
|
+
|
376
|
+
{{> base_object}}
|
377
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# {{moduleName}}::{{classname}}
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
{{#vars}}
|
8
|
+
| **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} |
|
9
|
+
{{/vars}}
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require '{{{gemName}}}'
|
15
|
+
|
16
|
+
{{^vars}}
|
17
|
+
instance = {{moduleName}}::{{classname}}.new()
|
18
|
+
{{/vars}}
|
19
|
+
{{#vars}}
|
20
|
+
{{#-first}}
|
21
|
+
instance = {{moduleName}}::{{classname}}.new(
|
22
|
+
{{/-first}}
|
23
|
+
{{name}}: {{example}}{{^-last}},{{/-last}}
|
24
|
+
{{#-last}}
|
25
|
+
)
|
26
|
+
{{/-last}}
|
27
|
+
{{/vars}}
|
28
|
+
```
|
@@ -0,0 +1,137 @@
|
|
1
|
+
{{#description}}
|
2
|
+
# {{{.}}}
|
3
|
+
{{/description}}
|
4
|
+
module {{classname}}
|
5
|
+
class << self
|
6
|
+
{{#oneOf}}
|
7
|
+
{{#-first}}
|
8
|
+
# List of class defined in oneOf (OpenAPI v3)
|
9
|
+
def openapi_one_of
|
10
|
+
[
|
11
|
+
{{/-first}}
|
12
|
+
:'{{{.}}}'{{^-last}},{{/-last}}
|
13
|
+
{{#-last}}
|
14
|
+
]
|
15
|
+
end
|
16
|
+
|
17
|
+
{{/-last}}
|
18
|
+
{{/oneOf}}
|
19
|
+
{{#discriminator}}
|
20
|
+
{{#propertyName}}
|
21
|
+
# Discriminator's property name (OpenAPI v3)
|
22
|
+
def openapi_discriminator_name
|
23
|
+
:'{{{.}}}'
|
24
|
+
end
|
25
|
+
|
26
|
+
{{/propertyName}}
|
27
|
+
{{#mappedModels}}
|
28
|
+
{{#-first}}
|
29
|
+
# Discriminator's mapping (OpenAPI v3)
|
30
|
+
def openapi_discriminator_mapping
|
31
|
+
{
|
32
|
+
{{/-first}}
|
33
|
+
:'{{{mappingName}}}' => :'{{{modelName}}}'{{^-last}},{{/-last}}
|
34
|
+
{{#-last}}
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
{{/-last}}
|
39
|
+
{{/mappedModels}}
|
40
|
+
{{/discriminator}}
|
41
|
+
# Builds the object
|
42
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
43
|
+
# @return [Object] Returns the model or the data itself
|
44
|
+
def build(data)
|
45
|
+
{{#discriminator}}
|
46
|
+
discriminator_value = data[openapi_discriminator_name]
|
47
|
+
return nil if discriminator_value.nil?
|
48
|
+
{{#mappedModels}}
|
49
|
+
{{#-first}}
|
50
|
+
|
51
|
+
klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
|
52
|
+
return nil unless klass
|
53
|
+
|
54
|
+
{{moduleName}}.const_get(klass).build_from_hash(data)
|
55
|
+
{{/-first}}
|
56
|
+
{{/mappedModels}}
|
57
|
+
{{^mappedModels}}
|
58
|
+
{{moduleName}}.const_get(discriminator_value).build_from_hash(data)
|
59
|
+
{{/mappedModels}}
|
60
|
+
{{/discriminator}}
|
61
|
+
{{^discriminator}}
|
62
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
63
|
+
# Note:
|
64
|
+
# - We do not attempt to check whether exactly one item matches.
|
65
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
66
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
67
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
68
|
+
# - TODO: logging when debugging is set.
|
69
|
+
openapi_one_of.each do |klass|
|
70
|
+
begin
|
71
|
+
next if klass == :AnyType # "nullable: true"
|
72
|
+
typed_data = find_and_cast_into_type(klass, data)
|
73
|
+
return typed_data if typed_data
|
74
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
79
|
+
{{/discriminator}}
|
80
|
+
end
|
81
|
+
{{^discriminator}}
|
82
|
+
|
83
|
+
private
|
84
|
+
|
85
|
+
SchemaMismatchError = Class.new(StandardError)
|
86
|
+
|
87
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
88
|
+
def find_and_cast_into_type(klass, data)
|
89
|
+
return if data.nil?
|
90
|
+
|
91
|
+
case klass.to_s
|
92
|
+
when 'Boolean'
|
93
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
94
|
+
when 'Float'
|
95
|
+
return data if data.instance_of?(Float)
|
96
|
+
when 'Integer'
|
97
|
+
return data if data.instance_of?(Integer)
|
98
|
+
when 'Time'
|
99
|
+
return Time.parse(data)
|
100
|
+
when 'Date'
|
101
|
+
return Date.parse(data)
|
102
|
+
when 'String'
|
103
|
+
return data if data.instance_of?(String)
|
104
|
+
when 'Object' # "type: object"
|
105
|
+
return data if data.instance_of?(Hash)
|
106
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
107
|
+
if data.instance_of?(Array)
|
108
|
+
sub_type = Regexp.last_match[:sub_type]
|
109
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
110
|
+
end
|
111
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
112
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
113
|
+
sub_type = Regexp.last_match[:sub_type]
|
114
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
115
|
+
end
|
116
|
+
else # model
|
117
|
+
const = {{moduleName}}.const_get(klass)
|
118
|
+
if const
|
119
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
120
|
+
model = const.build(data)
|
121
|
+
return model if model
|
122
|
+
else
|
123
|
+
# raise if data contains keys that are not known to the model
|
124
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
125
|
+
model = const.build_from_hash(data)
|
126
|
+
return model if model
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
raise # if no match by now, raise
|
132
|
+
rescue
|
133
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
134
|
+
end
|
135
|
+
{{/discriminator}}
|
136
|
+
end
|
137
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# {{moduleName}}::{{classname}}
|
2
|
+
|
3
|
+
## Class instance methods
|
4
|
+
|
5
|
+
### `openapi_one_of`
|
6
|
+
|
7
|
+
Returns the list of classes defined in oneOf.
|
8
|
+
|
9
|
+
#### Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require '{{{gemName}}}'
|
13
|
+
|
14
|
+
{{moduleName}}::{{classname}}.openapi_one_of
|
15
|
+
# =>
|
16
|
+
{{#oneOf}}
|
17
|
+
{{#-first}}
|
18
|
+
# [
|
19
|
+
{{/-first}}
|
20
|
+
# :'{{{.}}}'{{^-last}},{{/-last}}
|
21
|
+
{{#-last}}
|
22
|
+
# ]
|
23
|
+
{{/-last}}
|
24
|
+
{{/oneOf}}
|
25
|
+
```
|
26
|
+
{{#discriminator}}
|
27
|
+
{{#propertyName}}
|
28
|
+
|
29
|
+
### `openapi_discriminator_name`
|
30
|
+
|
31
|
+
Returns the discriminator's property name.
|
32
|
+
|
33
|
+
#### Example
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
require '{{{gemName}}}'
|
37
|
+
|
38
|
+
{{moduleName}}::{{classname}}.openapi_discriminator_name
|
39
|
+
# => :'{{{.}}}'
|
40
|
+
```
|
41
|
+
{{/propertyName}}
|
42
|
+
{{#mappedModels}}
|
43
|
+
{{#-first}}
|
44
|
+
|
45
|
+
### `openapi_discriminator_name`
|
46
|
+
|
47
|
+
Returns the discriminator's mapping.
|
48
|
+
|
49
|
+
#### Example
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
require '{{{gemName}}}'
|
53
|
+
|
54
|
+
{{moduleName}}::{{classname}}.openapi_discriminator_mapping
|
55
|
+
# =>
|
56
|
+
# {
|
57
|
+
{{/-first}}
|
58
|
+
# :'{{{mappingName}}}' => :'{{{modelName}}}'{{^-last}},{{/-last}}
|
59
|
+
{{#-last}}
|
60
|
+
# }
|
61
|
+
{{/-last}}
|
62
|
+
{{/mappedModels}}
|
63
|
+
```
|
64
|
+
{{/discriminator}}
|
65
|
+
|
66
|
+
### build
|
67
|
+
|
68
|
+
Find the appropriate object from the `openapi_one_of` list and casts the data into it.
|
69
|
+
|
70
|
+
#### Example
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
require '{{{gemName}}}'
|
74
|
+
|
75
|
+
{{moduleName}}::{{classname}}.build(data)
|
76
|
+
# => {{#oneOf}}{{#-first}}#<{{{.}}}:0x00007fdd4aab02a0>{{/-first}}{{/oneOf}}
|
77
|
+
|
78
|
+
{{moduleName}}::{{classname}}.build(data_that_doesnt_match)
|
79
|
+
# => nil
|
80
|
+
```
|
81
|
+
|
82
|
+
#### Parameters
|
83
|
+
|
84
|
+
| Name | Type | Description |
|
85
|
+
| ---- | ---- | ----------- |
|
86
|
+
| **data** | **Mixed** | data to be matched against the list of oneOf items |
|
87
|
+
|
88
|
+
#### Return type
|
89
|
+
|
90
|
+
{{#oneOf}}
|
91
|
+
- `{{{.}}}`
|
92
|
+
{{/oneOf}}
|
93
|
+
- `nil` (if no type matches)
|