Skip to content

Commit

Permalink
Merge pull request #14 from speakeasy-sdks/speakeasy-sdk-regen-170234…
Browse files Browse the repository at this point in the history
…3042

chore: 🐝 Update SDK - Generate
  • Loading branch information
speakeasybot authored Mar 13, 2024
2 parents 5dcb673 + 902bffc commit 26f2052
Show file tree
Hide file tree
Showing 44 changed files with 843 additions and 289 deletions.
118 changes: 118 additions & 0 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
lockVersion: 2.0.0
id: 463c131b-53b7-4e8c-b4de-cf4f7ff95e4d
management:
docChecksum: f22d50ed7aa4956c14ae35514eb114c1
docVersion: 1.0.0
speakeasyVersion: 1.207.1
generationVersion: 2.280.6
releaseVersion: 4.2.1
configChecksum: e87ed00f5cc6a32a5eaf235df776da2f
repoURL: https://github.com/speakeasy-sdks/template-sdk.git
repoSubDirectory: .
installationURL: https://github.com/speakeasy-sdks/template-sdk.git
features:
python:
callbacks: 1.0.0
core: 4.5.1
errors: 2.81.8
examples: 2.81.3
flattening: 2.81.1
globalSecurity: 2.83.4
globalServerURLs: 2.82.2
inputOutputModels: 2.83.1
methodSecurity: 2.82.1
methodServerURLs: 2.82.1
responseFormat: 0.1.0
retries: 2.82.1
serverIDs: 2.81.1
webhooks: 1.0.0
generatedFiles:
- src/speakeasybar/sdkconfiguration.py
- src/speakeasybar/authentication.py
- src/speakeasybar/drinks.py
- src/speakeasybar/ingredients.py
- src/speakeasybar/orders.py
- src/speakeasybar/config.py
- src/speakeasybar/sdk.py
- py.typed
- pylintrc
- setup.py
- src/speakeasybar/__init__.py
- src/speakeasybar/utils/__init__.py
- src/speakeasybar/utils/retries.py
- src/speakeasybar/utils/utils.py
- src/speakeasybar/models/errors/sdkerror.py
- tests/helpers.py
- src/speakeasybar/models/operations/login.py
- src/speakeasybar/models/operations/getdrink.py
- src/speakeasybar/models/operations/listdrinks.py
- src/speakeasybar/models/operations/listingredients.py
- src/speakeasybar/models/operations/createorder.py
- src/speakeasybar/models/operations/subscribetowebhooks.py
- src/speakeasybar/models/shared/error.py
- src/speakeasybar/models/shared/drink.py
- src/speakeasybar/models/shared/drinktype.py
- src/speakeasybar/models/shared/ingredient.py
- src/speakeasybar/models/shared/ingredienttype.py
- src/speakeasybar/models/shared/order.py
- src/speakeasybar/models/shared/ordertype.py
- src/speakeasybar/models/shared/order_input.py
- src/speakeasybar/models/shared/security.py
- src/speakeasybar/models/shared/ingredient_input.py
- src/speakeasybar/models/shared/drink_input.py
- src/speakeasybar/models/errors/apierror.py
- src/speakeasybar/models/errors/badrequest.py
- src/speakeasybar/models/callbacks/createorder.py
- src/speakeasybar/models/webhooks/stockupdate.py
- src/speakeasybar/models/__init__.py
- src/speakeasybar/models/errors/__init__.py
- src/speakeasybar/models/operations/__init__.py
- src/speakeasybar/models/shared/__init__.py
- src/speakeasybar/models/callbacks/__init__.py
- src/speakeasybar/models/webhooks/__init__.py
- docs/models/operations/loginsecurity.md
- docs/models/operations/type.md
- docs/models/operations/loginrequestbody.md
- docs/models/operations/loginresponsebody.md
- docs/models/operations/loginresponse.md
- docs/models/operations/getdrinkrequest.md
- docs/models/operations/getdrinkresponse.md
- docs/models/operations/listdrinksrequest.md
- docs/models/operations/listdrinksresponse.md
- docs/models/operations/listingredientsrequest.md
- docs/models/operations/listingredientsresponse.md
- docs/models/operations/createorderrequest.md
- docs/models/operations/createorderresponse.md
- docs/models/operations/webhook.md
- docs/models/operations/requestbody.md
- docs/models/operations/subscribetowebhooksresponse.md
- docs/models/shared/error.md
- docs/models/shared/drink.md
- docs/models/shared/drinktype.md
- docs/models/shared/ingredient.md
- docs/models/shared/ingredienttype.md
- docs/models/shared/status.md
- docs/models/shared/order.md
- docs/models/shared/ordertype.md
- docs/models/shared/orderinput.md
- docs/models/shared/security.md
- docs/models/shared/ingredientinput.md
- docs/models/shared/drinkinput.md
- docs/models/errors/apierror.md
- docs/models/errors/badrequest.md
- docs/models/callbacks/createorderorderupdateresponse.md
- docs/models/callbacks/createorderorderupdaterequestbody.md
- docs/models/webhooks/stockupdateresponse.md
- docs/models/webhooks/stockupdaterequestbody.md
- docs/sdks/speakeasybar/README.md
- docs/sdks/authentication/README.md
- docs/sdks/drinks/README.md
- docs/sdks/ingredients/README.md
- docs/sdks/orders/README.md
- docs/models/utils/retryconfig.md
- docs/sdks/config/README.md
- USAGE.md
- .gitattributes
- src/speakeasybar/_hooks/sdkhooks.py
- src/speakeasybar/_hooks/types.py
- src/speakeasybar/_hooks/__init__.py
58 changes: 35 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ res = s.authentication.login(req, operations.LoginSecurity(
if res.object is not None:
# handle response
pass

```

### Browse available drinks
Expand All @@ -99,7 +100,7 @@ For example, you can filter the list of available drinks by type.

```python
import speakeasybar
from speakeasybar.models import operations, shared
from speakeasybar.models import shared

s = speakeasybar.Speakeasybar(
security=shared.Security(
Expand All @@ -113,6 +114,7 @@ res = s.drinks.list_drinks(drink_type=shared.DrinkType.SPIRIT)
if res.classes is not None:
# handle response
pass

```

### Create an order
Expand All @@ -122,7 +124,7 @@ This URL will get called whenever the supplier updates the status of your order.

```python
import speakeasybar
from speakeasybar.models import callbacks, operations, shared
from speakeasybar.models import shared

s = speakeasybar.Speakeasybar(
security=shared.Security(
Expand All @@ -137,11 +139,12 @@ res = s.orders.create_order(request_body=[
quantity=26535,
type=shared.OrderType.DRINK,
),
], callback_url='string')
], callback_url='<value>')

if res.order is not None:
# handle response
pass

```

### Subscribe to webhooks to receive stock updates
Expand All @@ -162,9 +165,10 @@ req = [

res = s.config.subscribe_to_webhooks(req)

if res.status_code == 200:
if res is not None:
# handle response
pass

```
<!-- End SDK Example Usage [usage] -->

Expand Down Expand Up @@ -198,9 +202,9 @@ if res.status_code == 200:
<!-- Start Retries [retries] -->
## Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
```python
import speakeasybar
from speakeasybar.models import operations, shared
Expand All @@ -219,12 +223,13 @@ req = [
res = s.config.subscribe_to_webhooks(req,
RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False))

if res.status_code == 200:
if res is not None:
# handle response
pass

```

If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
```python
import speakeasybar
from speakeasybar.models import operations, shared
Expand All @@ -243,9 +248,10 @@ req = [

res = s.config.subscribe_to_webhooks(req)

if res.status_code == 200:
if res is not None:
# handle response
pass

```
<!-- End Retries [retries] -->

Expand All @@ -260,13 +266,13 @@ Handling errors in this SDK should largely match your expectations. All operati
| ----------------- | ----------------- | ----------------- |
| errors.BadRequest | 400 | application/json |
| errors.APIError | 5XX | application/json |
| errors.SDKError | 400-600 | */* |
| errors.SDKError | 4x-5xx | */* |

### Example

```python
import speakeasybar
from speakeasybar.models import operations, shared
from speakeasybar.models import errors, operations, shared

s = speakeasybar.Speakeasybar(
security=shared.Security(
Expand All @@ -282,18 +288,19 @@ res = None
try:
res = s.config.subscribe_to_webhooks(req)
except errors.BadRequest as e:
print(e) # handle exception
# handle exception
raise(e)
except errors.APIError as e:
print(e) # handle exception
# handle exception
raise(e)
except errors.SDKError as e:
print(e) # handle exception
# handle exception
raise(e)

if res.status_code == 200:
if res is not None:
# handle response
pass

```
<!-- End Error Handling [errors] -->

Expand All @@ -316,7 +323,7 @@ You can override the default server globally by passing a server name to the `se

```python
import speakeasybar
from speakeasybar.models import operations, shared
from speakeasybar.models import shared

s = speakeasybar.Speakeasybar(
server="customer",
Expand All @@ -327,12 +334,13 @@ s = speakeasybar.Speakeasybar(


res = s.ingredients.list_ingredients(ingredients=[
'string',
'<value>',
])

if res.classes is not None:
# handle response
pass

```

#### Variables
Expand All @@ -346,7 +354,7 @@ Some of the server options above contain variables. If you want to set the value
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
```python
import speakeasybar
from speakeasybar.models import operations, shared
from speakeasybar.models import shared

s = speakeasybar.Speakeasybar(
server_url="https://speakeasy.bar",
Expand All @@ -357,20 +365,21 @@ s = speakeasybar.Speakeasybar(


res = s.ingredients.list_ingredients(ingredients=[
'string',
'<value>',
])

if res.classes is not None:
# handle response
pass

```

### Override Server URL Per-Operation

The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
```python
import speakeasybar
from speakeasybar.models import operations, shared
from speakeasybar.models import shared

s = speakeasybar.Speakeasybar(
security=shared.Security(
Expand All @@ -384,6 +393,7 @@ res = s.drinks.list_drinks(server_url="https://speakeasy.bar", drink_type=shared
if res.classes is not None:
# handle response
pass

```
<!-- End Server Selection [server] -->

Expand All @@ -392,7 +402,7 @@ if res.classes is not None:
<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
The Python SDK makes API calls using the [requests](https://pypi.org/project/requests/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.

For example, you could specify a header for every request that this sdk makes as follows:
```python
Expand Down Expand Up @@ -422,7 +432,7 @@ This SDK supports the following security schemes globally:
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
```python
import speakeasybar
from speakeasybar.models import operations, shared
from speakeasybar.models import shared

s = speakeasybar.Speakeasybar(
security=shared.Security(
Expand All @@ -432,12 +442,13 @@ s = speakeasybar.Speakeasybar(


res = s.ingredients.list_ingredients(ingredients=[
'string',
'<value>',
])

if res.classes is not None:
# handle response
pass

```

### Per-Operation Security Schemes
Expand All @@ -461,6 +472,7 @@ res = s.authentication.login(req, operations.LoginSecurity(
if res.object is not None:
# handle response
pass

```
<!-- End Authentication [security] -->

Expand Down
Loading

0 comments on commit 26f2052

Please sign in to comment.