From 8d97a4b957a54c1de6c8cfdbebb5675858ecd6e2 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 9 Nov 2023 01:16:13 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.116.0 --- README.md | 32 +++++++++++++++++++++++++++++--- RELEASES.md | 10 +++++++++- docs/sdks/pets/README.md | 14 +++++++++++++- gen.yaml | 10 ++++++---- setup.py | 2 +- src/test/pets.py | 3 +++ src/test/sdk.py | 4 +--- src/test/sdkconfiguration.py | 7 +++---- 8 files changed, 65 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3e51f31..610cf08 100755 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ if res.status_code == 200: ## Available Resources and Operations -### [.pets](docs/sdks/pets/README.md) +### [pets](docs/sdks/pets/README.md) * [create_pets](docs/sdks/pets/README.md#create_pets) - Create a pet * [list_pets](docs/sdks/pets/README.md#list_pets) - List all pets @@ -58,7 +58,33 @@ Here's an example of one such pagination call: # Error Handling -Handling errors in your SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. + +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 400-600 | */* | + + +## Example + +```python +import test + +s = test.Test() + + +res = None +try: + res = s.pets.create_pets() + +except (errors.SDKError) as e: + print(e) # handle exception + + +if res.status_code == 200: + # handle response + pass +``` @@ -120,7 +146,7 @@ if res.status_code == 200: 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 your sdk makes as follows: +For example, you could specify a header for every request that this sdk makes as follows: ```python import test diff --git a/RELEASES.md b/RELEASES.md index 3e51071..a15e869 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -182,4 +182,12 @@ Based on: - OpenAPI Doc 1.0.0 - Speakeasy CLI 1.114.1 (2.181.1) https://github.com/speakeasy-api/speakeasy ### Generated -- [python v0.10.0] . \ No newline at end of file +- [python v0.10.0] . + +## 2023-11-09 01:15:58 +### Changes +Based on: +- OpenAPI Doc 1.0.0 +- Speakeasy CLI 1.116.0 (2.185.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.10.1] . \ No newline at end of file diff --git a/docs/sdks/pets/README.md b/docs/sdks/pets/README.md index 6cfd398..059b1af 100755 --- a/docs/sdks/pets/README.md +++ b/docs/sdks/pets/README.md @@ -1,5 +1,5 @@ # Pets -(*.pets*) +(*pets*) ### Available Operations @@ -30,7 +30,11 @@ if res.status_code == 200: ### Response **[operations.CreatePetsResponse](../../models/operations/createpetsresponse.md)** +### Errors +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 400-600 | */* | ## list_pets @@ -63,7 +67,11 @@ if res.pets is not None: ### Response **[operations.ListPetsResponse](../../models/operations/listpetsresponse.md)** +### Errors +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 400-600 | */* | ## show_pet_by_id @@ -98,4 +106,8 @@ if res.pet is not None: ### Response **[operations.ShowPetByIDResponse](../../models/operations/showpetbyidresponse.md)** +### Errors +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 400-600 | */* | diff --git a/gen.yaml b/gen.yaml index c474b37..57b7574 100644 --- a/gen.yaml +++ b/gen.yaml @@ -2,18 +2,18 @@ configVersion: 1.0.0 management: docChecksum: 2516596125ef223fbbef6c434d22eaac docVersion: 1.0.0 - speakeasyVersion: 1.114.1 - generationVersion: 2.181.1 + speakeasyVersion: 1.116.0 + generationVersion: 2.185.0 generation: comments: {} sdkClassName: test repoURL: https://github.com/speakeasy-sdks/test-repo-test2.git features: python: - core: 4.1.0 + core: 4.1.2 globalServerURLs: 2.82.0 python: - version: 0.10.0 + version: 0.10.1 author: my-test clientServerStatusCodesAsErrors: true description: Python Client SDK Generated by Speakeasy @@ -26,7 +26,9 @@ python: operations: models/operations shared: models/shared webhooks: models/webhooks + inputModelSuffix: input installationURL: https://github.com/speakeasy-sdks/test-repo-test2.git maxMethodParams: 0 + outputModelSuffix: output packageName: test repoSubDirectory: . diff --git a/setup.py b/setup.py index 4581758..c5e9e8c 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="test", - version="0.10.0", + version="0.10.1", author="my-test", description="Python Client SDK Generated by Speakeasy", long_description=long_description, diff --git a/src/test/pets.py b/src/test/pets.py index 38f04a8..c854a33 100755 --- a/src/test/pets.py +++ b/src/test/pets.py @@ -12,6 +12,7 @@ def __init__(self, sdk_config: SDKConfiguration) -> None: self.sdk_configuration = sdk_config + def create_pets(self) -> operations.CreatePetsResponse: r"""Create a pet""" base_url = utils.template_url(*self.sdk_configuration.get_server_details()) @@ -42,6 +43,7 @@ def create_pets(self) -> operations.CreatePetsResponse: return res + def list_pets(self, request: operations.ListPetsRequest) -> operations.ListPetsResponse: r"""List all pets""" base_url = utils.template_url(*self.sdk_configuration.get_server_details()) @@ -79,6 +81,7 @@ def list_pets(self, request: operations.ListPetsRequest) -> operations.ListPetsR return res + def show_pet_by_id(self, request: operations.ShowPetByIDRequest) -> operations.ShowPetByIDResponse: r"""Info for a specific pet""" base_url = utils.template_url(*self.sdk_configuration.get_server_details()) diff --git a/src/test/sdk.py b/src/test/sdk.py index 6f0186c..39cac9f 100755 --- a/src/test/sdk.py +++ b/src/test/sdk.py @@ -34,13 +34,11 @@ def __init__(self, if client is None: client = requests_http.Session() - security_client = client - if server_url is not None: if url_params is not None: server_url = utils.template_url(server_url, url_params) - self.sdk_configuration = SDKConfiguration(client, security_client, server_url, server_idx, retry_config=retry_config) + self.sdk_configuration = SDKConfiguration(client, None, server_url, server_idx, retry_config=retry_config) self._init_sdks() diff --git a/src/test/sdkconfiguration.py b/src/test/sdkconfiguration.py index 3175500..9c4f870 100755 --- a/src/test/sdkconfiguration.py +++ b/src/test/sdkconfiguration.py @@ -15,14 +15,13 @@ @dataclass class SDKConfiguration: client: requests.Session - security_client: requests.Session server_url: str = '' server_idx: int = 0 language: str = 'python' openapi_doc_version: str = '1.0.0' - sdk_version: str = '0.10.0' - gen_version: str = '2.181.1' - user_agent: str = 'speakeasy-sdk/python 0.10.0 2.181.1 1.0.0 test' + sdk_version: str = '0.10.1' + gen_version: str = '2.185.0' + user_agent: str = 'speakeasy-sdk/python 0.10.1 2.185.0 1.0.0 test' retry_config: RetryConfig = None def get_server_details(self) -> Tuple[str, Dict[str, str]]: