(drinks)
The drinks endpoints.
- list_drinks - Get a list of drinks.
- get_drink - Get a drink.
Get a list of drinks, if authenticated this will include stock levels and product codes otherwise it will only include public information.
from speakeasy_bar_py import BarPython
from speakeasy_bar_py.models import components
with BarPython(
security=components.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as s:
res = s.drinks.list_drinks()
if res.drinks is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
drink_type |
Optional[components.DrinkType] | ➖ | The type of drink to filter by. If not provided all drinks will be returned. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 5XX | application/json |
errors.SDKError | 4XX | */* |
Get a drink by name, if authenticated this will include stock levels and product codes otherwise it will only include public information.
from speakeasy_bar_py import BarPython
from speakeasy_bar_py.models import components
with BarPython(
security=components.Security(
api_key="<YOUR_API_KEY_HERE>",
),
) as s:
res = s.drinks.get_drink(name="<value>")
if res.drink is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
name |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 5XX | application/json |
errors.SDKError | 4XX | */* |