Skip to content
Snippets Groups Projects
Verified Commit 19dab67d authored by Georg Krause's avatar Georg Krause
Browse files

Update to current develop

parent 754c4f56
No related branches found
No related tags found
1 merge request!1Add basic model tests
Pipeline #23811 passed
Showing
with 984 additions and 354 deletions
...@@ -3,17 +3,17 @@ from typing import Any, Dict, Optional ...@@ -3,17 +3,17 @@ from typing import Any, Dict, Optional
import httpx import httpx
from ...client import AuthenticatedClient from ...client import AuthenticatedClient
from ...models.channel import Channel from ...models.channel_create import ChannelCreate
from ...models.channel_request import ChannelRequest from ...models.channel_create_request import ChannelCreateRequest
from ...types import Response from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelCreateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelCreateRequest,
json_body: ChannelRequest, json_body: ChannelCreateRequest,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/api/v1/channels/".format(client.base_url) url = "{}/api/v1/channels/".format(client.base_url)
...@@ -34,15 +34,15 @@ def _get_kwargs( ...@@ -34,15 +34,15 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Channel]: def _parse_response(*, response: httpx.Response) -> Optional[ChannelCreate]:
if response.status_code == 201: if response.status_code == 201:
response_201 = Channel.from_dict(response.json()) response_201 = ChannelCreate.from_dict(response.json())
return response_201 return response_201
return None return None
def _build_response(*, response: httpx.Response) -> Response[Channel]: def _build_response(*, response: httpx.Response) -> Response[ChannelCreate]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
...@@ -54,17 +54,17 @@ def _build_response(*, response: httpx.Response) -> Response[Channel]: ...@@ -54,17 +54,17 @@ def _build_response(*, response: httpx.Response) -> Response[Channel]:
def sync_detailed( def sync_detailed(
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelCreateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelCreateRequest,
json_body: ChannelRequest, json_body: ChannelCreateRequest,
) -> Response[Channel]: ) -> Response[ChannelCreate]:
""" """
Args: Args:
multipart_data (ChannelRequest): multipart_data (ChannelCreateRequest):
json_body (ChannelRequest): json_body (ChannelCreateRequest):
Returns: Returns:
Response[Channel] Response[ChannelCreate]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -85,17 +85,17 @@ def sync_detailed( ...@@ -85,17 +85,17 @@ def sync_detailed(
def sync( def sync(
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelCreateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelCreateRequest,
json_body: ChannelRequest, json_body: ChannelCreateRequest,
) -> Optional[Channel]: ) -> Optional[ChannelCreate]:
""" """
Args: Args:
multipart_data (ChannelRequest): multipart_data (ChannelCreateRequest):
json_body (ChannelRequest): json_body (ChannelCreateRequest):
Returns: Returns:
Response[Channel] Response[ChannelCreate]
""" """
return sync_detailed( return sync_detailed(
...@@ -109,17 +109,17 @@ def sync( ...@@ -109,17 +109,17 @@ def sync(
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelCreateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelCreateRequest,
json_body: ChannelRequest, json_body: ChannelCreateRequest,
) -> Response[Channel]: ) -> Response[ChannelCreate]:
""" """
Args: Args:
multipart_data (ChannelRequest): multipart_data (ChannelCreateRequest):
json_body (ChannelRequest): json_body (ChannelCreateRequest):
Returns: Returns:
Response[Channel] Response[ChannelCreate]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -138,17 +138,17 @@ async def asyncio_detailed( ...@@ -138,17 +138,17 @@ async def asyncio_detailed(
async def asyncio( async def asyncio(
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelCreateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelCreateRequest,
json_body: ChannelRequest, json_body: ChannelCreateRequest,
) -> Optional[Channel]: ) -> Optional[ChannelCreate]:
""" """
Args: Args:
multipart_data (ChannelRequest): multipart_data (ChannelCreateRequest):
json_body (ChannelRequest): json_body (ChannelCreateRequest):
Returns: Returns:
Response[Channel] Response[ChannelCreate]
""" """
return ( return (
......
...@@ -3,8 +3,8 @@ from typing import Any, Dict, Optional ...@@ -3,8 +3,8 @@ from typing import Any, Dict, Optional
import httpx import httpx
from ...client import AuthenticatedClient from ...client import AuthenticatedClient
from ...models.channel import Channel from ...models.channel_update import ChannelUpdate
from ...models.patched_channel_request import PatchedChannelRequest from ...models.patched_channel_update_request import PatchedChannelUpdateRequest
from ...types import Response from ...types import Response
...@@ -12,9 +12,9 @@ def _get_kwargs( ...@@ -12,9 +12,9 @@ def _get_kwargs(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: PatchedChannelRequest, form_data: PatchedChannelUpdateRequest,
multipart_data: PatchedChannelRequest, multipart_data: PatchedChannelUpdateRequest,
json_body: PatchedChannelRequest, json_body: PatchedChannelUpdateRequest,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/api/v1/channels/{composite}/".format(client.base_url, composite=composite) url = "{}/api/v1/channels/{composite}/".format(client.base_url, composite=composite)
...@@ -35,15 +35,15 @@ def _get_kwargs( ...@@ -35,15 +35,15 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Channel]: def _parse_response(*, response: httpx.Response) -> Optional[ChannelUpdate]:
if response.status_code == 200: if response.status_code == 200:
response_200 = Channel.from_dict(response.json()) response_200 = ChannelUpdate.from_dict(response.json())
return response_200 return response_200
return None return None
def _build_response(*, response: httpx.Response) -> Response[Channel]: def _build_response(*, response: httpx.Response) -> Response[ChannelUpdate]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
...@@ -56,18 +56,18 @@ def sync_detailed( ...@@ -56,18 +56,18 @@ def sync_detailed(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: PatchedChannelRequest, form_data: PatchedChannelUpdateRequest,
multipart_data: PatchedChannelRequest, multipart_data: PatchedChannelUpdateRequest,
json_body: PatchedChannelRequest, json_body: PatchedChannelUpdateRequest,
) -> Response[Channel]: ) -> Response[ChannelUpdate]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (PatchedChannelRequest): multipart_data (PatchedChannelUpdateRequest):
json_body (PatchedChannelRequest): json_body (PatchedChannelUpdateRequest):
Returns: Returns:
Response[Channel] Response[ChannelUpdate]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -90,18 +90,18 @@ def sync( ...@@ -90,18 +90,18 @@ def sync(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: PatchedChannelRequest, form_data: PatchedChannelUpdateRequest,
multipart_data: PatchedChannelRequest, multipart_data: PatchedChannelUpdateRequest,
json_body: PatchedChannelRequest, json_body: PatchedChannelUpdateRequest,
) -> Optional[Channel]: ) -> Optional[ChannelUpdate]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (PatchedChannelRequest): multipart_data (PatchedChannelUpdateRequest):
json_body (PatchedChannelRequest): json_body (PatchedChannelUpdateRequest):
Returns: Returns:
Response[Channel] Response[ChannelUpdate]
""" """
return sync_detailed( return sync_detailed(
...@@ -117,18 +117,18 @@ async def asyncio_detailed( ...@@ -117,18 +117,18 @@ async def asyncio_detailed(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: PatchedChannelRequest, form_data: PatchedChannelUpdateRequest,
multipart_data: PatchedChannelRequest, multipart_data: PatchedChannelUpdateRequest,
json_body: PatchedChannelRequest, json_body: PatchedChannelUpdateRequest,
) -> Response[Channel]: ) -> Response[ChannelUpdate]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (PatchedChannelRequest): multipart_data (PatchedChannelUpdateRequest):
json_body (PatchedChannelRequest): json_body (PatchedChannelUpdateRequest):
Returns: Returns:
Response[Channel] Response[ChannelUpdate]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -149,18 +149,18 @@ async def asyncio( ...@@ -149,18 +149,18 @@ async def asyncio(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: PatchedChannelRequest, form_data: PatchedChannelUpdateRequest,
multipart_data: PatchedChannelRequest, multipart_data: PatchedChannelUpdateRequest,
json_body: PatchedChannelRequest, json_body: PatchedChannelUpdateRequest,
) -> Optional[Channel]: ) -> Optional[ChannelUpdate]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (PatchedChannelRequest): multipart_data (PatchedChannelUpdateRequest):
json_body (PatchedChannelRequest): json_body (PatchedChannelUpdateRequest):
Returns: Returns:
Response[Channel] Response[ChannelUpdate]
""" """
return ( return (
......
from typing import Any, Dict, Optional from typing import Any, Dict
import httpx import httpx
from ...client import AuthenticatedClient from ...client import AuthenticatedClient
from ...models.subscription import Subscription
from ...types import Response from ...types import Response
...@@ -26,20 +25,12 @@ def _get_kwargs( ...@@ -26,20 +25,12 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Subscription]: def _build_response(*, response: httpx.Response) -> Response[Any]:
if response.status_code == 200:
response_200 = Subscription.from_dict(response.json())
return response_200
return None
def _build_response(*, response: httpx.Response) -> Response[Subscription]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
headers=response.headers, headers=response.headers,
parsed=_parse_response(response=response), parsed=None,
) )
...@@ -47,13 +38,13 @@ def sync_detailed( ...@@ -47,13 +38,13 @@ def sync_detailed(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
) -> Response[Subscription]: ) -> Response[Any]:
""" """
Args: Args:
composite (str): composite (str):
Returns: Returns:
Response[Subscription] Response[Any]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -69,36 +60,17 @@ def sync_detailed( ...@@ -69,36 +60,17 @@ def sync_detailed(
return _build_response(response=response) return _build_response(response=response)
def sync(
composite: str,
*,
client: AuthenticatedClient,
) -> Optional[Subscription]:
"""
Args:
composite (str):
Returns:
Response[Subscription]
"""
return sync_detailed(
composite=composite,
client=client,
).parsed
async def asyncio_detailed( async def asyncio_detailed(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
) -> Response[Subscription]: ) -> Response[Any]:
""" """
Args: Args:
composite (str): composite (str):
Returns: Returns:
Response[Subscription] Response[Any]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -110,24 +82,3 @@ async def asyncio_detailed( ...@@ -110,24 +82,3 @@ async def asyncio_detailed(
response = await _client.request(**kwargs) response = await _client.request(**kwargs)
return _build_response(response=response) return _build_response(response=response)
async def asyncio(
composite: str,
*,
client: AuthenticatedClient,
) -> Optional[Subscription]:
"""
Args:
composite (str):
Returns:
Response[Subscription]
"""
return (
await asyncio_detailed(
composite=composite,
client=client,
)
).parsed
from typing import Any, Dict, Optional from typing import Any, Dict
import httpx import httpx
from ...client import AuthenticatedClient from ...client import AuthenticatedClient
from ...models.channel import Channel
from ...models.channel_request import ChannelRequest
from ...types import Response from ...types import Response
def _get_kwargs( def _get_kwargs(
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest,
multipart_data: ChannelRequest,
json_body: ChannelRequest,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/api/v1/channels/rss-subscribe/".format(client.base_url) url = "{}/api/v1/channels/rss-subscribe/".format(client.base_url)
headers: Dict[str, str] = client.get_headers() headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
json_body.to_dict()
multipart_data.to_multipart()
return { return {
"method": "post", "method": "post",
"url": url, "url": url,
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
"data": form_data.to_dict(),
} }
def _parse_response(*, response: httpx.Response) -> Optional[Channel]: def _build_response(*, response: httpx.Response) -> Response[Any]:
if response.status_code == 200:
response_200 = Channel.from_dict(response.json())
return response_200
return None
def _build_response(*, response: httpx.Response) -> Response[Channel]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
headers=response.headers, headers=response.headers,
parsed=_parse_response(response=response), parsed=None,
) )
def sync_detailed( def sync_detailed(
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, ) -> Response[Any]:
multipart_data: ChannelRequest,
json_body: ChannelRequest,
) -> Response[Channel]:
""" """
Args:
multipart_data (ChannelRequest):
json_body (ChannelRequest):
Returns: Returns:
Response[Channel] Response[Any]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
form_data=form_data,
multipart_data=multipart_data,
json_body=json_body,
) )
response = httpx.request( response = httpx.request(
...@@ -82,80 +54,20 @@ def sync_detailed( ...@@ -82,80 +54,20 @@ def sync_detailed(
return _build_response(response=response) return _build_response(response=response)
def sync(
*,
client: AuthenticatedClient,
form_data: ChannelRequest,
multipart_data: ChannelRequest,
json_body: ChannelRequest,
) -> Optional[Channel]:
"""
Args:
multipart_data (ChannelRequest):
json_body (ChannelRequest):
Returns:
Response[Channel]
"""
return sync_detailed(
client=client,
form_data=form_data,
multipart_data=multipart_data,
json_body=json_body,
).parsed
async def asyncio_detailed( async def asyncio_detailed(
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, ) -> Response[Any]:
multipart_data: ChannelRequest,
json_body: ChannelRequest,
) -> Response[Channel]:
""" """
Args:
multipart_data (ChannelRequest):
json_body (ChannelRequest):
Returns: Returns:
Response[Channel] Response[Any]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
client=client, client=client,
form_data=form_data,
multipart_data=multipart_data,
json_body=json_body,
) )
async with httpx.AsyncClient(verify=client.verify_ssl) as _client: async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.request(**kwargs) response = await _client.request(**kwargs)
return _build_response(response=response) return _build_response(response=response)
async def asyncio(
*,
client: AuthenticatedClient,
form_data: ChannelRequest,
multipart_data: ChannelRequest,
json_body: ChannelRequest,
) -> Optional[Channel]:
"""
Args:
multipart_data (ChannelRequest):
json_body (ChannelRequest):
Returns:
Response[Channel]
"""
return (
await asyncio_detailed(
client=client,
form_data=form_data,
multipart_data=multipart_data,
json_body=json_body,
)
).parsed
...@@ -3,7 +3,6 @@ from typing import Any, Dict ...@@ -3,7 +3,6 @@ from typing import Any, Dict
import httpx import httpx
from ...client import AuthenticatedClient from ...client import AuthenticatedClient
from ...models.channel_request import ChannelRequest
from ...types import Response from ...types import Response
...@@ -11,26 +10,18 @@ def _get_kwargs( ...@@ -11,26 +10,18 @@ def _get_kwargs(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest,
multipart_data: ChannelRequest,
json_body: ChannelRequest,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/api/v1/channels/{composite}/unsubscribe/".format(client.base_url, composite=composite) url = "{}/api/v1/channels/{composite}/unsubscribe/".format(client.base_url, composite=composite)
headers: Dict[str, str] = client.get_headers() headers: Dict[str, str] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies() cookies: Dict[str, Any] = client.get_cookies()
json_body.to_dict()
multipart_data.to_multipart()
return { return {
"method": "post", "method": "post",
"url": url, "url": url,
"headers": headers, "headers": headers,
"cookies": cookies, "cookies": cookies,
"timeout": client.get_timeout(), "timeout": client.get_timeout(),
"data": form_data.to_dict(),
} }
...@@ -47,15 +38,10 @@ def sync_detailed( ...@@ -47,15 +38,10 @@ def sync_detailed(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest,
multipart_data: ChannelRequest,
json_body: ChannelRequest,
) -> Response[Any]: ) -> Response[Any]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (ChannelRequest):
json_body (ChannelRequest):
Returns: Returns:
Response[Any] Response[Any]
...@@ -64,9 +50,6 @@ def sync_detailed( ...@@ -64,9 +50,6 @@ def sync_detailed(
kwargs = _get_kwargs( kwargs = _get_kwargs(
composite=composite, composite=composite,
client=client, client=client,
form_data=form_data,
multipart_data=multipart_data,
json_body=json_body,
) )
response = httpx.request( response = httpx.request(
...@@ -81,15 +64,10 @@ async def asyncio_detailed( ...@@ -81,15 +64,10 @@ async def asyncio_detailed(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest,
multipart_data: ChannelRequest,
json_body: ChannelRequest,
) -> Response[Any]: ) -> Response[Any]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (ChannelRequest):
json_body (ChannelRequest):
Returns: Returns:
Response[Any] Response[Any]
...@@ -98,9 +76,6 @@ async def asyncio_detailed( ...@@ -98,9 +76,6 @@ async def asyncio_detailed(
kwargs = _get_kwargs( kwargs = _get_kwargs(
composite=composite, composite=composite,
client=client, client=client,
form_data=form_data,
multipart_data=multipart_data,
json_body=json_body,
) )
async with httpx.AsyncClient(verify=client.verify_ssl) as _client: async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
......
...@@ -3,8 +3,8 @@ from typing import Any, Dict, Optional ...@@ -3,8 +3,8 @@ from typing import Any, Dict, Optional
import httpx import httpx
from ...client import AuthenticatedClient from ...client import AuthenticatedClient
from ...models.channel import Channel from ...models.channel_update import ChannelUpdate
from ...models.channel_request import ChannelRequest from ...models.channel_update_request import ChannelUpdateRequest
from ...types import Response from ...types import Response
...@@ -12,9 +12,9 @@ def _get_kwargs( ...@@ -12,9 +12,9 @@ def _get_kwargs(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelUpdateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelUpdateRequest,
json_body: ChannelRequest, json_body: ChannelUpdateRequest,
) -> Dict[str, Any]: ) -> Dict[str, Any]:
url = "{}/api/v1/channels/{composite}/".format(client.base_url, composite=composite) url = "{}/api/v1/channels/{composite}/".format(client.base_url, composite=composite)
...@@ -35,15 +35,15 @@ def _get_kwargs( ...@@ -35,15 +35,15 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Channel]: def _parse_response(*, response: httpx.Response) -> Optional[ChannelUpdate]:
if response.status_code == 200: if response.status_code == 200:
response_200 = Channel.from_dict(response.json()) response_200 = ChannelUpdate.from_dict(response.json())
return response_200 return response_200
return None return None
def _build_response(*, response: httpx.Response) -> Response[Channel]: def _build_response(*, response: httpx.Response) -> Response[ChannelUpdate]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
...@@ -56,18 +56,18 @@ def sync_detailed( ...@@ -56,18 +56,18 @@ def sync_detailed(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelUpdateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelUpdateRequest,
json_body: ChannelRequest, json_body: ChannelUpdateRequest,
) -> Response[Channel]: ) -> Response[ChannelUpdate]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (ChannelRequest): multipart_data (ChannelUpdateRequest):
json_body (ChannelRequest): json_body (ChannelUpdateRequest):
Returns: Returns:
Response[Channel] Response[ChannelUpdate]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -90,18 +90,18 @@ def sync( ...@@ -90,18 +90,18 @@ def sync(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelUpdateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelUpdateRequest,
json_body: ChannelRequest, json_body: ChannelUpdateRequest,
) -> Optional[Channel]: ) -> Optional[ChannelUpdate]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (ChannelRequest): multipart_data (ChannelUpdateRequest):
json_body (ChannelRequest): json_body (ChannelUpdateRequest):
Returns: Returns:
Response[Channel] Response[ChannelUpdate]
""" """
return sync_detailed( return sync_detailed(
...@@ -117,18 +117,18 @@ async def asyncio_detailed( ...@@ -117,18 +117,18 @@ async def asyncio_detailed(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelUpdateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelUpdateRequest,
json_body: ChannelRequest, json_body: ChannelUpdateRequest,
) -> Response[Channel]: ) -> Response[ChannelUpdate]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (ChannelRequest): multipart_data (ChannelUpdateRequest):
json_body (ChannelRequest): json_body (ChannelUpdateRequest):
Returns: Returns:
Response[Channel] Response[ChannelUpdate]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -149,18 +149,18 @@ async def asyncio( ...@@ -149,18 +149,18 @@ async def asyncio(
composite: str, composite: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
form_data: ChannelRequest, form_data: ChannelUpdateRequest,
multipart_data: ChannelRequest, multipart_data: ChannelUpdateRequest,
json_body: ChannelRequest, json_body: ChannelUpdateRequest,
) -> Optional[Channel]: ) -> Optional[ChannelUpdate]:
""" """
Args: Args:
composite (str): composite (str):
multipart_data (ChannelRequest): multipart_data (ChannelUpdateRequest):
json_body (ChannelRequest): json_body (ChannelUpdateRequest):
Returns: Returns:
Response[Channel] Response[ChannelUpdate]
""" """
return ( return (
......
from typing import Any, Dict, Optional from typing import Any, Dict
import httpx import httpx
from ...client import AuthenticatedClient from ...client import AuthenticatedClient
from ...models.track import Track
from ...types import Response from ...types import Response
...@@ -26,20 +25,12 @@ def _get_kwargs( ...@@ -26,20 +25,12 @@ def _get_kwargs(
} }
def _parse_response(*, response: httpx.Response) -> Optional[Track]: def _build_response(*, response: httpx.Response) -> Response[Any]:
if response.status_code == 200:
response_200 = Track.from_dict(response.json())
return response_200
return None
def _build_response(*, response: httpx.Response) -> Response[Track]:
return Response( return Response(
status_code=response.status_code, status_code=response.status_code,
content=response.content, content=response.content,
headers=response.headers, headers=response.headers,
parsed=_parse_response(response=response), parsed=None,
) )
...@@ -47,13 +38,13 @@ def sync_detailed( ...@@ -47,13 +38,13 @@ def sync_detailed(
uuid: str, uuid: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
) -> Response[Track]: ) -> Response[Any]:
""" """
Args: Args:
uuid (str): uuid (str):
Returns: Returns:
Response[Track] Response[Any]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -69,36 +60,17 @@ def sync_detailed( ...@@ -69,36 +60,17 @@ def sync_detailed(
return _build_response(response=response) return _build_response(response=response)
def sync(
uuid: str,
*,
client: AuthenticatedClient,
) -> Optional[Track]:
"""
Args:
uuid (str):
Returns:
Response[Track]
"""
return sync_detailed(
uuid=uuid,
client=client,
).parsed
async def asyncio_detailed( async def asyncio_detailed(
uuid: str, uuid: str,
*, *,
client: AuthenticatedClient, client: AuthenticatedClient,
) -> Response[Track]: ) -> Response[Any]:
""" """
Args: Args:
uuid (str): uuid (str):
Returns: Returns:
Response[Track] Response[Any]
""" """
kwargs = _get_kwargs( kwargs = _get_kwargs(
...@@ -110,24 +82,3 @@ async def asyncio_detailed( ...@@ -110,24 +82,3 @@ async def asyncio_detailed(
response = await _client.request(**kwargs) response = await _client.request(**kwargs)
return _build_response(response=response) return _build_response(response=response)
async def asyncio(
uuid: str,
*,
client: AuthenticatedClient,
) -> Optional[Track]:
"""
Args:
uuid (str):
Returns:
Response[Track]
"""
return (
await asyncio_detailed(
uuid=uuid,
client=client,
)
).parsed
...@@ -39,9 +39,15 @@ from .attachment import Attachment ...@@ -39,9 +39,15 @@ from .attachment import Attachment
from .attachment_request import AttachmentRequest from .attachment_request import AttachmentRequest
from .attachment_urls import AttachmentUrls from .attachment_urls import AttachmentUrls
from .channel import Channel from .channel import Channel
from .channel_create import ChannelCreate
from .channel_create_metadata import ChannelCreateMetadata
from .channel_create_request import ChannelCreateRequest
from .channel_create_request_metadata import ChannelCreateRequestMetadata
from .channel_metadata import ChannelMetadata from .channel_metadata import ChannelMetadata
from .channel_request import ChannelRequest from .channel_update import ChannelUpdate
from .channel_request_metadata import ChannelRequestMetadata from .channel_update_metadata import ChannelUpdateMetadata
from .channel_update_request import ChannelUpdateRequest
from .channel_update_request_metadata import ChannelUpdateRequestMetadata
from .content import Content from .content import Content
from .content_category_enum import ContentCategoryEnum from .content_category_enum import ContentCategoryEnum
from .content_request import ContentRequest from .content_request import ContentRequest
...@@ -220,8 +226,8 @@ from .password_reset_confirm import PasswordResetConfirm ...@@ -220,8 +226,8 @@ from .password_reset_confirm import PasswordResetConfirm
from .password_reset_confirm_request import PasswordResetConfirmRequest from .password_reset_confirm_request import PasswordResetConfirmRequest
from .password_reset_request import PasswordResetRequest from .password_reset_request import PasswordResetRequest
from .patched_application_request import PatchedApplicationRequest from .patched_application_request import PatchedApplicationRequest
from .patched_channel_request import PatchedChannelRequest from .patched_channel_update_request import PatchedChannelUpdateRequest
from .patched_channel_request_metadata import PatchedChannelRequestMetadata from .patched_channel_update_request_metadata import PatchedChannelUpdateRequestMetadata
from .patched_global_preference_request import PatchedGlobalPreferenceRequest from .patched_global_preference_request import PatchedGlobalPreferenceRequest
from .patched_inbox_item_request import PatchedInboxItemRequest from .patched_inbox_item_request import PatchedInboxItemRequest
from .patched_library_for_owner_request import PatchedLibraryForOwnerRequest from .patched_library_for_owner_request import PatchedLibraryForOwnerRequest
......
from typing import Any, Dict, List, Optional, Type, TypeVar, Union, cast
import attr
from ..models.channel_create_metadata import ChannelCreateMetadata
from ..models.content import Content
from ..models.content_category_enum import ContentCategoryEnum
from ..types import UNSET, Unset
T = TypeVar("T", bound="ChannelCreate")
@attr.s(auto_attribs=True)
class ChannelCreate:
"""
Attributes:
name (str):
username (str):
tags (List[str]):
content_category (ContentCategoryEnum):
description (Optional[Content]):
metadata (Union[Unset, ChannelCreateMetadata]):
"""
name: str
username: str
tags: List[str]
content_category: ContentCategoryEnum
description: Optional[Content]
metadata: Union[Unset, ChannelCreateMetadata] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
name = self.name
username = self.username
tags = self.tags
content_category = self.content_category.value
description = self.description.to_dict() if self.description else None
metadata: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(self.metadata, Unset):
metadata = self.metadata.to_dict()
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"name": name,
"username": username,
"tags": tags,
"content_category": content_category,
"description": description,
}
)
if metadata is not UNSET:
field_dict["metadata"] = metadata
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
name = d.pop("name")
username = d.pop("username")
tags = cast(List[str], d.pop("tags"))
content_category = ContentCategoryEnum(d.pop("content_category"))
_description = d.pop("description")
description: Optional[Content]
if _description is None:
description = None
else:
description = Content.from_dict(_description)
_metadata = d.pop("metadata", UNSET)
metadata: Union[Unset, ChannelCreateMetadata]
if isinstance(_metadata, Unset):
metadata = UNSET
else:
metadata = ChannelCreateMetadata.from_dict(_metadata)
channel_create = cls(
name=name,
username=username,
tags=tags,
content_category=content_category,
description=description,
metadata=metadata,
)
channel_create.additional_properties = d
return channel_create
@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
...@@ -2,11 +2,11 @@ from typing import Any, Dict, List, Type, TypeVar ...@@ -2,11 +2,11 @@ from typing import Any, Dict, List, Type, TypeVar
import attr import attr
T = TypeVar("T", bound="ChannelRequestMetadata") T = TypeVar("T", bound="ChannelCreateMetadata")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class ChannelRequestMetadata: class ChannelCreateMetadata:
""" """ """ """
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
...@@ -22,10 +22,10 @@ class ChannelRequestMetadata: ...@@ -22,10 +22,10 @@ class ChannelRequestMetadata:
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
channel_request_metadata = cls() channel_create_metadata = cls()
channel_request_metadata.additional_properties = d channel_create_metadata.additional_properties = d
return channel_request_metadata return channel_create_metadata
@property @property
def additional_keys(self) -> List[str]: def additional_keys(self) -> List[str]:
......
import json
from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union, cast
import attr
from ..models.channel_create_request_metadata import ChannelCreateRequestMetadata
from ..models.content_category_enum import ContentCategoryEnum
from ..models.content_request import ContentRequest
from ..types import UNSET, Unset
T = TypeVar("T", bound="ChannelCreateRequest")
@attr.s(auto_attribs=True)
class ChannelCreateRequest:
"""
Attributes:
name (str):
username (str):
tags (List[str]):
content_category (ContentCategoryEnum):
cover (Union[Unset, None, str]):
description (Optional[ContentRequest]):
metadata (Union[Unset, ChannelCreateRequestMetadata]):
"""
name: str
username: str
tags: List[str]
content_category: ContentCategoryEnum
description: Optional[ContentRequest]
cover: Union[Unset, None, str] = UNSET
metadata: Union[Unset, ChannelCreateRequestMetadata] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
name = self.name
username = self.username
tags = self.tags
content_category = self.content_category.value
cover = self.cover
description = self.description.to_dict() if self.description else None
metadata: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(self.metadata, Unset):
metadata = self.metadata.to_dict()
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"name": name,
"username": username,
"tags": tags,
"content_category": content_category,
"description": description,
}
)
if cover is not UNSET:
field_dict["cover"] = cover
if metadata is not UNSET:
field_dict["metadata"] = metadata
return field_dict
def to_multipart(self) -> Dict[str, Any]:
name = self.name if isinstance(self.name, Unset) else (None, str(self.name).encode(), "text/plain")
username = (
self.username if isinstance(self.username, Unset) else (None, str(self.username).encode(), "text/plain")
)
_temp_tags = self.tags
tags = (None, json.dumps(_temp_tags).encode(), "application/json")
content_category = (None, str(self.content_category.value).encode(), "text/plain")
cover = self.cover if isinstance(self.cover, Unset) else (None, str(self.cover).encode(), "text/plain")
description = (
(None, json.dumps(self.description.to_dict()).encode(), "application/json") if self.description else None
)
metadata: Union[Unset, Tuple[None, bytes, str]] = UNSET
if not isinstance(self.metadata, Unset):
metadata = (None, json.dumps(self.metadata.to_dict()).encode(), "application/json")
field_dict: Dict[str, Any] = {}
field_dict.update(
{key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
)
field_dict.update(
{
"name": name,
"username": username,
"tags": tags,
"content_category": content_category,
"description": description,
}
)
if cover is not UNSET:
field_dict["cover"] = cover
if metadata is not UNSET:
field_dict["metadata"] = metadata
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
name = d.pop("name")
username = d.pop("username")
tags = cast(List[str], d.pop("tags"))
content_category = ContentCategoryEnum(d.pop("content_category"))
cover = d.pop("cover", UNSET)
_description = d.pop("description")
description: Optional[ContentRequest]
if _description is None:
description = None
else:
description = ContentRequest.from_dict(_description)
_metadata = d.pop("metadata", UNSET)
metadata: Union[Unset, ChannelCreateRequestMetadata]
if isinstance(_metadata, Unset):
metadata = UNSET
else:
metadata = ChannelCreateRequestMetadata.from_dict(_metadata)
channel_create_request = cls(
name=name,
username=username,
tags=tags,
content_category=content_category,
cover=cover,
description=description,
metadata=metadata,
)
channel_create_request.additional_properties = d
return channel_create_request
@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
...@@ -2,11 +2,11 @@ from typing import Any, Dict, List, Type, TypeVar ...@@ -2,11 +2,11 @@ from typing import Any, Dict, List, Type, TypeVar
import attr import attr
T = TypeVar("T", bound="PatchedChannelRequestMetadata") T = TypeVar("T", bound="ChannelCreateRequestMetadata")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class PatchedChannelRequestMetadata: class ChannelCreateRequestMetadata:
""" """ """ """
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
...@@ -22,10 +22,10 @@ class PatchedChannelRequestMetadata: ...@@ -22,10 +22,10 @@ class PatchedChannelRequestMetadata:
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
patched_channel_request_metadata = cls() channel_create_request_metadata = cls()
patched_channel_request_metadata.additional_properties = d channel_create_request_metadata.additional_properties = d
return patched_channel_request_metadata return channel_create_request_metadata
@property @property
def additional_keys(self) -> List[str]: def additional_keys(self) -> List[str]:
......
from typing import Any, Dict, List, Optional, Type, TypeVar, Union, cast
import attr
from ..models.channel_update_metadata import ChannelUpdateMetadata
from ..models.content import Content
from ..models.content_category_enum import ContentCategoryEnum
from ..types import UNSET, Unset
T = TypeVar("T", bound="ChannelUpdate")
@attr.s(auto_attribs=True)
class ChannelUpdate:
"""
Attributes:
name (str):
tags (List[str]):
content_category (ContentCategoryEnum):
description (Optional[Content]):
metadata (Union[Unset, ChannelUpdateMetadata]):
"""
name: str
tags: List[str]
content_category: ContentCategoryEnum
description: Optional[Content]
metadata: Union[Unset, ChannelUpdateMetadata] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
name = self.name
tags = self.tags
content_category = self.content_category.value
description = self.description.to_dict() if self.description else None
metadata: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(self.metadata, Unset):
metadata = self.metadata.to_dict()
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"name": name,
"tags": tags,
"content_category": content_category,
"description": description,
}
)
if metadata is not UNSET:
field_dict["metadata"] = metadata
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
name = d.pop("name")
tags = cast(List[str], d.pop("tags"))
content_category = ContentCategoryEnum(d.pop("content_category"))
_description = d.pop("description")
description: Optional[Content]
if _description is None:
description = None
else:
description = Content.from_dict(_description)
_metadata = d.pop("metadata", UNSET)
metadata: Union[Unset, ChannelUpdateMetadata]
if isinstance(_metadata, Unset):
metadata = UNSET
else:
metadata = ChannelUpdateMetadata.from_dict(_metadata)
channel_update = cls(
name=name,
tags=tags,
content_category=content_category,
description=description,
metadata=metadata,
)
channel_update.additional_properties = d
return channel_update
@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
from typing import Any, Dict, List, Type, TypeVar
import attr
T = TypeVar("T", bound="ChannelUpdateMetadata")
@attr.s(auto_attribs=True)
class ChannelUpdateMetadata:
""" """
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
channel_update_metadata = cls()
channel_update_metadata.additional_properties = d
return channel_update_metadata
@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
import datetime
import json import json
from typing import Any, Dict, List, Tuple, Type, TypeVar, Union from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union, cast
import attr import attr
from dateutil.parser import isoparse
from ..models.api_actor_request import APIActorRequest from ..models.channel_update_request_metadata import ChannelUpdateRequestMetadata
from ..models.channel_request_metadata import ChannelRequestMetadata from ..models.content_category_enum import ContentCategoryEnum
from ..models.simple_artist_request import SimpleArtistRequest from ..models.content_request import ContentRequest
from ..types import UNSET, Unset from ..types import UNSET, Unset
T = TypeVar("T", bound="ChannelRequest") T = TypeVar("T", bound="ChannelUpdateRequest")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class ChannelRequest: class ChannelUpdateRequest:
""" """
Attributes: Attributes:
artist (SimpleArtistRequest): name (str):
attributed_to (APIActorRequest): tags (List[str]):
rss_url (str): content_category (ContentCategoryEnum):
uuid (Union[Unset, str]): cover (Union[Unset, None, str]):
creation_date (Union[Unset, datetime.datetime]): description (Optional[ContentRequest]):
metadata (Union[Unset, ChannelRequestMetadata]): metadata (Union[Unset, ChannelUpdateRequestMetadata]):
""" """
artist: SimpleArtistRequest name: str
attributed_to: APIActorRequest tags: List[str]
rss_url: str content_category: ContentCategoryEnum
uuid: Union[Unset, str] = UNSET description: Optional[ContentRequest]
creation_date: Union[Unset, datetime.datetime] = UNSET cover: Union[Unset, None, str] = UNSET
metadata: Union[Unset, ChannelRequestMetadata] = UNSET metadata: Union[Unset, ChannelUpdateRequestMetadata] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
artist = self.artist.to_dict() name = self.name
tags = self.tags
attributed_to = self.attributed_to.to_dict() content_category = self.content_category.value
rss_url = self.rss_url cover = self.cover
uuid = self.uuid description = self.description.to_dict() if self.description else None
creation_date: Union[Unset, str] = UNSET
if not isinstance(self.creation_date, Unset):
creation_date = self.creation_date.isoformat()
metadata: Union[Unset, Dict[str, Any]] = UNSET metadata: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(self.metadata, Unset): if not isinstance(self.metadata, Unset):
...@@ -52,30 +48,30 @@ class ChannelRequest: ...@@ -52,30 +48,30 @@ class ChannelRequest:
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update( field_dict.update(
{ {
"artist": artist, "name": name,
"attributed_to": attributed_to, "tags": tags,
"rss_url": rss_url, "content_category": content_category,
"description": description,
} }
) )
if uuid is not UNSET: if cover is not UNSET:
field_dict["uuid"] = uuid field_dict["cover"] = cover
if creation_date is not UNSET:
field_dict["creation_date"] = creation_date
if metadata is not UNSET: if metadata is not UNSET:
field_dict["metadata"] = metadata field_dict["metadata"] = metadata
return field_dict return field_dict
def to_multipart(self) -> Dict[str, Any]: def to_multipart(self) -> Dict[str, Any]:
artist = (None, json.dumps(self.artist.to_dict()).encode(), "application/json") name = self.name if isinstance(self.name, Unset) else (None, str(self.name).encode(), "text/plain")
_temp_tags = self.tags
tags = (None, json.dumps(_temp_tags).encode(), "application/json")
attributed_to = (None, json.dumps(self.attributed_to.to_dict()).encode(), "application/json") content_category = (None, str(self.content_category.value).encode(), "text/plain")
rss_url = self.rss_url if isinstance(self.rss_url, Unset) else (None, str(self.rss_url).encode(), "text/plain") cover = self.cover if isinstance(self.cover, Unset) else (None, str(self.cover).encode(), "text/plain")
uuid = self.uuid if isinstance(self.uuid, Unset) else (None, str(self.uuid).encode(), "text/plain") description = (
creation_date: Union[Unset, bytes] = UNSET (None, json.dumps(self.description.to_dict()).encode(), "application/json") if self.description else None
if not isinstance(self.creation_date, Unset): )
creation_date = self.creation_date.isoformat().encode()
metadata: Union[Unset, Tuple[None, bytes, str]] = UNSET metadata: Union[Unset, Tuple[None, bytes, str]] = UNSET
if not isinstance(self.metadata, Unset): if not isinstance(self.metadata, Unset):
...@@ -87,15 +83,14 @@ class ChannelRequest: ...@@ -87,15 +83,14 @@ class ChannelRequest:
) )
field_dict.update( field_dict.update(
{ {
"artist": artist, "name": name,
"attributed_to": attributed_to, "tags": tags,
"rss_url": rss_url, "content_category": content_category,
"description": description,
} }
) )
if uuid is not UNSET: if cover is not UNSET:
field_dict["uuid"] = uuid field_dict["cover"] = cover
if creation_date is not UNSET:
field_dict["creation_date"] = creation_date
if metadata is not UNSET: if metadata is not UNSET:
field_dict["metadata"] = metadata field_dict["metadata"] = metadata
...@@ -104,39 +99,39 @@ class ChannelRequest: ...@@ -104,39 +99,39 @@ class ChannelRequest:
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
artist = SimpleArtistRequest.from_dict(d.pop("artist")) name = d.pop("name")
attributed_to = APIActorRequest.from_dict(d.pop("attributed_to")) tags = cast(List[str], d.pop("tags"))
rss_url = d.pop("rss_url") content_category = ContentCategoryEnum(d.pop("content_category"))
uuid = d.pop("uuid", UNSET) cover = d.pop("cover", UNSET)
_creation_date = d.pop("creation_date", UNSET) _description = d.pop("description")
creation_date: Union[Unset, datetime.datetime] description: Optional[ContentRequest]
if isinstance(_creation_date, Unset): if _description is None:
creation_date = UNSET description = None
else: else:
creation_date = isoparse(_creation_date) description = ContentRequest.from_dict(_description)
_metadata = d.pop("metadata", UNSET) _metadata = d.pop("metadata", UNSET)
metadata: Union[Unset, ChannelRequestMetadata] metadata: Union[Unset, ChannelUpdateRequestMetadata]
if isinstance(_metadata, Unset): if isinstance(_metadata, Unset):
metadata = UNSET metadata = UNSET
else: else:
metadata = ChannelRequestMetadata.from_dict(_metadata) metadata = ChannelUpdateRequestMetadata.from_dict(_metadata)
channel_request = cls( channel_update_request = cls(
artist=artist, name=name,
attributed_to=attributed_to, tags=tags,
rss_url=rss_url, content_category=content_category,
uuid=uuid, cover=cover,
creation_date=creation_date, description=description,
metadata=metadata, metadata=metadata,
) )
channel_request.additional_properties = d channel_update_request.additional_properties = d
return channel_request return channel_update_request
@property @property
def additional_keys(self) -> List[str]: def additional_keys(self) -> List[str]:
......
from typing import Any, Dict, List, Type, TypeVar
import attr
T = TypeVar("T", bound="ChannelUpdateRequestMetadata")
@attr.s(auto_attribs=True)
class ChannelUpdateRequestMetadata:
""" """
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
channel_update_request_metadata = cls()
channel_update_request_metadata.additional_properties = d
return channel_update_request_metadata
@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
import datetime
import json import json
from typing import Any, Dict, List, Tuple, Type, TypeVar, Union from typing import Any, Dict, List, Tuple, Type, TypeVar, Union, cast
import attr import attr
from dateutil.parser import isoparse
from ..models.api_actor_request import APIActorRequest from ..models.content_category_enum import ContentCategoryEnum
from ..models.patched_channel_request_metadata import PatchedChannelRequestMetadata from ..models.content_request import ContentRequest
from ..models.simple_artist_request import SimpleArtistRequest from ..models.patched_channel_update_request_metadata import PatchedChannelUpdateRequestMetadata
from ..types import UNSET, Unset from ..types import UNSET, Unset
T = TypeVar("T", bound="PatchedChannelRequest") T = TypeVar("T", bound="PatchedChannelUpdateRequest")
@attr.s(auto_attribs=True) @attr.s(auto_attribs=True)
class PatchedChannelRequest: class PatchedChannelUpdateRequest:
""" """
Attributes: Attributes:
uuid (Union[Unset, str]): cover (Union[Unset, None, str]):
artist (Union[Unset, SimpleArtistRequest]): name (Union[Unset, str]):
attributed_to (Union[Unset, APIActorRequest]): description (Union[Unset, None, ContentRequest]):
creation_date (Union[Unset, datetime.datetime]): tags (Union[Unset, List[str]]):
metadata (Union[Unset, PatchedChannelRequestMetadata]): content_category (Union[Unset, ContentCategoryEnum]):
rss_url (Union[Unset, str]): metadata (Union[Unset, PatchedChannelUpdateRequestMetadata]):
""" """
uuid: Union[Unset, str] = UNSET cover: Union[Unset, None, str] = UNSET
artist: Union[Unset, SimpleArtistRequest] = UNSET name: Union[Unset, str] = UNSET
attributed_to: Union[Unset, APIActorRequest] = UNSET description: Union[Unset, None, ContentRequest] = UNSET
creation_date: Union[Unset, datetime.datetime] = UNSET tags: Union[Unset, List[str]] = UNSET
metadata: Union[Unset, PatchedChannelRequestMetadata] = UNSET content_category: Union[Unset, ContentCategoryEnum] = UNSET
rss_url: Union[Unset, str] = UNSET metadata: Union[Unset, PatchedChannelUpdateRequestMetadata] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]: def to_dict(self) -> Dict[str, Any]:
uuid = self.uuid cover = self.cover
artist: Union[Unset, Dict[str, Any]] = UNSET name = self.name
if not isinstance(self.artist, Unset): description: Union[Unset, None, Dict[str, Any]] = UNSET
artist = self.artist.to_dict() if not isinstance(self.description, Unset):
description = self.description.to_dict() if self.description else None
attributed_to: Union[Unset, Dict[str, Any]] = UNSET tags: Union[Unset, List[str]] = UNSET
if not isinstance(self.attributed_to, Unset): if not isinstance(self.tags, Unset):
attributed_to = self.attributed_to.to_dict() tags = self.tags
creation_date: Union[Unset, str] = UNSET content_category: Union[Unset, str] = UNSET
if not isinstance(self.creation_date, Unset): if not isinstance(self.content_category, Unset):
creation_date = self.creation_date.isoformat() content_category = self.content_category.value
metadata: Union[Unset, Dict[str, Any]] = UNSET metadata: Union[Unset, Dict[str, Any]] = UNSET
if not isinstance(self.metadata, Unset): if not isinstance(self.metadata, Unset):
metadata = self.metadata.to_dict() metadata = self.metadata.to_dict()
rss_url = self.rss_url
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties) field_dict.update(self.additional_properties)
field_dict.update({}) field_dict.update({})
if uuid is not UNSET: if cover is not UNSET:
field_dict["uuid"] = uuid field_dict["cover"] = cover
if artist is not UNSET: if name is not UNSET:
field_dict["artist"] = artist field_dict["name"] = name
if attributed_to is not UNSET: if description is not UNSET:
field_dict["attributed_to"] = attributed_to field_dict["description"] = description
if creation_date is not UNSET: if tags is not UNSET:
field_dict["creation_date"] = creation_date field_dict["tags"] = tags
if content_category is not UNSET:
field_dict["content_category"] = content_category
if metadata is not UNSET: if metadata is not UNSET:
field_dict["metadata"] = metadata field_dict["metadata"] = metadata
if rss_url is not UNSET:
field_dict["rss_url"] = rss_url
return field_dict return field_dict
def to_multipart(self) -> Dict[str, Any]: def to_multipart(self) -> Dict[str, Any]:
uuid = self.uuid if isinstance(self.uuid, Unset) else (None, str(self.uuid).encode(), "text/plain") cover = self.cover if isinstance(self.cover, Unset) else (None, str(self.cover).encode(), "text/plain")
artist: Union[Unset, Tuple[None, bytes, str]] = UNSET name = self.name if isinstance(self.name, Unset) else (None, str(self.name).encode(), "text/plain")
if not isinstance(self.artist, Unset): description: Union[Unset, Tuple[None, bytes, str]] = UNSET
artist = (None, json.dumps(self.artist.to_dict()).encode(), "application/json") if not isinstance(self.description, Unset):
description = (
(None, json.dumps(self.description.to_dict()).encode(), "application/json")
if self.description
else None
)
attributed_to: Union[Unset, Tuple[None, bytes, str]] = UNSET tags: Union[Unset, Tuple[None, bytes, str]] = UNSET
if not isinstance(self.attributed_to, Unset): if not isinstance(self.tags, Unset):
attributed_to = (None, json.dumps(self.attributed_to.to_dict()).encode(), "application/json") _temp_tags = self.tags
tags = (None, json.dumps(_temp_tags).encode(), "application/json")
creation_date: Union[Unset, bytes] = UNSET content_category: Union[Unset, Tuple[None, bytes, str]] = UNSET
if not isinstance(self.creation_date, Unset): if not isinstance(self.content_category, Unset):
creation_date = self.creation_date.isoformat().encode() content_category = (None, str(self.content_category.value).encode(), "text/plain")
metadata: Union[Unset, Tuple[None, bytes, str]] = UNSET metadata: Union[Unset, Tuple[None, bytes, str]] = UNSET
if not isinstance(self.metadata, Unset): if not isinstance(self.metadata, Unset):
metadata = (None, json.dumps(self.metadata.to_dict()).encode(), "application/json") metadata = (None, json.dumps(self.metadata.to_dict()).encode(), "application/json")
rss_url = self.rss_url if isinstance(self.rss_url, Unset) else (None, str(self.rss_url).encode(), "text/plain")
field_dict: Dict[str, Any] = {} field_dict: Dict[str, Any] = {}
field_dict.update( field_dict.update(
{key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()} {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()}
) )
field_dict.update({}) field_dict.update({})
if uuid is not UNSET: if cover is not UNSET:
field_dict["uuid"] = uuid field_dict["cover"] = cover
if artist is not UNSET: if name is not UNSET:
field_dict["artist"] = artist field_dict["name"] = name
if attributed_to is not UNSET: if description is not UNSET:
field_dict["attributed_to"] = attributed_to field_dict["description"] = description
if creation_date is not UNSET: if tags is not UNSET:
field_dict["creation_date"] = creation_date field_dict["tags"] = tags
if content_category is not UNSET:
field_dict["content_category"] = content_category
if metadata is not UNSET: if metadata is not UNSET:
field_dict["metadata"] = metadata field_dict["metadata"] = metadata
if rss_url is not UNSET:
field_dict["rss_url"] = rss_url
return field_dict return field_dict
@classmethod @classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy() d = src_dict.copy()
uuid = d.pop("uuid", UNSET) cover = d.pop("cover", UNSET)
_artist = d.pop("artist", UNSET) name = d.pop("name", UNSET)
artist: Union[Unset, SimpleArtistRequest]
if isinstance(_artist, Unset):
artist = UNSET
else:
artist = SimpleArtistRequest.from_dict(_artist)
_attributed_to = d.pop("attributed_to", UNSET) _description = d.pop("description", UNSET)
attributed_to: Union[Unset, APIActorRequest] description: Union[Unset, None, ContentRequest]
if isinstance(_attributed_to, Unset): if _description is None:
attributed_to = UNSET description = None
elif isinstance(_description, Unset):
description = UNSET
else: else:
attributed_to = APIActorRequest.from_dict(_attributed_to) description = ContentRequest.from_dict(_description)
_creation_date = d.pop("creation_date", UNSET) tags = cast(List[str], d.pop("tags", UNSET))
creation_date: Union[Unset, datetime.datetime]
if isinstance(_creation_date, Unset): _content_category = d.pop("content_category", UNSET)
creation_date = UNSET content_category: Union[Unset, ContentCategoryEnum]
if isinstance(_content_category, Unset):
content_category = UNSET
else: else:
creation_date = isoparse(_creation_date) content_category = ContentCategoryEnum(_content_category)
_metadata = d.pop("metadata", UNSET) _metadata = d.pop("metadata", UNSET)
metadata: Union[Unset, PatchedChannelRequestMetadata] metadata: Union[Unset, PatchedChannelUpdateRequestMetadata]
if isinstance(_metadata, Unset): if isinstance(_metadata, Unset):
metadata = UNSET metadata = UNSET
else: else:
metadata = PatchedChannelRequestMetadata.from_dict(_metadata) metadata = PatchedChannelUpdateRequestMetadata.from_dict(_metadata)
rss_url = d.pop("rss_url", UNSET) patched_channel_update_request = cls(
cover=cover,
patched_channel_request = cls( name=name,
uuid=uuid, description=description,
artist=artist, tags=tags,
attributed_to=attributed_to, content_category=content_category,
creation_date=creation_date,
metadata=metadata, metadata=metadata,
rss_url=rss_url,
) )
patched_channel_request.additional_properties = d patched_channel_update_request.additional_properties = d
return patched_channel_request return patched_channel_update_request
@property @property
def additional_keys(self) -> List[str]: def additional_keys(self) -> List[str]:
......
from typing import Any, Dict, List, Type, TypeVar
import attr
T = TypeVar("T", bound="PatchedChannelUpdateRequestMetadata")
@attr.s(auto_attribs=True)
class PatchedChannelUpdateRequestMetadata:
""" """
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
patched_channel_update_request_metadata = cls()
patched_channel_update_request_metadata.additional_properties = d
return patched_channel_update_request_metadata
@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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment