Skip to content

Commit 0f7f6e1

Browse files
committed
initial commit, subscription sdk generated from spec v1
0 parents  commit 0f7f6e1

103 files changed

Lines changed: 9531 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
> **Remember to shutdown a GitHub Codespace when it is not in use!**
3+
4+
# Dev Containers Quick Start
5+
6+
The default location for usage snippets is the `samples` directory.
7+
8+
## Running a Usage Sample
9+
10+
A sample usage example has been provided in a `root.py` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
11+
12+
```
13+
python root.py
14+
```
15+
16+
## Generating Additional Usage Samples
17+
18+
The speakeasy CLI allows you to generate more usage snippets. Here's how:
19+
20+
- To generate a sample for a specific operation by providing an operation ID, use:
21+
22+
```
23+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l python -i {INPUT_OPERATION_ID} -o ./samples
24+
```
25+
26+
- To generate samples for an entire namespace (like a tag or group name), use:
27+
28+
```
29+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l python -n {INPUT_TAG_NAME} -o ./samples
30+
```

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/images/tree/main/src/python
3+
{
4+
"name": "Python",
5+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
6+
// Features to add to the dev container. More info: https://containers.dev/features.
7+
// "features": {},
8+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
9+
// "forwardPorts": [],
10+
// Use 'postCreateCommand' to run commands after the container is created.
11+
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-python.python",
16+
"ms-python.vscode-pylance",
17+
"github.vscode-pull-request-github"
18+
],
19+
"settings": {
20+
"files.eol": "\n",
21+
"editor.formatOnSave": true,
22+
"python.formatting.provider": "black",
23+
"python.linting.enabled": true,
24+
"python.linting.pylintEnabled": true,
25+
"python.linting.flake8Enabled": true,
26+
"python.linting.banditEnabled": true,
27+
"python.testing.pytestEnabled": true
28+
}
29+
},
30+
"codespaces": {
31+
"openFiles": [
32+
".devcontainer/README.md"
33+
]
34+
}
35+
}
36+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
37+
// "remoteUser": "root"
38+
}

.devcontainer/setup.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Install the speakeasy CLI
4+
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
5+
6+
# Setup samples directory
7+
rmdir samples || true
8+
mkdir samples
9+
10+
python -m pip install --upgrade pip
11+
pip install -e .
12+
13+
# Generate starter usage sample with speakeasy
14+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l python -o samples/root.py

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.py linguist-generated=false

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.venv/
2+
venv/
3+
src/*.egg-info/
4+
**/__pycache__/
5+
.pytest_cache/
6+
.python-version
7+
.DS_Store
8+
pyrightconfig.json
9+
**/.speakeasy/temp/
10+
**/.speakeasy/logs/
11+
.speakeasy/reports

