Files
cfw-autumn/others/python-sdk/.speakeasy/code-samples.overlay.yaml
John Yeo e8366d22ea latest
2026-02-18 16:24:19 +00:00

258 lines
6.8 KiB
YAML

overlay: 1.0.0
info:
title: CodeSamples overlay for python target
version: 0.0.0
actions:
- target: $["paths"]["/v1/balances.check"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.balances.check(customer_id="<id>")
# Handle response
print(res)
- target: $["paths"]["/v1/balances.create"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.balances.create(feature_id="<id>", customer_id="<id>")
# Handle response
print(res)
- target: $["paths"]["/v1/balances.track"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.balances.track(customer_id="<id>")
# Handle response
print(res)
- target: $["paths"]["/v1/balances.update"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.balances.update(customer_id="<id>", feature_id="<id>")
# Handle response
print(res)
- target: $["paths"]["/v1/billing.attach"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.billing.attach(customer_id="<id>", plan_id="<id>", redirect_mode="always")
# Handle response
print(res)
- target: $["paths"]["/v1/billing.preview_attach"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.billing.preview_attach(customer_id="<id>", plan_id="<id>", redirect_mode="always")
# Handle response
print(res)
- target: $["paths"]["/v1/billing.preview_update"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.billing.preview_update(customer_id="<id>")
# Handle response
print(res)
- target: $["paths"]["/v1/billing.setup_payment"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.billing.setup_payment(customer_id="<id>")
# Handle response
print(res)
- target: $["paths"]["/v1/billing.update"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.billing.update(customer_id="<id>")
# Handle response
print(res)
- target: $["paths"]["/v1/customers.delete"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.customers.delete(customer_id="cus_123", delete_in_stripe=False)
# Handle response
print(res)
- target: $["paths"]["/v1/customers.get_or_create"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.customers.get_or_create(customer_id="cus_123", name="John Doe", email="john@example.com")
# Handle response
print(res)
- target: $["paths"]["/v1/customers.list"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.customers.list(request={})
# Handle response
print(res)
- target: $["paths"]["/v1/customers.update"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.customers.update(customer_id="cus_123", name="Jane Doe", email="jane@example.com")
# Handle response
print(res)
- target: $["paths"]["/v1/plans.list"]["post"]
update:
x-codeSamples:
- lang: python
label: Python (SDK)
source: |-
from autumn_sdk import Autumn
with Autumn(
x_api_version="2.1",
secret_key="<YOUR_BEARER_TOKEN_HERE>",
) as autumn:
res = autumn.plans.list()
# Handle response
print(res)