Compare commits
No commits in common. "master" and "v0.1" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -21,4 +21,3 @@ dmypy.json
|
|||||||
|
|
||||||
/coverage.xml
|
/coverage.xml
|
||||||
/.coverage
|
/.coverage
|
||||||
.vscode
|
|
@ -34,7 +34,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +54,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -124,7 +123,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Album, Any, HTTPValidationError]
|
Response[Union[Album, Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -187,7 +186,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Album, Any, HTTPValidationError]
|
Response[Union[Album, Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -25,7 +25,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -105,7 +104,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -162,7 +161,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -31,7 +31,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ def _parse_response(
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -114,7 +113,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[HTTPValidationError, SearchResultsAlbum]
|
Response[Union[HTTPValidationError, SearchResultsAlbum]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -171,7 +170,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[HTTPValidationError, SearchResultsAlbum]
|
Response[Union[HTTPValidationError, SearchResultsAlbum]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -38,7 +38,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ def _parse_response(
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -142,7 +141,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[AlbumModified, Any, HTTPValidationError]
|
Response[Union[AlbumModified, Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -217,7 +216,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[AlbumModified, Any, HTTPValidationError]
|
Response[Union[AlbumModified, Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -38,7 +38,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ def _parse_response(
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -142,7 +141,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[AlbumModified, Any, HTTPValidationError]
|
Response[Union[AlbumModified, Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -217,7 +216,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[AlbumModified, Any, HTTPValidationError]
|
Response[Union[AlbumModified, Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -27,7 +27,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"data": form_data.to_dict(),
|
"data": form_data.to_dict(),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +44,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -99,7 +98,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, Token]
|
Response[Union[Any, HTTPValidationError, Token]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -146,7 +145,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, Token]
|
Response[Union[Any, HTTPValidationError, Token]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -25,7 +25,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -105,7 +104,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -162,7 +161,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -15,7 +15,6 @@ def _get_kwargs(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
lat: Union[Unset, None, float] = UNSET,
|
lat: Union[Unset, None, float] = UNSET,
|
||||||
@ -32,8 +31,6 @@ def _get_kwargs(
|
|||||||
|
|
||||||
params["caption"] = caption
|
params["caption"] = caption
|
||||||
|
|
||||||
params["token"] = token
|
|
||||||
|
|
||||||
params["page"] = page
|
params["page"] = page
|
||||||
|
|
||||||
params["page_size"] = page_size
|
params["page_size"] = page_size
|
||||||
@ -52,7 +49,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,9 +61,6 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||||
response_400 = cast(Any, None)
|
response_400 = cast(Any, None)
|
||||||
return response_400
|
return response_400
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = cast(Any, None)
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||||
response_404 = cast(Any, None)
|
response_404 = cast(Any, None)
|
||||||
return response_404
|
return response_404
|
||||||
@ -75,7 +68,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
response_422 = cast(Any, None)
|
response_422 = cast(Any, None)
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -95,7 +88,6 @@ def sync_detailed(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
lat: Union[Unset, None, float] = UNSET,
|
lat: Union[Unset, None, float] = UNSET,
|
||||||
@ -104,13 +96,12 @@ def sync_detailed(
|
|||||||
) -> Response[Union[Any, SearchResultsPhoto]]:
|
) -> Response[Union[Any, SearchResultsPhoto]]:
|
||||||
"""Photo Find
|
"""Photo Find
|
||||||
|
|
||||||
Find a photo by filename, caption, location or token
|
Find a photo by filename
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
album (str):
|
album (str):
|
||||||
q (Union[Unset, None, str]):
|
q (Union[Unset, None, str]):
|
||||||
caption (Union[Unset, None, str]):
|
caption (Union[Unset, None, str]):
|
||||||
token (Union[Unset, None, str]):
|
|
||||||
page (Union[Unset, None, int]): Default: 1.
|
page (Union[Unset, None, int]): Default: 1.
|
||||||
page_size (Union[Unset, None, int]): Default: 100.
|
page_size (Union[Unset, None, int]): Default: 100.
|
||||||
lat (Union[Unset, None, float]):
|
lat (Union[Unset, None, float]):
|
||||||
@ -130,7 +121,6 @@ def sync_detailed(
|
|||||||
client=client,
|
client=client,
|
||||||
q=q,
|
q=q,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
token=token,
|
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
lat=lat,
|
lat=lat,
|
||||||
@ -152,7 +142,6 @@ def sync(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
lat: Union[Unset, None, float] = UNSET,
|
lat: Union[Unset, None, float] = UNSET,
|
||||||
@ -161,13 +150,12 @@ def sync(
|
|||||||
) -> Optional[Union[Any, SearchResultsPhoto]]:
|
) -> Optional[Union[Any, SearchResultsPhoto]]:
|
||||||
"""Photo Find
|
"""Photo Find
|
||||||
|
|
||||||
Find a photo by filename, caption, location or token
|
Find a photo by filename
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
album (str):
|
album (str):
|
||||||
q (Union[Unset, None, str]):
|
q (Union[Unset, None, str]):
|
||||||
caption (Union[Unset, None, str]):
|
caption (Union[Unset, None, str]):
|
||||||
token (Union[Unset, None, str]):
|
|
||||||
page (Union[Unset, None, int]): Default: 1.
|
page (Union[Unset, None, int]): Default: 1.
|
||||||
page_size (Union[Unset, None, int]): Default: 100.
|
page_size (Union[Unset, None, int]): Default: 100.
|
||||||
lat (Union[Unset, None, float]):
|
lat (Union[Unset, None, float]):
|
||||||
@ -179,7 +167,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, SearchResultsPhoto]
|
Response[Union[Any, SearchResultsPhoto]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -187,7 +175,6 @@ def sync(
|
|||||||
client=client,
|
client=client,
|
||||||
q=q,
|
q=q,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
token=token,
|
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
lat=lat,
|
lat=lat,
|
||||||
@ -202,7 +189,6 @@ async def asyncio_detailed(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
lat: Union[Unset, None, float] = UNSET,
|
lat: Union[Unset, None, float] = UNSET,
|
||||||
@ -211,13 +197,12 @@ async def asyncio_detailed(
|
|||||||
) -> Response[Union[Any, SearchResultsPhoto]]:
|
) -> Response[Union[Any, SearchResultsPhoto]]:
|
||||||
"""Photo Find
|
"""Photo Find
|
||||||
|
|
||||||
Find a photo by filename, caption, location or token
|
Find a photo by filename
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
album (str):
|
album (str):
|
||||||
q (Union[Unset, None, str]):
|
q (Union[Unset, None, str]):
|
||||||
caption (Union[Unset, None, str]):
|
caption (Union[Unset, None, str]):
|
||||||
token (Union[Unset, None, str]):
|
|
||||||
page (Union[Unset, None, int]): Default: 1.
|
page (Union[Unset, None, int]): Default: 1.
|
||||||
page_size (Union[Unset, None, int]): Default: 100.
|
page_size (Union[Unset, None, int]): Default: 100.
|
||||||
lat (Union[Unset, None, float]):
|
lat (Union[Unset, None, float]):
|
||||||
@ -237,7 +222,6 @@ async def asyncio_detailed(
|
|||||||
client=client,
|
client=client,
|
||||||
q=q,
|
q=q,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
token=token,
|
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
lat=lat,
|
lat=lat,
|
||||||
@ -257,7 +241,6 @@ async def asyncio(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
lat: Union[Unset, None, float] = UNSET,
|
lat: Union[Unset, None, float] = UNSET,
|
||||||
@ -266,13 +249,12 @@ async def asyncio(
|
|||||||
) -> Optional[Union[Any, SearchResultsPhoto]]:
|
) -> Optional[Union[Any, SearchResultsPhoto]]:
|
||||||
"""Photo Find
|
"""Photo Find
|
||||||
|
|
||||||
Find a photo by filename, caption, location or token
|
Find a photo by filename
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
album (str):
|
album (str):
|
||||||
q (Union[Unset, None, str]):
|
q (Union[Unset, None, str]):
|
||||||
caption (Union[Unset, None, str]):
|
caption (Union[Unset, None, str]):
|
||||||
token (Union[Unset, None, str]):
|
|
||||||
page (Union[Unset, None, int]): Default: 1.
|
page (Union[Unset, None, int]): Default: 1.
|
||||||
page_size (Union[Unset, None, int]): Default: 100.
|
page_size (Union[Unset, None, int]): Default: 100.
|
||||||
lat (Union[Unset, None, float]):
|
lat (Union[Unset, None, float]):
|
||||||
@ -284,7 +266,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, SearchResultsPhoto]
|
Response[Union[Any, SearchResultsPhoto]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -293,7 +275,6 @@ async def asyncio(
|
|||||||
client=client,
|
client=client,
|
||||||
q=q,
|
q=q,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
token=token,
|
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
lat=lat,
|
lat=lat,
|
@ -1,5 +1,4 @@
|
|||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from io import BytesIO
|
|
||||||
from typing import Any, Dict, Optional, Union, cast
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
@ -7,7 +6,7 @@ import httpx
|
|||||||
from ... import errors
|
from ... import errors
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...models.http_validation_error import HTTPValidationError
|
from ...models.http_validation_error import HTTPValidationError
|
||||||
from ...types import File, Response
|
from ...types import Response
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
def _get_kwargs(
|
||||||
@ -26,14 +25,12 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, File, HTTPValidationError]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = File(payload=BytesIO(response.content))
|
response_200 = cast(Any, response.json())
|
||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||||
response_404 = cast(Any, None)
|
response_404 = cast(Any, None)
|
||||||
@ -43,12 +40,12 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, File, HTTPValidationError]]:
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
|
||||||
return Response(
|
return Response(
|
||||||
status_code=HTTPStatus(response.status_code),
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
@ -61,7 +58,7 @@ def sync_detailed(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
) -> Response[Union[Any, File, HTTPValidationError]]:
|
) -> Response[Union[Any, HTTPValidationError]]:
|
||||||
"""Photo Get
|
"""Photo Get
|
||||||
|
|
||||||
Get a photo by id
|
Get a photo by id
|
||||||
@ -74,7 +71,7 @@ def sync_detailed(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[Any, File, HTTPValidationError]]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
@ -94,7 +91,7 @@ def sync(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
) -> Optional[Union[Any, File, HTTPValidationError]]:
|
) -> Optional[Union[Any, HTTPValidationError]]:
|
||||||
"""Photo Get
|
"""Photo Get
|
||||||
|
|
||||||
Get a photo by id
|
Get a photo by id
|
||||||
@ -107,7 +104,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, File, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -120,7 +117,7 @@ async def asyncio_detailed(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
) -> Response[Union[Any, File, HTTPValidationError]]:
|
) -> Response[Union[Any, HTTPValidationError]]:
|
||||||
"""Photo Get
|
"""Photo Get
|
||||||
|
|
||||||
Get a photo by id
|
Get a photo by id
|
||||||
@ -133,7 +130,7 @@ async def asyncio_detailed(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[Any, File, HTTPValidationError]]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
@ -151,7 +148,7 @@ async def asyncio(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
) -> Optional[Union[Any, File, HTTPValidationError]]:
|
) -> Optional[Union[Any, HTTPValidationError]]:
|
||||||
"""Photo Get
|
"""Photo Get
|
||||||
|
|
||||||
Get a photo by id
|
Get a photo by id
|
||||||
@ -164,7 +161,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, File, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -31,7 +31,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -120,7 +119,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -183,7 +182,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -32,7 +32,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +51,7 @@ def _parse_response(
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -123,7 +122,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, PhotoPublic]
|
Response[Union[Any, HTTPValidationError, PhotoPublic]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -186,7 +185,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, PhotoPublic]
|
Response[Union[Any, HTTPValidationError, PhotoPublic]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -32,7 +32,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +51,7 @@ def _parse_response(
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -123,7 +122,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, PhotoPublic]
|
Response[Union[Any, HTTPValidationError, PhotoPublic]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -186,7 +185,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, PhotoPublic]
|
Response[Union[Any, HTTPValidationError, PhotoPublic]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -42,7 +42,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"files": multipart_multipart_data,
|
"files": multipart_multipart_data,
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
@ -64,7 +63,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -148,7 +147,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, Photo]
|
Response[Union[Any, HTTPValidationError, Photo]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -229,7 +228,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, Photo]
|
Response[Union[Any, HTTPValidationError, Photo]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -31,7 +31,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -113,7 +112,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -172,7 +171,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -31,7 +31,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -113,7 +112,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -172,7 +171,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -26,7 +26,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"data": form_data.to_dict(),
|
"data": form_data.to_dict(),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -97,7 +96,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -144,7 +143,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -26,7 +26,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"data": form_data.to_dict(),
|
"data": form_data.to_dict(),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -97,7 +96,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -144,7 +143,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -24,7 +24,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Use
|
|||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -85,7 +84,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
User
|
Response[User]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -128,7 +127,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
User
|
Response[User]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -25,7 +25,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -105,7 +104,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -162,7 +161,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -15,7 +15,6 @@ def _get_kwargs(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
@ -29,8 +28,6 @@ def _get_kwargs(
|
|||||||
|
|
||||||
params["caption"] = caption
|
params["caption"] = caption
|
||||||
|
|
||||||
params["token"] = token
|
|
||||||
|
|
||||||
params["page"] = page
|
params["page"] = page
|
||||||
|
|
||||||
params["page_size"] = page_size
|
params["page_size"] = page_size
|
||||||
@ -43,7 +40,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,9 +52,6 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
if response.status_code == HTTPStatus.BAD_REQUEST:
|
if response.status_code == HTTPStatus.BAD_REQUEST:
|
||||||
response_400 = cast(Any, None)
|
response_400 = cast(Any, None)
|
||||||
return response_400
|
return response_400
|
||||||
if response.status_code == HTTPStatus.UNAUTHORIZED:
|
|
||||||
response_401 = cast(Any, None)
|
|
||||||
return response_401
|
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||||
response_404 = cast(Any, None)
|
response_404 = cast(Any, None)
|
||||||
return response_404
|
return response_404
|
||||||
@ -66,7 +59,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
response_422 = cast(Any, None)
|
response_422 = cast(Any, None)
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -86,19 +79,17 @@ def sync_detailed(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
) -> Response[Union[Any, SearchResultsVideo]]:
|
) -> Response[Union[Any, SearchResultsVideo]]:
|
||||||
"""Video Find
|
"""Video Find
|
||||||
|
|
||||||
Find a video by filename, caption or token
|
Find a video by filename
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
album (str):
|
album (str):
|
||||||
q (Union[Unset, None, str]):
|
q (Union[Unset, None, str]):
|
||||||
caption (Union[Unset, None, str]):
|
caption (Union[Unset, None, str]):
|
||||||
token (Union[Unset, None, str]):
|
|
||||||
page (Union[Unset, None, int]): Default: 1.
|
page (Union[Unset, None, int]): Default: 1.
|
||||||
page_size (Union[Unset, None, int]): Default: 100.
|
page_size (Union[Unset, None, int]): Default: 100.
|
||||||
|
|
||||||
@ -115,7 +106,6 @@ def sync_detailed(
|
|||||||
client=client,
|
client=client,
|
||||||
q=q,
|
q=q,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
token=token,
|
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
)
|
)
|
||||||
@ -134,19 +124,17 @@ def sync(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
) -> Optional[Union[Any, SearchResultsVideo]]:
|
) -> Optional[Union[Any, SearchResultsVideo]]:
|
||||||
"""Video Find
|
"""Video Find
|
||||||
|
|
||||||
Find a video by filename, caption or token
|
Find a video by filename
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
album (str):
|
album (str):
|
||||||
q (Union[Unset, None, str]):
|
q (Union[Unset, None, str]):
|
||||||
caption (Union[Unset, None, str]):
|
caption (Union[Unset, None, str]):
|
||||||
token (Union[Unset, None, str]):
|
|
||||||
page (Union[Unset, None, int]): Default: 1.
|
page (Union[Unset, None, int]): Default: 1.
|
||||||
page_size (Union[Unset, None, int]): Default: 100.
|
page_size (Union[Unset, None, int]): Default: 100.
|
||||||
|
|
||||||
@ -155,7 +143,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, SearchResultsVideo]
|
Response[Union[Any, SearchResultsVideo]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -163,7 +151,6 @@ def sync(
|
|||||||
client=client,
|
client=client,
|
||||||
q=q,
|
q=q,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
token=token,
|
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
).parsed
|
).parsed
|
||||||
@ -175,19 +162,17 @@ async def asyncio_detailed(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
) -> Response[Union[Any, SearchResultsVideo]]:
|
) -> Response[Union[Any, SearchResultsVideo]]:
|
||||||
"""Video Find
|
"""Video Find
|
||||||
|
|
||||||
Find a video by filename, caption or token
|
Find a video by filename
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
album (str):
|
album (str):
|
||||||
q (Union[Unset, None, str]):
|
q (Union[Unset, None, str]):
|
||||||
caption (Union[Unset, None, str]):
|
caption (Union[Unset, None, str]):
|
||||||
token (Union[Unset, None, str]):
|
|
||||||
page (Union[Unset, None, int]): Default: 1.
|
page (Union[Unset, None, int]): Default: 1.
|
||||||
page_size (Union[Unset, None, int]): Default: 100.
|
page_size (Union[Unset, None, int]): Default: 100.
|
||||||
|
|
||||||
@ -204,7 +189,6 @@ async def asyncio_detailed(
|
|||||||
client=client,
|
client=client,
|
||||||
q=q,
|
q=q,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
token=token,
|
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
)
|
)
|
||||||
@ -221,19 +205,17 @@ async def asyncio(
|
|||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
q: Union[Unset, None, str] = UNSET,
|
q: Union[Unset, None, str] = UNSET,
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
caption: Union[Unset, None, str] = UNSET,
|
||||||
token: Union[Unset, None, str] = UNSET,
|
|
||||||
page: Union[Unset, None, int] = 1,
|
page: Union[Unset, None, int] = 1,
|
||||||
page_size: Union[Unset, None, int] = 100,
|
page_size: Union[Unset, None, int] = 100,
|
||||||
) -> Optional[Union[Any, SearchResultsVideo]]:
|
) -> Optional[Union[Any, SearchResultsVideo]]:
|
||||||
"""Video Find
|
"""Video Find
|
||||||
|
|
||||||
Find a video by filename, caption or token
|
Find a video by filename
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
album (str):
|
album (str):
|
||||||
q (Union[Unset, None, str]):
|
q (Union[Unset, None, str]):
|
||||||
caption (Union[Unset, None, str]):
|
caption (Union[Unset, None, str]):
|
||||||
token (Union[Unset, None, str]):
|
|
||||||
page (Union[Unset, None, int]): Default: 1.
|
page (Union[Unset, None, int]): Default: 1.
|
||||||
page_size (Union[Unset, None, int]): Default: 100.
|
page_size (Union[Unset, None, int]): Default: 100.
|
||||||
|
|
||||||
@ -242,7 +224,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, SearchResultsVideo]
|
Response[Union[Any, SearchResultsVideo]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -251,7 +233,6 @@ async def asyncio(
|
|||||||
client=client,
|
client=client,
|
||||||
q=q,
|
q=q,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
token=token,
|
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
)
|
)
|
@ -1,5 +1,4 @@
|
|||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from io import BytesIO
|
|
||||||
from typing import Any, Dict, Optional, Union, cast
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
@ -7,7 +6,7 @@ import httpx
|
|||||||
from ... import errors
|
from ... import errors
|
||||||
from ...client import AuthenticatedClient, Client
|
from ...client import AuthenticatedClient, Client
|
||||||
from ...models.http_validation_error import HTTPValidationError
|
from ...models.http_validation_error import HTTPValidationError
|
||||||
from ...types import File, Response
|
from ...types import Response
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
def _get_kwargs(
|
||||||
@ -26,14 +25,12 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, File, HTTPValidationError]]:
|
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
|
||||||
if response.status_code == HTTPStatus.OK:
|
if response.status_code == HTTPStatus.OK:
|
||||||
response_200 = File(payload=BytesIO(response.content))
|
response_200 = cast(Any, response.json())
|
||||||
|
|
||||||
return response_200
|
return response_200
|
||||||
if response.status_code == HTTPStatus.NOT_FOUND:
|
if response.status_code == HTTPStatus.NOT_FOUND:
|
||||||
response_404 = cast(Any, None)
|
response_404 = cast(Any, None)
|
||||||
@ -43,12 +40,12 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, File, HTTPValidationError]]:
|
def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
|
||||||
return Response(
|
return Response(
|
||||||
status_code=HTTPStatus(response.status_code),
|
status_code=HTTPStatus(response.status_code),
|
||||||
content=response.content,
|
content=response.content,
|
||||||
@ -61,7 +58,7 @@ def sync_detailed(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
) -> Response[Union[Any, File, HTTPValidationError]]:
|
) -> Response[Union[Any, HTTPValidationError]]:
|
||||||
"""Video Get
|
"""Video Get
|
||||||
|
|
||||||
Get a video by id
|
Get a video by id
|
||||||
@ -74,7 +71,7 @@ def sync_detailed(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[Any, File, HTTPValidationError]]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
@ -94,7 +91,7 @@ def sync(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
) -> Optional[Union[Any, File, HTTPValidationError]]:
|
) -> Optional[Union[Any, HTTPValidationError]]:
|
||||||
"""Video Get
|
"""Video Get
|
||||||
|
|
||||||
Get a video by id
|
Get a video by id
|
||||||
@ -107,7 +104,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, File, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -120,7 +117,7 @@ async def asyncio_detailed(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
) -> Response[Union[Any, File, HTTPValidationError]]:
|
) -> Response[Union[Any, HTTPValidationError]]:
|
||||||
"""Video Get
|
"""Video Get
|
||||||
|
|
||||||
Get a video by id
|
Get a video by id
|
||||||
@ -133,7 +130,7 @@ async def asyncio_detailed(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response[Union[Any, File, HTTPValidationError]]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
@ -151,7 +148,7 @@ async def asyncio(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: AuthenticatedClient,
|
client: AuthenticatedClient,
|
||||||
) -> Optional[Union[Any, File, HTTPValidationError]]:
|
) -> Optional[Union[Any, HTTPValidationError]]:
|
||||||
"""Video Get
|
"""Video Get
|
||||||
|
|
||||||
Get a video by id
|
Get a video by id
|
||||||
@ -164,7 +161,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, File, HTTPValidationError]
|
Response[Union[Any, HTTPValidationError]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -32,7 +32,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +51,7 @@ def _parse_response(
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -123,7 +122,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, VideoPublic]
|
Response[Union[Any, HTTPValidationError, VideoPublic]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -186,7 +185,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, VideoPublic]
|
Response[Union[Any, HTTPValidationError, VideoPublic]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -32,7 +32,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +51,7 @@ def _parse_response(
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -123,7 +122,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, VideoPublic]
|
Response[Union[Any, HTTPValidationError, VideoPublic]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -186,7 +185,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, VideoPublic]
|
Response[Union[Any, HTTPValidationError, VideoPublic]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -36,7 +36,6 @@ def _get_kwargs(
|
|||||||
"headers": headers,
|
"headers": headers,
|
||||||
"cookies": cookies,
|
"cookies": cookies,
|
||||||
"timeout": client.get_timeout(),
|
"timeout": client.get_timeout(),
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"files": multipart_multipart_data,
|
"files": multipart_multipart_data,
|
||||||
"params": params,
|
"params": params,
|
||||||
}
|
}
|
||||||
@ -55,7 +54,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|||||||
|
|
||||||
return response_422
|
return response_422
|
||||||
if client.raise_on_unexpected_status:
|
if client.raise_on_unexpected_status:
|
||||||
raise errors.UnexpectedStatus(response.status_code, response.content)
|
raise errors.UnexpectedStatus(f"Unexpected status code: {response.status_code}")
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -129,7 +128,7 @@ def sync(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, Video]
|
Response[Union[Any, HTTPValidationError, Video]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
@ -198,7 +197,7 @@ async def asyncio(
|
|||||||
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Union[Any, HTTPValidationError, Video]
|
Response[Union[Any, HTTPValidationError, Video]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return (
|
return (
|
@ -18,7 +18,6 @@ class Client:
|
|||||||
but can be set to False for testing purposes.
|
but can be set to False for testing purposes.
|
||||||
raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
|
raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
|
||||||
status code that was not documented in the source OpenAPI document.
|
status code that was not documented in the source OpenAPI document.
|
||||||
follow_redirects: Whether or not to follow redirects. Default value is False.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
base_url: str
|
base_url: str
|
||||||
@ -27,7 +26,6 @@ class Client:
|
|||||||
timeout: float = attr.ib(5.0, kw_only=True)
|
timeout: float = attr.ib(5.0, kw_only=True)
|
||||||
verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True)
|
verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True)
|
||||||
raise_on_unexpected_status: bool = attr.ib(False, kw_only=True)
|
raise_on_unexpected_status: bool = attr.ib(False, kw_only=True)
|
||||||
follow_redirects: bool = attr.ib(False, kw_only=True)
|
|
||||||
|
|
||||||
def get_headers(self) -> Dict[str, str]:
|
def get_headers(self) -> Dict[str, str]:
|
||||||
"""Get headers to be used in all endpoints"""
|
"""Get headers to be used in all endpoints"""
|
@ -4,11 +4,7 @@
|
|||||||
class UnexpectedStatus(Exception):
|
class UnexpectedStatus(Exception):
|
||||||
"""Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True"""
|
"""Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True"""
|
||||||
|
|
||||||
def __init__(self, status_code: int, content: bytes):
|
...
|
||||||
self.status_code = status_code
|
|
||||||
self.content = content
|
|
||||||
|
|
||||||
super().__init__(f"Unexpected status code: {status_code}")
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["UnexpectedStatus"]
|
__all__ = ["UnexpectedStatus"]
|
@ -11,8 +11,6 @@ from .http_validation_error import HTTPValidationError
|
|||||||
from .photo import Photo
|
from .photo import Photo
|
||||||
from .photo_public import PhotoPublic
|
from .photo_public import PhotoPublic
|
||||||
from .photo_search import PhotoSearch
|
from .photo_search import PhotoSearch
|
||||||
from .random_search_results_photo import RandomSearchResultsPhoto
|
|
||||||
from .random_search_results_video import RandomSearchResultsVideo
|
|
||||||
from .search_results_album import SearchResultsAlbum
|
from .search_results_album import SearchResultsAlbum
|
||||||
from .search_results_photo import SearchResultsPhoto
|
from .search_results_photo import SearchResultsPhoto
|
||||||
from .search_results_video import SearchResultsVideo
|
from .search_results_video import SearchResultsVideo
|
||||||
@ -35,8 +33,6 @@ __all__ = (
|
|||||||
"Photo",
|
"Photo",
|
||||||
"PhotoPublic",
|
"PhotoPublic",
|
||||||
"PhotoSearch",
|
"PhotoSearch",
|
||||||
"RandomSearchResultsPhoto",
|
|
||||||
"RandomSearchResultsVideo",
|
|
||||||
"SearchResultsAlbum",
|
"SearchResultsAlbum",
|
||||||
"SearchResultsPhoto",
|
"SearchResultsPhoto",
|
||||||
"SearchResultsVideo",
|
"SearchResultsVideo",
|
@ -1,12 +1,12 @@
|
|||||||
""" Contains some shared types for properties """
|
""" Contains some shared types for properties """
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from typing import BinaryIO, Generic, Literal, MutableMapping, Optional, Tuple, TypeVar
|
from typing import BinaryIO, Generic, MutableMapping, Optional, Tuple, TypeVar
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
|
|
||||||
class Unset:
|
class Unset:
|
||||||
def __bool__(self) -> Literal[False]:
|
def __bool__(self) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
26
README.md
26
README.md
@ -1,13 +1,11 @@
|
|||||||
# PhotosAPI_Client
|
# PhotosAPI_Client
|
||||||
|
A client library for accessing END PLAY Photos
|
||||||
A client library for accessing Photos API
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
First, create a client:
|
First, create a client:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from photosapi_client import Client
|
from PhotosAPI_Client import Client
|
||||||
|
|
||||||
client = Client(base_url="https://api.example.com")
|
client = Client(base_url="https://api.example.com")
|
||||||
```
|
```
|
||||||
@ -15,7 +13,7 @@ client = Client(base_url="https://api.example.com")
|
|||||||
If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
|
If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from photosapi_client import AuthenticatedClient
|
from PhotosAPI_Client import AuthenticatedClient
|
||||||
|
|
||||||
client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
|
client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
|
||||||
```
|
```
|
||||||
@ -23,9 +21,9 @@ client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSec
|
|||||||
Now call your endpoint and use your models:
|
Now call your endpoint and use your models:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from photosapi_client.models import MyDataModel
|
from PhotosAPI_Client.models import MyDataModel
|
||||||
from photosapi_client.api.my_tag import get_my_data_model
|
from PhotosAPI_Client.api.my_tag import get_my_data_model
|
||||||
from photosapi_client.types import Response
|
from PhotosAPI_Client.types import Response
|
||||||
|
|
||||||
my_data: MyDataModel = get_my_data_model.sync(client=client)
|
my_data: MyDataModel = get_my_data_model.sync(client=client)
|
||||||
# or if you need more info (e.g. status_code)
|
# or if you need more info (e.g. status_code)
|
||||||
@ -35,9 +33,9 @@ response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
|
|||||||
Or do the same thing with an async version:
|
Or do the same thing with an async version:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from photosapi_client.models import MyDataModel
|
from PhotosAPI_Client.models import MyDataModel
|
||||||
from photosapi_client.api.my_tag import get_my_data_model
|
from PhotosAPI_Client.api.my_tag import get_my_data_model
|
||||||
from photosapi_client.types import Response
|
from PhotosAPI_Client.types import Response
|
||||||
|
|
||||||
my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
|
my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
|
||||||
response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
|
response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
|
||||||
@ -66,7 +64,6 @@ client = AuthenticatedClient(
|
|||||||
There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info.
|
There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info.
|
||||||
|
|
||||||
Things to know:
|
Things to know:
|
||||||
|
|
||||||
1. Every path/method combo becomes a Python module with four functions:
|
1. Every path/method combo becomes a Python module with four functions:
|
||||||
1. `sync`: Blocking request that returns parsed data (if successful) or `None`
|
1. `sync`: Blocking request that returns parsed data (if successful) or `None`
|
||||||
1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
|
1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
|
||||||
@ -75,12 +72,10 @@ Things to know:
|
|||||||
|
|
||||||
1. All path/query params, and bodies become method arguments.
|
1. All path/query params, and bodies become method arguments.
|
||||||
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
|
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
|
||||||
1. Any endpoint which did not have a tag will be in `photosapi_client.api.default`
|
1. Any endpoint which did not have a tag will be in `PhotosAPI_Client.api.default`
|
||||||
|
|
||||||
## Building / publishing this Client
|
## Building / publishing this Client
|
||||||
|
|
||||||
This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
|
This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics:
|
||||||
|
|
||||||
1. Update the metadata in pyproject.toml (e.g. authors, version)
|
1. Update the metadata in pyproject.toml (e.g. authors, version)
|
||||||
1. If you're using a private repository, configure it with Poetry
|
1. If you're using a private repository, configure it with Poetry
|
||||||
1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
|
1. `poetry config repositories.<your-repository-name> <url-to-your-repository>`
|
||||||
@ -88,7 +83,6 @@ This project uses [Poetry](https://python-poetry.org/) to manage dependencies a
|
|||||||
1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
|
1. Publish the client with `poetry publish --build -r <your-repository-name>` or, if for public PyPI, just `poetry publish --build`
|
||||||
|
|
||||||
If you want to install this client into another project without publishing it (e.g. for development) then:
|
If you want to install this client into another project without publishing it (e.g. for development) then:
|
||||||
|
|
||||||
1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
|
1. If that project **is using Poetry**, you can simply do `poetry add <path-to-this-client>` from that project
|
||||||
1. If that project is not using Poetry:
|
1. If that project is not using Poetry:
|
||||||
1. Build a wheel with `poetry build -f wheel`
|
1. Build a wheel with `poetry build -f wheel`
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
project_name_override: PhotosAPI_Client
|
|
||||||
package_name_override: photosapi_client
|
|
||||||
post_hooks:
|
|
||||||
- "autoflake -i -r --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports photosapi_client/"
|
|
||||||
- "isort photosapi_client/"
|
|
||||||
- "black photosapi_client/"
|
|
@ -1,216 +0,0 @@
|
|||||||
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.random_search_results_photo import RandomSearchResultsPhoto
|
|
||||||
from ...types import UNSET, Response, Unset
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/albums/{album}/photos/random".format(client.base_url, album=album)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = client.get_cookies()
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["caption"] = caption
|
|
||||||
|
|
||||||
params["limit"] = limit
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": client.get_timeout(),
|
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(
|
|
||||||
*, client: Client, response: httpx.Response
|
|
||||||
) -> Optional[Union[Any, HTTPValidationError, RandomSearchResultsPhoto]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = RandomSearchResultsPhoto.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 = 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: Client, response: httpx.Response
|
|
||||||
) -> Response[Union[Any, HTTPValidationError, RandomSearchResultsPhoto]]:
|
|
||||||
return Response(
|
|
||||||
status_code=HTTPStatus(response.status_code),
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(client=client, response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Response[Union[Any, HTTPValidationError, RandomSearchResultsPhoto]]:
|
|
||||||
"""Photo Random
|
|
||||||
|
|
||||||
Get one random photo, optionally by caption
|
|
||||||
|
|
||||||
Args:
|
|
||||||
album (str):
|
|
||||||
caption (Union[Unset, None, str]):
|
|
||||||
limit (Union[Unset, None, 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, HTTPValidationError, RandomSearchResultsPhoto]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
album=album,
|
|
||||||
client=client,
|
|
||||||
caption=caption,
|
|
||||||
limit=limit,
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(client=client, response=response)
|
|
||||||
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Optional[Union[Any, HTTPValidationError, RandomSearchResultsPhoto]]:
|
|
||||||
"""Photo Random
|
|
||||||
|
|
||||||
Get one random photo, optionally by caption
|
|
||||||
|
|
||||||
Args:
|
|
||||||
album (str):
|
|
||||||
caption (Union[Unset, None, str]):
|
|
||||||
limit (Union[Unset, None, 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, HTTPValidationError, RandomSearchResultsPhoto]
|
|
||||||
"""
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
album=album,
|
|
||||||
client=client,
|
|
||||||
caption=caption,
|
|
||||||
limit=limit,
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Response[Union[Any, HTTPValidationError, RandomSearchResultsPhoto]]:
|
|
||||||
"""Photo Random
|
|
||||||
|
|
||||||
Get one random photo, optionally by caption
|
|
||||||
|
|
||||||
Args:
|
|
||||||
album (str):
|
|
||||||
caption (Union[Unset, None, str]):
|
|
||||||
limit (Union[Unset, None, 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, HTTPValidationError, RandomSearchResultsPhoto]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
album=album,
|
|
||||||
client=client,
|
|
||||||
caption=caption,
|
|
||||||
limit=limit,
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
||||||
response = await _client.request(**kwargs)
|
|
||||||
|
|
||||||
return _build_response(client=client, response=response)
|
|
||||||
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Optional[Union[Any, HTTPValidationError, RandomSearchResultsPhoto]]:
|
|
||||||
"""Photo Random
|
|
||||||
|
|
||||||
Get one random photo, optionally by caption
|
|
||||||
|
|
||||||
Args:
|
|
||||||
album (str):
|
|
||||||
caption (Union[Unset, None, str]):
|
|
||||||
limit (Union[Unset, None, 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, HTTPValidationError, RandomSearchResultsPhoto]
|
|
||||||
"""
|
|
||||||
|
|
||||||
return (
|
|
||||||
await asyncio_detailed(
|
|
||||||
album=album,
|
|
||||||
client=client,
|
|
||||||
caption=caption,
|
|
||||||
limit=limit,
|
|
||||||
)
|
|
||||||
).parsed
|
|
@ -1,216 +0,0 @@
|
|||||||
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.random_search_results_video import RandomSearchResultsVideo
|
|
||||||
from ...types import UNSET, Response, Unset
|
|
||||||
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/albums/{album}/videos/random".format(client.base_url, album=album)
|
|
||||||
|
|
||||||
headers: Dict[str, str] = client.get_headers()
|
|
||||||
cookies: Dict[str, Any] = client.get_cookies()
|
|
||||||
|
|
||||||
params: Dict[str, Any] = {}
|
|
||||||
params["caption"] = caption
|
|
||||||
|
|
||||||
params["limit"] = limit
|
|
||||||
|
|
||||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
||||||
|
|
||||||
return {
|
|
||||||
"method": "get",
|
|
||||||
"url": url,
|
|
||||||
"headers": headers,
|
|
||||||
"cookies": cookies,
|
|
||||||
"timeout": client.get_timeout(),
|
|
||||||
"follow_redirects": client.follow_redirects,
|
|
||||||
"params": params,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(
|
|
||||||
*, client: Client, response: httpx.Response
|
|
||||||
) -> Optional[Union[Any, HTTPValidationError, RandomSearchResultsVideo]]:
|
|
||||||
if response.status_code == HTTPStatus.OK:
|
|
||||||
response_200 = RandomSearchResultsVideo.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 = 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: Client, response: httpx.Response
|
|
||||||
) -> Response[Union[Any, HTTPValidationError, RandomSearchResultsVideo]]:
|
|
||||||
return Response(
|
|
||||||
status_code=HTTPStatus(response.status_code),
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(client=client, response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Response[Union[Any, HTTPValidationError, RandomSearchResultsVideo]]:
|
|
||||||
"""Video Random
|
|
||||||
|
|
||||||
Get one random video, optionally by caption
|
|
||||||
|
|
||||||
Args:
|
|
||||||
album (str):
|
|
||||||
caption (Union[Unset, None, str]):
|
|
||||||
limit (Union[Unset, None, 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, HTTPValidationError, RandomSearchResultsVideo]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
album=album,
|
|
||||||
client=client,
|
|
||||||
caption=caption,
|
|
||||||
limit=limit,
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.request(
|
|
||||||
verify=client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(client=client, response=response)
|
|
||||||
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Optional[Union[Any, HTTPValidationError, RandomSearchResultsVideo]]:
|
|
||||||
"""Video Random
|
|
||||||
|
|
||||||
Get one random video, optionally by caption
|
|
||||||
|
|
||||||
Args:
|
|
||||||
album (str):
|
|
||||||
caption (Union[Unset, None, str]):
|
|
||||||
limit (Union[Unset, None, 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, HTTPValidationError, RandomSearchResultsVideo]
|
|
||||||
"""
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
album=album,
|
|
||||||
client=client,
|
|
||||||
caption=caption,
|
|
||||||
limit=limit,
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Response[Union[Any, HTTPValidationError, RandomSearchResultsVideo]]:
|
|
||||||
"""Video Random
|
|
||||||
|
|
||||||
Get one random video, optionally by caption
|
|
||||||
|
|
||||||
Args:
|
|
||||||
album (str):
|
|
||||||
caption (Union[Unset, None, str]):
|
|
||||||
limit (Union[Unset, None, 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, HTTPValidationError, RandomSearchResultsVideo]]
|
|
||||||
"""
|
|
||||||
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
album=album,
|
|
||||||
client=client,
|
|
||||||
caption=caption,
|
|
||||||
limit=limit,
|
|
||||||
)
|
|
||||||
|
|
||||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
|
||||||
response = await _client.request(**kwargs)
|
|
||||||
|
|
||||||
return _build_response(client=client, response=response)
|
|
||||||
|
|
||||||
|
|
||||||
async def asyncio(
|
|
||||||
album: str,
|
|
||||||
*,
|
|
||||||
client: AuthenticatedClient,
|
|
||||||
caption: Union[Unset, None, str] = UNSET,
|
|
||||||
limit: Union[Unset, None, int] = 100,
|
|
||||||
) -> Optional[Union[Any, HTTPValidationError, RandomSearchResultsVideo]]:
|
|
||||||
"""Video Random
|
|
||||||
|
|
||||||
Get one random video, optionally by caption
|
|
||||||
|
|
||||||
Args:
|
|
||||||
album (str):
|
|
||||||
caption (Union[Unset, None, str]):
|
|
||||||
limit (Union[Unset, None, 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, HTTPValidationError, RandomSearchResultsVideo]
|
|
||||||
"""
|
|
||||||
|
|
||||||
return (
|
|
||||||
await asyncio_detailed(
|
|
||||||
album=album,
|
|
||||||
client=client,
|
|
||||||
caption=caption,
|
|
||||||
limit=limit,
|
|
||||||
)
|
|
||||||
).parsed
|
|
@ -1,72 +0,0 @@
|
|||||||
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
|
|
||||||
|
|
||||||
import attr
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from ..models.photo_search import PhotoSearch
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="RandomSearchResultsPhoto")
|
|
||||||
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
|
||||||
class RandomSearchResultsPhoto:
|
|
||||||
"""
|
|
||||||
Attributes:
|
|
||||||
results (List['PhotoSearch']):
|
|
||||||
"""
|
|
||||||
|
|
||||||
results: List["PhotoSearch"]
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
|
||||||
results = []
|
|
||||||
for results_item_data in self.results:
|
|
||||||
results_item = results_item_data.to_dict()
|
|
||||||
|
|
||||||
results.append(results_item)
|
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
|
||||||
field_dict.update(self.additional_properties)
|
|
||||||
field_dict.update(
|
|
||||||
{
|
|
||||||
"results": results,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
return field_dict
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
||||||
from ..models.photo_search import PhotoSearch
|
|
||||||
|
|
||||||
d = src_dict.copy()
|
|
||||||
results = []
|
|
||||||
_results = d.pop("results")
|
|
||||||
for results_item_data in _results:
|
|
||||||
results_item = PhotoSearch.from_dict(results_item_data)
|
|
||||||
|
|
||||||
results.append(results_item)
|
|
||||||
|
|
||||||
random_search_results_photo = cls(
|
|
||||||
results=results,
|
|
||||||
)
|
|
||||||
|
|
||||||
random_search_results_photo.additional_properties = d
|
|
||||||
return random_search_results_photo
|
|
||||||
|
|
||||||
@property
|
|
||||||
def additional_keys(self) -> List[str]:
|
|
||||||
return list(self.additional_properties.keys())
|
|
||||||
|
|
||||||
def __getitem__(self, key: str) -> Any:
|
|
||||||
return self.additional_properties[key]
|
|
||||||
|
|
||||||
def __setitem__(self, key: str, value: Any) -> None:
|
|
||||||
self.additional_properties[key] = value
|
|
||||||
|
|
||||||
def __delitem__(self, key: str) -> None:
|
|
||||||
del self.additional_properties[key]
|
|
||||||
|
|
||||||
def __contains__(self, key: str) -> bool:
|
|
||||||
return key in self.additional_properties
|
|
@ -1,72 +0,0 @@
|
|||||||
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar
|
|
||||||
|
|
||||||
import attr
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from ..models.video_search import VideoSearch
|
|
||||||
|
|
||||||
|
|
||||||
T = TypeVar("T", bound="RandomSearchResultsVideo")
|
|
||||||
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
|
||||||
class RandomSearchResultsVideo:
|
|
||||||
"""
|
|
||||||
Attributes:
|
|
||||||
results (List['VideoSearch']):
|
|
||||||
"""
|
|
||||||
|
|
||||||
results: List["VideoSearch"]
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
|
||||||
results = []
|
|
||||||
for results_item_data in self.results:
|
|
||||||
results_item = results_item_data.to_dict()
|
|
||||||
|
|
||||||
results.append(results_item)
|
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
|
||||||
field_dict.update(self.additional_properties)
|
|
||||||
field_dict.update(
|
|
||||||
{
|
|
||||||
"results": results,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
return field_dict
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
||||||
from ..models.video_search import VideoSearch
|
|
||||||
|
|
||||||
d = src_dict.copy()
|
|
||||||
results = []
|
|
||||||
_results = d.pop("results")
|
|
||||||
for results_item_data in _results:
|
|
||||||
results_item = VideoSearch.from_dict(results_item_data)
|
|
||||||
|
|
||||||
results.append(results_item)
|
|
||||||
|
|
||||||
random_search_results_video = cls(
|
|
||||||
results=results,
|
|
||||||
)
|
|
||||||
|
|
||||||
random_search_results_video.additional_properties = d
|
|
||||||
return random_search_results_video
|
|
||||||
|
|
||||||
@property
|
|
||||||
def additional_keys(self) -> List[str]:
|
|
||||||
return list(self.additional_properties.keys())
|
|
||||||
|
|
||||||
def __getitem__(self, key: str) -> Any:
|
|
||||||
return self.additional_properties[key]
|
|
||||||
|
|
||||||
def __setitem__(self, key: str, value: Any) -> None:
|
|
||||||
self.additional_properties[key] = value
|
|
||||||
|
|
||||||
def __delitem__(self, key: str) -> None:
|
|
||||||
del self.additional_properties[key]
|
|
||||||
|
|
||||||
def __contains__(self, key: str) -> bool:
|
|
||||||
return key in self.additional_properties
|
|
6
setup.py
6
setup.py
@ -7,12 +7,12 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="PhotosAPI_Client",
|
name="PhotosAPI_Client",
|
||||||
version="0.5.0",
|
version="0.1",
|
||||||
description="A client library for accessing Photos API",
|
description="A client library for accessing END PLAY Photos",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
python_requires=">=3.7, <4",
|
python_requires=">=3.7, <4",
|
||||||
install_requires=["httpx >= 0.15.0, < 0.24.0", "attrs >= 21.3.0", "python-dateutil >= 2.8.0, < 3"],
|
install_requires=["httpx >= 0.15.0, < 0.24.0", "attrs >= 21.3.0", "python-dateutil >= 2.8.0, < 3"],
|
||||||
package_data={"photosapi_client": ["py.typed"]},
|
package_data={"PhotosAPI_Client": ["py.typed"]},
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user