Skip to content

Commit 60edcdd

Browse files
committed
ci: regenerated with OpenAPI Doc 0.4.0, Speakeasy CLI 1.198.1
1 parent fff5adb commit 60edcdd

32 files changed

+1291
-71
lines changed

.speakeasy/gen.lock

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
lockVersion: 2.0.0
22
id: b0b519b1-d1d3-43b2-82dd-b4292eadd4b0
33
management:
4-
docChecksum: e7803aa801c8a80e23dbe21edbf4e9c5
4+
docChecksum: 9e766720141ee71ea97dae02c573b883
55
docVersion: 0.4.0
66
speakeasyVersion: internal
7-
generationVersion: 2.272.7
8-
releaseVersion: 5.2.8
9-
configChecksum: 2153cf881203d9f64e713f949a098799
7+
generationVersion: 2.275.4
8+
releaseVersion: 5.3.0
9+
configChecksum: 0d0e7964adcd5a451c9741b79154fa4e
1010
repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-python.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/speakeasy-api/speakeasy-client-sdk-python.git
1313
published: true
1414
features:
1515
python:
16-
core: 4.4.7
16+
core: 4.5.0
1717
downloadStreams: 0.0.2
1818
examples: 2.81.3
1919
globalSecurity: 2.83.4
@@ -66,6 +66,7 @@ generatedFiles:
6666
- src/speakeasy/models/operations/getschemarevision.py
6767
- src/speakeasy/models/operations/getschemas.py
6868
- src/speakeasy/models/operations/registerschema.py
69+
- src/speakeasy/models/operations/getaccesstoken.py
6970
- src/speakeasy/models/operations/getworkspaceaccess.py
7071
- src/speakeasy/models/operations/validateapikey.py
7172
- src/speakeasy/models/operations/generaterequestpostmancollection.py
@@ -87,6 +88,7 @@ generatedFiles:
8788
- src/speakeasy/models/shared/versionmetadata_input.py
8889
- src/speakeasy/models/shared/schema.py
8990
- src/speakeasy/models/shared/schemadiff.py
91+
- src/speakeasy/models/shared/accesstoken.py
9092
- src/speakeasy/models/shared/accessdetails.py
9193
- src/speakeasy/models/shared/apikeydetails.py
9294
- src/speakeasy/models/shared/unboundedrequest.py
@@ -157,6 +159,8 @@ generatedFiles:
157159
- docs/models/operations/registerschemarequestbody.md
158160
- docs/models/operations/registerschemarequest.md
159161
- docs/models/operations/registerschemaresponse.md
162+
- docs/models/operations/getaccesstokenrequest.md
163+
- docs/models/operations/getaccesstokenresponse.md
160164
- docs/models/operations/getworkspaceaccessrequest.md
161165
- docs/models/operations/getworkspaceaccessresponse.md
162166
- docs/models/operations/validateapikeyresponse.md
@@ -188,6 +192,10 @@ generatedFiles:
188192
- docs/models/shared/schema.md
189193
- docs/models/shared/valuechange.md
190194
- docs/models/shared/schemadiff.md
195+
- docs/models/shared/claims.md
196+
- docs/models/shared/user.md
197+
- docs/models/shared/workspaces.md
198+
- docs/models/shared/accesstoken.md
191199
- docs/models/shared/accessdetails.md
192200
- docs/models/shared/accounttype.md
193201
- docs/models/shared/apikeydetails.md
@@ -215,3 +223,7 @@ generatedFiles:
215223
- docs/sdks/events/README.md
216224
- USAGE.md
217225
- .gitattributes
226+
- src/speakeasy/_hooks/registration.py
227+
- src/speakeasy/_hooks/sdkhooks.py
228+
- src/speakeasy/_hooks/types.py
229+
- src/speakeasy/_hooks/__init__.py

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ if res.apis is not None:
7676

7777
### [auth](docs/sdks/auth/README.md)
7878

