-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Hallett
committed
Oct 25, 2023
1 parent
a01487f
commit 84f7d16
Showing
11 changed files
with
81 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from __future__ import annotations | ||
|
||
import inspect # noqa | ||
import typing # noqa | ||
import inspect | ||
import typing | ||
from enum import Enum # noqa | ||
from decimal import Decimal #noqa | ||
|
||
import pydantic # noqa | ||
import pydantic |
17 changes: 11 additions & 6 deletions
17
clientele/generators/standard/templates/sync_methods.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
|
||
|
||
def get(url: str, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP GET request """ | ||
"""Issue an HTTP GET request""" | ||
return client.get(parse_url(url), headers=headers) | ||
|
||
|
||
def post(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP POST request """ | ||
return client.post(parse_url(url), json=data, headers=headers) | ||
"""Issue an HTTP POST request""" | ||
json_data = json.dumps(data, default=json_serializer) | ||
return client.post(parse_url(url), json=json_data, headers=headers) | ||
|
||
|
||
def put(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP PUT request """ | ||
return client.put(parse_url(url), json=data, headers=headers) | ||
"""Issue an HTTP PUT request""" | ||
json_data = json.dumps(data, default=json_serializer) | ||
return client.put(parse_url(url), json=json_data, headers=headers) | ||
|
||
|
||
def delete(url: str, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP DELETE request """ | ||
"""Issue an HTTP DELETE request""" | ||
return client.delete(parse_url(url), headers=headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters