Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.204.1
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Mar 8, 2024
1 parent 5ee9010 commit 4d15283
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 102 deletions.
12 changes: 7 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ id: 45d697d3-6c8d-4d6e-8825-3af8be149b31
management:
docChecksum: 2516596125ef223fbbef6c434d22eaac
docVersion: 1.0.0
speakeasyVersion: internal
generationVersion: 2.275.4
releaseVersion: 0.14.0
configChecksum: 3094cf1ed617220ed856b216803e40c9
speakeasyVersion: 1.204.1
generationVersion: 2.279.1
releaseVersion: 0.15.0
configChecksum: e98e35505f2d6906edfeade8cc7d4974
repoURL: https://github.com/speakeasy-sdks/test-repo-test2.git
repoSubDirectory: .
installationURL: https://github.com/speakeasy-sdks/test-repo-test2.git
features:
python:
core: 4.5.0
core: 4.5.1
globalServerURLs: 2.82.1
responseFormat: 0.1.0
generatedFiles:
- src/test/sdkconfiguration.py
- src/test/pets.py
- src/test/sdk.py
- py.typed
- pylintrc
- setup.py
- src/test/__init__.py
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ s = test.Test()

res = s.pets.create_pets()

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

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

Expand Down Expand Up @@ -68,9 +69,10 @@ except errors.SDKError as e:
# handle exception
raise(e)

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

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

