-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
1,763 changed files
with
91,904 additions
and
91,770 deletions.
There are no files selected for viewing
94 changes: 0 additions & 94 deletions
94
rentman_api_client/api/accessories/accessoire_collection_get.py
This file was deleted.
Oops, something went wrong.
103 changes: 0 additions & 103 deletions
103
rentman_api_client/api/accessories/accessoire_item_get.py
This file was deleted.
Oops, something went wrong.
94 changes: 94 additions & 0 deletions
94
rentman_api_client/api/accessories/accessory_collection_get.py
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
from typing import Any, Dict, Optional | ||
|
||
import httpx | ||
|
||
from ...client import Client | ||
from ...models.accessory_collectionget_response_schema import AccessoryCollectiongetResponseSchema | ||
from ...types import Response | ||
|
||
|
||
def _get_kwargs( | ||
*, | ||
client: Client, | ||
) -> Dict[str, Any]: | ||
url = "{}/accessories".format(client.base_url) | ||
|
||
headers: Dict[str, Any] = client.get_headers() | ||
cookies: Dict[str, Any] = client.get_cookies() | ||
|
||
return { | ||
"url": url, | ||
"headers": headers, | ||
"cookies": cookies, | ||
"timeout": client.get_timeout(), | ||
} | ||
|
||
|
||
def _parse_response(*, response: httpx.Response) -> Optional[AccessoryCollectiongetResponseSchema]: | ||
if response.status_code == 200: | ||
response_200 = AccessoryCollectiongetResponseSchema.from_dict(response.json()) | ||
|
||
return response_200 | ||
return None | ||
|
||
|
||
def _build_response(*, response: httpx.Response) -> Response[AccessoryCollectiongetResponseSchema]: | ||
return Response( | ||
status_code=response.status_code, | ||
content=response.content, | ||
headers=response.headers, | ||
parsed=_parse_response(response=response), | ||
) | ||
|
||
|
||
def sync_detailed( | ||
*, | ||
client: Client, | ||
) -> Response[AccessoryCollectiongetResponseSchema]: | ||
kwargs = _get_kwargs( | ||
client=client, | ||
) | ||
|
||
response = httpx.get( | ||
**kwargs, | ||
) | ||
|
||
return _build_response(response=response) | ||
|
||
|
||
def sync( | ||
*, | ||
client: Client, | ||
) -> Optional[AccessoryCollectiongetResponseSchema]: | ||
""" """ | ||
|
||
return sync_detailed( | ||
client=client, | ||
).parsed | ||
|
||
|
||
async def asyncio_detailed( | ||
*, | ||
client: Client, | ||
) -> Response[AccessoryCollectiongetResponseSchema]: | ||
kwargs = _get_kwargs( | ||
client=client, | ||
) | ||
|
||
async with httpx.AsyncClient() as _client: | ||
response = await _client.get(**kwargs) | ||
|
||
return _build_response(response=response) | ||
|
||
|
||
async def asyncio( | ||
*, | ||
client: Client, | ||
) -> Optional[AccessoryCollectiongetResponseSchema]: | ||
""" """ | ||
|
||
return ( | ||
await asyncio_detailed( | ||
client=client, | ||
) | ||
).parsed |
103 changes: 103 additions & 0 deletions
103
rentman_api_client/api/accessories/accessory_item_get.py
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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
from typing import Any, Dict, Optional | ||
|
||
import httpx | ||
|
||
from ...client import Client | ||
from ...models.accessory_itemget_response_schema import AccessoryItemgetResponseSchema | ||
from ...types import Response | ||
|
||
|
||
def _get_kwargs( | ||
*, | ||
client: Client, | ||
id: int, | ||
) -> Dict[str, Any]: | ||
url = "{}/accessories/{id}".format(client.base_url, id=id) | ||
|
||
headers: Dict[str, Any] = client.get_headers() | ||
cookies: Dict[str, Any] = client.get_cookies() | ||
|
||
return { | ||
"url": url, | ||
"headers": headers, | ||
"cookies": cookies, | ||
"timeout": client.get_timeout(), | ||
} | ||
|
||
|
||
def _parse_response(*, response: httpx.Response) -> Optional[AccessoryItemgetResponseSchema]: | ||
if response.status_code == 200: | ||
response_200 = AccessoryItemgetResponseSchema.from_dict(response.json()) | ||
|
||
return response_200 | ||
return None | ||
|
||
|
||
def _build_response(*, response: httpx.Response) -> Response[AccessoryItemgetResponseSchema]: | ||
return Response( | ||
status_code=response.status_code, | ||
content=response.content, | ||
headers=response.headers, | ||
parsed=_parse_response(response=response), | ||
) | ||
|
||
|
||
def sync_detailed( | ||
*, | ||
client: Client, | ||
id: int, | ||
) -> Response[AccessoryItemgetResponseSchema]: | ||
kwargs = _get_kwargs( | ||
client=client, | ||
id=id, | ||
) | ||
|
||
response = httpx.get( | ||
**kwargs, | ||
) | ||
|
||
return _build_response(response=response) | ||
|
||
|
||
def sync( | ||
*, | ||
client: Client, | ||
id: int, | ||
) -> Optional[AccessoryItemgetResponseSchema]: | ||
""" """ | ||
|
||
return sync_detailed( | ||
client=client, | ||
id=id, | ||
).parsed | ||
|
||
|
||
async def asyncio_detailed( | ||
*, | ||
client: Client, | ||
id: int, | ||
) -> Response[AccessoryItemgetResponseSchema]: | ||
kwargs = _get_kwargs( | ||
client=client, | ||
id=id, | ||
) | ||
|
||
async with httpx.AsyncClient() as _client: | ||
response = await _client.get(**kwargs) | ||
|
||
return _build_response(response=response) | ||
|
||
|
||
async def asyncio( | ||
*, | ||
client: Client, | ||
id: int, | ||
) -> Optional[AccessoryItemgetResponseSchema]: | ||
""" """ | ||
|
||
return ( | ||
await asyncio_detailed( | ||
client=client, | ||
id=id, | ||
) | ||
).parsed |
Oops, something went wrong.