diff --git a/.generated/.openapi-generator/FILES b/.generated/.openapi-generator/FILES index eb469c9..d2a15df 100644 --- a/.generated/.openapi-generator/FILES +++ b/.generated/.openapi-generator/FILES @@ -35,6 +35,8 @@ docs/CreateBulkInvitationsRequestInner.md docs/CreateEmailAddressRequest.md docs/CreateInvitationRequest.md docs/CreateJWTTemplateRequest.md +docs/CreateM2MToken201Response.md +docs/CreateM2MTokenRequest.md docs/CreateMachine200Response.md docs/CreateMachineRequest.md docs/CreateMachineScopeRequest.md @@ -68,6 +70,12 @@ docs/EmailSMSTemplatesApi.md docs/ExternalAccountWithVerification.md docs/ExternalAccountWithVerificationVerification.md docs/FeatureResponse.md +docs/GetM2MTokens200Response.md +docs/GetM2MTokens200ResponseM2mTokensInner.md +docs/GetM2MTokens400Response.md +docs/GetM2MTokens400ResponseErrorsInner.md +docs/GetM2MTokens403Response.md +docs/GetM2MTokens403ResponseErrorsInner.md docs/GetMachineSecretKey200Response.md docs/IdentificationLink.md docs/Instance.md @@ -89,6 +97,7 @@ docs/JWTTemplate.md docs/JWTTemplatesApi.md docs/ListMachines200Response.md docs/ListWaitlistEntries200Response.md +docs/M2MTokensApi.md docs/Machine.md docs/MachineScope.md docs/MachineWithoutScopedMachines.md @@ -134,6 +143,7 @@ docs/RedirectUrl.md docs/RedirectUrlsApi.md docs/RefreshSessionRequest.md docs/RevokeInvitation200Response.md +docs/RevokeM2MTokenRequest.md docs/RevokeOrganizationInvitationRequest.md docs/SAMLAccount.md docs/SAMLAccountSamlConnection.md @@ -198,11 +208,8 @@ docs/VerificationTicket.md docs/VerificationWeb3.md docs/VerifyClientRequest.md docs/VerifyDomainProxyRequest.md +docs/VerifyM2MTokenRequest.md docs/VerifyOauthAccessToken200Response.md -docs/VerifyOauthAccessToken400Response.md -docs/VerifyOauthAccessToken400ResponseErrorsInner.md -docs/VerifyOauthAccessToken404Response.md -docs/VerifyOauthAccessToken404ResponseErrorsInner.md docs/VerifyOauthAccessTokenRequest.md docs/VerifyPassword200Response.md docs/VerifyPasswordRequest.md @@ -230,6 +237,7 @@ lib/clerk-http-client/api/instance_settings_api.rb lib/clerk-http-client/api/invitations_api.rb lib/clerk-http-client/api/jwks_api.rb lib/clerk-http-client/api/jwt_templates_api.rb +lib/clerk-http-client/api/m2_m_tokens_api.rb lib/clerk-http-client/api/machines_api.rb lib/clerk-http-client/api/miscellaneous_api.rb lib/clerk-http-client/api/oauth_access_tokens_api.rb @@ -275,6 +283,8 @@ lib/clerk-http-client/models/create_bulk_invitations_request_inner.rb lib/clerk-http-client/models/create_email_address_request.rb lib/clerk-http-client/models/create_invitation_request.rb lib/clerk-http-client/models/create_jwt_template_request.rb +lib/clerk-http-client/models/create_m2_m_token201_response.rb +lib/clerk-http-client/models/create_m2_m_token_request.rb lib/clerk-http-client/models/create_machine200_response.rb lib/clerk-http-client/models/create_machine_request.rb lib/clerk-http-client/models/create_machine_scope_request.rb @@ -305,6 +315,12 @@ lib/clerk-http-client/models/email_address_verification.rb lib/clerk-http-client/models/external_account_with_verification.rb lib/clerk-http-client/models/external_account_with_verification_verification.rb lib/clerk-http-client/models/feature_response.rb +lib/clerk-http-client/models/get_m2_m_tokens200_response.rb +lib/clerk-http-client/models/get_m2_m_tokens200_response_m2m_tokens_inner.rb +lib/clerk-http-client/models/get_m2_m_tokens400_response.rb +lib/clerk-http-client/models/get_m2_m_tokens400_response_errors_inner.rb +lib/clerk-http-client/models/get_m2_m_tokens403_response.rb +lib/clerk-http-client/models/get_m2_m_tokens403_response_errors_inner.rb lib/clerk-http-client/models/get_machine_secret_key200_response.rb lib/clerk-http-client/models/identification_link.rb lib/clerk-http-client/models/instance.rb @@ -356,6 +372,7 @@ lib/clerk-http-client/models/proxy_check.rb lib/clerk-http-client/models/redirect_url.rb lib/clerk-http-client/models/refresh_session_request.rb lib/clerk-http-client/models/revoke_invitation200_response.rb +lib/clerk-http-client/models/revoke_m2_m_token_request.rb lib/clerk-http-client/models/revoke_organization_invitation_request.rb lib/clerk-http-client/models/saml_account.rb lib/clerk-http-client/models/saml_account_saml_connection.rb @@ -414,11 +431,8 @@ lib/clerk-http-client/models/verification_ticket.rb lib/clerk-http-client/models/verification_web3.rb lib/clerk-http-client/models/verify_client_request.rb lib/clerk-http-client/models/verify_domain_proxy_request.rb +lib/clerk-http-client/models/verify_m2_m_token_request.rb lib/clerk-http-client/models/verify_oauth_access_token200_response.rb -lib/clerk-http-client/models/verify_oauth_access_token400_response.rb -lib/clerk-http-client/models/verify_oauth_access_token400_response_errors_inner.rb -lib/clerk-http-client/models/verify_oauth_access_token404_response.rb -lib/clerk-http-client/models/verify_oauth_access_token404_response_errors_inner.rb lib/clerk-http-client/models/verify_oauth_access_token_request.rb lib/clerk-http-client/models/verify_password200_response.rb lib/clerk-http-client/models/verify_password_request.rb @@ -428,20 +442,15 @@ lib/clerk-http-client/models/verify_totp_request.rb lib/clerk-http-client/models/waitlist_entry.rb lib/clerk-http-client/models/web3_wallet.rb lib/clerk-http-client/models/web3_wallet_verification.rb -spec/api/commerce_api_spec.rb -spec/models/commerce_money_response_spec.rb -spec/models/commerce_plan_spec.rb -spec/models/feature_response_spec.rb -spec/models/paginated_commerce_plan_response_spec.rb -spec/models/passkey_verification_spec.rb -spec/models/verification_admin_spec.rb -spec/models/verification_from_oauth_error_spec.rb -spec/models/verification_from_oauth_spec.rb -spec/models/verification_google_one_tap_spec.rb -spec/models/verification_oauth_spec.rb -spec/models/verification_otp_spec.rb -spec/models/verification_passkey_spec.rb -spec/models/verification_saml_spec.rb -spec/models/verification_ticket_spec.rb -spec/models/verification_web3_spec.rb +spec/api/m2_m_tokens_api_spec.rb +spec/models/create_m2_m_token201_response_spec.rb +spec/models/create_m2_m_token_request_spec.rb +spec/models/get_m2_m_tokens200_response_m2m_tokens_inner_spec.rb +spec/models/get_m2_m_tokens200_response_spec.rb +spec/models/get_m2_m_tokens400_response_errors_inner_spec.rb +spec/models/get_m2_m_tokens400_response_spec.rb +spec/models/get_m2_m_tokens403_response_errors_inner_spec.rb +spec/models/get_m2_m_tokens403_response_spec.rb +spec/models/revoke_m2_m_token_request_spec.rb +spec/models/verify_m2_m_token_request_spec.rb spec/spec_helper.rb diff --git a/.generated/README.md b/.generated/README.md index ebe39a6..85c7317 100644 --- a/.generated/README.md +++ b/.generated/README.md @@ -91,6 +91,10 @@ Class | Method | HTTP request | Description *Clerk::SDK.jwt_templates* | [**get_jwt_template**](docs/JWTTemplatesApi.md#get_jwt_template) | **GET** /jwt_templates/{template_id} | Retrieve a template *Clerk::SDK.jwt_templates* | [**list_jwt_templates**](docs/JWTTemplatesApi.md#list_jwt_templates) | **GET** /jwt_templates | List all templates *Clerk::SDK.jwt_templates* | [**update_jwt_template**](docs/JWTTemplatesApi.md#update_jwt_template) | **PATCH** /jwt_templates/{template_id} | Update a JWT template +*Clerk::SDK.m2m_tokens* | [**create_m2_m_token**](docs/M2MTokensApi.md#create_m2_m_token) | **POST** /m2m_tokens | Create a M2M Token +*Clerk::SDK.m2m_tokens* | [**get_m2_m_tokens**](docs/M2MTokensApi.md#get_m2_m_tokens) | **GET** /m2m_tokens | Get M2M Tokens +*Clerk::SDK.m2m_tokens* | [**revoke_m2_m_token**](docs/M2MTokensApi.md#revoke_m2_m_token) | **POST** /m2m_tokens/{m2m_token_id}/revoke | Revoke a M2M Token +*Clerk::SDK.m2m_tokens* | [**verify_m2_m_token**](docs/M2MTokensApi.md#verify_m2_m_token) | **POST** /m2m_tokens/verify | Verify a M2M Token *Clerk::SDK.machines* | [**create_machine**](docs/MachinesApi.md#create_machine) | **POST** /machines | Create a machine *Clerk::SDK.machines* | [**create_machine_scope**](docs/MachinesApi.md#create_machine_scope) | **POST** /machines/{machine_id}/scopes | Create a machine scope *Clerk::SDK.machines* | [**delete_machine**](docs/MachinesApi.md#delete_machine) | **DELETE** /machines/{machine_id} | Delete a machine @@ -218,6 +222,8 @@ Class | Method | HTTP request | Description - [ClerkHttpClient::CreateEmailAddressRequest](docs/CreateEmailAddressRequest.md) - [ClerkHttpClient::CreateInvitationRequest](docs/CreateInvitationRequest.md) - [ClerkHttpClient::CreateJWTTemplateRequest](docs/CreateJWTTemplateRequest.md) + - [ClerkHttpClient::CreateM2MToken201Response](docs/CreateM2MToken201Response.md) + - [ClerkHttpClient::CreateM2MTokenRequest](docs/CreateM2MTokenRequest.md) - [ClerkHttpClient::CreateMachine200Response](docs/CreateMachine200Response.md) - [ClerkHttpClient::CreateMachineRequest](docs/CreateMachineRequest.md) - [ClerkHttpClient::CreateMachineScopeRequest](docs/CreateMachineScopeRequest.md) @@ -248,6 +254,12 @@ Class | Method | HTTP request | Description - [ClerkHttpClient::ExternalAccountWithVerification](docs/ExternalAccountWithVerification.md) - [ClerkHttpClient::ExternalAccountWithVerificationVerification](docs/ExternalAccountWithVerificationVerification.md) - [ClerkHttpClient::FeatureResponse](docs/FeatureResponse.md) + - [ClerkHttpClient::GetM2MTokens200Response](docs/GetM2MTokens200Response.md) + - [ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner](docs/GetM2MTokens200ResponseM2mTokensInner.md) + - [ClerkHttpClient::GetM2MTokens400Response](docs/GetM2MTokens400Response.md) + - [ClerkHttpClient::GetM2MTokens400ResponseErrorsInner](docs/GetM2MTokens400ResponseErrorsInner.md) + - [ClerkHttpClient::GetM2MTokens403Response](docs/GetM2MTokens403Response.md) + - [ClerkHttpClient::GetM2MTokens403ResponseErrorsInner](docs/GetM2MTokens403ResponseErrorsInner.md) - [ClerkHttpClient::GetMachineSecretKey200Response](docs/GetMachineSecretKey200Response.md) - [ClerkHttpClient::IdentificationLink](docs/IdentificationLink.md) - [ClerkHttpClient::Instance](docs/Instance.md) @@ -299,6 +311,7 @@ Class | Method | HTTP request | Description - [ClerkHttpClient::RedirectURL](docs/RedirectURL.md) - [ClerkHttpClient::RefreshSessionRequest](docs/RefreshSessionRequest.md) - [ClerkHttpClient::RevokeInvitation200Response](docs/RevokeInvitation200Response.md) + - [ClerkHttpClient::RevokeM2MTokenRequest](docs/RevokeM2MTokenRequest.md) - [ClerkHttpClient::RevokeOrganizationInvitationRequest](docs/RevokeOrganizationInvitationRequest.md) - [ClerkHttpClient::SAMLAccount](docs/SAMLAccount.md) - [ClerkHttpClient::SAMLAccountSamlConnection](docs/SAMLAccountSamlConnection.md) @@ -357,11 +370,8 @@ Class | Method | HTTP request | Description - [ClerkHttpClient::VerificationWeb3](docs/VerificationWeb3.md) - [ClerkHttpClient::VerifyClientRequest](docs/VerifyClientRequest.md) - [ClerkHttpClient::VerifyDomainProxyRequest](docs/VerifyDomainProxyRequest.md) + - [ClerkHttpClient::VerifyM2MTokenRequest](docs/VerifyM2MTokenRequest.md) - [ClerkHttpClient::VerifyOAuthAccessToken200Response](docs/VerifyOAuthAccessToken200Response.md) - - [ClerkHttpClient::VerifyOAuthAccessToken400Response](docs/VerifyOAuthAccessToken400Response.md) - - [ClerkHttpClient::VerifyOAuthAccessToken400ResponseErrorsInner](docs/VerifyOAuthAccessToken400ResponseErrorsInner.md) - - [ClerkHttpClient::VerifyOAuthAccessToken404Response](docs/VerifyOAuthAccessToken404Response.md) - - [ClerkHttpClient::VerifyOAuthAccessToken404ResponseErrorsInner](docs/VerifyOAuthAccessToken404ResponseErrorsInner.md) - [ClerkHttpClient::VerifyOAuthAccessTokenRequest](docs/VerifyOAuthAccessTokenRequest.md) - [ClerkHttpClient::VerifyPassword200Response](docs/VerifyPassword200Response.md) - [ClerkHttpClient::VerifyPasswordRequest](docs/VerifyPasswordRequest.md) diff --git a/.generated/docs/CommerceApi.md b/.generated/docs/CommerceApi.md index edd8d49..d3d55d1 100644 --- a/.generated/docs/CommerceApi.md +++ b/.generated/docs/CommerceApi.md @@ -29,7 +29,8 @@ end opts = { paginated: true, # Boolean | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. limit: 56, # Integer | Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. - offset: 56 # Integer | Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. + offset: 56, # Integer | Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. + payer_type: 'user' # String | Filter plans by payer type } begin @@ -66,6 +67,7 @@ end | **paginated** | **Boolean** | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. | [optional] | | **limit** | **Integer** | Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. | [optional][default to 10] | | **offset** | **Integer** | Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. | [optional][default to 0] | +| **payer_type** | **String** | Filter plans by payer type | [optional] | ### Return type diff --git a/.generated/docs/CommercePlan.md b/.generated/docs/CommercePlan.md index 2e174a3..bfa063c 100644 --- a/.generated/docs/CommercePlan.md +++ b/.generated/docs/CommercePlan.md @@ -28,8 +28,8 @@ | **for_payer_type** | **String** | The payer type this plan is designed for. | | | **slug** | **String** | The URL-friendly slug for the plan. | | | **avatar_url** | **String** | The URL of the plan's avatar image. | | -| **period** | **String** | The billing period for the plan. | | -| **interval** | **Integer** | The billing interval. | | +| **period** | **String** | The billing period for the plan. | [optional] | +| **interval** | **Integer** | The billing interval. | [optional] | | **features** | [**Array<FeatureResponse>**](FeatureResponse.md) | The features included in this plan. | | ## Example diff --git a/.generated/docs/CreateM2MToken201Response.md b/.generated/docs/CreateM2MToken201Response.md new file mode 100644 index 0000000..336f2c2 --- /dev/null +++ b/.generated/docs/CreateM2MToken201Response.md @@ -0,0 +1,42 @@ +# ClerkHttpClient::CreateM2MToken201Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | | | +| **id** | **String** | | | +| **subject** | **String** | | | +| **claims** | **Object** | | [optional] | +| **scopes** | **Array<String>** | | [optional] | +| **token** | **String** | | | +| **revoked** | **Boolean** | | | +| **revocation_reason** | **String** | | | +| **expired** | **Boolean** | | | +| **expiration** | **Float** | | | +| **last_used_at** | **Float** | | | +| **created_at** | **Float** | | | +| **updated_at** | **Float** | | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::CreateM2MToken201Response.new( + object: null, + id: mt_f7f0ba8c3b4843ce7d85fcdd5e71853e, + subject: mch_2xhFjEI5X2qWRvtV13BzSj8H6Dk, + claims: {"important_metadata":"Some useful data"}, + scopes: ["mch_2xhFjEI5X2qWRvtV13BzSj8H6Dk","mch_2yGkLpQ7Y3rXSwtU24CzTk9I7Em"], + token: mt_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, + revoked: false, + revocation_reason: Revoked by user, + expired: false, + expiration: 1716883200, + last_used_at: 1716883200, + created_at: 1716883200, + updated_at: 1716883200 +) +``` + diff --git a/.generated/docs/CreateM2MTokenRequest.md b/.generated/docs/CreateM2MTokenRequest.md new file mode 100644 index 0000000..8d92371 --- /dev/null +++ b/.generated/docs/CreateM2MTokenRequest.md @@ -0,0 +1,20 @@ +# ClerkHttpClient::CreateM2MTokenRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **seconds_until_expiration** | **Float** | | [optional] | +| **claims** | **Object** | | [optional] | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::CreateM2MTokenRequest.new( + seconds_until_expiration: null, + claims: null +) +``` + diff --git a/.generated/docs/GetM2MTokens200Response.md b/.generated/docs/GetM2MTokens200Response.md new file mode 100644 index 0000000..355dcc5 --- /dev/null +++ b/.generated/docs/GetM2MTokens200Response.md @@ -0,0 +1,20 @@ +# ClerkHttpClient::GetM2MTokens200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **m2m_tokens** | [**Array<GetM2MTokens200ResponseM2mTokensInner>**](GetM2MTokens200ResponseM2mTokensInner.md) | | | +| **total_count** | **Float** | | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::GetM2MTokens200Response.new( + m2m_tokens: null, + total_count: null +) +``` + diff --git a/.generated/docs/GetM2MTokens200ResponseM2mTokensInner.md b/.generated/docs/GetM2MTokens200ResponseM2mTokensInner.md new file mode 100644 index 0000000..e33c647 --- /dev/null +++ b/.generated/docs/GetM2MTokens200ResponseM2mTokensInner.md @@ -0,0 +1,40 @@ +# ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | | | +| **id** | **String** | | | +| **subject** | **String** | | | +| **claims** | **Object** | | [optional] | +| **scopes** | **Array<String>** | | [optional] | +| **revoked** | **Boolean** | | | +| **revocation_reason** | **String** | | | +| **expired** | **Boolean** | | | +| **expiration** | **Float** | | | +| **last_used_at** | **Float** | | | +| **created_at** | **Float** | | | +| **updated_at** | **Float** | | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner.new( + object: null, + id: mt_f7f0ba8c3b4843ce7d85fcdd5e71853e, + subject: mch_2xhFjEI5X2qWRvtV13BzSj8H6Dk, + claims: {"important_metadata":"Some useful data"}, + scopes: ["mch_2xhFjEI5X2qWRvtV13BzSj8H6Dk","mch_2yGkLpQ7Y3rXSwtU24CzTk9I7Em"], + revoked: false, + revocation_reason: Revoked by user, + expired: false, + expiration: 1716883200, + last_used_at: 1716883200, + created_at: 1716883200, + updated_at: 1716883200 +) +``` + diff --git a/.generated/docs/GetM2MTokens400Response.md b/.generated/docs/GetM2MTokens400Response.md new file mode 100644 index 0000000..fe9cdc0 --- /dev/null +++ b/.generated/docs/GetM2MTokens400Response.md @@ -0,0 +1,18 @@ +# ClerkHttpClient::GetM2MTokens400Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **errors** | [**Array<GetM2MTokens400ResponseErrorsInner>**](GetM2MTokens400ResponseErrorsInner.md) | | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::GetM2MTokens400Response.new( + errors: null +) +``` + diff --git a/.generated/docs/GetM2MTokens400ResponseErrorsInner.md b/.generated/docs/GetM2MTokens400ResponseErrorsInner.md new file mode 100644 index 0000000..4b7bec3 --- /dev/null +++ b/.generated/docs/GetM2MTokens400ResponseErrorsInner.md @@ -0,0 +1,22 @@ +# ClerkHttpClient::GetM2MTokens400ResponseErrorsInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message** | **String** | | | +| **long_message** | **String** | | | +| **code** | **String** | | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::GetM2MTokens400ResponseErrorsInner.new( + message: Bad Request, + long_message: Invalid 'url_parameter.example': Failed regex check, + code: bad_request +) +``` + diff --git a/.generated/docs/GetM2MTokens403Response.md b/.generated/docs/GetM2MTokens403Response.md new file mode 100644 index 0000000..cf003dd --- /dev/null +++ b/.generated/docs/GetM2MTokens403Response.md @@ -0,0 +1,18 @@ +# ClerkHttpClient::GetM2MTokens403Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **errors** | [**Array<GetM2MTokens403ResponseErrorsInner>**](GetM2MTokens403ResponseErrorsInner.md) | | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::GetM2MTokens403Response.new( + errors: null +) +``` + diff --git a/.generated/docs/GetM2MTokens403ResponseErrorsInner.md b/.generated/docs/GetM2MTokens403ResponseErrorsInner.md new file mode 100644 index 0000000..57129ab --- /dev/null +++ b/.generated/docs/GetM2MTokens403ResponseErrorsInner.md @@ -0,0 +1,22 @@ +# ClerkHttpClient::GetM2MTokens403ResponseErrorsInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message** | **String** | | | +| **long_message** | **String** | | | +| **code** | **String** | | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::GetM2MTokens403ResponseErrorsInner.new( + message: some details about the error, + long_message: some details about the error, + code: some_error_code +) +``` + diff --git a/.generated/docs/InstanceRestrictions.md b/.generated/docs/InstanceRestrictions.md index 4b9e845..f7913ec 100644 --- a/.generated/docs/InstanceRestrictions.md +++ b/.generated/docs/InstanceRestrictions.md @@ -7,6 +7,7 @@ | **object** | **String** | String representing the object's type. Objects of the same type share the same value. | | | **allowlist** | **Boolean** | | | | **blocklist** | **Boolean** | | | +| **allowlist_blocklist_disabled_on_sign_in** | **Boolean** | | | | **block_email_subaddresses** | **Boolean** | | | | **block_disposable_email_domains** | **Boolean** | | | @@ -19,6 +20,7 @@ instance = ClerkHttpClient::InstanceRestrictions.new( object: null, allowlist: null, blocklist: null, + allowlist_blocklist_disabled_on_sign_in: null, block_email_subaddresses: null, block_disposable_email_domains: null ) diff --git a/.generated/docs/M2MTokensApi.md b/.generated/docs/M2MTokensApi.md new file mode 100644 index 0000000..313a822 --- /dev/null +++ b/.generated/docs/M2MTokensApi.md @@ -0,0 +1,295 @@ +# Clerk::SDK.m2m_tokens + +All URIs are relative to *https://api.clerk.com/v1* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_m2_m_token**](M2MTokensApi.md#create_m2_m_token) | **POST** /m2m_tokens | Create a M2M Token | +| [**get_m2_m_tokens**](M2MTokensApi.md#get_m2_m_tokens) | **GET** /m2m_tokens | Get M2M Tokens | +| [**revoke_m2_m_token**](M2MTokensApi.md#revoke_m2_m_token) | **POST** /m2m_tokens/{m2m_token_id}/revoke | Revoke a M2M Token | +| [**verify_m2_m_token**](M2MTokensApi.md#verify_m2_m_token) | **POST** /m2m_tokens/verify | Verify a M2M Token | + + +## create_m2_m_token + +> create_m2_m_token(create_m2_m_token_request) + +Create a M2M Token + +Creates a new M2M Token. Must be authenticated via a Machine Secret Key. + +### Examples + +```ruby +require 'time' +require 'clerk' + +## Setup +Clerk.configure do |config| + config.secret_key = 'sk_test_xxxxxxxxx' +end + +create_m2_m_token_request = ClerkHttpClient::CreateM2MTokenRequest.new # CreateM2MTokenRequest | + +begin + # Create a M2M Token + result = Clerk::SDK.m2m_tokens.create_m2_m_token(create_m2_m_token_request) + p result +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.m2m_tokens->create_m2_m_token: #{e}" +end +``` + +#### Using the `create_m2_m_token_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_m2_m_token_with_http_info(create_m2_m_token_request) + +```ruby +begin + # Create a M2M Token + data, status_code, headers = Clerk::SDK.m2m_tokens.create_m2_m_token_with_http_info(create_m2_m_token_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.m2m_tokens->create_m2_m_token_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_m2_m_token_request** | [**CreateM2MTokenRequest**](CreateM2MTokenRequest.md) | | | + +### Return type + +[**CreateM2MToken201Response**](CreateM2MToken201Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_m2_m_tokens + +> get_m2_m_tokens(subject, opts) + +Get M2M Tokens + +Fetches M2M tokens for a specific machine. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When fetching M2M tokens with a Machine Secret Key, only tokens associated with the authenticated machine can be retrieved. - When fetching M2M tokens with a Clerk Secret Key, tokens for any machine in the instance can be retrieved. + +### Examples + +```ruby +require 'time' +require 'clerk' + +## Setup +Clerk.configure do |config| + config.secret_key = 'sk_test_xxxxxxxxx' +end + +subject = 'subject_example' # String | +opts = { + revoked: true, # Boolean | + expired: true, # Boolean | + limit: 8.14, # Float | + offset: 8.14 # Float | +} + +begin + # Get M2M Tokens + result = Clerk::SDK.m2m_tokens.get_m2_m_tokens(subject, opts) + p result +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.m2m_tokens->get_m2_m_tokens: #{e}" +end +``` + +#### Using the `get_m2_m_tokens_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_m2_m_tokens_with_http_info(subject, opts) + +```ruby +begin + # Get M2M Tokens + data, status_code, headers = Clerk::SDK.m2m_tokens.get_m2_m_tokens_with_http_info(subject, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.m2m_tokens->get_m2_m_tokens_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **subject** | **String** | | | +| **revoked** | **Boolean** | | [optional][default to false] | +| **expired** | **Boolean** | | [optional][default to false] | +| **limit** | **Float** | | [optional][default to 10] | +| **offset** | **Float** | | [optional][default to 0] | + +### Return type + +[**GetM2MTokens200Response**](GetM2MTokens200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## revoke_m2_m_token + +> revoke_m2_m_token(m2m_token_id, revoke_m2_m_token_request) + +Revoke a M2M Token + +Revokes a M2M Token. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When revoking a M2M Token with a Machine Secret Key, the token must managed by the Machine associated with the Machine Secret Key. - When revoking a M2M Token with a Clerk Secret Key, any token on the Instance can be revoked. + +### Examples + +```ruby +require 'time' +require 'clerk' + +## Setup +Clerk.configure do |config| + config.secret_key = 'sk_test_xxxxxxxxx' +end + +m2m_token_id = 'm2m_token_id_example' # String | +revoke_m2_m_token_request = ClerkHttpClient::RevokeM2MTokenRequest.new # RevokeM2MTokenRequest | + +begin + # Revoke a M2M Token + result = Clerk::SDK.m2m_tokens.revoke_m2_m_token(m2m_token_id, revoke_m2_m_token_request) + p result +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.m2m_tokens->revoke_m2_m_token: #{e}" +end +``` + +#### Using the `revoke_m2_m_token_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> revoke_m2_m_token_with_http_info(m2m_token_id, revoke_m2_m_token_request) + +```ruby +begin + # Revoke a M2M Token + data, status_code, headers = Clerk::SDK.m2m_tokens.revoke_m2_m_token_with_http_info(m2m_token_id, revoke_m2_m_token_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.m2m_tokens->revoke_m2_m_token_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **m2m_token_id** | **String** | | | +| **revoke_m2_m_token_request** | [**RevokeM2MTokenRequest**](RevokeM2MTokenRequest.md) | | | + +### Return type + +[**GetM2MTokens200ResponseM2mTokensInner**](GetM2MTokens200ResponseM2mTokensInner.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## verify_m2_m_token + +> verify_m2_m_token(verify_m2_m_token_request) + +Verify a M2M Token + +Verifies a M2M Token. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When verifying a M2M Token with a Machine Secret Key, the token must be granted access to the Machine associated with the Machine Secret Key. - When verifying a M2M Token with a Clerk Secret Key, any token on the Instance can be verified. + +### Examples + +```ruby +require 'time' +require 'clerk' + +## Setup +Clerk.configure do |config| + config.secret_key = 'sk_test_xxxxxxxxx' +end + +verify_m2_m_token_request = ClerkHttpClient::VerifyM2MTokenRequest.new({token: 'token_example'}) # VerifyM2MTokenRequest | + +begin + # Verify a M2M Token + result = Clerk::SDK.m2m_tokens.verify_m2_m_token(verify_m2_m_token_request) + p result +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.m2m_tokens->verify_m2_m_token: #{e}" +end +``` + +#### Using the `verify_m2_m_token_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> verify_m2_m_token_with_http_info(verify_m2_m_token_request) + +```ruby +begin + # Verify a M2M Token + data, status_code, headers = Clerk::SDK.m2m_tokens.verify_m2_m_token_with_http_info(verify_m2_m_token_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.m2m_tokens->verify_m2_m_token_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **verify_m2_m_token_request** | [**VerifyM2MTokenRequest**](VerifyM2MTokenRequest.md) | | | + +### Return type + +[**GetM2MTokens200ResponseM2mTokensInner**](GetM2MTokens200ResponseM2mTokensInner.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/.generated/docs/OrganizationSettings.md b/.generated/docs/OrganizationSettings.md index 613e50a..1168e71 100644 --- a/.generated/docs/OrganizationSettings.md +++ b/.generated/docs/OrganizationSettings.md @@ -8,7 +8,7 @@ | **enabled** | **Boolean** | | | | **max_allowed_memberships** | **Integer** | | | | **max_allowed_roles** | **Integer** | | | -| **max_allowed_permissions** | **Integer** | | | +| **max_allowed_permissions** | **Integer** | max_allowed_permissions is now a no-op, as permissions are now unlimited | [optional] | | **creator_role** | **String** | The role key that a user will be assigned after creating an organization. | | | **admin_delete_enabled** | **Boolean** | The default for whether an admin can delete an organization with the Frontend API. | | | **domains_enabled** | **Boolean** | | | diff --git a/.generated/docs/RevokeM2MTokenRequest.md b/.generated/docs/RevokeM2MTokenRequest.md new file mode 100644 index 0000000..5f385f8 --- /dev/null +++ b/.generated/docs/RevokeM2MTokenRequest.md @@ -0,0 +1,18 @@ +# ClerkHttpClient::RevokeM2MTokenRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **revocation_reason** | **String** | | [optional] | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::RevokeM2MTokenRequest.new( + revocation_reason: null +) +``` + diff --git a/.generated/docs/UpdateInstanceRestrictionsRequest.md b/.generated/docs/UpdateInstanceRestrictionsRequest.md index 8e93fd5..57ba575 100644 --- a/.generated/docs/UpdateInstanceRestrictionsRequest.md +++ b/.generated/docs/UpdateInstanceRestrictionsRequest.md @@ -6,6 +6,7 @@ | ---- | ---- | ----------- | ----- | | **allowlist** | **Boolean** | | [optional] | | **blocklist** | **Boolean** | | [optional] | +| **allowlist_blocklist_disabled_on_sign_in** | **Boolean** | | [optional] | | **block_email_subaddresses** | **Boolean** | | [optional] | | **block_disposable_email_domains** | **Boolean** | | [optional] | @@ -17,6 +18,7 @@ require 'clerk-http-client' instance = ClerkHttpClient::UpdateInstanceRestrictionsRequest.new( allowlist: null, blocklist: null, + allowlist_blocklist_disabled_on_sign_in: null, block_email_subaddresses: null, block_disposable_email_domains: null ) diff --git a/.generated/docs/VerifyM2MTokenRequest.md b/.generated/docs/VerifyM2MTokenRequest.md new file mode 100644 index 0000000..07dc958 --- /dev/null +++ b/.generated/docs/VerifyM2MTokenRequest.md @@ -0,0 +1,18 @@ +# ClerkHttpClient::VerifyM2MTokenRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **token** | **String** | | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::VerifyM2MTokenRequest.new( + token: null +) +``` + diff --git a/.generated/lib/clerk-http-client.rb b/.generated/lib/clerk-http-client.rb index 56be262..38896cc 100644 --- a/.generated/lib/clerk-http-client.rb +++ b/.generated/lib/clerk-http-client.rb @@ -40,6 +40,8 @@ ClerkHttpClient.autoload :CreateEmailAddressRequest, 'clerk-http-client/models/create_email_address_request' ClerkHttpClient.autoload :CreateInvitationRequest, 'clerk-http-client/models/create_invitation_request' ClerkHttpClient.autoload :CreateJWTTemplateRequest, 'clerk-http-client/models/create_jwt_template_request' +ClerkHttpClient.autoload :CreateM2MToken201Response, 'clerk-http-client/models/create_m2_m_token201_response' +ClerkHttpClient.autoload :CreateM2MTokenRequest, 'clerk-http-client/models/create_m2_m_token_request' ClerkHttpClient.autoload :CreateMachine200Response, 'clerk-http-client/models/create_machine200_response' ClerkHttpClient.autoload :CreateMachineRequest, 'clerk-http-client/models/create_machine_request' ClerkHttpClient.autoload :CreateMachineScopeRequest, 'clerk-http-client/models/create_machine_scope_request' @@ -70,6 +72,12 @@ ClerkHttpClient.autoload :ExternalAccountWithVerification, 'clerk-http-client/models/external_account_with_verification' ClerkHttpClient.autoload :ExternalAccountWithVerificationVerification, 'clerk-http-client/models/external_account_with_verification_verification' ClerkHttpClient.autoload :FeatureResponse, 'clerk-http-client/models/feature_response' +ClerkHttpClient.autoload :GetM2MTokens200Response, 'clerk-http-client/models/get_m2_m_tokens200_response' +ClerkHttpClient.autoload :GetM2MTokens200ResponseM2mTokensInner, 'clerk-http-client/models/get_m2_m_tokens200_response_m2m_tokens_inner' +ClerkHttpClient.autoload :GetM2MTokens400Response, 'clerk-http-client/models/get_m2_m_tokens400_response' +ClerkHttpClient.autoload :GetM2MTokens400ResponseErrorsInner, 'clerk-http-client/models/get_m2_m_tokens400_response_errors_inner' +ClerkHttpClient.autoload :GetM2MTokens403Response, 'clerk-http-client/models/get_m2_m_tokens403_response' +ClerkHttpClient.autoload :GetM2MTokens403ResponseErrorsInner, 'clerk-http-client/models/get_m2_m_tokens403_response_errors_inner' ClerkHttpClient.autoload :GetMachineSecretKey200Response, 'clerk-http-client/models/get_machine_secret_key200_response' ClerkHttpClient.autoload :IdentificationLink, 'clerk-http-client/models/identification_link' ClerkHttpClient.autoload :Instance, 'clerk-http-client/models/instance' @@ -121,6 +129,7 @@ ClerkHttpClient.autoload :RedirectURL, 'clerk-http-client/models/redirect_url' ClerkHttpClient.autoload :RefreshSessionRequest, 'clerk-http-client/models/refresh_session_request' ClerkHttpClient.autoload :RevokeInvitation200Response, 'clerk-http-client/models/revoke_invitation200_response' +ClerkHttpClient.autoload :RevokeM2MTokenRequest, 'clerk-http-client/models/revoke_m2_m_token_request' ClerkHttpClient.autoload :RevokeOrganizationInvitationRequest, 'clerk-http-client/models/revoke_organization_invitation_request' ClerkHttpClient.autoload :SAMLAccount, 'clerk-http-client/models/saml_account' ClerkHttpClient.autoload :SAMLAccountSamlConnection, 'clerk-http-client/models/saml_account_saml_connection' @@ -179,11 +188,8 @@ ClerkHttpClient.autoload :VerificationWeb3, 'clerk-http-client/models/verification_web3' ClerkHttpClient.autoload :VerifyClientRequest, 'clerk-http-client/models/verify_client_request' ClerkHttpClient.autoload :VerifyDomainProxyRequest, 'clerk-http-client/models/verify_domain_proxy_request' +ClerkHttpClient.autoload :VerifyM2MTokenRequest, 'clerk-http-client/models/verify_m2_m_token_request' ClerkHttpClient.autoload :VerifyOAuthAccessToken200Response, 'clerk-http-client/models/verify_oauth_access_token200_response' -ClerkHttpClient.autoload :VerifyOAuthAccessToken400Response, 'clerk-http-client/models/verify_oauth_access_token400_response' -ClerkHttpClient.autoload :VerifyOAuthAccessToken400ResponseErrorsInner, 'clerk-http-client/models/verify_oauth_access_token400_response_errors_inner' -ClerkHttpClient.autoload :VerifyOAuthAccessToken404Response, 'clerk-http-client/models/verify_oauth_access_token404_response' -ClerkHttpClient.autoload :VerifyOAuthAccessToken404ResponseErrorsInner, 'clerk-http-client/models/verify_oauth_access_token404_response_errors_inner' ClerkHttpClient.autoload :VerifyOAuthAccessTokenRequest, 'clerk-http-client/models/verify_oauth_access_token_request' ClerkHttpClient.autoload :VerifyPassword200Response, 'clerk-http-client/models/verify_password200_response' ClerkHttpClient.autoload :VerifyPasswordRequest, 'clerk-http-client/models/verify_password_request' @@ -209,6 +215,7 @@ ClerkHttpClient.autoload :InvitationsApi, 'clerk-http-client/api/invitations_api' ClerkHttpClient.autoload :JWKSApi, 'clerk-http-client/api/jwks_api' ClerkHttpClient.autoload :JWTTemplatesApi, 'clerk-http-client/api/jwt_templates_api' +ClerkHttpClient.autoload :M2MTokensApi, 'clerk-http-client/api/m2_m_tokens_api' ClerkHttpClient.autoload :MachinesApi, 'clerk-http-client/api/machines_api' ClerkHttpClient.autoload :MiscellaneousApi, 'clerk-http-client/api/miscellaneous_api' ClerkHttpClient.autoload :OAuthAccessTokensApi, 'clerk-http-client/api/oauth_access_tokens_api' @@ -304,6 +311,10 @@ def jwt_templates ClerkHttpClient::JWTTemplatesApi.new end + def m2m_tokens + ClerkHttpClient::M2MTokensApi.new + end + def machines ClerkHttpClient::MachinesApi.new end diff --git a/.generated/lib/clerk-http-client/api/commerce_api.rb b/.generated/lib/clerk-http-client/api/commerce_api.rb index 5bbe909..b4cc354 100644 --- a/.generated/lib/clerk-http-client/api/commerce_api.rb +++ b/.generated/lib/clerk-http-client/api/commerce_api.rb @@ -25,6 +25,7 @@ def initialize(api_client = ApiClient.default) # @option opts [Boolean] :paginated Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. # @option opts [Integer] :limit Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. (default to 10) # @option opts [Integer] :offset Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. (default to 0) + # @option opts [String] :payer_type Filter plans by payer type # @return [PaginatedCommercePlanResponse] def get_commerce_plan_list(opts = {}) @@ -38,6 +39,7 @@ def get_commerce_plan_list(opts = {}) # @option opts [Boolean] :paginated Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. # @option opts [Integer] :limit Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`. (default to 10) # @option opts [Integer] :offset Skip the first `offset` results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with `limit`. (default to 0) + # @option opts [String] :payer_type Filter plans by payer type # @return [Array<(PaginatedCommercePlanResponse, Integer, Hash)>] PaginatedCommercePlanResponse data, response status code and response headers # GET def get_commerce_plan_list_with_http_info(opts = {}) @@ -56,6 +58,10 @@ def get_commerce_plan_list_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling CommerceApi.get_commerce_plan_list, must be greater than or equal to 0.' end + allowable_values = ["user", "org"] + if @api_client.config.client_side_validation && opts[:'payer_type'] && !allowable_values.include?(opts[:'payer_type']) + fail ArgumentError, "invalid value for \"payer_type\", must be one of #{allowable_values}" + end # resource path local_var_path = '/commerce/plans' @@ -64,6 +70,7 @@ def get_commerce_plan_list_with_http_info(opts = {}) query_params[:'paginated'] = opts[:'paginated'] if !opts[:'paginated'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? + query_params[:'payer_type'] = opts[:'payer_type'] if !opts[:'payer_type'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/.generated/lib/clerk-http-client/api/m2_m_tokens_api.rb b/.generated/lib/clerk-http-client/api/m2_m_tokens_api.rb new file mode 100644 index 0000000..7f636a7 --- /dev/null +++ b/.generated/lib/clerk-http-client/api/m2_m_tokens_api.rb @@ -0,0 +1,338 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'cgi' + +module ClerkHttpClient + class M2MTokensApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create a M2M Token + # Creates a new M2M Token. Must be authenticated via a Machine Secret Key. + # @param create_m2_m_token_request [CreateM2MTokenRequest] + # @param [Hash] opts the optional parameters + # @return [CreateM2MToken201Response] + + def create_m2_m_token(create_m2_m_token_request, opts = {}) + data, _status_code, _headers = create_m2_m_token_with_http_info(create_m2_m_token_request, opts) + data + end + + # Create a M2M Token + # Creates a new M2M Token. Must be authenticated via a Machine Secret Key. + # @param create_m2_m_token_request [CreateM2MTokenRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(CreateM2MToken201Response, Integer, Hash)>] CreateM2MToken201Response data, response status code and response headers + # POST + def create_m2_m_token_with_http_info(create_m2_m_token_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: M2MTokensApi.create_m2_m_token ...' + end + # verify the required parameter 'create_m2_m_token_request' is set + if @api_client.config.client_side_validation && create_m2_m_token_request.nil? + fail ArgumentError, "Missing the required parameter 'create_m2_m_token_request' when calling M2MTokensApi.create_m2_m_token" + end + # resource path + local_var_path = '/m2m_tokens' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_m2_m_token_request) + + # return_type + return_type = opts[:debug_return_type] || 'CreateM2MToken201Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearerAuth'] + + new_options = opts.merge( + :operation => :"M2MTokensApi.create_m2_m_token", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: M2MTokensApi#create_m2_m_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get M2M Tokens + # Fetches M2M tokens for a specific machine. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When fetching M2M tokens with a Machine Secret Key, only tokens associated with the authenticated machine can be retrieved. - When fetching M2M tokens with a Clerk Secret Key, tokens for any machine in the instance can be retrieved. + # @param subject [String] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :revoked (default to false) + # @option opts [Boolean] :expired (default to false) + # @option opts [Float] :limit (default to 10) + # @option opts [Float] :offset (default to 0) + # @return [GetM2MTokens200Response] + + def get_m2_m_tokens(subject, opts = {}) + data, _status_code, _headers = get_m2_m_tokens_with_http_info(subject, opts) + data + end + + # Get M2M Tokens + # Fetches M2M tokens for a specific machine. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When fetching M2M tokens with a Machine Secret Key, only tokens associated with the authenticated machine can be retrieved. - When fetching M2M tokens with a Clerk Secret Key, tokens for any machine in the instance can be retrieved. + # @param subject [String] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :revoked (default to false) + # @option opts [Boolean] :expired (default to false) + # @option opts [Float] :limit (default to 10) + # @option opts [Float] :offset (default to 0) + # @return [Array<(GetM2MTokens200Response, Integer, Hash)>] GetM2MTokens200Response data, response status code and response headers + # GET + def get_m2_m_tokens_with_http_info(subject, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: M2MTokensApi.get_m2_m_tokens ...' + end + # verify the required parameter 'subject' is set + if @api_client.config.client_side_validation && subject.nil? + fail ArgumentError, "Missing the required parameter 'subject' when calling M2MTokensApi.get_m2_m_tokens" + end + pattern = Regexp.new(/^mch_\w{27}$/) + if @api_client.config.client_side_validation && subject !~ pattern + fail ArgumentError, "invalid value for 'subject' when calling M2MTokensApi.get_m2_m_tokens, must conform to the pattern #{pattern}." + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling M2MTokensApi.get_m2_m_tokens, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling M2MTokensApi.get_m2_m_tokens, must be greater than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 + fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling M2MTokensApi.get_m2_m_tokens, must be greater than or equal to 0.' + end + + # resource path + local_var_path = '/m2m_tokens' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'subject'] = subject + query_params[:'revoked'] = opts[:'revoked'] if !opts[:'revoked'].nil? + query_params[:'expired'] = opts[:'expired'] if !opts[:'expired'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetM2MTokens200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearerAuth'] + + new_options = opts.merge( + :operation => :"M2MTokensApi.get_m2_m_tokens", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: M2MTokensApi#get_m2_m_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Revoke a M2M Token + # Revokes a M2M Token. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When revoking a M2M Token with a Machine Secret Key, the token must managed by the Machine associated with the Machine Secret Key. - When revoking a M2M Token with a Clerk Secret Key, any token on the Instance can be revoked. + # @param m2m_token_id [String] + # @param revoke_m2_m_token_request [RevokeM2MTokenRequest] + # @param [Hash] opts the optional parameters + # @return [GetM2MTokens200ResponseM2mTokensInner] + + def revoke_m2_m_token(m2m_token_id, revoke_m2_m_token_request, opts = {}) + data, _status_code, _headers = revoke_m2_m_token_with_http_info(m2m_token_id, revoke_m2_m_token_request, opts) + data + end + + # Revoke a M2M Token + # Revokes a M2M Token. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When revoking a M2M Token with a Machine Secret Key, the token must managed by the Machine associated with the Machine Secret Key. - When revoking a M2M Token with a Clerk Secret Key, any token on the Instance can be revoked. + # @param m2m_token_id [String] + # @param revoke_m2_m_token_request [RevokeM2MTokenRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(GetM2MTokens200ResponseM2mTokensInner, Integer, Hash)>] GetM2MTokens200ResponseM2mTokensInner data, response status code and response headers + # POST + def revoke_m2_m_token_with_http_info(m2m_token_id, revoke_m2_m_token_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: M2MTokensApi.revoke_m2_m_token ...' + end + # verify the required parameter 'm2m_token_id' is set + if @api_client.config.client_side_validation && m2m_token_id.nil? + fail ArgumentError, "Missing the required parameter 'm2m_token_id' when calling M2MTokensApi.revoke_m2_m_token" + end + pattern = Regexp.new(/^mt_[0-9A-Fa-f]{32}$/) + if @api_client.config.client_side_validation && m2m_token_id !~ pattern + fail ArgumentError, "invalid value for 'm2m_token_id' when calling M2MTokensApi.revoke_m2_m_token, must conform to the pattern #{pattern}." + end + + # verify the required parameter 'revoke_m2_m_token_request' is set + if @api_client.config.client_side_validation && revoke_m2_m_token_request.nil? + fail ArgumentError, "Missing the required parameter 'revoke_m2_m_token_request' when calling M2MTokensApi.revoke_m2_m_token" + end + # resource path + local_var_path = '/m2m_tokens/{m2m_token_id}/revoke'.sub('{' + 'm2m_token_id' + '}', CGI.escape(m2m_token_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(revoke_m2_m_token_request) + + # return_type + return_type = opts[:debug_return_type] || 'GetM2MTokens200ResponseM2mTokensInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearerAuth'] + + new_options = opts.merge( + :operation => :"M2MTokensApi.revoke_m2_m_token", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: M2MTokensApi#revoke_m2_m_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Verify a M2M Token + # Verifies a M2M Token. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When verifying a M2M Token with a Machine Secret Key, the token must be granted access to the Machine associated with the Machine Secret Key. - When verifying a M2M Token with a Clerk Secret Key, any token on the Instance can be verified. + # @param verify_m2_m_token_request [VerifyM2MTokenRequest] + # @param [Hash] opts the optional parameters + # @return [GetM2MTokens200ResponseM2mTokensInner] + + def verify_m2_m_token(verify_m2_m_token_request, opts = {}) + data, _status_code, _headers = verify_m2_m_token_with_http_info(verify_m2_m_token_request, opts) + data + end + + # Verify a M2M Token + # Verifies a M2M Token. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When verifying a M2M Token with a Machine Secret Key, the token must be granted access to the Machine associated with the Machine Secret Key. - When verifying a M2M Token with a Clerk Secret Key, any token on the Instance can be verified. + # @param verify_m2_m_token_request [VerifyM2MTokenRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(GetM2MTokens200ResponseM2mTokensInner, Integer, Hash)>] GetM2MTokens200ResponseM2mTokensInner data, response status code and response headers + # POST + def verify_m2_m_token_with_http_info(verify_m2_m_token_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: M2MTokensApi.verify_m2_m_token ...' + end + # verify the required parameter 'verify_m2_m_token_request' is set + if @api_client.config.client_side_validation && verify_m2_m_token_request.nil? + fail ArgumentError, "Missing the required parameter 'verify_m2_m_token_request' when calling M2MTokensApi.verify_m2_m_token" + end + # resource path + local_var_path = '/m2m_tokens/verify' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(verify_m2_m_token_request) + + # return_type + return_type = opts[:debug_return_type] || 'GetM2MTokens200ResponseM2mTokensInner' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearerAuth'] + + new_options = opts.merge( + :operation => :"M2MTokensApi.verify_m2_m_token", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: M2MTokensApi#verify_m2_m_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/.generated/lib/clerk-http-client/models/commerce_plan.rb b/.generated/lib/clerk-http-client/models/commerce_plan.rb index bf854be..c099775 100644 --- a/.generated/lib/clerk-http-client/models/commerce_plan.rb +++ b/.generated/lib/clerk-http-client/models/commerce_plan.rb @@ -355,14 +355,10 @@ def initialize(attributes = {}) if attributes.key?(:'period') self.period = attributes[:'period'] - else - self.period = nil end if attributes.key?(:'interval') self.interval = attributes[:'interval'] - else - self.interval = nil end if attributes.key?(:'features') @@ -475,14 +471,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "avatar_url", avatar_url cannot be nil.') end - if @period.nil? - invalid_properties.push('invalid value for "period", period cannot be nil.') - end - - if @interval.nil? - invalid_properties.push('invalid value for "interval", interval cannot be nil.') - end - if @features.nil? invalid_properties.push('invalid value for "features", features cannot be nil.') end @@ -520,8 +508,6 @@ def valid? return false if @for_payer_type.nil? return false if @slug.nil? return false if @avatar_url.nil? - return false if @period.nil? - return false if @interval.nil? return false if @features.nil? true end diff --git a/.generated/lib/clerk-http-client/models/create_m2_m_token201_response.rb b/.generated/lib/clerk-http-client/models/create_m2_m_token201_response.rb new file mode 100644 index 0000000..11aafa2 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/create_m2_m_token201_response.rb @@ -0,0 +1,465 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class CreateM2MToken201Response + attr_accessor :object + + attr_accessor :id + + attr_accessor :subject + + attr_accessor :claims + + attr_accessor :scopes + + attr_accessor :token + + attr_accessor :revoked + + attr_accessor :revocation_reason + + attr_accessor :expired + + attr_accessor :expiration + + attr_accessor :last_used_at + + attr_accessor :created_at + + attr_accessor :updated_at + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'object' => :'object', + :'id' => :'id', + :'subject' => :'subject', + :'claims' => :'claims', + :'scopes' => :'scopes', + :'token' => :'token', + :'revoked' => :'revoked', + :'revocation_reason' => :'revocation_reason', + :'expired' => :'expired', + :'expiration' => :'expiration', + :'last_used_at' => :'last_used_at', + :'created_at' => :'created_at', + :'updated_at' => :'updated_at' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'object' => :'String', + :'id' => :'String', + :'subject' => :'String', + :'claims' => :'Object', + :'scopes' => :'Array', + :'token' => :'String', + :'revoked' => :'Boolean', + :'revocation_reason' => :'String', + :'expired' => :'Boolean', + :'expiration' => :'Float', + :'last_used_at' => :'Float', + :'created_at' => :'Float', + :'updated_at' => :'Float' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'claims', + :'revocation_reason', + :'expiration', + :'last_used_at', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::CreateM2MToken201Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::CreateM2MToken201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'object') + self.object = attributes[:'object'] + else + self.object = nil + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + else + self.subject = nil + end + + if attributes.key?(:'claims') + self.claims = attributes[:'claims'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + + if attributes.key?(:'token') + self.token = attributes[:'token'] + else + self.token = nil + end + + if attributes.key?(:'revoked') + self.revoked = attributes[:'revoked'] + else + self.revoked = nil + end + + if attributes.key?(:'revocation_reason') + self.revocation_reason = attributes[:'revocation_reason'] + else + self.revocation_reason = nil + end + + if attributes.key?(:'expired') + self.expired = attributes[:'expired'] + else + self.expired = nil + end + + if attributes.key?(:'expiration') + self.expiration = attributes[:'expiration'] + else + self.expiration = nil + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + else + self.last_used_at = nil + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + else + self.created_at = nil + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + else + self.updated_at = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @object.nil? + invalid_properties.push('invalid value for "object", object cannot be nil.') + end + + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + pattern = Regexp.new(/^mt_[0-9A-Fa-f]{32}$/) + if @id !~ pattern + invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.") + end + + if @subject.nil? + invalid_properties.push('invalid value for "subject", subject cannot be nil.') + end + + pattern = Regexp.new(/^mch_\w{27}$/) + if @subject !~ pattern + invalid_properties.push("invalid value for \"subject\", must conform to the pattern #{pattern}.") + end + + if @token.nil? + invalid_properties.push('invalid value for "token", token cannot be nil.') + end + + if @revoked.nil? + invalid_properties.push('invalid value for "revoked", revoked cannot be nil.') + end + + if @expired.nil? + invalid_properties.push('invalid value for "expired", expired cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @updated_at.nil? + invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @object.nil? + object_validator = EnumAttributeValidator.new('String', ["machine_to_machine_token"]) + return false unless object_validator.valid?(@object) + return false if @id.nil? + return false if @id !~ Regexp.new(/^mt_[0-9A-Fa-f]{32}$/) + return false if @subject.nil? + return false if @subject !~ Regexp.new(/^mch_\w{27}$/) + return false if @token.nil? + return false if @revoked.nil? + return false if @expired.nil? + return false if @created_at.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] object Object to be assigned + def object=(object) + validator = EnumAttributeValidator.new('String', ["machine_to_machine_token"]) + unless validator.valid?(object) + fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}." + end + @object = object + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + pattern = Regexp.new(/^mt_[0-9A-Fa-f]{32}$/) + if id !~ pattern + fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}." + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] subject Value to be assigned + def subject=(subject) + if subject.nil? + fail ArgumentError, 'subject cannot be nil' + end + + pattern = Regexp.new(/^mch_\w{27}$/) + if subject !~ pattern + fail ArgumentError, "invalid value for \"subject\", must conform to the pattern #{pattern}." + end + + @subject = subject + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + object == o.object && + id == o.id && + subject == o.subject && + claims == o.claims && + scopes == o.scopes && + token == o.token && + revoked == o.revoked && + revocation_reason == o.revocation_reason && + expired == o.expired && + expiration == o.expiration && + last_used_at == o.last_used_at && + created_at == o.created_at && + updated_at == o.updated_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [object, id, subject, claims, scopes, token, revoked, revocation_reason, expired, expiration, last_used_at, created_at, updated_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/create_m2_m_token_request.rb b/.generated/lib/clerk-http-client/models/create_m2_m_token_request.rb new file mode 100644 index 0000000..0b1b193 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/create_m2_m_token_request.rb @@ -0,0 +1,239 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class CreateM2MTokenRequest + attr_accessor :seconds_until_expiration + + attr_accessor :claims + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'seconds_until_expiration' => :'seconds_until_expiration', + :'claims' => :'claims' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'seconds_until_expiration' => :'Float', + :'claims' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'seconds_until_expiration', + :'claims' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::CreateM2MTokenRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::CreateM2MTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'seconds_until_expiration') + self.seconds_until_expiration = attributes[:'seconds_until_expiration'] + end + + if attributes.key?(:'claims') + self.claims = attributes[:'claims'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@seconds_until_expiration.nil? && @seconds_until_expiration <= 0 + invalid_properties.push('invalid value for "seconds_until_expiration", must be greater than 0.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@seconds_until_expiration.nil? && @seconds_until_expiration <= 0 + true + end + + # Custom attribute writer method with validation + # @param [Object] seconds_until_expiration Value to be assigned + def seconds_until_expiration=(seconds_until_expiration) + if !seconds_until_expiration.nil? && seconds_until_expiration <= 0 + fail ArgumentError, 'invalid value for "seconds_until_expiration", must be greater than 0.' + end + + @seconds_until_expiration = seconds_until_expiration + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + seconds_until_expiration == o.seconds_until_expiration && + claims == o.claims + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [seconds_until_expiration, claims].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/get_m2_m_tokens200_response.rb b/.generated/lib/clerk-http-client/models/get_m2_m_tokens200_response.rb new file mode 100644 index 0000000..3c1cc08 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/get_m2_m_tokens200_response.rb @@ -0,0 +1,238 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class GetM2MTokens200Response + attr_accessor :m2m_tokens + + attr_accessor :total_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'m2m_tokens' => :'m2m_tokens', + :'total_count' => :'total_count' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'m2m_tokens' => :'Array', + :'total_count' => :'Float' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::GetM2MTokens200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::GetM2MTokens200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'m2m_tokens') + if (value = attributes[:'m2m_tokens']).is_a?(Array) + self.m2m_tokens = value + end + else + self.m2m_tokens = nil + end + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + else + self.total_count = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @m2m_tokens.nil? + invalid_properties.push('invalid value for "m2m_tokens", m2m_tokens cannot be nil.') + end + + if @total_count.nil? + invalid_properties.push('invalid value for "total_count", total_count cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @m2m_tokens.nil? + return false if @total_count.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + m2m_tokens == o.m2m_tokens && + total_count == o.total_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [m2m_tokens, total_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/get_m2_m_tokens200_response_m2m_tokens_inner.rb b/.generated/lib/clerk-http-client/models/get_m2_m_tokens200_response_m2m_tokens_inner.rb new file mode 100644 index 0000000..c25dd68 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/get_m2_m_tokens200_response_m2m_tokens_inner.rb @@ -0,0 +1,449 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class GetM2MTokens200ResponseM2mTokensInner + attr_accessor :object + + attr_accessor :id + + attr_accessor :subject + + attr_accessor :claims + + attr_accessor :scopes + + attr_accessor :revoked + + attr_accessor :revocation_reason + + attr_accessor :expired + + attr_accessor :expiration + + attr_accessor :last_used_at + + attr_accessor :created_at + + attr_accessor :updated_at + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'object' => :'object', + :'id' => :'id', + :'subject' => :'subject', + :'claims' => :'claims', + :'scopes' => :'scopes', + :'revoked' => :'revoked', + :'revocation_reason' => :'revocation_reason', + :'expired' => :'expired', + :'expiration' => :'expiration', + :'last_used_at' => :'last_used_at', + :'created_at' => :'created_at', + :'updated_at' => :'updated_at' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'object' => :'String', + :'id' => :'String', + :'subject' => :'String', + :'claims' => :'Object', + :'scopes' => :'Array', + :'revoked' => :'Boolean', + :'revocation_reason' => :'String', + :'expired' => :'Boolean', + :'expiration' => :'Float', + :'last_used_at' => :'Float', + :'created_at' => :'Float', + :'updated_at' => :'Float' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'claims', + :'revocation_reason', + :'expiration', + :'last_used_at', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'object') + self.object = attributes[:'object'] + else + self.object = nil + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + else + self.subject = nil + end + + if attributes.key?(:'claims') + self.claims = attributes[:'claims'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + + if attributes.key?(:'revoked') + self.revoked = attributes[:'revoked'] + else + self.revoked = nil + end + + if attributes.key?(:'revocation_reason') + self.revocation_reason = attributes[:'revocation_reason'] + else + self.revocation_reason = nil + end + + if attributes.key?(:'expired') + self.expired = attributes[:'expired'] + else + self.expired = nil + end + + if attributes.key?(:'expiration') + self.expiration = attributes[:'expiration'] + else + self.expiration = nil + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + else + self.last_used_at = nil + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + else + self.created_at = nil + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + else + self.updated_at = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @object.nil? + invalid_properties.push('invalid value for "object", object cannot be nil.') + end + + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + pattern = Regexp.new(/^mt_[0-9A-Fa-f]{32}$/) + if @id !~ pattern + invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.") + end + + if @subject.nil? + invalid_properties.push('invalid value for "subject", subject cannot be nil.') + end + + pattern = Regexp.new(/^mch_\w{27}$/) + if @subject !~ pattern + invalid_properties.push("invalid value for \"subject\", must conform to the pattern #{pattern}.") + end + + if @revoked.nil? + invalid_properties.push('invalid value for "revoked", revoked cannot be nil.') + end + + if @expired.nil? + invalid_properties.push('invalid value for "expired", expired cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @updated_at.nil? + invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @object.nil? + object_validator = EnumAttributeValidator.new('String', ["machine_to_machine_token"]) + return false unless object_validator.valid?(@object) + return false if @id.nil? + return false if @id !~ Regexp.new(/^mt_[0-9A-Fa-f]{32}$/) + return false if @subject.nil? + return false if @subject !~ Regexp.new(/^mch_\w{27}$/) + return false if @revoked.nil? + return false if @expired.nil? + return false if @created_at.nil? + return false if @updated_at.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] object Object to be assigned + def object=(object) + validator = EnumAttributeValidator.new('String', ["machine_to_machine_token"]) + unless validator.valid?(object) + fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}." + end + @object = object + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + pattern = Regexp.new(/^mt_[0-9A-Fa-f]{32}$/) + if id !~ pattern + fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}." + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] subject Value to be assigned + def subject=(subject) + if subject.nil? + fail ArgumentError, 'subject cannot be nil' + end + + pattern = Regexp.new(/^mch_\w{27}$/) + if subject !~ pattern + fail ArgumentError, "invalid value for \"subject\", must conform to the pattern #{pattern}." + end + + @subject = subject + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + object == o.object && + id == o.id && + subject == o.subject && + claims == o.claims && + scopes == o.scopes && + revoked == o.revoked && + revocation_reason == o.revocation_reason && + expired == o.expired && + expiration == o.expiration && + last_used_at == o.last_used_at && + created_at == o.created_at && + updated_at == o.updated_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [object, id, subject, claims, scopes, revoked, revocation_reason, expired, expiration, last_used_at, created_at, updated_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/get_m2_m_tokens400_response.rb b/.generated/lib/clerk-http-client/models/get_m2_m_tokens400_response.rb new file mode 100644 index 0000000..e2a99ec --- /dev/null +++ b/.generated/lib/clerk-http-client/models/get_m2_m_tokens400_response.rb @@ -0,0 +1,222 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class GetM2MTokens400Response + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'errors' => :'errors' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::GetM2MTokens400Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::GetM2MTokens400Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + else + self.errors = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @errors.nil? + invalid_properties.push('invalid value for "errors", errors cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @errors.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/get_m2_m_tokens400_response_errors_inner.rb b/.generated/lib/clerk-http-client/models/get_m2_m_tokens400_response_errors_inner.rb new file mode 100644 index 0000000..df09b1d --- /dev/null +++ b/.generated/lib/clerk-http-client/models/get_m2_m_tokens400_response_errors_inner.rb @@ -0,0 +1,252 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class GetM2MTokens400ResponseErrorsInner + attr_accessor :message + + attr_accessor :long_message + + attr_accessor :code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message', + :'long_message' => :'long_message', + :'code' => :'code' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String', + :'long_message' => :'String', + :'code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::GetM2MTokens400ResponseErrorsInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::GetM2MTokens400ResponseErrorsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + else + self.message = nil + end + + if attributes.key?(:'long_message') + self.long_message = attributes[:'long_message'] + else + self.long_message = nil + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + else + self.code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + if @long_message.nil? + invalid_properties.push('invalid value for "long_message", long_message cannot be nil.') + end + + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @message.nil? + return false if @long_message.nil? + return false if @code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message && + long_message == o.long_message && + code == o.code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message, long_message, code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/get_m2_m_tokens403_response.rb b/.generated/lib/clerk-http-client/models/get_m2_m_tokens403_response.rb new file mode 100644 index 0000000..36bb80c --- /dev/null +++ b/.generated/lib/clerk-http-client/models/get_m2_m_tokens403_response.rb @@ -0,0 +1,222 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class GetM2MTokens403Response + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'errors' => :'errors' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::GetM2MTokens403Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::GetM2MTokens403Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + else + self.errors = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @errors.nil? + invalid_properties.push('invalid value for "errors", errors cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @errors.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/get_m2_m_tokens403_response_errors_inner.rb b/.generated/lib/clerk-http-client/models/get_m2_m_tokens403_response_errors_inner.rb new file mode 100644 index 0000000..ef67ec0 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/get_m2_m_tokens403_response_errors_inner.rb @@ -0,0 +1,252 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class GetM2MTokens403ResponseErrorsInner + attr_accessor :message + + attr_accessor :long_message + + attr_accessor :code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message', + :'long_message' => :'long_message', + :'code' => :'code' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String', + :'long_message' => :'String', + :'code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::GetM2MTokens403ResponseErrorsInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::GetM2MTokens403ResponseErrorsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + else + self.message = nil + end + + if attributes.key?(:'long_message') + self.long_message = attributes[:'long_message'] + else + self.long_message = nil + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + else + self.code = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + if @long_message.nil? + invalid_properties.push('invalid value for "long_message", long_message cannot be nil.') + end + + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @message.nil? + return false if @long_message.nil? + return false if @code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message && + long_message == o.long_message && + code == o.code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message, long_message, code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/instance_restrictions.rb b/.generated/lib/clerk-http-client/models/instance_restrictions.rb index 71da1de..71c98e0 100644 --- a/.generated/lib/clerk-http-client/models/instance_restrictions.rb +++ b/.generated/lib/clerk-http-client/models/instance_restrictions.rb @@ -22,6 +22,8 @@ class InstanceRestrictions attr_accessor :blocklist + attr_accessor :allowlist_blocklist_disabled_on_sign_in + attr_accessor :block_email_subaddresses attr_accessor :block_disposable_email_domains @@ -54,6 +56,7 @@ def self.attribute_map :'object' => :'object', :'allowlist' => :'allowlist', :'blocklist' => :'blocklist', + :'allowlist_blocklist_disabled_on_sign_in' => :'allowlist_blocklist_disabled_on_sign_in', :'block_email_subaddresses' => :'block_email_subaddresses', :'block_disposable_email_domains' => :'block_disposable_email_domains' } @@ -70,6 +73,7 @@ def self.openapi_types :'object' => :'String', :'allowlist' => :'Boolean', :'blocklist' => :'Boolean', + :'allowlist_blocklist_disabled_on_sign_in' => :'Boolean', :'block_email_subaddresses' => :'Boolean', :'block_disposable_email_domains' => :'Boolean' } @@ -114,6 +118,12 @@ def initialize(attributes = {}) self.blocklist = nil end + if attributes.key?(:'allowlist_blocklist_disabled_on_sign_in') + self.allowlist_blocklist_disabled_on_sign_in = attributes[:'allowlist_blocklist_disabled_on_sign_in'] + else + self.allowlist_blocklist_disabled_on_sign_in = nil + end + if attributes.key?(:'block_email_subaddresses') self.block_email_subaddresses = attributes[:'block_email_subaddresses'] else @@ -144,6 +154,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "blocklist", blocklist cannot be nil.') end + if @allowlist_blocklist_disabled_on_sign_in.nil? + invalid_properties.push('invalid value for "allowlist_blocklist_disabled_on_sign_in", allowlist_blocklist_disabled_on_sign_in cannot be nil.') + end + if @block_email_subaddresses.nil? invalid_properties.push('invalid value for "block_email_subaddresses", block_email_subaddresses cannot be nil.') end @@ -164,6 +178,7 @@ def valid? return false unless object_validator.valid?(@object) return false if @allowlist.nil? return false if @blocklist.nil? + return false if @allowlist_blocklist_disabled_on_sign_in.nil? return false if @block_email_subaddresses.nil? return false if @block_disposable_email_domains.nil? true @@ -187,6 +202,7 @@ def ==(o) object == o.object && allowlist == o.allowlist && blocklist == o.blocklist && + allowlist_blocklist_disabled_on_sign_in == o.allowlist_blocklist_disabled_on_sign_in && block_email_subaddresses == o.block_email_subaddresses && block_disposable_email_domains == o.block_disposable_email_domains end @@ -200,7 +216,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [object, allowlist, blocklist, block_email_subaddresses, block_disposable_email_domains].hash + [object, allowlist, blocklist, allowlist_blocklist_disabled_on_sign_in, block_email_subaddresses, block_disposable_email_domains].hash end # Builds the object from hash diff --git a/.generated/lib/clerk-http-client/models/organization_settings.rb b/.generated/lib/clerk-http-client/models/organization_settings.rb index a5888b9..3bad88a 100644 --- a/.generated/lib/clerk-http-client/models/organization_settings.rb +++ b/.generated/lib/clerk-http-client/models/organization_settings.rb @@ -24,6 +24,7 @@ class OrganizationSettings attr_accessor :max_allowed_roles + # max_allowed_permissions is now a no-op, as permissions are now unlimited attr_accessor :max_allowed_permissions # The role key that a user will be assigned after creating an organization. @@ -145,8 +146,6 @@ def initialize(attributes = {}) if attributes.key?(:'max_allowed_permissions') self.max_allowed_permissions = attributes[:'max_allowed_permissions'] - else - self.max_allowed_permissions = nil end if attributes.key?(:'creator_role') @@ -203,10 +202,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "max_allowed_roles", max_allowed_roles cannot be nil.') end - if @max_allowed_permissions.nil? - invalid_properties.push('invalid value for "max_allowed_permissions", max_allowed_permissions cannot be nil.') - end - if @creator_role.nil? invalid_properties.push('invalid value for "creator_role", creator_role cannot be nil.') end @@ -240,7 +235,6 @@ def valid? return false if @enabled.nil? return false if @max_allowed_memberships.nil? return false if @max_allowed_roles.nil? - return false if @max_allowed_permissions.nil? return false if @creator_role.nil? return false if @admin_delete_enabled.nil? return false if @domains_enabled.nil? diff --git a/.generated/lib/clerk-http-client/models/revoke_m2_m_token_request.rb b/.generated/lib/clerk-http-client/models/revoke_m2_m_token_request.rb new file mode 100644 index 0000000..6b7e151 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/revoke_m2_m_token_request.rb @@ -0,0 +1,214 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class RevokeM2MTokenRequest + attr_accessor :revocation_reason + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'revocation_reason' => :'revocation_reason' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'revocation_reason' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'revocation_reason' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::RevokeM2MTokenRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::RevokeM2MTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'revocation_reason') + self.revocation_reason = attributes[:'revocation_reason'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + revocation_reason == o.revocation_reason + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [revocation_reason].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/lib/clerk-http-client/models/update_instance_restrictions_request.rb b/.generated/lib/clerk-http-client/models/update_instance_restrictions_request.rb index 60d2cfa..f76f1f9 100644 --- a/.generated/lib/clerk-http-client/models/update_instance_restrictions_request.rb +++ b/.generated/lib/clerk-http-client/models/update_instance_restrictions_request.rb @@ -19,6 +19,8 @@ class UpdateInstanceRestrictionsRequest attr_accessor :blocklist + attr_accessor :allowlist_blocklist_disabled_on_sign_in + attr_accessor :block_email_subaddresses attr_accessor :block_disposable_email_domains @@ -28,6 +30,7 @@ def self.attribute_map { :'allowlist' => :'allowlist', :'blocklist' => :'blocklist', + :'allowlist_blocklist_disabled_on_sign_in' => :'allowlist_blocklist_disabled_on_sign_in', :'block_email_subaddresses' => :'block_email_subaddresses', :'block_disposable_email_domains' => :'block_disposable_email_domains' } @@ -43,6 +46,7 @@ def self.openapi_types { :'allowlist' => :'Boolean', :'blocklist' => :'Boolean', + :'allowlist_blocklist_disabled_on_sign_in' => :'Boolean', :'block_email_subaddresses' => :'Boolean', :'block_disposable_email_domains' => :'Boolean' } @@ -53,6 +57,7 @@ def self.openapi_nullable Set.new([ :'allowlist', :'blocklist', + :'allowlist_blocklist_disabled_on_sign_in', :'block_email_subaddresses', :'block_disposable_email_domains' ]) @@ -81,6 +86,10 @@ def initialize(attributes = {}) self.blocklist = attributes[:'blocklist'] end + if attributes.key?(:'allowlist_blocklist_disabled_on_sign_in') + self.allowlist_blocklist_disabled_on_sign_in = attributes[:'allowlist_blocklist_disabled_on_sign_in'] + end + if attributes.key?(:'block_email_subaddresses') self.block_email_subaddresses = attributes[:'block_email_subaddresses'] end @@ -112,6 +121,7 @@ def ==(o) self.class == o.class && allowlist == o.allowlist && blocklist == o.blocklist && + allowlist_blocklist_disabled_on_sign_in == o.allowlist_blocklist_disabled_on_sign_in && block_email_subaddresses == o.block_email_subaddresses && block_disposable_email_domains == o.block_disposable_email_domains end @@ -125,7 +135,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [allowlist, blocklist, block_email_subaddresses, block_disposable_email_domains].hash + [allowlist, blocklist, allowlist_blocklist_disabled_on_sign_in, block_email_subaddresses, block_disposable_email_domains].hash end # Builds the object from hash diff --git a/.generated/lib/clerk-http-client/models/verify_m2_m_token_request.rb b/.generated/lib/clerk-http-client/models/verify_m2_m_token_request.rb new file mode 100644 index 0000000..7ad67d3 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/verify_m2_m_token_request.rb @@ -0,0 +1,220 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'date' +require 'time' + +module ClerkHttpClient + class VerifyM2MTokenRequest + attr_accessor :token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'token' => :'token' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::VerifyM2MTokenRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::VerifyM2MTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'token') + self.token = attributes[:'token'] + else + self.token = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @token.nil? + invalid_properties.push('invalid value for "token", token cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @token.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + token == o.token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = ClerkHttpClient.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end +end diff --git a/.generated/spec/api/m2_m_tokens_api_spec.rb b/.generated/spec/api/m2_m_tokens_api_spec.rb new file mode 100644 index 0000000..b0ae1cc --- /dev/null +++ b/.generated/spec/api/m2_m_tokens_api_spec.rb @@ -0,0 +1,88 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for ClerkHttpClient::M2MTokensApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'M2MTokensApi' do + before do + # run before each test + @api_instance = ClerkHttpClient::M2MTokensApi.new + end + + after do + # run after each test + end + + describe 'test an instance of M2MTokensApi' do + it 'should create an instance of M2MTokensApi' do + expect(@api_instance).to be_instance_of(ClerkHttpClient::M2MTokensApi) + end + end + + # unit tests for create_m2_m_token + # Create a M2M Token + # Creates a new M2M Token. Must be authenticated via a Machine Secret Key. + # @param create_m2_m_token_request + # @param [Hash] opts the optional parameters + # @return [CreateM2MToken201Response] + describe 'create_m2_m_token test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for get_m2_m_tokens + # Get M2M Tokens + # Fetches M2M tokens for a specific machine. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When fetching M2M tokens with a Machine Secret Key, only tokens associated with the authenticated machine can be retrieved. - When fetching M2M tokens with a Clerk Secret Key, tokens for any machine in the instance can be retrieved. + # @param subject + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :revoked + # @option opts [Boolean] :expired + # @option opts [Float] :limit + # @option opts [Float] :offset + # @return [GetM2MTokens200Response] + describe 'get_m2_m_tokens test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for revoke_m2_m_token + # Revoke a M2M Token + # Revokes a M2M Token. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When revoking a M2M Token with a Machine Secret Key, the token must managed by the Machine associated with the Machine Secret Key. - When revoking a M2M Token with a Clerk Secret Key, any token on the Instance can be revoked. + # @param m2m_token_id + # @param revoke_m2_m_token_request + # @param [Hash] opts the optional parameters + # @return [GetM2MTokens200ResponseM2mTokensInner] + describe 'revoke_m2_m_token test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + # unit tests for verify_m2_m_token + # Verify a M2M Token + # Verifies a M2M Token. This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key. - When verifying a M2M Token with a Machine Secret Key, the token must be granted access to the Machine associated with the Machine Secret Key. - When verifying a M2M Token with a Clerk Secret Key, any token on the Instance can be verified. + # @param verify_m2_m_token_request + # @param [Hash] opts the optional parameters + # @return [GetM2MTokens200ResponseM2mTokensInner] + describe 'verify_m2_m_token test' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/create_m2_m_token201_response_spec.rb b/.generated/spec/models/create_m2_m_token201_response_spec.rb new file mode 100644 index 0000000..5d3b25a --- /dev/null +++ b/.generated/spec/models/create_m2_m_token201_response_spec.rb @@ -0,0 +1,112 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::CreateM2MToken201Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::CreateM2MToken201Response do + let(:instance) { ClerkHttpClient::CreateM2MToken201Response.new } + + describe 'test an instance of CreateM2MToken201Response' do + it 'should create an instance of CreateM2MToken201Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::CreateM2MToken201Response) + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["machine_to_machine_token"]) + # validator.allowable_values.each do |value| + # expect { instance.object = value }.not_to raise_error + # end + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "subject"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "claims"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "scopes"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "token"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "revoked"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "revocation_reason"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "expired"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "expiration"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/create_m2_m_token_request_spec.rb b/.generated/spec/models/create_m2_m_token_request_spec.rb new file mode 100644 index 0000000..edf2b6d --- /dev/null +++ b/.generated/spec/models/create_m2_m_token_request_spec.rb @@ -0,0 +1,42 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::CreateM2MTokenRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::CreateM2MTokenRequest do + let(:instance) { ClerkHttpClient::CreateM2MTokenRequest.new } + + describe 'test an instance of CreateM2MTokenRequest' do + it 'should create an instance of CreateM2MTokenRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::CreateM2MTokenRequest) + end + end + + describe 'test attribute "seconds_until_expiration"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "claims"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/get_m2_m_tokens200_response_m2m_tokens_inner_spec.rb b/.generated/spec/models/get_m2_m_tokens200_response_m2m_tokens_inner_spec.rb new file mode 100644 index 0000000..9f02643 --- /dev/null +++ b/.generated/spec/models/get_m2_m_tokens200_response_m2m_tokens_inner_spec.rb @@ -0,0 +1,106 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner do + let(:instance) { ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner.new } + + describe 'test an instance of GetM2MTokens200ResponseM2mTokensInner' do + it 'should create an instance of GetM2MTokens200ResponseM2mTokensInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::GetM2MTokens200ResponseM2mTokensInner) + end + end + + describe 'test attribute "object"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["machine_to_machine_token"]) + # validator.allowable_values.each do |value| + # expect { instance.object = value }.not_to raise_error + # end + end + end + + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "subject"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "claims"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "scopes"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "revoked"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "revocation_reason"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "expired"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "expiration"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "last_used_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "updated_at"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/get_m2_m_tokens200_response_spec.rb b/.generated/spec/models/get_m2_m_tokens200_response_spec.rb new file mode 100644 index 0000000..77161e1 --- /dev/null +++ b/.generated/spec/models/get_m2_m_tokens200_response_spec.rb @@ -0,0 +1,42 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::GetM2MTokens200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::GetM2MTokens200Response do + let(:instance) { ClerkHttpClient::GetM2MTokens200Response.new } + + describe 'test an instance of GetM2MTokens200Response' do + it 'should create an instance of GetM2MTokens200Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::GetM2MTokens200Response) + end + end + + describe 'test attribute "m2m_tokens"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "total_count"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/get_m2_m_tokens400_response_errors_inner_spec.rb b/.generated/spec/models/get_m2_m_tokens400_response_errors_inner_spec.rb new file mode 100644 index 0000000..55b786a --- /dev/null +++ b/.generated/spec/models/get_m2_m_tokens400_response_errors_inner_spec.rb @@ -0,0 +1,48 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::GetM2MTokens400ResponseErrorsInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::GetM2MTokens400ResponseErrorsInner do + let(:instance) { ClerkHttpClient::GetM2MTokens400ResponseErrorsInner.new } + + describe 'test an instance of GetM2MTokens400ResponseErrorsInner' do + it 'should create an instance of GetM2MTokens400ResponseErrorsInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::GetM2MTokens400ResponseErrorsInner) + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "long_message"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/get_m2_m_tokens400_response_spec.rb b/.generated/spec/models/get_m2_m_tokens400_response_spec.rb new file mode 100644 index 0000000..bd249a0 --- /dev/null +++ b/.generated/spec/models/get_m2_m_tokens400_response_spec.rb @@ -0,0 +1,36 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::GetM2MTokens400Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::GetM2MTokens400Response do + let(:instance) { ClerkHttpClient::GetM2MTokens400Response.new } + + describe 'test an instance of GetM2MTokens400Response' do + it 'should create an instance of GetM2MTokens400Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::GetM2MTokens400Response) + end + end + + describe 'test attribute "errors"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/get_m2_m_tokens403_response_errors_inner_spec.rb b/.generated/spec/models/get_m2_m_tokens403_response_errors_inner_spec.rb new file mode 100644 index 0000000..344837f --- /dev/null +++ b/.generated/spec/models/get_m2_m_tokens403_response_errors_inner_spec.rb @@ -0,0 +1,48 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::GetM2MTokens403ResponseErrorsInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::GetM2MTokens403ResponseErrorsInner do + let(:instance) { ClerkHttpClient::GetM2MTokens403ResponseErrorsInner.new } + + describe 'test an instance of GetM2MTokens403ResponseErrorsInner' do + it 'should create an instance of GetM2MTokens403ResponseErrorsInner' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::GetM2MTokens403ResponseErrorsInner) + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "long_message"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/get_m2_m_tokens403_response_spec.rb b/.generated/spec/models/get_m2_m_tokens403_response_spec.rb new file mode 100644 index 0000000..551b5c2 --- /dev/null +++ b/.generated/spec/models/get_m2_m_tokens403_response_spec.rb @@ -0,0 +1,36 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::GetM2MTokens403Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::GetM2MTokens403Response do + let(:instance) { ClerkHttpClient::GetM2MTokens403Response.new } + + describe 'test an instance of GetM2MTokens403Response' do + it 'should create an instance of GetM2MTokens403Response' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::GetM2MTokens403Response) + end + end + + describe 'test attribute "errors"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/revoke_m2_m_token_request_spec.rb b/.generated/spec/models/revoke_m2_m_token_request_spec.rb new file mode 100644 index 0000000..34991f7 --- /dev/null +++ b/.generated/spec/models/revoke_m2_m_token_request_spec.rb @@ -0,0 +1,36 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::RevokeM2MTokenRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::RevokeM2MTokenRequest do + let(:instance) { ClerkHttpClient::RevokeM2MTokenRequest.new } + + describe 'test an instance of RevokeM2MTokenRequest' do + it 'should create an instance of RevokeM2MTokenRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::RevokeM2MTokenRequest) + end + end + + describe 'test attribute "revocation_reason"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/.generated/spec/models/verify_m2_m_token_request_spec.rb b/.generated/spec/models/verify_m2_m_token_request_spec.rb new file mode 100644 index 0000000..39d14c1 --- /dev/null +++ b/.generated/spec/models/verify_m2_m_token_request_spec.rb @@ -0,0 +1,36 @@ +=begin +#Clerk Backend API + +#The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information. + +The version of the OpenAPI document: 2021-02-05 +Contact: support@clerk.com +Generated by: https://openapi-generator.tech +Generator version: unset + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for ClerkHttpClient::VerifyM2MTokenRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::VerifyM2MTokenRequest do + let(:instance) { ClerkHttpClient::VerifyM2MTokenRequest.new } + + describe 'test an instance of VerifyM2MTokenRequest' do + it 'should create an instance of VerifyM2MTokenRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::VerifyM2MTokenRequest) + end + end + + describe 'test attribute "token"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end