Skip to content

Documentation Improvements #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 64 additions & 2 deletions api-reference/features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ paths:
autumn = Autumn('am_sk_1234567890')

async def main():
entity = await autumn.create_entity(
'user_123',
entity = await autumn.features.create_entity(
customer_id='user_123',
feature_id='seats',
id='seat_456',
name='Brandon Yeo'
Expand Down Expand Up @@ -130,6 +130,26 @@ paths:
responses:
"200":
description: ""
x-code-samples:
- lang: curl
source: |
curl -X DELETE 'https://api.useautumn.com/v1/customers/user_123/entities/seat_456' \
-H 'Authorization: Bearer am_sk_1234567890'

- lang: python
source: |
import asyncio
from autumn import Autumn

autumn = Autumn('am_sk_1234567890')

async def main():
await autumn.features.delete_entity(
customer_id='user_123',
entity_id='seat_456'
)

asyncio.run(main())

/usage:
post:
Expand Down Expand Up @@ -206,6 +226,48 @@ paths:
responses:
"200":
description: ""
x-code-samples:
- lang: curl
source: |
curl -X POST 'https://api.useautumn.com/v1/customers/user_123/balances' \
-H 'Authorization: Bearer am_sk_1234567890' \
-H 'Content-Type: application/json' \
-d '{
"balances": [
{
"feature_id": "chat_messages",
"balance": 10
},
{
"feature_id": "seats",
"balance": 15
}
]
}'

- lang: python
source: |
import asyncio
from autumn import Autumn, Balance

autumn = Autumn('am_sk_1234567890')

async def main():
balances = await autumn.features.set_balances(
customer_id='user_123',
balances=[
Balance(
feature_id='chat_messages',
balance=10
),
Balance(
feature_id='seats',
balance=15
)
]
)

asyncio.run(main())

components:
schemas:
Expand Down