79+
* [get_access_token](docs/sdks/auth/README.md#get_access_token) - Get or refresh an access token for the current workspace.
7980
* [get_workspace_access](docs/sdks/auth/README.md#get_workspace_access) - Get access allowances for a particular workspace
8081
* [validate_api_key](docs/sdks/auth/README.md#validate_api_key) - Validate the current api key.
8182

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,4 +1286,14 @@ Based on:
12861286
### Generated
12871287
- [python v5.2.8] .
12881288
### Releases
1289-
- [PyPI v5.2.8] https://pypi.org/project/speakeasy-client-sdk-python/5.2.8 - .
1289+
- [PyPI v5.2.8] https://pypi.org/project/speakeasy-client-sdk-python/5.2.8 - .
1290+
1291+
## 2024-03-01 00:11:49
1292+
### Changes
1293+
Based on:
1294+
- OpenAPI Doc 0.4.0 https://docs.speakeasyapi.dev/openapi.yaml
1295+
- Speakeasy CLI 1.198.1 (2.275.4) https://github.com/speakeasy-api/speakeasy
1296+
### Generated
1297+
- [python v5.3.0] .
1298+
### Releases
1299+
- [PyPI v5.3.0] https://pypi.org/project/speakeasy-client-sdk-python/5.3.0 - .
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# GetAccessTokenRequest
2+
3+
4+
## Fields
5+
6+
| Field | Type | Required | Description |
7+
| ------------------ | ------------------ | ------------------ | ------------------ |
8+
| `workspace_id` | *str* | :heavy_check_mark: | The workspace ID |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# GetAccessTokenResponse
2+
3+
4+
## Fields
5+
6+
| Field | Type | Required | Description |
7+
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
8+
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation |
9+
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
10+
| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
11+
| `access_token` | [Optional[shared.AccessToken]](../../models/shared/accesstoken.md) | :heavy_minus_sign: | OK |
12+
| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Default error response |

docs/models/shared/accesstoken.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# AccessToken
2+
3+
An AccessToken is a token that can be used to authenticate with the Speakeasy API.
4+
5+
6+
## Fields
7+
8+
| Field | Type | Required | Description |
9+
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
10+
| `access_token` | *str* | :heavy_check_mark: | N/A |
11+
| `claims` | [shared.Claims](../../models/shared/claims.md) | :heavy_check_mark: | N/A |
12+
| `user` | [shared.User](../../models/shared/user.md) | :heavy_check_mark: | N/A |
13+
| `workspaces` | List[[shared.Workspaces](../../models/shared/workspaces.md)] | :heavy_minus_sign: | N/A |

docs/models/shared/claims.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Claims
2+
3+
4+
## Fields
5+
6+
| Field | Type | Required | Description |
7+
| ----------- | ----------- | ----------- | ----------- |

docs/models/shared/user.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# User
2+
3+
4+
## Fields
5+
6+
| Field | Type | Required | Description |
7+
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
8+
| `admin` | *Optional[bool]* | :heavy_minus_sign: | N/A |
9+
| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A |
10+
| `display_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
11+
| `email` | *Optional[str]* | :heavy_minus_sign: | N/A |
12+
| `email_verified` | *Optional[bool]* | :heavy_minus_sign: | N/A |
13+
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |

docs/models/shared/workspaces.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Workspaces
2+
3+
4+
## Fields
5+
6+
| Field | Type | Required | Description |
7+
| ----------- | ----------- | ----------- | ----------- |

docs/sdks/auth/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,51 @@ REST APIs for managing Authentication
77

88
### Available Operations
99

10+
* [get_access_token](#get_access_token) - Get or refresh an access token for the current workspace.
1011
* [get_workspace_access](#get_workspace_access) - Get access allowances for a particular workspace
1112
* [validate_api_key](#validate_api_key) - Validate the current api key.
1213

14+
## get_access_token
15+
16+
Get or refresh an access token for the current workspace.
17+
18+
### Example Usage
19+
20+
```python
21+
import speakeasy
22+
from speakeasy.models import operations
23+
24+
s = speakeasy.Speakeasy(
25+
workspace_id='<value>',
26+
)
27+
28+
req = operations.GetAccessTokenRequest(
29+
workspace_id='<value>',
30+
)
31+
32+
res = s.auth.get_access_token(req)
33+
34+
if res.access_token is not None:
35+
# handle response
36+
pass
37+
```
38+
39+
### Parameters
40+
41+
| Parameter | Type | Required | Description |
42+
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
43+
| `request` | [operations.GetAccessTokenRequest](../../models/operations/getaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. |
44+
45+
46+
### Response
47+
48+
**[operations.GetAccessTokenResponse](../../models/operations/getaccesstokenresponse.md)**
49+
### Errors
50+
51+
| Error Object | Status Code | Content Type |
52+
| --------------- | --------------- | --------------- |
53+
| errors.SDKError | 4x-5xx | */* |
54+
1355
## get_workspace_access
1456

1557
Checks if generation is permitted for a particular run of the CLI

gen.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ generation:
1010
auth:
1111
oAuth2ClientCredentialsEnabled: false
1212
python:
13-
version: 5.2.8
13+
version: 5.3.0
14+
additionalDependencies:
15+
dependencies: {}
16+
extraDependencies:
17+
dev: {}
1418
author: Speakeasy
1519
clientServerStatusCodesAsErrors: true
1620
description: Speakeasy API Client SDK for Python

pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ good-names=i,
180180
ex,
181181
Run,
182182
_,
183+
e,
183184
op,
184185
to,
185186
id

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name="speakeasy-client-sdk-python",
13-
version="5.2.8",
13+
version="5.3.0",
1414
author="Speakeasy",
1515
description="Speakeasy API Client SDK for Python",
1616
long_description=long_description,
@@ -19,9 +19,9 @@
1919
install_requires=[
2020
"certifi>=2023.7.22",
2121
"charset-normalizer>=3.2.0",
22-
"dataclasses-json-speakeasy>=0.5.11",
22+
"dataclasses-json>=0.6.4",
2323
"idna>=3.4",
24-
"jsonpath-python>=1.0.6 ",
24+
"jsonpath-python>=1.0.6",
2525
"marshmallow>=3.19.0",
2626
"mypy-extensions>=1.0.0",
2727
"packaging>=23.1",
@@ -33,7 +33,9 @@
3333
"urllib3>=1.26.18",
3434
],
3535
extras_require={
36-
"dev":["pylint==2.16.2"]
36+
"dev": [
37+
"pylint==2.16.2",
38+
],
3739
},
3840
package_dir={'': 'src'},
3941
python_requires='>=3.8',

src/speakeasy/_hooks/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+
3+
from .sdkhooks import *
4+
from .types import *
5+
from .registration import *

src/speakeasy/_hooks/registration.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from .types import Hooks
2+
3+
4+
# This file is only ever generated once on the first generation and then is free to be modified.
5+
# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them
6+
# in this file or in separate files in the hooks folder.
7+
8+
9+
def init_hooks(hooks: Hooks):
10+
# pylint: disable=unused-argument
11+
"""Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook
12+
with an instance of a hook that implements that specific Hook interface
13+
Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance"""

src/speakeasy/_hooks/sdkhooks.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+
3+
import requests
4+
from .types import SDKInitHook, BeforeRequestContext, BeforeRequestHook, AfterSuccessContext, AfterSuccessHook, AfterErrorContext, AfterErrorHook, Hooks
5+
from .registration import init_hooks
6+
from typing import List, Optional, Tuple, Union
7+
8+
9+
class SDKHooks(Hooks):
10+
sdk_init_hooks: List[SDKInitHook] = []
11+
before_request_hooks: List[BeforeRequestHook] = []
12+
after_success_hooks: List[AfterSuccessHook] = []
13+
after_error_hooks: List[AfterErrorHook] = []
14+
15+
def __init__(self):
16+
init_hooks(self)
17+
18+
def register_sdk_init_hook(self, hook: SDKInitHook) -> None:
19+
self.sdk_init_hooks.append(hook)
20+
21+
def register_before_request_hook(self, hook: BeforeRequestHook) -> None:
22+
self.before_request_hooks.append(hook)
23+
24+
def register_after_success_hook(self, hook: AfterSuccessHook) -> None:
25+
self.after_success_hooks.append(hook)
26+
27+
def register_after_error_hook(self, hook: AfterErrorHook) -> None:
28+
self.after_error_hooks.append(hook)
29+
30+
def sdk_init(self, base_url: str, client: requests.Session) -> Tuple[str, requests.Session]:
31+
for hook in self.sdk_init_hooks:
32+
base_url, client = hook.sdk_init(base_url, client)
33+
return base_url, client
34+
35+
def before_request(self, hook_ctx: BeforeRequestContext, request: requests.PreparedRequest) -> Union[requests.PreparedRequest, Exception]:
36+
for hook in self.before_request_hooks:
37+
request = hook.before_request(hook_ctx, request)
38+
if isinstance(request, Exception):
39+
raise request
40+
41+
return request
42+
43+
def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Response) -> requests.Response:
44+
for hook in self.after_success_hooks:
45+
response = hook.after_success(hook_ctx, response)
46+
if isinstance(response, Exception):
47+
raise response
48+
return response
49+
50+
def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests.Response], error: Optional[Exception]) -> Tuple[Optional[requests.Response], Optional[Exception]]:
51+
for hook in self.after_error_hooks:
52+
result = hook.after_error(hook_ctx, response, error)
53+
if isinstance(result, Exception):
54+
raise result
55+
response, error = result
56+
return response, error

0 commit comments

Comments
 (0)