Expand Down Expand Up @@ -99,9 +101,10 @@ s = test.Test(

res = s.pets.create_pets()

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

```


Expand All @@ -118,9 +121,10 @@ s = test.Test(

res = s.pets.create_pets()

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

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

Expand Down
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,12 @@ Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.198.1 (2.275.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.14.0] .
- [python v0.14.0] .

## 2024-03-08 01:07:18
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.204.1 (2.279.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.15.0] .
3 changes: 2 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ s = test.Test()

res = s.pets.create_pets()

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

```
<!-- End SDK Example Usage [usage] -->
5 changes: 4 additions & 1 deletion docs/sdks/pets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ s = test.Test()

res = s.pets.create_pets()

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

```


Expand Down Expand Up @@ -55,6 +56,7 @@ res = s.pets.list_pets(req)
if res.pets is not None:
# handle response
pass

```

### Parameters
Expand Down Expand Up @@ -94,6 +96,7 @@ res = s.pets.show_pet_by_id(req)
if res.pet is not None:
# handle response
pass

```

### Parameters
Expand Down
3 changes: 2 additions & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
python:
version: 0.14.0
version: 0.15.0
additionalDependencies:
dependencies: {}
extraDependencies:
Expand All @@ -31,3 +31,4 @@ python:
maxMethodParams: 0
outputModelSuffix: output
packageName: test
responseFormat: envelope
1 change: 1 addition & 0 deletions py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Marker file for PEP 561. The package enables type hints.
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.14.0",
version="0.15.0",
author="my-test",
description="Python Client SDK Generated by Speakeasy",
long_description=long_description,
Expand Down
10 changes: 4 additions & 6 deletions src/test/_hooks/sdkhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@


class SDKHooks(Hooks):
sdk_init_hooks: List[SDKInitHook] = []
before_request_hooks: List[BeforeRequestHook] = []
after_success_hooks: List[AfterSuccessHook] = []
after_error_hooks: List[AfterErrorHook] = []

def __init__(self):
pass
self.sdk_init_hooks: List[SDKInitHook] = []
self.before_request_hooks: List[BeforeRequestHook] = []
self.after_success_hooks: List[AfterSuccessHook] = []
self.after_error_hooks: List[AfterErrorHook] = []

def register_sdk_init_hook(self, hook: SDKInitHook) -> None:
self.sdk_init_hooks.append(hook)
Expand Down
39 changes: 21 additions & 18 deletions src/test/pets.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def create_pets(self) -> operations.CreatePetsResponse:
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = base_url + '/pets'

headers = {}

headers['Accept'] = 'application/json'
headers['user-agent'] = self.sdk_configuration.user_agent

client = self.sdk_configuration.client


try:
req = self.sdk_configuration.get_hooks().before_request(
hook_ctx,
Expand All @@ -48,19 +48,19 @@ def create_pets(self) -> operations.CreatePetsResponse:
raise result
http_res = result

content_type = http_res.headers.get('Content-Type')

res = operations.CreatePetsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
res = operations.CreatePetsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type'), raw_response=http_res)

if http_res.status_code == 201:
pass
elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
else:
if utils.match_content_type(content_type, 'application/json'):
if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[shared.Error])
res.error = out
else:
content_type = http_res.headers.get('Content-Type')
raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res)

return res
Expand All @@ -73,14 +73,15 @@ def list_pets(self, request: operations.ListPetsRequest) -> operations.ListPetsR
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = base_url + '/pets'

headers = {}
query_params = utils.get_query_params(operations.ListPetsRequest, request)
query_params = {}

query_params = { **utils.get_query_params(operations.ListPetsRequest, request), **query_params }
headers['Accept'] = 'application/json'
headers['user-agent'] = self.sdk_configuration.user_agent

client = self.sdk_configuration.client


try:
req = self.sdk_configuration.get_hooks().before_request(
hook_ctx,
Expand All @@ -101,25 +102,26 @@ def list_pets(self, request: operations.ListPetsRequest) -> operations.ListPetsR
raise result
http_res = result

content_type = http_res.headers.get('Content-Type')

res = operations.ListPetsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res, headers=None)
res = operations.ListPetsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type'), raw_response=http_res, headers=None)

if http_res.status_code == 200:
res.headers = http_res.headers

if utils.match_content_type(content_type, 'application/json'):
if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[List[shared.Pet]])
res.pets = out
else:
content_type = http_res.headers.get('Content-Type')
raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res)
elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
else:
if utils.match_content_type(content_type, 'application/json'):
if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[shared.Error])
res.error = out
else:
content_type = http_res.headers.get('Content-Type')
raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res)

return res
Expand All @@ -132,13 +134,13 @@ def show_pet_by_id(self, request: operations.ShowPetByIDRequest) -> operations.S
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = utils.generate_url(operations.ShowPetByIDRequest, base_url, '/pets/{petId}', request)

headers = {}

headers['Accept'] = 'application/json'
headers['user-agent'] = self.sdk_configuration.user_agent

client = self.sdk_configuration.client


try:
req = self.sdk_configuration.get_hooks().before_request(
hook_ctx,
Expand All @@ -159,23 +161,24 @@ def show_pet_by_id(self, request: operations.ShowPetByIDRequest) -> operations.S
raise result
http_res = result

content_type = http_res.headers.get('Content-Type')

res = operations.ShowPetByIDResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
res = operations.ShowPetByIDResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type'), raw_response=http_res)

if http_res.status_code == 200:
if utils.match_content_type(content_type, 'application/json'):
if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[shared.Pet])
res.pet = out
else:
content_type = http_res.headers.get('Content-Type')
raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res)
elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
else:
if utils.match_content_type(content_type, 'application/json'):
if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[shared.Error])
res.error = out
else:
content_type = http_res.headers.get('Content-Type')
raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res)

return res
Expand Down
6 changes: 3 additions & 3 deletions src/test/sdkconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class SDKConfiguration:
server_idx: int = 0
language: str = 'python'
openapi_doc_version: str = '1.0.0'
sdk_version: str = '0.14.0'
gen_version: str = '2.275.4'
user_agent: str = 'speakeasy-sdk/python 0.14.0 2.275.4 1.0.0 test'
sdk_version: str = '0.15.0'
gen_version: str = '2.279.1'
user_agent: str = 'speakeasy-sdk/python 0.15.0 2.279.1 1.0.0 test'
retry_config: RetryConfig = None
_hooks: SDKHooks = None

Expand Down
Loading

0 comments on commit 4d15283

Please sign in to comment.