.speakeasy/gen.lock

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
lockVersion: 2.0.0
2+
id: 75aecebc-40e4-4ee7-93d2-571b70b46324
3+
management:
4+
docChecksum: e79d06fd4001d7925a985c30bf16cab0
5+
docVersion: v1
6+
speakeasyVersion: 1.584.0
7+
generationVersion: 2.660.0
8+
releaseVersion: 0.1.2
9+
configChecksum: d5eded91d42c10f2dd5d45a1e195ef24
10+
features:
11+
python:
12+
additionalDependencies: 1.0.0
13+
core: 5.19.4
14+
defaultEnabledRetries: 0.2.0
15+
devContainers: 3.0.0
16+
enumUnions: 0.1.0
17+
envVarSecurityUsage: 0.3.2
18+
flatRequests: 1.0.1
19+
flattening: 3.1.1
20+
globalSecurity: 3.0.3
21+
globalSecurityCallbacks: 1.0.0
22+
globalServerURLs: 3.1.1
23+
groups: 3.0.0
24+
methodArguments: 1.0.2
25+
nameOverrides: 3.0.1
26+
responseFormat: 1.0.1
27+
retries: 3.0.2
28+
sdkHooks: 1.1.0
29+
generatedFiles:
30+
- .devcontainer/README.md
31+
- .devcontainer/devcontainer.json
32+
- .devcontainer/setup.sh
33+
- .gitattributes
34+
- .vscode/settings.json
35+
- USAGE.md
36+
- docs/models/cancelsubscriptionrequest.md
37+
- docs/models/createproductfrequencyunit.md
38+
- docs/models/createproductplan.md
39+
- docs/models/createproductrequest.md
40+
- docs/models/createproductresponse.md
41+
- docs/models/frequencyunit.md
42+
- docs/models/getplansrequest.md
43+
- docs/models/getproductrequest.md
44+
- docs/models/getsubscriptionrequest.md
45+
- docs/models/listproductsresponse.md
46+
- docs/models/listsubscriptionordersrequest.md
47+
- docs/models/listsubscriptionsrequest.md
48+
- docs/models/plan.md
49+
- docs/models/postv1subscriptionssubscriptionidpauserequest.md
50+
- docs/models/postv1subscriptionssubscriptionidunpauserequest.md
51+
- docs/models/product.md
52+
- docs/models/security.md
53+
- docs/models/subscription.md
54+
- docs/models/subscriptionorder.md
55+
- docs/models/subscriptionorderstatus.md
56+
- docs/models/subscriptionstatus.md
57+
- docs/models/success.md
58+
- docs/models/utils/retryconfig.md
59+
- docs/sdks/bolt/README.md
60+
- docs/sdks/orders/README.md
61+
- docs/sdks/plans/README.md
62+
- docs/sdks/products/README.md
63+
- docs/sdks/subscriptions/README.md
64+
- poetry.toml
65+
- py.typed
66+
- pylintrc
67+
- pyproject.toml
68+
- scripts/publish.sh
69+
- src/bolt/__init__.py
70+
- src/bolt/_hooks/__init__.py
71+
- src/bolt/_hooks/sdkhooks.py
72+
- src/bolt/_hooks/types.py
73+
- src/bolt/_version.py
74+
- src/bolt/basesdk.py
75+
- src/bolt/errors/__init__.py
76+
- src/bolt/errors/apierror.py
77+
- src/bolt/errors/bolterror.py
78+
- src/bolt/errors/no_response_error.py
79+
- src/bolt/errors/responsevalidationerror.py
80+
- src/bolt/httpclient.py
81+
- src/bolt/models/__init__.py
82+
- src/bolt/models/cancelsubscriptionop.py
83+
- src/bolt/models/createproductop.py
84+
- src/bolt/models/getplansop.py
85+
- src/bolt/models/getproductop.py
86+
- src/bolt/models/getsubscriptionop.py
87+
- src/bolt/models/listproductsop.py
88+
- src/bolt/models/listsubscriptionordersop.py
89+
- src/bolt/models/listsubscriptionsop.py
90+
- src/bolt/models/plan.py
91+
- src/bolt/models/post_v1_subscriptions_subscriptionid_pauseop.py
92+
- src/bolt/models/post_v1_subscriptions_subscriptionid_unpauseop.py
93+
- src/bolt/models/product.py
94+
- src/bolt/models/security.py
95+
- src/bolt/models/subscription.py
96+
- src/bolt/models/subscriptionorder.py
97+
- src/bolt/models/success.py
98+
- src/bolt/orders.py
99+
- src/bolt/plans.py
100+
- src/bolt/products.py
101+
- src/bolt/py.typed
102+
- src/bolt/sdk.py
103+
- src/bolt/sdkconfiguration.py
104+
- src/bolt/subscriptions.py
105+
- src/bolt/types/__init__.py
106+
- src/bolt/types/basemodel.py
107+
- src/bolt/utils/__init__.py
108+
- src/bolt/utils/annotations.py
109+
- src/bolt/utils/datetimes.py
110+
- src/bolt/utils/enums.py
111+
- src/bolt/utils/eventstreaming.py
112+
- src/bolt/utils/forms.py
113+
- src/bolt/utils/headers.py
114+
- src/bolt/utils/logger.py
115+
- src/bolt/utils/metadata.py
116+
- src/bolt/utils/queryparams.py
117+
- src/bolt/utils/requestbodies.py
118+
- src/bolt/utils/retries.py
119+
- src/bolt/utils/security.py
120+
- src/bolt/utils/serializers.py
121+
- src/bolt/utils/unmarshal_json_response.py
122+
- src/bolt/utils/url.py
123+
- src/bolt/utils/values.py
124+
examples:
125+
createProduct:
126+
speakeasy-default-create-product:
127+
requestBody:
128+
application/json: {"name": "Bolt Subscription Product", "description": "This is a subscription product.", "brand": "Bolt", "sku": "BOLT-12345", "unit_price": 1999, "images": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"], "plans": [{"sku": "BOLT-PLAN-12345", "name": "Monthly Subscription", "frequency": 1, "frequency_unit": "month"}]}
129+
responses:
130+
"200":
131+
application/json: {"product": {"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"]}}
132+
listProducts:
133+
speakeasy-default-list-products:
134+
responses:
135+
"200":
136+
application/json: {"products": [{"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"]}]}
137+
getProduct:
138+
speakeasy-default-get-product:
139+
parameters:
140+
path:
141+
productId: "681031"
142+
responses:
143+
"200":
144+
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"]}
145+
getPlans:
146+
speakeasy-default-get-plans:
147+
parameters:
148+
query:
149+
merchant_product_id: "<id>"
150+
responses:
151+
"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"}]
153+
post_/v1/subscriptions/{subscriptionId}/pause:
154+
speakeasy-default-post-/v1-/subscriptions/{subscription-id}/pause:
155+
parameters:
156+
path:
157+
subscriptionId: "921987"
158+
responses:
159+
"200":
160+
application/json: {}
161+
post_/v1/subscriptions/{subscriptionId}/unpause:
162+
speakeasy-default-post-/v1-/subscriptions/{subscription-id}/unpause:
163+
parameters:
164+
path:
165+
subscriptionId: 438513
166+
responses:
167+
"200":
168+
application/json: {}
169+
cancelSubscription:
170+
speakeasy-default-cancel-subscription:
171+
parameters:
172+
path:
173+
subscriptionId: 111224
174+
responses:
175+
"200":
176+
application/json: {}
177+
getSubscription:
178+
speakeasy-default-get-subscription:
179+
parameters:
180+
path:
181+
subscriptionId: 186713
182+
responses:
183+
"200":
184+
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"}}
185+
listSubscriptions:
186+
speakeasy-default-list-subscriptions:
187+
responses:
188+
"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"}}]
190+
listSubscriptionOrders:
191+
speakeasy-default-list-subscription-orders:
192+
responses:
193+
"200":
194+
application/json: [{"id": "so_Vni2CsDCpT0r", "subscription_id": "s_711BJEHgNnGB", "order_id": "sr_1BHyrSbeQiKwdyQ_49_bdw", "status": "active"}]
195+
examplesVersion: 1.0.2

