Initial commit
This commit is contained in:
1
garbage_api_client/api/__init__.py
Normal file
1
garbage_api_client/api/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
""" Contains methods for accessing the API """
|
0
garbage_api_client/api/default/__init__.py
Normal file
0
garbage_api_client/api/default/__init__.py
Normal file
@@ -0,0 +1,271 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.entry_find_locations_location_entries_get_garbage_type_type_0 import (
|
||||
EntryFindLocationsLocationEntriesGetGarbageTypeType0,
|
||||
)
|
||||
from ...models.search_results_collection_entry import SearchResultsCollectionEntry
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
location: int,
|
||||
*,
|
||||
garbage_type: Union[
|
||||
EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset
|
||||
] = UNSET,
|
||||
date_start: Union[Unset, str] = "2024-04-13T15:39:14.714927",
|
||||
date_end: Union[Unset, str] = "2024-05-13T15:39:14.714945",
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
|
||||
json_garbage_type: Union[None, Unset, int]
|
||||
if isinstance(garbage_type, Unset):
|
||||
json_garbage_type = UNSET
|
||||
elif isinstance(garbage_type, EntryFindLocationsLocationEntriesGetGarbageTypeType0):
|
||||
json_garbage_type = garbage_type.value
|
||||
else:
|
||||
json_garbage_type = garbage_type
|
||||
params["garbage_type"] = json_garbage_type
|
||||
|
||||
params["date_start"] = date_start
|
||||
|
||||
params["date_end"] = date_end
|
||||
|
||||
params["page"] = page
|
||||
|
||||
params["page_size"] = page_size
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: Dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/locations/{location}/entries".format(
|
||||
location=location,
|
||||
),
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, SearchResultsCollectionEntry]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = SearchResultsCollectionEntry.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = cast(Any, None)
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
||||
response_422 = cast(Any, None)
|
||||
return response_422
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, SearchResultsCollectionEntry]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
location: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
garbage_type: Union[
|
||||
EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset
|
||||
] = UNSET,
|
||||
date_start: Union[Unset, str] = "2024-04-13T15:39:14.714927",
|
||||
date_end: Union[Unset, str] = "2024-05-13T15:39:14.714945",
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
) -> Response[Union[Any, SearchResultsCollectionEntry]]:
|
||||
"""Entry Find
|
||||
|
||||
Find entries by date(s) or type
|
||||
|
||||
Args:
|
||||
location (int):
|
||||
garbage_type (Union[EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset]):
|
||||
date_start (Union[Unset, str]): Default: '2024-04-13T15:39:14.714927'.
|
||||
date_end (Union[Unset, str]): Default: '2024-05-13T15:39:14.714945'.
|
||||
page (Union[Unset, int]): Default: 1.
|
||||
page_size (Union[Unset, int]): Default: 100.
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, SearchResultsCollectionEntry]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
location=location,
|
||||
garbage_type=garbage_type,
|
||||
date_start=date_start,
|
||||
date_end=date_end,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
location: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
garbage_type: Union[
|
||||
EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset
|
||||
] = UNSET,
|
||||
date_start: Union[Unset, str] = "2024-04-13T15:39:14.714927",
|
||||
date_end: Union[Unset, str] = "2024-05-13T15:39:14.714945",
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
) -> Optional[Union[Any, SearchResultsCollectionEntry]]:
|
||||
"""Entry Find
|
||||
|
||||
Find entries by date(s) or type
|
||||
|
||||
Args:
|
||||
location (int):
|
||||
garbage_type (Union[EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset]):
|
||||
date_start (Union[Unset, str]): Default: '2024-04-13T15:39:14.714927'.
|
||||
date_end (Union[Unset, str]): Default: '2024-05-13T15:39:14.714945'.
|
||||
page (Union[Unset, int]): Default: 1.
|
||||
page_size (Union[Unset, int]): Default: 100.
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, SearchResultsCollectionEntry]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
location=location,
|
||||
client=client,
|
||||
garbage_type=garbage_type,
|
||||
date_start=date_start,
|
||||
date_end=date_end,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
location: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
garbage_type: Union[
|
||||
EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset
|
||||
] = UNSET,
|
||||
date_start: Union[Unset, str] = "2024-04-13T15:39:14.714927",
|
||||
date_end: Union[Unset, str] = "2024-05-13T15:39:14.714945",
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
) -> Response[Union[Any, SearchResultsCollectionEntry]]:
|
||||
"""Entry Find
|
||||
|
||||
Find entries by date(s) or type
|
||||
|
||||
Args:
|
||||
location (int):
|
||||
garbage_type (Union[EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset]):
|
||||
date_start (Union[Unset, str]): Default: '2024-04-13T15:39:14.714927'.
|
||||
date_end (Union[Unset, str]): Default: '2024-05-13T15:39:14.714945'.
|
||||
page (Union[Unset, int]): Default: 1.
|
||||
page_size (Union[Unset, int]): Default: 100.
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, SearchResultsCollectionEntry]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
location=location,
|
||||
garbage_type=garbage_type,
|
||||
date_start=date_start,
|
||||
date_end=date_end,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
location: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
garbage_type: Union[
|
||||
EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset
|
||||
] = UNSET,
|
||||
date_start: Union[Unset, str] = "2024-04-13T15:39:14.714927",
|
||||
date_end: Union[Unset, str] = "2024-05-13T15:39:14.714945",
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
) -> Optional[Union[Any, SearchResultsCollectionEntry]]:
|
||||
"""Entry Find
|
||||
|
||||
Find entries by date(s) or type
|
||||
|
||||
Args:
|
||||
location (int):
|
||||
garbage_type (Union[EntryFindLocationsLocationEntriesGetGarbageTypeType0, None, Unset]):
|
||||
date_start (Union[Unset, str]): Default: '2024-04-13T15:39:14.714927'.
|
||||
date_end (Union[Unset, str]): Default: '2024-05-13T15:39:14.714945'.
|
||||
page (Union[Unset, int]): Default: 1.
|
||||
page_size (Union[Unset, int]): Default: 100.
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, SearchResultsCollectionEntry]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
location=location,
|
||||
client=client,
|
||||
garbage_type=garbage_type,
|
||||
date_start=date_start,
|
||||
date_end=date_end,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
)
|
||||
).parsed
|
268
garbage_api_client/api/default/location_find_locations_get.py
Normal file
268
garbage_api_client/api/default/location_find_locations_get.py
Normal file
@@ -0,0 +1,268 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.search_results_location import SearchResultsLocation
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
q: Union[None, Unset, str] = UNSET,
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
lat: Union[None, Unset, float] = UNSET,
|
||||
lng: Union[None, Unset, float] = UNSET,
|
||||
radius: Union[None, Unset, int] = UNSET,
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
params: Dict[str, Any] = {}
|
||||
|
||||
json_q: Union[None, Unset, str]
|
||||
if isinstance(q, Unset):
|
||||
json_q = UNSET
|
||||
else:
|
||||
json_q = q
|
||||
params["q"] = json_q
|
||||
|
||||
params["page"] = page
|
||||
|
||||
params["page_size"] = page_size
|
||||
|
||||
json_lat: Union[None, Unset, float]
|
||||
if isinstance(lat, Unset):
|
||||
json_lat = UNSET
|
||||
else:
|
||||
json_lat = lat
|
||||
params["lat"] = json_lat
|
||||
|
||||
json_lng: Union[None, Unset, float]
|
||||
if isinstance(lng, Unset):
|
||||
json_lng = UNSET
|
||||
else:
|
||||
json_lng = lng
|
||||
params["lng"] = json_lng
|
||||
|
||||
json_radius: Union[None, Unset, int]
|
||||
if isinstance(radius, Unset):
|
||||
json_radius = UNSET
|
||||
else:
|
||||
json_radius = radius
|
||||
params["radius"] = json_radius
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: Dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/locations",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, SearchResultsLocation]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = SearchResultsLocation.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||
response_400 = cast(Any, None)
|
||||
return response_400
|
||||
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
||||
response_422 = cast(Any, None)
|
||||
return response_422
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, SearchResultsLocation]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
q: Union[None, Unset, str] = UNSET,
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
lat: Union[None, Unset, float] = UNSET,
|
||||
lng: Union[None, Unset, float] = UNSET,
|
||||
radius: Union[None, Unset, int] = UNSET,
|
||||
) -> Response[Union[Any, SearchResultsLocation]]:
|
||||
"""Location Find
|
||||
|
||||
Find a location by name or coordinates
|
||||
|
||||
Args:
|
||||
q (Union[None, Unset, str]):
|
||||
page (Union[Unset, int]): Default: 1.
|
||||
page_size (Union[Unset, int]): Default: 100.
|
||||
lat (Union[None, Unset, float]):
|
||||
lng (Union[None, Unset, float]):
|
||||
radius (Union[None, Unset, int]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, SearchResultsLocation]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
q=q,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
lat=lat,
|
||||
lng=lng,
|
||||
radius=radius,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
q: Union[None, Unset, str] = UNSET,
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
lat: Union[None, Unset, float] = UNSET,
|
||||
lng: Union[None, Unset, float] = UNSET,
|
||||
radius: Union[None, Unset, int] = UNSET,
|
||||
) -> Optional[Union[Any, SearchResultsLocation]]:
|
||||
"""Location Find
|
||||
|
||||
Find a location by name or coordinates
|
||||
|
||||
Args:
|
||||
q (Union[None, Unset, str]):
|
||||
page (Union[Unset, int]): Default: 1.
|
||||
page_size (Union[Unset, int]): Default: 100.
|
||||
lat (Union[None, Unset, float]):
|
||||
lng (Union[None, Unset, float]):
|
||||
radius (Union[None, Unset, int]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, SearchResultsLocation]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
q=q,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
lat=lat,
|
||||
lng=lng,
|
||||
radius=radius,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
q: Union[None, Unset, str] = UNSET,
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
lat: Union[None, Unset, float] = UNSET,
|
||||
lng: Union[None, Unset, float] = UNSET,
|
||||
radius: Union[None, Unset, int] = UNSET,
|
||||
) -> Response[Union[Any, SearchResultsLocation]]:
|
||||
"""Location Find
|
||||
|
||||
Find a location by name or coordinates
|
||||
|
||||
Args:
|
||||
q (Union[None, Unset, str]):
|
||||
page (Union[Unset, int]): Default: 1.
|
||||
page_size (Union[Unset, int]): Default: 100.
|
||||
lat (Union[None, Unset, float]):
|
||||
lng (Union[None, Unset, float]):
|
||||
radius (Union[None, Unset, int]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, SearchResultsLocation]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
q=q,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
lat=lat,
|
||||
lng=lng,
|
||||
radius=radius,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
q: Union[None, Unset, str] = UNSET,
|
||||
page: Union[Unset, int] = 1,
|
||||
page_size: Union[Unset, int] = 100,
|
||||
lat: Union[None, Unset, float] = UNSET,
|
||||
lng: Union[None, Unset, float] = UNSET,
|
||||
radius: Union[None, Unset, int] = UNSET,
|
||||
) -> Optional[Union[Any, SearchResultsLocation]]:
|
||||
"""Location Find
|
||||
|
||||
Find a location by name or coordinates
|
||||
|
||||
Args:
|
||||
q (Union[None, Unset, str]):
|
||||
page (Union[Unset, int]): Default: 1.
|
||||
page_size (Union[Unset, int]): Default: 100.
|
||||
lat (Union[None, Unset, float]):
|
||||
lng (Union[None, Unset, float]):
|
||||
radius (Union[None, Unset, int]):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, SearchResultsLocation]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
q=q,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
lat=lat,
|
||||
lng=lng,
|
||||
radius=radius,
|
||||
)
|
||||
).parsed
|
169
garbage_api_client/api/default/location_get_locations_id_get.py
Normal file
169
garbage_api_client/api/default/location_get_locations_id_get.py
Normal file
@@ -0,0 +1,169 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.http_validation_error import HTTPValidationError
|
||||
from ...models.location import Location
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
_kwargs: Dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": "/locations/{id}".format(
|
||||
id=id,
|
||||
),
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, HTTPValidationError, Location]]:
|
||||
if response.status_code == HTTPStatus.OK:
|
||||
response_200 = Location.from_dict(response.json())
|
||||
|
||||
return response_200
|
||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||
response_404 = cast(Any, None)
|
||||
return response_404
|
||||
if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
|
||||
response_422 = HTTPValidationError.from_dict(response.json())
|
||||
|
||||
return response_422
|
||||
if client.raise_on_unexpected_status:
|
||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Response[Union[Any, HTTPValidationError, Location]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, HTTPValidationError, Location]]:
|
||||
"""Location Get
|
||||
|
||||
Get a location by id
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, HTTPValidationError, Location]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, HTTPValidationError, Location]]:
|
||||
"""Location Get
|
||||
|
||||
Get a location by id
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, HTTPValidationError, Location]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Response[Union[Any, HTTPValidationError, Location]]:
|
||||
"""Location Get
|
||||
|
||||
Get a location by id
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Response[Union[Any, HTTPValidationError, Location]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: Union[AuthenticatedClient, Client],
|
||||
) -> Optional[Union[Any, HTTPValidationError, Location]]:
|
||||
"""Location Get
|
||||
|
||||
Get a location by id
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
Raises:
|
||||
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||
|
||||
Returns:
|
||||
Union[Any, HTTPValidationError, Location]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
Reference in New Issue
Block a user