Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Commit c6f22d0

Browse files
Generate Ruby Backend SDK (#52)
Co-authored-by: Tom Milewski <me@tm.codes>
1 parent e6a0f32 commit c6f22d0

36 files changed

+3741
-17
lines changed

.generated/.openapi-generator/FILES

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ docs/ClientsApi.md
2525
docs/CnameTarget.md
2626
docs/CommerceApi.md
2727
docs/CommerceMoneyResponse.md
28+
docs/CommercePayerResponse.md
29+
docs/CommercePaymentSourceResponse.md
2830
docs/CommercePlan.md
31+
docs/CommerceSubscriptionCreditResponse.md
32+
docs/CommerceSubscriptionItem.md
33+
docs/CommerceSubscriptionItemNextPaymentResponse.md
2934
docs/Cookies.md
3035
docs/CreateActorTokenRequest.md
3136
docs/CreateActorTokenRequestActor.md
@@ -131,6 +136,7 @@ docs/OrganizationWithLogo.md
131136
docs/Organizations.md
132137
docs/OrganizationsApi.md
133138
docs/PaginatedCommercePlanResponse.md
139+
docs/PaginatedCommerceSubscriptionItemResponse.md
134140
docs/Passkey.md
135141
docs/PasskeyVerification.md
136142
docs/PhoneNumber.md
@@ -197,6 +203,7 @@ docs/UsersApi.md
197203
docs/UsersBanRequest.md
198204
docs/UsersUnbanRequest.md
199205
docs/VerificationAdmin.md
206+
docs/VerificationEmailLink.md
200207
docs/VerificationFromOauth.md
201208
docs/VerificationFromOauthError.md
202209
docs/VerificationGoogleOneTap.md
@@ -273,7 +280,12 @@ lib/clerk-http-client/models/clerk_errors.rb
273280
lib/clerk-http-client/models/client.rb
274281
lib/clerk-http-client/models/cname_target.rb
275282
lib/clerk-http-client/models/commerce_money_response.rb
283+
lib/clerk-http-client/models/commerce_payer_response.rb
284+
lib/clerk-http-client/models/commerce_payment_source_response.rb
276285
lib/clerk-http-client/models/commerce_plan.rb
286+
lib/clerk-http-client/models/commerce_subscription_credit_response.rb
287+
lib/clerk-http-client/models/commerce_subscription_item.rb
288+
lib/clerk-http-client/models/commerce_subscription_item_next_payment_response.rb
277289
lib/clerk-http-client/models/cookies.rb
278290
lib/clerk-http-client/models/create_actor_token_request.rb
279291
lib/clerk-http-client/models/create_actor_token_request_actor.rb
@@ -363,6 +375,7 @@ lib/clerk-http-client/models/organization_settings.rb
363375
lib/clerk-http-client/models/organization_with_logo.rb
364376
lib/clerk-http-client/models/organizations.rb
365377
lib/clerk-http-client/models/paginated_commerce_plan_response.rb
378+
lib/clerk-http-client/models/paginated_commerce_subscription_item_response.rb
366379
lib/clerk-http-client/models/passkey.rb
367380
lib/clerk-http-client/models/passkey_verification.rb
368381
lib/clerk-http-client/models/phone_number.rb
@@ -420,6 +433,7 @@ lib/clerk-http-client/models/user.rb
420433
lib/clerk-http-client/models/users_ban_request.rb
421434
lib/clerk-http-client/models/users_unban_request.rb
422435
lib/clerk-http-client/models/verification_admin.rb
436+
lib/clerk-http-client/models/verification_email_link.rb
423437
lib/clerk-http-client/models/verification_from_oauth.rb
424438
lib/clerk-http-client/models/verification_from_oauth_error.rb
425439
lib/clerk-http-client/models/verification_google_one_tap.rb
@@ -442,4 +456,11 @@ lib/clerk-http-client/models/verify_totp_request.rb
442456
lib/clerk-http-client/models/waitlist_entry.rb
443457
lib/clerk-http-client/models/web3_wallet.rb
444458
lib/clerk-http-client/models/web3_wallet_verification.rb
459+
spec/models/commerce_payer_response_spec.rb
460+
spec/models/commerce_payment_source_response_spec.rb
461+
spec/models/commerce_subscription_credit_response_spec.rb
462+
spec/models/commerce_subscription_item_next_payment_response_spec.rb
463+
spec/models/commerce_subscription_item_spec.rb
464+
spec/models/paginated_commerce_subscription_item_response_spec.rb
465+
spec/models/verification_email_link_spec.rb
445466
spec/spec_helper.rb

.generated/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Class | Method | HTTP request | Description
6363
*Clerk::SDK.clients* | [**get_client_list**](docs/ClientsApi.md#get_client_list) | **GET** /clients | List all clients
6464
*Clerk::SDK.clients* | [**verify_client**](docs/ClientsApi.md#verify_client) | **POST** /clients/verify | Verify a client
6565
*Clerk::SDK.commerce* | [**get_commerce_plan_list**](docs/CommerceApi.md#get_commerce_plan_list) | **GET** /commerce/plans | List all commerce plans
66+
*Clerk::SDK.commerce* | [**get_commerce_subscription_item_list**](docs/CommerceApi.md#get_commerce_subscription_item_list) | **GET** /commerce/subscription_items | List all subscription items
6667
*Clerk::SDK.domains* | [**add_domain**](docs/DomainsApi.md#add_domain) | **POST** /domains | Add a domain
6768
*Clerk::SDK.domains* | [**delete_domain**](docs/DomainsApi.md#delete_domain) | **DELETE** /domains/{domain_id} | Delete a satellite domain
6869
*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
212213
- [ClerkHttpClient::ClerkErrors](docs/ClerkErrors.md)
213214
- [ClerkHttpClient::Client](docs/Client.md)
214215
- [ClerkHttpClient::CommerceMoneyResponse](docs/CommerceMoneyResponse.md)
216+
- [ClerkHttpClient::CommercePayerResponse](docs/CommercePayerResponse.md)
217+
- [ClerkHttpClient::CommercePaymentSourceResponse](docs/CommercePaymentSourceResponse.md)
215218
- [ClerkHttpClient::CommercePlan](docs/CommercePlan.md)
219+
- [ClerkHttpClient::CommerceSubscriptionCreditResponse](docs/CommerceSubscriptionCreditResponse.md)
220+
- [ClerkHttpClient::CommerceSubscriptionItem](docs/CommerceSubscriptionItem.md)
221+
- [ClerkHttpClient::CommerceSubscriptionItemNextPaymentResponse](docs/CommerceSubscriptionItemNextPaymentResponse.md)
216222
- [ClerkHttpClient::Cookies](docs/Cookies.md)
217223
- [ClerkHttpClient::CreateActorTokenRequest](docs/CreateActorTokenRequest.md)
218224
- [ClerkHttpClient::CreateActorTokenRequestActor](docs/CreateActorTokenRequestActor.md)
@@ -302,6 +308,7 @@ Class | Method | HTTP request | Description
302308
- [ClerkHttpClient::OrganizationWithLogo](docs/OrganizationWithLogo.md)
303309
- [ClerkHttpClient::Organizations](docs/Organizations.md)
304310
- [ClerkHttpClient::PaginatedCommercePlanResponse](docs/PaginatedCommercePlanResponse.md)
311+
- [ClerkHttpClient::PaginatedCommerceSubscriptionItemResponse](docs/PaginatedCommerceSubscriptionItemResponse.md)
305312
- [ClerkHttpClient::Passkey](docs/Passkey.md)
306313
- [ClerkHttpClient::PasskeyVerification](docs/PasskeyVerification.md)
307314
- [ClerkHttpClient::PhoneNumber](docs/PhoneNumber.md)
@@ -359,6 +366,7 @@ Class | Method | HTTP request | Description
359366
- [ClerkHttpClient::UsersBanRequest](docs/UsersBanRequest.md)
360367
- [ClerkHttpClient::UsersUnbanRequest](docs/UsersUnbanRequest.md)
361368
- [ClerkHttpClient::VerificationAdmin](docs/VerificationAdmin.md)
369+
- [ClerkHttpClient::VerificationEmailLink](docs/VerificationEmailLink.md)
362370
- [ClerkHttpClient::VerificationFromOauth](docs/VerificationFromOauth.md)
363371
- [ClerkHttpClient::VerificationFromOauthError](docs/VerificationFromOauthError.md)
364372
- [ClerkHttpClient::VerificationGoogleOneTap](docs/VerificationGoogleOneTap.md)

.generated/docs/BetaFeaturesApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ All URIs are relative to *https://api.clerk.com/v1*
1515
1616
Update production instance domain
1717

18-
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.
18+
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.
1919

2020
### Examples
2121

@@ -154,7 +154,7 @@ end
154154
155155
Update production instance domain
156156

157-
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.
157+
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.
158158

159159
### Examples
160160

.generated/docs/CommerceApi.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All URIs are relative to *https://api.clerk.com/v1*
55
| Method | HTTP request | Description |
66
| ------ | ------------ | ----------- |
77
| [**get_commerce_plan_list**](CommerceApi.md#get_commerce_plan_list) | **GET** /commerce/plans | List all commerce plans |
8+
| [**get_commerce_subscription_item_list**](CommerceApi.md#get_commerce_subscription_item_list) | **GET** /commerce/subscription_items | List all subscription items |
89

910

1011
## get_commerce_plan_list
@@ -82,3 +83,87 @@ end
8283
- **Content-Type**: Not defined
8384
- **Accept**: application/json
8485

86+
87+
## get_commerce_subscription_item_list
88+
89+
> <PaginatedCommerceSubscriptionItemResponse> get_commerce_subscription_item_list(opts)
90+
91+
List all subscription items
92+
93+
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.
94+
95+
### Examples
96+
97+
```ruby
98+
require 'time'
99+
require 'clerk'
100+
101+
## Setup
102+
Clerk.configure do |config|
103+
config.secret_key = 'sk_test_xxxxxxxxx'
104+
end
105+
106+
opts = {
107+
paginated: true, # Boolean | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated.
108+
limit: 56, # Integer | Applies a limit to the number of results returned. Can be used for paginating the results together with `offset`.
109+
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`.
110+
status: 'active', # String | Filter subscription items by status
111+
payer_type: 'user', # String | Filter subscription items by payer type
112+
plan_id: 'plan_id_example', # String | Filter subscription items by plan ID
113+
include_free: true, # Boolean | Whether to include free plan subscription items
114+
query: 'query_example' # String | Search query to filter subscription items
115+
}
116+
117+
begin
118+
# List all subscription items
119+
result = Clerk::SDK.commerce.get_commerce_subscription_item_list(opts)
120+
p result
121+
rescue ClerkHttpClient::ApiError => e
122+
puts "Error when calling Clerk::SDK.commerce->get_commerce_subscription_item_list: #{e}"
123+
end
124+
```
125+
126+
#### Using the `get_commerce_subscription_item_list_with_http_info variant
127+
128+
This returns an Array which contains the response data, status code and headers.
129+
130+
> <Array(<PaginatedCommerceSubscriptionItemResponse>, Integer, Hash)> get_commerce_subscription_item_list_with_http_info(opts)
131+
132+
```ruby
133+
begin
134+
# List all subscription items
135+
data, status_code, headers = Clerk::SDK.commerce.get_commerce_subscription_item_list_with_http_info(opts)
136+
p status_code # => 2xx
137+
p headers # => { ... }
138+
p data # => <PaginatedCommerceSubscriptionItemResponse>
139+
rescue ClerkHttpClient::ApiError => e
140+
puts "Error when calling Clerk::SDK.commerce->get_commerce_subscription_item_list_with_http_info: #{e}"
141+
end
142+
```
143+
144+
### Parameters
145+
146+
| Name | Type | Description | Notes |
147+
| ---- | ---- | ----------- | ----- |
148+
| **paginated** | **Boolean** | Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated. | [optional] |
149+
| **limit** | **Integer** | Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. | [optional][default to 10] |
150+
| **offset** | **Integer** | Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. | [optional][default to 0] |
151+
| **status** | **String** | Filter subscription items by status | [optional] |
152+
| **payer_type** | **String** | Filter subscription items by payer type | [optional] |
153+
| **plan_id** | **String** | Filter subscription items by plan ID | [optional] |
154+
| **include_free** | **Boolean** | Whether to include free plan subscription items | [optional][default to false] |
155+
| **query** | **String** | Search query to filter subscription items | [optional] |
156+
157+
### Return type
158+
159+
[**PaginatedCommerceSubscriptionItemResponse**](PaginatedCommerceSubscriptionItemResponse.md)
160+
161+
### Authorization
162+
163+
[bearerAuth](../README.md#bearerAuth)
164+
165+
### HTTP request headers
166+
167+
- **Content-Type**: Not defined
168+
- **Accept**: application/json
169+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# ClerkHttpClient::CommercePayerResponse
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **object** | **String** | String representing the object&#39;s type. Objects of the same type share the same value. | |
8+
| **id** | **String** | Unique identifier for the payer. | |
9+
| **instance_id** | **String** | Unique identifier for the Clerk instance. | |
10+
| **user_id** | **String** | User ID for user-type payers. | [optional] |
11+
| **first_name** | **String** | First name of the payer. | |
12+
| **last_name** | **String** | Last name of the payer. | |
13+
| **email** | **String** | Email address of the payer. | |
14+
| **organization_id** | **String** | Organization ID for org-type payers. | [optional] |
15+
| **organization_name** | **String** | Organization name for org-type payers. | [optional] |
16+
| **image_url** | **String** | URL of the payer&#39;s image/avatar. | |
17+
| **created_at** | **Integer** | Unix timestamp (in milliseconds) when the payer was created. | |
18+
| **updated_at** | **Integer** | Unix timestamp (in milliseconds) when the payer was last updated. | |
19+
20+
## Example
21+
22+
```ruby
23+
require 'clerk-http-client'
24+
25+
instance = ClerkHttpClient::CommercePayerResponse.new(
26+
object: null,
27+
id: null,
28+
instance_id: null,
29+
user_id: null,
30+
first_name: null,
31+
last_name: null,
32+
email: null,
33+
organization_id: null,
34+
organization_name: null,
35+
image_url: null,
36+
created_at: null,
37+
updated_at: null
38+
)
39+
```
40+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# ClerkHttpClient::CommercePaymentSourceResponse
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **object** | **String** | String representing the object&#39;s type. Objects of the same type share the same value. | |
8+
| **id** | **String** | Unique identifier for the payment source. | |
9+
| **payer_id** | **String** | Unique identifier for the payer. | |
10+
| **payment_method** | **String** | The payment method type. | |
11+
| **is_default** | **Boolean** | Whether this is the default payment source for the payer. | [optional] |
12+
| **gateway** | **String** | The payment gateway. | |
13+
| **gateway_external_id** | **String** | External ID in the payment gateway. | |
14+
| **gateway_external_account_id** | **String** | External account ID in the payment gateway. | [optional] |
15+
| **last4** | **String** | Last 4 digits of the card (for card payment sources). | |
16+
| **status** | **String** | Status of the payment source. | |
17+
| **wallet_type** | **String** | Type of wallet (if applicable). | |
18+
| **card_type** | **String** | Type of card (if applicable). | |
19+
| **expiry_year** | **Integer** | Card expiration year (for card payment sources). | [optional] |
20+
| **expiry_month** | **Integer** | Card expiration month (for card payment sources). | [optional] |
21+
| **created_at** | **Integer** | Unix timestamp (in milliseconds) when the payment source was created. | |
22+
| **updated_at** | **Integer** | Unix timestamp (in milliseconds) when the payment source was last updated. | |
23+
| **is_removable** | **Boolean** | Whether this payment source can be removed. | [optional] |
24+
25+
## Example
26+
27+
```ruby
28+
require 'clerk-http-client'
29+
30+
instance = ClerkHttpClient::CommercePaymentSourceResponse.new(
31+
object: null,
32+
id: null,
33+
payer_id: null,
34+
payment_method: null,
35+
is_default: null,
36+
gateway: null,
37+
gateway_external_id: null,
38+
gateway_external_account_id: null,
39+
last4: null,
40+
status: null,
41+
wallet_type: null,
42+
card_type: null,
43+
expiry_year: null,
44+
expiry_month: null,
45+
created_at: null,
46+
updated_at: null,
47+
is_removable: null
48+
)
49+
```
50+

.generated/docs/CommercePlan.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
| **period** | **String** | The billing period for the plan. | [optional] |
3232
| **interval** | **Integer** | The billing interval. | [optional] |
3333
| **features** | [**Array&lt;FeatureResponse&gt;**](FeatureResponse.md) | The features included in this plan. | |
34+
| **free_trial_enabled** | **Boolean** | Whether free trial is enabled for this plan. | [optional] |
35+
| **free_trial_days** | **Integer** | Number of free trial days for this plan. | [optional] |
3436

3537
## Example
3638

@@ -64,7 +66,9 @@ instance = ClerkHttpClient::CommercePlan.new(
6466
avatar_url: null,
6567
period: null,
6668
interval: null,
67-
features: null
69+
features: null,
70+
free_trial_enabled: null,
71+
free_trial_days: null
6872
)
6973
```
7074

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ClerkHttpClient::CommerceSubscriptionCreditResponse
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **amount** | [**CommerceMoneyResponse**](CommerceMoneyResponse.md) | Credit amount. | [optional] |
8+
| **cycle_remaining_percent** | **Float** | Percentage of the billing cycle remaining. | [optional] |
9+
10+
## Example
11+
12+
```ruby
13+
require 'clerk-http-client'
14+
15+
instance = ClerkHttpClient::CommerceSubscriptionCreditResponse.new(
16+
amount: null,
17+
cycle_remaining_percent: null
18+
)
19+
```
20+

0 commit comments

Comments
 (0)