.speakeasy/gen.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
configVersion: 2.0.0
2+
generation:
3+
devContainers:
4+
enabled: true
5+
schemaPath: .speakeasy/out.openapi.yaml
6+
sdkClassName: Bolt
7+
maintainOpenAPIOrder: true
8+
usageSnippets:
9+
optionalPropertyRendering: withExample
10+
sdkInitStyle: constructor
11+
useClassNamesForArrayFields: true
12+
fixes:
13+
nameResolutionDec2023: true
14+
nameResolutionFeb2025: true
15+
parameterOrderingFeb2024: true
16+
requestResponseComponentNamesFeb2024: true
17+
securityFeb2025: true
18+
sharedErrorComponentsApr2025: true
19+
auth:
20+
oAuth2ClientCredentialsEnabled: false
21+
oAuth2PasswordEnabled: false
22+
sdkHooksConfigAccess: true
23+
tests:
24+
generateTests: false
25+
generateNewTests: true
26+
skipResponseBodyAssertions: false
27+
python:
28+
version: 0.1.2
29+
additionalDependencies:
30+
dev: {}
31+
main: {}
32+
authors:
33+
- Speakeasy
34+
baseErrorName: BoltError
35+
clientServerStatusCodesAsErrors: true
36+
defaultErrorName: APIError
37+
description: Python Client SDK Generated by Speakeasy.
38+
enableCustomCodeRegions: false
39+
enumFormat: enum
40+
envVarPrefix: BOLT
41+
fixFlags:
42+
responseRequiredSep2024: true
43+
flattenGlobalSecurity: true
44+
flattenRequests: true
45+
flatteningOrder: parameters-first
46+
imports:
47+
option: openapi
48+
paths:
49+
callbacks: ""
50+
errors: errors
51+
operations: ""
52+
shared: ""
53+
webhooks: ""
54+
inputModelSuffix: input
55+
maxMethodParams: 999
56+
methodArguments: infer-optional-args
57+
moduleName: ""
58+
outputModelSuffix: output
59+
packageName: bolt
60+
pytestFilterWarnings: []
61+
pytestTimeout: 0
62+
responseFormat: flat
63+
templateVersion: v2

0 commit comments

Comments
 (0)