Skip to content

Commit 2d82d79

Browse files
committed
subsciptions spec updated
1 parent deddc43 commit 2d82d79

37 files changed

Lines changed: 289 additions & 116 deletions

.speakeasy/gen.lock

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 75aecebc-40e4-4ee7-93d2-571b70b46324
33
management:
4-
docChecksum: e79d06fd4001d7925a985c30bf16cab0
4+
docChecksum: 2e670939de7c53d757b682ab351f0b61
55
docVersion: v1
6-
speakeasyVersion: 1.584.0
7-
generationVersion: 2.660.0
8-
releaseVersion: 0.1.2
9-
configChecksum: d5eded91d42c10f2dd5d45a1e195ef24
6+
speakeasyVersion: 1.589.0
7+
generationVersion: 2.664.0
8+
releaseVersion: 0.2.1
9+
configChecksum: 20e7f693414768ffb098333bfe661c0d
1010
features:
1111
python:
1212
additionalDependencies: 1.0.0
@@ -26,6 +26,7 @@ features:
2626
responseFormat: 1.0.1
2727
retries: 3.0.2
2828
sdkHooks: 1.1.0
29+
unions: 3.0.4
2930
generatedFiles:
3031
- .devcontainer/README.md
3132
- .devcontainer/devcontainer.json
@@ -40,11 +41,15 @@ generatedFiles:
4041
- docs/models/createproductresponse.md
4142
- docs/models/frequencyunit.md
4243
- docs/models/getplansrequest.md
44+
- docs/models/getplansresponse.md
4345
- docs/models/getproductrequest.md
4446
- docs/models/getsubscriptionrequest.md
4547
- docs/models/listproductsresponse.md
4648
- docs/models/listsubscriptionordersrequest.md
49+
- docs/models/listsubscriptionordersresponse.md
4750
- docs/models/listsubscriptionsrequest.md
51+
- docs/models/listsubscriptionsresponse.md
52+
- docs/models/orderid.md
4853
- docs/models/plan.md
4954
- docs/models/postv1subscriptionssubscriptionidpauserequest.md
5055
- docs/models/postv1subscriptionssubscriptionidunpauserequest.md
@@ -138,7 +143,7 @@ examples:
138143
speakeasy-default-get-product:
139144
parameters:
140145
path:
141-
productId: "681031"
146+
productId: 681031
142147
responses:
143148
"200":
144149
application/json: {"id": "sp_Tlj0Osm0N76T", "name": "Bolt Subscription Product", "description": "This is a subscription product.", "sku": "BOLT-12345", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z", "plans": [{"id": "spl_ba_PpkW16oIW", "name": "Monthly Subscription", "sku": "BOLT-12345", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z", "frequency": 1, "product_id": "sp_Tlj0Osm0N76T", "frequency_unit": "month", "checkout_link": "https://your_site.c.bolt.com/g?merchant_product_id=37&merchant_variant_id=67&publishable_key=BQ9PKQksUGtj.Q9LwVLfV3WF4.32122926f7b9651a416a5099dc92dc2b4c87c8b922c114229f83b345d65f1195"}], "images": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"]}
@@ -149,12 +154,12 @@ examples:
149154
merchant_product_id: "<id>"
150155
responses:
151156
"200":
152-
application/json: [{"id": "spl_ba_PpkW16oIW", "name": "Monthly Subscription", "sku": "BOLT-12345", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z", "frequency": 1, "product_id": "sp_Tlj0Osm0N76T", "frequency_unit": "month", "checkout_link": "https://your_site.c.bolt.com/g?merchant_product_id=37&merchant_variant_id=67&publishable_key=BQ9PKQksUGtj.Q9LwVLfV3WF4.32122926f7b9651a416a5099dc92dc2b4c87c8b922c114229f83b345d65f1195"}]
157+
application/json: {"plans": [{"id": "spl_ba_PpkW16oIW", "name": "Monthly Subscription", "sku": "BOLT-12345", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z", "frequency": 1, "product_id": "sp_Tlj0Osm0N76T", "frequency_unit": "month", "checkout_link": "https://your_site.c.bolt.com/g?merchant_product_id=37&merchant_variant_id=67&publishable_key=BQ9PKQksUGtj.Q9LwVLfV3WF4.32122926f7b9651a416a5099dc92dc2b4c87c8b922c114229f83b345d65f1195"}]}
153158
post_/v1/subscriptions/{subscriptionId}/pause:
154159
speakeasy-default-post-/v1-/subscriptions/{subscription-id}/pause:
155160
parameters:
156161
path:
157-
subscriptionId: "921987"
162+
subscriptionId: 921987
158163
responses:
159164
"200":
160165
application/json: {}
@@ -186,10 +191,10 @@ examples:
186191
speakeasy-default-list-subscriptions:
187192
responses:
188193
"200":
189-
application/json: [{"id": "s_1234567890", "subscription_plan_id": "spl_ba_PpkW16oIW", "status": "active", "plan": {"id": "spl_ba_PpkW16oIW", "name": "Monthly Subscription", "sku": "BOLT-12345", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z", "frequency": 1, "product_id": "sp_Tlj0Osm0N76T", "frequency_unit": "month", "checkout_link": "https://your_site.c.bolt.com/g?merchant_product_id=37&merchant_variant_id=67&publishable_key=BQ9PKQksUGtj.Q9LwVLfV3WF4.32122926f7b9651a416a5099dc92dc2b4c87c8b922c114229f83b345d65f1195"}}]
194+
application/json: {"subscriptions": [{"id": "s_1234567890", "subscription_plan_id": "spl_ba_PpkW16oIW", "status": "active", "plan": {"id": "spl_ba_PpkW16oIW", "name": "Monthly Subscription", "sku": "BOLT-12345", "created_at": "2023-10-01T12:00:00Z", "updated_at": "2023-10-01T12:00:00Z", "frequency": 1, "product_id": "sp_Tlj0Osm0N76T", "frequency_unit": "month", "checkout_link": "https://your_site.c.bolt.com/g?merchant_product_id=37&merchant_variant_id=67&publishable_key=BQ9PKQksUGtj.Q9LwVLfV3WF4.32122926f7b9651a416a5099dc92dc2b4c87c8b922c114229f83b345d65f1195"}}]}
190195
listSubscriptionOrders:
191196
speakeasy-default-list-subscription-orders:
192197
responses:
193198
"200":
194-
application/json: [{"id": "so_Vni2CsDCpT0r", "subscription_id": "s_711BJEHgNnGB", "order_id": "sr_1BHyrSbeQiKwdyQ_49_bdw", "status": "active"}]
199+
application/json: {"orders": [{"id": "so_Vni2CsDCpT0r", "subscription_id": "s_711BJEHgNnGB", "order_id": "sr_1BHyrSbeQiKwdyQ_49_bdw", "status": "active"}]}
195200
examplesVersion: 1.0.2

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ generation:
2525
generateNewTests: true
2626
skipResponseBodyAssertions: false
2727
python:
28-
version: 0.1.2
28+
version: 0.2.1
2929
additionalDependencies:
3030
dev: {}
3131
main: {}

.speakeasy/out.openapi.yaml

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,13 @@ paths:
9393
frequency_unit:
9494
type: string
9595
enum:
96+
- day
9697
- week
9798
- month
99+
- Month
98100
- year
99-
description: Unit of frequency (e.g., hour, week, month).
101+
- one_time
102+
description: Unit of frequency (e.g., day, week, month, Month, year, one_time).
100103
example: "month"
101104
responses:
102105
'200':
@@ -156,7 +159,7 @@ paths:
156159
- in: path
157160
name: productId
158161
schema:
159-
type: string
162+
type: integer
160163
required: true
161164
description: ID of the product to retrieve.
162165
responses:
@@ -223,9 +226,14 @@ paths:
223226
content:
224227
application/json:
225228
schema:
226-
type: array
227-
items:
228-
$ref: '#/components/schemas/Plan'
229+
type: object
230+
properties:
231+
plans:
232+
type: array
233+
items:
234+
$ref: '#/components/schemas/Plan'
235+
required:
236+
- plans
229237
'401':
230238
description: Unauthorized - Invalid or missing publishable key.
231239
x-speakeasy-group: plans
@@ -241,7 +249,7 @@ paths:
241249
- in: path
242250
name: subscriptionId
243251
schema:
244-
type: string
252+
type: integer
245253
required: true
246254
description: ID of the subscription to pause.
247255
responses:
@@ -383,9 +391,14 @@ paths:
383391
content:
384392
application/json:
385393
schema:
386-
type: array
387-
items:
388-
$ref: '#/components/schemas/Subscription'
394+
type: object
395+
properties:
396+
subscriptions:
397+
type: array
398+
items:
399+
$ref: '#/components/schemas/Subscription'
400+
required:
401+
- subscriptions
389402
'401':
390403
description: Unauthorized - Invalid or missing API key.
391404
'404':
@@ -413,9 +426,14 @@ paths:
413426
content:
414427
application/json:
415428
schema:
416-
type: array
417-
items:
418-
$ref: '#/components/schemas/SubscriptionOrder'
429+
type: object
430+
properties:
431+
orders:
432+
type: array
433+
items:
434+
$ref: '#/components/schemas/SubscriptionOrder'
435+
required:
436+
- orders
419437
'401':
420438
description: Unauthorized - Invalid or missing API key.
421439
'404':
@@ -466,11 +484,14 @@ components:
466484
example: sp_Tlj0Osm0N76T
467485
frequency_unit:
468486
type: string
469-
description: Unit of frequency (e.g., hour, week, month).
487+
description: Unit of frequency (e.g., day, week, month, Month, year, one_time).
470488
enum:
489+
- day
471490
- week
472491
- month
492+
- Month
473493
- year
494+
- one_time
474495
example: "month"
475496
checkout_link:
476497
type: string
@@ -566,9 +587,14 @@ components:
566587
description: ID of the subscription associated with the order.
567588
example: s_711BJEHgNnGB
568589
order_id:
569-
type: string
570-
description: ID of the order.
571-
example: sr_1BHyrSbeQiKwdyQ_49_bdw
590+
oneOf:
591+
- type: string
592+
description: ID of the order as a string.
593+
example: sr_1BHyrSbeQiKwdyQ_49_bdw
594+
- type: integer
595+
description: ID of the order as an integer.
596+
example: 123456789
597+
description: ID of the order. Can be a string or integer.
572598
placement_time:
573599
type: string
574600
format: date-time
@@ -578,6 +604,7 @@ components:
578604
- scheduled
579605
- active
580606
- canceled
607+
- done
581608
example: "active"
582609
created_at:
583610
type: string

.speakeasy/workflow.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
speakeasyVersion: 1.584.0
1+
speakeasyVersion: 1.589.0
22
sources:
33
Subscriptions API:
44
sourceNamespace: subscriptions-api
5-
sourceRevisionDigest: sha256:5145fe36b6527ae3dd93be65c95f7c2fb139b7d8a943bd61684f48433e3b2ae7
6-
sourceBlobDigest: sha256:9420e0f78389d3ddfc1f9b9c1b10cb93828f9d50f80ba740ca1b973e95853e59
5+
sourceRevisionDigest: sha256:33e271622a4846fc722c3c2dfb1a4d0ba7f37e7ee61d6add9005db5963ebd357
6+
sourceBlobDigest: sha256:861745d74c991d3891a809d547043d4820bf95c222bf3419baa4343f7e6adb1b
77
tags:
88
- latest
99
- v1
1010
targets:
1111
bolt:
1212
source: Subscriptions API
1313
sourceNamespace: subscriptions-api
14-
sourceRevisionDigest: sha256:5145fe36b6527ae3dd93be65c95f7c2fb139b7d8a943bd61684f48433e3b2ae7
15-
sourceBlobDigest: sha256:9420e0f78389d3ddfc1f9b9c1b10cb93828f9d50f80ba740ca1b973e95853e59
14+
sourceRevisionDigest: sha256:33e271622a4846fc722c3c2dfb1a4d0ba7f37e7ee61d6add9005db5963ebd357
15+
sourceBlobDigest: sha256:861745d74c991d3891a809d547043d4820bf95c222bf3419baa4343f7e6adb1b
1616
codeSamplesNamespace: subscriptions-api-python-code-samples
17-
codeSamplesRevisionDigest: sha256:db15874e3e145fb40413d65d24fa4fdd223d75e5954b12a5d0811b5a6af5f1e8
17+
codeSamplesRevisionDigest: sha256:ac6e1a55061937361b0b77a6fded4e57ae60e90ce8bfc37dbab58bceb814edce
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ The SDK can be installed with either *pip* or *poetry* package managers.
6060
*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
6161

6262
```bash
63-
pip install git+https://github.com/BoltApp/Bolt-Python-SDK.git@dev
63+
pip install git+<UNSET>.git
6464
```
6565

6666
### Poetry
6767

6868
*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
6969

7070
```bash
71-
poetry add git+https://github.com/BoltApp/Bolt-Python-SDK.git@dev
71+
poetry add git+<UNSET>.git
7272
```
7373

7474
### Shell and script usage with `uv`
@@ -135,7 +135,7 @@ with Bolt(
135135
"sku": "BOLT-PLAN-12345",
136136
"name": "Monthly Subscription",
137137
"frequency": 1,
138-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
138+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
139139
},
140140
], images=[
141141
"https://example.com/image1.jpg",
@@ -168,7 +168,7 @@ async def main():
168168
"sku": "BOLT-PLAN-12345",
169169
"name": "Monthly Subscription",
170170
"frequency": 1,
171-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
171+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
172172
},
173173
], images=[
174174
"https://example.com/image1.jpg",
@@ -211,7 +211,7 @@ with Bolt(
211211
"sku": "BOLT-PLAN-12345",
212212
"name": "Monthly Subscription",
213213
"frequency": 1,
214-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
214+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
215215
},
216216
], images=[
217217
"https://example.com/image1.jpg",
@@ -279,7 +279,7 @@ with Bolt(
279279
"sku": "BOLT-PLAN-12345",
280280
"name": "Monthly Subscription",
281281
"frequency": 1,
282-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
282+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
283283
},
284284
], images=[
285285
"https://example.com/image1.jpg",
@@ -311,7 +311,7 @@ with Bolt(
311311
"sku": "BOLT-PLAN-12345",
312312
"name": "Monthly Subscription",
313313
"frequency": 1,
314-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
314+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
315315
},
316316
], images=[
317317
"https://example.com/image1.jpg",
@@ -356,7 +356,7 @@ with Bolt(
356356
"sku": "BOLT-PLAN-12345",
357357
"name": "Monthly Subscription",
358358
"frequency": 1,
359-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
359+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
360360
},
361361
], images=[
362362
"https://example.com/image1.jpg",
@@ -429,7 +429,7 @@ with Bolt(
429429
"sku": "BOLT-PLAN-12345",
430430
"name": "Monthly Subscription",
431431
"frequency": 1,
432-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
432+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
433433
},
434434
], images=[
435435
"https://example.com/image1.jpg",
@@ -461,7 +461,7 @@ with Bolt(
461461
"sku": "BOLT-PLAN-12345",
462462
"name": "Monthly Subscription",
463463
"frequency": 1,
464-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
464+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
465465
},
466466
], images=[
467467
"https://example.com/image1.jpg",

USAGE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ with Bolt(
1616
"sku": "BOLT-PLAN-12345",
1717
"name": "Monthly Subscription",
1818
"frequency": 1,
19-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
19+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
2020
},
2121
], images=[
2222
"https://example.com/image1.jpg",
@@ -49,7 +49,7 @@ async def main():
4949
"sku": "BOLT-PLAN-12345",
5050
"name": "Monthly Subscription",
5151
"frequency": 1,
52-
"frequency_unit": models.CreateProductFrequencyUnit.MONTH,
52+
"frequency_unit": models.CreateProductFrequencyUnit.MONTH_LOWER,
5353
},
5454
], images=[
5555
"https://example.com/image1.jpg",
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# CreateProductFrequencyUnit
22

3-
Unit of frequency (e.g., hour, week, month).
3+
Unit of frequency (e.g., day, week, month, Month, year, one_time).
44

55

66
## Values
77

8-
| Name | Value |
9-
| ------- | ------- |
10-
| `WEEK` | week |
11-
| `MONTH` | month |
12-
| `YEAR` | year |
8+
| Name | Value |
9+
| ------------- | ------------- |
10+
| `DAY` | day |
11+
| `WEEK` | week |
12+
| `MONTH_LOWER` | month |
13+
| `MONTH_MIXED` | Month |
14+
| `YEAR` | year |
15+
| `ONE_TIME` | one_time |

docs/models/createproductplan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
| `sku` | *str* | :heavy_check_mark: | SKU of the plan. | BOLT-PLAN-12345 |
99
| `name` | *str* | :heavy_check_mark: | Name of the plan. | Monthly Subscription |
1010
| `frequency` | *int* | :heavy_check_mark: | Frequency of the plan. | 1 |
11-
| `frequency_unit` | [models.CreateProductFrequencyUnit](../models/createproductfrequencyunit.md) | :heavy_check_mark: | Unit of frequency (e.g., hour, week, month). | month |
11+
| `frequency_unit` | [models.CreateProductFrequencyUnit](../models/createproductfrequencyunit.md) | :heavy_check_mark: | Unit of frequency (e.g., day, week, month, Month, year, one_time). | month |

0 commit comments

Comments
 (0)