diff --git a/.generated/.openapi-generator/FILES b/.generated/.openapi-generator/FILES index 6084c30..605a7a5 100644 --- a/.generated/.openapi-generator/FILES +++ b/.generated/.openapi-generator/FILES @@ -25,7 +25,12 @@ docs/ClientsApi.md docs/CnameTarget.md docs/CommerceApi.md docs/CommerceMoneyResponse.md +docs/CommercePayerResponse.md +docs/CommercePaymentSourceResponse.md docs/CommercePlan.md +docs/CommerceSubscriptionCreditResponse.md +docs/CommerceSubscriptionItem.md +docs/CommerceSubscriptionItemNextPaymentResponse.md docs/Cookies.md docs/CreateActorTokenRequest.md docs/CreateActorTokenRequestActor.md @@ -131,6 +136,7 @@ docs/OrganizationWithLogo.md docs/Organizations.md docs/OrganizationsApi.md docs/PaginatedCommercePlanResponse.md +docs/PaginatedCommerceSubscriptionItemResponse.md docs/Passkey.md docs/PasskeyVerification.md docs/PhoneNumber.md @@ -197,6 +203,7 @@ docs/UsersApi.md docs/UsersBanRequest.md docs/UsersUnbanRequest.md docs/VerificationAdmin.md +docs/VerificationEmailLink.md docs/VerificationFromOauth.md docs/VerificationFromOauthError.md docs/VerificationGoogleOneTap.md @@ -273,7 +280,12 @@ lib/clerk-http-client/models/clerk_errors.rb lib/clerk-http-client/models/client.rb lib/clerk-http-client/models/cname_target.rb lib/clerk-http-client/models/commerce_money_response.rb +lib/clerk-http-client/models/commerce_payer_response.rb +lib/clerk-http-client/models/commerce_payment_source_response.rb lib/clerk-http-client/models/commerce_plan.rb +lib/clerk-http-client/models/commerce_subscription_credit_response.rb +lib/clerk-http-client/models/commerce_subscription_item.rb +lib/clerk-http-client/models/commerce_subscription_item_next_payment_response.rb lib/clerk-http-client/models/cookies.rb lib/clerk-http-client/models/create_actor_token_request.rb lib/clerk-http-client/models/create_actor_token_request_actor.rb @@ -363,6 +375,7 @@ lib/clerk-http-client/models/organization_settings.rb lib/clerk-http-client/models/organization_with_logo.rb lib/clerk-http-client/models/organizations.rb lib/clerk-http-client/models/paginated_commerce_plan_response.rb +lib/clerk-http-client/models/paginated_commerce_subscription_item_response.rb lib/clerk-http-client/models/passkey.rb lib/clerk-http-client/models/passkey_verification.rb lib/clerk-http-client/models/phone_number.rb @@ -420,6 +433,7 @@ lib/clerk-http-client/models/user.rb lib/clerk-http-client/models/users_ban_request.rb lib/clerk-http-client/models/users_unban_request.rb lib/clerk-http-client/models/verification_admin.rb +lib/clerk-http-client/models/verification_email_link.rb lib/clerk-http-client/models/verification_from_oauth.rb lib/clerk-http-client/models/verification_from_oauth_error.rb lib/clerk-http-client/models/verification_google_one_tap.rb @@ -442,4 +456,11 @@ 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/models/commerce_payer_response_spec.rb +spec/models/commerce_payment_source_response_spec.rb +spec/models/commerce_subscription_credit_response_spec.rb +spec/models/commerce_subscription_item_next_payment_response_spec.rb +spec/models/commerce_subscription_item_spec.rb +spec/models/paginated_commerce_subscription_item_response_spec.rb +spec/models/verification_email_link_spec.rb spec/spec_helper.rb diff --git a/.generated/README.md b/.generated/README.md index 85c7317..a619b0d 100644 --- a/.generated/README.md +++ b/.generated/README.md @@ -63,6 +63,7 @@ Class | Method | HTTP request | Description *Clerk::SDK.clients* | [**get_client_list**](docs/ClientsApi.md#get_client_list) | **GET** /clients | List all clients *Clerk::SDK.clients* | [**verify_client**](docs/ClientsApi.md#verify_client) | **POST** /clients/verify | Verify a client *Clerk::SDK.commerce* | [**get_commerce_plan_list**](docs/CommerceApi.md#get_commerce_plan_list) | **GET** /commerce/plans | List all commerce plans +*Clerk::SDK.commerce* | [**get_commerce_subscription_item_list**](docs/CommerceApi.md#get_commerce_subscription_item_list) | **GET** /commerce/subscription_items | List all subscription items *Clerk::SDK.domains* | [**add_domain**](docs/DomainsApi.md#add_domain) | **POST** /domains | Add a domain *Clerk::SDK.domains* | [**delete_domain**](docs/DomainsApi.md#delete_domain) | **DELETE** /domains/{domain_id} | Delete a satellite domain *Clerk::SDK.domains* | [**list_domains**](docs/DomainsApi.md#list_domains) | **GET** /domains | List all instance domains @@ -212,7 +213,12 @@ Class | Method | HTTP request | Description - [ClerkHttpClient::ClerkErrors](docs/ClerkErrors.md) - [ClerkHttpClient::Client](docs/Client.md) - [ClerkHttpClient::CommerceMoneyResponse](docs/CommerceMoneyResponse.md) + - [ClerkHttpClient::CommercePayerResponse](docs/CommercePayerResponse.md) + - [ClerkHttpClient::CommercePaymentSourceResponse](docs/CommercePaymentSourceResponse.md) - [ClerkHttpClient::CommercePlan](docs/CommercePlan.md) + - [ClerkHttpClient::CommerceSubscriptionCreditResponse](docs/CommerceSubscriptionCreditResponse.md) + - [ClerkHttpClient::CommerceSubscriptionItem](docs/CommerceSubscriptionItem.md) + - [ClerkHttpClient::CommerceSubscriptionItemNextPaymentResponse](docs/CommerceSubscriptionItemNextPaymentResponse.md) - [ClerkHttpClient::Cookies](docs/Cookies.md) - [ClerkHttpClient::CreateActorTokenRequest](docs/CreateActorTokenRequest.md) - [ClerkHttpClient::CreateActorTokenRequestActor](docs/CreateActorTokenRequestActor.md) @@ -302,6 +308,7 @@ Class | Method | HTTP request | Description - [ClerkHttpClient::OrganizationWithLogo](docs/OrganizationWithLogo.md) - [ClerkHttpClient::Organizations](docs/Organizations.md) - [ClerkHttpClient::PaginatedCommercePlanResponse](docs/PaginatedCommercePlanResponse.md) + - [ClerkHttpClient::PaginatedCommerceSubscriptionItemResponse](docs/PaginatedCommerceSubscriptionItemResponse.md) - [ClerkHttpClient::Passkey](docs/Passkey.md) - [ClerkHttpClient::PasskeyVerification](docs/PasskeyVerification.md) - [ClerkHttpClient::PhoneNumber](docs/PhoneNumber.md) @@ -359,6 +366,7 @@ Class | Method | HTTP request | Description - [ClerkHttpClient::UsersBanRequest](docs/UsersBanRequest.md) - [ClerkHttpClient::UsersUnbanRequest](docs/UsersUnbanRequest.md) - [ClerkHttpClient::VerificationAdmin](docs/VerificationAdmin.md) + - [ClerkHttpClient::VerificationEmailLink](docs/VerificationEmailLink.md) - [ClerkHttpClient::VerificationFromOauth](docs/VerificationFromOauth.md) - [ClerkHttpClient::VerificationFromOauthError](docs/VerificationFromOauthError.md) - [ClerkHttpClient::VerificationGoogleOneTap](docs/VerificationGoogleOneTap.md) diff --git a/.generated/docs/BetaFeaturesApi.md b/.generated/docs/BetaFeaturesApi.md index 71cc21b..d229cef 100644 --- a/.generated/docs/BetaFeaturesApi.md +++ b/.generated/docs/BetaFeaturesApi.md @@ -15,7 +15,7 @@ All URIs are relative to *https://api.clerk.com/v1* Update production instance domain -Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. +Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy-certificates), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. ### Examples @@ -154,7 +154,7 @@ end Update production instance domain -Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. +Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy-certificates), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. ### Examples diff --git a/.generated/docs/CommerceApi.md b/.generated/docs/CommerceApi.md index d3d55d1..4f997e7 100644 --- a/.generated/docs/CommerceApi.md +++ b/.generated/docs/CommerceApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.clerk.com/v1* | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [**get_commerce_plan_list**](CommerceApi.md#get_commerce_plan_list) | **GET** /commerce/plans | List all commerce plans | +| [**get_commerce_subscription_item_list**](CommerceApi.md#get_commerce_subscription_item_list) | **GET** /commerce/subscription_items | List all subscription items | ## get_commerce_plan_list @@ -82,3 +83,87 @@ end - **Content-Type**: Not defined - **Accept**: application/json + +## get_commerce_subscription_item_list + +> get_commerce_subscription_item_list(opts) + +List all subscription items + +Returns a list of all subscription items for the instance. The subscription items are returned sorted by creation date, with the newest appearing first. This includes subscriptions for both users and organizations. Pagination is supported. + +### Examples + +```ruby +require 'time' +require 'clerk' + +## Setup +Clerk.configure do |config| + config.secret_key = 'sk_test_xxxxxxxxx' +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`. + status: 'active', # String | Filter subscription items by status + payer_type: 'user', # String | Filter subscription items by payer type + plan_id: 'plan_id_example', # String | Filter subscription items by plan ID + include_free: true, # Boolean | Whether to include free plan subscription items + query: 'query_example' # String | Search query to filter subscription items +} + +begin + # List all subscription items + result = Clerk::SDK.commerce.get_commerce_subscription_item_list(opts) + p result +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.commerce->get_commerce_subscription_item_list: #{e}" +end +``` + +#### Using the `get_commerce_subscription_item_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_commerce_subscription_item_list_with_http_info(opts) + +```ruby +begin + # List all subscription items + data, status_code, headers = Clerk::SDK.commerce.get_commerce_subscription_item_list_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue ClerkHttpClient::ApiError => e + puts "Error when calling Clerk::SDK.commerce->get_commerce_subscription_item_list_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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] | +| **status** | **String** | Filter subscription items by status | [optional] | +| **payer_type** | **String** | Filter subscription items by payer type | [optional] | +| **plan_id** | **String** | Filter subscription items by plan ID | [optional] | +| **include_free** | **Boolean** | Whether to include free plan subscription items | [optional][default to false] | +| **query** | **String** | Search query to filter subscription items | [optional] | + +### Return type + +[**PaginatedCommerceSubscriptionItemResponse**](PaginatedCommerceSubscriptionItemResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/.generated/docs/CommercePayerResponse.md b/.generated/docs/CommercePayerResponse.md new file mode 100644 index 0000000..e2721b2 --- /dev/null +++ b/.generated/docs/CommercePayerResponse.md @@ -0,0 +1,40 @@ +# ClerkHttpClient::CommercePayerResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | String representing the object's type. Objects of the same type share the same value. | | +| **id** | **String** | Unique identifier for the payer. | | +| **instance_id** | **String** | Unique identifier for the Clerk instance. | | +| **user_id** | **String** | User ID for user-type payers. | [optional] | +| **first_name** | **String** | First name of the payer. | | +| **last_name** | **String** | Last name of the payer. | | +| **email** | **String** | Email address of the payer. | | +| **organization_id** | **String** | Organization ID for org-type payers. | [optional] | +| **organization_name** | **String** | Organization name for org-type payers. | [optional] | +| **image_url** | **String** | URL of the payer's image/avatar. | | +| **created_at** | **Integer** | Unix timestamp (in milliseconds) when the payer was created. | | +| **updated_at** | **Integer** | Unix timestamp (in milliseconds) when the payer was last updated. | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::CommercePayerResponse.new( + object: null, + id: null, + instance_id: null, + user_id: null, + first_name: null, + last_name: null, + email: null, + organization_id: null, + organization_name: null, + image_url: null, + created_at: null, + updated_at: null +) +``` + diff --git a/.generated/docs/CommercePaymentSourceResponse.md b/.generated/docs/CommercePaymentSourceResponse.md new file mode 100644 index 0000000..efdb176 --- /dev/null +++ b/.generated/docs/CommercePaymentSourceResponse.md @@ -0,0 +1,50 @@ +# ClerkHttpClient::CommercePaymentSourceResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | String representing the object's type. Objects of the same type share the same value. | | +| **id** | **String** | Unique identifier for the payment source. | | +| **payer_id** | **String** | Unique identifier for the payer. | | +| **payment_method** | **String** | The payment method type. | | +| **is_default** | **Boolean** | Whether this is the default payment source for the payer. | [optional] | +| **gateway** | **String** | The payment gateway. | | +| **gateway_external_id** | **String** | External ID in the payment gateway. | | +| **gateway_external_account_id** | **String** | External account ID in the payment gateway. | [optional] | +| **last4** | **String** | Last 4 digits of the card (for card payment sources). | | +| **status** | **String** | Status of the payment source. | | +| **wallet_type** | **String** | Type of wallet (if applicable). | | +| **card_type** | **String** | Type of card (if applicable). | | +| **expiry_year** | **Integer** | Card expiration year (for card payment sources). | [optional] | +| **expiry_month** | **Integer** | Card expiration month (for card payment sources). | [optional] | +| **created_at** | **Integer** | Unix timestamp (in milliseconds) when the payment source was created. | | +| **updated_at** | **Integer** | Unix timestamp (in milliseconds) when the payment source was last updated. | | +| **is_removable** | **Boolean** | Whether this payment source can be removed. | [optional] | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::CommercePaymentSourceResponse.new( + object: null, + id: null, + payer_id: null, + payment_method: null, + is_default: null, + gateway: null, + gateway_external_id: null, + gateway_external_account_id: null, + last4: null, + status: null, + wallet_type: null, + card_type: null, + expiry_year: null, + expiry_month: null, + created_at: null, + updated_at: null, + is_removable: null +) +``` + diff --git a/.generated/docs/CommercePlan.md b/.generated/docs/CommercePlan.md index bfa063c..6791b3a 100644 --- a/.generated/docs/CommercePlan.md +++ b/.generated/docs/CommercePlan.md @@ -31,6 +31,8 @@ | **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. | | +| **free_trial_enabled** | **Boolean** | Whether free trial is enabled for this plan. | [optional] | +| **free_trial_days** | **Integer** | Number of free trial days for this plan. | [optional] | ## Example @@ -64,7 +66,9 @@ instance = ClerkHttpClient::CommercePlan.new( avatar_url: null, period: null, interval: null, - features: null + features: null, + free_trial_enabled: null, + free_trial_days: null ) ``` diff --git a/.generated/docs/CommerceSubscriptionCreditResponse.md b/.generated/docs/CommerceSubscriptionCreditResponse.md new file mode 100644 index 0000000..7ff8f22 --- /dev/null +++ b/.generated/docs/CommerceSubscriptionCreditResponse.md @@ -0,0 +1,20 @@ +# ClerkHttpClient::CommerceSubscriptionCreditResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **amount** | [**CommerceMoneyResponse**](CommerceMoneyResponse.md) | Credit amount. | [optional] | +| **cycle_remaining_percent** | **Float** | Percentage of the billing cycle remaining. | [optional] | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::CommerceSubscriptionCreditResponse.new( + amount: null, + cycle_remaining_percent: null +) +``` + diff --git a/.generated/docs/CommerceSubscriptionItem.md b/.generated/docs/CommerceSubscriptionItem.md new file mode 100644 index 0000000..4382821 --- /dev/null +++ b/.generated/docs/CommerceSubscriptionItem.md @@ -0,0 +1,66 @@ +# ClerkHttpClient::CommerceSubscriptionItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | String representing the object's type. Objects of the same type share the same value. | | +| **id** | **String** | Unique identifier for the subscription item. | | +| **instance_id** | **String** | Unique identifier for the Clerk instance. | | +| **status** | **String** | Current status of the subscription item. | | +| **credit** | [**CommerceSubscriptionCreditResponse**](CommerceSubscriptionCreditResponse.md) | Credit information (only available in PaymentAttempt events). | [optional] | +| **plan_id** | **String** | Unique identifier for the associated plan. | | +| **plan** | [**CommercePlan**](CommercePlan.md) | The associated commerce plan. | | +| **plan_period** | **String** | The billing period for this subscription. | | +| **payment_source_id** | **String** | Unique identifier for the payment source. | | +| **payment_source** | [**CommercePaymentSourceResponse**](CommercePaymentSourceResponse.md) | The payment source associated with this subscription. | [optional] | +| **lifetime_paid** | [**CommerceMoneyResponse**](CommerceMoneyResponse.md) | Total amount paid over the lifetime of this subscription. | [optional] | +| **amount** | [**CommerceMoneyResponse**](CommerceMoneyResponse.md) | Current amount for this subscription. | [optional] | +| **next_invoice** | [**CommerceSubscriptionItemNextPaymentResponse**](CommerceSubscriptionItemNextPaymentResponse.md) | Information about the next invoice. | [optional] | +| **next_payment** | [**CommerceSubscriptionItemNextPaymentResponse**](CommerceSubscriptionItemNextPaymentResponse.md) | Information about the next payment. | [optional] | +| **payer_id** | **String** | Unique identifier for the payer. | | +| **payer** | [**CommercePayerResponse**](CommercePayerResponse.md) | The payer associated with this subscription. | [optional] | +| **is_free_trial** | **Boolean** | Whether this subscription is currently on a free trial. | | +| **period_start** | **Integer** | Unix timestamp (in milliseconds) when the current period started. | [optional] | +| **period_end** | **Integer** | Unix timestamp (in milliseconds) when the current period ends. | [optional] | +| **proration_date** | **String** | Date used for proration calculations. | | +| **canceled_at** | **Integer** | Unix timestamp (in milliseconds) when the subscription was canceled. | [optional] | +| **past_due_at** | **Integer** | Unix timestamp (in milliseconds) when the subscription became past due. | [optional] | +| **ended_at** | **Integer** | Unix timestamp (in milliseconds) when the subscription ended. | [optional] | +| **created_at** | **Integer** | Unix timestamp (in milliseconds) when the subscription was created. | | +| **updated_at** | **Integer** | Unix timestamp (in milliseconds) when the subscription was last updated. | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::CommerceSubscriptionItem.new( + object: null, + id: null, + instance_id: null, + status: null, + credit: null, + plan_id: null, + plan: null, + plan_period: null, + payment_source_id: null, + payment_source: null, + lifetime_paid: null, + amount: null, + next_invoice: null, + next_payment: null, + payer_id: null, + payer: null, + is_free_trial: null, + period_start: null, + period_end: null, + proration_date: null, + canceled_at: null, + past_due_at: null, + ended_at: null, + created_at: null, + updated_at: null +) +``` + diff --git a/.generated/docs/CommerceSubscriptionItemNextPaymentResponse.md b/.generated/docs/CommerceSubscriptionItemNextPaymentResponse.md new file mode 100644 index 0000000..6e21ba6 --- /dev/null +++ b/.generated/docs/CommerceSubscriptionItemNextPaymentResponse.md @@ -0,0 +1,20 @@ +# ClerkHttpClient::CommerceSubscriptionItemNextPaymentResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **amount** | [**CommerceMoneyResponse**](CommerceMoneyResponse.md) | Amount for the next payment. | [optional] | +| **date** | **Integer** | Unix timestamp (in milliseconds) for the next payment date. | [optional] | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::CommerceSubscriptionItemNextPaymentResponse.new( + amount: null, + date: null +) +``` + diff --git a/.generated/docs/EmailAddressVerification.md b/.generated/docs/EmailAddressVerification.md index 50689ea..680d537 100644 --- a/.generated/docs/EmailAddressVerification.md +++ b/.generated/docs/EmailAddressVerification.md @@ -15,8 +15,10 @@ ClerkHttpClient::EmailAddressVerification.openapi_one_of # => # [ # :'VerificationAdmin', +# :'VerificationEmailLink', # :'VerificationFromOauth', # :'VerificationOtp', +# :'VerificationSaml', # :'VerificationTicket' # ] ``` @@ -60,8 +62,10 @@ ClerkHttpClient::EmailAddressVerification.build(data_that_doesnt_match) #### Return type - `VerificationAdmin` +- `VerificationEmailLink` - `VerificationFromOauth` - `VerificationOtp` +- `VerificationSaml` - `VerificationTicket` - `nil` (if no type matches) diff --git a/.generated/docs/OrganizationsApi.md b/.generated/docs/OrganizationsApi.md index 656a5e1..276972e 100644 --- a/.generated/docs/OrganizationsApi.md +++ b/.generated/docs/OrganizationsApi.md @@ -20,7 +20,7 @@ All URIs are relative to *https://api.clerk.com/v1* Create an organization -Creates a new organization with the given name for an instance. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\". Organization slugs must be unique for the instance. You can provide additional metadata for the organization and set any custom attribute you want. Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. The `created_by` user will see this as their [active organization] (https://clerk.com/docs/organizations/overview#active-organization) the next time they create a session, presuming they don't explicitly set a different organization as active before then. +Creates a new organization with the given name for an instance. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\". Organization slugs must be unique for the instance. You can provide additional metadata for the organization and set any custom attribute you want. Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. The `created_by` user will see this as their [active organization](https://clerk.com/docs/organizations/overview#active-organization) the next time they create a session, presuming they don't explicitly set a different organization as active before then. ### Examples diff --git a/.generated/docs/PaginatedCommerceSubscriptionItemResponse.md b/.generated/docs/PaginatedCommerceSubscriptionItemResponse.md new file mode 100644 index 0000000..5b510cd --- /dev/null +++ b/.generated/docs/PaginatedCommerceSubscriptionItemResponse.md @@ -0,0 +1,20 @@ +# ClerkHttpClient::PaginatedCommerceSubscriptionItemResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **data** | [**Array<CommerceSubscriptionItem>**](CommerceSubscriptionItem.md) | Array of commerce subscription items. | | +| **total_count** | **Integer** | Total number of commerce subscription items. | | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::PaginatedCommerceSubscriptionItemResponse.new( + data: null, + total_count: null +) +``` + diff --git a/.generated/docs/SessionsApi.md b/.generated/docs/SessionsApi.md index ff22438..c318251 100644 --- a/.generated/docs/SessionsApi.md +++ b/.generated/docs/SessionsApi.md @@ -524,7 +524,7 @@ end Verify a session -Returns the session if it is authenticated; otherwise, returns an error. WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#clerk-express-require-auth)). For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). +Returns the session if it is authenticated; otherwise, returns an error. WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#require-auth)). For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). ### Examples diff --git a/.generated/docs/VerificationEmailLink.md b/.generated/docs/VerificationEmailLink.md new file mode 100644 index 0000000..8e8171f --- /dev/null +++ b/.generated/docs/VerificationEmailLink.md @@ -0,0 +1,28 @@ +# ClerkHttpClient::VerificationEmailLink + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **object** | **String** | | [optional] | +| **status** | **String** | | | +| **strategy** | **String** | | | +| **attempts** | **Integer** | | | +| **expire_at** | **Integer** | | | +| **verified_at_client** | **String** | | [optional] | + +## Example + +```ruby +require 'clerk-http-client' + +instance = ClerkHttpClient::VerificationEmailLink.new( + object: null, + status: null, + strategy: null, + attempts: null, + expire_at: null, + verified_at_client: null +) +``` + diff --git a/.generated/lib/clerk-http-client.rb b/.generated/lib/clerk-http-client.rb index 38896cc..85478f7 100644 --- a/.generated/lib/clerk-http-client.rb +++ b/.generated/lib/clerk-http-client.rb @@ -30,7 +30,12 @@ ClerkHttpClient.autoload :ClerkErrors, 'clerk-http-client/models/clerk_errors' ClerkHttpClient.autoload :Client, 'clerk-http-client/models/client' ClerkHttpClient.autoload :CommerceMoneyResponse, 'clerk-http-client/models/commerce_money_response' +ClerkHttpClient.autoload :CommercePayerResponse, 'clerk-http-client/models/commerce_payer_response' +ClerkHttpClient.autoload :CommercePaymentSourceResponse, 'clerk-http-client/models/commerce_payment_source_response' ClerkHttpClient.autoload :CommercePlan, 'clerk-http-client/models/commerce_plan' +ClerkHttpClient.autoload :CommerceSubscriptionCreditResponse, 'clerk-http-client/models/commerce_subscription_credit_response' +ClerkHttpClient.autoload :CommerceSubscriptionItem, 'clerk-http-client/models/commerce_subscription_item' +ClerkHttpClient.autoload :CommerceSubscriptionItemNextPaymentResponse, 'clerk-http-client/models/commerce_subscription_item_next_payment_response' ClerkHttpClient.autoload :Cookies, 'clerk-http-client/models/cookies' ClerkHttpClient.autoload :CreateActorTokenRequest, 'clerk-http-client/models/create_actor_token_request' ClerkHttpClient.autoload :CreateActorTokenRequestActor, 'clerk-http-client/models/create_actor_token_request_actor' @@ -120,6 +125,7 @@ ClerkHttpClient.autoload :OrganizationWithLogo, 'clerk-http-client/models/organization_with_logo' ClerkHttpClient.autoload :Organizations, 'clerk-http-client/models/organizations' ClerkHttpClient.autoload :PaginatedCommercePlanResponse, 'clerk-http-client/models/paginated_commerce_plan_response' +ClerkHttpClient.autoload :PaginatedCommerceSubscriptionItemResponse, 'clerk-http-client/models/paginated_commerce_subscription_item_response' ClerkHttpClient.autoload :Passkey, 'clerk-http-client/models/passkey' ClerkHttpClient.autoload :PasskeyVerification, 'clerk-http-client/models/passkey_verification' ClerkHttpClient.autoload :PhoneNumber, 'clerk-http-client/models/phone_number' @@ -177,6 +183,7 @@ ClerkHttpClient.autoload :UsersBanRequest, 'clerk-http-client/models/users_ban_request' ClerkHttpClient.autoload :UsersUnbanRequest, 'clerk-http-client/models/users_unban_request' ClerkHttpClient.autoload :VerificationAdmin, 'clerk-http-client/models/verification_admin' +ClerkHttpClient.autoload :VerificationEmailLink, 'clerk-http-client/models/verification_email_link' ClerkHttpClient.autoload :VerificationFromOauth, 'clerk-http-client/models/verification_from_oauth' ClerkHttpClient.autoload :VerificationFromOauthError, 'clerk-http-client/models/verification_from_oauth_error' ClerkHttpClient.autoload :VerificationGoogleOneTap, 'clerk-http-client/models/verification_google_one_tap' diff --git a/.generated/lib/clerk-http-client/api/beta_features_api.rb b/.generated/lib/clerk-http-client/api/beta_features_api.rb index 18799b2..3aa253c 100644 --- a/.generated/lib/clerk-http-client/api/beta_features_api.rb +++ b/.generated/lib/clerk-http-client/api/beta_features_api.rb @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Update production instance domain - # Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + # Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy-certificates), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. # @param [Hash] opts the optional parameters # @option opts [ChangeProductionInstanceDomainRequest] :change_production_instance_domain_request # @return [nil] @@ -31,7 +31,7 @@ def change_production_instance_domain(opts = {}) end # Update production instance domain - # Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + # Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy-certificates), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. # @param [Hash] opts the optional parameters # @option opts [ChangeProductionInstanceDomainRequest] :change_production_instance_domain_request # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -152,7 +152,7 @@ def update_instance_auth_config_with_http_info(opts = {}) end # Update production instance domain - # Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + # Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy-certificates), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. # @param [Hash] opts the optional parameters # @option opts [UpdateProductionInstanceDomainRequest] :update_production_instance_domain_request # @return [nil] @@ -163,7 +163,7 @@ def update_production_instance_domain(opts = {}) end # Update production instance domain - # Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. + # Change the domain of a production instance. Changing the domain requires updating the [DNS records](https://clerk.com/docs/deployments/overview#dns-records) accordingly, deploying new [SSL certificates](https://clerk.com/docs/deployments/overview#deploy-certificates), updating your Social Connection's redirect URLs and setting the new keys in your code. WARNING: Changing your domain will invalidate all current user sessions (i.e. users will be logged out). Also, while your application is being deployed, a small downtime is expected to occur. # @param [Hash] opts the optional parameters # @option opts [UpdateProductionInstanceDomainRequest] :update_production_instance_domain_request # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers diff --git a/.generated/lib/clerk-http-client/api/commerce_api.rb b/.generated/lib/clerk-http-client/api/commerce_api.rb index b4cc354..2430383 100644 --- a/.generated/lib/clerk-http-client/api/commerce_api.rb +++ b/.generated/lib/clerk-http-client/api/commerce_api.rb @@ -105,5 +105,108 @@ def get_commerce_plan_list_with_http_info(opts = {}) end return data, status_code, headers end + + # List all subscription items + # Returns a list of all subscription items for the instance. The subscription items are returned sorted by creation date, with the newest appearing first. This includes subscriptions for both users and organizations. Pagination is supported. + # @param [Hash] opts the optional parameters + # @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] :status Filter subscription items by status + # @option opts [String] :payer_type Filter subscription items by payer type + # @option opts [String] :plan_id Filter subscription items by plan ID + # @option opts [Boolean] :include_free Whether to include free plan subscription items (default to false) + # @option opts [String] :query Search query to filter subscription items + # @return [PaginatedCommerceSubscriptionItemResponse] + + def get_commerce_subscription_item_list(opts = {}) + data, _status_code, _headers = get_commerce_subscription_item_list_with_http_info(opts) + data + end + + # List all subscription items + # Returns a list of all subscription items for the instance. The subscription items are returned sorted by creation date, with the newest appearing first. This includes subscriptions for both users and organizations. Pagination is supported. + # @param [Hash] opts the optional parameters + # @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] :status Filter subscription items by status + # @option opts [String] :payer_type Filter subscription items by payer type + # @option opts [String] :plan_id Filter subscription items by plan ID + # @option opts [Boolean] :include_free Whether to include free plan subscription items (default to false) + # @option opts [String] :query Search query to filter subscription items + # @return [Array<(PaginatedCommerceSubscriptionItemResponse, Integer, Hash)>] PaginatedCommerceSubscriptionItemResponse data, response status code and response headers + # GET + def get_commerce_subscription_item_list_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CommerceApi.get_commerce_subscription_item_list ...' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CommerceApi.get_commerce_subscription_item_list, must be smaller than or equal to 500.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CommerceApi.get_commerce_subscription_item_list, 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 CommerceApi.get_commerce_subscription_item_list, must be greater than or equal to 0.' + end + + allowable_values = ["active", "ended", "past_due", "upcoming", "free_trial"] + if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) + fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" + 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/subscription_items' + + # query parameters + query_params = opts[:query_params] || {} + 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[:'status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'payer_type'] = opts[:'payer_type'] if !opts[:'payer_type'].nil? + query_params[:'plan_id'] = opts[:'plan_id'] if !opts[:'plan_id'].nil? + query_params[:'include_free'] = opts[:'include_free'] if !opts[:'include_free'].nil? + query_params[:'query'] = opts[:'query'] if !opts[:'query'].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] || 'PaginatedCommerceSubscriptionItemResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['bearerAuth'] + + new_options = opts.merge( + :operation => :"CommerceApi.get_commerce_subscription_item_list", + :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: CommerceApi#get_commerce_subscription_item_list\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/api/organizations_api.rb b/.generated/lib/clerk-http-client/api/organizations_api.rb index 7c06ae9..3addcd6 100644 --- a/.generated/lib/clerk-http-client/api/organizations_api.rb +++ b/.generated/lib/clerk-http-client/api/organizations_api.rb @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # Create an organization - # Creates a new organization with the given name for an instance. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\". Organization slugs must be unique for the instance. You can provide additional metadata for the organization and set any custom attribute you want. Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. The `created_by` user will see this as their [active organization] (https://clerk.com/docs/organizations/overview#active-organization) the next time they create a session, presuming they don't explicitly set a different organization as active before then. + # Creates a new organization with the given name for an instance. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\". Organization slugs must be unique for the instance. You can provide additional metadata for the organization and set any custom attribute you want. Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. The `created_by` user will see this as their [active organization](https://clerk.com/docs/organizations/overview#active-organization) the next time they create a session, presuming they don't explicitly set a different organization as active before then. # @param [Hash] opts the optional parameters # @option opts [CreateOrganizationRequest] :create_organization_request # @return [Organization] @@ -31,7 +31,7 @@ def create_organization(opts = {}) end # Create an organization - # Creates a new organization with the given name for an instance. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\". Organization slugs must be unique for the instance. You can provide additional metadata for the organization and set any custom attribute you want. Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. The `created_by` user will see this as their [active organization] (https://clerk.com/docs/organizations/overview#active-organization) the next time they create a session, presuming they don't explicitly set a different organization as active before then. + # Creates a new organization with the given name for an instance. You can specify an optional slug for the new organization. If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash \"-\". Organization slugs must be unique for the instance. You can provide additional metadata for the organization and set any custom attribute you want. Organizations support private and public metadata. Private metadata can only be accessed from the Backend API. Public metadata can be accessed from the Backend API, and are read-only from the Frontend API. The `created_by` user will see this as their [active organization](https://clerk.com/docs/organizations/overview#active-organization) the next time they create a session, presuming they don't explicitly set a different organization as active before then. # @param [Hash] opts the optional parameters # @option opts [CreateOrganizationRequest] :create_organization_request # @return [Array<(Organization, Integer, Hash)>] Organization data, response status code and response headers diff --git a/.generated/lib/clerk-http-client/api/sessions_api.rb b/.generated/lib/clerk-http-client/api/sessions_api.rb index d4afee7..9a822f9 100644 --- a/.generated/lib/clerk-http-client/api/sessions_api.rb +++ b/.generated/lib/clerk-http-client/api/sessions_api.rb @@ -531,7 +531,7 @@ def revoke_session_with_http_info(session_id, opts = {}) end # Verify a session - # Returns the session if it is authenticated; otherwise, returns an error. WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#clerk-express-require-auth)). For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). + # Returns the session if it is authenticated; otherwise, returns an error. WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#require-auth)). For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). # @param session_id [String] The ID of the session # @param [Hash] opts the optional parameters # @option opts [VerifySessionRequest] :verify_session_request Parameters. @@ -543,7 +543,7 @@ def verify_session(session_id, opts = {}) end # Verify a session - # Returns the session if it is authenticated; otherwise, returns an error. WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#clerk-express-require-auth)). For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). + # Returns the session if it is authenticated; otherwise, returns an error. WARNING: This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, which is implemented transparently in all recent SDK versions (e.g. [NodeJS SDK](https://clerk.com/docs/backend-requests/handling/nodejs#require-auth)). For more details on how networkless verification works, refer to our [Session Tokens documentation](https://clerk.com/docs/backend-requests/resources/session-tokens). # @param session_id [String] The ID of the session # @param [Hash] opts the optional parameters # @option opts [VerifySessionRequest] :verify_session_request Parameters. diff --git a/.generated/lib/clerk-http-client/models/commerce_payer_response.rb b/.generated/lib/clerk-http-client/models/commerce_payer_response.rb new file mode 100644 index 0000000..154a076 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/commerce_payer_response.rb @@ -0,0 +1,421 @@ +=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 CommercePayerResponse + # String representing the object's type. Objects of the same type share the same value. + attr_accessor :object + + # Unique identifier for the payer. + attr_accessor :id + + # Unique identifier for the Clerk instance. + attr_accessor :instance_id + + # User ID for user-type payers. + attr_accessor :user_id + + # First name of the payer. + attr_accessor :first_name + + # Last name of the payer. + attr_accessor :last_name + + # Email address of the payer. + attr_accessor :email + + # Organization ID for org-type payers. + attr_accessor :organization_id + + # Organization name for org-type payers. + attr_accessor :organization_name + + # URL of the payer's image/avatar. + attr_accessor :image_url + + # Unix timestamp (in milliseconds) when the payer was created. + attr_accessor :created_at + + # Unix timestamp (in milliseconds) when the payer was last updated. + 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', + :'instance_id' => :'instance_id', + :'user_id' => :'user_id', + :'first_name' => :'first_name', + :'last_name' => :'last_name', + :'email' => :'email', + :'organization_id' => :'organization_id', + :'organization_name' => :'organization_name', + :'image_url' => :'image_url', + :'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', + :'instance_id' => :'String', + :'user_id' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'email' => :'String', + :'organization_id' => :'String', + :'organization_name' => :'String', + :'image_url' => :'String', + :'created_at' => :'Integer', + :'updated_at' => :'Integer' + } + 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::CommercePayerResponse` 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::CommercePayerResponse`. 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?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + else + self.instance_id = nil + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + else + self.first_name = nil + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + else + self.last_name = nil + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + else + self.email = nil + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'organization_name') + self.organization_name = attributes[:'organization_name'] + end + + if attributes.key?(:'image_url') + self.image_url = attributes[:'image_url'] + else + self.image_url = 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 + + if @instance_id.nil? + invalid_properties.push('invalid value for "instance_id", instance_id cannot be nil.') + end + + if @first_name.nil? + invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') + end + + if @last_name.nil? + invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') + end + + if @email.nil? + invalid_properties.push('invalid value for "email", email cannot be nil.') + end + + if @image_url.nil? + invalid_properties.push('invalid value for "image_url", image_url 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', ["commerce_payer"]) + return false unless object_validator.valid?(@object) + return false if @id.nil? + return false if @instance_id.nil? + return false if @first_name.nil? + return false if @last_name.nil? + return false if @email.nil? + return false if @image_url.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', ["commerce_payer"]) + unless validator.valid?(object) + fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}." + end + @object = object + 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 && + instance_id == o.instance_id && + user_id == o.user_id && + first_name == o.first_name && + last_name == o.last_name && + email == o.email && + organization_id == o.organization_id && + organization_name == o.organization_name && + image_url == o.image_url && + 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, instance_id, user_id, first_name, last_name, email, organization_id, organization_name, image_url, 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/commerce_payment_source_response.rb b/.generated/lib/clerk-http-client/models/commerce_payment_source_response.rb new file mode 100644 index 0000000..9519659 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/commerce_payment_source_response.rb @@ -0,0 +1,519 @@ +=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 CommercePaymentSourceResponse + # String representing the object's type. Objects of the same type share the same value. + attr_accessor :object + + # Unique identifier for the payment source. + attr_accessor :id + + # Unique identifier for the payer. + attr_accessor :payer_id + + # The payment method type. + attr_accessor :payment_method + + # Whether this is the default payment source for the payer. + attr_accessor :is_default + + # The payment gateway. + attr_accessor :gateway + + # External ID in the payment gateway. + attr_accessor :gateway_external_id + + # External account ID in the payment gateway. + attr_accessor :gateway_external_account_id + + # Last 4 digits of the card (for card payment sources). + attr_accessor :last4 + + # Status of the payment source. + attr_accessor :status + + # Type of wallet (if applicable). + attr_accessor :wallet_type + + # Type of card (if applicable). + attr_accessor :card_type + + # Card expiration year (for card payment sources). + attr_accessor :expiry_year + + # Card expiration month (for card payment sources). + attr_accessor :expiry_month + + # Unix timestamp (in milliseconds) when the payment source was created. + attr_accessor :created_at + + # Unix timestamp (in milliseconds) when the payment source was last updated. + attr_accessor :updated_at + + # Whether this payment source can be removed. + attr_accessor :is_removable + + 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', + :'payer_id' => :'payer_id', + :'payment_method' => :'payment_method', + :'is_default' => :'is_default', + :'gateway' => :'gateway', + :'gateway_external_id' => :'gateway_external_id', + :'gateway_external_account_id' => :'gateway_external_account_id', + :'last4' => :'last4', + :'status' => :'status', + :'wallet_type' => :'wallet_type', + :'card_type' => :'card_type', + :'expiry_year' => :'expiry_year', + :'expiry_month' => :'expiry_month', + :'created_at' => :'created_at', + :'updated_at' => :'updated_at', + :'is_removable' => :'is_removable' + } + 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', + :'payer_id' => :'String', + :'payment_method' => :'String', + :'is_default' => :'Boolean', + :'gateway' => :'String', + :'gateway_external_id' => :'String', + :'gateway_external_account_id' => :'String', + :'last4' => :'String', + :'status' => :'String', + :'wallet_type' => :'String', + :'card_type' => :'String', + :'expiry_year' => :'Integer', + :'expiry_month' => :'Integer', + :'created_at' => :'Integer', + :'updated_at' => :'Integer', + :'is_removable' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'is_default', + :'gateway_external_account_id', + :'is_removable' + ]) + 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::CommercePaymentSourceResponse` 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::CommercePaymentSourceResponse`. 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?(:'payer_id') + self.payer_id = attributes[:'payer_id'] + else + self.payer_id = nil + end + + if attributes.key?(:'payment_method') + self.payment_method = attributes[:'payment_method'] + else + self.payment_method = nil + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'gateway') + self.gateway = attributes[:'gateway'] + else + self.gateway = nil + end + + if attributes.key?(:'gateway_external_id') + self.gateway_external_id = attributes[:'gateway_external_id'] + else + self.gateway_external_id = nil + end + + if attributes.key?(:'gateway_external_account_id') + self.gateway_external_account_id = attributes[:'gateway_external_account_id'] + end + + if attributes.key?(:'last4') + self.last4 = attributes[:'last4'] + else + self.last4 = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'wallet_type') + self.wallet_type = attributes[:'wallet_type'] + else + self.wallet_type = nil + end + + if attributes.key?(:'card_type') + self.card_type = attributes[:'card_type'] + else + self.card_type = nil + end + + if attributes.key?(:'expiry_year') + self.expiry_year = attributes[:'expiry_year'] + end + + if attributes.key?(:'expiry_month') + self.expiry_month = attributes[:'expiry_month'] + 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 + + if attributes.key?(:'is_removable') + self.is_removable = attributes[:'is_removable'] + 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 + + if @payer_id.nil? + invalid_properties.push('invalid value for "payer_id", payer_id cannot be nil.') + end + + if @payment_method.nil? + invalid_properties.push('invalid value for "payment_method", payment_method cannot be nil.') + end + + if @gateway.nil? + invalid_properties.push('invalid value for "gateway", gateway cannot be nil.') + end + + if @gateway_external_id.nil? + invalid_properties.push('invalid value for "gateway_external_id", gateway_external_id cannot be nil.') + end + + if @last4.nil? + invalid_properties.push('invalid value for "last4", last4 cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @wallet_type.nil? + invalid_properties.push('invalid value for "wallet_type", wallet_type cannot be nil.') + end + + if @card_type.nil? + invalid_properties.push('invalid value for "card_type", card_type 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', ["commerce_source"]) + return false unless object_validator.valid?(@object) + return false if @id.nil? + return false if @payer_id.nil? + return false if @payment_method.nil? + payment_method_validator = EnumAttributeValidator.new('String', ["card", "apple_pay", "google_pay"]) + return false unless payment_method_validator.valid?(@payment_method) + return false if @gateway.nil? + return false if @gateway_external_id.nil? + return false if @last4.nil? + return false if @status.nil? + status_validator = EnumAttributeValidator.new('String', ["active", "disconnected"]) + return false unless status_validator.valid?(@status) + return false if @wallet_type.nil? + return false if @card_type.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', ["commerce_source"]) + 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 checking allowed values (enum). + # @param [Object] payment_method Object to be assigned + def payment_method=(payment_method) + validator = EnumAttributeValidator.new('String', ["card", "apple_pay", "google_pay"]) + unless validator.valid?(payment_method) + fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}." + end + @payment_method = payment_method + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["active", "disconnected"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + 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 && + payer_id == o.payer_id && + payment_method == o.payment_method && + is_default == o.is_default && + gateway == o.gateway && + gateway_external_id == o.gateway_external_id && + gateway_external_account_id == o.gateway_external_account_id && + last4 == o.last4 && + status == o.status && + wallet_type == o.wallet_type && + card_type == o.card_type && + expiry_year == o.expiry_year && + expiry_month == o.expiry_month && + created_at == o.created_at && + updated_at == o.updated_at && + is_removable == o.is_removable + 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, payer_id, payment_method, is_default, gateway, gateway_external_id, gateway_external_account_id, last4, status, wallet_type, card_type, expiry_year, expiry_month, created_at, updated_at, is_removable].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/commerce_plan.rb b/.generated/lib/clerk-http-client/models/commerce_plan.rb index c099775..fc09637 100644 --- a/.generated/lib/clerk-http-client/models/commerce_plan.rb +++ b/.generated/lib/clerk-http-client/models/commerce_plan.rb @@ -93,6 +93,12 @@ class CommercePlan # The features included in this plan. attr_accessor :features + # Whether free trial is enabled for this plan. + attr_accessor :free_trial_enabled + + # Number of free trial days for this plan. + attr_accessor :free_trial_days + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -144,7 +150,9 @@ def self.attribute_map :'avatar_url' => :'avatar_url', :'period' => :'period', :'interval' => :'interval', - :'features' => :'features' + :'features' => :'features', + :'free_trial_enabled' => :'free_trial_enabled', + :'free_trial_days' => :'free_trial_days' } end @@ -182,13 +190,16 @@ def self.openapi_types :'avatar_url' => :'String', :'period' => :'String', :'interval' => :'Integer', - :'features' => :'Array' + :'features' => :'Array', + :'free_trial_enabled' => :'Boolean', + :'free_trial_days' => :'Integer' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'free_trial_days' ]) end @@ -368,6 +379,14 @@ def initialize(attributes = {}) else self.features = nil end + + if attributes.key?(:'free_trial_enabled') + self.free_trial_enabled = attributes[:'free_trial_enabled'] + end + + if attributes.key?(:'free_trial_days') + self.free_trial_days = attributes[:'free_trial_days'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -553,7 +572,9 @@ def ==(o) avatar_url == o.avatar_url && period == o.period && interval == o.interval && - features == o.features + features == o.features && + free_trial_enabled == o.free_trial_enabled && + free_trial_days == o.free_trial_days end # @see the `==` method @@ -565,7 +586,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [object, id, name, fee, annual_monthly_fee, annual_fee, amount, amount_formatted, annual_monthly_amount, annual_monthly_amount_formatted, annual_amount, annual_amount_formatted, currency_symbol, currency, description, product_id, is_default, is_recurring, publicly_visible, has_base_fee, payer_type, for_payer_type, slug, avatar_url, period, interval, features].hash + [object, id, name, fee, annual_monthly_fee, annual_fee, amount, amount_formatted, annual_monthly_amount, annual_monthly_amount_formatted, annual_amount, annual_amount_formatted, currency_symbol, currency, description, product_id, is_default, is_recurring, publicly_visible, has_base_fee, payer_type, for_payer_type, slug, avatar_url, period, interval, features, free_trial_enabled, free_trial_days].hash end # Builds the object from hash diff --git a/.generated/lib/clerk-http-client/models/commerce_subscription_credit_response.rb b/.generated/lib/clerk-http-client/models/commerce_subscription_credit_response.rb new file mode 100644 index 0000000..a01fba8 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/commerce_subscription_credit_response.rb @@ -0,0 +1,225 @@ +=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 CommerceSubscriptionCreditResponse + # Credit amount. + attr_accessor :amount + + # Percentage of the billing cycle remaining. + attr_accessor :cycle_remaining_percent + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'amount' => :'amount', + :'cycle_remaining_percent' => :'cycle_remaining_percent' + } + 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 + { + :'amount' => :'CommerceMoneyResponse', + :'cycle_remaining_percent' => :'Float' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'amount', + ]) + 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::CommerceSubscriptionCreditResponse` 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::CommerceSubscriptionCreditResponse`. 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?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'cycle_remaining_percent') + self.cycle_remaining_percent = attributes[:'cycle_remaining_percent'] + 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 && + amount == o.amount && + cycle_remaining_percent == o.cycle_remaining_percent + 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 + [amount, cycle_remaining_percent].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/commerce_subscription_item.rb b/.generated/lib/clerk-http-client/models/commerce_subscription_item.rb new file mode 100644 index 0000000..95e0d61 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/commerce_subscription_item.rb @@ -0,0 +1,611 @@ +=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 CommerceSubscriptionItem + # String representing the object's type. Objects of the same type share the same value. + attr_accessor :object + + # Unique identifier for the subscription item. + attr_accessor :id + + # Unique identifier for the Clerk instance. + attr_accessor :instance_id + + # Current status of the subscription item. + attr_accessor :status + + # Credit information (only available in PaymentAttempt events). + attr_accessor :credit + + # Unique identifier for the associated plan. + attr_accessor :plan_id + + # The associated commerce plan. + attr_accessor :plan + + # The billing period for this subscription. + attr_accessor :plan_period + + # Unique identifier for the payment source. + attr_accessor :payment_source_id + + # The payment source associated with this subscription. + attr_accessor :payment_source + + # Total amount paid over the lifetime of this subscription. + attr_accessor :lifetime_paid + + # Current amount for this subscription. + attr_accessor :amount + + # Information about the next invoice. + attr_accessor :next_invoice + + # Information about the next payment. + attr_accessor :next_payment + + # Unique identifier for the payer. + attr_accessor :payer_id + + # The payer associated with this subscription. + attr_accessor :payer + + # Whether this subscription is currently on a free trial. + attr_accessor :is_free_trial + + # Unix timestamp (in milliseconds) when the current period started. + attr_accessor :period_start + + # Unix timestamp (in milliseconds) when the current period ends. + attr_accessor :period_end + + # Date used for proration calculations. + attr_accessor :proration_date + + # Unix timestamp (in milliseconds) when the subscription was canceled. + attr_accessor :canceled_at + + # Unix timestamp (in milliseconds) when the subscription became past due. + attr_accessor :past_due_at + + # Unix timestamp (in milliseconds) when the subscription ended. + attr_accessor :ended_at + + # Unix timestamp (in milliseconds) when the subscription was created. + attr_accessor :created_at + + # Unix timestamp (in milliseconds) when the subscription was last updated. + 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', + :'instance_id' => :'instance_id', + :'status' => :'status', + :'credit' => :'credit', + :'plan_id' => :'plan_id', + :'plan' => :'plan', + :'plan_period' => :'plan_period', + :'payment_source_id' => :'payment_source_id', + :'payment_source' => :'payment_source', + :'lifetime_paid' => :'lifetime_paid', + :'amount' => :'amount', + :'next_invoice' => :'next_invoice', + :'next_payment' => :'next_payment', + :'payer_id' => :'payer_id', + :'payer' => :'payer', + :'is_free_trial' => :'is_free_trial', + :'period_start' => :'period_start', + :'period_end' => :'period_end', + :'proration_date' => :'proration_date', + :'canceled_at' => :'canceled_at', + :'past_due_at' => :'past_due_at', + :'ended_at' => :'ended_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', + :'instance_id' => :'String', + :'status' => :'String', + :'credit' => :'CommerceSubscriptionCreditResponse', + :'plan_id' => :'String', + :'plan' => :'CommercePlan', + :'plan_period' => :'String', + :'payment_source_id' => :'String', + :'payment_source' => :'CommercePaymentSourceResponse', + :'lifetime_paid' => :'CommerceMoneyResponse', + :'amount' => :'CommerceMoneyResponse', + :'next_invoice' => :'CommerceSubscriptionItemNextPaymentResponse', + :'next_payment' => :'CommerceSubscriptionItemNextPaymentResponse', + :'payer_id' => :'String', + :'payer' => :'CommercePayerResponse', + :'is_free_trial' => :'Boolean', + :'period_start' => :'Integer', + :'period_end' => :'Integer', + :'proration_date' => :'String', + :'canceled_at' => :'Integer', + :'past_due_at' => :'Integer', + :'ended_at' => :'Integer', + :'created_at' => :'Integer', + :'updated_at' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'credit', + :'plan', + :'payment_source', + :'lifetime_paid', + :'amount', + :'next_invoice', + :'next_payment', + :'payer', + :'period_start', + :'period_end', + :'canceled_at', + :'past_due_at', + :'ended_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::CommerceSubscriptionItem` 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::CommerceSubscriptionItem`. 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?(:'instance_id') + self.instance_id = attributes[:'instance_id'] + else + self.instance_id = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'credit') + self.credit = attributes[:'credit'] + end + + if attributes.key?(:'plan_id') + self.plan_id = attributes[:'plan_id'] + else + self.plan_id = nil + end + + if attributes.key?(:'plan') + self.plan = attributes[:'plan'] + else + self.plan = nil + end + + if attributes.key?(:'plan_period') + self.plan_period = attributes[:'plan_period'] + else + self.plan_period = nil + end + + if attributes.key?(:'payment_source_id') + self.payment_source_id = attributes[:'payment_source_id'] + else + self.payment_source_id = nil + end + + if attributes.key?(:'payment_source') + self.payment_source = attributes[:'payment_source'] + end + + if attributes.key?(:'lifetime_paid') + self.lifetime_paid = attributes[:'lifetime_paid'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'next_invoice') + self.next_invoice = attributes[:'next_invoice'] + end + + if attributes.key?(:'next_payment') + self.next_payment = attributes[:'next_payment'] + end + + if attributes.key?(:'payer_id') + self.payer_id = attributes[:'payer_id'] + else + self.payer_id = nil + end + + if attributes.key?(:'payer') + self.payer = attributes[:'payer'] + end + + if attributes.key?(:'is_free_trial') + self.is_free_trial = attributes[:'is_free_trial'] + else + self.is_free_trial = nil + end + + if attributes.key?(:'period_start') + self.period_start = attributes[:'period_start'] + end + + if attributes.key?(:'period_end') + self.period_end = attributes[:'period_end'] + end + + if attributes.key?(:'proration_date') + self.proration_date = attributes[:'proration_date'] + else + self.proration_date = nil + end + + if attributes.key?(:'canceled_at') + self.canceled_at = attributes[:'canceled_at'] + end + + if attributes.key?(:'past_due_at') + self.past_due_at = attributes[:'past_due_at'] + end + + if attributes.key?(:'ended_at') + self.ended_at = attributes[:'ended_at'] + 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 + + if @instance_id.nil? + invalid_properties.push('invalid value for "instance_id", instance_id cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @plan_id.nil? + invalid_properties.push('invalid value for "plan_id", plan_id cannot be nil.') + end + + if @plan_period.nil? + invalid_properties.push('invalid value for "plan_period", plan_period cannot be nil.') + end + + if @payment_source_id.nil? + invalid_properties.push('invalid value for "payment_source_id", payment_source_id cannot be nil.') + end + + if @payer_id.nil? + invalid_properties.push('invalid value for "payer_id", payer_id cannot be nil.') + end + + if @is_free_trial.nil? + invalid_properties.push('invalid value for "is_free_trial", is_free_trial cannot be nil.') + end + + if @proration_date.nil? + invalid_properties.push('invalid value for "proration_date", proration_date 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', ["commerce_subscription_item"]) + return false unless object_validator.valid?(@object) + return false if @id.nil? + return false if @instance_id.nil? + return false if @status.nil? + status_validator = EnumAttributeValidator.new('String', ["active", "ended", "past_due", "upcoming", "incomplete", "abandoned"]) + return false unless status_validator.valid?(@status) + return false if @plan_id.nil? + return false if @plan_period.nil? + plan_period_validator = EnumAttributeValidator.new('String', ["month", "annual"]) + return false unless plan_period_validator.valid?(@plan_period) + return false if @payment_source_id.nil? + return false if @payer_id.nil? + return false if @is_free_trial.nil? + return false if @proration_date.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', ["commerce_subscription_item"]) + 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 checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["active", "ended", "past_due", "upcoming", "incomplete", "abandoned"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] plan_period Object to be assigned + def plan_period=(plan_period) + validator = EnumAttributeValidator.new('String', ["month", "annual"]) + unless validator.valid?(plan_period) + fail ArgumentError, "invalid value for \"plan_period\", must be one of #{validator.allowable_values}." + end + @plan_period = plan_period + 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 && + instance_id == o.instance_id && + status == o.status && + credit == o.credit && + plan_id == o.plan_id && + plan == o.plan && + plan_period == o.plan_period && + payment_source_id == o.payment_source_id && + payment_source == o.payment_source && + lifetime_paid == o.lifetime_paid && + amount == o.amount && + next_invoice == o.next_invoice && + next_payment == o.next_payment && + payer_id == o.payer_id && + payer == o.payer && + is_free_trial == o.is_free_trial && + period_start == o.period_start && + period_end == o.period_end && + proration_date == o.proration_date && + canceled_at == o.canceled_at && + past_due_at == o.past_due_at && + ended_at == o.ended_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, instance_id, status, credit, plan_id, plan, plan_period, payment_source_id, payment_source, lifetime_paid, amount, next_invoice, next_payment, payer_id, payer, is_free_trial, period_start, period_end, proration_date, canceled_at, past_due_at, ended_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/commerce_subscription_item_next_payment_response.rb b/.generated/lib/clerk-http-client/models/commerce_subscription_item_next_payment_response.rb new file mode 100644 index 0000000..f248e6d --- /dev/null +++ b/.generated/lib/clerk-http-client/models/commerce_subscription_item_next_payment_response.rb @@ -0,0 +1,226 @@ +=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 CommerceSubscriptionItemNextPaymentResponse + # Amount for the next payment. + attr_accessor :amount + + # Unix timestamp (in milliseconds) for the next payment date. + attr_accessor :date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'amount' => :'amount', + :'date' => :'date' + } + 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 + { + :'amount' => :'CommerceMoneyResponse', + :'date' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'amount', + :'date' + ]) + 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::CommerceSubscriptionItemNextPaymentResponse` 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::CommerceSubscriptionItemNextPaymentResponse`. 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?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + 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 && + amount == o.amount && + date == o.date + 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 + [amount, date].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/email_address_verification.rb b/.generated/lib/clerk-http-client/models/email_address_verification.rb index b095c6d..59298ab 100644 --- a/.generated/lib/clerk-http-client/models/email_address_verification.rb +++ b/.generated/lib/clerk-http-client/models/email_address_verification.rb @@ -20,8 +20,10 @@ class << self def openapi_one_of [ :'VerificationAdmin', + :'VerificationEmailLink', :'VerificationFromOauth', :'VerificationOtp', + :'VerificationSaml', :'VerificationTicket' ] end diff --git a/.generated/lib/clerk-http-client/models/paginated_commerce_subscription_item_response.rb b/.generated/lib/clerk-http-client/models/paginated_commerce_subscription_item_response.rb new file mode 100644 index 0000000..b85d146 --- /dev/null +++ b/.generated/lib/clerk-http-client/models/paginated_commerce_subscription_item_response.rb @@ -0,0 +1,240 @@ +=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 PaginatedCommerceSubscriptionItemResponse + # Array of commerce subscription items. + attr_accessor :data + + # Total number of commerce subscription items. + attr_accessor :total_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data', + :'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 + { + :'data' => :'Array', + :'total_count' => :'Integer' + } + 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::PaginatedCommerceSubscriptionItemResponse` 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::PaginatedCommerceSubscriptionItemResponse`. 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?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + else + self.data = 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 @data.nil? + invalid_properties.push('invalid value for "data", data 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 @data.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 && + data == o.data && + 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 + [data, 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/verification_email_link.rb b/.generated/lib/clerk-http-client/models/verification_email_link.rb new file mode 100644 index 0000000..227b77e --- /dev/null +++ b/.generated/lib/clerk-http-client/models/verification_email_link.rb @@ -0,0 +1,337 @@ +=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 VerificationEmailLink + attr_accessor :object + + attr_accessor :status + + attr_accessor :strategy + + attr_accessor :attempts + + attr_accessor :expire_at + + attr_accessor :verified_at_client + + 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', + :'status' => :'status', + :'strategy' => :'strategy', + :'attempts' => :'attempts', + :'expire_at' => :'expire_at', + :'verified_at_client' => :'verified_at_client' + } + 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', + :'status' => :'String', + :'strategy' => :'String', + :'attempts' => :'Integer', + :'expire_at' => :'Integer', + :'verified_at_client' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'attempts', + :'expire_at', + :'verified_at_client' + ]) + 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::VerificationEmailLink` 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::VerificationEmailLink`. 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'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'strategy') + self.strategy = attributes[:'strategy'] + else + self.strategy = nil + end + + if attributes.key?(:'attempts') + self.attempts = attributes[:'attempts'] + else + self.attempts = nil + end + + if attributes.key?(:'expire_at') + self.expire_at = attributes[:'expire_at'] + else + self.expire_at = nil + end + + if attributes.key?(:'verified_at_client') + self.verified_at_client = attributes[:'verified_at_client'] + 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 @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @strategy.nil? + invalid_properties.push('invalid value for "strategy", strategy 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' + object_validator = EnumAttributeValidator.new('String', ["verification_email_link"]) + return false unless object_validator.valid?(@object) + return false if @status.nil? + status_validator = EnumAttributeValidator.new('String', ["unverified", "verified", "failed", "expired"]) + return false unless status_validator.valid?(@status) + return false if @strategy.nil? + strategy_validator = EnumAttributeValidator.new('String', ["email_link"]) + return false unless strategy_validator.valid?(@strategy) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] object Object to be assigned + def object=(object) + validator = EnumAttributeValidator.new('String', ["verification_email_link"]) + 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 checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["unverified", "verified", "failed", "expired"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] strategy Object to be assigned + def strategy=(strategy) + validator = EnumAttributeValidator.new('String', ["email_link"]) + unless validator.valid?(strategy) + fail ArgumentError, "invalid value for \"strategy\", must be one of #{validator.allowable_values}." + end + @strategy = strategy + 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 && + status == o.status && + strategy == o.strategy && + attempts == o.attempts && + expire_at == o.expire_at && + verified_at_client == o.verified_at_client + 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, status, strategy, attempts, expire_at, verified_at_client].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/models/commerce_payer_response_spec.rb b/.generated/spec/models/commerce_payer_response_spec.rb new file mode 100644 index 0000000..7824a8c --- /dev/null +++ b/.generated/spec/models/commerce_payer_response_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::CommercePayerResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::CommercePayerResponse do + let(:instance) { ClerkHttpClient::CommercePayerResponse.new } + + describe 'test an instance of CommercePayerResponse' do + it 'should create an instance of CommercePayerResponse' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::CommercePayerResponse) + 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', ["commerce_payer"]) + # 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 "instance_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 "user_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 "first_name"' 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_name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "organization_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 "organization_name"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "image_url"' 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/commerce_payment_source_response_spec.rb b/.generated/spec/models/commerce_payment_source_response_spec.rb new file mode 100644 index 0000000..b4dd714 --- /dev/null +++ b/.generated/spec/models/commerce_payment_source_response_spec.rb @@ -0,0 +1,144 @@ +=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::CommercePaymentSourceResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::CommercePaymentSourceResponse do + let(:instance) { ClerkHttpClient::CommercePaymentSourceResponse.new } + + describe 'test an instance of CommercePaymentSourceResponse' do + it 'should create an instance of CommercePaymentSourceResponse' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::CommercePaymentSourceResponse) + 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', ["commerce_source"]) + # 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 "payer_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 "payment_method"' 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', ["card", "apple_pay", "google_pay"]) + # validator.allowable_values.each do |value| + # expect { instance.payment_method = value }.not_to raise_error + # end + end + end + + describe 'test attribute "is_default"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "gateway"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "gateway_external_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 "gateway_external_account_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 "last4"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "status"' 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', ["active", "disconnected"]) + # validator.allowable_values.each do |value| + # expect { instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "wallet_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "card_type"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "expiry_year"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "expiry_month"' 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 + + describe 'test attribute "is_removable"' 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/commerce_subscription_credit_response_spec.rb b/.generated/spec/models/commerce_subscription_credit_response_spec.rb new file mode 100644 index 0000000..610ab3d --- /dev/null +++ b/.generated/spec/models/commerce_subscription_credit_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::CommerceSubscriptionCreditResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::CommerceSubscriptionCreditResponse do + let(:instance) { ClerkHttpClient::CommerceSubscriptionCreditResponse.new } + + describe 'test an instance of CommerceSubscriptionCreditResponse' do + it 'should create an instance of CommerceSubscriptionCreditResponse' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::CommerceSubscriptionCreditResponse) + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "cycle_remaining_percent"' 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/commerce_subscription_item_next_payment_response_spec.rb b/.generated/spec/models/commerce_subscription_item_next_payment_response_spec.rb new file mode 100644 index 0000000..9049a72 --- /dev/null +++ b/.generated/spec/models/commerce_subscription_item_next_payment_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::CommerceSubscriptionItemNextPaymentResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::CommerceSubscriptionItemNextPaymentResponse do + let(:instance) { ClerkHttpClient::CommerceSubscriptionItemNextPaymentResponse.new } + + describe 'test an instance of CommerceSubscriptionItemNextPaymentResponse' do + it 'should create an instance of CommerceSubscriptionItemNextPaymentResponse' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::CommerceSubscriptionItemNextPaymentResponse) + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "date"' 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/commerce_subscription_item_spec.rb b/.generated/spec/models/commerce_subscription_item_spec.rb new file mode 100644 index 0000000..d11285e --- /dev/null +++ b/.generated/spec/models/commerce_subscription_item_spec.rb @@ -0,0 +1,192 @@ +=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::CommerceSubscriptionItem +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::CommerceSubscriptionItem do + let(:instance) { ClerkHttpClient::CommerceSubscriptionItem.new } + + describe 'test an instance of CommerceSubscriptionItem' do + it 'should create an instance of CommerceSubscriptionItem' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::CommerceSubscriptionItem) + 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', ["commerce_subscription_item"]) + # 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 "instance_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 "status"' 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', ["active", "ended", "past_due", "upcoming", "incomplete", "abandoned"]) + # validator.allowable_values.each do |value| + # expect { instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "credit"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "plan_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 "plan"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "plan_period"' 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', ["month", "annual"]) + # validator.allowable_values.each do |value| + # expect { instance.plan_period = value }.not_to raise_error + # end + end + end + + describe 'test attribute "payment_source_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 "payment_source"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "lifetime_paid"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "amount"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "next_invoice"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "next_payment"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "payer_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 "payer"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "is_free_trial"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "period_start"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "period_end"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "proration_date"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "canceled_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 "past_due_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 "ended_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/paginated_commerce_subscription_item_response_spec.rb b/.generated/spec/models/paginated_commerce_subscription_item_response_spec.rb new file mode 100644 index 0000000..1b97119 --- /dev/null +++ b/.generated/spec/models/paginated_commerce_subscription_item_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::PaginatedCommerceSubscriptionItemResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::PaginatedCommerceSubscriptionItemResponse do + let(:instance) { ClerkHttpClient::PaginatedCommerceSubscriptionItemResponse.new } + + describe 'test an instance of PaginatedCommerceSubscriptionItemResponse' do + it 'should create an instance of PaginatedCommerceSubscriptionItemResponse' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::PaginatedCommerceSubscriptionItemResponse) + end + end + + describe 'test attribute "data"' 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/verification_email_link_spec.rb b/.generated/spec/models/verification_email_link_spec.rb new file mode 100644 index 0000000..ab536b0 --- /dev/null +++ b/.generated/spec/models/verification_email_link_spec.rb @@ -0,0 +1,78 @@ +=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::VerificationEmailLink +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe ClerkHttpClient::VerificationEmailLink do + let(:instance) { ClerkHttpClient::VerificationEmailLink.new } + + describe 'test an instance of VerificationEmailLink' do + it 'should create an instance of VerificationEmailLink' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(ClerkHttpClient::VerificationEmailLink) + 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', ["verification_email_link"]) + # validator.allowable_values.each do |value| + # expect { instance.object = value }.not_to raise_error + # end + end + end + + describe 'test attribute "status"' 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', ["unverified", "verified", "failed", "expired"]) + # validator.allowable_values.each do |value| + # expect { instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "strategy"' 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', ["email_link"]) + # validator.allowable_values.each do |value| + # expect { instance.strategy = value }.not_to raise_error + # end + end + end + + describe 'test attribute "attempts"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + + describe 'test attribute "expire_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 "verified_at_client"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end