Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.116.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Nov 9, 2023
1 parent 023c905 commit 8d97a4b
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 17 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -58,7 +58,33 @@ Here's an example of one such pagination call:
<!-- Start Error Handling -->
# 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
```
<!-- End Error Handling -->


Expand Down Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] .
- [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] .
14 changes: 13 additions & 1 deletion docs/sdks/pets/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Pets
(*.pets*)
(*pets*)

### Available Operations

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 | */* |
10 changes: 6 additions & 4 deletions gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: .
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/test/pets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 1 addition & 3 deletions src/test/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
7 changes: 3 additions & 4 deletions src/test/sdkconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]:
Expand Down

0 comments on commit 8d97a4b

Please sign in to comment.