Compare commits

..

No commits in common. "d643fde9171b4b4063cfa4db9888d112d10c9b83" and "37fb483ddfb10c1e332c95146b59fee04ac517c0" have entirely different histories.

29 changed files with 82 additions and 108 deletions

View File

@ -1,2 +0,0 @@
project_name_override: PhotosAPI_Client
package_name_override: photosapi_client

View File

@ -34,7 +34,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -55,7 +54,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -124,7 +123,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Album, Any, HTTPValidationError]
Response[Union[Album, Any, HTTPValidationError]]
"""
return sync_detailed(
@ -187,7 +186,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Album, Any, HTTPValidationError]
Response[Union[Album, Any, HTTPValidationError]]
"""
return (

View File

@ -25,7 +25,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"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
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:
return None
@ -105,7 +104,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -162,7 +161,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -31,7 +31,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -48,7 +47,7 @@ def _parse_response(
return response_422
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:
return None
@ -114,7 +113,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[HTTPValidationError, SearchResultsAlbum]
Response[Union[HTTPValidationError, SearchResultsAlbum]]
"""
return sync_detailed(
@ -171,7 +170,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[HTTPValidationError, SearchResultsAlbum]
Response[Union[HTTPValidationError, SearchResultsAlbum]]
"""
return (

View File

@ -38,7 +38,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -61,7 +60,7 @@ def _parse_response(
return response_422
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:
return None
@ -142,7 +141,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[AlbumModified, Any, HTTPValidationError]
Response[Union[AlbumModified, Any, HTTPValidationError]]
"""
return sync_detailed(
@ -217,7 +216,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[AlbumModified, Any, HTTPValidationError]
Response[Union[AlbumModified, Any, HTTPValidationError]]
"""
return (

View File

@ -38,7 +38,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -61,7 +60,7 @@ def _parse_response(
return response_422
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:
return None
@ -142,7 +141,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[AlbumModified, Any, HTTPValidationError]
Response[Union[AlbumModified, Any, HTTPValidationError]]
"""
return sync_detailed(
@ -217,7 +216,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[AlbumModified, Any, HTTPValidationError]
Response[Union[AlbumModified, Any, HTTPValidationError]]
"""
return (

View File

@ -27,7 +27,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"data": form_data.to_dict(),
}
@ -45,7 +44,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -99,7 +98,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, Token]
Response[Union[Any, HTTPValidationError, Token]]
"""
return sync_detailed(
@ -146,7 +145,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, Token]
Response[Union[Any, HTTPValidationError, Token]]
"""
return (

View File

@ -25,7 +25,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"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
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:
return None
@ -105,7 +104,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -162,7 +161,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -52,7 +52,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -75,7 +74,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
response_422 = cast(Any, None)
return response_422
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:
return None
@ -179,7 +178,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, SearchResultsPhoto]
Response[Union[Any, SearchResultsPhoto]]
"""
return sync_detailed(
@ -284,7 +283,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, SearchResultsPhoto]
Response[Union[Any, SearchResultsPhoto]]
"""
return (

View File

@ -25,11 +25,13 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
}
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(Any, response.json())
return response_200
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = cast(Any, None)
return response_404
@ -38,7 +40,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -102,7 +104,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -159,7 +161,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -31,7 +31,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -51,7 +50,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -120,7 +119,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -183,7 +182,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -32,7 +32,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -52,7 +51,7 @@ def _parse_response(
return response_422
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:
return None
@ -123,7 +122,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, PhotoPublic]
Response[Union[Any, HTTPValidationError, PhotoPublic]]
"""
return sync_detailed(
@ -186,7 +185,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, PhotoPublic]
Response[Union[Any, HTTPValidationError, PhotoPublic]]
"""
return (

View File

@ -32,7 +32,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -52,7 +51,7 @@ def _parse_response(
return response_422
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:
return None
@ -123,7 +122,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, PhotoPublic]
Response[Union[Any, HTTPValidationError, PhotoPublic]]
"""
return sync_detailed(
@ -186,7 +185,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, PhotoPublic]
Response[Union[Any, HTTPValidationError, PhotoPublic]]
"""
return (

View File

@ -42,7 +42,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"files": multipart_multipart_data,
"params": params,
}
@ -64,7 +63,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -148,7 +147,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, Photo]
Response[Union[Any, HTTPValidationError, Photo]]
"""
return sync_detailed(
@ -229,7 +228,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, Photo]
Response[Union[Any, HTTPValidationError, Photo]]
"""
return (

View File

@ -31,7 +31,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -48,7 +47,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -113,7 +112,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -172,7 +171,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -31,7 +31,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -48,7 +47,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -113,7 +112,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -172,7 +171,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -26,7 +26,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"data": form_data.to_dict(),
}
@ -43,7 +42,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -97,7 +96,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -144,7 +143,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -26,7 +26,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"data": form_data.to_dict(),
}
@ -43,7 +42,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -97,7 +96,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -144,7 +143,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -24,7 +24,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"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
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:
return None
@ -85,7 +84,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
User
Response[User]
"""
return sync_detailed(
@ -128,7 +127,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
User
Response[User]
"""
return (

View File

@ -25,7 +25,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"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
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:
return None
@ -105,7 +104,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -162,7 +161,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -43,7 +43,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -66,7 +65,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
response_422 = cast(Any, None)
return response_422
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:
return None
@ -155,7 +154,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, SearchResultsVideo]
Response[Union[Any, SearchResultsVideo]]
"""
return sync_detailed(
@ -242,7 +241,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, SearchResultsVideo]
Response[Union[Any, SearchResultsVideo]]
"""
return (

View File

@ -25,11 +25,13 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
}
def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
if response.status_code == HTTPStatus.OK:
response_200 = cast(Any, response.json())
return response_200
if response.status_code == HTTPStatus.NOT_FOUND:
response_404 = cast(Any, None)
return response_404
@ -38,7 +40,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -102,7 +104,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return sync_detailed(
@ -159,7 +161,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError]
Response[Union[Any, HTTPValidationError]]
"""
return (

View File

@ -32,7 +32,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -52,7 +51,7 @@ def _parse_response(
return response_422
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:
return None
@ -123,7 +122,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, VideoPublic]
Response[Union[Any, HTTPValidationError, VideoPublic]]
"""
return sync_detailed(
@ -186,7 +185,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, VideoPublic]
Response[Union[Any, HTTPValidationError, VideoPublic]]
"""
return (

View File

@ -32,7 +32,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"params": params,
}
@ -52,7 +51,7 @@ def _parse_response(
return response_422
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:
return None
@ -123,7 +122,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, VideoPublic]
Response[Union[Any, HTTPValidationError, VideoPublic]]
"""
return sync_detailed(
@ -186,7 +185,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, VideoPublic]
Response[Union[Any, HTTPValidationError, VideoPublic]]
"""
return (

View File

@ -36,7 +36,6 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"follow_redirects": client.follow_redirects,
"files": multipart_multipart_data,
"params": params,
}
@ -55,7 +54,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
return response_422
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:
return None
@ -129,7 +128,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, Video]
Response[Union[Any, HTTPValidationError, Video]]
"""
return sync_detailed(
@ -198,7 +197,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.
Returns:
Union[Any, HTTPValidationError, Video]
Response[Union[Any, HTTPValidationError, Video]]
"""
return (

View File

@ -18,7 +18,6 @@ class Client:
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
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
@ -27,7 +26,6 @@ class Client:
timeout: float = attr.ib(5.0, 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)
follow_redirects: bool = attr.ib(False, kw_only=True)
def get_headers(self) -> Dict[str, str]:
"""Get headers to be used in all endpoints"""

View File

@ -4,11 +4,7 @@
class UnexpectedStatus(Exception):
"""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"]

View File

@ -1,12 +1,12 @@
""" Contains some shared types for properties """
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
class Unset:
def __bool__(self) -> Literal[False]:
def __bool__(self) -> bool:
return False

View File

@ -7,7 +7,7 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
setup(
name="PhotosAPI_Client",
version="0.3.0",
version="0.2.0",
description="A client library for accessing Photos API",
long_description=long_description,
long_description_content_type="text/markdown",