From dc55b70536b192d3da70aad200f91373f3dab005 Mon Sep 17 00:00:00 2001 From: profitroll Date: Thu, 23 Mar 2023 12:44:02 +0100 Subject: [PATCH] Updated to API version 0.2 --- .../photo_find_albums_album_photos_get.py | 26 ++++++++++++++++--- .../video_find_albums_album_videos_get.py | 26 ++++++++++++++++--- setup.py | 4 +-- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/photosapi_client/api/default/photo_find_albums_album_photos_get.py b/photosapi_client/api/default/photo_find_albums_album_photos_get.py index b172707..44475d0 100644 --- a/photosapi_client/api/default/photo_find_albums_album_photos_get.py +++ b/photosapi_client/api/default/photo_find_albums_album_photos_get.py @@ -15,6 +15,7 @@ def _get_kwargs( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, lat: Union[Unset, None, float] = UNSET, @@ -31,6 +32,8 @@ def _get_kwargs( params["caption"] = caption + params["token"] = token + params["page"] = page params["page_size"] = page_size @@ -61,6 +64,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni if response.status_code == HTTPStatus.BAD_REQUEST: response_400 = cast(Any, None) return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 if response.status_code == HTTPStatus.NOT_FOUND: response_404 = cast(Any, None) return response_404 @@ -88,6 +94,7 @@ def sync_detailed( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, lat: Union[Unset, None, float] = UNSET, @@ -96,12 +103,13 @@ def sync_detailed( ) -> Response[Union[Any, SearchResultsPhoto]]: """Photo Find - Find a photo by filename + Find a photo by filename, caption, location or token Args: album (str): q (Union[Unset, None, str]): caption (Union[Unset, None, str]): + token (Union[Unset, None, str]): page (Union[Unset, None, int]): Default: 1. page_size (Union[Unset, None, int]): Default: 100. lat (Union[Unset, None, float]): @@ -121,6 +129,7 @@ def sync_detailed( client=client, q=q, caption=caption, + token=token, page=page, page_size=page_size, lat=lat, @@ -142,6 +151,7 @@ def sync( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, lat: Union[Unset, None, float] = UNSET, @@ -150,12 +160,13 @@ def sync( ) -> Optional[Union[Any, SearchResultsPhoto]]: """Photo Find - Find a photo by filename + Find a photo by filename, caption, location or token Args: album (str): q (Union[Unset, None, str]): caption (Union[Unset, None, str]): + token (Union[Unset, None, str]): page (Union[Unset, None, int]): Default: 1. page_size (Union[Unset, None, int]): Default: 100. lat (Union[Unset, None, float]): @@ -175,6 +186,7 @@ def sync( client=client, q=q, caption=caption, + token=token, page=page, page_size=page_size, lat=lat, @@ -189,6 +201,7 @@ async def asyncio_detailed( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, lat: Union[Unset, None, float] = UNSET, @@ -197,12 +210,13 @@ async def asyncio_detailed( ) -> Response[Union[Any, SearchResultsPhoto]]: """Photo Find - Find a photo by filename + Find a photo by filename, caption, location or token Args: album (str): q (Union[Unset, None, str]): caption (Union[Unset, None, str]): + token (Union[Unset, None, str]): page (Union[Unset, None, int]): Default: 1. page_size (Union[Unset, None, int]): Default: 100. lat (Union[Unset, None, float]): @@ -222,6 +236,7 @@ async def asyncio_detailed( client=client, q=q, caption=caption, + token=token, page=page, page_size=page_size, lat=lat, @@ -241,6 +256,7 @@ async def asyncio( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, lat: Union[Unset, None, float] = UNSET, @@ -249,12 +265,13 @@ async def asyncio( ) -> Optional[Union[Any, SearchResultsPhoto]]: """Photo Find - Find a photo by filename + Find a photo by filename, caption, location or token Args: album (str): q (Union[Unset, None, str]): caption (Union[Unset, None, str]): + token (Union[Unset, None, str]): page (Union[Unset, None, int]): Default: 1. page_size (Union[Unset, None, int]): Default: 100. lat (Union[Unset, None, float]): @@ -275,6 +292,7 @@ async def asyncio( client=client, q=q, caption=caption, + token=token, page=page, page_size=page_size, lat=lat, diff --git a/photosapi_client/api/default/video_find_albums_album_videos_get.py b/photosapi_client/api/default/video_find_albums_album_videos_get.py index 4f1ebc1..fa5885c 100644 --- a/photosapi_client/api/default/video_find_albums_album_videos_get.py +++ b/photosapi_client/api/default/video_find_albums_album_videos_get.py @@ -15,6 +15,7 @@ def _get_kwargs( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, ) -> Dict[str, Any]: @@ -28,6 +29,8 @@ def _get_kwargs( params["caption"] = caption + params["token"] = token + params["page"] = page params["page_size"] = page_size @@ -52,6 +55,9 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni if response.status_code == HTTPStatus.BAD_REQUEST: response_400 = cast(Any, None) return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 if response.status_code == HTTPStatus.NOT_FOUND: response_404 = cast(Any, None) return response_404 @@ -79,17 +85,19 @@ def sync_detailed( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, ) -> Response[Union[Any, SearchResultsVideo]]: """Video Find - Find a video by filename + Find a video by filename, caption or token Args: album (str): q (Union[Unset, None, str]): caption (Union[Unset, None, str]): + token (Union[Unset, None, str]): page (Union[Unset, None, int]): Default: 1. page_size (Union[Unset, None, int]): Default: 100. @@ -106,6 +114,7 @@ def sync_detailed( client=client, q=q, caption=caption, + token=token, page=page, page_size=page_size, ) @@ -124,17 +133,19 @@ def sync( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, ) -> Optional[Union[Any, SearchResultsVideo]]: """Video Find - Find a video by filename + Find a video by filename, caption or token Args: album (str): q (Union[Unset, None, str]): caption (Union[Unset, None, str]): + token (Union[Unset, None, str]): page (Union[Unset, None, int]): Default: 1. page_size (Union[Unset, None, int]): Default: 100. @@ -151,6 +162,7 @@ def sync( client=client, q=q, caption=caption, + token=token, page=page, page_size=page_size, ).parsed @@ -162,17 +174,19 @@ async def asyncio_detailed( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, ) -> Response[Union[Any, SearchResultsVideo]]: """Video Find - Find a video by filename + Find a video by filename, caption or token Args: album (str): q (Union[Unset, None, str]): caption (Union[Unset, None, str]): + token (Union[Unset, None, str]): page (Union[Unset, None, int]): Default: 1. page_size (Union[Unset, None, int]): Default: 100. @@ -189,6 +203,7 @@ async def asyncio_detailed( client=client, q=q, caption=caption, + token=token, page=page, page_size=page_size, ) @@ -205,17 +220,19 @@ async def asyncio( client: AuthenticatedClient, q: Union[Unset, None, str] = UNSET, caption: Union[Unset, None, str] = UNSET, + token: Union[Unset, None, str] = UNSET, page: Union[Unset, None, int] = 1, page_size: Union[Unset, None, int] = 100, ) -> Optional[Union[Any, SearchResultsVideo]]: """Video Find - Find a video by filename + Find a video by filename, caption or token Args: album (str): q (Union[Unset, None, str]): caption (Union[Unset, None, str]): + token (Union[Unset, None, str]): page (Union[Unset, None, int]): Default: 1. page_size (Union[Unset, None, int]): Default: 100. @@ -233,6 +250,7 @@ async def asyncio( client=client, q=q, caption=caption, + token=token, page=page, page_size=page_size, ) diff --git a/setup.py b/setup.py index 37ace6e..5c3c7c4 100644 --- a/setup.py +++ b/setup.py @@ -7,8 +7,8 @@ long_description = (here / "README.md").read_text(encoding="utf-8") setup( name="PhotosAPI_Client", - version="0.1.1", - description="A client library for accessing END PLAY Photos", + version="0.2.0", + description="A client library for accessing Photos API", long_description=long_description, long_description_content_type="text/markdown", packages=find_packages(),