diff --git a/osidb_bindings/bindings/.gitignore b/osidb_bindings/bindings/.gitignore index ed29cb9..79a2c3d 100644 --- a/osidb_bindings/bindings/.gitignore +++ b/osidb_bindings/bindings/.gitignore @@ -20,4 +20,4 @@ dmypy.json .idea/ /coverage.xml -/.coverage \ No newline at end of file +/.coverage diff --git a/osidb_bindings/bindings/README.md b/osidb_bindings/bindings/README.md index 8bd9c92..b052d04 100644 --- a/osidb_bindings/bindings/README.md +++ b/osidb_bindings/bindings/README.md @@ -25,9 +25,10 @@ from python_client.models import MyDataModel from python_client.api.my_tag import get_my_data_model from python_client.types import Response -my_data: MyDataModel = get_my_data_model.sync(client=client) -# or if you need more info (e.g. status_code) -response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) +with client as client: + my_data: MyDataModel = get_my_data_model.sync(client=client) + # or if you need more info (e.g. status_code) + response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) ``` Or do the same thing with an async version: @@ -37,8 +38,9 @@ from python_client.models import MyDataModel from python_client.api.my_tag import get_my_data_model from python_client.types import Response -my_data: MyDataModel = await get_my_data_model.asyncio(client=client) -response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) +async with client as client: + my_data: MyDataModel = await get_my_data_model.asyncio(client=client) + response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) ``` By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. @@ -65,14 +67,49 @@ Things to know: 1. Every path/method combo becomes a Python module with four functions: 1. `sync`: Blocking request that returns parsed data (if successful) or `None` 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. - 1. `asyncio`: Like `sync` but the async instead of blocking - 1. `asyncio_detailed`: Like `sync_detailed` by async instead of blocking + 1. `asyncio`: Like `sync` but async instead of blocking + 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking 1. All path/query params, and bodies become method arguments. 1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) 1. Any endpoint which did not have a tag will be in `python_client.api.default` -## Building / publishing this Client +## Advanced customizations + +There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): + +```python +from python_client import Client + +def log_request(request): + print(f"Request event hook: {request.method} {request.url} - Waiting for response") + +def log_response(response): + request = response.request + print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") + +client = Client( + base_url="https://api.example.com", + httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, +) + +# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() +``` + +You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): + +```python +import httpx +from python_client import Client + +client = Client( + base_url="https://api.example.com", +) +# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. +client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030")) +``` + +## Building / publishing this package This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: 1. Update the metadata in pyproject.toml (e.g. authors, version) 1. If you're using a private repository, configure it with Poetry @@ -84,4 +121,4 @@ If you want to install this client into another project without publishing it (e 1. If that project **is using Poetry**, you can simply do `poetry add ` from that project 1. If that project is not using Poetry: 1. Build a wheel with `poetry build -f wheel` - 1. Install that wheel from the other project `pip install ` \ No newline at end of file + 1. Install that wheel from the other project `pip install ` diff --git a/osidb_bindings/bindings/pyproject.toml b/osidb_bindings/bindings/pyproject.toml index d4df99b..88de38b 100644 --- a/osidb_bindings/bindings/pyproject.toml +++ b/osidb_bindings/bindings/pyproject.toml @@ -1,39 +1,27 @@ [tool.poetry] name = "bindings" -version = "4.6.0" +version = "4.6.1" description = "A client library for accessing OSIDB API" - authors = [] - readme = "README.md" packages = [ {include = "python_client"}, ] include = ["CHANGELOG.md", "python_client/py.typed"] + [tool.poetry.dependencies] -python = "^3.6" -httpx = ">=0.15.4,<0.21.0" -attrs = ">=20.1.0,<22.0.0" +python = "^3.9" +httpx = ">=0.20.0,<0.28.0" +attrs = ">=21.3.0" python-dateutil = "^2.8.0" [build-system] -requires = ["poetry>=1.0"] -build-backend = "poetry.masonry.api" +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" -[tool.black] +[tool.ruff] line-length = 120 -target_version = ['py36', 'py37', 'py38'] -exclude = ''' -( - /( - | \.git - | \.venv - | \.mypy_cache - )/ -) -''' -[tool.isort] -line_length = 120 -profile = "black" \ No newline at end of file +[tool.ruff.lint] +select = ["F", "I", "UP"] diff --git a/osidb_bindings/bindings/python_client/__init__.py b/osidb_bindings/bindings/python_client/__init__.py index 005b186..15ef6db 100644 --- a/osidb_bindings/bindings/python_client/__init__.py +++ b/osidb_bindings/bindings/python_client/__init__.py @@ -1,2 +1,8 @@ -""" A client library for accessing OSIDB API """ +"""A client library for accessing OSIDB API""" + from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/osidb_bindings/bindings/python_client/api/__init__.py b/osidb_bindings/bindings/python_client/api/__init__.py index dc035f4..81f9fa2 100644 --- a/osidb_bindings/bindings/python_client/api/__init__.py +++ b/osidb_bindings/bindings/python_client/api/__init__.py @@ -1 +1 @@ -""" Contains methods for accessing the API """ +"""Contains methods for accessing the API""" diff --git a/osidb_bindings/bindings/python_client/api/auth/__init__.py b/osidb_bindings/bindings/python_client/api/auth/__init__.py index 294b062..b708fc3 100644 --- a/osidb_bindings/bindings/python_client/api/auth/__init__.py +++ b/osidb_bindings/bindings/python_client/api/auth/__init__.py @@ -1,4 +1,4 @@ +from .auth_token_retrieve import * from .auth_token_create import * from .auth_token_refresh_create import * -from .auth_token_retrieve import * from .auth_token_verify_create import * diff --git a/osidb_bindings/bindings/python_client/api/auth/auth_token_create.py b/osidb_bindings/bindings/python_client/api/auth/auth_token_create.py index aa9f9d2..9d8be57 100644 --- a/osidb_bindings/bindings/python_client/api/auth/auth_token_create.py +++ b/osidb_bindings/bindings/python_client/api/auth/auth_token_create.py @@ -1,46 +1,46 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import Client +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.auth_token_create_response_200 import AuthTokenCreateResponse200 from ...models.token_obtain_pair import TokenObtainPair -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = TokenObtainPair def _get_kwargs( *, - client: Client, - form_data: TokenObtainPair, - multipart_data: TokenObtainPair, - json_body: TokenObtainPair, -) -> Dict[str, Any]: - url = "{}/auth/token".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenObtainPair, + TokenObtainPair, + TokenObtainPair, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/auth/token", + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, TokenObtainPair): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[AuthTokenCreateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -51,32 +51,51 @@ def _parse_response( response_200 = AuthTokenCreateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[AuthTokenCreateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, - client: Client, - form_data: TokenObtainPair, - multipart_data: TokenObtainPair, - json_body: TokenObtainPair, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenObtainPair, + TokenObtainPair, + TokenObtainPair, + ], ) -> Response[AuthTokenCreateResponse200]: + """Takes a set of user credentials and returns an access and refresh JSON web + token pair to prove the authentication of those credentials. + + Args: + body (TokenObtainPair): + body (TokenObtainPair): + body (TokenObtainPair): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AuthTokenCreateResponse200] + """ + kwargs = _get_kwargs( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -87,67 +106,102 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, - client: Client, - form_data: TokenObtainPair, - multipart_data: TokenObtainPair, - json_body: TokenObtainPair, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenObtainPair, + TokenObtainPair, + TokenObtainPair, + ], ) -> Optional[AuthTokenCreateResponse200]: """Takes a set of user credentials and returns an access and refresh JSON web - token pair to prove the authentication of those credentials.""" + token pair to prove the authentication of those credentials. + + Args: + body (TokenObtainPair): + body (TokenObtainPair): + body (TokenObtainPair): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AuthTokenCreateResponse200 + """ return sync_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, - client: Client, - form_data: TokenObtainPair, - multipart_data: TokenObtainPair, - json_body: TokenObtainPair, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenObtainPair, + TokenObtainPair, + TokenObtainPair, + ], ) -> Response[AuthTokenCreateResponse200]: + """Takes a set of user credentials and returns an access and refresh JSON web + token pair to prove the authentication of those credentials. + + Args: + body (TokenObtainPair): + body (TokenObtainPair): + body (TokenObtainPair): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AuthTokenCreateResponse200] + """ + kwargs = _get_kwargs( - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, - client: Client, - form_data: TokenObtainPair, - multipart_data: TokenObtainPair, - json_body: TokenObtainPair, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenObtainPair, + TokenObtainPair, + TokenObtainPair, + ], ) -> Optional[AuthTokenCreateResponse200]: """Takes a set of user credentials and returns an access and refresh JSON web - token pair to prove the authentication of those credentials.""" + token pair to prove the authentication of those credentials. + + Args: + body (TokenObtainPair): + body (TokenObtainPair): + body (TokenObtainPair): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AuthTokenCreateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/auth/auth_token_refresh_create.py b/osidb_bindings/bindings/python_client/api/auth/auth_token_refresh_create.py index e32a37d..94c2ad8 100644 --- a/osidb_bindings/bindings/python_client/api/auth/auth_token_refresh_create.py +++ b/osidb_bindings/bindings/python_client/api/auth/auth_token_refresh_create.py @@ -1,48 +1,46 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import Client -from ...models.auth_token_refresh_create_response_200 import ( - AuthTokenRefreshCreateResponse200, -) -from ...models.token_refresh import TokenRefresh -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = TokenRefresh +from ...models.auth_token_refresh_create_response_200 import AuthTokenRefreshCreateResponse200 +from ...models.token_refresh import TokenRefresh def _get_kwargs( *, - client: Client, - form_data: TokenRefresh, - multipart_data: TokenRefresh, - json_body: TokenRefresh, -) -> Dict[str, Any]: - url = "{}/auth/token/refresh".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenRefresh, + TokenRefresh, + TokenRefresh, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/auth/token/refresh", + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, TokenRefresh): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[AuthTokenRefreshCreateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -53,32 +51,51 @@ def _parse_response( response_200 = AuthTokenRefreshCreateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[AuthTokenRefreshCreateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, - client: Client, - form_data: TokenRefresh, - multipart_data: TokenRefresh, - json_body: TokenRefresh, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenRefresh, + TokenRefresh, + TokenRefresh, + ], ) -> Response[AuthTokenRefreshCreateResponse200]: + """Takes a refresh type JSON web token and returns an access type JSON web + token if the refresh token is valid. + + Args: + body (TokenRefresh): + body (TokenRefresh): + body (TokenRefresh): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AuthTokenRefreshCreateResponse200] + """ + kwargs = _get_kwargs( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -89,67 +106,102 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, - client: Client, - form_data: TokenRefresh, - multipart_data: TokenRefresh, - json_body: TokenRefresh, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenRefresh, + TokenRefresh, + TokenRefresh, + ], ) -> Optional[AuthTokenRefreshCreateResponse200]: """Takes a refresh type JSON web token and returns an access type JSON web - token if the refresh token is valid.""" + token if the refresh token is valid. + + Args: + body (TokenRefresh): + body (TokenRefresh): + body (TokenRefresh): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AuthTokenRefreshCreateResponse200 + """ return sync_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, - client: Client, - form_data: TokenRefresh, - multipart_data: TokenRefresh, - json_body: TokenRefresh, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenRefresh, + TokenRefresh, + TokenRefresh, + ], ) -> Response[AuthTokenRefreshCreateResponse200]: + """Takes a refresh type JSON web token and returns an access type JSON web + token if the refresh token is valid. + + Args: + body (TokenRefresh): + body (TokenRefresh): + body (TokenRefresh): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AuthTokenRefreshCreateResponse200] + """ + kwargs = _get_kwargs( - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, - client: Client, - form_data: TokenRefresh, - multipart_data: TokenRefresh, - json_body: TokenRefresh, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenRefresh, + TokenRefresh, + TokenRefresh, + ], ) -> Optional[AuthTokenRefreshCreateResponse200]: """Takes a refresh type JSON web token and returns an access type JSON web - token if the refresh token is valid.""" + token if the refresh token is valid. + + Args: + body (TokenRefresh): + body (TokenRefresh): + body (TokenRefresh): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AuthTokenRefreshCreateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/auth/auth_token_retrieve.py b/osidb_bindings/bindings/python_client/api/auth/auth_token_retrieve.py index 3d2fcdf..c37fa9d 100644 --- a/osidb_bindings/bindings/python_client/api/auth/auth_token_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/auth/auth_token_retrieve.py @@ -1,32 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.auth_token_retrieve_response_200 import AuthTokenRetrieveResponse200 -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.auth_token_retrieve_response_200 import AuthTokenRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/auth/token".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/auth/token", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[AuthTokenRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -37,17 +34,20 @@ def _parse_response( response_200 = AuthTokenRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[AuthTokenRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -55,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[AuthTokenRetrieveResponse200]: + """Takes a kerberos ticket and returns an access and refresh JWT pair. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AuthTokenRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -67,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[AuthTokenRetrieveResponse200]: - """Takes a kerberos ticket and returns an access and refresh JWT pair.""" + """Takes a kerberos ticket and returns an access and refresh JWT pair. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AuthTokenRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[AuthTokenRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """Takes a kerberos ticket and returns an access and refresh JWT pair. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[AuthTokenRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[AuthTokenRetrieveResponse200]: - """Takes a kerberos ticket and returns an access and refresh JWT pair.""" + """Takes a kerberos ticket and returns an access and refresh JWT pair. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AuthTokenRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/auth/auth_token_verify_create.py b/osidb_bindings/bindings/python_client/api/auth/auth_token_verify_create.py index f201e57..292269c 100644 --- a/osidb_bindings/bindings/python_client/api/auth/auth_token_verify_create.py +++ b/osidb_bindings/bindings/python_client/api/auth/auth_token_verify_create.py @@ -1,48 +1,46 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import Client -from ...models.auth_token_verify_create_response_200 import ( - AuthTokenVerifyCreateResponse200, -) -from ...models.token_verify import TokenVerify -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = TokenVerify +from ...models.auth_token_verify_create_response_200 import AuthTokenVerifyCreateResponse200 +from ...models.token_verify import TokenVerify def _get_kwargs( *, - client: Client, - form_data: TokenVerify, - multipart_data: TokenVerify, - json_body: TokenVerify, -) -> Dict[str, Any]: - url = "{}/auth/token/verify".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenVerify, + TokenVerify, + TokenVerify, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/auth/token/verify", + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, TokenVerify): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[AuthTokenVerifyCreateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -53,32 +51,51 @@ def _parse_response( response_200 = AuthTokenVerifyCreateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[AuthTokenVerifyCreateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, - client: Client, - form_data: TokenVerify, - multipart_data: TokenVerify, - json_body: TokenVerify, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenVerify, + TokenVerify, + TokenVerify, + ], ) -> Response[AuthTokenVerifyCreateResponse200]: + """Takes a token and indicates if it is valid. This view provides no + information about a token's fitness for a particular use. + + Args: + body (TokenVerify): + body (TokenVerify): + body (TokenVerify): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AuthTokenVerifyCreateResponse200] + """ + kwargs = _get_kwargs( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -89,67 +106,102 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, - client: Client, - form_data: TokenVerify, - multipart_data: TokenVerify, - json_body: TokenVerify, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenVerify, + TokenVerify, + TokenVerify, + ], ) -> Optional[AuthTokenVerifyCreateResponse200]: """Takes a token and indicates if it is valid. This view provides no - information about a token's fitness for a particular use.""" + information about a token's fitness for a particular use. + + Args: + body (TokenVerify): + body (TokenVerify): + body (TokenVerify): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AuthTokenVerifyCreateResponse200 + """ return sync_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, - client: Client, - form_data: TokenVerify, - multipart_data: TokenVerify, - json_body: TokenVerify, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenVerify, + TokenVerify, + TokenVerify, + ], ) -> Response[AuthTokenVerifyCreateResponse200]: + """Takes a token and indicates if it is valid. This view provides no + information about a token's fitness for a particular use. + + Args: + body (TokenVerify): + body (TokenVerify): + body (TokenVerify): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AuthTokenVerifyCreateResponse200] + """ + kwargs = _get_kwargs( - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, - client: Client, - form_data: TokenVerify, - multipart_data: TokenVerify, - json_body: TokenVerify, + client: Union[AuthenticatedClient, Client], + body: Union[ + TokenVerify, + TokenVerify, + TokenVerify, + ], ) -> Optional[AuthTokenVerifyCreateResponse200]: """Takes a token and indicates if it is valid. This view provides no - information about a token's fitness for a particular use.""" + information about a token's fitness for a particular use. + + Args: + body (TokenVerify): + body (TokenVerify): + body (TokenVerify): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AuthTokenVerifyCreateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/collectors/__init__.py b/osidb_bindings/bindings/python_client/api/collectors/__init__.py index c875d5f..999e7dc 100644 --- a/osidb_bindings/bindings/python_client/api/collectors/__init__.py +++ b/osidb_bindings/bindings/python_client/api/collectors/__init__.py @@ -1,3 +1,3 @@ +from .collectors_retrieve import * from .collectors_api_v1_status_retrieve import * from .collectors_healthy_retrieve import * -from .collectors_retrieve import * diff --git a/osidb_bindings/bindings/python_client/api/collectors/collectors_api_v1_status_retrieve.py b/osidb_bindings/bindings/python_client/api/collectors/collectors_api_v1_status_retrieve.py index dec951d..d161553 100644 --- a/osidb_bindings/bindings/python_client/api/collectors/collectors_api_v1_status_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/collectors/collectors_api_v1_status_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.collectors_api_v1_status_retrieve_response_200 import ( - CollectorsApiV1StatusRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.collectors_api_v1_status_retrieve_response_200 import CollectorsApiV1StatusRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/collectors/api/v1/status".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/collectors/api/v1/status", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[CollectorsApiV1StatusRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +31,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = CollectorsApiV1StatusRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = CollectorsApiV1StatusRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CollectorsApiV1StatusRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[CollectorsApiV1StatusRetrieveResponse200]: + """get the overall status of all collectors and the collected data + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CollectorsApiV1StatusRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[CollectorsApiV1StatusRetrieveResponse200]: - """get the overall status of all collectors and the collected data""" + """get the overall status of all collectors and the collected data + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CollectorsApiV1StatusRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[CollectorsApiV1StatusRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """get the overall status of all collectors and the collected data + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[CollectorsApiV1StatusRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[CollectorsApiV1StatusRetrieveResponse200]: - """get the overall status of all collectors and the collected data""" + """get the overall status of all collectors and the collected data + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CollectorsApiV1StatusRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/collectors/collectors_healthy_retrieve.py b/osidb_bindings/bindings/python_client/api/collectors/collectors_healthy_retrieve.py index 5938942..e869d27 100644 --- a/osidb_bindings/bindings/python_client/api/collectors/collectors_healthy_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/collectors/collectors_healthy_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.collectors_healthy_retrieve_response_200 import ( - CollectorsHealthyRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.collectors_healthy_retrieve_response_200 import CollectorsHealthyRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/collectors/healthy".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/collectors/healthy", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[CollectorsHealthyRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -39,17 +34,20 @@ def _parse_response( response_200 = CollectorsHealthyRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CollectorsHealthyRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -57,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[CollectorsHealthyRetrieveResponse200]: + """unauthenticated health check API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CollectorsHealthyRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -69,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[CollectorsHealthyRetrieveResponse200]: - """unauthenticated health check API endpoint""" + """unauthenticated health check API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CollectorsHealthyRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[CollectorsHealthyRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """unauthenticated health check API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[CollectorsHealthyRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[CollectorsHealthyRetrieveResponse200]: - """unauthenticated health check API endpoint""" + """unauthenticated health check API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CollectorsHealthyRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/collectors/collectors_retrieve.py b/osidb_bindings/bindings/python_client/api/collectors/collectors_retrieve.py index bdde580..51c6cbb 100644 --- a/osidb_bindings/bindings/python_client/api/collectors/collectors_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/collectors/collectors_retrieve.py @@ -1,32 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.collectors_retrieve_response_200 import CollectorsRetrieveResponse200 -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.collectors_retrieve_response_200 import CollectorsRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/collectors/".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/collectors/", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[CollectorsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -37,17 +34,20 @@ def _parse_response( response_200 = CollectorsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[CollectorsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -55,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[CollectorsRetrieveResponse200]: + """index API endpoint listing available collector API endpoints + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CollectorsRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -67,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[CollectorsRetrieveResponse200]: - """index API endpoint listing available collector API endpoints""" + """index API endpoint listing available collector API endpoints + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CollectorsRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[CollectorsRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """index API endpoint listing available collector API endpoints + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[CollectorsRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[CollectorsRetrieveResponse200]: - """index API endpoint listing available collector API endpoints""" + """index API endpoint listing available collector API endpoints + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CollectorsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/exploits/__init__.py b/osidb_bindings/bindings/python_client/api/exploits/__init__.py index 4d07a2e..4fd250d 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/__init__.py +++ b/osidb_bindings/bindings/python_client/api/exploits/__init__.py @@ -2,9 +2,9 @@ from .exploits_api_v1_cve_map_retrieve import * from .exploits_api_v1_epss_list import * from .exploits_api_v1_flaw_data_list import * -from .exploits_api_v1_report_data_list import * from .exploits_api_v1_report_date_retrieve import * from .exploits_api_v1_report_explanations_retrieve import * from .exploits_api_v1_report_pending_retrieve import * +from .exploits_api_v1_report_data_list import * from .exploits_api_v1_status_retrieve import * from .exploits_api_v1_supported_products_list import * diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_collect_update.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_collect_update.py index 96f5ea6..e1ae1cd 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_collect_update.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_collect_update.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_collect_update_response_200 import ( - ExploitsApiV1CollectUpdateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.exploits_api_v1_collect_update_response_200 import ExploitsApiV1CollectUpdateResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/collect".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/collect", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1CollectUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +31,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = ExploitsApiV1CollectUpdateResponse200.from_dict( - _response_200 - ) + response_200 = ExploitsApiV1CollectUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1CollectUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +55,18 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1CollectUpdateResponse200]: + """API endpoint for re-collecting exploit data. + + **NOTE:** Currently for CISA data only, which is very small and collection is fast. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1CollectUpdateResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,7 +79,7 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( @@ -80,42 +88,62 @@ def sync( ) -> Optional[ExploitsApiV1CollectUpdateResponse200]: """API endpoint for re-collecting exploit data. - **NOTE:** Currently for CISA data only, which is very small and collection is fast.""" + **NOTE:** Currently for CISA data only, which is very small and collection is fast. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1CollectUpdateResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1CollectUpdateResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """API endpoint for re-collecting exploit data. + + **NOTE:** Currently for CISA data only, which is very small and collection is fast. - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - return _build_response(response=resp) + Returns: + Response[ExploitsApiV1CollectUpdateResponse200] + """ + kwargs = _get_kwargs() -async def async_( + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1CollectUpdateResponse200]: """API endpoint for re-collecting exploit data. - **NOTE:** Currently for CISA data only, which is very small and collection is fast.""" + **NOTE:** Currently for CISA data only, which is very small and collection is fast. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1CollectUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_cve_map_retrieve.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_cve_map_retrieve.py index 05e68c9..735c359 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_cve_map_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_cve_map_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_cve_map_retrieve_response_200 import ( - ExploitsApiV1CveMapRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.exploits_api_v1_cve_map_retrieve_response_200 import ExploitsApiV1CveMapRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/cve_map".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/cve_map", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1CveMapRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +31,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = ExploitsApiV1CveMapRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = ExploitsApiV1CveMapRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1CveMapRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +55,30 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1CveMapRetrieveResponse200]: + r"""API endpoint for getting simple exploits information mapped to impacted CVEs. + + The Insights Vulnerability application needs this format. + + Format of results: + ``` + { + \"page_size\": , + \"cves\": { + \"CVE-2222-0001\": [], + \"CVE-2222-0002\": [], + ... + }, + } + ``` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1CveMapRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,14 +91,14 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1CveMapRetrieveResponse200]: - """API endpoint for getting simple exploits information mapped to impacted CVEs. + r"""API endpoint for getting simple exploits information mapped to impacted CVEs. The Insights Vulnerability application needs this format. @@ -92,37 +112,61 @@ def sync( ... }, } - ```""" + ``` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1CveMapRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1CveMapRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + r"""API endpoint for getting simple exploits information mapped to impacted CVEs. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + The Insights Vulnerability application needs this format. - return _build_response(response=resp) + Format of results: + ``` + { + \"page_size\": , + \"cves\": { + \"CVE-2222-0001\": [], + \"CVE-2222-0002\": [], + ... + }, + } + ``` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1CveMapRetrieveResponse200] + """ + + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1CveMapRetrieveResponse200]: - """API endpoint for getting simple exploits information mapped to impacted CVEs. + r"""API endpoint for getting simple exploits information mapped to impacted CVEs. The Insights Vulnerability application needs this format. @@ -136,10 +180,18 @@ async def async_( ... }, } - ```""" + ``` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1CveMapRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_epss_list.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_epss_list.py index 869b209..f8a0010 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_epss_list.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_epss_list.py @@ -1,46 +1,40 @@ -from typing import Any, Dict, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_epss_list_response_200 import ( - ExploitsApiV1EpssListResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "limit": int, - "offset": int, -} +from ...models.exploits_api_v1_epss_list_response_200 import ExploitsApiV1EpssListResponse200 def _get_kwargs( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/epss".format( - client.base_url, - ) + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() + params["limit"] = limit + + params["offset"] = offset - params: Dict[str, Any] = { - "limit": limit, - "offset": offset, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/epss", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1EpssListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -51,26 +45,43 @@ def _parse_response( response_200 = ExploitsApiV1EpssListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1EpssListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Response[ExploitsApiV1EpssListResponse200]: + """API endpoint for getting list of Red Hat relevant CVEs with their EPSS score. + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1EpssListResponse200] + """ + kwargs = _get_kwargs( client=client, limit=limit, @@ -85,16 +96,28 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Optional[ExploitsApiV1EpssListResponse200]: - """API endpoint for getting list of Red Hat relevant CVEs with their EPSS score.""" + """API endpoint for getting list of Red Hat relevant CVEs with their EPSS score. + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1EpssListResponse200 + """ return sync_detailed( client=client, @@ -103,39 +126,58 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Response[ExploitsApiV1EpssListResponse200]: + """API endpoint for getting list of Red Hat relevant CVEs with their EPSS score. + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1EpssListResponse200] + """ + kwargs = _get_kwargs( - client=client, limit=limit, offset=offset, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Optional[ExploitsApiV1EpssListResponse200]: - """API endpoint for getting list of Red Hat relevant CVEs with their EPSS score.""" + """API endpoint for getting list of Red Hat relevant CVEs with their EPSS score. + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1EpssListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, limit=limit, offset=offset, diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_flaw_data_list.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_flaw_data_list.py index c1b40dc..f73aa30 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_flaw_data_list.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_flaw_data_list.py @@ -1,46 +1,40 @@ -from typing import Any, Dict, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_flaw_data_list_response_200 import ( - ExploitsApiV1FlawDataListResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "limit": int, - "offset": int, -} +from ...models.exploits_api_v1_flaw_data_list_response_200 import ExploitsApiV1FlawDataListResponse200 def _get_kwargs( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/flaw_data".format( - client.base_url, - ) + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() + params["limit"] = limit + + params["offset"] = offset - params: Dict[str, Any] = { - "limit": limit, - "offset": offset, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/flaw_data", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1FlawDataListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -51,26 +45,43 @@ def _parse_response( response_200 = ExploitsApiV1FlawDataListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1FlawDataListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Response[ExploitsApiV1FlawDataListResponse200]: + """Flaw, affect, and tracker data for Exploits + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1FlawDataListResponse200] + """ + kwargs = _get_kwargs( client=client, limit=limit, @@ -85,16 +96,28 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Optional[ExploitsApiV1FlawDataListResponse200]: - """Flaw, affect, and tracker data for Exploits""" + """Flaw, affect, and tracker data for Exploits + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1FlawDataListResponse200 + """ return sync_detailed( client=client, @@ -103,39 +126,58 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Response[ExploitsApiV1FlawDataListResponse200]: + """Flaw, affect, and tracker data for Exploits + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1FlawDataListResponse200] + """ + kwargs = _get_kwargs( - client=client, limit=limit, offset=offset, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Optional[ExploitsApiV1FlawDataListResponse200]: - """Flaw, affect, and tracker data for Exploits""" + """Flaw, affect, and tracker data for Exploits + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1FlawDataListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, limit=limit, offset=offset, diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_data_list.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_data_list.py index f116327..50ba07c 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_data_list.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_data_list.py @@ -1,46 +1,40 @@ -from typing import Any, Dict, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_report_data_list_response_200 import ( - ExploitsApiV1ReportDataListResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "limit": int, - "offset": int, -} +from ...models.exploits_api_v1_report_data_list_response_200 import ExploitsApiV1ReportDataListResponse200 def _get_kwargs( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/report_data".format( - client.base_url, - ) + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() + params["limit"] = limit + + params["offset"] = offset - params: Dict[str, Any] = { - "limit": limit, - "offset": offset, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/report_data", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1ReportDataListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -48,31 +42,46 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = ExploitsApiV1ReportDataListResponse200.from_dict( - _response_200 - ) + response_200 = ExploitsApiV1ReportDataListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1ReportDataListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Response[ExploitsApiV1ReportDataListResponse200]: + """Export only the data required to generate the exploits report + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1ReportDataListResponse200] + """ + kwargs = _get_kwargs( client=client, limit=limit, @@ -87,16 +96,28 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Optional[ExploitsApiV1ReportDataListResponse200]: - """Export only the data required to generate the exploits report""" + """Export only the data required to generate the exploits report + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1ReportDataListResponse200 + """ return sync_detailed( client=client, @@ -105,39 +126,58 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Response[ExploitsApiV1ReportDataListResponse200]: + """Export only the data required to generate the exploits report + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1ReportDataListResponse200] + """ + kwargs = _get_kwargs( - client=client, limit=limit, offset=offset, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Optional[ExploitsApiV1ReportDataListResponse200]: - """Export only the data required to generate the exploits report""" + """Export only the data required to generate the exploits report + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1ReportDataListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, limit=limit, offset=offset, diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_date_retrieve.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_date_retrieve.py index 887b2e7..6214e51 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_date_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_date_retrieve.py @@ -1,37 +1,33 @@ -import datetime -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_report_date_retrieve_response_200 import ( - ExploitsApiV1ReportDateRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.exploits_api_v1_report_date_retrieve_response_200 import ExploitsApiV1ReportDateRetrieveResponse200 +import datetime def _get_kwargs( date: datetime.date, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/report/date/{date}".format( - client.base_url, - date=date, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//exploits/api/v1/report/date/{date}".format( + date=date, + ), } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1ReportDateRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -39,22 +35,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = ExploitsApiV1ReportDateRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = ExploitsApiV1ReportDateRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1ReportDateRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -63,6 +60,34 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1ReportDateRetrieveResponse200]: + r"""API endpoint for getting date based report for Incident Response. + + Format of results: + ``` + { + \"cutoff_date\": , + \"evaluated_cves\": , + \"action_required\": [], + \"no_action\": [], + \"not_relevant\": [], + } + ``` + + **NOTE:** No pagination is performed on this endpoint as data is limited by date and is expected + to be fairly small. Also, because data is broken into three categories it is not + exactly obvious how to create pages. + + Args: + date (datetime.date): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1ReportDateRetrieveResponse200] + """ + kwargs = _get_kwargs( date=date, client=client, @@ -76,7 +101,7 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( @@ -84,7 +109,7 @@ def sync( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1ReportDateRetrieveResponse200]: - """API endpoint for getting date based report for Incident Response. + r"""API endpoint for getting date based report for Incident Response. Format of results: ``` @@ -99,7 +124,18 @@ def sync( **NOTE:** No pagination is performed on this endpoint as data is limited by date and is expected to be fairly small. Also, because data is broken into three categories it is not - exactly obvious how to create pages.""" + exactly obvious how to create pages. + + Args: + date (datetime.date): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1ReportDateRetrieveResponse200 + """ return sync_detailed( date=date, @@ -107,33 +143,54 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( date: datetime.date, *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1ReportDateRetrieveResponse200]: + r"""API endpoint for getting date based report for Incident Response. + + Format of results: + ``` + { + \"cutoff_date\": , + \"evaluated_cves\": , + \"action_required\": [], + \"no_action\": [], + \"not_relevant\": [], + } + ``` + + **NOTE:** No pagination is performed on this endpoint as data is limited by date and is expected + to be fairly small. Also, because data is broken into three categories it is not + exactly obvious how to create pages. + + Args: + date (datetime.date): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1ReportDateRetrieveResponse200] + """ + kwargs = _get_kwargs( date=date, - client=client, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( date: datetime.date, *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1ReportDateRetrieveResponse200]: - """API endpoint for getting date based report for Incident Response. + r"""API endpoint for getting date based report for Incident Response. Format of results: ``` @@ -148,10 +205,21 @@ async def async_( **NOTE:** No pagination is performed on this endpoint as data is limited by date and is expected to be fairly small. Also, because data is broken into three categories it is not - exactly obvious how to create pages.""" + exactly obvious how to create pages. + + Args: + date (datetime.date): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1ReportDateRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( date=date, client=client, ) diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_explanations_retrieve.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_explanations_retrieve.py index 0d1023e..9903986 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_explanations_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_explanations_retrieve.py @@ -1,34 +1,31 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.exploits_api_v1_report_explanations_retrieve_response_200 import ( ExploitsApiV1ReportExplanationsRetrieveResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/report/explanations".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/report/explanations", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1ReportExplanationsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +33,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = ExploitsApiV1ReportExplanationsRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = ExploitsApiV1ReportExplanationsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1ReportExplanationsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +57,25 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1ReportExplanationsRetrieveResponse200]: + r"""API endpoint for getting a report of all CVEs with exploit and their status + for Incident Response. + + Format of results: + ``` + { + \"page_size\": , + \"explanations\": [], + } + ``` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1ReportExplanationsRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,14 +88,14 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1ReportExplanationsRetrieveResponse200]: - """API endpoint for getting a report of all CVEs with exploit and their status + r"""API endpoint for getting a report of all CVEs with exploit and their status for Incident Response. Format of results: @@ -87,37 +104,56 @@ def sync( \"page_size\": , \"explanations\": [], } - ```""" + ``` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1ReportExplanationsRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1ReportExplanationsRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + r"""API endpoint for getting a report of all CVEs with exploit and their status + for Incident Response. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Format of results: + ``` + { + \"page_size\": , + \"explanations\": [], + } + ``` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1ReportExplanationsRetrieveResponse200] + """ + + kwargs = _get_kwargs() - return _build_response(response=resp) + response = await client.get_async_httpx_client().request(**kwargs) + return _build_response(client=client, response=response) -async def async_( + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1ReportExplanationsRetrieveResponse200]: - """API endpoint for getting a report of all CVEs with exploit and their status + r"""API endpoint for getting a report of all CVEs with exploit and their status for Incident Response. Format of results: @@ -126,10 +162,18 @@ async def async_( \"page_size\": , \"explanations\": [], } - ```""" + ``` + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1ReportExplanationsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_pending_retrieve.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_pending_retrieve.py index 6acc1a7..4222ae0 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_pending_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_report_pending_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_report_pending_retrieve_response_200 import ( - ExploitsApiV1ReportPendingRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.exploits_api_v1_report_pending_retrieve_response_200 import ExploitsApiV1ReportPendingRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/report/pending".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/report/pending", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1ReportPendingRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +31,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = ExploitsApiV1ReportPendingRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = ExploitsApiV1ReportPendingRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1ReportPendingRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +55,29 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1ReportPendingRetrieveResponse200]: + r"""API endpoint for getting a report of pending actions for Incident Response. + + Format of results: + ``` + { + \"pending_actions\": [], + \"pending_actions_count\": , + } + ``` + + **NOTE:** No pagination is performed on this endpoint as it is expected that the size of + the list of pending actions will be mostly stable. Also, the paging cannot be done on + the query level, as additional analysis of every exploit is required before a decision + to include it in this report is done. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1ReportPendingRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,14 +90,14 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1ReportPendingRetrieveResponse200]: - """API endpoint for getting a report of pending actions for Incident Response. + r"""API endpoint for getting a report of pending actions for Incident Response. Format of results: ``` @@ -91,37 +110,60 @@ def sync( **NOTE:** No pagination is performed on this endpoint as it is expected that the size of the list of pending actions will be mostly stable. Also, the paging cannot be done on the query level, as additional analysis of every exploit is required before a decision - to include it in this report is done.""" + to include it in this report is done. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1ReportPendingRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1ReportPendingRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + r"""API endpoint for getting a report of pending actions for Incident Response. + + Format of results: + ``` + { + \"pending_actions\": [], + \"pending_actions_count\": , + } + ``` + + **NOTE:** No pagination is performed on this endpoint as it is expected that the size of + the list of pending actions will be mostly stable. Also, the paging cannot be done on + the query level, as additional analysis of every exploit is required before a decision + to include it in this report is done. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - return _build_response(response=resp) + Returns: + Response[ExploitsApiV1ReportPendingRetrieveResponse200] + """ + kwargs = _get_kwargs() -async def async_( + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1ReportPendingRetrieveResponse200]: - """API endpoint for getting a report of pending actions for Incident Response. + r"""API endpoint for getting a report of pending actions for Incident Response. Format of results: ``` @@ -134,10 +176,18 @@ async def async_( **NOTE:** No pagination is performed on this endpoint as it is expected that the size of the list of pending actions will be mostly stable. Also, the paging cannot be done on the query level, as additional analysis of every exploit is required before a decision - to include it in this report is done.""" + to include it in this report is done. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1ReportPendingRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_status_retrieve.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_status_retrieve.py index 0d7b4b2..6cacf4c 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_status_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_status_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_status_retrieve_response_200 import ( - ExploitsApiV1StatusRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.exploits_api_v1_status_retrieve_response_200 import ExploitsApiV1StatusRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/status".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/status", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1StatusRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +31,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = ExploitsApiV1StatusRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = ExploitsApiV1StatusRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1StatusRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +55,18 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1StatusRetrieveResponse200]: + """API endpoint for getting basic information about exploits in the database. + + **NOTE:** Everyone is allowed to see basic information. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1StatusRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,7 +79,7 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( @@ -80,42 +88,62 @@ def sync( ) -> Optional[ExploitsApiV1StatusRetrieveResponse200]: """API endpoint for getting basic information about exploits in the database. - **NOTE:** Everyone is allowed to see basic information.""" + **NOTE:** Everyone is allowed to see basic information. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1StatusRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[ExploitsApiV1StatusRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """API endpoint for getting basic information about exploits in the database. + + **NOTE:** Everyone is allowed to see basic information. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - return _build_response(response=resp) + Returns: + Response[ExploitsApiV1StatusRetrieveResponse200] + """ + kwargs = _get_kwargs() -async def async_( + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[ExploitsApiV1StatusRetrieveResponse200]: """API endpoint for getting basic information about exploits in the database. - **NOTE:** Everyone is allowed to see basic information.""" + **NOTE:** Everyone is allowed to see basic information. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1StatusRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_supported_products_list.py b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_supported_products_list.py index a11f2f0..0d80783 100644 --- a/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_supported_products_list.py +++ b/osidb_bindings/bindings/python_client/api/exploits/exploits_api_v1_supported_products_list.py @@ -1,46 +1,40 @@ -from typing import Any, Dict, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.exploits_api_v1_supported_products_list_response_200 import ( - ExploitsApiV1SupportedProductsListResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "limit": int, - "offset": int, -} +from ...models.exploits_api_v1_supported_products_list_response_200 import ExploitsApiV1SupportedProductsListResponse200 def _get_kwargs( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, -) -> Dict[str, Any]: - url = "{}/exploits/api/v1/supported-products".format( - client.base_url, - ) + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() + params["limit"] = limit + + params["offset"] = offset - params: Dict[str, Any] = { - "limit": limit, - "offset": offset, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/exploits/api/v1/supported-products", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[ExploitsApiV1SupportedProductsListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -48,31 +42,46 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = ExploitsApiV1SupportedProductsListResponse200.from_dict( - _response_200 - ) + response_200 = ExploitsApiV1SupportedProductsListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[ExploitsApiV1SupportedProductsListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Response[ExploitsApiV1SupportedProductsListResponse200]: + """API endpoint for getting a list of all supported products. + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1SupportedProductsListResponse200] + """ + kwargs = _get_kwargs( client=client, limit=limit, @@ -87,16 +96,28 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Optional[ExploitsApiV1SupportedProductsListResponse200]: - """API endpoint for getting a list of all supported products.""" + """API endpoint for getting a list of all supported products. + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1SupportedProductsListResponse200 + """ return sync_detailed( client=client, @@ -105,39 +126,58 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Response[ExploitsApiV1SupportedProductsListResponse200]: + """API endpoint for getting a list of all supported products. + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExploitsApiV1SupportedProductsListResponse200] + """ + kwargs = _get_kwargs( - client=client, limit=limit, offset=offset, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, ) -> Optional[ExploitsApiV1SupportedProductsListResponse200]: - """API endpoint for getting a list of all supported products.""" + """API endpoint for getting a list of all supported products. + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExploitsApiV1SupportedProductsListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, limit=limit, offset=offset, diff --git a/osidb_bindings/bindings/python_client/api/osidb/__init__.py b/osidb_bindings/bindings/python_client/api/osidb/__init__.py index e278b98..5a7478b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/__init__.py +++ b/osidb_bindings/bindings/python_client/api/osidb/__init__.py @@ -1,55 +1,55 @@ -from .osidb_api_v1_affects_bulk_create import * -from .osidb_api_v1_affects_bulk_destroy import * -from .osidb_api_v1_affects_bulk_update import * +from .osidb_api_v1_affects_list import * from .osidb_api_v1_affects_create import * -from .osidb_api_v1_affects_cvss_scores_create import * -from .osidb_api_v1_affects_cvss_scores_destroy import * from .osidb_api_v1_affects_cvss_scores_list import * +from .osidb_api_v1_affects_cvss_scores_create import * from .osidb_api_v1_affects_cvss_scores_retrieve import * from .osidb_api_v1_affects_cvss_scores_update import * -from .osidb_api_v1_affects_destroy import * -from .osidb_api_v1_affects_list import * +from .osidb_api_v1_affects_cvss_scores_destroy import * from .osidb_api_v1_affects_retrieve import * from .osidb_api_v1_affects_update import * +from .osidb_api_v1_affects_destroy import * +from .osidb_api_v1_affects_bulk_update import * +from .osidb_api_v1_affects_bulk_create import * +from .osidb_api_v1_affects_bulk_destroy import * from .osidb_api_v1_alerts_list import * from .osidb_api_v1_alerts_retrieve import * from .osidb_api_v1_audit_list import * from .osidb_api_v1_audit_retrieve import * from .osidb_api_v1_audit_update import * -from .osidb_api_v1_flaws_acknowledgments_create import * -from .osidb_api_v1_flaws_acknowledgments_destroy import * +from .osidb_api_v1_flaws_list import * +from .osidb_api_v1_flaws_create import * from .osidb_api_v1_flaws_acknowledgments_list import * +from .osidb_api_v1_flaws_acknowledgments_create import * from .osidb_api_v1_flaws_acknowledgments_retrieve import * from .osidb_api_v1_flaws_acknowledgments_update import * -from .osidb_api_v1_flaws_comments_create import * +from .osidb_api_v1_flaws_acknowledgments_destroy import * from .osidb_api_v1_flaws_comments_list import * +from .osidb_api_v1_flaws_comments_create import * from .osidb_api_v1_flaws_comments_retrieve import * -from .osidb_api_v1_flaws_create import * -from .osidb_api_v1_flaws_cvss_scores_create import * -from .osidb_api_v1_flaws_cvss_scores_destroy import * from .osidb_api_v1_flaws_cvss_scores_list import * +from .osidb_api_v1_flaws_cvss_scores_create import * from .osidb_api_v1_flaws_cvss_scores_retrieve import * from .osidb_api_v1_flaws_cvss_scores_update import * -from .osidb_api_v1_flaws_list import * -from .osidb_api_v1_flaws_package_versions_create import * -from .osidb_api_v1_flaws_package_versions_destroy import * +from .osidb_api_v1_flaws_cvss_scores_destroy import * from .osidb_api_v1_flaws_package_versions_list import * +from .osidb_api_v1_flaws_package_versions_create import * from .osidb_api_v1_flaws_package_versions_retrieve import * from .osidb_api_v1_flaws_package_versions_update import * +from .osidb_api_v1_flaws_package_versions_destroy import * from .osidb_api_v1_flaws_promote_create import * -from .osidb_api_v1_flaws_references_create import * -from .osidb_api_v1_flaws_references_destroy import * from .osidb_api_v1_flaws_references_list import * +from .osidb_api_v1_flaws_references_create import * from .osidb_api_v1_flaws_references_retrieve import * from .osidb_api_v1_flaws_references_update import * +from .osidb_api_v1_flaws_references_destroy import * from .osidb_api_v1_flaws_reject_create import * from .osidb_api_v1_flaws_retrieve import * from .osidb_api_v1_flaws_update import * from .osidb_api_v1_manifest_retrieve import * from .osidb_api_v1_schema_retrieve import * from .osidb_api_v1_status_retrieve import * -from .osidb_api_v1_trackers_create import * from .osidb_api_v1_trackers_list import * +from .osidb_api_v1_trackers_create import * from .osidb_api_v1_trackers_retrieve import * from .osidb_api_v1_trackers_update import * from .osidb_healthy_retrieve import * diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_create.py index 9c0bf7d..6421812 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_create.py @@ -1,59 +1,52 @@ -from typing import Any, Dict, List, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.affect_post import AffectPost -from ...models.osidb_api_v1_affects_bulk_create_response_200 import ( - OsidbApiV1AffectsBulkCreateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = List[AffectPost] +from ...models.affect_post import AffectPost +from ...models.osidb_api_v1_affects_bulk_create_response_200 import OsidbApiV1AffectsBulkCreateResponse200 def _get_kwargs( *, client: AuthenticatedClient, - multipart_data: List[AffectPost], - json_body: List[AffectPost], -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/bulk".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + list["AffectPost"], + list["AffectPost"], + list["AffectPost"], + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/affects/bulk", + } - json_json_body: List[Dict[str, Any]] = UNSET - if not isinstance(json_body, Unset): - json_json_body = [] - for json_body_item_data in json_body: - json_body_item: Dict[str, Any] = UNSET - if not isinstance(json_body_item_data, Unset): - json_body_item = json_body_item_data.to_dict() + if isinstance(body, list["AffectPost"]): + _json_body: list[dict[str, Any]] = UNSET + if not isinstance(body, Unset): + _json_body = [] + for body_item_data in body: + body_item: dict[str, Any] = UNSET + if not isinstance(body_item_data, Unset): + body_item = body_item_data.to_dict() - json_json_body.append(json_body_item) + _json_body.append(body_item) - multipart_multipart_data: List[Dict[str, Any]] = UNSET - if not isinstance(multipart_data, Unset): - multipart_multipart_data = [] - for multipart_data_item_data in multipart_data: - multipart_data_item: Dict[str, Any] = UNSET - if not isinstance(multipart_data_item_data, Unset): - multipart_data_item = multipart_data_item_data.to_dict() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - multipart_multipart_data.append(multipart_data_item) - - return { - "url": url, - "headers": headers, - "json": json_json_body, - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsBulkCreateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -61,35 +54,54 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1AffectsBulkCreateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1AffectsBulkCreateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsBulkCreateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - multipart_data: List[AffectPost], - json_body: List[AffectPost], + body: Union[ + list["AffectPost"], + list["AffectPost"], + list["AffectPost"], + ], ) -> Response[OsidbApiV1AffectsBulkCreateResponse200]: + """Bulk create endpoint. Expects a list of dict Affect objects. + + Args: + bugzilla_api_key (str): + body (list['AffectPost']): + body (list['AffectPost']): + body (list['AffectPost']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsBulkCreateResponse200] + """ + kwargs = _get_kwargs( client=client, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -100,59 +112,102 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - multipart_data: List[AffectPost], - json_body: List[AffectPost], + body: Union[ + list["AffectPost"], + list["AffectPost"], + list["AffectPost"], + ], ) -> Optional[OsidbApiV1AffectsBulkCreateResponse200]: - """Bulk create endpoint. Expects a list of dict Affect objects.""" + """Bulk create endpoint. Expects a list of dict Affect objects. + + Args: + bugzilla_api_key (str): + body (list['AffectPost']): + body (list['AffectPost']): + body (list['AffectPost']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsBulkCreateResponse200 + """ return sync_detailed( client=client, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - multipart_data: List[AffectPost], - json_body: List[AffectPost], + body: Union[ + list["AffectPost"], + list["AffectPost"], + list["AffectPost"], + ], ) -> Response[OsidbApiV1AffectsBulkCreateResponse200]: + """Bulk create endpoint. Expects a list of dict Affect objects. + + Args: + bugzilla_api_key (str): + body (list['AffectPost']): + body (list['AffectPost']): + body (list['AffectPost']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsBulkCreateResponse200] + """ + kwargs = _get_kwargs( - client=client, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - multipart_data: List[AffectPost], - json_body: List[AffectPost], + body: Union[ + list["AffectPost"], + list["AffectPost"], + list["AffectPost"], + ], ) -> Optional[OsidbApiV1AffectsBulkCreateResponse200]: - """Bulk create endpoint. Expects a list of dict Affect objects.""" + """Bulk create endpoint. Expects a list of dict Affect objects. + + Args: + bugzilla_api_key (str): + body (list['AffectPost']): + body (list['AffectPost']): + body (list['AffectPost']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsBulkCreateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_destroy.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_destroy.py index 68909da..23ecdc3 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_destroy.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_destroy.py @@ -1,34 +1,32 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_affects_bulk_destroy_response_200 import ( - OsidbApiV1AffectsBulkDestroyResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_api_v1_affects_bulk_destroy_response_200 import OsidbApiV1AffectsBulkDestroyResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/bulk".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/affects/bulk", } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsBulkDestroyResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +34,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1AffectsBulkDestroyResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1AffectsBulkDestroyResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsBulkDestroyResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +58,19 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbApiV1AffectsBulkDestroyResponse200]: + """Bulk delete endpoint. Expects a list of Affect uuids. + + Args: + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsBulkDestroyResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,47 +83,74 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1AffectsBulkDestroyResponse200]: - """Bulk delete endpoint. Expects a list of Affect uuids.""" + """Bulk delete endpoint. Expects a list of Affect uuids. + + Args: + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsBulkDestroyResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbApiV1AffectsBulkDestroyResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """Bulk delete endpoint. Expects a list of Affect uuids. + + Args: + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().delete( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[OsidbApiV1AffectsBulkDestroyResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1AffectsBulkDestroyResponse200]: - """Bulk delete endpoint. Expects a list of Affect uuids.""" + """Bulk delete endpoint. Expects a list of Affect uuids. + + Args: + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsBulkDestroyResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_update.py index e67ccfe..e540225 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_bulk_update.py @@ -1,59 +1,52 @@ -from typing import Any, Dict, List, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.affect_bulk_put import AffectBulkPut -from ...models.osidb_api_v1_affects_bulk_update_response_200 import ( - OsidbApiV1AffectsBulkUpdateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = List[AffectBulkPut] +from ...models.affect_bulk_put import AffectBulkPut +from ...models.osidb_api_v1_affects_bulk_update_response_200 import OsidbApiV1AffectsBulkUpdateResponse200 def _get_kwargs( *, client: AuthenticatedClient, - multipart_data: List[AffectBulkPut], - json_body: List[AffectBulkPut], -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/bulk".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + list["AffectBulkPut"], + list["AffectBulkPut"], + list["AffectBulkPut"], + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/affects/bulk", + } - json_json_body: List[Dict[str, Any]] = UNSET - if not isinstance(json_body, Unset): - json_json_body = [] - for json_body_item_data in json_body: - json_body_item: Dict[str, Any] = UNSET - if not isinstance(json_body_item_data, Unset): - json_body_item = json_body_item_data.to_dict() + if isinstance(body, list["AffectBulkPut"]): + _json_body: list[dict[str, Any]] = UNSET + if not isinstance(body, Unset): + _json_body = [] + for body_item_data in body: + body_item: dict[str, Any] = UNSET + if not isinstance(body_item_data, Unset): + body_item = body_item_data.to_dict() - json_json_body.append(json_body_item) + _json_body.append(body_item) - multipart_multipart_data: List[Dict[str, Any]] = UNSET - if not isinstance(multipart_data, Unset): - multipart_multipart_data = [] - for multipart_data_item_data in multipart_data: - multipart_data_item: Dict[str, Any] = UNSET - if not isinstance(multipart_data_item_data, Unset): - multipart_data_item = multipart_data_item_data.to_dict() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - multipart_multipart_data.append(multipart_data_item) - - return { - "url": url, - "headers": headers, - "json": json_json_body, - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsBulkUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -61,35 +54,55 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1AffectsBulkUpdateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1AffectsBulkUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsBulkUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - multipart_data: List[AffectBulkPut], - json_body: List[AffectBulkPut], + body: Union[ + list["AffectBulkPut"], + list["AffectBulkPut"], + list["AffectBulkPut"], + ], ) -> Response[OsidbApiV1AffectsBulkUpdateResponse200]: + """Bulk update endpoint. Expects a list of dict Affect objects. + + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (list['AffectBulkPut']): + body (list['AffectBulkPut']): + body (list['AffectBulkPut']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsBulkUpdateResponse200] + """ + kwargs = _get_kwargs( client=client, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -100,59 +113,105 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - multipart_data: List[AffectBulkPut], - json_body: List[AffectBulkPut], + body: Union[ + list["AffectBulkPut"], + list["AffectBulkPut"], + list["AffectBulkPut"], + ], ) -> Optional[OsidbApiV1AffectsBulkUpdateResponse200]: - """Bulk update endpoint. Expects a list of dict Affect objects.""" + """Bulk update endpoint. Expects a list of dict Affect objects. + + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (list['AffectBulkPut']): + body (list['AffectBulkPut']): + body (list['AffectBulkPut']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsBulkUpdateResponse200 + """ return sync_detailed( client=client, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - multipart_data: List[AffectBulkPut], - json_body: List[AffectBulkPut], + body: Union[ + list["AffectBulkPut"], + list["AffectBulkPut"], + list["AffectBulkPut"], + ], ) -> Response[OsidbApiV1AffectsBulkUpdateResponse200]: + """Bulk update endpoint. Expects a list of dict Affect objects. + + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (list['AffectBulkPut']): + body (list['AffectBulkPut']): + body (list['AffectBulkPut']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsBulkUpdateResponse200] + """ + kwargs = _get_kwargs( - client=client, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - multipart_data: List[AffectBulkPut], - json_body: List[AffectBulkPut], + body: Union[ + list["AffectBulkPut"], + list["AffectBulkPut"], + list["AffectBulkPut"], + ], ) -> Optional[OsidbApiV1AffectsBulkUpdateResponse200]: - """Bulk update endpoint. Expects a list of dict Affect objects.""" + """Bulk update endpoint. Expects a list of dict Affect objects. + + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (list['AffectBulkPut']): + body (list['AffectBulkPut']): + body (list['AffectBulkPut']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsBulkUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_create.py index b98bd1f..60d26a3 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_create.py @@ -1,48 +1,46 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.affect_post import AffectPost -from ...models.osidb_api_v1_affects_create_response_201 import ( - OsidbApiV1AffectsCreateResponse201, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = AffectPost +from ...models.affect_post import AffectPost +from ...models.osidb_api_v1_affects_create_response_201 import OsidbApiV1AffectsCreateResponse201 def _get_kwargs( *, client: AuthenticatedClient, - form_data: AffectPost, - multipart_data: AffectPost, - json_body: AffectPost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects".format( - client.base_url, - ) + body: Union[ + AffectPost, + AffectPost, + AffectPost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/affects", + } - headers: Dict[str, Any] = client.get_headers() + if isinstance(body, AffectPost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() - - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -53,32 +51,51 @@ def _parse_response( response_201 = OsidbApiV1AffectsCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - form_data: AffectPost, - multipart_data: AffectPost, - json_body: AffectPost, + body: Union[ + AffectPost, + AffectPost, + AffectPost, + ], ) -> Response[OsidbApiV1AffectsCreateResponse201]: + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (AffectPost): Affect serializer + body (AffectPost): Affect serializer + body (AffectPost): Affect serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCreateResponse201] + """ + kwargs = _get_kwargs( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -89,65 +106,102 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - form_data: AffectPost, - multipart_data: AffectPost, - json_body: AffectPost, + body: Union[ + AffectPost, + AffectPost, + AffectPost, + ], ) -> Optional[OsidbApiV1AffectsCreateResponse201]: - """ """ + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (AffectPost): Affect serializer + body (AffectPost): Affect serializer + body (AffectPost): Affect serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCreateResponse201 + """ return sync_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - form_data: AffectPost, - multipart_data: AffectPost, - json_body: AffectPost, + body: Union[ + AffectPost, + AffectPost, + AffectPost, + ], ) -> Response[OsidbApiV1AffectsCreateResponse201]: + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (AffectPost): Affect serializer + body (AffectPost): Affect serializer + body (AffectPost): Affect serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCreateResponse201] + """ + kwargs = _get_kwargs( - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - form_data: AffectPost, - multipart_data: AffectPost, - json_body: AffectPost, + body: Union[ + AffectPost, + AffectPost, + AffectPost, + ], ) -> Optional[OsidbApiV1AffectsCreateResponse201]: - """ """ + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (AffectPost): Affect serializer + body (AffectPost): Affect serializer + body (AffectPost): Affect serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_create.py index 7ef31d1..22d70a8 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_create.py @@ -1,50 +1,50 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.affect_cvss_post import AffectCVSSPost -from ...models.osidb_api_v1_affects_cvss_scores_create_response_201 import ( - OsidbApiV1AffectsCvssScoresCreateResponse201, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = AffectCVSSPost +from ...models.affect_cvss_post import AffectCVSSPost +from ...models.osidb_api_v1_affects_cvss_scores_create_response_201 import OsidbApiV1AffectsCvssScoresCreateResponse201 +from uuid import UUID def _get_kwargs( - affect_id: str, + affect_id: UUID, *, client: AuthenticatedClient, - form_data: AffectCVSSPost, - multipart_data: AffectCVSSPost, - json_body: AffectCVSSPost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/{affect_id}/cvss_scores".format( - client.base_url, - affect_id=affect_id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + AffectCVSSPost, + AffectCVSSPost, + AffectCVSSPost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/affects/{affect_id}/cvss_scores".format( + affect_id=affect_id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, AffectCVSSPost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsCvssScoresCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -52,39 +52,56 @@ def _parse_response( if isinstance(_response_201, Unset): response_201 = UNSET else: - response_201 = OsidbApiV1AffectsCvssScoresCreateResponse201.from_dict( - _response_201 - ) + response_201 = OsidbApiV1AffectsCvssScoresCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsCvssScoresCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - affect_id: str, + affect_id: UUID, *, client: AuthenticatedClient, - form_data: AffectCVSSPost, - multipart_data: AffectCVSSPost, - json_body: AffectCVSSPost, + body: Union[ + AffectCVSSPost, + AffectCVSSPost, + AffectCVSSPost, + ], ) -> Response[OsidbApiV1AffectsCvssScoresCreateResponse201]: + """ + Args: + affect_id (UUID): + bugzilla_api_key (str): + body (AffectCVSSPost): AffectCVSS serializer + body (AffectCVSSPost): AffectCVSS serializer + body (AffectCVSSPost): AffectCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresCreateResponse201] + """ + kwargs = _get_kwargs( affect_id=affect_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -95,71 +112,108 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - affect_id: str, + affect_id: UUID, *, client: AuthenticatedClient, - form_data: AffectCVSSPost, - multipart_data: AffectCVSSPost, - json_body: AffectCVSSPost, + body: Union[ + AffectCVSSPost, + AffectCVSSPost, + AffectCVSSPost, + ], ) -> Optional[OsidbApiV1AffectsCvssScoresCreateResponse201]: - """ """ + """ + Args: + affect_id (UUID): + bugzilla_api_key (str): + body (AffectCVSSPost): AffectCVSS serializer + body (AffectCVSSPost): AffectCVSS serializer + body (AffectCVSSPost): AffectCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresCreateResponse201 + """ return sync_detailed( affect_id=affect_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - affect_id: str, +async def asyncio_detailed( + affect_id: UUID, *, client: AuthenticatedClient, - form_data: AffectCVSSPost, - multipart_data: AffectCVSSPost, - json_body: AffectCVSSPost, + body: Union[ + AffectCVSSPost, + AffectCVSSPost, + AffectCVSSPost, + ], ) -> Response[OsidbApiV1AffectsCvssScoresCreateResponse201]: + """ + Args: + affect_id (UUID): + bugzilla_api_key (str): + body (AffectCVSSPost): AffectCVSS serializer + body (AffectCVSSPost): AffectCVSS serializer + body (AffectCVSSPost): AffectCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresCreateResponse201] + """ + kwargs = _get_kwargs( affect_id=affect_id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - affect_id: str, +async def asyncio( + affect_id: UUID, *, client: AuthenticatedClient, - form_data: AffectCVSSPost, - multipart_data: AffectCVSSPost, - json_body: AffectCVSSPost, + body: Union[ + AffectCVSSPost, + AffectCVSSPost, + AffectCVSSPost, + ], ) -> Optional[OsidbApiV1AffectsCvssScoresCreateResponse201]: - """ """ + """ + Args: + affect_id (UUID): + bugzilla_api_key (str): + body (AffectCVSSPost): AffectCVSS serializer + body (AffectCVSSPost): AffectCVSS serializer + body (AffectCVSSPost): AffectCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( affect_id=affect_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_destroy.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_destroy.py index 9fb9fd3..0f8a1fb 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_destroy.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_destroy.py @@ -1,38 +1,40 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_affects_cvss_scores_destroy_response_200 import ( OsidbApiV1AffectsCvssScoresDestroyResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} +from uuid import UUID def _get_kwargs( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/{affect_id}/cvss_scores/{id}".format( - client.base_url, - affect_id=affect_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/affects/{affect_id}/cvss_scores/{id}".format( + affect_id=affect_id, + id=id, + ), } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsCvssScoresDestroyResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -40,31 +42,47 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1AffectsCvssScoresDestroyResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1AffectsCvssScoresDestroyResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsCvssScoresDestroyResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1AffectsCvssScoresDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla. + + Args: + affect_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresDestroyResponse200] + """ + kwargs = _get_kwargs( affect_id=affect_id, id=id, @@ -79,16 +97,29 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1AffectsCvssScoresDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla.""" + """Destroy the instance and proxy the delete to Bugzilla. + + Args: + affect_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresDestroyResponse200 + """ return sync_detailed( affect_id=affect_id, @@ -97,39 +128,60 @@ def sync( ).parsed -async def async_detailed( - affect_id: str, +async def asyncio_detailed( + affect_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1AffectsCvssScoresDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla. + + Args: + affect_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresDestroyResponse200] + """ + kwargs = _get_kwargs( affect_id=affect_id, id=id, - client=client, ) - async with client.get_async_session().delete( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - affect_id: str, +async def asyncio( + affect_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1AffectsCvssScoresDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla.""" + """Destroy the instance and proxy the delete to Bugzilla. + + Args: + affect_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresDestroyResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( affect_id=affect_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_list.py index c775b74..504c62b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_list.py @@ -1,217 +1,199 @@ -import datetime -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_affects_cvss_scores_list_issuer import ( - OsidbApiV1AffectsCvssScoresListIssuer, -) -from ...models.osidb_api_v1_affects_cvss_scores_list_response_200 import ( - OsidbApiV1AffectsCvssScoresListResponse200, -) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "comment": str, - "created_dt": datetime.datetime, - "created_dt__date": datetime.date, - "created_dt__date__gte": datetime.date, - "created_dt__date__lte": datetime.date, - "created_dt__gt": datetime.datetime, - "created_dt__gte": datetime.datetime, - "created_dt__lt": datetime.datetime, - "created_dt__lte": datetime.datetime, - "cvss_version": str, - "exclude_fields": List[str], - "include_fields": List[str], - "issuer": OsidbApiV1AffectsCvssScoresListIssuer, - "limit": int, - "offset": int, - "score": float, - "updated_dt": datetime.datetime, - "updated_dt__date": datetime.date, - "updated_dt__date__gte": datetime.date, - "updated_dt__date__lte": datetime.date, - "updated_dt__gt": datetime.datetime, - "updated_dt__gte": datetime.datetime, - "updated_dt__lt": datetime.datetime, - "updated_dt__lte": datetime.datetime, - "uuid": str, - "vector": str, -} +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + +from ...models.osidb_api_v1_affects_cvss_scores_list_issuer import OsidbApiV1AffectsCvssScoresListIssuer +from ...models.osidb_api_v1_affects_cvss_scores_list_response_200 import OsidbApiV1AffectsCvssScoresListResponse200 +from uuid import UUID +import datetime def _get_kwargs( - affect_id: str, + affect_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/{affect_id}/cvss_scores".format( - client.base_url, - affect_id=affect_id, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_created_dt: Union[Unset, None, str] = UNSET + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["comment"] = comment + + json_created_dt: Union[Unset, str] = UNSET if not isinstance(created_dt, Unset): - json_created_dt = created_dt.isoformat() if created_dt else None + json_created_dt = created_dt.isoformat() + + params["created_dt"] = json_created_dt - json_created_dt_date: Union[Unset, None, str] = UNSET + json_created_dt_date: Union[Unset, str] = UNSET if not isinstance(created_dt_date, Unset): - json_created_dt_date = created_dt_date.isoformat() if created_dt_date else None + json_created_dt_date = created_dt_date.isoformat() + + params["created_dt__date"] = json_created_dt_date - json_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_gte, Unset): - json_created_dt_date_gte = ( - created_dt_date_gte.isoformat() if created_dt_date_gte else None - ) + json_created_dt_date_gte = created_dt_date_gte.isoformat() + + params["created_dt__date__gte"] = json_created_dt_date_gte - json_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_lte, Unset): - json_created_dt_date_lte = ( - created_dt_date_lte.isoformat() if created_dt_date_lte else None - ) + json_created_dt_date_lte = created_dt_date_lte.isoformat() - json_created_dt_gt: Union[Unset, None, str] = UNSET + params["created_dt__date__lte"] = json_created_dt_date_lte + + json_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(created_dt_gt, Unset): - json_created_dt_gt = created_dt_gt.isoformat() if created_dt_gt else None + json_created_dt_gt = created_dt_gt.isoformat() + + params["created_dt__gt"] = json_created_dt_gt - json_created_dt_gte: Union[Unset, None, str] = UNSET + json_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_gte, Unset): - json_created_dt_gte = created_dt_gte.isoformat() if created_dt_gte else None + json_created_dt_gte = created_dt_gte.isoformat() + + params["created_dt__gte"] = json_created_dt_gte - json_created_dt_lt: Union[Unset, None, str] = UNSET + json_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(created_dt_lt, Unset): - json_created_dt_lt = created_dt_lt.isoformat() if created_dt_lt else None + json_created_dt_lt = created_dt_lt.isoformat() - json_created_dt_lte: Union[Unset, None, str] = UNSET + params["created_dt__lt"] = json_created_dt_lt + + json_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_lte, Unset): - json_created_dt_lte = created_dt_lte.isoformat() if created_dt_lte else None + json_created_dt_lte = created_dt_lte.isoformat() + + params["created_dt__lte"] = json_created_dt_lte + + params["cvss_version"] = cvss_version - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields - json_issuer: Union[Unset, None, str] = UNSET + params["include_fields"] = json_include_fields + + print(OsidbApiV1AffectsCvssScoresListIssuer) + json_issuer: Union[Unset, str] = UNSET if not isinstance(issuer, Unset): + json_issuer = issuer.value - json_issuer = ( - OsidbApiV1AffectsCvssScoresListIssuer(issuer).value if issuer else None - ) + params["issuer"] = json_issuer - json_updated_dt: Union[Unset, None, str] = UNSET + params["limit"] = limit + + params["offset"] = offset + + params["score"] = score + + json_updated_dt: Union[Unset, str] = UNSET if not isinstance(updated_dt, Unset): - json_updated_dt = updated_dt.isoformat() if updated_dt else None + json_updated_dt = updated_dt.isoformat() - json_updated_dt_date: Union[Unset, None, str] = UNSET + params["updated_dt"] = json_updated_dt + + json_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(updated_dt_date, Unset): - json_updated_dt_date = updated_dt_date.isoformat() if updated_dt_date else None + json_updated_dt_date = updated_dt_date.isoformat() + + params["updated_dt__date"] = json_updated_dt_date - json_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_gte, Unset): - json_updated_dt_date_gte = ( - updated_dt_date_gte.isoformat() if updated_dt_date_gte else None - ) + json_updated_dt_date_gte = updated_dt_date_gte.isoformat() - json_updated_dt_date_lte: Union[Unset, None, str] = UNSET + params["updated_dt__date__gte"] = json_updated_dt_date_gte + + json_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_lte, Unset): - json_updated_dt_date_lte = ( - updated_dt_date_lte.isoformat() if updated_dt_date_lte else None - ) + json_updated_dt_date_lte = updated_dt_date_lte.isoformat() + + params["updated_dt__date__lte"] = json_updated_dt_date_lte - json_updated_dt_gt: Union[Unset, None, str] = UNSET + json_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(updated_dt_gt, Unset): - json_updated_dt_gt = updated_dt_gt.isoformat() if updated_dt_gt else None + json_updated_dt_gt = updated_dt_gt.isoformat() - json_updated_dt_gte: Union[Unset, None, str] = UNSET + params["updated_dt__gt"] = json_updated_dt_gt + + json_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_gte, Unset): - json_updated_dt_gte = updated_dt_gte.isoformat() if updated_dt_gte else None + json_updated_dt_gte = updated_dt_gte.isoformat() + + params["updated_dt__gte"] = json_updated_dt_gte - json_updated_dt_lt: Union[Unset, None, str] = UNSET + json_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(updated_dt_lt, Unset): - json_updated_dt_lt = updated_dt_lt.isoformat() if updated_dt_lt else None + json_updated_dt_lt = updated_dt_lt.isoformat() + + params["updated_dt__lt"] = json_updated_dt_lt - json_updated_dt_lte: Union[Unset, None, str] = UNSET + json_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_lte, Unset): - json_updated_dt_lte = updated_dt_lte.isoformat() if updated_dt_lte else None - - params: Dict[str, Any] = { - "comment": comment, - "created_dt": json_created_dt, - "created_dt__date": json_created_dt_date, - "created_dt__date__gte": json_created_dt_date_gte, - "created_dt__date__lte": json_created_dt_date_lte, - "created_dt__gt": json_created_dt_gt, - "created_dt__gte": json_created_dt_gte, - "created_dt__lt": json_created_dt_lt, - "created_dt__lte": json_created_dt_lte, - "cvss_version": cvss_version, - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - "issuer": json_issuer, - "limit": limit, - "offset": offset, - "score": score, - "updated_dt": json_updated_dt, - "updated_dt__date": json_updated_dt_date, - "updated_dt__date__gte": json_updated_dt_date_gte, - "updated_dt__date__lte": json_updated_dt_date_lte, - "updated_dt__gt": json_updated_dt_gt, - "updated_dt__gte": json_updated_dt_gte, - "updated_dt__lt": json_updated_dt_lt, - "updated_dt__lte": json_updated_dt_lte, - "uuid": uuid, - "vector": vector, - } + json_updated_dt_lte = updated_dt_lte.isoformat() + + params["updated_dt__lte"] = json_updated_dt_lte + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid + + params["vector"] = vector + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/affects/{affect_id}/cvss_scores".format( + affect_id=affect_id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsCvssScoresListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -219,56 +201,95 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1AffectsCvssScoresListResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1AffectsCvssScoresListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsCvssScoresListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - affect_id: str, + affect_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, ) -> Response[OsidbApiV1AffectsCvssScoresListResponse200]: + """ + Args: + affect_id (UUID): + comment (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_version (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + issuer (Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + score (Union[Unset, float]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + vector (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresListResponse200] + """ + kwargs = _get_kwargs( affect_id=affect_id, client=client, @@ -308,41 +329,77 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - affect_id: str, + affect_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, ) -> Optional[OsidbApiV1AffectsCvssScoresListResponse200]: - """ """ + """ + Args: + affect_id (UUID): + comment (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_version (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + issuer (Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + score (Union[Unset, float]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + vector (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresListResponse200 + """ return sync_detailed( affect_id=affect_id, @@ -376,40 +433,77 @@ def sync( ).parsed -async def async_detailed( - affect_id: str, +async def asyncio_detailed( + affect_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, ) -> Response[OsidbApiV1AffectsCvssScoresListResponse200]: + """ + Args: + affect_id (UUID): + comment (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_version (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + issuer (Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + score (Union[Unset, float]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + vector (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresListResponse200] + """ + kwargs = _get_kwargs( affect_id=affect_id, - client=client, comment=comment, created_dt=created_dt, created_dt_date=created_dt_date, @@ -438,52 +532,82 @@ async def async_detailed( vector=vector, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - affect_id: str, +async def asyncio( + affect_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, ) -> Optional[OsidbApiV1AffectsCvssScoresListResponse200]: - """ """ + """ + Args: + affect_id (UUID): + comment (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_version (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + issuer (Union[Unset, OsidbApiV1AffectsCvssScoresListIssuer]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + score (Union[Unset, float]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + vector (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( affect_id=affect_id, client=client, comment=comment, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_retrieve.py index 5bb685a..a22a679 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_retrieve.py @@ -1,64 +1,56 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_affects_cvss_scores_retrieve_response_200 import ( OsidbApiV1AffectsCvssScoresRetrieveResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], -} +from uuid import UUID def _get_kwargs( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/{affect_id}/cvss_scores/{id}".format( - client.base_url, - affect_id=affect_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + params["exclude_fields"] = json_exclude_fields + + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/affects/{affect_id}/cvss_scores/{id}".format( + affect_id=affect_id, + id=id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsCvssScoresRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -66,33 +58,49 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1AffectsCvssScoresRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1AffectsCvssScoresRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsCvssScoresRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1AffectsCvssScoresRetrieveResponse200]: + """ + Args: + affect_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresRetrieveResponse200] + """ + kwargs = _get_kwargs( affect_id=affect_id, id=id, @@ -109,18 +117,31 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1AffectsCvssScoresRetrieveResponse200]: - """ """ + """ + Args: + affect_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresRetrieveResponse200 + """ return sync_detailed( affect_id=affect_id, @@ -131,45 +152,66 @@ def sync( ).parsed -async def async_detailed( - affect_id: str, +async def asyncio_detailed( + affect_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1AffectsCvssScoresRetrieveResponse200]: + """ + Args: + affect_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresRetrieveResponse200] + """ + kwargs = _get_kwargs( affect_id=affect_id, id=id, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - affect_id: str, +async def asyncio( + affect_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1AffectsCvssScoresRetrieveResponse200]: - """ """ + """ + Args: + affect_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( affect_id=affect_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_update.py index c1a9c76..3d4e0ef 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_cvss_scores_update.py @@ -1,52 +1,52 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.affect_cvss_put import AffectCVSSPut -from ...models.osidb_api_v1_affects_cvss_scores_update_response_200 import ( - OsidbApiV1AffectsCvssScoresUpdateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = AffectCVSSPut +from ...models.affect_cvss_put import AffectCVSSPut +from ...models.osidb_api_v1_affects_cvss_scores_update_response_200 import OsidbApiV1AffectsCvssScoresUpdateResponse200 +from uuid import UUID def _get_kwargs( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: AffectCVSSPut, - multipart_data: AffectCVSSPut, - json_body: AffectCVSSPut, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/{affect_id}/cvss_scores/{id}".format( - client.base_url, - affect_id=affect_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + AffectCVSSPut, + AffectCVSSPut, + AffectCVSSPut, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/affects/{affect_id}/cvss_scores/{id}".format( + affect_id=affect_id, + id=id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, AffectCVSSPut): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsCvssScoresUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -54,41 +54,59 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1AffectsCvssScoresUpdateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1AffectsCvssScoresUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsCvssScoresUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: AffectCVSSPut, - multipart_data: AffectCVSSPut, - json_body: AffectCVSSPut, + body: Union[ + AffectCVSSPut, + AffectCVSSPut, + AffectCVSSPut, + ], ) -> Response[OsidbApiV1AffectsCvssScoresUpdateResponse200]: + """ + Args: + affect_id (UUID): + id (str): + bugzilla_api_key (str): + body (AffectCVSSPut): AffectCVSS serializer + body (AffectCVSSPut): AffectCVSS serializer + body (AffectCVSSPut): AffectCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresUpdateResponse200] + """ + kwargs = _get_kwargs( affect_id=affect_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -99,77 +117,117 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - affect_id: str, + affect_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: AffectCVSSPut, - multipart_data: AffectCVSSPut, - json_body: AffectCVSSPut, + body: Union[ + AffectCVSSPut, + AffectCVSSPut, + AffectCVSSPut, + ], ) -> Optional[OsidbApiV1AffectsCvssScoresUpdateResponse200]: - """ """ + """ + Args: + affect_id (UUID): + id (str): + bugzilla_api_key (str): + body (AffectCVSSPut): AffectCVSS serializer + body (AffectCVSSPut): AffectCVSS serializer + body (AffectCVSSPut): AffectCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresUpdateResponse200 + """ return sync_detailed( affect_id=affect_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - affect_id: str, +async def asyncio_detailed( + affect_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: AffectCVSSPut, - multipart_data: AffectCVSSPut, - json_body: AffectCVSSPut, + body: Union[ + AffectCVSSPut, + AffectCVSSPut, + AffectCVSSPut, + ], ) -> Response[OsidbApiV1AffectsCvssScoresUpdateResponse200]: + """ + Args: + affect_id (UUID): + id (str): + bugzilla_api_key (str): + body (AffectCVSSPut): AffectCVSS serializer + body (AffectCVSSPut): AffectCVSS serializer + body (AffectCVSSPut): AffectCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsCvssScoresUpdateResponse200] + """ + kwargs = _get_kwargs( affect_id=affect_id, id=id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - affect_id: str, +async def asyncio( + affect_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: AffectCVSSPut, - multipart_data: AffectCVSSPut, - json_body: AffectCVSSPut, + body: Union[ + AffectCVSSPut, + AffectCVSSPut, + AffectCVSSPut, + ], ) -> Optional[OsidbApiV1AffectsCvssScoresUpdateResponse200]: - """ """ + """ + Args: + affect_id (UUID): + id (str): + bugzilla_api_key (str): + body (AffectCVSSPut): AffectCVSS serializer + body (AffectCVSSPut): AffectCVSS serializer + body (AffectCVSSPut): AffectCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsCvssScoresUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( affect_id=affect_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_destroy.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_destroy.py index 479a3bb..d64962b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_destroy.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_destroy.py @@ -1,36 +1,36 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_affects_destroy_response_200 import ( - OsidbApiV1AffectsDestroyResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_api_v1_affects_destroy_response_200 import OsidbApiV1AffectsDestroyResponse200 +from uuid import UUID def _get_kwargs( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/{uuid}".format( - client.base_url, - uuid=uuid, - ) - - headers: Dict[str, Any] = client.get_headers() +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/affects/{uuid}".format( + uuid=uuid, + ), } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsDestroyResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -41,25 +41,42 @@ def _parse_response( response_200 = OsidbApiV1AffectsDestroyResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsDestroyResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1AffectsDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + uuid (UUID): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsDestroyResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, client=client, @@ -73,15 +90,27 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1AffectsDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + uuid (UUID): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsDestroyResponse200 + """ return sync_detailed( uuid=uuid, @@ -89,36 +118,55 @@ def sync( ).parsed -async def async_detailed( - uuid: str, +async def asyncio_detailed( + uuid: UUID, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1AffectsDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + uuid (UUID): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsDestroyResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, - client=client, ) - async with client.get_async_session().delete( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - uuid: str, +async def asyncio( + uuid: UUID, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1AffectsDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + uuid (UUID): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsDestroyResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( uuid=uuid, client=client, ) diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_list.py index 1223462..cd1f30f 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_list.py @@ -1,916 +1,732 @@ -import datetime -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_affects_list_affectedness import ( - OsidbApiV1AffectsListAffectedness, -) -from ...models.osidb_api_v1_affects_list_cvss_scores_issuer import ( - OsidbApiV1AffectsListCvssScoresIssuer, -) -from ...models.osidb_api_v1_affects_list_flaw_impact import ( - OsidbApiV1AffectsListFlawImpact, -) -from ...models.osidb_api_v1_affects_list_flaw_source import ( - OsidbApiV1AffectsListFlawSource, -) +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + +from ...models.osidb_api_v1_affects_list_affectedness import OsidbApiV1AffectsListAffectedness +from ...models.osidb_api_v1_affects_list_cvss_scores_issuer import OsidbApiV1AffectsListCvssScoresIssuer +from ...models.osidb_api_v1_affects_list_flaw_impact import OsidbApiV1AffectsListFlawImpact +from ...models.osidb_api_v1_affects_list_flaw_source import OsidbApiV1AffectsListFlawSource from ...models.osidb_api_v1_affects_list_impact import OsidbApiV1AffectsListImpact -from ...models.osidb_api_v1_affects_list_order_item import ( - OsidbApiV1AffectsListOrderItem, -) -from ...models.osidb_api_v1_affects_list_resolution import ( - OsidbApiV1AffectsListResolution, -) -from ...models.osidb_api_v1_affects_list_response_200 import ( - OsidbApiV1AffectsListResponse200, -) -from ...models.osidb_api_v1_affects_list_trackers_type import ( - OsidbApiV1AffectsListTrackersType, -) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "affectedness": OsidbApiV1AffectsListAffectedness, - "created_dt": datetime.datetime, - "created_dt__date": datetime.date, - "created_dt__date__gte": datetime.date, - "created_dt__date__lte": datetime.date, - "created_dt__gt": datetime.datetime, - "created_dt__gte": datetime.datetime, - "created_dt__lt": datetime.datetime, - "created_dt__lte": datetime.datetime, - "cvss_scores__comment": str, - "cvss_scores__created_dt": datetime.datetime, - "cvss_scores__created_dt__date": datetime.date, - "cvss_scores__created_dt__date__gte": datetime.date, - "cvss_scores__created_dt__date__lte": datetime.date, - "cvss_scores__created_dt__gt": datetime.datetime, - "cvss_scores__created_dt__gte": datetime.datetime, - "cvss_scores__created_dt__lt": datetime.datetime, - "cvss_scores__created_dt__lte": datetime.datetime, - "cvss_scores__cvss_version": str, - "cvss_scores__issuer": OsidbApiV1AffectsListCvssScoresIssuer, - "cvss_scores__score": float, - "cvss_scores__updated_dt": datetime.datetime, - "cvss_scores__updated_dt__date": datetime.date, - "cvss_scores__updated_dt__date__gte": datetime.date, - "cvss_scores__updated_dt__date__lte": datetime.date, - "cvss_scores__updated_dt__gt": datetime.datetime, - "cvss_scores__updated_dt__gte": datetime.datetime, - "cvss_scores__updated_dt__lt": datetime.datetime, - "cvss_scores__updated_dt__lte": datetime.datetime, - "cvss_scores__uuid": str, - "cvss_scores__vector": str, - "embargoed": bool, - "exclude_fields": List[str], - "flaw__components": List[str], - "flaw__created_dt": datetime.datetime, - "flaw__created_dt__date": datetime.date, - "flaw__created_dt__date__gte": datetime.date, - "flaw__created_dt__date__lte": datetime.date, - "flaw__created_dt__gt": datetime.datetime, - "flaw__created_dt__gte": datetime.datetime, - "flaw__created_dt__lt": datetime.datetime, - "flaw__created_dt__lte": datetime.datetime, - "flaw__cve_id": str, - "flaw__cwe_id": str, - "flaw__embargoed": bool, - "flaw__impact": OsidbApiV1AffectsListFlawImpact, - "flaw__reported_dt": datetime.datetime, - "flaw__reported_dt__date": datetime.date, - "flaw__reported_dt__date__gte": datetime.date, - "flaw__reported_dt__date__lte": datetime.date, - "flaw__reported_dt__gt": datetime.datetime, - "flaw__reported_dt__gte": datetime.datetime, - "flaw__reported_dt__lt": datetime.datetime, - "flaw__reported_dt__lte": datetime.datetime, - "flaw__source": OsidbApiV1AffectsListFlawSource, - "flaw__unembargo_dt": datetime.datetime, - "flaw__updated_dt": datetime.datetime, - "flaw__updated_dt__date": datetime.date, - "flaw__updated_dt__date__gte": datetime.date, - "flaw__updated_dt__date__lte": datetime.date, - "flaw__updated_dt__gt": datetime.datetime, - "flaw__updated_dt__gte": datetime.datetime, - "flaw__updated_dt__lt": datetime.datetime, - "flaw__updated_dt__lte": datetime.datetime, - "flaw__uuid": str, - "impact": OsidbApiV1AffectsListImpact, - "include_fields": List[str], - "include_meta_attr": List[str], - "limit": int, - "offset": int, - "order": List[OsidbApiV1AffectsListOrderItem], - "ps_component": str, - "ps_module": str, - "resolution": OsidbApiV1AffectsListResolution, - "trackers__created_dt": datetime.datetime, - "trackers__created_dt__date": datetime.date, - "trackers__created_dt__date__gte": datetime.date, - "trackers__created_dt__date__lte": datetime.date, - "trackers__created_dt__gt": datetime.datetime, - "trackers__created_dt__gte": datetime.datetime, - "trackers__created_dt__lt": datetime.datetime, - "trackers__created_dt__lte": datetime.datetime, - "trackers__embargoed": bool, - "trackers__external_system_id": str, - "trackers__ps_update_stream": str, - "trackers__resolution": str, - "trackers__status": str, - "trackers__type": OsidbApiV1AffectsListTrackersType, - "trackers__updated_dt": datetime.datetime, - "trackers__updated_dt__date": datetime.date, - "trackers__updated_dt__date__gte": datetime.date, - "trackers__updated_dt__date__lte": datetime.date, - "trackers__updated_dt__gt": datetime.datetime, - "trackers__updated_dt__gte": datetime.datetime, - "trackers__updated_dt__lt": datetime.datetime, - "trackers__updated_dt__lte": datetime.datetime, - "trackers__uuid": str, - "updated_dt": datetime.datetime, - "updated_dt__date": datetime.date, - "updated_dt__date__gte": datetime.date, - "updated_dt__date__lte": datetime.date, - "updated_dt__gt": datetime.datetime, - "updated_dt__gte": datetime.datetime, - "updated_dt__lt": datetime.datetime, - "updated_dt__lte": datetime.datetime, - "uuid": str, -} +from ...models.osidb_api_v1_affects_list_order_item import OsidbApiV1AffectsListOrderItem +from ...models.osidb_api_v1_affects_list_resolution import OsidbApiV1AffectsListResolution +from ...models.osidb_api_v1_affects_list_response_200 import OsidbApiV1AffectsListResponse200 +from ...models.osidb_api_v1_affects_list_trackers_type import OsidbApiV1AffectsListTrackersType +from uuid import UUID +import datetime def _get_kwargs( *, client: AuthenticatedClient, - affectedness: Union[Unset, None, OsidbApiV1AffectsListAffectedness] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[ - Unset, None, OsidbApiV1AffectsListCvssScoresIssuer - ] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - flaw_components: Union[Unset, None, List[str]] = UNSET, - flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_cve_id: Union[Unset, None, str] = UNSET, - flaw_cwe_id: Union[Unset, None, str] = UNSET, - flaw_embargoed: Union[Unset, None, bool] = UNSET, - flaw_impact: Union[Unset, None, OsidbApiV1AffectsListFlawImpact] = UNSET, - flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_source: Union[Unset, None, OsidbApiV1AffectsListFlawSource] = UNSET, - flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_uuid: Union[Unset, None, str] = UNSET, - impact: Union[Unset, None, OsidbApiV1AffectsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1AffectsListOrderItem]] = UNSET, - ps_component: Union[Unset, None, str] = UNSET, - ps_module: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, OsidbApiV1AffectsListResolution] = UNSET, - trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_embargoed: Union[Unset, None, bool] = UNSET, - trackers_external_system_id: Union[Unset, None, str] = UNSET, - trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - trackers_resolution: Union[Unset, None, str] = UNSET, - trackers_status: Union[Unset, None, str] = UNSET, - trackers_type: Union[Unset, None, OsidbApiV1AffectsListTrackersType] = UNSET, - trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_uuid: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_affectedness: Union[Unset, None, str] = UNSET + affectedness: Union[Unset, OsidbApiV1AffectsListAffectedness] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + flaw_components: Union[Unset, list[str]] = UNSET, + flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_cve_id: Union[Unset, str] = UNSET, + flaw_cwe_id: Union[Unset, str] = UNSET, + flaw_embargoed: Union[Unset, bool] = UNSET, + flaw_impact: Union[Unset, OsidbApiV1AffectsListFlawImpact] = UNSET, + flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_source: Union[Unset, OsidbApiV1AffectsListFlawSource] = UNSET, + flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_uuid: Union[Unset, UUID] = UNSET, + impact: Union[Unset, OsidbApiV1AffectsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1AffectsListOrderItem]] = UNSET, + ps_component: Union[Unset, str] = UNSET, + ps_module: Union[Unset, str] = UNSET, + resolution: Union[Unset, OsidbApiV1AffectsListResolution] = UNSET, + trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_embargoed: Union[Unset, bool] = UNSET, + trackers_external_system_id: Union[Unset, str] = UNSET, + trackers_ps_update_stream: Union[Unset, str] = UNSET, + trackers_resolution: Union[Unset, str] = UNSET, + trackers_status: Union[Unset, str] = UNSET, + trackers_type: Union[Unset, OsidbApiV1AffectsListTrackersType] = UNSET, + trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_uuid: Union[Unset, UUID] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + print(OsidbApiV1AffectsListAffectedness) + json_affectedness: Union[Unset, str] = UNSET if not isinstance(affectedness, Unset): + json_affectedness = affectedness.value - json_affectedness = ( - OsidbApiV1AffectsListAffectedness(affectedness).value - if affectedness - else None - ) + params["affectedness"] = json_affectedness - json_created_dt: Union[Unset, None, str] = UNSET + json_created_dt: Union[Unset, str] = UNSET if not isinstance(created_dt, Unset): - json_created_dt = created_dt.isoformat() if created_dt else None + json_created_dt = created_dt.isoformat() + + params["created_dt"] = json_created_dt - json_created_dt_date: Union[Unset, None, str] = UNSET + json_created_dt_date: Union[Unset, str] = UNSET if not isinstance(created_dt_date, Unset): - json_created_dt_date = created_dt_date.isoformat() if created_dt_date else None + json_created_dt_date = created_dt_date.isoformat() + + params["created_dt__date"] = json_created_dt_date - json_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_gte, Unset): - json_created_dt_date_gte = ( - created_dt_date_gte.isoformat() if created_dt_date_gte else None - ) + json_created_dt_date_gte = created_dt_date_gte.isoformat() + + params["created_dt__date__gte"] = json_created_dt_date_gte - json_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_lte, Unset): - json_created_dt_date_lte = ( - created_dt_date_lte.isoformat() if created_dt_date_lte else None - ) + json_created_dt_date_lte = created_dt_date_lte.isoformat() - json_created_dt_gt: Union[Unset, None, str] = UNSET + params["created_dt__date__lte"] = json_created_dt_date_lte + + json_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(created_dt_gt, Unset): - json_created_dt_gt = created_dt_gt.isoformat() if created_dt_gt else None + json_created_dt_gt = created_dt_gt.isoformat() + + params["created_dt__gt"] = json_created_dt_gt - json_created_dt_gte: Union[Unset, None, str] = UNSET + json_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_gte, Unset): - json_created_dt_gte = created_dt_gte.isoformat() if created_dt_gte else None + json_created_dt_gte = created_dt_gte.isoformat() + + params["created_dt__gte"] = json_created_dt_gte - json_created_dt_lt: Union[Unset, None, str] = UNSET + json_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(created_dt_lt, Unset): - json_created_dt_lt = created_dt_lt.isoformat() if created_dt_lt else None + json_created_dt_lt = created_dt_lt.isoformat() - json_created_dt_lte: Union[Unset, None, str] = UNSET + params["created_dt__lt"] = json_created_dt_lt + + json_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_lte, Unset): - json_created_dt_lte = created_dt_lte.isoformat() if created_dt_lte else None + json_created_dt_lte = created_dt_lte.isoformat() + + params["created_dt__lte"] = json_created_dt_lte + + params["cvss_scores__comment"] = cvss_scores_comment - json_cvss_scores_created_dt: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt, Unset): - json_cvss_scores_created_dt = ( - cvss_scores_created_dt.isoformat() if cvss_scores_created_dt else None - ) + json_cvss_scores_created_dt = cvss_scores_created_dt.isoformat() + + params["cvss_scores__created_dt"] = json_cvss_scores_created_dt - json_cvss_scores_created_dt_date: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt_date: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_date, Unset): - json_cvss_scores_created_dt_date = ( - cvss_scores_created_dt_date.isoformat() - if cvss_scores_created_dt_date - else None - ) + json_cvss_scores_created_dt_date = cvss_scores_created_dt_date.isoformat() - json_cvss_scores_created_dt_date_gte: Union[Unset, None, str] = UNSET + params["cvss_scores__created_dt__date"] = json_cvss_scores_created_dt_date + + json_cvss_scores_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_date_gte, Unset): - json_cvss_scores_created_dt_date_gte = ( - cvss_scores_created_dt_date_gte.isoformat() - if cvss_scores_created_dt_date_gte - else None - ) + json_cvss_scores_created_dt_date_gte = cvss_scores_created_dt_date_gte.isoformat() - json_cvss_scores_created_dt_date_lte: Union[Unset, None, str] = UNSET + params["cvss_scores__created_dt__date__gte"] = json_cvss_scores_created_dt_date_gte + + json_cvss_scores_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_date_lte, Unset): - json_cvss_scores_created_dt_date_lte = ( - cvss_scores_created_dt_date_lte.isoformat() - if cvss_scores_created_dt_date_lte - else None - ) + json_cvss_scores_created_dt_date_lte = cvss_scores_created_dt_date_lte.isoformat() + + params["cvss_scores__created_dt__date__lte"] = json_cvss_scores_created_dt_date_lte - json_cvss_scores_created_dt_gt: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_gt, Unset): - json_cvss_scores_created_dt_gt = ( - cvss_scores_created_dt_gt.isoformat() if cvss_scores_created_dt_gt else None - ) + json_cvss_scores_created_dt_gt = cvss_scores_created_dt_gt.isoformat() + + params["cvss_scores__created_dt__gt"] = json_cvss_scores_created_dt_gt - json_cvss_scores_created_dt_gte: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_gte, Unset): - json_cvss_scores_created_dt_gte = ( - cvss_scores_created_dt_gte.isoformat() - if cvss_scores_created_dt_gte - else None - ) + json_cvss_scores_created_dt_gte = cvss_scores_created_dt_gte.isoformat() - json_cvss_scores_created_dt_lt: Union[Unset, None, str] = UNSET + params["cvss_scores__created_dt__gte"] = json_cvss_scores_created_dt_gte + + json_cvss_scores_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_lt, Unset): - json_cvss_scores_created_dt_lt = ( - cvss_scores_created_dt_lt.isoformat() if cvss_scores_created_dt_lt else None - ) + json_cvss_scores_created_dt_lt = cvss_scores_created_dt_lt.isoformat() + + params["cvss_scores__created_dt__lt"] = json_cvss_scores_created_dt_lt - json_cvss_scores_created_dt_lte: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_lte, Unset): - json_cvss_scores_created_dt_lte = ( - cvss_scores_created_dt_lte.isoformat() - if cvss_scores_created_dt_lte - else None - ) + json_cvss_scores_created_dt_lte = cvss_scores_created_dt_lte.isoformat() + + params["cvss_scores__created_dt__lte"] = json_cvss_scores_created_dt_lte + + params["cvss_scores__cvss_version"] = cvss_scores_cvss_version - json_cvss_scores_issuer: Union[Unset, None, str] = UNSET + print(OsidbApiV1AffectsListCvssScoresIssuer) + json_cvss_scores_issuer: Union[Unset, str] = UNSET if not isinstance(cvss_scores_issuer, Unset): + json_cvss_scores_issuer = cvss_scores_issuer.value - json_cvss_scores_issuer = ( - OsidbApiV1AffectsListCvssScoresIssuer(cvss_scores_issuer).value - if cvss_scores_issuer - else None - ) + params["cvss_scores__issuer"] = json_cvss_scores_issuer + + params["cvss_scores__score"] = cvss_scores_score - json_cvss_scores_updated_dt: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt, Unset): - json_cvss_scores_updated_dt = ( - cvss_scores_updated_dt.isoformat() if cvss_scores_updated_dt else None - ) + json_cvss_scores_updated_dt = cvss_scores_updated_dt.isoformat() - json_cvss_scores_updated_dt_date: Union[Unset, None, str] = UNSET + params["cvss_scores__updated_dt"] = json_cvss_scores_updated_dt + + json_cvss_scores_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_date, Unset): - json_cvss_scores_updated_dt_date = ( - cvss_scores_updated_dt_date.isoformat() - if cvss_scores_updated_dt_date - else None - ) + json_cvss_scores_updated_dt_date = cvss_scores_updated_dt_date.isoformat() + + params["cvss_scores__updated_dt__date"] = json_cvss_scores_updated_dt_date - json_cvss_scores_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_date_gte, Unset): - json_cvss_scores_updated_dt_date_gte = ( - cvss_scores_updated_dt_date_gte.isoformat() - if cvss_scores_updated_dt_date_gte - else None - ) + json_cvss_scores_updated_dt_date_gte = cvss_scores_updated_dt_date_gte.isoformat() + + params["cvss_scores__updated_dt__date__gte"] = json_cvss_scores_updated_dt_date_gte - json_cvss_scores_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_date_lte, Unset): - json_cvss_scores_updated_dt_date_lte = ( - cvss_scores_updated_dt_date_lte.isoformat() - if cvss_scores_updated_dt_date_lte - else None - ) + json_cvss_scores_updated_dt_date_lte = cvss_scores_updated_dt_date_lte.isoformat() - json_cvss_scores_updated_dt_gt: Union[Unset, None, str] = UNSET + params["cvss_scores__updated_dt__date__lte"] = json_cvss_scores_updated_dt_date_lte + + json_cvss_scores_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_gt, Unset): - json_cvss_scores_updated_dt_gt = ( - cvss_scores_updated_dt_gt.isoformat() if cvss_scores_updated_dt_gt else None - ) + json_cvss_scores_updated_dt_gt = cvss_scores_updated_dt_gt.isoformat() - json_cvss_scores_updated_dt_gte: Union[Unset, None, str] = UNSET + params["cvss_scores__updated_dt__gt"] = json_cvss_scores_updated_dt_gt + + json_cvss_scores_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_gte, Unset): - json_cvss_scores_updated_dt_gte = ( - cvss_scores_updated_dt_gte.isoformat() - if cvss_scores_updated_dt_gte - else None - ) + json_cvss_scores_updated_dt_gte = cvss_scores_updated_dt_gte.isoformat() + + params["cvss_scores__updated_dt__gte"] = json_cvss_scores_updated_dt_gte - json_cvss_scores_updated_dt_lt: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_lt, Unset): - json_cvss_scores_updated_dt_lt = ( - cvss_scores_updated_dt_lt.isoformat() if cvss_scores_updated_dt_lt else None - ) + json_cvss_scores_updated_dt_lt = cvss_scores_updated_dt_lt.isoformat() + + params["cvss_scores__updated_dt__lt"] = json_cvss_scores_updated_dt_lt - json_cvss_scores_updated_dt_lte: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_lte, Unset): - json_cvss_scores_updated_dt_lte = ( - cvss_scores_updated_dt_lte.isoformat() - if cvss_scores_updated_dt_lte - else None - ) + json_cvss_scores_updated_dt_lte = cvss_scores_updated_dt_lte.isoformat() - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + params["cvss_scores__updated_dt__lte"] = json_cvss_scores_updated_dt_lte + + json_cvss_scores_uuid: Union[Unset, str] = UNSET + if not isinstance(cvss_scores_uuid, Unset): + json_cvss_scores_uuid = str(cvss_scores_uuid) + + params["cvss_scores__uuid"] = json_cvss_scores_uuid + + params["cvss_scores__vector"] = cvss_scores_vector + + params["embargoed"] = embargoed + + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields - json_flaw_components: Union[Unset, None, List[str]] = UNSET + params["exclude_fields"] = json_exclude_fields + + json_flaw_components: Union[Unset, list[str]] = UNSET if not isinstance(flaw_components, Unset): - if flaw_components is None: - json_flaw_components = None - else: - json_flaw_components = flaw_components + json_flaw_components = flaw_components + + params["flaw__components"] = json_flaw_components - json_flaw_created_dt: Union[Unset, None, str] = UNSET + json_flaw_created_dt: Union[Unset, str] = UNSET if not isinstance(flaw_created_dt, Unset): - json_flaw_created_dt = flaw_created_dt.isoformat() if flaw_created_dt else None + json_flaw_created_dt = flaw_created_dt.isoformat() - json_flaw_created_dt_date: Union[Unset, None, str] = UNSET + params["flaw__created_dt"] = json_flaw_created_dt + + json_flaw_created_dt_date: Union[Unset, str] = UNSET if not isinstance(flaw_created_dt_date, Unset): - json_flaw_created_dt_date = ( - flaw_created_dt_date.isoformat() if flaw_created_dt_date else None - ) + json_flaw_created_dt_date = flaw_created_dt_date.isoformat() + + params["flaw__created_dt__date"] = json_flaw_created_dt_date - json_flaw_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_flaw_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(flaw_created_dt_date_gte, Unset): - json_flaw_created_dt_date_gte = ( - flaw_created_dt_date_gte.isoformat() if flaw_created_dt_date_gte else None - ) + json_flaw_created_dt_date_gte = flaw_created_dt_date_gte.isoformat() + + params["flaw__created_dt__date__gte"] = json_flaw_created_dt_date_gte - json_flaw_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_flaw_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(flaw_created_dt_date_lte, Unset): - json_flaw_created_dt_date_lte = ( - flaw_created_dt_date_lte.isoformat() if flaw_created_dt_date_lte else None - ) + json_flaw_created_dt_date_lte = flaw_created_dt_date_lte.isoformat() - json_flaw_created_dt_gt: Union[Unset, None, str] = UNSET + params["flaw__created_dt__date__lte"] = json_flaw_created_dt_date_lte + + json_flaw_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(flaw_created_dt_gt, Unset): - json_flaw_created_dt_gt = ( - flaw_created_dt_gt.isoformat() if flaw_created_dt_gt else None - ) + json_flaw_created_dt_gt = flaw_created_dt_gt.isoformat() - json_flaw_created_dt_gte: Union[Unset, None, str] = UNSET + params["flaw__created_dt__gt"] = json_flaw_created_dt_gt + + json_flaw_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(flaw_created_dt_gte, Unset): - json_flaw_created_dt_gte = ( - flaw_created_dt_gte.isoformat() if flaw_created_dt_gte else None - ) + json_flaw_created_dt_gte = flaw_created_dt_gte.isoformat() + + params["flaw__created_dt__gte"] = json_flaw_created_dt_gte - json_flaw_created_dt_lt: Union[Unset, None, str] = UNSET + json_flaw_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(flaw_created_dt_lt, Unset): - json_flaw_created_dt_lt = ( - flaw_created_dt_lt.isoformat() if flaw_created_dt_lt else None - ) + json_flaw_created_dt_lt = flaw_created_dt_lt.isoformat() + + params["flaw__created_dt__lt"] = json_flaw_created_dt_lt - json_flaw_created_dt_lte: Union[Unset, None, str] = UNSET + json_flaw_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(flaw_created_dt_lte, Unset): - json_flaw_created_dt_lte = ( - flaw_created_dt_lte.isoformat() if flaw_created_dt_lte else None - ) + json_flaw_created_dt_lte = flaw_created_dt_lte.isoformat() - json_flaw_impact: Union[Unset, None, str] = UNSET + params["flaw__created_dt__lte"] = json_flaw_created_dt_lte + + params["flaw__cve_id"] = flaw_cve_id + + params["flaw__cwe_id"] = flaw_cwe_id + + params["flaw__embargoed"] = flaw_embargoed + + print(OsidbApiV1AffectsListFlawImpact) + json_flaw_impact: Union[Unset, str] = UNSET if not isinstance(flaw_impact, Unset): + json_flaw_impact = flaw_impact.value - json_flaw_impact = ( - OsidbApiV1AffectsListFlawImpact(flaw_impact).value if flaw_impact else None - ) + params["flaw__impact"] = json_flaw_impact - json_flaw_reported_dt: Union[Unset, None, str] = UNSET + json_flaw_reported_dt: Union[Unset, str] = UNSET if not isinstance(flaw_reported_dt, Unset): - json_flaw_reported_dt = ( - flaw_reported_dt.isoformat() if flaw_reported_dt else None - ) + json_flaw_reported_dt = flaw_reported_dt.isoformat() - json_flaw_reported_dt_date: Union[Unset, None, str] = UNSET + params["flaw__reported_dt"] = json_flaw_reported_dt + + json_flaw_reported_dt_date: Union[Unset, str] = UNSET if not isinstance(flaw_reported_dt_date, Unset): - json_flaw_reported_dt_date = ( - flaw_reported_dt_date.isoformat() if flaw_reported_dt_date else None - ) + json_flaw_reported_dt_date = flaw_reported_dt_date.isoformat() + + params["flaw__reported_dt__date"] = json_flaw_reported_dt_date - json_flaw_reported_dt_date_gte: Union[Unset, None, str] = UNSET + json_flaw_reported_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(flaw_reported_dt_date_gte, Unset): - json_flaw_reported_dt_date_gte = ( - flaw_reported_dt_date_gte.isoformat() if flaw_reported_dt_date_gte else None - ) + json_flaw_reported_dt_date_gte = flaw_reported_dt_date_gte.isoformat() + + params["flaw__reported_dt__date__gte"] = json_flaw_reported_dt_date_gte - json_flaw_reported_dt_date_lte: Union[Unset, None, str] = UNSET + json_flaw_reported_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(flaw_reported_dt_date_lte, Unset): - json_flaw_reported_dt_date_lte = ( - flaw_reported_dt_date_lte.isoformat() if flaw_reported_dt_date_lte else None - ) + json_flaw_reported_dt_date_lte = flaw_reported_dt_date_lte.isoformat() - json_flaw_reported_dt_gt: Union[Unset, None, str] = UNSET + params["flaw__reported_dt__date__lte"] = json_flaw_reported_dt_date_lte + + json_flaw_reported_dt_gt: Union[Unset, str] = UNSET if not isinstance(flaw_reported_dt_gt, Unset): - json_flaw_reported_dt_gt = ( - flaw_reported_dt_gt.isoformat() if flaw_reported_dt_gt else None - ) + json_flaw_reported_dt_gt = flaw_reported_dt_gt.isoformat() + + params["flaw__reported_dt__gt"] = json_flaw_reported_dt_gt - json_flaw_reported_dt_gte: Union[Unset, None, str] = UNSET + json_flaw_reported_dt_gte: Union[Unset, str] = UNSET if not isinstance(flaw_reported_dt_gte, Unset): - json_flaw_reported_dt_gte = ( - flaw_reported_dt_gte.isoformat() if flaw_reported_dt_gte else None - ) + json_flaw_reported_dt_gte = flaw_reported_dt_gte.isoformat() + + params["flaw__reported_dt__gte"] = json_flaw_reported_dt_gte - json_flaw_reported_dt_lt: Union[Unset, None, str] = UNSET + json_flaw_reported_dt_lt: Union[Unset, str] = UNSET if not isinstance(flaw_reported_dt_lt, Unset): - json_flaw_reported_dt_lt = ( - flaw_reported_dt_lt.isoformat() if flaw_reported_dt_lt else None - ) + json_flaw_reported_dt_lt = flaw_reported_dt_lt.isoformat() + + params["flaw__reported_dt__lt"] = json_flaw_reported_dt_lt - json_flaw_reported_dt_lte: Union[Unset, None, str] = UNSET + json_flaw_reported_dt_lte: Union[Unset, str] = UNSET if not isinstance(flaw_reported_dt_lte, Unset): - json_flaw_reported_dt_lte = ( - flaw_reported_dt_lte.isoformat() if flaw_reported_dt_lte else None - ) + json_flaw_reported_dt_lte = flaw_reported_dt_lte.isoformat() - json_flaw_source: Union[Unset, None, str] = UNSET + params["flaw__reported_dt__lte"] = json_flaw_reported_dt_lte + + print(OsidbApiV1AffectsListFlawSource) + json_flaw_source: Union[Unset, str] = UNSET if not isinstance(flaw_source, Unset): + json_flaw_source = flaw_source.value - json_flaw_source = ( - OsidbApiV1AffectsListFlawSource(flaw_source).value if flaw_source else None - ) + params["flaw__source"] = json_flaw_source - json_flaw_unembargo_dt: Union[Unset, None, str] = UNSET + json_flaw_unembargo_dt: Union[Unset, str] = UNSET if not isinstance(flaw_unembargo_dt, Unset): - json_flaw_unembargo_dt = ( - flaw_unembargo_dt.isoformat() if flaw_unembargo_dt else None - ) + json_flaw_unembargo_dt = flaw_unembargo_dt.isoformat() - json_flaw_updated_dt: Union[Unset, None, str] = UNSET + params["flaw__unembargo_dt"] = json_flaw_unembargo_dt + + json_flaw_updated_dt: Union[Unset, str] = UNSET if not isinstance(flaw_updated_dt, Unset): - json_flaw_updated_dt = flaw_updated_dt.isoformat() if flaw_updated_dt else None + json_flaw_updated_dt = flaw_updated_dt.isoformat() + + params["flaw__updated_dt"] = json_flaw_updated_dt - json_flaw_updated_dt_date: Union[Unset, None, str] = UNSET + json_flaw_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(flaw_updated_dt_date, Unset): - json_flaw_updated_dt_date = ( - flaw_updated_dt_date.isoformat() if flaw_updated_dt_date else None - ) + json_flaw_updated_dt_date = flaw_updated_dt_date.isoformat() - json_flaw_updated_dt_date_gte: Union[Unset, None, str] = UNSET + params["flaw__updated_dt__date"] = json_flaw_updated_dt_date + + json_flaw_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(flaw_updated_dt_date_gte, Unset): - json_flaw_updated_dt_date_gte = ( - flaw_updated_dt_date_gte.isoformat() if flaw_updated_dt_date_gte else None - ) + json_flaw_updated_dt_date_gte = flaw_updated_dt_date_gte.isoformat() + + params["flaw__updated_dt__date__gte"] = json_flaw_updated_dt_date_gte - json_flaw_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_flaw_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(flaw_updated_dt_date_lte, Unset): - json_flaw_updated_dt_date_lte = ( - flaw_updated_dt_date_lte.isoformat() if flaw_updated_dt_date_lte else None - ) + json_flaw_updated_dt_date_lte = flaw_updated_dt_date_lte.isoformat() + + params["flaw__updated_dt__date__lte"] = json_flaw_updated_dt_date_lte - json_flaw_updated_dt_gt: Union[Unset, None, str] = UNSET + json_flaw_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(flaw_updated_dt_gt, Unset): - json_flaw_updated_dt_gt = ( - flaw_updated_dt_gt.isoformat() if flaw_updated_dt_gt else None - ) + json_flaw_updated_dt_gt = flaw_updated_dt_gt.isoformat() - json_flaw_updated_dt_gte: Union[Unset, None, str] = UNSET + params["flaw__updated_dt__gt"] = json_flaw_updated_dt_gt + + json_flaw_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(flaw_updated_dt_gte, Unset): - json_flaw_updated_dt_gte = ( - flaw_updated_dt_gte.isoformat() if flaw_updated_dt_gte else None - ) + json_flaw_updated_dt_gte = flaw_updated_dt_gte.isoformat() + + params["flaw__updated_dt__gte"] = json_flaw_updated_dt_gte - json_flaw_updated_dt_lt: Union[Unset, None, str] = UNSET + json_flaw_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(flaw_updated_dt_lt, Unset): - json_flaw_updated_dt_lt = ( - flaw_updated_dt_lt.isoformat() if flaw_updated_dt_lt else None - ) + json_flaw_updated_dt_lt = flaw_updated_dt_lt.isoformat() + + params["flaw__updated_dt__lt"] = json_flaw_updated_dt_lt - json_flaw_updated_dt_lte: Union[Unset, None, str] = UNSET + json_flaw_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(flaw_updated_dt_lte, Unset): - json_flaw_updated_dt_lte = ( - flaw_updated_dt_lte.isoformat() if flaw_updated_dt_lte else None - ) + json_flaw_updated_dt_lte = flaw_updated_dt_lte.isoformat() + + params["flaw__updated_dt__lte"] = json_flaw_updated_dt_lte + + json_flaw_uuid: Union[Unset, str] = UNSET + if not isinstance(flaw_uuid, Unset): + json_flaw_uuid = str(flaw_uuid) - json_impact: Union[Unset, None, str] = UNSET + params["flaw__uuid"] = json_flaw_uuid + + print(OsidbApiV1AffectsListImpact) + json_impact: Union[Unset, str] = UNSET if not isinstance(impact, Unset): + json_impact = impact.value - json_impact = OsidbApiV1AffectsListImpact(impact).value if impact else None + params["impact"] = json_impact - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - json_include_meta_attr: Union[Unset, None, List[str]] = UNSET + json_include_meta_attr: Union[Unset, list[str]] = UNSET if not isinstance(include_meta_attr, Unset): - if include_meta_attr is None: - json_include_meta_attr = None - else: - json_include_meta_attr = include_meta_attr + json_include_meta_attr = include_meta_attr + + params["include_meta_attr"] = json_include_meta_attr + + params["limit"] = limit - json_order: Union[Unset, None, List[str]] = UNSET + params["offset"] = offset + + json_order: Union[Unset, list[str]] = UNSET if not isinstance(order, Unset): - if order is None: - json_order = None - else: - json_order = [] - for order_item_data in order: - order_item: str = UNSET - if not isinstance(order_item_data, Unset): + json_order = [] + for order_item_data in order: + print(OsidbApiV1AffectsListOrderItem) + order_item: str = UNSET + if not isinstance(order_item_data, Unset): + order_item = order_item_data.value + + json_order.append(order_item) - order_item = OsidbApiV1AffectsListOrderItem(order_item_data).value + params["order"] = json_order - json_order.append(order_item) + params["ps_component"] = ps_component - json_resolution: Union[Unset, None, str] = UNSET + params["ps_module"] = ps_module + + print(OsidbApiV1AffectsListResolution) + json_resolution: Union[Unset, str] = UNSET if not isinstance(resolution, Unset): + json_resolution = resolution.value - json_resolution = ( - OsidbApiV1AffectsListResolution(resolution).value if resolution else None - ) + params["resolution"] = json_resolution - json_trackers_created_dt: Union[Unset, None, str] = UNSET + json_trackers_created_dt: Union[Unset, str] = UNSET if not isinstance(trackers_created_dt, Unset): - json_trackers_created_dt = ( - trackers_created_dt.isoformat() if trackers_created_dt else None - ) + json_trackers_created_dt = trackers_created_dt.isoformat() - json_trackers_created_dt_date: Union[Unset, None, str] = UNSET + params["trackers__created_dt"] = json_trackers_created_dt + + json_trackers_created_dt_date: Union[Unset, str] = UNSET if not isinstance(trackers_created_dt_date, Unset): - json_trackers_created_dt_date = ( - trackers_created_dt_date.isoformat() if trackers_created_dt_date else None - ) + json_trackers_created_dt_date = trackers_created_dt_date.isoformat() + + params["trackers__created_dt__date"] = json_trackers_created_dt_date - json_trackers_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_trackers_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(trackers_created_dt_date_gte, Unset): - json_trackers_created_dt_date_gte = ( - trackers_created_dt_date_gte.isoformat() - if trackers_created_dt_date_gte - else None - ) + json_trackers_created_dt_date_gte = trackers_created_dt_date_gte.isoformat() + + params["trackers__created_dt__date__gte"] = json_trackers_created_dt_date_gte - json_trackers_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_trackers_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(trackers_created_dt_date_lte, Unset): - json_trackers_created_dt_date_lte = ( - trackers_created_dt_date_lte.isoformat() - if trackers_created_dt_date_lte - else None - ) + json_trackers_created_dt_date_lte = trackers_created_dt_date_lte.isoformat() - json_trackers_created_dt_gt: Union[Unset, None, str] = UNSET + params["trackers__created_dt__date__lte"] = json_trackers_created_dt_date_lte + + json_trackers_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(trackers_created_dt_gt, Unset): - json_trackers_created_dt_gt = ( - trackers_created_dt_gt.isoformat() if trackers_created_dt_gt else None - ) + json_trackers_created_dt_gt = trackers_created_dt_gt.isoformat() + + params["trackers__created_dt__gt"] = json_trackers_created_dt_gt - json_trackers_created_dt_gte: Union[Unset, None, str] = UNSET + json_trackers_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(trackers_created_dt_gte, Unset): - json_trackers_created_dt_gte = ( - trackers_created_dt_gte.isoformat() if trackers_created_dt_gte else None - ) + json_trackers_created_dt_gte = trackers_created_dt_gte.isoformat() + + params["trackers__created_dt__gte"] = json_trackers_created_dt_gte - json_trackers_created_dt_lt: Union[Unset, None, str] = UNSET + json_trackers_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(trackers_created_dt_lt, Unset): - json_trackers_created_dt_lt = ( - trackers_created_dt_lt.isoformat() if trackers_created_dt_lt else None - ) + json_trackers_created_dt_lt = trackers_created_dt_lt.isoformat() + + params["trackers__created_dt__lt"] = json_trackers_created_dt_lt - json_trackers_created_dt_lte: Union[Unset, None, str] = UNSET + json_trackers_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(trackers_created_dt_lte, Unset): - json_trackers_created_dt_lte = ( - trackers_created_dt_lte.isoformat() if trackers_created_dt_lte else None - ) + json_trackers_created_dt_lte = trackers_created_dt_lte.isoformat() + + params["trackers__created_dt__lte"] = json_trackers_created_dt_lte + + params["trackers__embargoed"] = trackers_embargoed + + params["trackers__external_system_id"] = trackers_external_system_id - json_trackers_type: Union[Unset, None, str] = UNSET + params["trackers__ps_update_stream"] = trackers_ps_update_stream + + params["trackers__resolution"] = trackers_resolution + + params["trackers__status"] = trackers_status + + print(OsidbApiV1AffectsListTrackersType) + json_trackers_type: Union[Unset, str] = UNSET if not isinstance(trackers_type, Unset): + json_trackers_type = trackers_type.value - json_trackers_type = ( - OsidbApiV1AffectsListTrackersType(trackers_type).value - if trackers_type - else None - ) + params["trackers__type"] = json_trackers_type - json_trackers_updated_dt: Union[Unset, None, str] = UNSET + json_trackers_updated_dt: Union[Unset, str] = UNSET if not isinstance(trackers_updated_dt, Unset): - json_trackers_updated_dt = ( - trackers_updated_dt.isoformat() if trackers_updated_dt else None - ) + json_trackers_updated_dt = trackers_updated_dt.isoformat() + + params["trackers__updated_dt"] = json_trackers_updated_dt - json_trackers_updated_dt_date: Union[Unset, None, str] = UNSET + json_trackers_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(trackers_updated_dt_date, Unset): - json_trackers_updated_dt_date = ( - trackers_updated_dt_date.isoformat() if trackers_updated_dt_date else None - ) + json_trackers_updated_dt_date = trackers_updated_dt_date.isoformat() + + params["trackers__updated_dt__date"] = json_trackers_updated_dt_date - json_trackers_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_trackers_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(trackers_updated_dt_date_gte, Unset): - json_trackers_updated_dt_date_gte = ( - trackers_updated_dt_date_gte.isoformat() - if trackers_updated_dt_date_gte - else None - ) + json_trackers_updated_dt_date_gte = trackers_updated_dt_date_gte.isoformat() - json_trackers_updated_dt_date_lte: Union[Unset, None, str] = UNSET + params["trackers__updated_dt__date__gte"] = json_trackers_updated_dt_date_gte + + json_trackers_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(trackers_updated_dt_date_lte, Unset): - json_trackers_updated_dt_date_lte = ( - trackers_updated_dt_date_lte.isoformat() - if trackers_updated_dt_date_lte - else None - ) + json_trackers_updated_dt_date_lte = trackers_updated_dt_date_lte.isoformat() + + params["trackers__updated_dt__date__lte"] = json_trackers_updated_dt_date_lte - json_trackers_updated_dt_gt: Union[Unset, None, str] = UNSET + json_trackers_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(trackers_updated_dt_gt, Unset): - json_trackers_updated_dt_gt = ( - trackers_updated_dt_gt.isoformat() if trackers_updated_dt_gt else None - ) + json_trackers_updated_dt_gt = trackers_updated_dt_gt.isoformat() + + params["trackers__updated_dt__gt"] = json_trackers_updated_dt_gt - json_trackers_updated_dt_gte: Union[Unset, None, str] = UNSET + json_trackers_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(trackers_updated_dt_gte, Unset): - json_trackers_updated_dt_gte = ( - trackers_updated_dt_gte.isoformat() if trackers_updated_dt_gte else None - ) + json_trackers_updated_dt_gte = trackers_updated_dt_gte.isoformat() - json_trackers_updated_dt_lt: Union[Unset, None, str] = UNSET + params["trackers__updated_dt__gte"] = json_trackers_updated_dt_gte + + json_trackers_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(trackers_updated_dt_lt, Unset): - json_trackers_updated_dt_lt = ( - trackers_updated_dt_lt.isoformat() if trackers_updated_dt_lt else None - ) + json_trackers_updated_dt_lt = trackers_updated_dt_lt.isoformat() - json_trackers_updated_dt_lte: Union[Unset, None, str] = UNSET + params["trackers__updated_dt__lt"] = json_trackers_updated_dt_lt + + json_trackers_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(trackers_updated_dt_lte, Unset): - json_trackers_updated_dt_lte = ( - trackers_updated_dt_lte.isoformat() if trackers_updated_dt_lte else None - ) + json_trackers_updated_dt_lte = trackers_updated_dt_lte.isoformat() + + params["trackers__updated_dt__lte"] = json_trackers_updated_dt_lte - json_updated_dt: Union[Unset, None, str] = UNSET + json_trackers_uuid: Union[Unset, str] = UNSET + if not isinstance(trackers_uuid, Unset): + json_trackers_uuid = str(trackers_uuid) + + params["trackers__uuid"] = json_trackers_uuid + + json_updated_dt: Union[Unset, str] = UNSET if not isinstance(updated_dt, Unset): - json_updated_dt = updated_dt.isoformat() if updated_dt else None + json_updated_dt = updated_dt.isoformat() + + params["updated_dt"] = json_updated_dt - json_updated_dt_date: Union[Unset, None, str] = UNSET + json_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(updated_dt_date, Unset): - json_updated_dt_date = updated_dt_date.isoformat() if updated_dt_date else None + json_updated_dt_date = updated_dt_date.isoformat() - json_updated_dt_date_gte: Union[Unset, None, str] = UNSET + params["updated_dt__date"] = json_updated_dt_date + + json_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_gte, Unset): - json_updated_dt_date_gte = ( - updated_dt_date_gte.isoformat() if updated_dt_date_gte else None - ) + json_updated_dt_date_gte = updated_dt_date_gte.isoformat() + + params["updated_dt__date__gte"] = json_updated_dt_date_gte - json_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_lte, Unset): - json_updated_dt_date_lte = ( - updated_dt_date_lte.isoformat() if updated_dt_date_lte else None - ) + json_updated_dt_date_lte = updated_dt_date_lte.isoformat() + + params["updated_dt__date__lte"] = json_updated_dt_date_lte - json_updated_dt_gt: Union[Unset, None, str] = UNSET + json_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(updated_dt_gt, Unset): - json_updated_dt_gt = updated_dt_gt.isoformat() if updated_dt_gt else None + json_updated_dt_gt = updated_dt_gt.isoformat() + + params["updated_dt__gt"] = json_updated_dt_gt - json_updated_dt_gte: Union[Unset, None, str] = UNSET + json_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_gte, Unset): - json_updated_dt_gte = updated_dt_gte.isoformat() if updated_dt_gte else None + json_updated_dt_gte = updated_dt_gte.isoformat() - json_updated_dt_lt: Union[Unset, None, str] = UNSET + params["updated_dt__gte"] = json_updated_dt_gte + + json_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(updated_dt_lt, Unset): - json_updated_dt_lt = updated_dt_lt.isoformat() if updated_dt_lt else None + json_updated_dt_lt = updated_dt_lt.isoformat() + + params["updated_dt__lt"] = json_updated_dt_lt - json_updated_dt_lte: Union[Unset, None, str] = UNSET + json_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_lte, Unset): - json_updated_dt_lte = updated_dt_lte.isoformat() if updated_dt_lte else None - - params: Dict[str, Any] = { - "affectedness": json_affectedness, - "created_dt": json_created_dt, - "created_dt__date": json_created_dt_date, - "created_dt__date__gte": json_created_dt_date_gte, - "created_dt__date__lte": json_created_dt_date_lte, - "created_dt__gt": json_created_dt_gt, - "created_dt__gte": json_created_dt_gte, - "created_dt__lt": json_created_dt_lt, - "created_dt__lte": json_created_dt_lte, - "cvss_scores__comment": cvss_scores_comment, - "cvss_scores__created_dt": json_cvss_scores_created_dt, - "cvss_scores__created_dt__date": json_cvss_scores_created_dt_date, - "cvss_scores__created_dt__date__gte": json_cvss_scores_created_dt_date_gte, - "cvss_scores__created_dt__date__lte": json_cvss_scores_created_dt_date_lte, - "cvss_scores__created_dt__gt": json_cvss_scores_created_dt_gt, - "cvss_scores__created_dt__gte": json_cvss_scores_created_dt_gte, - "cvss_scores__created_dt__lt": json_cvss_scores_created_dt_lt, - "cvss_scores__created_dt__lte": json_cvss_scores_created_dt_lte, - "cvss_scores__cvss_version": cvss_scores_cvss_version, - "cvss_scores__issuer": json_cvss_scores_issuer, - "cvss_scores__score": cvss_scores_score, - "cvss_scores__updated_dt": json_cvss_scores_updated_dt, - "cvss_scores__updated_dt__date": json_cvss_scores_updated_dt_date, - "cvss_scores__updated_dt__date__gte": json_cvss_scores_updated_dt_date_gte, - "cvss_scores__updated_dt__date__lte": json_cvss_scores_updated_dt_date_lte, - "cvss_scores__updated_dt__gt": json_cvss_scores_updated_dt_gt, - "cvss_scores__updated_dt__gte": json_cvss_scores_updated_dt_gte, - "cvss_scores__updated_dt__lt": json_cvss_scores_updated_dt_lt, - "cvss_scores__updated_dt__lte": json_cvss_scores_updated_dt_lte, - "cvss_scores__uuid": cvss_scores_uuid, - "cvss_scores__vector": cvss_scores_vector, - "embargoed": embargoed, - "exclude_fields": json_exclude_fields, - "flaw__components": json_flaw_components, - "flaw__created_dt": json_flaw_created_dt, - "flaw__created_dt__date": json_flaw_created_dt_date, - "flaw__created_dt__date__gte": json_flaw_created_dt_date_gte, - "flaw__created_dt__date__lte": json_flaw_created_dt_date_lte, - "flaw__created_dt__gt": json_flaw_created_dt_gt, - "flaw__created_dt__gte": json_flaw_created_dt_gte, - "flaw__created_dt__lt": json_flaw_created_dt_lt, - "flaw__created_dt__lte": json_flaw_created_dt_lte, - "flaw__cve_id": flaw_cve_id, - "flaw__cwe_id": flaw_cwe_id, - "flaw__embargoed": flaw_embargoed, - "flaw__impact": json_flaw_impact, - "flaw__reported_dt": json_flaw_reported_dt, - "flaw__reported_dt__date": json_flaw_reported_dt_date, - "flaw__reported_dt__date__gte": json_flaw_reported_dt_date_gte, - "flaw__reported_dt__date__lte": json_flaw_reported_dt_date_lte, - "flaw__reported_dt__gt": json_flaw_reported_dt_gt, - "flaw__reported_dt__gte": json_flaw_reported_dt_gte, - "flaw__reported_dt__lt": json_flaw_reported_dt_lt, - "flaw__reported_dt__lte": json_flaw_reported_dt_lte, - "flaw__source": json_flaw_source, - "flaw__unembargo_dt": json_flaw_unembargo_dt, - "flaw__updated_dt": json_flaw_updated_dt, - "flaw__updated_dt__date": json_flaw_updated_dt_date, - "flaw__updated_dt__date__gte": json_flaw_updated_dt_date_gte, - "flaw__updated_dt__date__lte": json_flaw_updated_dt_date_lte, - "flaw__updated_dt__gt": json_flaw_updated_dt_gt, - "flaw__updated_dt__gte": json_flaw_updated_dt_gte, - "flaw__updated_dt__lt": json_flaw_updated_dt_lt, - "flaw__updated_dt__lte": json_flaw_updated_dt_lte, - "flaw__uuid": flaw_uuid, - "impact": json_impact, - "include_fields": json_include_fields, - "include_meta_attr": json_include_meta_attr, - "limit": limit, - "offset": offset, - "order": json_order, - "ps_component": ps_component, - "ps_module": ps_module, - "resolution": json_resolution, - "trackers__created_dt": json_trackers_created_dt, - "trackers__created_dt__date": json_trackers_created_dt_date, - "trackers__created_dt__date__gte": json_trackers_created_dt_date_gte, - "trackers__created_dt__date__lte": json_trackers_created_dt_date_lte, - "trackers__created_dt__gt": json_trackers_created_dt_gt, - "trackers__created_dt__gte": json_trackers_created_dt_gte, - "trackers__created_dt__lt": json_trackers_created_dt_lt, - "trackers__created_dt__lte": json_trackers_created_dt_lte, - "trackers__embargoed": trackers_embargoed, - "trackers__external_system_id": trackers_external_system_id, - "trackers__ps_update_stream": trackers_ps_update_stream, - "trackers__resolution": trackers_resolution, - "trackers__status": trackers_status, - "trackers__type": json_trackers_type, - "trackers__updated_dt": json_trackers_updated_dt, - "trackers__updated_dt__date": json_trackers_updated_dt_date, - "trackers__updated_dt__date__gte": json_trackers_updated_dt_date_gte, - "trackers__updated_dt__date__lte": json_trackers_updated_dt_date_lte, - "trackers__updated_dt__gt": json_trackers_updated_dt_gt, - "trackers__updated_dt__gte": json_trackers_updated_dt_gte, - "trackers__updated_dt__lt": json_trackers_updated_dt_lt, - "trackers__updated_dt__lte": json_trackers_updated_dt_lte, - "trackers__uuid": trackers_uuid, - "updated_dt": json_updated_dt, - "updated_dt__date": json_updated_dt_date, - "updated_dt__date__gte": json_updated_dt_date_gte, - "updated_dt__date__lte": json_updated_dt_date_lte, - "updated_dt__gt": json_updated_dt_gt, - "updated_dt__gte": json_updated_dt_gte, - "updated_dt__lt": json_updated_dt_lt, - "updated_dt__lte": json_updated_dt_lte, - "uuid": uuid, - } + json_updated_dt_lte = updated_dt_lte.isoformat() + + params["updated_dt__lte"] = json_updated_dt_lte + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/affects", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -921,132 +737,250 @@ def _parse_response( response_200 = OsidbApiV1AffectsListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - affectedness: Union[Unset, None, OsidbApiV1AffectsListAffectedness] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[ - Unset, None, OsidbApiV1AffectsListCvssScoresIssuer - ] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - flaw_components: Union[Unset, None, List[str]] = UNSET, - flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_cve_id: Union[Unset, None, str] = UNSET, - flaw_cwe_id: Union[Unset, None, str] = UNSET, - flaw_embargoed: Union[Unset, None, bool] = UNSET, - flaw_impact: Union[Unset, None, OsidbApiV1AffectsListFlawImpact] = UNSET, - flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_source: Union[Unset, None, OsidbApiV1AffectsListFlawSource] = UNSET, - flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_uuid: Union[Unset, None, str] = UNSET, - impact: Union[Unset, None, OsidbApiV1AffectsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1AffectsListOrderItem]] = UNSET, - ps_component: Union[Unset, None, str] = UNSET, - ps_module: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, OsidbApiV1AffectsListResolution] = UNSET, - trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_embargoed: Union[Unset, None, bool] = UNSET, - trackers_external_system_id: Union[Unset, None, str] = UNSET, - trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - trackers_resolution: Union[Unset, None, str] = UNSET, - trackers_status: Union[Unset, None, str] = UNSET, - trackers_type: Union[Unset, None, OsidbApiV1AffectsListTrackersType] = UNSET, - trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_uuid: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affectedness: Union[Unset, OsidbApiV1AffectsListAffectedness] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + flaw_components: Union[Unset, list[str]] = UNSET, + flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_cve_id: Union[Unset, str] = UNSET, + flaw_cwe_id: Union[Unset, str] = UNSET, + flaw_embargoed: Union[Unset, bool] = UNSET, + flaw_impact: Union[Unset, OsidbApiV1AffectsListFlawImpact] = UNSET, + flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_source: Union[Unset, OsidbApiV1AffectsListFlawSource] = UNSET, + flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_uuid: Union[Unset, UUID] = UNSET, + impact: Union[Unset, OsidbApiV1AffectsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1AffectsListOrderItem]] = UNSET, + ps_component: Union[Unset, str] = UNSET, + ps_module: Union[Unset, str] = UNSET, + resolution: Union[Unset, OsidbApiV1AffectsListResolution] = UNSET, + trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_embargoed: Union[Unset, bool] = UNSET, + trackers_external_system_id: Union[Unset, str] = UNSET, + trackers_ps_update_stream: Union[Unset, str] = UNSET, + trackers_resolution: Union[Unset, str] = UNSET, + trackers_status: Union[Unset, str] = UNSET, + trackers_type: Union[Unset, OsidbApiV1AffectsListTrackersType] = UNSET, + trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_uuid: Union[Unset, UUID] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1AffectsListResponse200]: + """ + Args: + affectedness (Union[Unset, OsidbApiV1AffectsListAffectedness]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_comment (Union[Unset, str]): + cvss_scores_created_dt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_date (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_created_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_cvss_version (Union[Unset, str]): + cvss_scores_issuer (Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer]): + cvss_scores_score (Union[Unset, float]): + cvss_scores_updated_dt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_date (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_uuid (Union[Unset, UUID]): + cvss_scores_vector (Union[Unset, str]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + flaw_components (Union[Unset, list[str]]): + flaw_created_dt (Union[Unset, datetime.datetime]): + flaw_created_dt_date (Union[Unset, datetime.date]): + flaw_created_dt_date_gte (Union[Unset, datetime.date]): + flaw_created_dt_date_lte (Union[Unset, datetime.date]): + flaw_created_dt_gt (Union[Unset, datetime.datetime]): + flaw_created_dt_gte (Union[Unset, datetime.datetime]): + flaw_created_dt_lt (Union[Unset, datetime.datetime]): + flaw_created_dt_lte (Union[Unset, datetime.datetime]): + flaw_cve_id (Union[Unset, str]): + flaw_cwe_id (Union[Unset, str]): + flaw_embargoed (Union[Unset, bool]): + flaw_impact (Union[Unset, OsidbApiV1AffectsListFlawImpact]): + flaw_reported_dt (Union[Unset, datetime.datetime]): + flaw_reported_dt_date (Union[Unset, datetime.date]): + flaw_reported_dt_date_gte (Union[Unset, datetime.date]): + flaw_reported_dt_date_lte (Union[Unset, datetime.date]): + flaw_reported_dt_gt (Union[Unset, datetime.datetime]): + flaw_reported_dt_gte (Union[Unset, datetime.datetime]): + flaw_reported_dt_lt (Union[Unset, datetime.datetime]): + flaw_reported_dt_lte (Union[Unset, datetime.datetime]): + flaw_source (Union[Unset, OsidbApiV1AffectsListFlawSource]): + flaw_unembargo_dt (Union[Unset, datetime.datetime]): + flaw_updated_dt (Union[Unset, datetime.datetime]): + flaw_updated_dt_date (Union[Unset, datetime.date]): + flaw_updated_dt_date_gte (Union[Unset, datetime.date]): + flaw_updated_dt_date_lte (Union[Unset, datetime.date]): + flaw_updated_dt_gt (Union[Unset, datetime.datetime]): + flaw_updated_dt_gte (Union[Unset, datetime.datetime]): + flaw_updated_dt_lt (Union[Unset, datetime.datetime]): + flaw_updated_dt_lte (Union[Unset, datetime.datetime]): + flaw_uuid (Union[Unset, UUID]): + impact (Union[Unset, OsidbApiV1AffectsListImpact]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1AffectsListOrderItem]]): + ps_component (Union[Unset, str]): + ps_module (Union[Unset, str]): + resolution (Union[Unset, OsidbApiV1AffectsListResolution]): + trackers_created_dt (Union[Unset, datetime.datetime]): + trackers_created_dt_date (Union[Unset, datetime.date]): + trackers_created_dt_date_gte (Union[Unset, datetime.date]): + trackers_created_dt_date_lte (Union[Unset, datetime.date]): + trackers_created_dt_gt (Union[Unset, datetime.datetime]): + trackers_created_dt_gte (Union[Unset, datetime.datetime]): + trackers_created_dt_lt (Union[Unset, datetime.datetime]): + trackers_created_dt_lte (Union[Unset, datetime.datetime]): + trackers_embargoed (Union[Unset, bool]): + trackers_external_system_id (Union[Unset, str]): + trackers_ps_update_stream (Union[Unset, str]): + trackers_resolution (Union[Unset, str]): + trackers_status (Union[Unset, str]): + trackers_type (Union[Unset, OsidbApiV1AffectsListTrackersType]): + trackers_updated_dt (Union[Unset, datetime.datetime]): + trackers_updated_dt_date (Union[Unset, datetime.date]): + trackers_updated_dt_date_gte (Union[Unset, datetime.date]): + trackers_updated_dt_date_lte (Union[Unset, datetime.date]): + trackers_updated_dt_gt (Union[Unset, datetime.datetime]): + trackers_updated_dt_gte (Union[Unset, datetime.datetime]): + trackers_updated_dt_lt (Union[Unset, datetime.datetime]): + trackers_updated_dt_lte (Union[Unset, datetime.datetime]): + trackers_uuid (Union[Unset, UUID]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsListResponse200] + """ + kwargs = _get_kwargs( client=client, affectedness=affectedness, @@ -1165,122 +1099,235 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - affectedness: Union[Unset, None, OsidbApiV1AffectsListAffectedness] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[ - Unset, None, OsidbApiV1AffectsListCvssScoresIssuer - ] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - flaw_components: Union[Unset, None, List[str]] = UNSET, - flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_cve_id: Union[Unset, None, str] = UNSET, - flaw_cwe_id: Union[Unset, None, str] = UNSET, - flaw_embargoed: Union[Unset, None, bool] = UNSET, - flaw_impact: Union[Unset, None, OsidbApiV1AffectsListFlawImpact] = UNSET, - flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_source: Union[Unset, None, OsidbApiV1AffectsListFlawSource] = UNSET, - flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_uuid: Union[Unset, None, str] = UNSET, - impact: Union[Unset, None, OsidbApiV1AffectsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1AffectsListOrderItem]] = UNSET, - ps_component: Union[Unset, None, str] = UNSET, - ps_module: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, OsidbApiV1AffectsListResolution] = UNSET, - trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_embargoed: Union[Unset, None, bool] = UNSET, - trackers_external_system_id: Union[Unset, None, str] = UNSET, - trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - trackers_resolution: Union[Unset, None, str] = UNSET, - trackers_status: Union[Unset, None, str] = UNSET, - trackers_type: Union[Unset, None, OsidbApiV1AffectsListTrackersType] = UNSET, - trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_uuid: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affectedness: Union[Unset, OsidbApiV1AffectsListAffectedness] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + flaw_components: Union[Unset, list[str]] = UNSET, + flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_cve_id: Union[Unset, str] = UNSET, + flaw_cwe_id: Union[Unset, str] = UNSET, + flaw_embargoed: Union[Unset, bool] = UNSET, + flaw_impact: Union[Unset, OsidbApiV1AffectsListFlawImpact] = UNSET, + flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_source: Union[Unset, OsidbApiV1AffectsListFlawSource] = UNSET, + flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_uuid: Union[Unset, UUID] = UNSET, + impact: Union[Unset, OsidbApiV1AffectsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1AffectsListOrderItem]] = UNSET, + ps_component: Union[Unset, str] = UNSET, + ps_module: Union[Unset, str] = UNSET, + resolution: Union[Unset, OsidbApiV1AffectsListResolution] = UNSET, + trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_embargoed: Union[Unset, bool] = UNSET, + trackers_external_system_id: Union[Unset, str] = UNSET, + trackers_ps_update_stream: Union[Unset, str] = UNSET, + trackers_resolution: Union[Unset, str] = UNSET, + trackers_status: Union[Unset, str] = UNSET, + trackers_type: Union[Unset, OsidbApiV1AffectsListTrackersType] = UNSET, + trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_uuid: Union[Unset, UUID] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1AffectsListResponse200]: - """ """ + """ + Args: + affectedness (Union[Unset, OsidbApiV1AffectsListAffectedness]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_comment (Union[Unset, str]): + cvss_scores_created_dt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_date (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_created_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_cvss_version (Union[Unset, str]): + cvss_scores_issuer (Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer]): + cvss_scores_score (Union[Unset, float]): + cvss_scores_updated_dt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_date (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_uuid (Union[Unset, UUID]): + cvss_scores_vector (Union[Unset, str]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + flaw_components (Union[Unset, list[str]]): + flaw_created_dt (Union[Unset, datetime.datetime]): + flaw_created_dt_date (Union[Unset, datetime.date]): + flaw_created_dt_date_gte (Union[Unset, datetime.date]): + flaw_created_dt_date_lte (Union[Unset, datetime.date]): + flaw_created_dt_gt (Union[Unset, datetime.datetime]): + flaw_created_dt_gte (Union[Unset, datetime.datetime]): + flaw_created_dt_lt (Union[Unset, datetime.datetime]): + flaw_created_dt_lte (Union[Unset, datetime.datetime]): + flaw_cve_id (Union[Unset, str]): + flaw_cwe_id (Union[Unset, str]): + flaw_embargoed (Union[Unset, bool]): + flaw_impact (Union[Unset, OsidbApiV1AffectsListFlawImpact]): + flaw_reported_dt (Union[Unset, datetime.datetime]): + flaw_reported_dt_date (Union[Unset, datetime.date]): + flaw_reported_dt_date_gte (Union[Unset, datetime.date]): + flaw_reported_dt_date_lte (Union[Unset, datetime.date]): + flaw_reported_dt_gt (Union[Unset, datetime.datetime]): + flaw_reported_dt_gte (Union[Unset, datetime.datetime]): + flaw_reported_dt_lt (Union[Unset, datetime.datetime]): + flaw_reported_dt_lte (Union[Unset, datetime.datetime]): + flaw_source (Union[Unset, OsidbApiV1AffectsListFlawSource]): + flaw_unembargo_dt (Union[Unset, datetime.datetime]): + flaw_updated_dt (Union[Unset, datetime.datetime]): + flaw_updated_dt_date (Union[Unset, datetime.date]): + flaw_updated_dt_date_gte (Union[Unset, datetime.date]): + flaw_updated_dt_date_lte (Union[Unset, datetime.date]): + flaw_updated_dt_gt (Union[Unset, datetime.datetime]): + flaw_updated_dt_gte (Union[Unset, datetime.datetime]): + flaw_updated_dt_lt (Union[Unset, datetime.datetime]): + flaw_updated_dt_lte (Union[Unset, datetime.datetime]): + flaw_uuid (Union[Unset, UUID]): + impact (Union[Unset, OsidbApiV1AffectsListImpact]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1AffectsListOrderItem]]): + ps_component (Union[Unset, str]): + ps_module (Union[Unset, str]): + resolution (Union[Unset, OsidbApiV1AffectsListResolution]): + trackers_created_dt (Union[Unset, datetime.datetime]): + trackers_created_dt_date (Union[Unset, datetime.date]): + trackers_created_dt_date_gte (Union[Unset, datetime.date]): + trackers_created_dt_date_lte (Union[Unset, datetime.date]): + trackers_created_dt_gt (Union[Unset, datetime.datetime]): + trackers_created_dt_gte (Union[Unset, datetime.datetime]): + trackers_created_dt_lt (Union[Unset, datetime.datetime]): + trackers_created_dt_lte (Union[Unset, datetime.datetime]): + trackers_embargoed (Union[Unset, bool]): + trackers_external_system_id (Union[Unset, str]): + trackers_ps_update_stream (Union[Unset, str]): + trackers_resolution (Union[Unset, str]): + trackers_status (Union[Unset, str]): + trackers_type (Union[Unset, OsidbApiV1AffectsListTrackersType]): + trackers_updated_dt (Union[Unset, datetime.datetime]): + trackers_updated_dt_date (Union[Unset, datetime.date]): + trackers_updated_dt_date_gte (Union[Unset, datetime.date]): + trackers_updated_dt_date_lte (Union[Unset, datetime.date]): + trackers_updated_dt_gt (Union[Unset, datetime.datetime]): + trackers_updated_dt_gte (Union[Unset, datetime.datetime]): + trackers_updated_dt_lt (Union[Unset, datetime.datetime]): + trackers_updated_dt_lte (Union[Unset, datetime.datetime]): + trackers_uuid (Union[Unset, UUID]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsListResponse200 + """ return sync_detailed( client=client, @@ -1393,120 +1440,234 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - affectedness: Union[Unset, None, OsidbApiV1AffectsListAffectedness] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[ - Unset, None, OsidbApiV1AffectsListCvssScoresIssuer - ] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - flaw_components: Union[Unset, None, List[str]] = UNSET, - flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_cve_id: Union[Unset, None, str] = UNSET, - flaw_cwe_id: Union[Unset, None, str] = UNSET, - flaw_embargoed: Union[Unset, None, bool] = UNSET, - flaw_impact: Union[Unset, None, OsidbApiV1AffectsListFlawImpact] = UNSET, - flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_source: Union[Unset, None, OsidbApiV1AffectsListFlawSource] = UNSET, - flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_uuid: Union[Unset, None, str] = UNSET, - impact: Union[Unset, None, OsidbApiV1AffectsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1AffectsListOrderItem]] = UNSET, - ps_component: Union[Unset, None, str] = UNSET, - ps_module: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, OsidbApiV1AffectsListResolution] = UNSET, - trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_embargoed: Union[Unset, None, bool] = UNSET, - trackers_external_system_id: Union[Unset, None, str] = UNSET, - trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - trackers_resolution: Union[Unset, None, str] = UNSET, - trackers_status: Union[Unset, None, str] = UNSET, - trackers_type: Union[Unset, None, OsidbApiV1AffectsListTrackersType] = UNSET, - trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_uuid: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affectedness: Union[Unset, OsidbApiV1AffectsListAffectedness] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + flaw_components: Union[Unset, list[str]] = UNSET, + flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_cve_id: Union[Unset, str] = UNSET, + flaw_cwe_id: Union[Unset, str] = UNSET, + flaw_embargoed: Union[Unset, bool] = UNSET, + flaw_impact: Union[Unset, OsidbApiV1AffectsListFlawImpact] = UNSET, + flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_source: Union[Unset, OsidbApiV1AffectsListFlawSource] = UNSET, + flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_uuid: Union[Unset, UUID] = UNSET, + impact: Union[Unset, OsidbApiV1AffectsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1AffectsListOrderItem]] = UNSET, + ps_component: Union[Unset, str] = UNSET, + ps_module: Union[Unset, str] = UNSET, + resolution: Union[Unset, OsidbApiV1AffectsListResolution] = UNSET, + trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_embargoed: Union[Unset, bool] = UNSET, + trackers_external_system_id: Union[Unset, str] = UNSET, + trackers_ps_update_stream: Union[Unset, str] = UNSET, + trackers_resolution: Union[Unset, str] = UNSET, + trackers_status: Union[Unset, str] = UNSET, + trackers_type: Union[Unset, OsidbApiV1AffectsListTrackersType] = UNSET, + trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_uuid: Union[Unset, UUID] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1AffectsListResponse200]: + """ + Args: + affectedness (Union[Unset, OsidbApiV1AffectsListAffectedness]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_comment (Union[Unset, str]): + cvss_scores_created_dt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_date (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_created_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_cvss_version (Union[Unset, str]): + cvss_scores_issuer (Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer]): + cvss_scores_score (Union[Unset, float]): + cvss_scores_updated_dt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_date (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_uuid (Union[Unset, UUID]): + cvss_scores_vector (Union[Unset, str]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + flaw_components (Union[Unset, list[str]]): + flaw_created_dt (Union[Unset, datetime.datetime]): + flaw_created_dt_date (Union[Unset, datetime.date]): + flaw_created_dt_date_gte (Union[Unset, datetime.date]): + flaw_created_dt_date_lte (Union[Unset, datetime.date]): + flaw_created_dt_gt (Union[Unset, datetime.datetime]): + flaw_created_dt_gte (Union[Unset, datetime.datetime]): + flaw_created_dt_lt (Union[Unset, datetime.datetime]): + flaw_created_dt_lte (Union[Unset, datetime.datetime]): + flaw_cve_id (Union[Unset, str]): + flaw_cwe_id (Union[Unset, str]): + flaw_embargoed (Union[Unset, bool]): + flaw_impact (Union[Unset, OsidbApiV1AffectsListFlawImpact]): + flaw_reported_dt (Union[Unset, datetime.datetime]): + flaw_reported_dt_date (Union[Unset, datetime.date]): + flaw_reported_dt_date_gte (Union[Unset, datetime.date]): + flaw_reported_dt_date_lte (Union[Unset, datetime.date]): + flaw_reported_dt_gt (Union[Unset, datetime.datetime]): + flaw_reported_dt_gte (Union[Unset, datetime.datetime]): + flaw_reported_dt_lt (Union[Unset, datetime.datetime]): + flaw_reported_dt_lte (Union[Unset, datetime.datetime]): + flaw_source (Union[Unset, OsidbApiV1AffectsListFlawSource]): + flaw_unembargo_dt (Union[Unset, datetime.datetime]): + flaw_updated_dt (Union[Unset, datetime.datetime]): + flaw_updated_dt_date (Union[Unset, datetime.date]): + flaw_updated_dt_date_gte (Union[Unset, datetime.date]): + flaw_updated_dt_date_lte (Union[Unset, datetime.date]): + flaw_updated_dt_gt (Union[Unset, datetime.datetime]): + flaw_updated_dt_gte (Union[Unset, datetime.datetime]): + flaw_updated_dt_lt (Union[Unset, datetime.datetime]): + flaw_updated_dt_lte (Union[Unset, datetime.datetime]): + flaw_uuid (Union[Unset, UUID]): + impact (Union[Unset, OsidbApiV1AffectsListImpact]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1AffectsListOrderItem]]): + ps_component (Union[Unset, str]): + ps_module (Union[Unset, str]): + resolution (Union[Unset, OsidbApiV1AffectsListResolution]): + trackers_created_dt (Union[Unset, datetime.datetime]): + trackers_created_dt_date (Union[Unset, datetime.date]): + trackers_created_dt_date_gte (Union[Unset, datetime.date]): + trackers_created_dt_date_lte (Union[Unset, datetime.date]): + trackers_created_dt_gt (Union[Unset, datetime.datetime]): + trackers_created_dt_gte (Union[Unset, datetime.datetime]): + trackers_created_dt_lt (Union[Unset, datetime.datetime]): + trackers_created_dt_lte (Union[Unset, datetime.datetime]): + trackers_embargoed (Union[Unset, bool]): + trackers_external_system_id (Union[Unset, str]): + trackers_ps_update_stream (Union[Unset, str]): + trackers_resolution (Union[Unset, str]): + trackers_status (Union[Unset, str]): + trackers_type (Union[Unset, OsidbApiV1AffectsListTrackersType]): + trackers_updated_dt (Union[Unset, datetime.datetime]): + trackers_updated_dt_date (Union[Unset, datetime.date]): + trackers_updated_dt_date_gte (Union[Unset, datetime.date]): + trackers_updated_dt_date_lte (Union[Unset, datetime.date]): + trackers_updated_dt_gt (Union[Unset, datetime.datetime]): + trackers_updated_dt_gte (Union[Unset, datetime.datetime]): + trackers_updated_dt_lt (Union[Unset, datetime.datetime]): + trackers_updated_dt_lte (Union[Unset, datetime.datetime]): + trackers_uuid (Union[Unset, UUID]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsListResponse200] + """ + kwargs = _get_kwargs( - client=client, affectedness=affectedness, created_dt=created_dt, created_dt_date=created_dt_date, @@ -1615,133 +1776,240 @@ async def async_detailed( uuid=uuid, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - affectedness: Union[Unset, None, OsidbApiV1AffectsListAffectedness] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[ - Unset, None, OsidbApiV1AffectsListCvssScoresIssuer - ] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - flaw_components: Union[Unset, None, List[str]] = UNSET, - flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_cve_id: Union[Unset, None, str] = UNSET, - flaw_cwe_id: Union[Unset, None, str] = UNSET, - flaw_embargoed: Union[Unset, None, bool] = UNSET, - flaw_impact: Union[Unset, None, OsidbApiV1AffectsListFlawImpact] = UNSET, - flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_source: Union[Unset, None, OsidbApiV1AffectsListFlawSource] = UNSET, - flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - flaw_uuid: Union[Unset, None, str] = UNSET, - impact: Union[Unset, None, OsidbApiV1AffectsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1AffectsListOrderItem]] = UNSET, - ps_component: Union[Unset, None, str] = UNSET, - ps_module: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, OsidbApiV1AffectsListResolution] = UNSET, - trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_embargoed: Union[Unset, None, bool] = UNSET, - trackers_external_system_id: Union[Unset, None, str] = UNSET, - trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - trackers_resolution: Union[Unset, None, str] = UNSET, - trackers_status: Union[Unset, None, str] = UNSET, - trackers_type: Union[Unset, None, OsidbApiV1AffectsListTrackersType] = UNSET, - trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - trackers_uuid: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affectedness: Union[Unset, OsidbApiV1AffectsListAffectedness] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + flaw_components: Union[Unset, list[str]] = UNSET, + flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_cve_id: Union[Unset, str] = UNSET, + flaw_cwe_id: Union[Unset, str] = UNSET, + flaw_embargoed: Union[Unset, bool] = UNSET, + flaw_impact: Union[Unset, OsidbApiV1AffectsListFlawImpact] = UNSET, + flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_source: Union[Unset, OsidbApiV1AffectsListFlawSource] = UNSET, + flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + flaw_uuid: Union[Unset, UUID] = UNSET, + impact: Union[Unset, OsidbApiV1AffectsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1AffectsListOrderItem]] = UNSET, + ps_component: Union[Unset, str] = UNSET, + ps_module: Union[Unset, str] = UNSET, + resolution: Union[Unset, OsidbApiV1AffectsListResolution] = UNSET, + trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_embargoed: Union[Unset, bool] = UNSET, + trackers_external_system_id: Union[Unset, str] = UNSET, + trackers_ps_update_stream: Union[Unset, str] = UNSET, + trackers_resolution: Union[Unset, str] = UNSET, + trackers_status: Union[Unset, str] = UNSET, + trackers_type: Union[Unset, OsidbApiV1AffectsListTrackersType] = UNSET, + trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + trackers_uuid: Union[Unset, UUID] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1AffectsListResponse200]: - """ """ + """ + Args: + affectedness (Union[Unset, OsidbApiV1AffectsListAffectedness]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_comment (Union[Unset, str]): + cvss_scores_created_dt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_date (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_created_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_cvss_version (Union[Unset, str]): + cvss_scores_issuer (Union[Unset, OsidbApiV1AffectsListCvssScoresIssuer]): + cvss_scores_score (Union[Unset, float]): + cvss_scores_updated_dt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_date (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_uuid (Union[Unset, UUID]): + cvss_scores_vector (Union[Unset, str]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + flaw_components (Union[Unset, list[str]]): + flaw_created_dt (Union[Unset, datetime.datetime]): + flaw_created_dt_date (Union[Unset, datetime.date]): + flaw_created_dt_date_gte (Union[Unset, datetime.date]): + flaw_created_dt_date_lte (Union[Unset, datetime.date]): + flaw_created_dt_gt (Union[Unset, datetime.datetime]): + flaw_created_dt_gte (Union[Unset, datetime.datetime]): + flaw_created_dt_lt (Union[Unset, datetime.datetime]): + flaw_created_dt_lte (Union[Unset, datetime.datetime]): + flaw_cve_id (Union[Unset, str]): + flaw_cwe_id (Union[Unset, str]): + flaw_embargoed (Union[Unset, bool]): + flaw_impact (Union[Unset, OsidbApiV1AffectsListFlawImpact]): + flaw_reported_dt (Union[Unset, datetime.datetime]): + flaw_reported_dt_date (Union[Unset, datetime.date]): + flaw_reported_dt_date_gte (Union[Unset, datetime.date]): + flaw_reported_dt_date_lte (Union[Unset, datetime.date]): + flaw_reported_dt_gt (Union[Unset, datetime.datetime]): + flaw_reported_dt_gte (Union[Unset, datetime.datetime]): + flaw_reported_dt_lt (Union[Unset, datetime.datetime]): + flaw_reported_dt_lte (Union[Unset, datetime.datetime]): + flaw_source (Union[Unset, OsidbApiV1AffectsListFlawSource]): + flaw_unembargo_dt (Union[Unset, datetime.datetime]): + flaw_updated_dt (Union[Unset, datetime.datetime]): + flaw_updated_dt_date (Union[Unset, datetime.date]): + flaw_updated_dt_date_gte (Union[Unset, datetime.date]): + flaw_updated_dt_date_lte (Union[Unset, datetime.date]): + flaw_updated_dt_gt (Union[Unset, datetime.datetime]): + flaw_updated_dt_gte (Union[Unset, datetime.datetime]): + flaw_updated_dt_lt (Union[Unset, datetime.datetime]): + flaw_updated_dt_lte (Union[Unset, datetime.datetime]): + flaw_uuid (Union[Unset, UUID]): + impact (Union[Unset, OsidbApiV1AffectsListImpact]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1AffectsListOrderItem]]): + ps_component (Union[Unset, str]): + ps_module (Union[Unset, str]): + resolution (Union[Unset, OsidbApiV1AffectsListResolution]): + trackers_created_dt (Union[Unset, datetime.datetime]): + trackers_created_dt_date (Union[Unset, datetime.date]): + trackers_created_dt_date_gte (Union[Unset, datetime.date]): + trackers_created_dt_date_lte (Union[Unset, datetime.date]): + trackers_created_dt_gt (Union[Unset, datetime.datetime]): + trackers_created_dt_gte (Union[Unset, datetime.datetime]): + trackers_created_dt_lt (Union[Unset, datetime.datetime]): + trackers_created_dt_lte (Union[Unset, datetime.datetime]): + trackers_embargoed (Union[Unset, bool]): + trackers_external_system_id (Union[Unset, str]): + trackers_ps_update_stream (Union[Unset, str]): + trackers_resolution (Union[Unset, str]): + trackers_status (Union[Unset, str]): + trackers_type (Union[Unset, OsidbApiV1AffectsListTrackersType]): + trackers_updated_dt (Union[Unset, datetime.datetime]): + trackers_updated_dt_date (Union[Unset, datetime.date]): + trackers_updated_dt_date_gte (Union[Unset, datetime.date]): + trackers_updated_dt_date_lte (Union[Unset, datetime.date]): + trackers_updated_dt_gt (Union[Unset, datetime.datetime]): + trackers_updated_dt_gte (Union[Unset, datetime.datetime]): + trackers_updated_dt_lt (Union[Unset, datetime.datetime]): + trackers_updated_dt_lte (Union[Unset, datetime.datetime]): + trackers_uuid (Union[Unset, UUID]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, affectedness=affectedness, created_dt=created_dt, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_retrieve.py index 2a3a563..f7ce089 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_retrieve.py @@ -1,72 +1,59 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_affects_retrieve_response_200 import ( - OsidbApiV1AffectsRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], - "include_meta_attr": List[str], -} +from ...models.osidb_api_v1_affects_retrieve_response_200 import OsidbApiV1AffectsRetrieveResponse200 +from uuid import UUID def _get_kwargs( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/{uuid}".format( - client.base_url, - uuid=uuid, - ) - - headers: Dict[str, Any] = client.get_headers() + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields - json_include_meta_attr: Union[Unset, None, List[str]] = UNSET + params["include_fields"] = json_include_fields + + json_include_meta_attr: Union[Unset, list[str]] = UNSET if not isinstance(include_meta_attr, Unset): - if include_meta_attr is None: - json_include_meta_attr = None - else: - json_include_meta_attr = include_meta_attr + json_include_meta_attr = include_meta_attr + + params["include_meta_attr"] = json_include_meta_attr - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - "include_meta_attr": json_include_meta_attr, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/affects/{uuid}".format( + uuid=uuid, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -77,28 +64,46 @@ def _parse_response( response_200 = OsidbApiV1AffectsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1AffectsRetrieveResponse200]: + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsRetrieveResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, client=client, @@ -115,18 +120,31 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1AffectsRetrieveResponse200]: - """ """ + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsRetrieveResponse200 + """ return sync_detailed( uuid=uuid, @@ -137,45 +155,66 @@ def sync( ).parsed -async def async_detailed( - uuid: str, +async def asyncio_detailed( + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1AffectsRetrieveResponse200]: + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsRetrieveResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, include_meta_attr=include_meta_attr, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - uuid: str, +async def asyncio( + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1AffectsRetrieveResponse200]: - """ """ + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( uuid=uuid, client=client, exclude_fields=exclude_fields, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_update.py index 18e21b3..475ffb5 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_affects_update.py @@ -1,50 +1,50 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.affect import Affect -from ...models.osidb_api_v1_affects_update_response_200 import ( - OsidbApiV1AffectsUpdateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = Affect +from ...models.affect import Affect +from ...models.osidb_api_v1_affects_update_response_200 import OsidbApiV1AffectsUpdateResponse200 +from uuid import UUID def _get_kwargs( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - form_data: Affect, - multipart_data: Affect, - json_body: Affect, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/affects/{uuid}".format( - client.base_url, - uuid=uuid, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + Affect, + Affect, + Affect, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/affects/{uuid}".format( + uuid=uuid, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, Affect): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AffectsUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -55,34 +55,54 @@ def _parse_response( response_200 = OsidbApiV1AffectsUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AffectsUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - form_data: Affect, - multipart_data: Affect, - json_body: Affect, + body: Union[ + Affect, + Affect, + Affect, + ], ) -> Response[OsidbApiV1AffectsUpdateResponse200]: + """ + Args: + uuid (UUID): + bugzilla_api_key (str): + jira_api_key (str): + body (Affect): Affect serializer + body (Affect): Affect serializer + body (Affect): Affect serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsUpdateResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -93,71 +113,111 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - form_data: Affect, - multipart_data: Affect, - json_body: Affect, + body: Union[ + Affect, + Affect, + Affect, + ], ) -> Optional[OsidbApiV1AffectsUpdateResponse200]: - """ """ + """ + Args: + uuid (UUID): + bugzilla_api_key (str): + jira_api_key (str): + body (Affect): Affect serializer + body (Affect): Affect serializer + body (Affect): Affect serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsUpdateResponse200 + """ return sync_detailed( uuid=uuid, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - uuid: str, +async def asyncio_detailed( + uuid: UUID, *, client: AuthenticatedClient, - form_data: Affect, - multipart_data: Affect, - json_body: Affect, + body: Union[ + Affect, + Affect, + Affect, + ], ) -> Response[OsidbApiV1AffectsUpdateResponse200]: + """ + Args: + uuid (UUID): + bugzilla_api_key (str): + jira_api_key (str): + body (Affect): Affect serializer + body (Affect): Affect serializer + body (Affect): Affect serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AffectsUpdateResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - uuid: str, +async def asyncio( + uuid: UUID, *, client: AuthenticatedClient, - form_data: Affect, - multipart_data: Affect, - json_body: Affect, + body: Union[ + Affect, + Affect, + Affect, + ], ) -> Optional[OsidbApiV1AffectsUpdateResponse200]: - """ """ + """ + Args: + uuid (UUID): + bugzilla_api_key (str): + jira_api_key (str): + body (Affect): Affect serializer + body (Affect): Affect serializer + body (Affect): Affect serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AffectsUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( uuid=uuid, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_alerts_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_alerts_list.py index 0afa364..0983d7e 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_alerts_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_alerts_list.py @@ -1,101 +1,90 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_alerts_list_alert_type import OsidbApiV1AlertsListAlertType -from ...models.osidb_api_v1_alerts_list_parent_model import ( - OsidbApiV1AlertsListParentModel, -) -from ...models.osidb_api_v1_alerts_list_response_200 import ( - OsidbApiV1AlertsListResponse200, -) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "alert_type": OsidbApiV1AlertsListAlertType, - "exclude_fields": List[str], - "include_fields": List[str], - "limit": int, - "name": str, - "offset": int, - "parent_model": OsidbApiV1AlertsListParentModel, - "parent_uuid": str, - "uuid": str, -} +from ...models.osidb_api_v1_alerts_list_parent_model import OsidbApiV1AlertsListParentModel +from ...models.osidb_api_v1_alerts_list_response_200 import OsidbApiV1AlertsListResponse200 +from uuid import UUID def _get_kwargs( *, client: AuthenticatedClient, - alert_type: Union[Unset, None, OsidbApiV1AlertsListAlertType] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - parent_model: Union[Unset, None, OsidbApiV1AlertsListParentModel] = UNSET, - parent_uuid: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/alerts".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_alert_type: Union[Unset, None, str] = UNSET + alert_type: Union[Unset, OsidbApiV1AlertsListAlertType] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + parent_model: Union[Unset, OsidbApiV1AlertsListParentModel] = UNSET, + parent_uuid: Union[Unset, UUID] = UNSET, + uuid: Union[Unset, UUID] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + print(OsidbApiV1AlertsListAlertType) + json_alert_type: Union[Unset, str] = UNSET if not isinstance(alert_type, Unset): + json_alert_type = alert_type.value - json_alert_type = ( - OsidbApiV1AlertsListAlertType(alert_type).value if alert_type else None - ) + params["alert_type"] = json_alert_type - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + params["exclude_fields"] = json_exclude_fields + + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields + + params["limit"] = limit + + params["name"] = name - json_parent_model: Union[Unset, None, str] = UNSET + params["offset"] = offset + + print(OsidbApiV1AlertsListParentModel) + json_parent_model: Union[Unset, str] = UNSET if not isinstance(parent_model, Unset): + json_parent_model = parent_model.value - json_parent_model = ( - OsidbApiV1AlertsListParentModel(parent_model).value - if parent_model - else None - ) + params["parent_model"] = json_parent_model + + json_parent_uuid: Union[Unset, str] = UNSET + if not isinstance(parent_uuid, Unset): + json_parent_uuid = str(parent_uuid) + + params["parent_uuid"] = json_parent_uuid + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid - params: Dict[str, Any] = { - "alert_type": json_alert_type, - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - "limit": limit, - "name": name, - "offset": offset, - "parent_model": json_parent_model, - "parent_uuid": parent_uuid, - "uuid": uuid, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/alerts", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AlertsListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -106,33 +95,57 @@ def _parse_response( response_200 = OsidbApiV1AlertsListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AlertsListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - alert_type: Union[Unset, None, OsidbApiV1AlertsListAlertType] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - parent_model: Union[Unset, None, OsidbApiV1AlertsListParentModel] = UNSET, - parent_uuid: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + alert_type: Union[Unset, OsidbApiV1AlertsListAlertType] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + parent_model: Union[Unset, OsidbApiV1AlertsListParentModel] = UNSET, + parent_uuid: Union[Unset, UUID] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1AlertsListResponse200]: + """List existing alerts for all models. + + Args: + alert_type (Union[Unset, OsidbApiV1AlertsListAlertType]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + name (Union[Unset, str]): + offset (Union[Unset, int]): + parent_model (Union[Unset, OsidbApiV1AlertsListParentModel]): + parent_uuid (Union[Unset, UUID]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AlertsListResponse200] + """ + kwargs = _get_kwargs( client=client, alert_type=alert_type, @@ -154,23 +167,42 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - alert_type: Union[Unset, None, OsidbApiV1AlertsListAlertType] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - parent_model: Union[Unset, None, OsidbApiV1AlertsListParentModel] = UNSET, - parent_uuid: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + alert_type: Union[Unset, OsidbApiV1AlertsListAlertType] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + parent_model: Union[Unset, OsidbApiV1AlertsListParentModel] = UNSET, + parent_uuid: Union[Unset, UUID] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1AlertsListResponse200]: - """List existing alerts for all models.""" + """List existing alerts for all models. + + Args: + alert_type (Union[Unset, OsidbApiV1AlertsListAlertType]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + name (Union[Unset, str]): + offset (Union[Unset, int]): + parent_model (Union[Unset, OsidbApiV1AlertsListParentModel]): + parent_uuid (Union[Unset, UUID]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AlertsListResponse200 + """ return sync_detailed( client=client, @@ -186,21 +218,41 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - alert_type: Union[Unset, None, OsidbApiV1AlertsListAlertType] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - parent_model: Union[Unset, None, OsidbApiV1AlertsListParentModel] = UNSET, - parent_uuid: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + alert_type: Union[Unset, OsidbApiV1AlertsListAlertType] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + parent_model: Union[Unset, OsidbApiV1AlertsListParentModel] = UNSET, + parent_uuid: Union[Unset, UUID] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1AlertsListResponse200]: + """List existing alerts for all models. + + Args: + alert_type (Union[Unset, OsidbApiV1AlertsListAlertType]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + name (Union[Unset, str]): + offset (Union[Unset, int]): + parent_model (Union[Unset, OsidbApiV1AlertsListParentModel]): + parent_uuid (Union[Unset, UUID]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AlertsListResponse200] + """ + kwargs = _get_kwargs( - client=client, alert_type=alert_type, exclude_fields=exclude_fields, include_fields=include_fields, @@ -212,34 +264,47 @@ async def async_detailed( uuid=uuid, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - alert_type: Union[Unset, None, OsidbApiV1AlertsListAlertType] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - parent_model: Union[Unset, None, OsidbApiV1AlertsListParentModel] = UNSET, - parent_uuid: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + alert_type: Union[Unset, OsidbApiV1AlertsListAlertType] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + parent_model: Union[Unset, OsidbApiV1AlertsListParentModel] = UNSET, + parent_uuid: Union[Unset, UUID] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1AlertsListResponse200]: - """List existing alerts for all models.""" + """List existing alerts for all models. + + Args: + alert_type (Union[Unset, OsidbApiV1AlertsListAlertType]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + name (Union[Unset, str]): + offset (Union[Unset, int]): + parent_model (Union[Unset, OsidbApiV1AlertsListParentModel]): + parent_uuid (Union[Unset, UUID]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AlertsListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, alert_type=alert_type, exclude_fields=exclude_fields, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_alerts_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_alerts_retrieve.py index 1f68d7c..9820e98 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_alerts_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_alerts_retrieve.py @@ -1,62 +1,52 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_alerts_retrieve_response_200 import ( - OsidbApiV1AlertsRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], -} +from ...models.osidb_api_v1_alerts_retrieve_response_200 import OsidbApiV1AlertsRetrieveResponse200 +from uuid import UUID def _get_kwargs( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/alerts/{uuid}".format( - client.base_url, - uuid=uuid, - ) - - headers: Dict[str, Any] = client.get_headers() + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/alerts/{uuid}".format( + uuid=uuid, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AlertsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -67,27 +57,44 @@ def _parse_response( response_200 = OsidbApiV1AlertsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AlertsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1AlertsRetrieveResponse200]: + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AlertsRetrieveResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, client=client, @@ -103,17 +110,29 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1AlertsRetrieveResponse200]: - """ """ + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AlertsRetrieveResponse200 + """ return sync_detailed( uuid=uuid, @@ -123,42 +142,61 @@ def sync( ).parsed -async def async_detailed( - uuid: str, +async def asyncio_detailed( + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1AlertsRetrieveResponse200]: + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AlertsRetrieveResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - uuid: str, +async def asyncio( + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1AlertsRetrieveResponse200]: - """ """ + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AlertsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( uuid=uuid, client=client, exclude_fields=exclude_fields, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_list.py index 5de3468..f80dd84 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_list.py @@ -1,63 +1,57 @@ -import datetime -from typing import Any, Dict, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_audit_list_response_200 import ( - OsidbApiV1AuditListResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "limit": int, - "offset": int, - "pgh_created_at": datetime.datetime, - "pgh_label": str, - "pgh_obj_model": str, - "pgh_slug": str, -} +from ...models.osidb_api_v1_audit_list_response_200 import OsidbApiV1AuditListResponse200 +import datetime def _get_kwargs( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - pgh_created_at: Union[Unset, None, datetime.datetime] = UNSET, - pgh_label: Union[Unset, None, str] = UNSET, - pgh_obj_model: Union[Unset, None, str] = UNSET, - pgh_slug: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/audit".format( - client.base_url, - ) + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + pgh_created_at: Union[Unset, datetime.datetime] = UNSET, + pgh_label: Union[Unset, str] = UNSET, + pgh_obj_model: Union[Unset, str] = UNSET, + pgh_slug: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["limit"] = limit - headers: Dict[str, Any] = client.get_headers() + params["offset"] = offset - json_pgh_created_at: Union[Unset, None, str] = UNSET + json_pgh_created_at: Union[Unset, str] = UNSET if not isinstance(pgh_created_at, Unset): - json_pgh_created_at = pgh_created_at.isoformat() if pgh_created_at else None - - params: Dict[str, Any] = { - "limit": limit, - "offset": offset, - "pgh_created_at": json_pgh_created_at, - "pgh_label": pgh_label, - "pgh_obj_model": pgh_obj_model, - "pgh_slug": pgh_slug, - } + json_pgh_created_at = pgh_created_at.isoformat() + + params["pgh_created_at"] = json_pgh_created_at + + params["pgh_label"] = pgh_label + + params["pgh_obj_model"] = pgh_obj_model + + params["pgh_slug"] = pgh_slug + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/audit", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AuditListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -68,30 +62,51 @@ def _parse_response( response_200 = OsidbApiV1AuditListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AuditListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - pgh_created_at: Union[Unset, None, datetime.datetime] = UNSET, - pgh_label: Union[Unset, None, str] = UNSET, - pgh_obj_model: Union[Unset, None, str] = UNSET, - pgh_slug: Union[Unset, None, str] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + pgh_created_at: Union[Unset, datetime.datetime] = UNSET, + pgh_label: Union[Unset, str] = UNSET, + pgh_obj_model: Union[Unset, str] = UNSET, + pgh_slug: Union[Unset, str] = UNSET, ) -> Response[OsidbApiV1AuditListResponse200]: + """basic view of audit history events + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + pgh_created_at (Union[Unset, datetime.datetime]): + pgh_label (Union[Unset, str]): + pgh_obj_model (Union[Unset, str]): + pgh_slug (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AuditListResponse200] + """ + kwargs = _get_kwargs( client=client, limit=limit, @@ -110,20 +125,36 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - pgh_created_at: Union[Unset, None, datetime.datetime] = UNSET, - pgh_label: Union[Unset, None, str] = UNSET, - pgh_obj_model: Union[Unset, None, str] = UNSET, - pgh_slug: Union[Unset, None, str] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + pgh_created_at: Union[Unset, datetime.datetime] = UNSET, + pgh_label: Union[Unset, str] = UNSET, + pgh_obj_model: Union[Unset, str] = UNSET, + pgh_slug: Union[Unset, str] = UNSET, ) -> Optional[OsidbApiV1AuditListResponse200]: - """basic view of audit history events""" + """basic view of audit history events + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + pgh_created_at (Union[Unset, datetime.datetime]): + pgh_label (Union[Unset, str]): + pgh_obj_model (Union[Unset, str]): + pgh_slug (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AuditListResponse200 + """ return sync_detailed( client=client, @@ -136,18 +167,35 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - pgh_created_at: Union[Unset, None, datetime.datetime] = UNSET, - pgh_label: Union[Unset, None, str] = UNSET, - pgh_obj_model: Union[Unset, None, str] = UNSET, - pgh_slug: Union[Unset, None, str] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + pgh_created_at: Union[Unset, datetime.datetime] = UNSET, + pgh_label: Union[Unset, str] = UNSET, + pgh_obj_model: Union[Unset, str] = UNSET, + pgh_slug: Union[Unset, str] = UNSET, ) -> Response[OsidbApiV1AuditListResponse200]: + """basic view of audit history events + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + pgh_created_at (Union[Unset, datetime.datetime]): + pgh_label (Union[Unset, str]): + pgh_obj_model (Union[Unset, str]): + pgh_slug (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AuditListResponse200] + """ + kwargs = _get_kwargs( - client=client, limit=limit, offset=offset, pgh_created_at=pgh_created_at, @@ -156,31 +204,41 @@ async def async_detailed( pgh_slug=pgh_slug, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - pgh_created_at: Union[Unset, None, datetime.datetime] = UNSET, - pgh_label: Union[Unset, None, str] = UNSET, - pgh_obj_model: Union[Unset, None, str] = UNSET, - pgh_slug: Union[Unset, None, str] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + pgh_created_at: Union[Unset, datetime.datetime] = UNSET, + pgh_label: Union[Unset, str] = UNSET, + pgh_obj_model: Union[Unset, str] = UNSET, + pgh_slug: Union[Unset, str] = UNSET, ) -> Optional[OsidbApiV1AuditListResponse200]: - """basic view of audit history events""" + """basic view of audit history events + + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + pgh_created_at (Union[Unset, datetime.datetime]): + pgh_label (Union[Unset, str]): + pgh_obj_model (Union[Unset, str]): + pgh_slug (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AuditListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, limit=limit, offset=offset, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_retrieve.py index 39daeca..b97c62d 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_retrieve.py @@ -1,36 +1,32 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_audit_retrieve_response_200 import ( - OsidbApiV1AuditRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_api_v1_audit_retrieve_response_200 import OsidbApiV1AuditRetrieveResponse200 def _get_kwargs( pgh_slug: str, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/audit/{pgh_slug}".format( - client.base_url, - pgh_slug=pgh_slug, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/audit/{pgh_slug}".format( + pgh_slug=pgh_slug, + ), } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AuditRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -41,17 +37,20 @@ def _parse_response( response_200 = OsidbApiV1AuditRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AuditRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -60,6 +59,19 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbApiV1AuditRetrieveResponse200]: + """basic view of audit history events + + Args: + pgh_slug (str): The unique identifier across all event tables. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AuditRetrieveResponse200] + """ + kwargs = _get_kwargs( pgh_slug=pgh_slug, client=client, @@ -73,7 +85,7 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( @@ -81,7 +93,18 @@ def sync( *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1AuditRetrieveResponse200]: - """basic view of audit history events""" + """basic view of audit history events + + Args: + pgh_slug (str): The unique identifier across all event tables. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AuditRetrieveResponse200 + """ return sync_detailed( pgh_slug=pgh_slug, @@ -89,36 +112,53 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( pgh_slug: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1AuditRetrieveResponse200]: + """basic view of audit history events + + Args: + pgh_slug (str): The unique identifier across all event tables. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AuditRetrieveResponse200] + """ + kwargs = _get_kwargs( pgh_slug=pgh_slug, - client=client, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( pgh_slug: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1AuditRetrieveResponse200]: - """basic view of audit history events""" + """basic view of audit history events + + Args: + pgh_slug (str): The unique identifier across all event tables. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AuditRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( pgh_slug=pgh_slug, client=client, ) diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_update.py index 57788d5..71cc02d 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_audit_update.py @@ -1,50 +1,49 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.audit import Audit -from ...models.osidb_api_v1_audit_update_response_200 import ( - OsidbApiV1AuditUpdateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = Audit +from ...models.audit import Audit +from ...models.osidb_api_v1_audit_update_response_200 import OsidbApiV1AuditUpdateResponse200 def _get_kwargs( pgh_slug: str, *, client: AuthenticatedClient, - form_data: Audit, - multipart_data: Audit, - json_body: Audit, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/audit/{pgh_slug}".format( - client.base_url, - pgh_slug=pgh_slug, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + Audit, + Audit, + Audit, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/audit/{pgh_slug}".format( + pgh_slug=pgh_slug, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, Audit): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1AuditUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -55,17 +54,20 @@ def _parse_response( response_200 = OsidbApiV1AuditUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1AuditUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -73,16 +75,32 @@ def sync_detailed( pgh_slug: str, *, client: AuthenticatedClient, - form_data: Audit, - multipart_data: Audit, - json_body: Audit, + body: Union[ + Audit, + Audit, + Audit, + ], ) -> Response[OsidbApiV1AuditUpdateResponse200]: + """basic view of audit history events + + Args: + pgh_slug (str): The unique identifier across all event tables. + body (Audit): + body (Audit): + body (Audit): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AuditUpdateResponse200] + """ + kwargs = _get_kwargs( pgh_slug=pgh_slug, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -93,71 +111,108 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( pgh_slug: str, *, client: AuthenticatedClient, - form_data: Audit, - multipart_data: Audit, - json_body: Audit, + body: Union[ + Audit, + Audit, + Audit, + ], ) -> Optional[OsidbApiV1AuditUpdateResponse200]: - """basic view of audit history events""" + """basic view of audit history events + + Args: + pgh_slug (str): The unique identifier across all event tables. + body (Audit): + body (Audit): + body (Audit): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AuditUpdateResponse200 + """ return sync_detailed( pgh_slug=pgh_slug, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( pgh_slug: str, *, client: AuthenticatedClient, - form_data: Audit, - multipart_data: Audit, - json_body: Audit, + body: Union[ + Audit, + Audit, + Audit, + ], ) -> Response[OsidbApiV1AuditUpdateResponse200]: + """basic view of audit history events + + Args: + pgh_slug (str): The unique identifier across all event tables. + body (Audit): + body (Audit): + body (Audit): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1AuditUpdateResponse200] + """ + kwargs = _get_kwargs( pgh_slug=pgh_slug, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( pgh_slug: str, *, client: AuthenticatedClient, - form_data: Audit, - multipart_data: Audit, - json_body: Audit, + body: Union[ + Audit, + Audit, + Audit, + ], ) -> Optional[OsidbApiV1AuditUpdateResponse200]: - """basic view of audit history events""" + """basic view of audit history events + + Args: + pgh_slug (str): The unique identifier across all event tables. + body (Audit): + body (Audit): + body (Audit): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1AuditUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( pgh_slug=pgh_slug, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_create.py index bcda2d6..55eb938 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_create.py @@ -1,50 +1,52 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.flaw_acknowledgment_post import FlawAcknowledgmentPost from ...models.osidb_api_v1_flaws_acknowledgments_create_response_201 import ( OsidbApiV1FlawsAcknowledgmentsCreateResponse201, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawAcknowledgmentPost +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPost, - multipart_data: FlawAcknowledgmentPost, - json_body: FlawAcknowledgmentPost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/acknowledgments".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/acknowledgments".format( + flaw_id=flaw_id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawAcknowledgmentPost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsAcknowledgmentsCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -52,39 +54,56 @@ def _parse_response( if isinstance(_response_201, Unset): response_201 = UNSET else: - response_201 = OsidbApiV1FlawsAcknowledgmentsCreateResponse201.from_dict( - _response_201 - ) + response_201 = OsidbApiV1FlawsAcknowledgmentsCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsAcknowledgmentsCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPost, - multipart_data: FlawAcknowledgmentPost, - json_body: FlawAcknowledgmentPost, + body: Union[ + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + ], ) -> Response[OsidbApiV1FlawsAcknowledgmentsCreateResponse201]: + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -95,71 +114,108 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPost, - multipart_data: FlawAcknowledgmentPost, - json_body: FlawAcknowledgmentPost, + body: Union[ + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + ], ) -> Optional[OsidbApiV1FlawsAcknowledgmentsCreateResponse201]: - """ """ + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsCreateResponse201 + """ return sync_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPost, - multipart_data: FlawAcknowledgmentPost, - json_body: FlawAcknowledgmentPost, + body: Union[ + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + ], ) -> Response[OsidbApiV1FlawsAcknowledgmentsCreateResponse201]: + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPost, - multipart_data: FlawAcknowledgmentPost, - json_body: FlawAcknowledgmentPost, + body: Union[ + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + FlawAcknowledgmentPost, + ], ) -> Optional[OsidbApiV1FlawsAcknowledgmentsCreateResponse201]: - """ """ + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + body (FlawAcknowledgmentPost): FlawAcknowledgment serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_destroy.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_destroy.py index bc8d180..1cd7ce5 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_destroy.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_destroy.py @@ -1,38 +1,40 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_flaws_acknowledgments_destroy_response_200 import ( OsidbApiV1FlawsAcknowledgmentsDestroyResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/acknowledgments/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/acknowledgments/{id}".format( + flaw_id=flaw_id, + id=id, + ), } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsAcknowledgmentsDestroyResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -40,31 +42,47 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsAcknowledgmentsDestroyResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsAcknowledgmentsDestroyResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsAcknowledgmentsDestroyResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsAcknowledgmentsDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsDestroyResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, @@ -79,16 +97,29 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1FlawsAcknowledgmentsDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsDestroyResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -97,39 +128,60 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsAcknowledgmentsDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsDestroyResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, ) - async with client.get_async_session().delete( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1FlawsAcknowledgmentsDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsDestroyResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_list.py index 3289b00..e83fabe 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_list.py @@ -1,201 +1,187 @@ -import datetime -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_acknowledgments_list_response_200 import ( - OsidbApiV1FlawsAcknowledgmentsListResponse200, -) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "affiliation": str, - "created_dt": datetime.datetime, - "created_dt__date": datetime.date, - "created_dt__date__gte": datetime.date, - "created_dt__date__lte": datetime.date, - "created_dt__gt": datetime.datetime, - "created_dt__gte": datetime.datetime, - "created_dt__lt": datetime.datetime, - "created_dt__lte": datetime.datetime, - "exclude_fields": List[str], - "from_upstream": bool, - "include_fields": List[str], - "limit": int, - "name": str, - "offset": int, - "updated_dt": datetime.datetime, - "updated_dt__date": datetime.date, - "updated_dt__date__gte": datetime.date, - "updated_dt__date__lte": datetime.date, - "updated_dt__gt": datetime.datetime, - "updated_dt__gte": datetime.datetime, - "updated_dt__lt": datetime.datetime, - "updated_dt__lte": datetime.datetime, - "uuid": str, -} +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + +from ...models.osidb_api_v1_flaws_acknowledgments_list_response_200 import OsidbApiV1FlawsAcknowledgmentsListResponse200 +from uuid import UUID +import datetime def _get_kwargs( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - affiliation: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - from_upstream: Union[Unset, None, bool] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/acknowledgments".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_created_dt: Union[Unset, None, str] = UNSET + affiliation: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + from_upstream: Union[Unset, bool] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["affiliation"] = affiliation + + json_created_dt: Union[Unset, str] = UNSET if not isinstance(created_dt, Unset): - json_created_dt = created_dt.isoformat() if created_dt else None + json_created_dt = created_dt.isoformat() + + params["created_dt"] = json_created_dt - json_created_dt_date: Union[Unset, None, str] = UNSET + json_created_dt_date: Union[Unset, str] = UNSET if not isinstance(created_dt_date, Unset): - json_created_dt_date = created_dt_date.isoformat() if created_dt_date else None + json_created_dt_date = created_dt_date.isoformat() + + params["created_dt__date"] = json_created_dt_date - json_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_gte, Unset): - json_created_dt_date_gte = ( - created_dt_date_gte.isoformat() if created_dt_date_gte else None - ) + json_created_dt_date_gte = created_dt_date_gte.isoformat() + + params["created_dt__date__gte"] = json_created_dt_date_gte - json_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_lte, Unset): - json_created_dt_date_lte = ( - created_dt_date_lte.isoformat() if created_dt_date_lte else None - ) + json_created_dt_date_lte = created_dt_date_lte.isoformat() + + params["created_dt__date__lte"] = json_created_dt_date_lte - json_created_dt_gt: Union[Unset, None, str] = UNSET + json_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(created_dt_gt, Unset): - json_created_dt_gt = created_dt_gt.isoformat() if created_dt_gt else None + json_created_dt_gt = created_dt_gt.isoformat() + + params["created_dt__gt"] = json_created_dt_gt - json_created_dt_gte: Union[Unset, None, str] = UNSET + json_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_gte, Unset): - json_created_dt_gte = created_dt_gte.isoformat() if created_dt_gte else None + json_created_dt_gte = created_dt_gte.isoformat() - json_created_dt_lt: Union[Unset, None, str] = UNSET + params["created_dt__gte"] = json_created_dt_gte + + json_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(created_dt_lt, Unset): - json_created_dt_lt = created_dt_lt.isoformat() if created_dt_lt else None + json_created_dt_lt = created_dt_lt.isoformat() + + params["created_dt__lt"] = json_created_dt_lt - json_created_dt_lte: Union[Unset, None, str] = UNSET + json_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_lte, Unset): - json_created_dt_lte = created_dt_lte.isoformat() if created_dt_lte else None + json_created_dt_lte = created_dt_lte.isoformat() + + params["created_dt__lte"] = json_created_dt_lte - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields + + params["from_upstream"] = from_upstream - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - json_updated_dt: Union[Unset, None, str] = UNSET + params["limit"] = limit + + params["name"] = name + + params["offset"] = offset + + json_updated_dt: Union[Unset, str] = UNSET if not isinstance(updated_dt, Unset): - json_updated_dt = updated_dt.isoformat() if updated_dt else None + json_updated_dt = updated_dt.isoformat() - json_updated_dt_date: Union[Unset, None, str] = UNSET + params["updated_dt"] = json_updated_dt + + json_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(updated_dt_date, Unset): - json_updated_dt_date = updated_dt_date.isoformat() if updated_dt_date else None + json_updated_dt_date = updated_dt_date.isoformat() + + params["updated_dt__date"] = json_updated_dt_date - json_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_gte, Unset): - json_updated_dt_date_gte = ( - updated_dt_date_gte.isoformat() if updated_dt_date_gte else None - ) + json_updated_dt_date_gte = updated_dt_date_gte.isoformat() - json_updated_dt_date_lte: Union[Unset, None, str] = UNSET + params["updated_dt__date__gte"] = json_updated_dt_date_gte + + json_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_lte, Unset): - json_updated_dt_date_lte = ( - updated_dt_date_lte.isoformat() if updated_dt_date_lte else None - ) + json_updated_dt_date_lte = updated_dt_date_lte.isoformat() + + params["updated_dt__date__lte"] = json_updated_dt_date_lte - json_updated_dt_gt: Union[Unset, None, str] = UNSET + json_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(updated_dt_gt, Unset): - json_updated_dt_gt = updated_dt_gt.isoformat() if updated_dt_gt else None + json_updated_dt_gt = updated_dt_gt.isoformat() - json_updated_dt_gte: Union[Unset, None, str] = UNSET + params["updated_dt__gt"] = json_updated_dt_gt + + json_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_gte, Unset): - json_updated_dt_gte = updated_dt_gte.isoformat() if updated_dt_gte else None + json_updated_dt_gte = updated_dt_gte.isoformat() + + params["updated_dt__gte"] = json_updated_dt_gte - json_updated_dt_lt: Union[Unset, None, str] = UNSET + json_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(updated_dt_lt, Unset): - json_updated_dt_lt = updated_dt_lt.isoformat() if updated_dt_lt else None + json_updated_dt_lt = updated_dt_lt.isoformat() - json_updated_dt_lte: Union[Unset, None, str] = UNSET + params["updated_dt__lt"] = json_updated_dt_lt + + json_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_lte, Unset): - json_updated_dt_lte = updated_dt_lte.isoformat() if updated_dt_lte else None - - params: Dict[str, Any] = { - "affiliation": affiliation, - "created_dt": json_created_dt, - "created_dt__date": json_created_dt_date, - "created_dt__date__gte": json_created_dt_date_gte, - "created_dt__date__lte": json_created_dt_date_lte, - "created_dt__gt": json_created_dt_gt, - "created_dt__gte": json_created_dt_gte, - "created_dt__lt": json_created_dt_lt, - "created_dt__lte": json_created_dt_lte, - "exclude_fields": json_exclude_fields, - "from_upstream": from_upstream, - "include_fields": json_include_fields, - "limit": limit, - "name": name, - "offset": offset, - "updated_dt": json_updated_dt, - "updated_dt__date": json_updated_dt_date, - "updated_dt__date__gte": json_updated_dt_date_gte, - "updated_dt__date__lte": json_updated_dt_date_lte, - "updated_dt__gt": json_updated_dt_gt, - "updated_dt__gte": json_updated_dt_gte, - "updated_dt__lt": json_updated_dt_lt, - "updated_dt__lte": json_updated_dt_lte, - "uuid": uuid, - } + json_updated_dt_lte = updated_dt_lte.isoformat() + + params["updated_dt__lte"] = json_updated_dt_lte + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/acknowledgments".format( + flaw_id=flaw_id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsAcknowledgmentsListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -203,54 +189,91 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsAcknowledgmentsListResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsAcknowledgmentsListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsAcknowledgmentsListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - affiliation: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - from_upstream: Union[Unset, None, bool] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affiliation: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + from_upstream: Union[Unset, bool] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1FlawsAcknowledgmentsListResponse200]: + """ + Args: + flaw_id (UUID): + affiliation (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + exclude_fields (Union[Unset, list[str]]): + from_upstream (Union[Unset, bool]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + name (Union[Unset, str]): + offset (Union[Unset, int]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, @@ -288,39 +311,73 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - affiliation: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - from_upstream: Union[Unset, None, bool] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affiliation: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + from_upstream: Union[Unset, bool] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1FlawsAcknowledgmentsListResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + affiliation (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + exclude_fields (Union[Unset, list[str]]): + from_upstream (Union[Unset, bool]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + name (Union[Unset, str]): + offset (Union[Unset, int]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsListResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -352,38 +409,73 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, *, client: AuthenticatedClient, - affiliation: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - from_upstream: Union[Unset, None, bool] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affiliation: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + from_upstream: Union[Unset, bool] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1FlawsAcknowledgmentsListResponse200]: + """ + Args: + flaw_id (UUID): + affiliation (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + exclude_fields (Union[Unset, list[str]]): + from_upstream (Union[Unset, bool]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + name (Union[Unset, str]): + offset (Union[Unset, int]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, affiliation=affiliation, created_dt=created_dt, created_dt_date=created_dt_date, @@ -410,50 +502,78 @@ async def async_detailed( uuid=uuid, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, *, client: AuthenticatedClient, - affiliation: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - from_upstream: Union[Unset, None, bool] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - name: Union[Unset, None, str] = UNSET, - offset: Union[Unset, None, int] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affiliation: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + from_upstream: Union[Unset, bool] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + name: Union[Unset, str] = UNSET, + offset: Union[Unset, int] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1FlawsAcknowledgmentsListResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + affiliation (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + exclude_fields (Union[Unset, list[str]]): + from_upstream (Union[Unset, bool]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + name (Union[Unset, str]): + offset (Union[Unset, int]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, affiliation=affiliation, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_retrieve.py index c1c926b..abd55d4 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_retrieve.py @@ -1,64 +1,56 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_flaws_acknowledgments_retrieve_response_200 import ( OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], -} +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/acknowledgments/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + params["exclude_fields"] = json_exclude_fields + + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/acknowledgments/{id}".format( + flaw_id=flaw_id, + id=id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -66,33 +58,49 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, @@ -109,18 +117,31 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -131,45 +152,66 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_update.py index 02d8536..7faee64 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_acknowledgments_update.py @@ -1,52 +1,54 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.flaw_acknowledgment_put import FlawAcknowledgmentPut from ...models.osidb_api_v1_flaws_acknowledgments_update_response_200 import ( OsidbApiV1FlawsAcknowledgmentsUpdateResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawAcknowledgmentPut +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPut, - multipart_data: FlawAcknowledgmentPut, - json_body: FlawAcknowledgmentPut, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/acknowledgments/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/acknowledgments/{id}".format( + flaw_id=flaw_id, + id=id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawAcknowledgmentPut): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsAcknowledgmentsUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -54,41 +56,59 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsAcknowledgmentsUpdateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsAcknowledgmentsUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsAcknowledgmentsUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPut, - multipart_data: FlawAcknowledgmentPut, - json_body: FlawAcknowledgmentPut, + body: Union[ + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + ], ) -> Response[OsidbApiV1FlawsAcknowledgmentsUpdateResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsUpdateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -99,77 +119,117 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPut, - multipart_data: FlawAcknowledgmentPut, - json_body: FlawAcknowledgmentPut, + body: Union[ + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + ], ) -> Optional[OsidbApiV1FlawsAcknowledgmentsUpdateResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsUpdateResponse200 + """ return sync_detailed( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPut, - multipart_data: FlawAcknowledgmentPut, - json_body: FlawAcknowledgmentPut, + body: Union[ + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + ], ) -> Response[OsidbApiV1FlawsAcknowledgmentsUpdateResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsAcknowledgmentsUpdateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawAcknowledgmentPut, - multipart_data: FlawAcknowledgmentPut, - json_body: FlawAcknowledgmentPut, + body: Union[ + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + FlawAcknowledgmentPut, + ], ) -> Optional[OsidbApiV1FlawsAcknowledgmentsUpdateResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + body (FlawAcknowledgmentPut): FlawAcknowledgment serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsAcknowledgmentsUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_create.py index 4533ee3..afe7cdf 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_create.py @@ -1,50 +1,49 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.flaw_comment_post import FlawCommentPost -from ...models.osidb_api_v1_flaws_comments_create_response_201 import ( - OsidbApiV1FlawsCommentsCreateResponse201, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawCommentPost +from ...models.flaw_comment_post import FlawCommentPost +from ...models.osidb_api_v1_flaws_comments_create_response_201 import OsidbApiV1FlawsCommentsCreateResponse201 def _get_kwargs( flaw_id: str, *, client: AuthenticatedClient, - form_data: FlawCommentPost, - multipart_data: FlawCommentPost, - json_body: FlawCommentPost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/comments".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawCommentPost, + FlawCommentPost, + FlawCommentPost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/comments".format( + flaw_id=flaw_id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawCommentPost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCommentsCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -52,22 +51,23 @@ def _parse_response( if isinstance(_response_201, Unset): response_201 = UNSET else: - response_201 = OsidbApiV1FlawsCommentsCreateResponse201.from_dict( - _response_201 - ) + response_201 = OsidbApiV1FlawsCommentsCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCommentsCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -75,16 +75,34 @@ def sync_detailed( flaw_id: str, *, client: AuthenticatedClient, - form_data: FlawCommentPost, - multipart_data: FlawCommentPost, - json_body: FlawCommentPost, + body: Union[ + FlawCommentPost, + FlawCommentPost, + FlawCommentPost, + ], ) -> Response[OsidbApiV1FlawsCommentsCreateResponse201]: + """Create a new comment for a given flaw. Beware that freshly created comments are not guaranteed to + keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + bugzilla_api_key (str): + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCommentsCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -95,71 +113,114 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( flaw_id: str, *, client: AuthenticatedClient, - form_data: FlawCommentPost, - multipart_data: FlawCommentPost, - json_body: FlawCommentPost, + body: Union[ + FlawCommentPost, + FlawCommentPost, + FlawCommentPost, + ], ) -> Optional[OsidbApiV1FlawsCommentsCreateResponse201]: - """Create a new comment for a given flaw. Beware that freshly created comments are not guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously.""" + """Create a new comment for a given flaw. Beware that freshly created comments are not guaranteed to + keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + bugzilla_api_key (str): + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCommentsCreateResponse201 + """ return sync_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( flaw_id: str, *, client: AuthenticatedClient, - form_data: FlawCommentPost, - multipart_data: FlawCommentPost, - json_body: FlawCommentPost, + body: Union[ + FlawCommentPost, + FlawCommentPost, + FlawCommentPost, + ], ) -> Response[OsidbApiV1FlawsCommentsCreateResponse201]: + """Create a new comment for a given flaw. Beware that freshly created comments are not guaranteed to + keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + bugzilla_api_key (str): + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCommentsCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( flaw_id: str, *, client: AuthenticatedClient, - form_data: FlawCommentPost, - multipart_data: FlawCommentPost, - json_body: FlawCommentPost, + body: Union[ + FlawCommentPost, + FlawCommentPost, + FlawCommentPost, + ], ) -> Optional[OsidbApiV1FlawsCommentsCreateResponse201]: - """Create a new comment for a given flaw. Beware that freshly created comments are not guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously.""" + """Create a new comment for a given flaw. Beware that freshly created comments are not guaranteed to + keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + bugzilla_api_key (str): + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + body (FlawCommentPost): FlawComment serializer for use by flaw_comments endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCommentsCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_list.py index 0d1c9b2..a9bddd2 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_list.py @@ -1,80 +1,74 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_comments_list_response_200 import ( - OsidbApiV1FlawsCommentsListResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "creator": str, - "exclude_fields": List[str], - "external_system_id": str, - "include_fields": List[str], - "limit": int, - "offset": int, - "order": int, - "uuid": str, -} +from ...models.osidb_api_v1_flaws_comments_list_response_200 import OsidbApiV1FlawsCommentsListResponse200 +from uuid import UUID def _get_kwargs( flaw_id: str, *, client: AuthenticatedClient, - creator: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, int] = UNSET, - uuid: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/comments".format( - client.base_url, - flaw_id=flaw_id, - ) + creator: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, int] = UNSET, + uuid: Union[Unset, UUID] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() + params["creator"] = creator - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + params["external_system_id"] = external_system_id + + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields - - params: Dict[str, Any] = { - "creator": creator, - "exclude_fields": json_exclude_fields, - "external_system_id": external_system_id, - "include_fields": json_include_fields, - "limit": limit, - "offset": offset, - "order": order, - "uuid": uuid, - } + json_include_fields = include_fields + + params["include_fields"] = json_include_fields + + params["limit"] = limit + + params["offset"] = offset + + params["order"] = order + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/comments".format( + flaw_id=flaw_id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCommentsListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -82,22 +76,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsCommentsListResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsCommentsListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCommentsListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -105,15 +100,37 @@ def sync_detailed( flaw_id: str, *, client: AuthenticatedClient, - creator: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, int] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + creator: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, int] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1FlawsCommentsListResponse200]: + """List existing comments for a given flaw. Beware that freshly created comments are not guaranteed to + keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + creator (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + external_system_id (Union[Unset, str]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, int]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCommentsListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, @@ -135,23 +152,43 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( flaw_id: str, *, client: AuthenticatedClient, - creator: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, int] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + creator: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, int] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1FlawsCommentsListResponse200]: - """List existing comments for a given flaw. Beware that freshly created comments are not guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously.""" + """List existing comments for a given flaw. Beware that freshly created comments are not guaranteed to + keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + creator (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + external_system_id (Union[Unset, str]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, int]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCommentsListResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -167,22 +204,43 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( flaw_id: str, *, client: AuthenticatedClient, - creator: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, int] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + creator: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, int] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1FlawsCommentsListResponse200]: + """List existing comments for a given flaw. Beware that freshly created comments are not guaranteed to + keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + creator (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + external_system_id (Union[Unset, str]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, int]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCommentsListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, creator=creator, exclude_fields=exclude_fields, external_system_id=external_system_id, @@ -193,34 +251,48 @@ async def async_detailed( uuid=uuid, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( flaw_id: str, *, client: AuthenticatedClient, - creator: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, int] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + creator: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, int] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1FlawsCommentsListResponse200]: - """List existing comments for a given flaw. Beware that freshly created comments are not guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously.""" + """List existing comments for a given flaw. Beware that freshly created comments are not guaranteed to + keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + creator (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + external_system_id (Union[Unset, str]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, int]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCommentsListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, creator=creator, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_retrieve.py index 28f3da9..02a952b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_retrieve.py @@ -1,17 +1,14 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_comments_retrieve_response_200 import ( - OsidbApiV1FlawsCommentsRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], -} +from ...models.osidb_api_v1_flaws_comments_retrieve_response_200 import OsidbApiV1FlawsCommentsRetrieveResponse200 def _get_kwargs( @@ -19,46 +16,38 @@ def _get_kwargs( comment_id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/comments/{comment_id}".format( - client.base_url, - flaw_id=flaw_id, - comment_id=comment_id, - ) - - headers: Dict[str, Any] = client.get_headers() + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/comments/{comment_id}".format( + flaw_id=flaw_id, + comment_id=comment_id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCommentsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -66,22 +55,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsCommentsRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsCommentsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCommentsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -90,9 +80,26 @@ def sync_detailed( comment_id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsCommentsRetrieveResponse200]: + """Retrieve a single existing comments for a given flaw. Beware that freshly created comments are not + guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + comment_id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCommentsRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, comment_id=comment_id, @@ -109,7 +116,7 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( @@ -117,10 +124,25 @@ def sync( comment_id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsCommentsRetrieveResponse200]: - """Retrieve a single existing comments for a given flaw. Beware that freshly created comments are not guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously.""" + """Retrieve a single existing comments for a given flaw. Beware that freshly created comments are not + guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + comment_id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCommentsRetrieveResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -131,45 +153,70 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( flaw_id: str, comment_id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsCommentsRetrieveResponse200]: + """Retrieve a single existing comments for a given flaw. Beware that freshly created comments are not + guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + comment_id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCommentsRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, comment_id=comment_id, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( flaw_id: str, comment_id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsCommentsRetrieveResponse200]: - """Retrieve a single existing comments for a given flaw. Beware that freshly created comments are not guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously.""" + """Retrieve a single existing comments for a given flaw. Beware that freshly created comments are not + guaranteed to keep their original UUIDs, especially if multiple comments are created simultaneously. + + Args: + flaw_id (str): + comment_id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCommentsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, comment_id=comment_id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_create.py index 348fc75..7e7ece1 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_create.py @@ -1,48 +1,46 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.flaw_post import FlawPost -from ...models.osidb_api_v1_flaws_create_response_201 import ( - OsidbApiV1FlawsCreateResponse201, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawPost +from ...models.flaw_post import FlawPost +from ...models.osidb_api_v1_flaws_create_response_201 import OsidbApiV1FlawsCreateResponse201 def _get_kwargs( *, client: AuthenticatedClient, - form_data: FlawPost, - multipart_data: FlawPost, - json_body: FlawPost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws".format( - client.base_url, - ) + body: Union[ + FlawPost, + FlawPost, + FlawPost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/flaws", + } - headers: Dict[str, Any] = client.get_headers() + if isinstance(body, FlawPost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() - - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -53,32 +51,51 @@ def _parse_response( response_201 = OsidbApiV1FlawsCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - form_data: FlawPost, - multipart_data: FlawPost, - json_body: FlawPost, + body: Union[ + FlawPost, + FlawPost, + FlawPost, + ], ) -> Response[OsidbApiV1FlawsCreateResponse201]: + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (FlawPost): serialize flaw model + body (FlawPost): serialize flaw model + body (FlawPost): serialize flaw model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCreateResponse201] + """ + kwargs = _get_kwargs( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -89,65 +106,102 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - form_data: FlawPost, - multipart_data: FlawPost, - json_body: FlawPost, + body: Union[ + FlawPost, + FlawPost, + FlawPost, + ], ) -> Optional[OsidbApiV1FlawsCreateResponse201]: - """ """ + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (FlawPost): serialize flaw model + body (FlawPost): serialize flaw model + body (FlawPost): serialize flaw model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCreateResponse201 + """ return sync_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - form_data: FlawPost, - multipart_data: FlawPost, - json_body: FlawPost, + body: Union[ + FlawPost, + FlawPost, + FlawPost, + ], ) -> Response[OsidbApiV1FlawsCreateResponse201]: + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (FlawPost): serialize flaw model + body (FlawPost): serialize flaw model + body (FlawPost): serialize flaw model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCreateResponse201] + """ + kwargs = _get_kwargs( - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - form_data: FlawPost, - multipart_data: FlawPost, - json_body: FlawPost, + body: Union[ + FlawPost, + FlawPost, + FlawPost, + ], ) -> Optional[OsidbApiV1FlawsCreateResponse201]: - """ """ + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (FlawPost): serialize flaw model + body (FlawPost): serialize flaw model + body (FlawPost): serialize flaw model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_create.py index 775e844..ab8e0ef 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_create.py @@ -1,50 +1,50 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.flaw_cvss_post import FlawCVSSPost -from ...models.osidb_api_v1_flaws_cvss_scores_create_response_201 import ( - OsidbApiV1FlawsCvssScoresCreateResponse201, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawCVSSPost +from ...models.flaw_cvss_post import FlawCVSSPost +from ...models.osidb_api_v1_flaws_cvss_scores_create_response_201 import OsidbApiV1FlawsCvssScoresCreateResponse201 +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawCVSSPost, - multipart_data: FlawCVSSPost, - json_body: FlawCVSSPost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/cvss_scores".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawCVSSPost, + FlawCVSSPost, + FlawCVSSPost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/cvss_scores".format( + flaw_id=flaw_id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawCVSSPost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCvssScoresCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -52,39 +52,56 @@ def _parse_response( if isinstance(_response_201, Unset): response_201 = UNSET else: - response_201 = OsidbApiV1FlawsCvssScoresCreateResponse201.from_dict( - _response_201 - ) + response_201 = OsidbApiV1FlawsCvssScoresCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCvssScoresCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawCVSSPost, - multipart_data: FlawCVSSPost, - json_body: FlawCVSSPost, + body: Union[ + FlawCVSSPost, + FlawCVSSPost, + FlawCVSSPost, + ], ) -> Response[OsidbApiV1FlawsCvssScoresCreateResponse201]: + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawCVSSPost): FlawCVSS serializer + body (FlawCVSSPost): FlawCVSS serializer + body (FlawCVSSPost): FlawCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -95,71 +112,108 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawCVSSPost, - multipart_data: FlawCVSSPost, - json_body: FlawCVSSPost, + body: Union[ + FlawCVSSPost, + FlawCVSSPost, + FlawCVSSPost, + ], ) -> Optional[OsidbApiV1FlawsCvssScoresCreateResponse201]: - """ """ + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawCVSSPost): FlawCVSS serializer + body (FlawCVSSPost): FlawCVSS serializer + body (FlawCVSSPost): FlawCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresCreateResponse201 + """ return sync_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawCVSSPost, - multipart_data: FlawCVSSPost, - json_body: FlawCVSSPost, + body: Union[ + FlawCVSSPost, + FlawCVSSPost, + FlawCVSSPost, + ], ) -> Response[OsidbApiV1FlawsCvssScoresCreateResponse201]: + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawCVSSPost): FlawCVSS serializer + body (FlawCVSSPost): FlawCVSS serializer + body (FlawCVSSPost): FlawCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawCVSSPost, - multipart_data: FlawCVSSPost, - json_body: FlawCVSSPost, + body: Union[ + FlawCVSSPost, + FlawCVSSPost, + FlawCVSSPost, + ], ) -> Optional[OsidbApiV1FlawsCvssScoresCreateResponse201]: - """ """ + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawCVSSPost): FlawCVSS serializer + body (FlawCVSSPost): FlawCVSS serializer + body (FlawCVSSPost): FlawCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_destroy.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_destroy.py index f60930c..daa0428 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_destroy.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_destroy.py @@ -1,38 +1,38 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_cvss_scores_destroy_response_200 import ( - OsidbApiV1FlawsCvssScoresDestroyResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_api_v1_flaws_cvss_scores_destroy_response_200 import OsidbApiV1FlawsCvssScoresDestroyResponse200 +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/cvss_scores/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/cvss_scores/{id}".format( + flaw_id=flaw_id, + id=id, + ), } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCvssScoresDestroyResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -40,31 +40,47 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsCvssScoresDestroyResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsCvssScoresDestroyResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCvssScoresDestroyResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsCvssScoresDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresDestroyResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, @@ -79,16 +95,29 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1FlawsCvssScoresDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresDestroyResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -97,39 +126,60 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsCvssScoresDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresDestroyResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, ) - async with client.get_async_session().delete( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1FlawsCvssScoresDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresDestroyResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_list.py index 7a584ba..8d2b30e 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_list.py @@ -1,217 +1,199 @@ -import datetime -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_cvss_scores_list_issuer import ( - OsidbApiV1FlawsCvssScoresListIssuer, -) -from ...models.osidb_api_v1_flaws_cvss_scores_list_response_200 import ( - OsidbApiV1FlawsCvssScoresListResponse200, -) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "comment": str, - "created_dt": datetime.datetime, - "created_dt__date": datetime.date, - "created_dt__date__gte": datetime.date, - "created_dt__date__lte": datetime.date, - "created_dt__gt": datetime.datetime, - "created_dt__gte": datetime.datetime, - "created_dt__lt": datetime.datetime, - "created_dt__lte": datetime.datetime, - "cvss_version": str, - "exclude_fields": List[str], - "include_fields": List[str], - "issuer": OsidbApiV1FlawsCvssScoresListIssuer, - "limit": int, - "offset": int, - "score": float, - "updated_dt": datetime.datetime, - "updated_dt__date": datetime.date, - "updated_dt__date__gte": datetime.date, - "updated_dt__date__lte": datetime.date, - "updated_dt__gt": datetime.datetime, - "updated_dt__gte": datetime.datetime, - "updated_dt__lt": datetime.datetime, - "updated_dt__lte": datetime.datetime, - "uuid": str, - "vector": str, -} +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + +from ...models.osidb_api_v1_flaws_cvss_scores_list_issuer import OsidbApiV1FlawsCvssScoresListIssuer +from ...models.osidb_api_v1_flaws_cvss_scores_list_response_200 import OsidbApiV1FlawsCvssScoresListResponse200 +from uuid import UUID +import datetime def _get_kwargs( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/cvss_scores".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_created_dt: Union[Unset, None, str] = UNSET + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["comment"] = comment + + json_created_dt: Union[Unset, str] = UNSET if not isinstance(created_dt, Unset): - json_created_dt = created_dt.isoformat() if created_dt else None + json_created_dt = created_dt.isoformat() + + params["created_dt"] = json_created_dt - json_created_dt_date: Union[Unset, None, str] = UNSET + json_created_dt_date: Union[Unset, str] = UNSET if not isinstance(created_dt_date, Unset): - json_created_dt_date = created_dt_date.isoformat() if created_dt_date else None + json_created_dt_date = created_dt_date.isoformat() + + params["created_dt__date"] = json_created_dt_date - json_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_gte, Unset): - json_created_dt_date_gte = ( - created_dt_date_gte.isoformat() if created_dt_date_gte else None - ) + json_created_dt_date_gte = created_dt_date_gte.isoformat() + + params["created_dt__date__gte"] = json_created_dt_date_gte - json_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_lte, Unset): - json_created_dt_date_lte = ( - created_dt_date_lte.isoformat() if created_dt_date_lte else None - ) + json_created_dt_date_lte = created_dt_date_lte.isoformat() - json_created_dt_gt: Union[Unset, None, str] = UNSET + params["created_dt__date__lte"] = json_created_dt_date_lte + + json_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(created_dt_gt, Unset): - json_created_dt_gt = created_dt_gt.isoformat() if created_dt_gt else None + json_created_dt_gt = created_dt_gt.isoformat() + + params["created_dt__gt"] = json_created_dt_gt - json_created_dt_gte: Union[Unset, None, str] = UNSET + json_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_gte, Unset): - json_created_dt_gte = created_dt_gte.isoformat() if created_dt_gte else None + json_created_dt_gte = created_dt_gte.isoformat() + + params["created_dt__gte"] = json_created_dt_gte - json_created_dt_lt: Union[Unset, None, str] = UNSET + json_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(created_dt_lt, Unset): - json_created_dt_lt = created_dt_lt.isoformat() if created_dt_lt else None + json_created_dt_lt = created_dt_lt.isoformat() - json_created_dt_lte: Union[Unset, None, str] = UNSET + params["created_dt__lt"] = json_created_dt_lt + + json_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_lte, Unset): - json_created_dt_lte = created_dt_lte.isoformat() if created_dt_lte else None + json_created_dt_lte = created_dt_lte.isoformat() + + params["created_dt__lte"] = json_created_dt_lte + + params["cvss_version"] = cvss_version - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields - json_issuer: Union[Unset, None, str] = UNSET + params["include_fields"] = json_include_fields + + print(OsidbApiV1FlawsCvssScoresListIssuer) + json_issuer: Union[Unset, str] = UNSET if not isinstance(issuer, Unset): + json_issuer = issuer.value - json_issuer = ( - OsidbApiV1FlawsCvssScoresListIssuer(issuer).value if issuer else None - ) + params["issuer"] = json_issuer - json_updated_dt: Union[Unset, None, str] = UNSET + params["limit"] = limit + + params["offset"] = offset + + params["score"] = score + + json_updated_dt: Union[Unset, str] = UNSET if not isinstance(updated_dt, Unset): - json_updated_dt = updated_dt.isoformat() if updated_dt else None + json_updated_dt = updated_dt.isoformat() - json_updated_dt_date: Union[Unset, None, str] = UNSET + params["updated_dt"] = json_updated_dt + + json_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(updated_dt_date, Unset): - json_updated_dt_date = updated_dt_date.isoformat() if updated_dt_date else None + json_updated_dt_date = updated_dt_date.isoformat() + + params["updated_dt__date"] = json_updated_dt_date - json_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_gte, Unset): - json_updated_dt_date_gte = ( - updated_dt_date_gte.isoformat() if updated_dt_date_gte else None - ) + json_updated_dt_date_gte = updated_dt_date_gte.isoformat() - json_updated_dt_date_lte: Union[Unset, None, str] = UNSET + params["updated_dt__date__gte"] = json_updated_dt_date_gte + + json_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_lte, Unset): - json_updated_dt_date_lte = ( - updated_dt_date_lte.isoformat() if updated_dt_date_lte else None - ) + json_updated_dt_date_lte = updated_dt_date_lte.isoformat() + + params["updated_dt__date__lte"] = json_updated_dt_date_lte - json_updated_dt_gt: Union[Unset, None, str] = UNSET + json_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(updated_dt_gt, Unset): - json_updated_dt_gt = updated_dt_gt.isoformat() if updated_dt_gt else None + json_updated_dt_gt = updated_dt_gt.isoformat() - json_updated_dt_gte: Union[Unset, None, str] = UNSET + params["updated_dt__gt"] = json_updated_dt_gt + + json_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_gte, Unset): - json_updated_dt_gte = updated_dt_gte.isoformat() if updated_dt_gte else None + json_updated_dt_gte = updated_dt_gte.isoformat() + + params["updated_dt__gte"] = json_updated_dt_gte - json_updated_dt_lt: Union[Unset, None, str] = UNSET + json_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(updated_dt_lt, Unset): - json_updated_dt_lt = updated_dt_lt.isoformat() if updated_dt_lt else None + json_updated_dt_lt = updated_dt_lt.isoformat() + + params["updated_dt__lt"] = json_updated_dt_lt - json_updated_dt_lte: Union[Unset, None, str] = UNSET + json_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_lte, Unset): - json_updated_dt_lte = updated_dt_lte.isoformat() if updated_dt_lte else None - - params: Dict[str, Any] = { - "comment": comment, - "created_dt": json_created_dt, - "created_dt__date": json_created_dt_date, - "created_dt__date__gte": json_created_dt_date_gte, - "created_dt__date__lte": json_created_dt_date_lte, - "created_dt__gt": json_created_dt_gt, - "created_dt__gte": json_created_dt_gte, - "created_dt__lt": json_created_dt_lt, - "created_dt__lte": json_created_dt_lte, - "cvss_version": cvss_version, - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - "issuer": json_issuer, - "limit": limit, - "offset": offset, - "score": score, - "updated_dt": json_updated_dt, - "updated_dt__date": json_updated_dt_date, - "updated_dt__date__gte": json_updated_dt_date_gte, - "updated_dt__date__lte": json_updated_dt_date_lte, - "updated_dt__gt": json_updated_dt_gt, - "updated_dt__gte": json_updated_dt_gte, - "updated_dt__lt": json_updated_dt_lt, - "updated_dt__lte": json_updated_dt_lte, - "uuid": uuid, - "vector": vector, - } + json_updated_dt_lte = updated_dt_lte.isoformat() + + params["updated_dt__lte"] = json_updated_dt_lte + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid + + params["vector"] = vector + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/cvss_scores".format( + flaw_id=flaw_id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCvssScoresListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -219,56 +201,95 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsCvssScoresListResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsCvssScoresListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCvssScoresListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, ) -> Response[OsidbApiV1FlawsCvssScoresListResponse200]: + """ + Args: + flaw_id (UUID): + comment (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_version (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + issuer (Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + score (Union[Unset, float]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + vector (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, @@ -308,41 +329,77 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, ) -> Optional[OsidbApiV1FlawsCvssScoresListResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + comment (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_version (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + issuer (Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + score (Union[Unset, float]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + vector (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresListResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -376,40 +433,77 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, ) -> Response[OsidbApiV1FlawsCvssScoresListResponse200]: + """ + Args: + flaw_id (UUID): + comment (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_version (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + issuer (Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + score (Union[Unset, float]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + vector (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, comment=comment, created_dt=created_dt, created_dt_date=created_dt_date, @@ -438,52 +532,82 @@ async def async_detailed( vector=vector, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, *, client: AuthenticatedClient, - comment: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_version: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - issuer: Union[Unset, None, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - score: Union[Unset, None, float] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - vector: Union[Unset, None, str] = UNSET, + comment: Union[Unset, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_version: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + issuer: Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + score: Union[Unset, float] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + vector: Union[Unset, str] = UNSET, ) -> Optional[OsidbApiV1FlawsCvssScoresListResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + comment (Union[Unset, str]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cvss_version (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + issuer (Union[Unset, OsidbApiV1FlawsCvssScoresListIssuer]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + score (Union[Unset, float]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + vector (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, comment=comment, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_retrieve.py index d8311d3..3d0571b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_retrieve.py @@ -1,64 +1,54 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_cvss_scores_retrieve_response_200 import ( - OsidbApiV1FlawsCvssScoresRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], -} +from ...models.osidb_api_v1_flaws_cvss_scores_retrieve_response_200 import OsidbApiV1FlawsCvssScoresRetrieveResponse200 +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/cvss_scores/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() - - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/cvss_scores/{id}".format( + flaw_id=flaw_id, + id=id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCvssScoresRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -66,33 +56,49 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsCvssScoresRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsCvssScoresRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCvssScoresRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsCvssScoresRetrieveResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, @@ -109,18 +115,31 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsCvssScoresRetrieveResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresRetrieveResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -131,45 +150,66 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsCvssScoresRetrieveResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsCvssScoresRetrieveResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_update.py index a2ce149..ad290c0 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_cvss_scores_update.py @@ -1,52 +1,52 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.flaw_cvss_put import FlawCVSSPut -from ...models.osidb_api_v1_flaws_cvss_scores_update_response_200 import ( - OsidbApiV1FlawsCvssScoresUpdateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawCVSSPut +from ...models.flaw_cvss_put import FlawCVSSPut +from ...models.osidb_api_v1_flaws_cvss_scores_update_response_200 import OsidbApiV1FlawsCvssScoresUpdateResponse200 +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawCVSSPut, - multipart_data: FlawCVSSPut, - json_body: FlawCVSSPut, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/cvss_scores/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawCVSSPut, + FlawCVSSPut, + FlawCVSSPut, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/cvss_scores/{id}".format( + flaw_id=flaw_id, + id=id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawCVSSPut): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsCvssScoresUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -54,41 +54,59 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsCvssScoresUpdateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsCvssScoresUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsCvssScoresUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawCVSSPut, - multipart_data: FlawCVSSPut, - json_body: FlawCVSSPut, + body: Union[ + FlawCVSSPut, + FlawCVSSPut, + FlawCVSSPut, + ], ) -> Response[OsidbApiV1FlawsCvssScoresUpdateResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawCVSSPut): FlawCVSS serializer + body (FlawCVSSPut): FlawCVSS serializer + body (FlawCVSSPut): FlawCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresUpdateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -99,77 +117,117 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawCVSSPut, - multipart_data: FlawCVSSPut, - json_body: FlawCVSSPut, + body: Union[ + FlawCVSSPut, + FlawCVSSPut, + FlawCVSSPut, + ], ) -> Optional[OsidbApiV1FlawsCvssScoresUpdateResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawCVSSPut): FlawCVSS serializer + body (FlawCVSSPut): FlawCVSS serializer + body (FlawCVSSPut): FlawCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresUpdateResponse200 + """ return sync_detailed( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawCVSSPut, - multipart_data: FlawCVSSPut, - json_body: FlawCVSSPut, + body: Union[ + FlawCVSSPut, + FlawCVSSPut, + FlawCVSSPut, + ], ) -> Response[OsidbApiV1FlawsCvssScoresUpdateResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawCVSSPut): FlawCVSS serializer + body (FlawCVSSPut): FlawCVSS serializer + body (FlawCVSSPut): FlawCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsCvssScoresUpdateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawCVSSPut, - multipart_data: FlawCVSSPut, - json_body: FlawCVSSPut, + body: Union[ + FlawCVSSPut, + FlawCVSSPut, + FlawCVSSPut, + ], ) -> Optional[OsidbApiV1FlawsCvssScoresUpdateResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawCVSSPut): FlawCVSS serializer + body (FlawCVSSPut): FlawCVSS serializer + body (FlawCVSSPut): FlawCVSS serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsCvssScoresUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_list.py index a13bc00..51a4e2b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_list.py @@ -1,1671 +1,1242 @@ -import datetime -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_list_affects_affectedness import ( - OsidbApiV1FlawsListAffectsAffectedness, -) -from ...models.osidb_api_v1_flaws_list_affects_impact import ( - OsidbApiV1FlawsListAffectsImpact, -) -from ...models.osidb_api_v1_flaws_list_affects_resolution import ( - OsidbApiV1FlawsListAffectsResolution, -) -from ...models.osidb_api_v1_flaws_list_affects_trackers_type import ( - OsidbApiV1FlawsListAffectsTrackersType, -) -from ...models.osidb_api_v1_flaws_list_cvss_scores_issuer import ( - OsidbApiV1FlawsListCvssScoresIssuer, -) +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + +from ...models.osidb_api_v1_flaws_list_affects_affectedness import OsidbApiV1FlawsListAffectsAffectedness +from ...models.osidb_api_v1_flaws_list_affects_impact import OsidbApiV1FlawsListAffectsImpact +from ...models.osidb_api_v1_flaws_list_affects_resolution import OsidbApiV1FlawsListAffectsResolution +from ...models.osidb_api_v1_flaws_list_affects_trackers_type import OsidbApiV1FlawsListAffectsTrackersType +from ...models.osidb_api_v1_flaws_list_cvss_scores_issuer import OsidbApiV1FlawsListCvssScoresIssuer from ...models.osidb_api_v1_flaws_list_impact import OsidbApiV1FlawsListImpact -from ...models.osidb_api_v1_flaws_list_major_incident_state import ( - OsidbApiV1FlawsListMajorIncidentState, -) -from ...models.osidb_api_v1_flaws_list_nist_cvss_validation import ( - OsidbApiV1FlawsListNistCvssValidation, -) +from ...models.osidb_api_v1_flaws_list_major_incident_state import OsidbApiV1FlawsListMajorIncidentState +from ...models.osidb_api_v1_flaws_list_nist_cvss_validation import OsidbApiV1FlawsListNistCvssValidation from ...models.osidb_api_v1_flaws_list_order_item import OsidbApiV1FlawsListOrderItem -from ...models.osidb_api_v1_flaws_list_references_type import ( - OsidbApiV1FlawsListReferencesType, -) -from ...models.osidb_api_v1_flaws_list_requires_cve_description import ( - OsidbApiV1FlawsListRequiresCveDescription, -) -from ...models.osidb_api_v1_flaws_list_response_200 import ( - OsidbApiV1FlawsListResponse200, -) +from ...models.osidb_api_v1_flaws_list_references_type import OsidbApiV1FlawsListReferencesType +from ...models.osidb_api_v1_flaws_list_requires_cve_description import OsidbApiV1FlawsListRequiresCveDescription +from ...models.osidb_api_v1_flaws_list_response_200 import OsidbApiV1FlawsListResponse200 from ...models.osidb_api_v1_flaws_list_source import OsidbApiV1FlawsListSource -from ...models.osidb_api_v1_flaws_list_workflow_state_item import ( - OsidbApiV1FlawsListWorkflowStateItem, -) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "acknowledgments__affiliation": str, - "acknowledgments__created_dt": datetime.datetime, - "acknowledgments__created_dt__date": datetime.date, - "acknowledgments__created_dt__date__gte": datetime.date, - "acknowledgments__created_dt__date__lte": datetime.date, - "acknowledgments__created_dt__gt": datetime.datetime, - "acknowledgments__created_dt__gte": datetime.datetime, - "acknowledgments__created_dt__lt": datetime.datetime, - "acknowledgments__created_dt__lte": datetime.datetime, - "acknowledgments__from_upstream": bool, - "acknowledgments__name": str, - "acknowledgments__updated_dt": datetime.datetime, - "acknowledgments__updated_dt__date": datetime.date, - "acknowledgments__updated_dt__date__gte": datetime.date, - "acknowledgments__updated_dt__date__lte": datetime.date, - "acknowledgments__updated_dt__gt": datetime.datetime, - "acknowledgments__updated_dt__gte": datetime.datetime, - "acknowledgments__updated_dt__lt": datetime.datetime, - "acknowledgments__updated_dt__lte": datetime.datetime, - "acknowledgments__uuid": str, - "affects__affectedness": OsidbApiV1FlawsListAffectsAffectedness, - "affects__created_dt": datetime.datetime, - "affects__created_dt__date": datetime.date, - "affects__created_dt__date__gte": datetime.date, - "affects__created_dt__date__lte": datetime.date, - "affects__created_dt__gt": datetime.datetime, - "affects__created_dt__gte": datetime.datetime, - "affects__created_dt__lt": datetime.datetime, - "affects__created_dt__lte": datetime.datetime, - "affects__embargoed": bool, - "affects__impact": OsidbApiV1FlawsListAffectsImpact, - "affects__ps_component": str, - "affects__ps_module": str, - "affects__resolution": OsidbApiV1FlawsListAffectsResolution, - "affects__trackers__created_dt": datetime.datetime, - "affects__trackers__created_dt__date": datetime.date, - "affects__trackers__created_dt__date__gte": datetime.date, - "affects__trackers__created_dt__date__lte": datetime.date, - "affects__trackers__created_dt__gt": datetime.datetime, - "affects__trackers__created_dt__gte": datetime.datetime, - "affects__trackers__created_dt__lt": datetime.datetime, - "affects__trackers__created_dt__lte": datetime.datetime, - "affects__trackers__embargoed": bool, - "affects__trackers__errata__advisory_name": str, - "affects__trackers__errata__et_id": int, - "affects__trackers__errata__shipped_dt": datetime.datetime, - "affects__trackers__errata__shipped_dt__date": datetime.date, - "affects__trackers__errata__shipped_dt__date__gte": datetime.date, - "affects__trackers__errata__shipped_dt__date__lte": datetime.date, - "affects__trackers__errata__shipped_dt__gt": datetime.datetime, - "affects__trackers__errata__shipped_dt__gte": datetime.datetime, - "affects__trackers__errata__shipped_dt__lt": datetime.datetime, - "affects__trackers__errata__shipped_dt__lte": datetime.datetime, - "affects__trackers__external_system_id": str, - "affects__trackers__ps_update_stream": str, - "affects__trackers__resolution": str, - "affects__trackers__status": str, - "affects__trackers__type": OsidbApiV1FlawsListAffectsTrackersType, - "affects__trackers__updated_dt": datetime.datetime, - "affects__trackers__updated_dt__date": datetime.date, - "affects__trackers__updated_dt__date__gte": datetime.date, - "affects__trackers__updated_dt__date__lte": datetime.date, - "affects__trackers__updated_dt__gt": datetime.datetime, - "affects__trackers__updated_dt__gte": datetime.datetime, - "affects__trackers__updated_dt__lt": datetime.datetime, - "affects__trackers__updated_dt__lte": datetime.datetime, - "affects__trackers__uuid": str, - "affects__updated_dt": datetime.datetime, - "affects__updated_dt__date": datetime.date, - "affects__updated_dt__date__gte": datetime.date, - "affects__updated_dt__date__lte": datetime.date, - "affects__updated_dt__gt": datetime.datetime, - "affects__updated_dt__gte": datetime.datetime, - "affects__updated_dt__lt": datetime.datetime, - "affects__updated_dt__lte": datetime.datetime, - "affects__uuid": str, - "bz_id": float, - "changed_after": datetime.datetime, - "changed_before": datetime.datetime, - "comment_zero": str, - "components": List[str], - "created_dt": datetime.datetime, - "created_dt__date": datetime.date, - "created_dt__date__gte": datetime.date, - "created_dt__date__lte": datetime.date, - "created_dt__gt": datetime.datetime, - "created_dt__gte": datetime.datetime, - "created_dt__lt": datetime.datetime, - "created_dt__lte": datetime.datetime, - "cve_description": str, - "cve_description__isempty": bool, - "cve_id": List[str], - "cve_id__isempty": bool, - "cvss2_nist__isempty": bool, - "cvss2_rh__isempty": bool, - "cvss3_nist__isempty": bool, - "cvss3_rh__isempty": bool, - "cvss4_nist__isempty": bool, - "cvss4_rh__isempty": bool, - "cvss_scores__comment": str, - "cvss_scores__created_dt": datetime.datetime, - "cvss_scores__created_dt__date": datetime.date, - "cvss_scores__created_dt__date__gte": datetime.date, - "cvss_scores__created_dt__date__lte": datetime.date, - "cvss_scores__created_dt__gt": datetime.datetime, - "cvss_scores__created_dt__gte": datetime.datetime, - "cvss_scores__created_dt__lt": datetime.datetime, - "cvss_scores__created_dt__lte": datetime.datetime, - "cvss_scores__cvss_version": str, - "cvss_scores__issuer": OsidbApiV1FlawsListCvssScoresIssuer, - "cvss_scores__score": float, - "cvss_scores__updated_dt": datetime.datetime, - "cvss_scores__updated_dt__date": datetime.date, - "cvss_scores__updated_dt__date__gte": datetime.date, - "cvss_scores__updated_dt__date__lte": datetime.date, - "cvss_scores__updated_dt__gt": datetime.datetime, - "cvss_scores__updated_dt__gte": datetime.datetime, - "cvss_scores__updated_dt__lt": datetime.datetime, - "cvss_scores__updated_dt__lte": datetime.datetime, - "cvss_scores__uuid": str, - "cvss_scores__vector": str, - "cwe_id": str, - "cwe_id__isempty": bool, - "embargoed": bool, - "exclude_fields": List[str], - "impact": OsidbApiV1FlawsListImpact, - "include_fields": List[str], - "include_meta_attr": List[str], - "limit": int, - "major_incident_start_dt": datetime.datetime, - "major_incident_start_dt__date": datetime.date, - "major_incident_start_dt__date__gte": datetime.date, - "major_incident_start_dt__date__lte": datetime.date, - "major_incident_start_dt__gt": datetime.datetime, - "major_incident_start_dt__gte": datetime.datetime, - "major_incident_start_dt__lt": datetime.datetime, - "major_incident_start_dt__lte": datetime.datetime, - "major_incident_state": OsidbApiV1FlawsListMajorIncidentState, - "mitigation__isempty": bool, - "nist_cvss_validation": OsidbApiV1FlawsListNistCvssValidation, - "offset": int, - "order": List[OsidbApiV1FlawsListOrderItem], - "owner": str, - "owner__isempty": bool, - "query": str, - "references__created_dt": datetime.datetime, - "references__created_dt__date": datetime.date, - "references__created_dt__date__gte": datetime.date, - "references__created_dt__date__lte": datetime.date, - "references__created_dt__gt": datetime.datetime, - "references__created_dt__gte": datetime.datetime, - "references__created_dt__lt": datetime.datetime, - "references__created_dt__lte": datetime.datetime, - "references__description": str, - "references__type": OsidbApiV1FlawsListReferencesType, - "references__updated_dt": datetime.datetime, - "references__updated_dt__date": datetime.date, - "references__updated_dt__date__gte": datetime.date, - "references__updated_dt__date__lte": datetime.date, - "references__updated_dt__gt": datetime.datetime, - "references__updated_dt__gte": datetime.datetime, - "references__updated_dt__lt": datetime.datetime, - "references__updated_dt__lte": datetime.datetime, - "references__url": str, - "references__uuid": str, - "reported_dt": datetime.datetime, - "reported_dt__date": datetime.date, - "reported_dt__date__gte": datetime.date, - "reported_dt__date__lte": datetime.date, - "reported_dt__gt": datetime.datetime, - "reported_dt__gte": datetime.datetime, - "reported_dt__lt": datetime.datetime, - "reported_dt__lte": datetime.datetime, - "requires_cve_description": OsidbApiV1FlawsListRequiresCveDescription, - "search": str, - "source": OsidbApiV1FlawsListSource, - "statement": str, - "statement__isempty": bool, - "team_id": str, - "title": str, - "tracker_ids": List[str], - "unembargo_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "updated_dt__date": datetime.date, - "updated_dt__date__gte": datetime.date, - "updated_dt__date__lte": datetime.date, - "updated_dt__gt": datetime.datetime, - "updated_dt__gte": datetime.datetime, - "updated_dt__lt": datetime.datetime, - "updated_dt__lte": datetime.datetime, - "uuid": str, - "workflow_state": List[OsidbApiV1FlawsListWorkflowStateItem], -} +from ...models.osidb_api_v1_flaws_list_workflow_state_item import OsidbApiV1FlawsListWorkflowStateItem +from uuid import UUID +import datetime def _get_kwargs( *, client: AuthenticatedClient, - acknowledgments_affiliation: Union[Unset, None, str] = UNSET, - acknowledgments_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_from_upstream: Union[Unset, None, bool] = UNSET, - acknowledgments_name: Union[Unset, None, str] = UNSET, - acknowledgments_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_uuid: Union[Unset, None, str] = UNSET, - affects_affectedness: Union[ - Unset, None, OsidbApiV1FlawsListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1FlawsListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1FlawsListAffectsResolution - ] = UNSET, - affects_trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_embargoed: Union[Unset, None, bool] = UNSET, - affects_trackers_errata_advisory_name: Union[Unset, None, str] = UNSET, - affects_trackers_errata_et_id: Union[Unset, None, int] = UNSET, - affects_trackers_errata_shipped_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_errata_shipped_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_errata_shipped_dt_date_gte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_date_lte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_gt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_gte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_external_system_id: Union[Unset, None, str] = UNSET, - affects_trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - affects_trackers_resolution: Union[Unset, None, str] = UNSET, - affects_trackers_status: Union[Unset, None, str] = UNSET, - affects_trackers_type: Union[ - Unset, None, OsidbApiV1FlawsListAffectsTrackersType - ] = UNSET, - affects_trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_uuid: Union[Unset, None, str] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - bz_id: Union[Unset, None, float] = UNSET, - changed_after: Union[Unset, None, datetime.datetime] = UNSET, - changed_before: Union[Unset, None, datetime.datetime] = UNSET, - comment_zero: Union[Unset, None, str] = UNSET, - components: Union[Unset, None, List[str]] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cve_description: Union[Unset, None, str] = UNSET, - cve_description_isempty: Union[Unset, None, bool] = UNSET, - cve_id: Union[Unset, None, List[str]] = UNSET, - cve_id_isempty: Union[Unset, None, bool] = UNSET, - cvss2_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss2_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss3_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss3_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss4_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss4_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[Unset, None, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - cwe_id: Union[Unset, None, str] = UNSET, - cwe_id_isempty: Union[Unset, None, bool] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - impact: Union[Unset, None, OsidbApiV1FlawsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_date: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_state: Union[ - Unset, None, OsidbApiV1FlawsListMajorIncidentState - ] = UNSET, - mitigation_isempty: Union[Unset, None, bool] = UNSET, - nist_cvss_validation: Union[ - Unset, None, OsidbApiV1FlawsListNistCvssValidation - ] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1FlawsListOrderItem]] = UNSET, - owner: Union[Unset, None, str] = UNSET, - owner_isempty: Union[Unset, None, bool] = UNSET, - query: Union[Unset, None, str] = UNSET, - references_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_description: Union[Unset, None, str] = UNSET, - references_type: Union[Unset, None, OsidbApiV1FlawsListReferencesType] = UNSET, - references_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_url: Union[Unset, None, str] = UNSET, - references_uuid: Union[Unset, None, str] = UNSET, - reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - requires_cve_description: Union[ - Unset, None, OsidbApiV1FlawsListRequiresCveDescription - ] = UNSET, - search: Union[Unset, None, str] = UNSET, - source: Union[Unset, None, OsidbApiV1FlawsListSource] = UNSET, - statement: Union[Unset, None, str] = UNSET, - statement_isempty: Union[Unset, None, bool] = UNSET, - team_id: Union[Unset, None, str] = UNSET, - title: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - workflow_state: Union[ - Unset, None, List[OsidbApiV1FlawsListWorkflowStateItem] - ] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_acknowledgments_created_dt: Union[Unset, None, str] = UNSET + acknowledgments_affiliation: Union[Unset, str] = UNSET, + acknowledgments_created_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_from_upstream: Union[Unset, bool] = UNSET, + acknowledgments_name: Union[Unset, str] = UNSET, + acknowledgments_updated_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_uuid: Union[Unset, UUID] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1FlawsListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_impact: Union[Unset, OsidbApiV1FlawsListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1FlawsListAffectsResolution] = UNSET, + affects_trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_embargoed: Union[Unset, bool] = UNSET, + affects_trackers_errata_advisory_name: Union[Unset, str] = UNSET, + affects_trackers_errata_et_id: Union[Unset, int] = UNSET, + affects_trackers_errata_shipped_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_external_system_id: Union[Unset, str] = UNSET, + affects_trackers_ps_update_stream: Union[Unset, str] = UNSET, + affects_trackers_resolution: Union[Unset, str] = UNSET, + affects_trackers_status: Union[Unset, str] = UNSET, + affects_trackers_type: Union[Unset, OsidbApiV1FlawsListAffectsTrackersType] = UNSET, + affects_trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_uuid: Union[Unset, UUID] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + bz_id: Union[Unset, float] = UNSET, + changed_after: Union[Unset, datetime.datetime] = UNSET, + changed_before: Union[Unset, datetime.datetime] = UNSET, + comment_zero: Union[Unset, str] = UNSET, + components: Union[Unset, list[str]] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cve_description: Union[Unset, str] = UNSET, + cve_description_isempty: Union[Unset, bool] = UNSET, + cve_id: Union[Unset, list[str]] = UNSET, + cve_id_isempty: Union[Unset, bool] = UNSET, + cvss2_nist_isempty: Union[Unset, bool] = UNSET, + cvss2_rh_isempty: Union[Unset, bool] = UNSET, + cvss3_nist_isempty: Union[Unset, bool] = UNSET, + cvss3_rh_isempty: Union[Unset, bool] = UNSET, + cvss4_nist_isempty: Union[Unset, bool] = UNSET, + cvss4_rh_isempty: Union[Unset, bool] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + cwe_id: Union[Unset, str] = UNSET, + cwe_id_isempty: Union[Unset, bool] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + impact: Union[Unset, OsidbApiV1FlawsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + major_incident_start_dt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_date: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_gte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_lte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_gt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_gte: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lte: Union[Unset, datetime.datetime] = UNSET, + major_incident_state: Union[Unset, OsidbApiV1FlawsListMajorIncidentState] = UNSET, + mitigation_isempty: Union[Unset, bool] = UNSET, + nist_cvss_validation: Union[Unset, OsidbApiV1FlawsListNistCvssValidation] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1FlawsListOrderItem]] = UNSET, + owner: Union[Unset, str] = UNSET, + owner_isempty: Union[Unset, bool] = UNSET, + query: Union[Unset, str] = UNSET, + references_created_dt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_date: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_description: Union[Unset, str] = UNSET, + references_type: Union[Unset, OsidbApiV1FlawsListReferencesType] = UNSET, + references_updated_dt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_date: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_url: Union[Unset, str] = UNSET, + references_uuid: Union[Unset, UUID] = UNSET, + reported_dt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_date: Union[Unset, datetime.date] = UNSET, + reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + requires_cve_description: Union[Unset, OsidbApiV1FlawsListRequiresCveDescription] = UNSET, + search: Union[Unset, str] = UNSET, + source: Union[Unset, OsidbApiV1FlawsListSource] = UNSET, + statement: Union[Unset, str] = UNSET, + statement_isempty: Union[Unset, bool] = UNSET, + team_id: Union[Unset, str] = UNSET, + title: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, + unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + workflow_state: Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["acknowledgments__affiliation"] = acknowledgments_affiliation + + json_acknowledgments_created_dt: Union[Unset, str] = UNSET if not isinstance(acknowledgments_created_dt, Unset): - json_acknowledgments_created_dt = ( - acknowledgments_created_dt.isoformat() - if acknowledgments_created_dt - else None - ) + json_acknowledgments_created_dt = acknowledgments_created_dt.isoformat() + + params["acknowledgments__created_dt"] = json_acknowledgments_created_dt - json_acknowledgments_created_dt_date: Union[Unset, None, str] = UNSET + json_acknowledgments_created_dt_date: Union[Unset, str] = UNSET if not isinstance(acknowledgments_created_dt_date, Unset): - json_acknowledgments_created_dt_date = ( - acknowledgments_created_dt_date.isoformat() - if acknowledgments_created_dt_date - else None - ) + json_acknowledgments_created_dt_date = acknowledgments_created_dt_date.isoformat() + + params["acknowledgments__created_dt__date"] = json_acknowledgments_created_dt_date - json_acknowledgments_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_acknowledgments_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(acknowledgments_created_dt_date_gte, Unset): - json_acknowledgments_created_dt_date_gte = ( - acknowledgments_created_dt_date_gte.isoformat() - if acknowledgments_created_dt_date_gte - else None - ) + json_acknowledgments_created_dt_date_gte = acknowledgments_created_dt_date_gte.isoformat() + + params["acknowledgments__created_dt__date__gte"] = json_acknowledgments_created_dt_date_gte - json_acknowledgments_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_acknowledgments_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(acknowledgments_created_dt_date_lte, Unset): - json_acknowledgments_created_dt_date_lte = ( - acknowledgments_created_dt_date_lte.isoformat() - if acknowledgments_created_dt_date_lte - else None - ) + json_acknowledgments_created_dt_date_lte = acknowledgments_created_dt_date_lte.isoformat() - json_acknowledgments_created_dt_gt: Union[Unset, None, str] = UNSET + params["acknowledgments__created_dt__date__lte"] = json_acknowledgments_created_dt_date_lte + + json_acknowledgments_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(acknowledgments_created_dt_gt, Unset): - json_acknowledgments_created_dt_gt = ( - acknowledgments_created_dt_gt.isoformat() - if acknowledgments_created_dt_gt - else None - ) + json_acknowledgments_created_dt_gt = acknowledgments_created_dt_gt.isoformat() - json_acknowledgments_created_dt_gte: Union[Unset, None, str] = UNSET + params["acknowledgments__created_dt__gt"] = json_acknowledgments_created_dt_gt + + json_acknowledgments_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(acknowledgments_created_dt_gte, Unset): - json_acknowledgments_created_dt_gte = ( - acknowledgments_created_dt_gte.isoformat() - if acknowledgments_created_dt_gte - else None - ) + json_acknowledgments_created_dt_gte = acknowledgments_created_dt_gte.isoformat() + + params["acknowledgments__created_dt__gte"] = json_acknowledgments_created_dt_gte - json_acknowledgments_created_dt_lt: Union[Unset, None, str] = UNSET + json_acknowledgments_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(acknowledgments_created_dt_lt, Unset): - json_acknowledgments_created_dt_lt = ( - acknowledgments_created_dt_lt.isoformat() - if acknowledgments_created_dt_lt - else None - ) + json_acknowledgments_created_dt_lt = acknowledgments_created_dt_lt.isoformat() + + params["acknowledgments__created_dt__lt"] = json_acknowledgments_created_dt_lt - json_acknowledgments_created_dt_lte: Union[Unset, None, str] = UNSET + json_acknowledgments_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(acknowledgments_created_dt_lte, Unset): - json_acknowledgments_created_dt_lte = ( - acknowledgments_created_dt_lte.isoformat() - if acknowledgments_created_dt_lte - else None - ) + json_acknowledgments_created_dt_lte = acknowledgments_created_dt_lte.isoformat() + + params["acknowledgments__created_dt__lte"] = json_acknowledgments_created_dt_lte + + params["acknowledgments__from_upstream"] = acknowledgments_from_upstream - json_acknowledgments_updated_dt: Union[Unset, None, str] = UNSET + params["acknowledgments__name"] = acknowledgments_name + + json_acknowledgments_updated_dt: Union[Unset, str] = UNSET if not isinstance(acknowledgments_updated_dt, Unset): - json_acknowledgments_updated_dt = ( - acknowledgments_updated_dt.isoformat() - if acknowledgments_updated_dt - else None - ) + json_acknowledgments_updated_dt = acknowledgments_updated_dt.isoformat() - json_acknowledgments_updated_dt_date: Union[Unset, None, str] = UNSET + params["acknowledgments__updated_dt"] = json_acknowledgments_updated_dt + + json_acknowledgments_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(acknowledgments_updated_dt_date, Unset): - json_acknowledgments_updated_dt_date = ( - acknowledgments_updated_dt_date.isoformat() - if acknowledgments_updated_dt_date - else None - ) + json_acknowledgments_updated_dt_date = acknowledgments_updated_dt_date.isoformat() + + params["acknowledgments__updated_dt__date"] = json_acknowledgments_updated_dt_date - json_acknowledgments_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_acknowledgments_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(acknowledgments_updated_dt_date_gte, Unset): - json_acknowledgments_updated_dt_date_gte = ( - acknowledgments_updated_dt_date_gte.isoformat() - if acknowledgments_updated_dt_date_gte - else None - ) + json_acknowledgments_updated_dt_date_gte = acknowledgments_updated_dt_date_gte.isoformat() + + params["acknowledgments__updated_dt__date__gte"] = json_acknowledgments_updated_dt_date_gte - json_acknowledgments_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_acknowledgments_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(acknowledgments_updated_dt_date_lte, Unset): - json_acknowledgments_updated_dt_date_lte = ( - acknowledgments_updated_dt_date_lte.isoformat() - if acknowledgments_updated_dt_date_lte - else None - ) + json_acknowledgments_updated_dt_date_lte = acknowledgments_updated_dt_date_lte.isoformat() + + params["acknowledgments__updated_dt__date__lte"] = json_acknowledgments_updated_dt_date_lte - json_acknowledgments_updated_dt_gt: Union[Unset, None, str] = UNSET + json_acknowledgments_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(acknowledgments_updated_dt_gt, Unset): - json_acknowledgments_updated_dt_gt = ( - acknowledgments_updated_dt_gt.isoformat() - if acknowledgments_updated_dt_gt - else None - ) + json_acknowledgments_updated_dt_gt = acknowledgments_updated_dt_gt.isoformat() - json_acknowledgments_updated_dt_gte: Union[Unset, None, str] = UNSET + params["acknowledgments__updated_dt__gt"] = json_acknowledgments_updated_dt_gt + + json_acknowledgments_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(acknowledgments_updated_dt_gte, Unset): - json_acknowledgments_updated_dt_gte = ( - acknowledgments_updated_dt_gte.isoformat() - if acknowledgments_updated_dt_gte - else None - ) + json_acknowledgments_updated_dt_gte = acknowledgments_updated_dt_gte.isoformat() - json_acknowledgments_updated_dt_lt: Union[Unset, None, str] = UNSET + params["acknowledgments__updated_dt__gte"] = json_acknowledgments_updated_dt_gte + + json_acknowledgments_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(acknowledgments_updated_dt_lt, Unset): - json_acknowledgments_updated_dt_lt = ( - acknowledgments_updated_dt_lt.isoformat() - if acknowledgments_updated_dt_lt - else None - ) + json_acknowledgments_updated_dt_lt = acknowledgments_updated_dt_lt.isoformat() + + params["acknowledgments__updated_dt__lt"] = json_acknowledgments_updated_dt_lt - json_acknowledgments_updated_dt_lte: Union[Unset, None, str] = UNSET + json_acknowledgments_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(acknowledgments_updated_dt_lte, Unset): - json_acknowledgments_updated_dt_lte = ( - acknowledgments_updated_dt_lte.isoformat() - if acknowledgments_updated_dt_lte - else None - ) + json_acknowledgments_updated_dt_lte = acknowledgments_updated_dt_lte.isoformat() + + params["acknowledgments__updated_dt__lte"] = json_acknowledgments_updated_dt_lte - json_affects_affectedness: Union[Unset, None, str] = UNSET + json_acknowledgments_uuid: Union[Unset, str] = UNSET + if not isinstance(acknowledgments_uuid, Unset): + json_acknowledgments_uuid = str(acknowledgments_uuid) + + params["acknowledgments__uuid"] = json_acknowledgments_uuid + + print(OsidbApiV1FlawsListAffectsAffectedness) + json_affects_affectedness: Union[Unset, str] = UNSET if not isinstance(affects_affectedness, Unset): + json_affects_affectedness = affects_affectedness.value - json_affects_affectedness = ( - OsidbApiV1FlawsListAffectsAffectedness(affects_affectedness).value - if affects_affectedness - else None - ) + params["affects__affectedness"] = json_affects_affectedness - json_affects_created_dt: Union[Unset, None, str] = UNSET + json_affects_created_dt: Union[Unset, str] = UNSET if not isinstance(affects_created_dt, Unset): - json_affects_created_dt = ( - affects_created_dt.isoformat() if affects_created_dt else None - ) + json_affects_created_dt = affects_created_dt.isoformat() + + params["affects__created_dt"] = json_affects_created_dt - json_affects_created_dt_date: Union[Unset, None, str] = UNSET + json_affects_created_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_date, Unset): - json_affects_created_dt_date = ( - affects_created_dt_date.isoformat() if affects_created_dt_date else None - ) + json_affects_created_dt_date = affects_created_dt_date.isoformat() + + params["affects__created_dt__date"] = json_affects_created_dt_date - json_affects_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_affects_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_date_gte, Unset): - json_affects_created_dt_date_gte = ( - affects_created_dt_date_gte.isoformat() - if affects_created_dt_date_gte - else None - ) + json_affects_created_dt_date_gte = affects_created_dt_date_gte.isoformat() - json_affects_created_dt_date_lte: Union[Unset, None, str] = UNSET + params["affects__created_dt__date__gte"] = json_affects_created_dt_date_gte + + json_affects_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_date_lte, Unset): - json_affects_created_dt_date_lte = ( - affects_created_dt_date_lte.isoformat() - if affects_created_dt_date_lte - else None - ) + json_affects_created_dt_date_lte = affects_created_dt_date_lte.isoformat() - json_affects_created_dt_gt: Union[Unset, None, str] = UNSET + params["affects__created_dt__date__lte"] = json_affects_created_dt_date_lte + + json_affects_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_gt, Unset): - json_affects_created_dt_gt = ( - affects_created_dt_gt.isoformat() if affects_created_dt_gt else None - ) + json_affects_created_dt_gt = affects_created_dt_gt.isoformat() + + params["affects__created_dt__gt"] = json_affects_created_dt_gt - json_affects_created_dt_gte: Union[Unset, None, str] = UNSET + json_affects_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_gte, Unset): - json_affects_created_dt_gte = ( - affects_created_dt_gte.isoformat() if affects_created_dt_gte else None - ) + json_affects_created_dt_gte = affects_created_dt_gte.isoformat() + + params["affects__created_dt__gte"] = json_affects_created_dt_gte - json_affects_created_dt_lt: Union[Unset, None, str] = UNSET + json_affects_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_lt, Unset): - json_affects_created_dt_lt = ( - affects_created_dt_lt.isoformat() if affects_created_dt_lt else None - ) + json_affects_created_dt_lt = affects_created_dt_lt.isoformat() + + params["affects__created_dt__lt"] = json_affects_created_dt_lt - json_affects_created_dt_lte: Union[Unset, None, str] = UNSET + json_affects_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_lte, Unset): - json_affects_created_dt_lte = ( - affects_created_dt_lte.isoformat() if affects_created_dt_lte else None - ) + json_affects_created_dt_lte = affects_created_dt_lte.isoformat() + + params["affects__created_dt__lte"] = json_affects_created_dt_lte + + params["affects__embargoed"] = affects_embargoed - json_affects_impact: Union[Unset, None, str] = UNSET + print(OsidbApiV1FlawsListAffectsImpact) + json_affects_impact: Union[Unset, str] = UNSET if not isinstance(affects_impact, Unset): + json_affects_impact = affects_impact.value - json_affects_impact = ( - OsidbApiV1FlawsListAffectsImpact(affects_impact).value - if affects_impact - else None - ) + params["affects__impact"] = json_affects_impact + + params["affects__ps_component"] = affects_ps_component + + params["affects__ps_module"] = affects_ps_module - json_affects_resolution: Union[Unset, None, str] = UNSET + print(OsidbApiV1FlawsListAffectsResolution) + json_affects_resolution: Union[Unset, str] = UNSET if not isinstance(affects_resolution, Unset): + json_affects_resolution = affects_resolution.value - json_affects_resolution = ( - OsidbApiV1FlawsListAffectsResolution(affects_resolution).value - if affects_resolution - else None - ) + params["affects__resolution"] = json_affects_resolution - json_affects_trackers_created_dt: Union[Unset, None, str] = UNSET + json_affects_trackers_created_dt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_created_dt, Unset): - json_affects_trackers_created_dt = ( - affects_trackers_created_dt.isoformat() - if affects_trackers_created_dt - else None - ) + json_affects_trackers_created_dt = affects_trackers_created_dt.isoformat() - json_affects_trackers_created_dt_date: Union[Unset, None, str] = UNSET + params["affects__trackers__created_dt"] = json_affects_trackers_created_dt + + json_affects_trackers_created_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_trackers_created_dt_date, Unset): - json_affects_trackers_created_dt_date = ( - affects_trackers_created_dt_date.isoformat() - if affects_trackers_created_dt_date - else None - ) + json_affects_trackers_created_dt_date = affects_trackers_created_dt_date.isoformat() + + params["affects__trackers__created_dt__date"] = json_affects_trackers_created_dt_date - json_affects_trackers_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_affects_trackers_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_created_dt_date_gte, Unset): - json_affects_trackers_created_dt_date_gte = ( - affects_trackers_created_dt_date_gte.isoformat() - if affects_trackers_created_dt_date_gte - else None - ) + json_affects_trackers_created_dt_date_gte = affects_trackers_created_dt_date_gte.isoformat() + + params["affects__trackers__created_dt__date__gte"] = json_affects_trackers_created_dt_date_gte - json_affects_trackers_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_affects_trackers_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_created_dt_date_lte, Unset): - json_affects_trackers_created_dt_date_lte = ( - affects_trackers_created_dt_date_lte.isoformat() - if affects_trackers_created_dt_date_lte - else None - ) + json_affects_trackers_created_dt_date_lte = affects_trackers_created_dt_date_lte.isoformat() + + params["affects__trackers__created_dt__date__lte"] = json_affects_trackers_created_dt_date_lte - json_affects_trackers_created_dt_gt: Union[Unset, None, str] = UNSET + json_affects_trackers_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_created_dt_gt, Unset): - json_affects_trackers_created_dt_gt = ( - affects_trackers_created_dt_gt.isoformat() - if affects_trackers_created_dt_gt - else None - ) + json_affects_trackers_created_dt_gt = affects_trackers_created_dt_gt.isoformat() - json_affects_trackers_created_dt_gte: Union[Unset, None, str] = UNSET + params["affects__trackers__created_dt__gt"] = json_affects_trackers_created_dt_gt + + json_affects_trackers_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_created_dt_gte, Unset): - json_affects_trackers_created_dt_gte = ( - affects_trackers_created_dt_gte.isoformat() - if affects_trackers_created_dt_gte - else None - ) + json_affects_trackers_created_dt_gte = affects_trackers_created_dt_gte.isoformat() - json_affects_trackers_created_dt_lt: Union[Unset, None, str] = UNSET + params["affects__trackers__created_dt__gte"] = json_affects_trackers_created_dt_gte + + json_affects_trackers_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_created_dt_lt, Unset): - json_affects_trackers_created_dt_lt = ( - affects_trackers_created_dt_lt.isoformat() - if affects_trackers_created_dt_lt - else None - ) + json_affects_trackers_created_dt_lt = affects_trackers_created_dt_lt.isoformat() + + params["affects__trackers__created_dt__lt"] = json_affects_trackers_created_dt_lt - json_affects_trackers_created_dt_lte: Union[Unset, None, str] = UNSET + json_affects_trackers_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_created_dt_lte, Unset): - json_affects_trackers_created_dt_lte = ( - affects_trackers_created_dt_lte.isoformat() - if affects_trackers_created_dt_lte - else None - ) + json_affects_trackers_created_dt_lte = affects_trackers_created_dt_lte.isoformat() + + params["affects__trackers__created_dt__lte"] = json_affects_trackers_created_dt_lte - json_affects_trackers_errata_shipped_dt: Union[Unset, None, str] = UNSET + params["affects__trackers__embargoed"] = affects_trackers_embargoed + + params["affects__trackers__errata__advisory_name"] = affects_trackers_errata_advisory_name + + params["affects__trackers__errata__et_id"] = affects_trackers_errata_et_id + + json_affects_trackers_errata_shipped_dt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_errata_shipped_dt, Unset): - json_affects_trackers_errata_shipped_dt = ( - affects_trackers_errata_shipped_dt.isoformat() - if affects_trackers_errata_shipped_dt - else None - ) + json_affects_trackers_errata_shipped_dt = affects_trackers_errata_shipped_dt.isoformat() + + params["affects__trackers__errata__shipped_dt"] = json_affects_trackers_errata_shipped_dt - json_affects_trackers_errata_shipped_dt_date: Union[Unset, None, str] = UNSET + json_affects_trackers_errata_shipped_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_trackers_errata_shipped_dt_date, Unset): - json_affects_trackers_errata_shipped_dt_date = ( - affects_trackers_errata_shipped_dt_date.isoformat() - if affects_trackers_errata_shipped_dt_date - else None - ) + json_affects_trackers_errata_shipped_dt_date = affects_trackers_errata_shipped_dt_date.isoformat() + + params["affects__trackers__errata__shipped_dt__date"] = json_affects_trackers_errata_shipped_dt_date - json_affects_trackers_errata_shipped_dt_date_gte: Union[Unset, None, str] = UNSET + json_affects_trackers_errata_shipped_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_errata_shipped_dt_date_gte, Unset): - json_affects_trackers_errata_shipped_dt_date_gte = ( - affects_trackers_errata_shipped_dt_date_gte.isoformat() - if affects_trackers_errata_shipped_dt_date_gte - else None - ) + json_affects_trackers_errata_shipped_dt_date_gte = affects_trackers_errata_shipped_dt_date_gte.isoformat() - json_affects_trackers_errata_shipped_dt_date_lte: Union[Unset, None, str] = UNSET + params["affects__trackers__errata__shipped_dt__date__gte"] = json_affects_trackers_errata_shipped_dt_date_gte + + json_affects_trackers_errata_shipped_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_errata_shipped_dt_date_lte, Unset): - json_affects_trackers_errata_shipped_dt_date_lte = ( - affects_trackers_errata_shipped_dt_date_lte.isoformat() - if affects_trackers_errata_shipped_dt_date_lte - else None - ) + json_affects_trackers_errata_shipped_dt_date_lte = affects_trackers_errata_shipped_dt_date_lte.isoformat() - json_affects_trackers_errata_shipped_dt_gt: Union[Unset, None, str] = UNSET + params["affects__trackers__errata__shipped_dt__date__lte"] = json_affects_trackers_errata_shipped_dt_date_lte + + json_affects_trackers_errata_shipped_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_errata_shipped_dt_gt, Unset): - json_affects_trackers_errata_shipped_dt_gt = ( - affects_trackers_errata_shipped_dt_gt.isoformat() - if affects_trackers_errata_shipped_dt_gt - else None - ) + json_affects_trackers_errata_shipped_dt_gt = affects_trackers_errata_shipped_dt_gt.isoformat() + + params["affects__trackers__errata__shipped_dt__gt"] = json_affects_trackers_errata_shipped_dt_gt - json_affects_trackers_errata_shipped_dt_gte: Union[Unset, None, str] = UNSET + json_affects_trackers_errata_shipped_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_errata_shipped_dt_gte, Unset): - json_affects_trackers_errata_shipped_dt_gte = ( - affects_trackers_errata_shipped_dt_gte.isoformat() - if affects_trackers_errata_shipped_dt_gte - else None - ) + json_affects_trackers_errata_shipped_dt_gte = affects_trackers_errata_shipped_dt_gte.isoformat() + + params["affects__trackers__errata__shipped_dt__gte"] = json_affects_trackers_errata_shipped_dt_gte - json_affects_trackers_errata_shipped_dt_lt: Union[Unset, None, str] = UNSET + json_affects_trackers_errata_shipped_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_errata_shipped_dt_lt, Unset): - json_affects_trackers_errata_shipped_dt_lt = ( - affects_trackers_errata_shipped_dt_lt.isoformat() - if affects_trackers_errata_shipped_dt_lt - else None - ) + json_affects_trackers_errata_shipped_dt_lt = affects_trackers_errata_shipped_dt_lt.isoformat() + + params["affects__trackers__errata__shipped_dt__lt"] = json_affects_trackers_errata_shipped_dt_lt - json_affects_trackers_errata_shipped_dt_lte: Union[Unset, None, str] = UNSET + json_affects_trackers_errata_shipped_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_errata_shipped_dt_lte, Unset): - json_affects_trackers_errata_shipped_dt_lte = ( - affects_trackers_errata_shipped_dt_lte.isoformat() - if affects_trackers_errata_shipped_dt_lte - else None - ) + json_affects_trackers_errata_shipped_dt_lte = affects_trackers_errata_shipped_dt_lte.isoformat() + + params["affects__trackers__errata__shipped_dt__lte"] = json_affects_trackers_errata_shipped_dt_lte + + params["affects__trackers__external_system_id"] = affects_trackers_external_system_id - json_affects_trackers_type: Union[Unset, None, str] = UNSET + params["affects__trackers__ps_update_stream"] = affects_trackers_ps_update_stream + + params["affects__trackers__resolution"] = affects_trackers_resolution + + params["affects__trackers__status"] = affects_trackers_status + + print(OsidbApiV1FlawsListAffectsTrackersType) + json_affects_trackers_type: Union[Unset, str] = UNSET if not isinstance(affects_trackers_type, Unset): + json_affects_trackers_type = affects_trackers_type.value - json_affects_trackers_type = ( - OsidbApiV1FlawsListAffectsTrackersType(affects_trackers_type).value - if affects_trackers_type - else None - ) + params["affects__trackers__type"] = json_affects_trackers_type - json_affects_trackers_updated_dt: Union[Unset, None, str] = UNSET + json_affects_trackers_updated_dt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_updated_dt, Unset): - json_affects_trackers_updated_dt = ( - affects_trackers_updated_dt.isoformat() - if affects_trackers_updated_dt - else None - ) + json_affects_trackers_updated_dt = affects_trackers_updated_dt.isoformat() - json_affects_trackers_updated_dt_date: Union[Unset, None, str] = UNSET + params["affects__trackers__updated_dt"] = json_affects_trackers_updated_dt + + json_affects_trackers_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_trackers_updated_dt_date, Unset): - json_affects_trackers_updated_dt_date = ( - affects_trackers_updated_dt_date.isoformat() - if affects_trackers_updated_dt_date - else None - ) + json_affects_trackers_updated_dt_date = affects_trackers_updated_dt_date.isoformat() + + params["affects__trackers__updated_dt__date"] = json_affects_trackers_updated_dt_date - json_affects_trackers_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_affects_trackers_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_updated_dt_date_gte, Unset): - json_affects_trackers_updated_dt_date_gte = ( - affects_trackers_updated_dt_date_gte.isoformat() - if affects_trackers_updated_dt_date_gte - else None - ) + json_affects_trackers_updated_dt_date_gte = affects_trackers_updated_dt_date_gte.isoformat() + + params["affects__trackers__updated_dt__date__gte"] = json_affects_trackers_updated_dt_date_gte - json_affects_trackers_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_affects_trackers_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_updated_dt_date_lte, Unset): - json_affects_trackers_updated_dt_date_lte = ( - affects_trackers_updated_dt_date_lte.isoformat() - if affects_trackers_updated_dt_date_lte - else None - ) + json_affects_trackers_updated_dt_date_lte = affects_trackers_updated_dt_date_lte.isoformat() + + params["affects__trackers__updated_dt__date__lte"] = json_affects_trackers_updated_dt_date_lte - json_affects_trackers_updated_dt_gt: Union[Unset, None, str] = UNSET + json_affects_trackers_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_updated_dt_gt, Unset): - json_affects_trackers_updated_dt_gt = ( - affects_trackers_updated_dt_gt.isoformat() - if affects_trackers_updated_dt_gt - else None - ) + json_affects_trackers_updated_dt_gt = affects_trackers_updated_dt_gt.isoformat() - json_affects_trackers_updated_dt_gte: Union[Unset, None, str] = UNSET + params["affects__trackers__updated_dt__gt"] = json_affects_trackers_updated_dt_gt + + json_affects_trackers_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_updated_dt_gte, Unset): - json_affects_trackers_updated_dt_gte = ( - affects_trackers_updated_dt_gte.isoformat() - if affects_trackers_updated_dt_gte - else None - ) + json_affects_trackers_updated_dt_gte = affects_trackers_updated_dt_gte.isoformat() - json_affects_trackers_updated_dt_lt: Union[Unset, None, str] = UNSET + params["affects__trackers__updated_dt__gte"] = json_affects_trackers_updated_dt_gte + + json_affects_trackers_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_trackers_updated_dt_lt, Unset): - json_affects_trackers_updated_dt_lt = ( - affects_trackers_updated_dt_lt.isoformat() - if affects_trackers_updated_dt_lt - else None - ) + json_affects_trackers_updated_dt_lt = affects_trackers_updated_dt_lt.isoformat() + + params["affects__trackers__updated_dt__lt"] = json_affects_trackers_updated_dt_lt - json_affects_trackers_updated_dt_lte: Union[Unset, None, str] = UNSET + json_affects_trackers_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_trackers_updated_dt_lte, Unset): - json_affects_trackers_updated_dt_lte = ( - affects_trackers_updated_dt_lte.isoformat() - if affects_trackers_updated_dt_lte - else None - ) + json_affects_trackers_updated_dt_lte = affects_trackers_updated_dt_lte.isoformat() + + params["affects__trackers__updated_dt__lte"] = json_affects_trackers_updated_dt_lte - json_affects_updated_dt: Union[Unset, None, str] = UNSET + json_affects_trackers_uuid: Union[Unset, str] = UNSET + if not isinstance(affects_trackers_uuid, Unset): + json_affects_trackers_uuid = str(affects_trackers_uuid) + + params["affects__trackers__uuid"] = json_affects_trackers_uuid + + json_affects_updated_dt: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt, Unset): - json_affects_updated_dt = ( - affects_updated_dt.isoformat() if affects_updated_dt else None - ) + json_affects_updated_dt = affects_updated_dt.isoformat() - json_affects_updated_dt_date: Union[Unset, None, str] = UNSET + params["affects__updated_dt"] = json_affects_updated_dt + + json_affects_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_date, Unset): - json_affects_updated_dt_date = ( - affects_updated_dt_date.isoformat() if affects_updated_dt_date else None - ) + json_affects_updated_dt_date = affects_updated_dt_date.isoformat() - json_affects_updated_dt_date_gte: Union[Unset, None, str] = UNSET + params["affects__updated_dt__date"] = json_affects_updated_dt_date + + json_affects_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_date_gte, Unset): - json_affects_updated_dt_date_gte = ( - affects_updated_dt_date_gte.isoformat() - if affects_updated_dt_date_gte - else None - ) + json_affects_updated_dt_date_gte = affects_updated_dt_date_gte.isoformat() + + params["affects__updated_dt__date__gte"] = json_affects_updated_dt_date_gte - json_affects_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_affects_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_date_lte, Unset): - json_affects_updated_dt_date_lte = ( - affects_updated_dt_date_lte.isoformat() - if affects_updated_dt_date_lte - else None - ) + json_affects_updated_dt_date_lte = affects_updated_dt_date_lte.isoformat() + + params["affects__updated_dt__date__lte"] = json_affects_updated_dt_date_lte - json_affects_updated_dt_gt: Union[Unset, None, str] = UNSET + json_affects_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_gt, Unset): - json_affects_updated_dt_gt = ( - affects_updated_dt_gt.isoformat() if affects_updated_dt_gt else None - ) + json_affects_updated_dt_gt = affects_updated_dt_gt.isoformat() + + params["affects__updated_dt__gt"] = json_affects_updated_dt_gt - json_affects_updated_dt_gte: Union[Unset, None, str] = UNSET + json_affects_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_gte, Unset): - json_affects_updated_dt_gte = ( - affects_updated_dt_gte.isoformat() if affects_updated_dt_gte else None - ) + json_affects_updated_dt_gte = affects_updated_dt_gte.isoformat() - json_affects_updated_dt_lt: Union[Unset, None, str] = UNSET + params["affects__updated_dt__gte"] = json_affects_updated_dt_gte + + json_affects_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_lt, Unset): - json_affects_updated_dt_lt = ( - affects_updated_dt_lt.isoformat() if affects_updated_dt_lt else None - ) + json_affects_updated_dt_lt = affects_updated_dt_lt.isoformat() - json_affects_updated_dt_lte: Union[Unset, None, str] = UNSET + params["affects__updated_dt__lt"] = json_affects_updated_dt_lt + + json_affects_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_lte, Unset): - json_affects_updated_dt_lte = ( - affects_updated_dt_lte.isoformat() if affects_updated_dt_lte else None - ) + json_affects_updated_dt_lte = affects_updated_dt_lte.isoformat() + + params["affects__updated_dt__lte"] = json_affects_updated_dt_lte + + json_affects_uuid: Union[Unset, str] = UNSET + if not isinstance(affects_uuid, Unset): + json_affects_uuid = str(affects_uuid) + + params["affects__uuid"] = json_affects_uuid - json_changed_after: Union[Unset, None, str] = UNSET + params["bz_id"] = bz_id + + json_changed_after: Union[Unset, str] = UNSET if not isinstance(changed_after, Unset): - json_changed_after = changed_after.isoformat() if changed_after else None + json_changed_after = changed_after.isoformat() + + params["changed_after"] = json_changed_after - json_changed_before: Union[Unset, None, str] = UNSET + json_changed_before: Union[Unset, str] = UNSET if not isinstance(changed_before, Unset): - json_changed_before = changed_before.isoformat() if changed_before else None + json_changed_before = changed_before.isoformat() + + params["changed_before"] = json_changed_before - json_components: Union[Unset, None, List[str]] = UNSET + params["comment_zero"] = comment_zero + + json_components: Union[Unset, list[str]] = UNSET if not isinstance(components, Unset): - if components is None: - json_components = None - else: - json_components = components + json_components = components - json_created_dt: Union[Unset, None, str] = UNSET + params["components"] = json_components + + json_created_dt: Union[Unset, str] = UNSET if not isinstance(created_dt, Unset): - json_created_dt = created_dt.isoformat() if created_dt else None + json_created_dt = created_dt.isoformat() + + params["created_dt"] = json_created_dt - json_created_dt_date: Union[Unset, None, str] = UNSET + json_created_dt_date: Union[Unset, str] = UNSET if not isinstance(created_dt_date, Unset): - json_created_dt_date = created_dt_date.isoformat() if created_dt_date else None + json_created_dt_date = created_dt_date.isoformat() + + params["created_dt__date"] = json_created_dt_date - json_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_gte, Unset): - json_created_dt_date_gte = ( - created_dt_date_gte.isoformat() if created_dt_date_gte else None - ) + json_created_dt_date_gte = created_dt_date_gte.isoformat() + + params["created_dt__date__gte"] = json_created_dt_date_gte - json_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_lte, Unset): - json_created_dt_date_lte = ( - created_dt_date_lte.isoformat() if created_dt_date_lte else None - ) + json_created_dt_date_lte = created_dt_date_lte.isoformat() + + params["created_dt__date__lte"] = json_created_dt_date_lte - json_created_dt_gt: Union[Unset, None, str] = UNSET + json_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(created_dt_gt, Unset): - json_created_dt_gt = created_dt_gt.isoformat() if created_dt_gt else None + json_created_dt_gt = created_dt_gt.isoformat() + + params["created_dt__gt"] = json_created_dt_gt - json_created_dt_gte: Union[Unset, None, str] = UNSET + json_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_gte, Unset): - json_created_dt_gte = created_dt_gte.isoformat() if created_dt_gte else None + json_created_dt_gte = created_dt_gte.isoformat() - json_created_dt_lt: Union[Unset, None, str] = UNSET + params["created_dt__gte"] = json_created_dt_gte + + json_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(created_dt_lt, Unset): - json_created_dt_lt = created_dt_lt.isoformat() if created_dt_lt else None + json_created_dt_lt = created_dt_lt.isoformat() + + params["created_dt__lt"] = json_created_dt_lt - json_created_dt_lte: Union[Unset, None, str] = UNSET + json_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_lte, Unset): - json_created_dt_lte = created_dt_lte.isoformat() if created_dt_lte else None + json_created_dt_lte = created_dt_lte.isoformat() - json_cve_id: Union[Unset, None, List[str]] = UNSET + params["created_dt__lte"] = json_created_dt_lte + + params["cve_description"] = cve_description + + params["cve_description__isempty"] = cve_description_isempty + + json_cve_id: Union[Unset, list[str]] = UNSET if not isinstance(cve_id, Unset): - if cve_id is None: - json_cve_id = None - else: - json_cve_id = cve_id + json_cve_id = cve_id - json_cvss_scores_created_dt: Union[Unset, None, str] = UNSET + params["cve_id"] = json_cve_id + + params["cve_id__isempty"] = cve_id_isempty + + params["cvss2_nist__isempty"] = cvss2_nist_isempty + + params["cvss2_rh__isempty"] = cvss2_rh_isempty + + params["cvss3_nist__isempty"] = cvss3_nist_isempty + + params["cvss3_rh__isempty"] = cvss3_rh_isempty + + params["cvss4_nist__isempty"] = cvss4_nist_isempty + + params["cvss4_rh__isempty"] = cvss4_rh_isempty + + params["cvss_scores__comment"] = cvss_scores_comment + + json_cvss_scores_created_dt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt, Unset): - json_cvss_scores_created_dt = ( - cvss_scores_created_dt.isoformat() if cvss_scores_created_dt else None - ) + json_cvss_scores_created_dt = cvss_scores_created_dt.isoformat() - json_cvss_scores_created_dt_date: Union[Unset, None, str] = UNSET + params["cvss_scores__created_dt"] = json_cvss_scores_created_dt + + json_cvss_scores_created_dt_date: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_date, Unset): - json_cvss_scores_created_dt_date = ( - cvss_scores_created_dt_date.isoformat() - if cvss_scores_created_dt_date - else None - ) + json_cvss_scores_created_dt_date = cvss_scores_created_dt_date.isoformat() + + params["cvss_scores__created_dt__date"] = json_cvss_scores_created_dt_date - json_cvss_scores_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_date_gte, Unset): - json_cvss_scores_created_dt_date_gte = ( - cvss_scores_created_dt_date_gte.isoformat() - if cvss_scores_created_dt_date_gte - else None - ) + json_cvss_scores_created_dt_date_gte = cvss_scores_created_dt_date_gte.isoformat() + + params["cvss_scores__created_dt__date__gte"] = json_cvss_scores_created_dt_date_gte - json_cvss_scores_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_date_lte, Unset): - json_cvss_scores_created_dt_date_lte = ( - cvss_scores_created_dt_date_lte.isoformat() - if cvss_scores_created_dt_date_lte - else None - ) + json_cvss_scores_created_dt_date_lte = cvss_scores_created_dt_date_lte.isoformat() + + params["cvss_scores__created_dt__date__lte"] = json_cvss_scores_created_dt_date_lte - json_cvss_scores_created_dt_gt: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_gt, Unset): - json_cvss_scores_created_dt_gt = ( - cvss_scores_created_dt_gt.isoformat() if cvss_scores_created_dt_gt else None - ) + json_cvss_scores_created_dt_gt = cvss_scores_created_dt_gt.isoformat() - json_cvss_scores_created_dt_gte: Union[Unset, None, str] = UNSET + params["cvss_scores__created_dt__gt"] = json_cvss_scores_created_dt_gt + + json_cvss_scores_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_gte, Unset): - json_cvss_scores_created_dt_gte = ( - cvss_scores_created_dt_gte.isoformat() - if cvss_scores_created_dt_gte - else None - ) + json_cvss_scores_created_dt_gte = cvss_scores_created_dt_gte.isoformat() - json_cvss_scores_created_dt_lt: Union[Unset, None, str] = UNSET + params["cvss_scores__created_dt__gte"] = json_cvss_scores_created_dt_gte + + json_cvss_scores_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_lt, Unset): - json_cvss_scores_created_dt_lt = ( - cvss_scores_created_dt_lt.isoformat() if cvss_scores_created_dt_lt else None - ) + json_cvss_scores_created_dt_lt = cvss_scores_created_dt_lt.isoformat() + + params["cvss_scores__created_dt__lt"] = json_cvss_scores_created_dt_lt - json_cvss_scores_created_dt_lte: Union[Unset, None, str] = UNSET + json_cvss_scores_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_created_dt_lte, Unset): - json_cvss_scores_created_dt_lte = ( - cvss_scores_created_dt_lte.isoformat() - if cvss_scores_created_dt_lte - else None - ) + json_cvss_scores_created_dt_lte = cvss_scores_created_dt_lte.isoformat() + + params["cvss_scores__created_dt__lte"] = json_cvss_scores_created_dt_lte - json_cvss_scores_issuer: Union[Unset, None, str] = UNSET + params["cvss_scores__cvss_version"] = cvss_scores_cvss_version + + print(OsidbApiV1FlawsListCvssScoresIssuer) + json_cvss_scores_issuer: Union[Unset, str] = UNSET if not isinstance(cvss_scores_issuer, Unset): + json_cvss_scores_issuer = cvss_scores_issuer.value - json_cvss_scores_issuer = ( - OsidbApiV1FlawsListCvssScoresIssuer(cvss_scores_issuer).value - if cvss_scores_issuer - else None - ) + params["cvss_scores__issuer"] = json_cvss_scores_issuer + + params["cvss_scores__score"] = cvss_scores_score - json_cvss_scores_updated_dt: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt, Unset): - json_cvss_scores_updated_dt = ( - cvss_scores_updated_dt.isoformat() if cvss_scores_updated_dt else None - ) + json_cvss_scores_updated_dt = cvss_scores_updated_dt.isoformat() + + params["cvss_scores__updated_dt"] = json_cvss_scores_updated_dt - json_cvss_scores_updated_dt_date: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_date, Unset): - json_cvss_scores_updated_dt_date = ( - cvss_scores_updated_dt_date.isoformat() - if cvss_scores_updated_dt_date - else None - ) + json_cvss_scores_updated_dt_date = cvss_scores_updated_dt_date.isoformat() + + params["cvss_scores__updated_dt__date"] = json_cvss_scores_updated_dt_date - json_cvss_scores_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_date_gte, Unset): - json_cvss_scores_updated_dt_date_gte = ( - cvss_scores_updated_dt_date_gte.isoformat() - if cvss_scores_updated_dt_date_gte - else None - ) + json_cvss_scores_updated_dt_date_gte = cvss_scores_updated_dt_date_gte.isoformat() - json_cvss_scores_updated_dt_date_lte: Union[Unset, None, str] = UNSET + params["cvss_scores__updated_dt__date__gte"] = json_cvss_scores_updated_dt_date_gte + + json_cvss_scores_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_date_lte, Unset): - json_cvss_scores_updated_dt_date_lte = ( - cvss_scores_updated_dt_date_lte.isoformat() - if cvss_scores_updated_dt_date_lte - else None - ) + json_cvss_scores_updated_dt_date_lte = cvss_scores_updated_dt_date_lte.isoformat() - json_cvss_scores_updated_dt_gt: Union[Unset, None, str] = UNSET + params["cvss_scores__updated_dt__date__lte"] = json_cvss_scores_updated_dt_date_lte + + json_cvss_scores_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_gt, Unset): - json_cvss_scores_updated_dt_gt = ( - cvss_scores_updated_dt_gt.isoformat() if cvss_scores_updated_dt_gt else None - ) + json_cvss_scores_updated_dt_gt = cvss_scores_updated_dt_gt.isoformat() + + params["cvss_scores__updated_dt__gt"] = json_cvss_scores_updated_dt_gt - json_cvss_scores_updated_dt_gte: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_gte, Unset): - json_cvss_scores_updated_dt_gte = ( - cvss_scores_updated_dt_gte.isoformat() - if cvss_scores_updated_dt_gte - else None - ) + json_cvss_scores_updated_dt_gte = cvss_scores_updated_dt_gte.isoformat() + + params["cvss_scores__updated_dt__gte"] = json_cvss_scores_updated_dt_gte - json_cvss_scores_updated_dt_lt: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_lt, Unset): - json_cvss_scores_updated_dt_lt = ( - cvss_scores_updated_dt_lt.isoformat() if cvss_scores_updated_dt_lt else None - ) + json_cvss_scores_updated_dt_lt = cvss_scores_updated_dt_lt.isoformat() + + params["cvss_scores__updated_dt__lt"] = json_cvss_scores_updated_dt_lt - json_cvss_scores_updated_dt_lte: Union[Unset, None, str] = UNSET + json_cvss_scores_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(cvss_scores_updated_dt_lte, Unset): - json_cvss_scores_updated_dt_lte = ( - cvss_scores_updated_dt_lte.isoformat() - if cvss_scores_updated_dt_lte - else None - ) + json_cvss_scores_updated_dt_lte = cvss_scores_updated_dt_lte.isoformat() + + params["cvss_scores__updated_dt__lte"] = json_cvss_scores_updated_dt_lte + + json_cvss_scores_uuid: Union[Unset, str] = UNSET + if not isinstance(cvss_scores_uuid, Unset): + json_cvss_scores_uuid = str(cvss_scores_uuid) + + params["cvss_scores__uuid"] = json_cvss_scores_uuid + + params["cvss_scores__vector"] = cvss_scores_vector + + params["cwe_id"] = cwe_id + + params["cwe_id__isempty"] = cwe_id_isempty + + params["embargoed"] = embargoed - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_impact: Union[Unset, None, str] = UNSET + print(OsidbApiV1FlawsListImpact) + json_impact: Union[Unset, str] = UNSET if not isinstance(impact, Unset): + json_impact = impact.value - json_impact = OsidbApiV1FlawsListImpact(impact).value if impact else None + params["impact"] = json_impact - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields - json_include_meta_attr: Union[Unset, None, List[str]] = UNSET + params["include_fields"] = json_include_fields + + json_include_meta_attr: Union[Unset, list[str]] = UNSET if not isinstance(include_meta_attr, Unset): - if include_meta_attr is None: - json_include_meta_attr = None - else: - json_include_meta_attr = include_meta_attr + json_include_meta_attr = include_meta_attr - json_major_incident_start_dt: Union[Unset, None, str] = UNSET + params["include_meta_attr"] = json_include_meta_attr + + params["limit"] = limit + + json_major_incident_start_dt: Union[Unset, str] = UNSET if not isinstance(major_incident_start_dt, Unset): - json_major_incident_start_dt = ( - major_incident_start_dt.isoformat() if major_incident_start_dt else None - ) + json_major_incident_start_dt = major_incident_start_dt.isoformat() - json_major_incident_start_dt_date: Union[Unset, None, str] = UNSET + params["major_incident_start_dt"] = json_major_incident_start_dt + + json_major_incident_start_dt_date: Union[Unset, str] = UNSET if not isinstance(major_incident_start_dt_date, Unset): - json_major_incident_start_dt_date = ( - major_incident_start_dt_date.isoformat() - if major_incident_start_dt_date - else None - ) + json_major_incident_start_dt_date = major_incident_start_dt_date.isoformat() - json_major_incident_start_dt_date_gte: Union[Unset, None, str] = UNSET + params["major_incident_start_dt__date"] = json_major_incident_start_dt_date + + json_major_incident_start_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(major_incident_start_dt_date_gte, Unset): - json_major_incident_start_dt_date_gte = ( - major_incident_start_dt_date_gte.isoformat() - if major_incident_start_dt_date_gte - else None - ) + json_major_incident_start_dt_date_gte = major_incident_start_dt_date_gte.isoformat() + + params["major_incident_start_dt__date__gte"] = json_major_incident_start_dt_date_gte - json_major_incident_start_dt_date_lte: Union[Unset, None, str] = UNSET + json_major_incident_start_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(major_incident_start_dt_date_lte, Unset): - json_major_incident_start_dt_date_lte = ( - major_incident_start_dt_date_lte.isoformat() - if major_incident_start_dt_date_lte - else None - ) + json_major_incident_start_dt_date_lte = major_incident_start_dt_date_lte.isoformat() + + params["major_incident_start_dt__date__lte"] = json_major_incident_start_dt_date_lte - json_major_incident_start_dt_gt: Union[Unset, None, str] = UNSET + json_major_incident_start_dt_gt: Union[Unset, str] = UNSET if not isinstance(major_incident_start_dt_gt, Unset): - json_major_incident_start_dt_gt = ( - major_incident_start_dt_gt.isoformat() - if major_incident_start_dt_gt - else None - ) + json_major_incident_start_dt_gt = major_incident_start_dt_gt.isoformat() + + params["major_incident_start_dt__gt"] = json_major_incident_start_dt_gt - json_major_incident_start_dt_gte: Union[Unset, None, str] = UNSET + json_major_incident_start_dt_gte: Union[Unset, str] = UNSET if not isinstance(major_incident_start_dt_gte, Unset): - json_major_incident_start_dt_gte = ( - major_incident_start_dt_gte.isoformat() - if major_incident_start_dt_gte - else None - ) + json_major_incident_start_dt_gte = major_incident_start_dt_gte.isoformat() - json_major_incident_start_dt_lt: Union[Unset, None, str] = UNSET + params["major_incident_start_dt__gte"] = json_major_incident_start_dt_gte + + json_major_incident_start_dt_lt: Union[Unset, str] = UNSET if not isinstance(major_incident_start_dt_lt, Unset): - json_major_incident_start_dt_lt = ( - major_incident_start_dt_lt.isoformat() - if major_incident_start_dt_lt - else None - ) + json_major_incident_start_dt_lt = major_incident_start_dt_lt.isoformat() - json_major_incident_start_dt_lte: Union[Unset, None, str] = UNSET + params["major_incident_start_dt__lt"] = json_major_incident_start_dt_lt + + json_major_incident_start_dt_lte: Union[Unset, str] = UNSET if not isinstance(major_incident_start_dt_lte, Unset): - json_major_incident_start_dt_lte = ( - major_incident_start_dt_lte.isoformat() - if major_incident_start_dt_lte - else None - ) + json_major_incident_start_dt_lte = major_incident_start_dt_lte.isoformat() + + params["major_incident_start_dt__lte"] = json_major_incident_start_dt_lte - json_major_incident_state: Union[Unset, None, str] = UNSET + print(OsidbApiV1FlawsListMajorIncidentState) + json_major_incident_state: Union[Unset, str] = UNSET if not isinstance(major_incident_state, Unset): + json_major_incident_state = major_incident_state.value - json_major_incident_state = ( - OsidbApiV1FlawsListMajorIncidentState(major_incident_state).value - if major_incident_state - else None - ) + params["major_incident_state"] = json_major_incident_state + + params["mitigation__isempty"] = mitigation_isempty - json_nist_cvss_validation: Union[Unset, None, str] = UNSET + print(OsidbApiV1FlawsListNistCvssValidation) + json_nist_cvss_validation: Union[Unset, str] = UNSET if not isinstance(nist_cvss_validation, Unset): + json_nist_cvss_validation = nist_cvss_validation.value - json_nist_cvss_validation = ( - OsidbApiV1FlawsListNistCvssValidation(nist_cvss_validation).value - if nist_cvss_validation - else None - ) + params["nist_cvss_validation"] = json_nist_cvss_validation + + params["offset"] = offset - json_order: Union[Unset, None, List[str]] = UNSET + json_order: Union[Unset, list[str]] = UNSET if not isinstance(order, Unset): - if order is None: - json_order = None - else: - json_order = [] - for order_item_data in order: - order_item: str = UNSET - if not isinstance(order_item_data, Unset): + json_order = [] + for order_item_data in order: + print(OsidbApiV1FlawsListOrderItem) + order_item: str = UNSET + if not isinstance(order_item_data, Unset): + order_item = order_item_data.value + + json_order.append(order_item) + + params["order"] = json_order - order_item = OsidbApiV1FlawsListOrderItem(order_item_data).value + params["owner"] = owner - json_order.append(order_item) + params["owner__isempty"] = owner_isempty - json_references_created_dt: Union[Unset, None, str] = UNSET + params["query"] = query + + json_references_created_dt: Union[Unset, str] = UNSET if not isinstance(references_created_dt, Unset): - json_references_created_dt = ( - references_created_dt.isoformat() if references_created_dt else None - ) + json_references_created_dt = references_created_dt.isoformat() + + params["references__created_dt"] = json_references_created_dt - json_references_created_dt_date: Union[Unset, None, str] = UNSET + json_references_created_dt_date: Union[Unset, str] = UNSET if not isinstance(references_created_dt_date, Unset): - json_references_created_dt_date = ( - references_created_dt_date.isoformat() - if references_created_dt_date - else None - ) + json_references_created_dt_date = references_created_dt_date.isoformat() + + params["references__created_dt__date"] = json_references_created_dt_date - json_references_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_references_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(references_created_dt_date_gte, Unset): - json_references_created_dt_date_gte = ( - references_created_dt_date_gte.isoformat() - if references_created_dt_date_gte - else None - ) + json_references_created_dt_date_gte = references_created_dt_date_gte.isoformat() + + params["references__created_dt__date__gte"] = json_references_created_dt_date_gte - json_references_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_references_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(references_created_dt_date_lte, Unset): - json_references_created_dt_date_lte = ( - references_created_dt_date_lte.isoformat() - if references_created_dt_date_lte - else None - ) + json_references_created_dt_date_lte = references_created_dt_date_lte.isoformat() - json_references_created_dt_gt: Union[Unset, None, str] = UNSET + params["references__created_dt__date__lte"] = json_references_created_dt_date_lte + + json_references_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(references_created_dt_gt, Unset): - json_references_created_dt_gt = ( - references_created_dt_gt.isoformat() if references_created_dt_gt else None - ) + json_references_created_dt_gt = references_created_dt_gt.isoformat() - json_references_created_dt_gte: Union[Unset, None, str] = UNSET + params["references__created_dt__gt"] = json_references_created_dt_gt + + json_references_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(references_created_dt_gte, Unset): - json_references_created_dt_gte = ( - references_created_dt_gte.isoformat() if references_created_dt_gte else None - ) + json_references_created_dt_gte = references_created_dt_gte.isoformat() + + params["references__created_dt__gte"] = json_references_created_dt_gte - json_references_created_dt_lt: Union[Unset, None, str] = UNSET + json_references_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(references_created_dt_lt, Unset): - json_references_created_dt_lt = ( - references_created_dt_lt.isoformat() if references_created_dt_lt else None - ) + json_references_created_dt_lt = references_created_dt_lt.isoformat() + + params["references__created_dt__lt"] = json_references_created_dt_lt - json_references_created_dt_lte: Union[Unset, None, str] = UNSET + json_references_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(references_created_dt_lte, Unset): - json_references_created_dt_lte = ( - references_created_dt_lte.isoformat() if references_created_dt_lte else None - ) + json_references_created_dt_lte = references_created_dt_lte.isoformat() + + params["references__created_dt__lte"] = json_references_created_dt_lte + + params["references__description"] = references_description - json_references_type: Union[Unset, None, str] = UNSET + print(OsidbApiV1FlawsListReferencesType) + json_references_type: Union[Unset, str] = UNSET if not isinstance(references_type, Unset): + json_references_type = references_type.value - json_references_type = ( - OsidbApiV1FlawsListReferencesType(references_type).value - if references_type - else None - ) + params["references__type"] = json_references_type - json_references_updated_dt: Union[Unset, None, str] = UNSET + json_references_updated_dt: Union[Unset, str] = UNSET if not isinstance(references_updated_dt, Unset): - json_references_updated_dt = ( - references_updated_dt.isoformat() if references_updated_dt else None - ) + json_references_updated_dt = references_updated_dt.isoformat() - json_references_updated_dt_date: Union[Unset, None, str] = UNSET + params["references__updated_dt"] = json_references_updated_dt + + json_references_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(references_updated_dt_date, Unset): - json_references_updated_dt_date = ( - references_updated_dt_date.isoformat() - if references_updated_dt_date - else None - ) + json_references_updated_dt_date = references_updated_dt_date.isoformat() + + params["references__updated_dt__date"] = json_references_updated_dt_date - json_references_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_references_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(references_updated_dt_date_gte, Unset): - json_references_updated_dt_date_gte = ( - references_updated_dt_date_gte.isoformat() - if references_updated_dt_date_gte - else None - ) + json_references_updated_dt_date_gte = references_updated_dt_date_gte.isoformat() + + params["references__updated_dt__date__gte"] = json_references_updated_dt_date_gte - json_references_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_references_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(references_updated_dt_date_lte, Unset): - json_references_updated_dt_date_lte = ( - references_updated_dt_date_lte.isoformat() - if references_updated_dt_date_lte - else None - ) + json_references_updated_dt_date_lte = references_updated_dt_date_lte.isoformat() + + params["references__updated_dt__date__lte"] = json_references_updated_dt_date_lte - json_references_updated_dt_gt: Union[Unset, None, str] = UNSET + json_references_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(references_updated_dt_gt, Unset): - json_references_updated_dt_gt = ( - references_updated_dt_gt.isoformat() if references_updated_dt_gt else None - ) + json_references_updated_dt_gt = references_updated_dt_gt.isoformat() - json_references_updated_dt_gte: Union[Unset, None, str] = UNSET + params["references__updated_dt__gt"] = json_references_updated_dt_gt + + json_references_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(references_updated_dt_gte, Unset): - json_references_updated_dt_gte = ( - references_updated_dt_gte.isoformat() if references_updated_dt_gte else None - ) + json_references_updated_dt_gte = references_updated_dt_gte.isoformat() - json_references_updated_dt_lt: Union[Unset, None, str] = UNSET + params["references__updated_dt__gte"] = json_references_updated_dt_gte + + json_references_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(references_updated_dt_lt, Unset): - json_references_updated_dt_lt = ( - references_updated_dt_lt.isoformat() if references_updated_dt_lt else None - ) + json_references_updated_dt_lt = references_updated_dt_lt.isoformat() + + params["references__updated_dt__lt"] = json_references_updated_dt_lt - json_references_updated_dt_lte: Union[Unset, None, str] = UNSET + json_references_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(references_updated_dt_lte, Unset): - json_references_updated_dt_lte = ( - references_updated_dt_lte.isoformat() if references_updated_dt_lte else None - ) + json_references_updated_dt_lte = references_updated_dt_lte.isoformat() + + params["references__updated_dt__lte"] = json_references_updated_dt_lte - json_reported_dt: Union[Unset, None, str] = UNSET + params["references__url"] = references_url + + json_references_uuid: Union[Unset, str] = UNSET + if not isinstance(references_uuid, Unset): + json_references_uuid = str(references_uuid) + + params["references__uuid"] = json_references_uuid + + json_reported_dt: Union[Unset, str] = UNSET if not isinstance(reported_dt, Unset): - json_reported_dt = reported_dt.isoformat() if reported_dt else None + json_reported_dt = reported_dt.isoformat() - json_reported_dt_date: Union[Unset, None, str] = UNSET + params["reported_dt"] = json_reported_dt + + json_reported_dt_date: Union[Unset, str] = UNSET if not isinstance(reported_dt_date, Unset): - json_reported_dt_date = ( - reported_dt_date.isoformat() if reported_dt_date else None - ) + json_reported_dt_date = reported_dt_date.isoformat() - json_reported_dt_date_gte: Union[Unset, None, str] = UNSET + params["reported_dt__date"] = json_reported_dt_date + + json_reported_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(reported_dt_date_gte, Unset): - json_reported_dt_date_gte = ( - reported_dt_date_gte.isoformat() if reported_dt_date_gte else None - ) + json_reported_dt_date_gte = reported_dt_date_gte.isoformat() + + params["reported_dt__date__gte"] = json_reported_dt_date_gte - json_reported_dt_date_lte: Union[Unset, None, str] = UNSET + json_reported_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(reported_dt_date_lte, Unset): - json_reported_dt_date_lte = ( - reported_dt_date_lte.isoformat() if reported_dt_date_lte else None - ) + json_reported_dt_date_lte = reported_dt_date_lte.isoformat() + + params["reported_dt__date__lte"] = json_reported_dt_date_lte - json_reported_dt_gt: Union[Unset, None, str] = UNSET + json_reported_dt_gt: Union[Unset, str] = UNSET if not isinstance(reported_dt_gt, Unset): - json_reported_dt_gt = reported_dt_gt.isoformat() if reported_dt_gt else None + json_reported_dt_gt = reported_dt_gt.isoformat() - json_reported_dt_gte: Union[Unset, None, str] = UNSET + params["reported_dt__gt"] = json_reported_dt_gt + + json_reported_dt_gte: Union[Unset, str] = UNSET if not isinstance(reported_dt_gte, Unset): - json_reported_dt_gte = reported_dt_gte.isoformat() if reported_dt_gte else None + json_reported_dt_gte = reported_dt_gte.isoformat() + + params["reported_dt__gte"] = json_reported_dt_gte - json_reported_dt_lt: Union[Unset, None, str] = UNSET + json_reported_dt_lt: Union[Unset, str] = UNSET if not isinstance(reported_dt_lt, Unset): - json_reported_dt_lt = reported_dt_lt.isoformat() if reported_dt_lt else None + json_reported_dt_lt = reported_dt_lt.isoformat() + + params["reported_dt__lt"] = json_reported_dt_lt - json_reported_dt_lte: Union[Unset, None, str] = UNSET + json_reported_dt_lte: Union[Unset, str] = UNSET if not isinstance(reported_dt_lte, Unset): - json_reported_dt_lte = reported_dt_lte.isoformat() if reported_dt_lte else None + json_reported_dt_lte = reported_dt_lte.isoformat() - json_requires_cve_description: Union[Unset, None, str] = UNSET + params["reported_dt__lte"] = json_reported_dt_lte + + print(OsidbApiV1FlawsListRequiresCveDescription) + json_requires_cve_description: Union[Unset, str] = UNSET if not isinstance(requires_cve_description, Unset): + json_requires_cve_description = requires_cve_description.value - json_requires_cve_description = ( - OsidbApiV1FlawsListRequiresCveDescription(requires_cve_description).value - if requires_cve_description - else None - ) + params["requires_cve_description"] = json_requires_cve_description - json_source: Union[Unset, None, str] = UNSET + params["search"] = search + + print(OsidbApiV1FlawsListSource) + json_source: Union[Unset, str] = UNSET if not isinstance(source, Unset): + json_source = source.value + + params["source"] = json_source + + params["statement"] = statement + + params["statement__isempty"] = statement_isempty + + params["team_id"] = team_id - json_source = OsidbApiV1FlawsListSource(source).value if source else None + params["title"] = title - json_tracker_ids: Union[Unset, None, List[str]] = UNSET + json_tracker_ids: Union[Unset, list[str]] = UNSET if not isinstance(tracker_ids, Unset): - if tracker_ids is None: - json_tracker_ids = None - else: - json_tracker_ids = tracker_ids + json_tracker_ids = tracker_ids + + params["tracker_ids"] = json_tracker_ids - json_unembargo_dt: Union[Unset, None, str] = UNSET + json_unembargo_dt: Union[Unset, str] = UNSET if not isinstance(unembargo_dt, Unset): - json_unembargo_dt = unembargo_dt.isoformat() if unembargo_dt else None + json_unembargo_dt = unembargo_dt.isoformat() + + params["unembargo_dt"] = json_unembargo_dt - json_updated_dt: Union[Unset, None, str] = UNSET + json_updated_dt: Union[Unset, str] = UNSET if not isinstance(updated_dt, Unset): - json_updated_dt = updated_dt.isoformat() if updated_dt else None + json_updated_dt = updated_dt.isoformat() - json_updated_dt_date: Union[Unset, None, str] = UNSET + params["updated_dt"] = json_updated_dt + + json_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(updated_dt_date, Unset): - json_updated_dt_date = updated_dt_date.isoformat() if updated_dt_date else None + json_updated_dt_date = updated_dt_date.isoformat() + + params["updated_dt__date"] = json_updated_dt_date - json_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_gte, Unset): - json_updated_dt_date_gte = ( - updated_dt_date_gte.isoformat() if updated_dt_date_gte else None - ) + json_updated_dt_date_gte = updated_dt_date_gte.isoformat() + + params["updated_dt__date__gte"] = json_updated_dt_date_gte - json_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_lte, Unset): - json_updated_dt_date_lte = ( - updated_dt_date_lte.isoformat() if updated_dt_date_lte else None - ) + json_updated_dt_date_lte = updated_dt_date_lte.isoformat() - json_updated_dt_gt: Union[Unset, None, str] = UNSET + params["updated_dt__date__lte"] = json_updated_dt_date_lte + + json_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(updated_dt_gt, Unset): - json_updated_dt_gt = updated_dt_gt.isoformat() if updated_dt_gt else None + json_updated_dt_gt = updated_dt_gt.isoformat() + + params["updated_dt__gt"] = json_updated_dt_gt - json_updated_dt_gte: Union[Unset, None, str] = UNSET + json_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_gte, Unset): - json_updated_dt_gte = updated_dt_gte.isoformat() if updated_dt_gte else None + json_updated_dt_gte = updated_dt_gte.isoformat() - json_updated_dt_lt: Union[Unset, None, str] = UNSET + params["updated_dt__gte"] = json_updated_dt_gte + + json_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(updated_dt_lt, Unset): - json_updated_dt_lt = updated_dt_lt.isoformat() if updated_dt_lt else None + json_updated_dt_lt = updated_dt_lt.isoformat() + + params["updated_dt__lt"] = json_updated_dt_lt - json_updated_dt_lte: Union[Unset, None, str] = UNSET + json_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_lte, Unset): - json_updated_dt_lte = updated_dt_lte.isoformat() if updated_dt_lte else None + json_updated_dt_lte = updated_dt_lte.isoformat() + + params["updated_dt__lte"] = json_updated_dt_lte + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid - json_workflow_state: Union[Unset, None, List[str]] = UNSET + json_workflow_state: Union[Unset, list[str]] = UNSET if not isinstance(workflow_state, Unset): - if workflow_state is None: - json_workflow_state = None - else: - json_workflow_state = [] - for workflow_state_item_data in workflow_state: - workflow_state_item: str = UNSET - if not isinstance(workflow_state_item_data, Unset): - - workflow_state_item = OsidbApiV1FlawsListWorkflowStateItem( - workflow_state_item_data - ).value - - json_workflow_state.append(workflow_state_item) - - params: Dict[str, Any] = { - "acknowledgments__affiliation": acknowledgments_affiliation, - "acknowledgments__created_dt": json_acknowledgments_created_dt, - "acknowledgments__created_dt__date": json_acknowledgments_created_dt_date, - "acknowledgments__created_dt__date__gte": json_acknowledgments_created_dt_date_gte, - "acknowledgments__created_dt__date__lte": json_acknowledgments_created_dt_date_lte, - "acknowledgments__created_dt__gt": json_acknowledgments_created_dt_gt, - "acknowledgments__created_dt__gte": json_acknowledgments_created_dt_gte, - "acknowledgments__created_dt__lt": json_acknowledgments_created_dt_lt, - "acknowledgments__created_dt__lte": json_acknowledgments_created_dt_lte, - "acknowledgments__from_upstream": acknowledgments_from_upstream, - "acknowledgments__name": acknowledgments_name, - "acknowledgments__updated_dt": json_acknowledgments_updated_dt, - "acknowledgments__updated_dt__date": json_acknowledgments_updated_dt_date, - "acknowledgments__updated_dt__date__gte": json_acknowledgments_updated_dt_date_gte, - "acknowledgments__updated_dt__date__lte": json_acknowledgments_updated_dt_date_lte, - "acknowledgments__updated_dt__gt": json_acknowledgments_updated_dt_gt, - "acknowledgments__updated_dt__gte": json_acknowledgments_updated_dt_gte, - "acknowledgments__updated_dt__lt": json_acknowledgments_updated_dt_lt, - "acknowledgments__updated_dt__lte": json_acknowledgments_updated_dt_lte, - "acknowledgments__uuid": acknowledgments_uuid, - "affects__affectedness": json_affects_affectedness, - "affects__created_dt": json_affects_created_dt, - "affects__created_dt__date": json_affects_created_dt_date, - "affects__created_dt__date__gte": json_affects_created_dt_date_gte, - "affects__created_dt__date__lte": json_affects_created_dt_date_lte, - "affects__created_dt__gt": json_affects_created_dt_gt, - "affects__created_dt__gte": json_affects_created_dt_gte, - "affects__created_dt__lt": json_affects_created_dt_lt, - "affects__created_dt__lte": json_affects_created_dt_lte, - "affects__embargoed": affects_embargoed, - "affects__impact": json_affects_impact, - "affects__ps_component": affects_ps_component, - "affects__ps_module": affects_ps_module, - "affects__resolution": json_affects_resolution, - "affects__trackers__created_dt": json_affects_trackers_created_dt, - "affects__trackers__created_dt__date": json_affects_trackers_created_dt_date, - "affects__trackers__created_dt__date__gte": json_affects_trackers_created_dt_date_gte, - "affects__trackers__created_dt__date__lte": json_affects_trackers_created_dt_date_lte, - "affects__trackers__created_dt__gt": json_affects_trackers_created_dt_gt, - "affects__trackers__created_dt__gte": json_affects_trackers_created_dt_gte, - "affects__trackers__created_dt__lt": json_affects_trackers_created_dt_lt, - "affects__trackers__created_dt__lte": json_affects_trackers_created_dt_lte, - "affects__trackers__embargoed": affects_trackers_embargoed, - "affects__trackers__errata__advisory_name": affects_trackers_errata_advisory_name, - "affects__trackers__errata__et_id": affects_trackers_errata_et_id, - "affects__trackers__errata__shipped_dt": json_affects_trackers_errata_shipped_dt, - "affects__trackers__errata__shipped_dt__date": json_affects_trackers_errata_shipped_dt_date, - "affects__trackers__errata__shipped_dt__date__gte": json_affects_trackers_errata_shipped_dt_date_gte, - "affects__trackers__errata__shipped_dt__date__lte": json_affects_trackers_errata_shipped_dt_date_lte, - "affects__trackers__errata__shipped_dt__gt": json_affects_trackers_errata_shipped_dt_gt, - "affects__trackers__errata__shipped_dt__gte": json_affects_trackers_errata_shipped_dt_gte, - "affects__trackers__errata__shipped_dt__lt": json_affects_trackers_errata_shipped_dt_lt, - "affects__trackers__errata__shipped_dt__lte": json_affects_trackers_errata_shipped_dt_lte, - "affects__trackers__external_system_id": affects_trackers_external_system_id, - "affects__trackers__ps_update_stream": affects_trackers_ps_update_stream, - "affects__trackers__resolution": affects_trackers_resolution, - "affects__trackers__status": affects_trackers_status, - "affects__trackers__type": json_affects_trackers_type, - "affects__trackers__updated_dt": json_affects_trackers_updated_dt, - "affects__trackers__updated_dt__date": json_affects_trackers_updated_dt_date, - "affects__trackers__updated_dt__date__gte": json_affects_trackers_updated_dt_date_gte, - "affects__trackers__updated_dt__date__lte": json_affects_trackers_updated_dt_date_lte, - "affects__trackers__updated_dt__gt": json_affects_trackers_updated_dt_gt, - "affects__trackers__updated_dt__gte": json_affects_trackers_updated_dt_gte, - "affects__trackers__updated_dt__lt": json_affects_trackers_updated_dt_lt, - "affects__trackers__updated_dt__lte": json_affects_trackers_updated_dt_lte, - "affects__trackers__uuid": affects_trackers_uuid, - "affects__updated_dt": json_affects_updated_dt, - "affects__updated_dt__date": json_affects_updated_dt_date, - "affects__updated_dt__date__gte": json_affects_updated_dt_date_gte, - "affects__updated_dt__date__lte": json_affects_updated_dt_date_lte, - "affects__updated_dt__gt": json_affects_updated_dt_gt, - "affects__updated_dt__gte": json_affects_updated_dt_gte, - "affects__updated_dt__lt": json_affects_updated_dt_lt, - "affects__updated_dt__lte": json_affects_updated_dt_lte, - "affects__uuid": affects_uuid, - "bz_id": bz_id, - "changed_after": json_changed_after, - "changed_before": json_changed_before, - "comment_zero": comment_zero, - "components": json_components, - "created_dt": json_created_dt, - "created_dt__date": json_created_dt_date, - "created_dt__date__gte": json_created_dt_date_gte, - "created_dt__date__lte": json_created_dt_date_lte, - "created_dt__gt": json_created_dt_gt, - "created_dt__gte": json_created_dt_gte, - "created_dt__lt": json_created_dt_lt, - "created_dt__lte": json_created_dt_lte, - "cve_description": cve_description, - "cve_description__isempty": cve_description_isempty, - "cve_id": json_cve_id, - "cve_id__isempty": cve_id_isempty, - "cvss2_nist__isempty": cvss2_nist_isempty, - "cvss2_rh__isempty": cvss2_rh_isempty, - "cvss3_nist__isempty": cvss3_nist_isempty, - "cvss3_rh__isempty": cvss3_rh_isempty, - "cvss4_nist__isempty": cvss4_nist_isempty, - "cvss4_rh__isempty": cvss4_rh_isempty, - "cvss_scores__comment": cvss_scores_comment, - "cvss_scores__created_dt": json_cvss_scores_created_dt, - "cvss_scores__created_dt__date": json_cvss_scores_created_dt_date, - "cvss_scores__created_dt__date__gte": json_cvss_scores_created_dt_date_gte, - "cvss_scores__created_dt__date__lte": json_cvss_scores_created_dt_date_lte, - "cvss_scores__created_dt__gt": json_cvss_scores_created_dt_gt, - "cvss_scores__created_dt__gte": json_cvss_scores_created_dt_gte, - "cvss_scores__created_dt__lt": json_cvss_scores_created_dt_lt, - "cvss_scores__created_dt__lte": json_cvss_scores_created_dt_lte, - "cvss_scores__cvss_version": cvss_scores_cvss_version, - "cvss_scores__issuer": json_cvss_scores_issuer, - "cvss_scores__score": cvss_scores_score, - "cvss_scores__updated_dt": json_cvss_scores_updated_dt, - "cvss_scores__updated_dt__date": json_cvss_scores_updated_dt_date, - "cvss_scores__updated_dt__date__gte": json_cvss_scores_updated_dt_date_gte, - "cvss_scores__updated_dt__date__lte": json_cvss_scores_updated_dt_date_lte, - "cvss_scores__updated_dt__gt": json_cvss_scores_updated_dt_gt, - "cvss_scores__updated_dt__gte": json_cvss_scores_updated_dt_gte, - "cvss_scores__updated_dt__lt": json_cvss_scores_updated_dt_lt, - "cvss_scores__updated_dt__lte": json_cvss_scores_updated_dt_lte, - "cvss_scores__uuid": cvss_scores_uuid, - "cvss_scores__vector": cvss_scores_vector, - "cwe_id": cwe_id, - "cwe_id__isempty": cwe_id_isempty, - "embargoed": embargoed, - "exclude_fields": json_exclude_fields, - "impact": json_impact, - "include_fields": json_include_fields, - "include_meta_attr": json_include_meta_attr, - "limit": limit, - "major_incident_start_dt": json_major_incident_start_dt, - "major_incident_start_dt__date": json_major_incident_start_dt_date, - "major_incident_start_dt__date__gte": json_major_incident_start_dt_date_gte, - "major_incident_start_dt__date__lte": json_major_incident_start_dt_date_lte, - "major_incident_start_dt__gt": json_major_incident_start_dt_gt, - "major_incident_start_dt__gte": json_major_incident_start_dt_gte, - "major_incident_start_dt__lt": json_major_incident_start_dt_lt, - "major_incident_start_dt__lte": json_major_incident_start_dt_lte, - "major_incident_state": json_major_incident_state, - "mitigation__isempty": mitigation_isempty, - "nist_cvss_validation": json_nist_cvss_validation, - "offset": offset, - "order": json_order, - "owner": owner, - "owner__isempty": owner_isempty, - "query": query, - "references__created_dt": json_references_created_dt, - "references__created_dt__date": json_references_created_dt_date, - "references__created_dt__date__gte": json_references_created_dt_date_gte, - "references__created_dt__date__lte": json_references_created_dt_date_lte, - "references__created_dt__gt": json_references_created_dt_gt, - "references__created_dt__gte": json_references_created_dt_gte, - "references__created_dt__lt": json_references_created_dt_lt, - "references__created_dt__lte": json_references_created_dt_lte, - "references__description": references_description, - "references__type": json_references_type, - "references__updated_dt": json_references_updated_dt, - "references__updated_dt__date": json_references_updated_dt_date, - "references__updated_dt__date__gte": json_references_updated_dt_date_gte, - "references__updated_dt__date__lte": json_references_updated_dt_date_lte, - "references__updated_dt__gt": json_references_updated_dt_gt, - "references__updated_dt__gte": json_references_updated_dt_gte, - "references__updated_dt__lt": json_references_updated_dt_lt, - "references__updated_dt__lte": json_references_updated_dt_lte, - "references__url": references_url, - "references__uuid": references_uuid, - "reported_dt": json_reported_dt, - "reported_dt__date": json_reported_dt_date, - "reported_dt__date__gte": json_reported_dt_date_gte, - "reported_dt__date__lte": json_reported_dt_date_lte, - "reported_dt__gt": json_reported_dt_gt, - "reported_dt__gte": json_reported_dt_gte, - "reported_dt__lt": json_reported_dt_lt, - "reported_dt__lte": json_reported_dt_lte, - "requires_cve_description": json_requires_cve_description, - "search": search, - "source": json_source, - "statement": statement, - "statement__isempty": statement_isempty, - "team_id": team_id, - "title": title, - "tracker_ids": json_tracker_ids, - "unembargo_dt": json_unembargo_dt, - "updated_dt": json_updated_dt, - "updated_dt__date": json_updated_dt_date, - "updated_dt__date__gte": json_updated_dt_date_gte, - "updated_dt__date__lte": json_updated_dt_date_lte, - "updated_dt__gt": json_updated_dt_gt, - "updated_dt__gte": json_updated_dt_gte, - "updated_dt__lt": json_updated_dt_lt, - "updated_dt__lte": json_updated_dt_lte, - "uuid": uuid, - "workflow_state": json_workflow_state, - } + json_workflow_state = [] + for workflow_state_item_data in workflow_state: + print(OsidbApiV1FlawsListWorkflowStateItem) + workflow_state_item: str = UNSET + if not isinstance(workflow_state_item_data, Unset): + workflow_state_item = workflow_state_item_data.value + + json_workflow_state.append(workflow_state_item) + + params["workflow_state"] = json_workflow_state + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/flaws", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -1676,242 +1247,422 @@ def _parse_response( response_200 = OsidbApiV1FlawsListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - acknowledgments_affiliation: Union[Unset, None, str] = UNSET, - acknowledgments_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_from_upstream: Union[Unset, None, bool] = UNSET, - acknowledgments_name: Union[Unset, None, str] = UNSET, - acknowledgments_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_uuid: Union[Unset, None, str] = UNSET, - affects_affectedness: Union[ - Unset, None, OsidbApiV1FlawsListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1FlawsListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1FlawsListAffectsResolution - ] = UNSET, - affects_trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_embargoed: Union[Unset, None, bool] = UNSET, - affects_trackers_errata_advisory_name: Union[Unset, None, str] = UNSET, - affects_trackers_errata_et_id: Union[Unset, None, int] = UNSET, - affects_trackers_errata_shipped_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_errata_shipped_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_errata_shipped_dt_date_gte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_date_lte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_gt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_gte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_external_system_id: Union[Unset, None, str] = UNSET, - affects_trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - affects_trackers_resolution: Union[Unset, None, str] = UNSET, - affects_trackers_status: Union[Unset, None, str] = UNSET, - affects_trackers_type: Union[ - Unset, None, OsidbApiV1FlawsListAffectsTrackersType - ] = UNSET, - affects_trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_uuid: Union[Unset, None, str] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - bz_id: Union[Unset, None, float] = UNSET, - changed_after: Union[Unset, None, datetime.datetime] = UNSET, - changed_before: Union[Unset, None, datetime.datetime] = UNSET, - comment_zero: Union[Unset, None, str] = UNSET, - components: Union[Unset, None, List[str]] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cve_description: Union[Unset, None, str] = UNSET, - cve_description_isempty: Union[Unset, None, bool] = UNSET, - cve_id: Union[Unset, None, List[str]] = UNSET, - cve_id_isempty: Union[Unset, None, bool] = UNSET, - cvss2_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss2_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss3_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss3_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss4_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss4_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[Unset, None, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - cwe_id: Union[Unset, None, str] = UNSET, - cwe_id_isempty: Union[Unset, None, bool] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - impact: Union[Unset, None, OsidbApiV1FlawsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_date: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_state: Union[ - Unset, None, OsidbApiV1FlawsListMajorIncidentState - ] = UNSET, - mitigation_isempty: Union[Unset, None, bool] = UNSET, - nist_cvss_validation: Union[ - Unset, None, OsidbApiV1FlawsListNistCvssValidation - ] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1FlawsListOrderItem]] = UNSET, - owner: Union[Unset, None, str] = UNSET, - owner_isempty: Union[Unset, None, bool] = UNSET, - query: Union[Unset, None, str] = UNSET, - references_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_description: Union[Unset, None, str] = UNSET, - references_type: Union[Unset, None, OsidbApiV1FlawsListReferencesType] = UNSET, - references_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_url: Union[Unset, None, str] = UNSET, - references_uuid: Union[Unset, None, str] = UNSET, - reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - requires_cve_description: Union[ - Unset, None, OsidbApiV1FlawsListRequiresCveDescription - ] = UNSET, - search: Union[Unset, None, str] = UNSET, - source: Union[Unset, None, OsidbApiV1FlawsListSource] = UNSET, - statement: Union[Unset, None, str] = UNSET, - statement_isempty: Union[Unset, None, bool] = UNSET, - team_id: Union[Unset, None, str] = UNSET, - title: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - workflow_state: Union[ - Unset, None, List[OsidbApiV1FlawsListWorkflowStateItem] - ] = UNSET, + acknowledgments_affiliation: Union[Unset, str] = UNSET, + acknowledgments_created_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_from_upstream: Union[Unset, bool] = UNSET, + acknowledgments_name: Union[Unset, str] = UNSET, + acknowledgments_updated_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_uuid: Union[Unset, UUID] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1FlawsListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_impact: Union[Unset, OsidbApiV1FlawsListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1FlawsListAffectsResolution] = UNSET, + affects_trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_embargoed: Union[Unset, bool] = UNSET, + affects_trackers_errata_advisory_name: Union[Unset, str] = UNSET, + affects_trackers_errata_et_id: Union[Unset, int] = UNSET, + affects_trackers_errata_shipped_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_external_system_id: Union[Unset, str] = UNSET, + affects_trackers_ps_update_stream: Union[Unset, str] = UNSET, + affects_trackers_resolution: Union[Unset, str] = UNSET, + affects_trackers_status: Union[Unset, str] = UNSET, + affects_trackers_type: Union[Unset, OsidbApiV1FlawsListAffectsTrackersType] = UNSET, + affects_trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_uuid: Union[Unset, UUID] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + bz_id: Union[Unset, float] = UNSET, + changed_after: Union[Unset, datetime.datetime] = UNSET, + changed_before: Union[Unset, datetime.datetime] = UNSET, + comment_zero: Union[Unset, str] = UNSET, + components: Union[Unset, list[str]] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cve_description: Union[Unset, str] = UNSET, + cve_description_isempty: Union[Unset, bool] = UNSET, + cve_id: Union[Unset, list[str]] = UNSET, + cve_id_isempty: Union[Unset, bool] = UNSET, + cvss2_nist_isempty: Union[Unset, bool] = UNSET, + cvss2_rh_isempty: Union[Unset, bool] = UNSET, + cvss3_nist_isempty: Union[Unset, bool] = UNSET, + cvss3_rh_isempty: Union[Unset, bool] = UNSET, + cvss4_nist_isempty: Union[Unset, bool] = UNSET, + cvss4_rh_isempty: Union[Unset, bool] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + cwe_id: Union[Unset, str] = UNSET, + cwe_id_isempty: Union[Unset, bool] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + impact: Union[Unset, OsidbApiV1FlawsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + major_incident_start_dt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_date: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_gte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_lte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_gt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_gte: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lte: Union[Unset, datetime.datetime] = UNSET, + major_incident_state: Union[Unset, OsidbApiV1FlawsListMajorIncidentState] = UNSET, + mitigation_isempty: Union[Unset, bool] = UNSET, + nist_cvss_validation: Union[Unset, OsidbApiV1FlawsListNistCvssValidation] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1FlawsListOrderItem]] = UNSET, + owner: Union[Unset, str] = UNSET, + owner_isempty: Union[Unset, bool] = UNSET, + query: Union[Unset, str] = UNSET, + references_created_dt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_date: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_description: Union[Unset, str] = UNSET, + references_type: Union[Unset, OsidbApiV1FlawsListReferencesType] = UNSET, + references_updated_dt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_date: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_url: Union[Unset, str] = UNSET, + references_uuid: Union[Unset, UUID] = UNSET, + reported_dt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_date: Union[Unset, datetime.date] = UNSET, + reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + requires_cve_description: Union[Unset, OsidbApiV1FlawsListRequiresCveDescription] = UNSET, + search: Union[Unset, str] = UNSET, + source: Union[Unset, OsidbApiV1FlawsListSource] = UNSET, + statement: Union[Unset, str] = UNSET, + statement_isempty: Union[Unset, bool] = UNSET, + team_id: Union[Unset, str] = UNSET, + title: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, + unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + workflow_state: Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]] = UNSET, ) -> Response[OsidbApiV1FlawsListResponse200]: + """ + Args: + acknowledgments_affiliation (Union[Unset, str]): + acknowledgments_created_dt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_date (Union[Unset, datetime.date]): + acknowledgments_created_dt_date_gte (Union[Unset, datetime.date]): + acknowledgments_created_dt_date_lte (Union[Unset, datetime.date]): + acknowledgments_created_dt_gt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_gte (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_lt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_lte (Union[Unset, datetime.datetime]): + acknowledgments_from_upstream (Union[Unset, bool]): + acknowledgments_name (Union[Unset, str]): + acknowledgments_updated_dt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_date (Union[Unset, datetime.date]): + acknowledgments_updated_dt_date_gte (Union[Unset, datetime.date]): + acknowledgments_updated_dt_date_lte (Union[Unset, datetime.date]): + acknowledgments_updated_dt_gt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_gte (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_lt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_lte (Union[Unset, datetime.datetime]): + acknowledgments_uuid (Union[Unset, UUID]): + affects_affectedness (Union[Unset, OsidbApiV1FlawsListAffectsAffectedness]): + affects_created_dt (Union[Unset, datetime.datetime]): + affects_created_dt_date (Union[Unset, datetime.date]): + affects_created_dt_date_gte (Union[Unset, datetime.date]): + affects_created_dt_date_lte (Union[Unset, datetime.date]): + affects_created_dt_gt (Union[Unset, datetime.datetime]): + affects_created_dt_gte (Union[Unset, datetime.datetime]): + affects_created_dt_lt (Union[Unset, datetime.datetime]): + affects_created_dt_lte (Union[Unset, datetime.datetime]): + affects_embargoed (Union[Unset, bool]): + affects_impact (Union[Unset, OsidbApiV1FlawsListAffectsImpact]): + affects_ps_component (Union[Unset, str]): + affects_ps_module (Union[Unset, str]): + affects_resolution (Union[Unset, OsidbApiV1FlawsListAffectsResolution]): + affects_trackers_created_dt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_date (Union[Unset, datetime.date]): + affects_trackers_created_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_created_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_created_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_embargoed (Union[Unset, bool]): + affects_trackers_errata_advisory_name (Union[Unset, str]): + affects_trackers_errata_et_id (Union[Unset, int]): + affects_trackers_errata_shipped_dt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_date (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_external_system_id (Union[Unset, str]): + affects_trackers_ps_update_stream (Union[Unset, str]): + affects_trackers_resolution (Union[Unset, str]): + affects_trackers_status (Union[Unset, str]): + affects_trackers_type (Union[Unset, OsidbApiV1FlawsListAffectsTrackersType]): + affects_trackers_updated_dt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_date (Union[Unset, datetime.date]): + affects_trackers_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_uuid (Union[Unset, UUID]): + affects_updated_dt (Union[Unset, datetime.datetime]): + affects_updated_dt_date (Union[Unset, datetime.date]): + affects_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_uuid (Union[Unset, UUID]): + bz_id (Union[Unset, float]): + changed_after (Union[Unset, datetime.datetime]): + changed_before (Union[Unset, datetime.datetime]): + comment_zero (Union[Unset, str]): + components (Union[Unset, list[str]]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cve_description (Union[Unset, str]): + cve_description_isempty (Union[Unset, bool]): + cve_id (Union[Unset, list[str]]): + cve_id_isempty (Union[Unset, bool]): + cvss2_nist_isempty (Union[Unset, bool]): + cvss2_rh_isempty (Union[Unset, bool]): + cvss3_nist_isempty (Union[Unset, bool]): + cvss3_rh_isempty (Union[Unset, bool]): + cvss4_nist_isempty (Union[Unset, bool]): + cvss4_rh_isempty (Union[Unset, bool]): + cvss_scores_comment (Union[Unset, str]): + cvss_scores_created_dt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_date (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_created_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_cvss_version (Union[Unset, str]): + cvss_scores_issuer (Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer]): + cvss_scores_score (Union[Unset, float]): + cvss_scores_updated_dt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_date (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_uuid (Union[Unset, UUID]): + cvss_scores_vector (Union[Unset, str]): + cwe_id (Union[Unset, str]): + cwe_id_isempty (Union[Unset, bool]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + impact (Union[Unset, OsidbApiV1FlawsListImpact]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + major_incident_start_dt (Union[Unset, datetime.datetime]): + major_incident_start_dt_date (Union[Unset, datetime.date]): + major_incident_start_dt_date_gte (Union[Unset, datetime.date]): + major_incident_start_dt_date_lte (Union[Unset, datetime.date]): + major_incident_start_dt_gt (Union[Unset, datetime.datetime]): + major_incident_start_dt_gte (Union[Unset, datetime.datetime]): + major_incident_start_dt_lt (Union[Unset, datetime.datetime]): + major_incident_start_dt_lte (Union[Unset, datetime.datetime]): + major_incident_state (Union[Unset, OsidbApiV1FlawsListMajorIncidentState]): + mitigation_isempty (Union[Unset, bool]): + nist_cvss_validation (Union[Unset, OsidbApiV1FlawsListNistCvssValidation]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1FlawsListOrderItem]]): + owner (Union[Unset, str]): + owner_isempty (Union[Unset, bool]): + query (Union[Unset, str]): + references_created_dt (Union[Unset, datetime.datetime]): + references_created_dt_date (Union[Unset, datetime.date]): + references_created_dt_date_gte (Union[Unset, datetime.date]): + references_created_dt_date_lte (Union[Unset, datetime.date]): + references_created_dt_gt (Union[Unset, datetime.datetime]): + references_created_dt_gte (Union[Unset, datetime.datetime]): + references_created_dt_lt (Union[Unset, datetime.datetime]): + references_created_dt_lte (Union[Unset, datetime.datetime]): + references_description (Union[Unset, str]): + references_type (Union[Unset, OsidbApiV1FlawsListReferencesType]): + references_updated_dt (Union[Unset, datetime.datetime]): + references_updated_dt_date (Union[Unset, datetime.date]): + references_updated_dt_date_gte (Union[Unset, datetime.date]): + references_updated_dt_date_lte (Union[Unset, datetime.date]): + references_updated_dt_gt (Union[Unset, datetime.datetime]): + references_updated_dt_gte (Union[Unset, datetime.datetime]): + references_updated_dt_lt (Union[Unset, datetime.datetime]): + references_updated_dt_lte (Union[Unset, datetime.datetime]): + references_url (Union[Unset, str]): + references_uuid (Union[Unset, UUID]): + reported_dt (Union[Unset, datetime.datetime]): + reported_dt_date (Union[Unset, datetime.date]): + reported_dt_date_gte (Union[Unset, datetime.date]): + reported_dt_date_lte (Union[Unset, datetime.date]): + reported_dt_gt (Union[Unset, datetime.datetime]): + reported_dt_gte (Union[Unset, datetime.datetime]): + reported_dt_lt (Union[Unset, datetime.datetime]): + reported_dt_lte (Union[Unset, datetime.datetime]): + requires_cve_description (Union[Unset, OsidbApiV1FlawsListRequiresCveDescription]): + search (Union[Unset, str]): + source (Union[Unset, OsidbApiV1FlawsListSource]): + statement (Union[Unset, str]): + statement_isempty (Union[Unset, bool]): + team_id (Union[Unset, str]): + title (Union[Unset, str]): + tracker_ids (Union[Unset, list[str]]): + unembargo_dt (Union[Unset, datetime.datetime]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + workflow_state (Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsListResponse200] + """ + kwargs = _get_kwargs( client=client, acknowledgments_affiliation=acknowledgments_affiliation, @@ -2116,232 +1867,407 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - acknowledgments_affiliation: Union[Unset, None, str] = UNSET, - acknowledgments_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_from_upstream: Union[Unset, None, bool] = UNSET, - acknowledgments_name: Union[Unset, None, str] = UNSET, - acknowledgments_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_uuid: Union[Unset, None, str] = UNSET, - affects_affectedness: Union[ - Unset, None, OsidbApiV1FlawsListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1FlawsListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1FlawsListAffectsResolution - ] = UNSET, - affects_trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_embargoed: Union[Unset, None, bool] = UNSET, - affects_trackers_errata_advisory_name: Union[Unset, None, str] = UNSET, - affects_trackers_errata_et_id: Union[Unset, None, int] = UNSET, - affects_trackers_errata_shipped_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_errata_shipped_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_errata_shipped_dt_date_gte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_date_lte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_gt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_gte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_external_system_id: Union[Unset, None, str] = UNSET, - affects_trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - affects_trackers_resolution: Union[Unset, None, str] = UNSET, - affects_trackers_status: Union[Unset, None, str] = UNSET, - affects_trackers_type: Union[ - Unset, None, OsidbApiV1FlawsListAffectsTrackersType - ] = UNSET, - affects_trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_uuid: Union[Unset, None, str] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - bz_id: Union[Unset, None, float] = UNSET, - changed_after: Union[Unset, None, datetime.datetime] = UNSET, - changed_before: Union[Unset, None, datetime.datetime] = UNSET, - comment_zero: Union[Unset, None, str] = UNSET, - components: Union[Unset, None, List[str]] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cve_description: Union[Unset, None, str] = UNSET, - cve_description_isempty: Union[Unset, None, bool] = UNSET, - cve_id: Union[Unset, None, List[str]] = UNSET, - cve_id_isempty: Union[Unset, None, bool] = UNSET, - cvss2_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss2_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss3_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss3_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss4_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss4_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[Unset, None, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - cwe_id: Union[Unset, None, str] = UNSET, - cwe_id_isempty: Union[Unset, None, bool] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - impact: Union[Unset, None, OsidbApiV1FlawsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_date: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_state: Union[ - Unset, None, OsidbApiV1FlawsListMajorIncidentState - ] = UNSET, - mitigation_isempty: Union[Unset, None, bool] = UNSET, - nist_cvss_validation: Union[ - Unset, None, OsidbApiV1FlawsListNistCvssValidation - ] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1FlawsListOrderItem]] = UNSET, - owner: Union[Unset, None, str] = UNSET, - owner_isempty: Union[Unset, None, bool] = UNSET, - query: Union[Unset, None, str] = UNSET, - references_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_description: Union[Unset, None, str] = UNSET, - references_type: Union[Unset, None, OsidbApiV1FlawsListReferencesType] = UNSET, - references_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_url: Union[Unset, None, str] = UNSET, - references_uuid: Union[Unset, None, str] = UNSET, - reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - requires_cve_description: Union[ - Unset, None, OsidbApiV1FlawsListRequiresCveDescription - ] = UNSET, - search: Union[Unset, None, str] = UNSET, - source: Union[Unset, None, OsidbApiV1FlawsListSource] = UNSET, - statement: Union[Unset, None, str] = UNSET, - statement_isempty: Union[Unset, None, bool] = UNSET, - team_id: Union[Unset, None, str] = UNSET, - title: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - workflow_state: Union[ - Unset, None, List[OsidbApiV1FlawsListWorkflowStateItem] - ] = UNSET, + acknowledgments_affiliation: Union[Unset, str] = UNSET, + acknowledgments_created_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_from_upstream: Union[Unset, bool] = UNSET, + acknowledgments_name: Union[Unset, str] = UNSET, + acknowledgments_updated_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_uuid: Union[Unset, UUID] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1FlawsListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_impact: Union[Unset, OsidbApiV1FlawsListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1FlawsListAffectsResolution] = UNSET, + affects_trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_embargoed: Union[Unset, bool] = UNSET, + affects_trackers_errata_advisory_name: Union[Unset, str] = UNSET, + affects_trackers_errata_et_id: Union[Unset, int] = UNSET, + affects_trackers_errata_shipped_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_external_system_id: Union[Unset, str] = UNSET, + affects_trackers_ps_update_stream: Union[Unset, str] = UNSET, + affects_trackers_resolution: Union[Unset, str] = UNSET, + affects_trackers_status: Union[Unset, str] = UNSET, + affects_trackers_type: Union[Unset, OsidbApiV1FlawsListAffectsTrackersType] = UNSET, + affects_trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_uuid: Union[Unset, UUID] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + bz_id: Union[Unset, float] = UNSET, + changed_after: Union[Unset, datetime.datetime] = UNSET, + changed_before: Union[Unset, datetime.datetime] = UNSET, + comment_zero: Union[Unset, str] = UNSET, + components: Union[Unset, list[str]] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cve_description: Union[Unset, str] = UNSET, + cve_description_isempty: Union[Unset, bool] = UNSET, + cve_id: Union[Unset, list[str]] = UNSET, + cve_id_isempty: Union[Unset, bool] = UNSET, + cvss2_nist_isempty: Union[Unset, bool] = UNSET, + cvss2_rh_isempty: Union[Unset, bool] = UNSET, + cvss3_nist_isempty: Union[Unset, bool] = UNSET, + cvss3_rh_isempty: Union[Unset, bool] = UNSET, + cvss4_nist_isempty: Union[Unset, bool] = UNSET, + cvss4_rh_isempty: Union[Unset, bool] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + cwe_id: Union[Unset, str] = UNSET, + cwe_id_isempty: Union[Unset, bool] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + impact: Union[Unset, OsidbApiV1FlawsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + major_incident_start_dt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_date: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_gte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_lte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_gt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_gte: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lte: Union[Unset, datetime.datetime] = UNSET, + major_incident_state: Union[Unset, OsidbApiV1FlawsListMajorIncidentState] = UNSET, + mitigation_isempty: Union[Unset, bool] = UNSET, + nist_cvss_validation: Union[Unset, OsidbApiV1FlawsListNistCvssValidation] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1FlawsListOrderItem]] = UNSET, + owner: Union[Unset, str] = UNSET, + owner_isempty: Union[Unset, bool] = UNSET, + query: Union[Unset, str] = UNSET, + references_created_dt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_date: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_description: Union[Unset, str] = UNSET, + references_type: Union[Unset, OsidbApiV1FlawsListReferencesType] = UNSET, + references_updated_dt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_date: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_url: Union[Unset, str] = UNSET, + references_uuid: Union[Unset, UUID] = UNSET, + reported_dt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_date: Union[Unset, datetime.date] = UNSET, + reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + requires_cve_description: Union[Unset, OsidbApiV1FlawsListRequiresCveDescription] = UNSET, + search: Union[Unset, str] = UNSET, + source: Union[Unset, OsidbApiV1FlawsListSource] = UNSET, + statement: Union[Unset, str] = UNSET, + statement_isempty: Union[Unset, bool] = UNSET, + team_id: Union[Unset, str] = UNSET, + title: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, + unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + workflow_state: Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]] = UNSET, ) -> Optional[OsidbApiV1FlawsListResponse200]: - """ """ + """ + Args: + acknowledgments_affiliation (Union[Unset, str]): + acknowledgments_created_dt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_date (Union[Unset, datetime.date]): + acknowledgments_created_dt_date_gte (Union[Unset, datetime.date]): + acknowledgments_created_dt_date_lte (Union[Unset, datetime.date]): + acknowledgments_created_dt_gt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_gte (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_lt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_lte (Union[Unset, datetime.datetime]): + acknowledgments_from_upstream (Union[Unset, bool]): + acknowledgments_name (Union[Unset, str]): + acknowledgments_updated_dt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_date (Union[Unset, datetime.date]): + acknowledgments_updated_dt_date_gte (Union[Unset, datetime.date]): + acknowledgments_updated_dt_date_lte (Union[Unset, datetime.date]): + acknowledgments_updated_dt_gt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_gte (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_lt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_lte (Union[Unset, datetime.datetime]): + acknowledgments_uuid (Union[Unset, UUID]): + affects_affectedness (Union[Unset, OsidbApiV1FlawsListAffectsAffectedness]): + affects_created_dt (Union[Unset, datetime.datetime]): + affects_created_dt_date (Union[Unset, datetime.date]): + affects_created_dt_date_gte (Union[Unset, datetime.date]): + affects_created_dt_date_lte (Union[Unset, datetime.date]): + affects_created_dt_gt (Union[Unset, datetime.datetime]): + affects_created_dt_gte (Union[Unset, datetime.datetime]): + affects_created_dt_lt (Union[Unset, datetime.datetime]): + affects_created_dt_lte (Union[Unset, datetime.datetime]): + affects_embargoed (Union[Unset, bool]): + affects_impact (Union[Unset, OsidbApiV1FlawsListAffectsImpact]): + affects_ps_component (Union[Unset, str]): + affects_ps_module (Union[Unset, str]): + affects_resolution (Union[Unset, OsidbApiV1FlawsListAffectsResolution]): + affects_trackers_created_dt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_date (Union[Unset, datetime.date]): + affects_trackers_created_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_created_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_created_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_embargoed (Union[Unset, bool]): + affects_trackers_errata_advisory_name (Union[Unset, str]): + affects_trackers_errata_et_id (Union[Unset, int]): + affects_trackers_errata_shipped_dt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_date (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_external_system_id (Union[Unset, str]): + affects_trackers_ps_update_stream (Union[Unset, str]): + affects_trackers_resolution (Union[Unset, str]): + affects_trackers_status (Union[Unset, str]): + affects_trackers_type (Union[Unset, OsidbApiV1FlawsListAffectsTrackersType]): + affects_trackers_updated_dt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_date (Union[Unset, datetime.date]): + affects_trackers_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_uuid (Union[Unset, UUID]): + affects_updated_dt (Union[Unset, datetime.datetime]): + affects_updated_dt_date (Union[Unset, datetime.date]): + affects_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_uuid (Union[Unset, UUID]): + bz_id (Union[Unset, float]): + changed_after (Union[Unset, datetime.datetime]): + changed_before (Union[Unset, datetime.datetime]): + comment_zero (Union[Unset, str]): + components (Union[Unset, list[str]]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cve_description (Union[Unset, str]): + cve_description_isempty (Union[Unset, bool]): + cve_id (Union[Unset, list[str]]): + cve_id_isempty (Union[Unset, bool]): + cvss2_nist_isempty (Union[Unset, bool]): + cvss2_rh_isempty (Union[Unset, bool]): + cvss3_nist_isempty (Union[Unset, bool]): + cvss3_rh_isempty (Union[Unset, bool]): + cvss4_nist_isempty (Union[Unset, bool]): + cvss4_rh_isempty (Union[Unset, bool]): + cvss_scores_comment (Union[Unset, str]): + cvss_scores_created_dt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_date (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_created_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_cvss_version (Union[Unset, str]): + cvss_scores_issuer (Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer]): + cvss_scores_score (Union[Unset, float]): + cvss_scores_updated_dt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_date (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_uuid (Union[Unset, UUID]): + cvss_scores_vector (Union[Unset, str]): + cwe_id (Union[Unset, str]): + cwe_id_isempty (Union[Unset, bool]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + impact (Union[Unset, OsidbApiV1FlawsListImpact]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + major_incident_start_dt (Union[Unset, datetime.datetime]): + major_incident_start_dt_date (Union[Unset, datetime.date]): + major_incident_start_dt_date_gte (Union[Unset, datetime.date]): + major_incident_start_dt_date_lte (Union[Unset, datetime.date]): + major_incident_start_dt_gt (Union[Unset, datetime.datetime]): + major_incident_start_dt_gte (Union[Unset, datetime.datetime]): + major_incident_start_dt_lt (Union[Unset, datetime.datetime]): + major_incident_start_dt_lte (Union[Unset, datetime.datetime]): + major_incident_state (Union[Unset, OsidbApiV1FlawsListMajorIncidentState]): + mitigation_isempty (Union[Unset, bool]): + nist_cvss_validation (Union[Unset, OsidbApiV1FlawsListNistCvssValidation]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1FlawsListOrderItem]]): + owner (Union[Unset, str]): + owner_isempty (Union[Unset, bool]): + query (Union[Unset, str]): + references_created_dt (Union[Unset, datetime.datetime]): + references_created_dt_date (Union[Unset, datetime.date]): + references_created_dt_date_gte (Union[Unset, datetime.date]): + references_created_dt_date_lte (Union[Unset, datetime.date]): + references_created_dt_gt (Union[Unset, datetime.datetime]): + references_created_dt_gte (Union[Unset, datetime.datetime]): + references_created_dt_lt (Union[Unset, datetime.datetime]): + references_created_dt_lte (Union[Unset, datetime.datetime]): + references_description (Union[Unset, str]): + references_type (Union[Unset, OsidbApiV1FlawsListReferencesType]): + references_updated_dt (Union[Unset, datetime.datetime]): + references_updated_dt_date (Union[Unset, datetime.date]): + references_updated_dt_date_gte (Union[Unset, datetime.date]): + references_updated_dt_date_lte (Union[Unset, datetime.date]): + references_updated_dt_gt (Union[Unset, datetime.datetime]): + references_updated_dt_gte (Union[Unset, datetime.datetime]): + references_updated_dt_lt (Union[Unset, datetime.datetime]): + references_updated_dt_lte (Union[Unset, datetime.datetime]): + references_url (Union[Unset, str]): + references_uuid (Union[Unset, UUID]): + reported_dt (Union[Unset, datetime.datetime]): + reported_dt_date (Union[Unset, datetime.date]): + reported_dt_date_gte (Union[Unset, datetime.date]): + reported_dt_date_lte (Union[Unset, datetime.date]): + reported_dt_gt (Union[Unset, datetime.datetime]): + reported_dt_gte (Union[Unset, datetime.datetime]): + reported_dt_lt (Union[Unset, datetime.datetime]): + reported_dt_lte (Union[Unset, datetime.datetime]): + requires_cve_description (Union[Unset, OsidbApiV1FlawsListRequiresCveDescription]): + search (Union[Unset, str]): + source (Union[Unset, OsidbApiV1FlawsListSource]): + statement (Union[Unset, str]): + statement_isempty (Union[Unset, bool]): + team_id (Union[Unset, str]): + title (Union[Unset, str]): + tracker_ids (Union[Unset, list[str]]): + unembargo_dt (Union[Unset, datetime.datetime]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + workflow_state (Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsListResponse200 + """ return sync_detailed( client=client, @@ -2540,230 +2466,406 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - acknowledgments_affiliation: Union[Unset, None, str] = UNSET, - acknowledgments_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_from_upstream: Union[Unset, None, bool] = UNSET, - acknowledgments_name: Union[Unset, None, str] = UNSET, - acknowledgments_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_uuid: Union[Unset, None, str] = UNSET, - affects_affectedness: Union[ - Unset, None, OsidbApiV1FlawsListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1FlawsListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1FlawsListAffectsResolution - ] = UNSET, - affects_trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_embargoed: Union[Unset, None, bool] = UNSET, - affects_trackers_errata_advisory_name: Union[Unset, None, str] = UNSET, - affects_trackers_errata_et_id: Union[Unset, None, int] = UNSET, - affects_trackers_errata_shipped_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_errata_shipped_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_errata_shipped_dt_date_gte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_date_lte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_gt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_gte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_external_system_id: Union[Unset, None, str] = UNSET, - affects_trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - affects_trackers_resolution: Union[Unset, None, str] = UNSET, - affects_trackers_status: Union[Unset, None, str] = UNSET, - affects_trackers_type: Union[ - Unset, None, OsidbApiV1FlawsListAffectsTrackersType - ] = UNSET, - affects_trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_uuid: Union[Unset, None, str] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - bz_id: Union[Unset, None, float] = UNSET, - changed_after: Union[Unset, None, datetime.datetime] = UNSET, - changed_before: Union[Unset, None, datetime.datetime] = UNSET, - comment_zero: Union[Unset, None, str] = UNSET, - components: Union[Unset, None, List[str]] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cve_description: Union[Unset, None, str] = UNSET, - cve_description_isempty: Union[Unset, None, bool] = UNSET, - cve_id: Union[Unset, None, List[str]] = UNSET, - cve_id_isempty: Union[Unset, None, bool] = UNSET, - cvss2_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss2_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss3_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss3_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss4_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss4_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[Unset, None, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - cwe_id: Union[Unset, None, str] = UNSET, - cwe_id_isempty: Union[Unset, None, bool] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - impact: Union[Unset, None, OsidbApiV1FlawsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_date: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_state: Union[ - Unset, None, OsidbApiV1FlawsListMajorIncidentState - ] = UNSET, - mitigation_isempty: Union[Unset, None, bool] = UNSET, - nist_cvss_validation: Union[ - Unset, None, OsidbApiV1FlawsListNistCvssValidation - ] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1FlawsListOrderItem]] = UNSET, - owner: Union[Unset, None, str] = UNSET, - owner_isempty: Union[Unset, None, bool] = UNSET, - query: Union[Unset, None, str] = UNSET, - references_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_description: Union[Unset, None, str] = UNSET, - references_type: Union[Unset, None, OsidbApiV1FlawsListReferencesType] = UNSET, - references_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_url: Union[Unset, None, str] = UNSET, - references_uuid: Union[Unset, None, str] = UNSET, - reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - requires_cve_description: Union[ - Unset, None, OsidbApiV1FlawsListRequiresCveDescription - ] = UNSET, - search: Union[Unset, None, str] = UNSET, - source: Union[Unset, None, OsidbApiV1FlawsListSource] = UNSET, - statement: Union[Unset, None, str] = UNSET, - statement_isempty: Union[Unset, None, bool] = UNSET, - team_id: Union[Unset, None, str] = UNSET, - title: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - workflow_state: Union[ - Unset, None, List[OsidbApiV1FlawsListWorkflowStateItem] - ] = UNSET, + acknowledgments_affiliation: Union[Unset, str] = UNSET, + acknowledgments_created_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_from_upstream: Union[Unset, bool] = UNSET, + acknowledgments_name: Union[Unset, str] = UNSET, + acknowledgments_updated_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_uuid: Union[Unset, UUID] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1FlawsListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_impact: Union[Unset, OsidbApiV1FlawsListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1FlawsListAffectsResolution] = UNSET, + affects_trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_embargoed: Union[Unset, bool] = UNSET, + affects_trackers_errata_advisory_name: Union[Unset, str] = UNSET, + affects_trackers_errata_et_id: Union[Unset, int] = UNSET, + affects_trackers_errata_shipped_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_external_system_id: Union[Unset, str] = UNSET, + affects_trackers_ps_update_stream: Union[Unset, str] = UNSET, + affects_trackers_resolution: Union[Unset, str] = UNSET, + affects_trackers_status: Union[Unset, str] = UNSET, + affects_trackers_type: Union[Unset, OsidbApiV1FlawsListAffectsTrackersType] = UNSET, + affects_trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_uuid: Union[Unset, UUID] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + bz_id: Union[Unset, float] = UNSET, + changed_after: Union[Unset, datetime.datetime] = UNSET, + changed_before: Union[Unset, datetime.datetime] = UNSET, + comment_zero: Union[Unset, str] = UNSET, + components: Union[Unset, list[str]] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cve_description: Union[Unset, str] = UNSET, + cve_description_isempty: Union[Unset, bool] = UNSET, + cve_id: Union[Unset, list[str]] = UNSET, + cve_id_isempty: Union[Unset, bool] = UNSET, + cvss2_nist_isempty: Union[Unset, bool] = UNSET, + cvss2_rh_isempty: Union[Unset, bool] = UNSET, + cvss3_nist_isempty: Union[Unset, bool] = UNSET, + cvss3_rh_isempty: Union[Unset, bool] = UNSET, + cvss4_nist_isempty: Union[Unset, bool] = UNSET, + cvss4_rh_isempty: Union[Unset, bool] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + cwe_id: Union[Unset, str] = UNSET, + cwe_id_isempty: Union[Unset, bool] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + impact: Union[Unset, OsidbApiV1FlawsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + major_incident_start_dt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_date: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_gte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_lte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_gt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_gte: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lte: Union[Unset, datetime.datetime] = UNSET, + major_incident_state: Union[Unset, OsidbApiV1FlawsListMajorIncidentState] = UNSET, + mitigation_isempty: Union[Unset, bool] = UNSET, + nist_cvss_validation: Union[Unset, OsidbApiV1FlawsListNistCvssValidation] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1FlawsListOrderItem]] = UNSET, + owner: Union[Unset, str] = UNSET, + owner_isempty: Union[Unset, bool] = UNSET, + query: Union[Unset, str] = UNSET, + references_created_dt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_date: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_description: Union[Unset, str] = UNSET, + references_type: Union[Unset, OsidbApiV1FlawsListReferencesType] = UNSET, + references_updated_dt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_date: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_url: Union[Unset, str] = UNSET, + references_uuid: Union[Unset, UUID] = UNSET, + reported_dt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_date: Union[Unset, datetime.date] = UNSET, + reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + requires_cve_description: Union[Unset, OsidbApiV1FlawsListRequiresCveDescription] = UNSET, + search: Union[Unset, str] = UNSET, + source: Union[Unset, OsidbApiV1FlawsListSource] = UNSET, + statement: Union[Unset, str] = UNSET, + statement_isempty: Union[Unset, bool] = UNSET, + team_id: Union[Unset, str] = UNSET, + title: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, + unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + workflow_state: Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]] = UNSET, ) -> Response[OsidbApiV1FlawsListResponse200]: + """ + Args: + acknowledgments_affiliation (Union[Unset, str]): + acknowledgments_created_dt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_date (Union[Unset, datetime.date]): + acknowledgments_created_dt_date_gte (Union[Unset, datetime.date]): + acknowledgments_created_dt_date_lte (Union[Unset, datetime.date]): + acknowledgments_created_dt_gt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_gte (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_lt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_lte (Union[Unset, datetime.datetime]): + acknowledgments_from_upstream (Union[Unset, bool]): + acknowledgments_name (Union[Unset, str]): + acknowledgments_updated_dt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_date (Union[Unset, datetime.date]): + acknowledgments_updated_dt_date_gte (Union[Unset, datetime.date]): + acknowledgments_updated_dt_date_lte (Union[Unset, datetime.date]): + acknowledgments_updated_dt_gt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_gte (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_lt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_lte (Union[Unset, datetime.datetime]): + acknowledgments_uuid (Union[Unset, UUID]): + affects_affectedness (Union[Unset, OsidbApiV1FlawsListAffectsAffectedness]): + affects_created_dt (Union[Unset, datetime.datetime]): + affects_created_dt_date (Union[Unset, datetime.date]): + affects_created_dt_date_gte (Union[Unset, datetime.date]): + affects_created_dt_date_lte (Union[Unset, datetime.date]): + affects_created_dt_gt (Union[Unset, datetime.datetime]): + affects_created_dt_gte (Union[Unset, datetime.datetime]): + affects_created_dt_lt (Union[Unset, datetime.datetime]): + affects_created_dt_lte (Union[Unset, datetime.datetime]): + affects_embargoed (Union[Unset, bool]): + affects_impact (Union[Unset, OsidbApiV1FlawsListAffectsImpact]): + affects_ps_component (Union[Unset, str]): + affects_ps_module (Union[Unset, str]): + affects_resolution (Union[Unset, OsidbApiV1FlawsListAffectsResolution]): + affects_trackers_created_dt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_date (Union[Unset, datetime.date]): + affects_trackers_created_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_created_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_created_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_embargoed (Union[Unset, bool]): + affects_trackers_errata_advisory_name (Union[Unset, str]): + affects_trackers_errata_et_id (Union[Unset, int]): + affects_trackers_errata_shipped_dt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_date (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_external_system_id (Union[Unset, str]): + affects_trackers_ps_update_stream (Union[Unset, str]): + affects_trackers_resolution (Union[Unset, str]): + affects_trackers_status (Union[Unset, str]): + affects_trackers_type (Union[Unset, OsidbApiV1FlawsListAffectsTrackersType]): + affects_trackers_updated_dt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_date (Union[Unset, datetime.date]): + affects_trackers_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_uuid (Union[Unset, UUID]): + affects_updated_dt (Union[Unset, datetime.datetime]): + affects_updated_dt_date (Union[Unset, datetime.date]): + affects_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_uuid (Union[Unset, UUID]): + bz_id (Union[Unset, float]): + changed_after (Union[Unset, datetime.datetime]): + changed_before (Union[Unset, datetime.datetime]): + comment_zero (Union[Unset, str]): + components (Union[Unset, list[str]]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cve_description (Union[Unset, str]): + cve_description_isempty (Union[Unset, bool]): + cve_id (Union[Unset, list[str]]): + cve_id_isempty (Union[Unset, bool]): + cvss2_nist_isempty (Union[Unset, bool]): + cvss2_rh_isempty (Union[Unset, bool]): + cvss3_nist_isempty (Union[Unset, bool]): + cvss3_rh_isempty (Union[Unset, bool]): + cvss4_nist_isempty (Union[Unset, bool]): + cvss4_rh_isempty (Union[Unset, bool]): + cvss_scores_comment (Union[Unset, str]): + cvss_scores_created_dt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_date (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_created_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_cvss_version (Union[Unset, str]): + cvss_scores_issuer (Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer]): + cvss_scores_score (Union[Unset, float]): + cvss_scores_updated_dt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_date (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_uuid (Union[Unset, UUID]): + cvss_scores_vector (Union[Unset, str]): + cwe_id (Union[Unset, str]): + cwe_id_isempty (Union[Unset, bool]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + impact (Union[Unset, OsidbApiV1FlawsListImpact]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + major_incident_start_dt (Union[Unset, datetime.datetime]): + major_incident_start_dt_date (Union[Unset, datetime.date]): + major_incident_start_dt_date_gte (Union[Unset, datetime.date]): + major_incident_start_dt_date_lte (Union[Unset, datetime.date]): + major_incident_start_dt_gt (Union[Unset, datetime.datetime]): + major_incident_start_dt_gte (Union[Unset, datetime.datetime]): + major_incident_start_dt_lt (Union[Unset, datetime.datetime]): + major_incident_start_dt_lte (Union[Unset, datetime.datetime]): + major_incident_state (Union[Unset, OsidbApiV1FlawsListMajorIncidentState]): + mitigation_isempty (Union[Unset, bool]): + nist_cvss_validation (Union[Unset, OsidbApiV1FlawsListNistCvssValidation]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1FlawsListOrderItem]]): + owner (Union[Unset, str]): + owner_isempty (Union[Unset, bool]): + query (Union[Unset, str]): + references_created_dt (Union[Unset, datetime.datetime]): + references_created_dt_date (Union[Unset, datetime.date]): + references_created_dt_date_gte (Union[Unset, datetime.date]): + references_created_dt_date_lte (Union[Unset, datetime.date]): + references_created_dt_gt (Union[Unset, datetime.datetime]): + references_created_dt_gte (Union[Unset, datetime.datetime]): + references_created_dt_lt (Union[Unset, datetime.datetime]): + references_created_dt_lte (Union[Unset, datetime.datetime]): + references_description (Union[Unset, str]): + references_type (Union[Unset, OsidbApiV1FlawsListReferencesType]): + references_updated_dt (Union[Unset, datetime.datetime]): + references_updated_dt_date (Union[Unset, datetime.date]): + references_updated_dt_date_gte (Union[Unset, datetime.date]): + references_updated_dt_date_lte (Union[Unset, datetime.date]): + references_updated_dt_gt (Union[Unset, datetime.datetime]): + references_updated_dt_gte (Union[Unset, datetime.datetime]): + references_updated_dt_lt (Union[Unset, datetime.datetime]): + references_updated_dt_lte (Union[Unset, datetime.datetime]): + references_url (Union[Unset, str]): + references_uuid (Union[Unset, UUID]): + reported_dt (Union[Unset, datetime.datetime]): + reported_dt_date (Union[Unset, datetime.date]): + reported_dt_date_gte (Union[Unset, datetime.date]): + reported_dt_date_lte (Union[Unset, datetime.date]): + reported_dt_gt (Union[Unset, datetime.datetime]): + reported_dt_gte (Union[Unset, datetime.datetime]): + reported_dt_lt (Union[Unset, datetime.datetime]): + reported_dt_lte (Union[Unset, datetime.datetime]): + requires_cve_description (Union[Unset, OsidbApiV1FlawsListRequiresCveDescription]): + search (Union[Unset, str]): + source (Union[Unset, OsidbApiV1FlawsListSource]): + statement (Union[Unset, str]): + statement_isempty (Union[Unset, bool]): + team_id (Union[Unset, str]): + title (Union[Unset, str]): + tracker_ids (Union[Unset, list[str]]): + unembargo_dt (Union[Unset, datetime.datetime]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + workflow_state (Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsListResponse200] + """ + kwargs = _get_kwargs( - client=client, acknowledgments_affiliation=acknowledgments_affiliation, acknowledgments_created_dt=acknowledgments_created_dt, acknowledgments_created_dt_date=acknowledgments_created_dt_date, @@ -2958,243 +3060,412 @@ async def async_detailed( workflow_state=workflow_state, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - acknowledgments_affiliation: Union[Unset, None, str] = UNSET, - acknowledgments_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_from_upstream: Union[Unset, None, bool] = UNSET, - acknowledgments_name: Union[Unset, None, str] = UNSET, - acknowledgments_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - acknowledgments_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - acknowledgments_uuid: Union[Unset, None, str] = UNSET, - affects_affectedness: Union[ - Unset, None, OsidbApiV1FlawsListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1FlawsListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1FlawsListAffectsResolution - ] = UNSET, - affects_trackers_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_embargoed: Union[Unset, None, bool] = UNSET, - affects_trackers_errata_advisory_name: Union[Unset, None, str] = UNSET, - affects_trackers_errata_et_id: Union[Unset, None, int] = UNSET, - affects_trackers_errata_shipped_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_errata_shipped_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_errata_shipped_dt_date_gte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_date_lte: Union[ - Unset, None, datetime.date - ] = UNSET, - affects_trackers_errata_shipped_dt_gt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_gte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lt: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_errata_shipped_dt_lte: Union[ - Unset, None, datetime.datetime - ] = UNSET, - affects_trackers_external_system_id: Union[Unset, None, str] = UNSET, - affects_trackers_ps_update_stream: Union[Unset, None, str] = UNSET, - affects_trackers_resolution: Union[Unset, None, str] = UNSET, - affects_trackers_status: Union[Unset, None, str] = UNSET, - affects_trackers_type: Union[ - Unset, None, OsidbApiV1FlawsListAffectsTrackersType - ] = UNSET, - affects_trackers_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_trackers_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_trackers_uuid: Union[Unset, None, str] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - bz_id: Union[Unset, None, float] = UNSET, - changed_after: Union[Unset, None, datetime.datetime] = UNSET, - changed_before: Union[Unset, None, datetime.datetime] = UNSET, - comment_zero: Union[Unset, None, str] = UNSET, - components: Union[Unset, None, List[str]] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cve_description: Union[Unset, None, str] = UNSET, - cve_description_isempty: Union[Unset, None, bool] = UNSET, - cve_id: Union[Unset, None, List[str]] = UNSET, - cve_id_isempty: Union[Unset, None, bool] = UNSET, - cvss2_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss2_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss3_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss3_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss4_nist_isempty: Union[Unset, None, bool] = UNSET, - cvss4_rh_isempty: Union[Unset, None, bool] = UNSET, - cvss_scores_comment: Union[Unset, None, str] = UNSET, - cvss_scores_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_cvss_version: Union[Unset, None, str] = UNSET, - cvss_scores_issuer: Union[Unset, None, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, - cvss_scores_score: Union[Unset, None, float] = UNSET, - cvss_scores_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - cvss_scores_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - cvss_scores_uuid: Union[Unset, None, str] = UNSET, - cvss_scores_vector: Union[Unset, None, str] = UNSET, - cwe_id: Union[Unset, None, str] = UNSET, - cwe_id_isempty: Union[Unset, None, bool] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - impact: Union[Unset, None, OsidbApiV1FlawsListImpact] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_date: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - major_incident_start_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_start_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - major_incident_state: Union[ - Unset, None, OsidbApiV1FlawsListMajorIncidentState - ] = UNSET, - mitigation_isempty: Union[Unset, None, bool] = UNSET, - nist_cvss_validation: Union[ - Unset, None, OsidbApiV1FlawsListNistCvssValidation - ] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1FlawsListOrderItem]] = UNSET, - owner: Union[Unset, None, str] = UNSET, - owner_isempty: Union[Unset, None, bool] = UNSET, - query: Union[Unset, None, str] = UNSET, - references_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_description: Union[Unset, None, str] = UNSET, - references_type: Union[Unset, None, OsidbApiV1FlawsListReferencesType] = UNSET, - references_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - references_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - references_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - references_url: Union[Unset, None, str] = UNSET, - references_uuid: Union[Unset, None, str] = UNSET, - reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - requires_cve_description: Union[ - Unset, None, OsidbApiV1FlawsListRequiresCveDescription - ] = UNSET, - search: Union[Unset, None, str] = UNSET, - source: Union[Unset, None, OsidbApiV1FlawsListSource] = UNSET, - statement: Union[Unset, None, str] = UNSET, - statement_isempty: Union[Unset, None, bool] = UNSET, - team_id: Union[Unset, None, str] = UNSET, - title: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - workflow_state: Union[ - Unset, None, List[OsidbApiV1FlawsListWorkflowStateItem] - ] = UNSET, + acknowledgments_affiliation: Union[Unset, str] = UNSET, + acknowledgments_created_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_from_upstream: Union[Unset, bool] = UNSET, + acknowledgments_name: Union[Unset, str] = UNSET, + acknowledgments_updated_dt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_date: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + acknowledgments_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + acknowledgments_uuid: Union[Unset, UUID] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1FlawsListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_impact: Union[Unset, OsidbApiV1FlawsListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1FlawsListAffectsResolution] = UNSET, + affects_trackers_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_embargoed: Union[Unset, bool] = UNSET, + affects_trackers_errata_advisory_name: Union[Unset, str] = UNSET, + affects_trackers_errata_et_id: Union[Unset, int] = UNSET, + affects_trackers_errata_shipped_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_errata_shipped_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_errata_shipped_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_external_system_id: Union[Unset, str] = UNSET, + affects_trackers_ps_update_stream: Union[Unset, str] = UNSET, + affects_trackers_resolution: Union[Unset, str] = UNSET, + affects_trackers_status: Union[Unset, str] = UNSET, + affects_trackers_type: Union[Unset, OsidbApiV1FlawsListAffectsTrackersType] = UNSET, + affects_trackers_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_trackers_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_trackers_uuid: Union[Unset, UUID] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + bz_id: Union[Unset, float] = UNSET, + changed_after: Union[Unset, datetime.datetime] = UNSET, + changed_before: Union[Unset, datetime.datetime] = UNSET, + comment_zero: Union[Unset, str] = UNSET, + components: Union[Unset, list[str]] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cve_description: Union[Unset, str] = UNSET, + cve_description_isempty: Union[Unset, bool] = UNSET, + cve_id: Union[Unset, list[str]] = UNSET, + cve_id_isempty: Union[Unset, bool] = UNSET, + cvss2_nist_isempty: Union[Unset, bool] = UNSET, + cvss2_rh_isempty: Union[Unset, bool] = UNSET, + cvss3_nist_isempty: Union[Unset, bool] = UNSET, + cvss3_rh_isempty: Union[Unset, bool] = UNSET, + cvss4_nist_isempty: Union[Unset, bool] = UNSET, + cvss4_rh_isempty: Union[Unset, bool] = UNSET, + cvss_scores_comment: Union[Unset, str] = UNSET, + cvss_scores_created_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_cvss_version: Union[Unset, str] = UNSET, + cvss_scores_issuer: Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer] = UNSET, + cvss_scores_score: Union[Unset, float] = UNSET, + cvss_scores_updated_dt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_date: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + cvss_scores_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + cvss_scores_uuid: Union[Unset, UUID] = UNSET, + cvss_scores_vector: Union[Unset, str] = UNSET, + cwe_id: Union[Unset, str] = UNSET, + cwe_id_isempty: Union[Unset, bool] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + impact: Union[Unset, OsidbApiV1FlawsListImpact] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + major_incident_start_dt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_date: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_gte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_date_lte: Union[Unset, datetime.date] = UNSET, + major_incident_start_dt_gt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_gte: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lt: Union[Unset, datetime.datetime] = UNSET, + major_incident_start_dt_lte: Union[Unset, datetime.datetime] = UNSET, + major_incident_state: Union[Unset, OsidbApiV1FlawsListMajorIncidentState] = UNSET, + mitigation_isempty: Union[Unset, bool] = UNSET, + nist_cvss_validation: Union[Unset, OsidbApiV1FlawsListNistCvssValidation] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1FlawsListOrderItem]] = UNSET, + owner: Union[Unset, str] = UNSET, + owner_isempty: Union[Unset, bool] = UNSET, + query: Union[Unset, str] = UNSET, + references_created_dt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_date: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_description: Union[Unset, str] = UNSET, + references_type: Union[Unset, OsidbApiV1FlawsListReferencesType] = UNSET, + references_updated_dt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_date: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + references_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + references_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + references_url: Union[Unset, str] = UNSET, + references_uuid: Union[Unset, UUID] = UNSET, + reported_dt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_date: Union[Unset, datetime.date] = UNSET, + reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + requires_cve_description: Union[Unset, OsidbApiV1FlawsListRequiresCveDescription] = UNSET, + search: Union[Unset, str] = UNSET, + source: Union[Unset, OsidbApiV1FlawsListSource] = UNSET, + statement: Union[Unset, str] = UNSET, + statement_isempty: Union[Unset, bool] = UNSET, + team_id: Union[Unset, str] = UNSET, + title: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, + unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + workflow_state: Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]] = UNSET, ) -> Optional[OsidbApiV1FlawsListResponse200]: - """ """ + """ + Args: + acknowledgments_affiliation (Union[Unset, str]): + acknowledgments_created_dt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_date (Union[Unset, datetime.date]): + acknowledgments_created_dt_date_gte (Union[Unset, datetime.date]): + acknowledgments_created_dt_date_lte (Union[Unset, datetime.date]): + acknowledgments_created_dt_gt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_gte (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_lt (Union[Unset, datetime.datetime]): + acknowledgments_created_dt_lte (Union[Unset, datetime.datetime]): + acknowledgments_from_upstream (Union[Unset, bool]): + acknowledgments_name (Union[Unset, str]): + acknowledgments_updated_dt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_date (Union[Unset, datetime.date]): + acknowledgments_updated_dt_date_gte (Union[Unset, datetime.date]): + acknowledgments_updated_dt_date_lte (Union[Unset, datetime.date]): + acknowledgments_updated_dt_gt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_gte (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_lt (Union[Unset, datetime.datetime]): + acknowledgments_updated_dt_lte (Union[Unset, datetime.datetime]): + acknowledgments_uuid (Union[Unset, UUID]): + affects_affectedness (Union[Unset, OsidbApiV1FlawsListAffectsAffectedness]): + affects_created_dt (Union[Unset, datetime.datetime]): + affects_created_dt_date (Union[Unset, datetime.date]): + affects_created_dt_date_gte (Union[Unset, datetime.date]): + affects_created_dt_date_lte (Union[Unset, datetime.date]): + affects_created_dt_gt (Union[Unset, datetime.datetime]): + affects_created_dt_gte (Union[Unset, datetime.datetime]): + affects_created_dt_lt (Union[Unset, datetime.datetime]): + affects_created_dt_lte (Union[Unset, datetime.datetime]): + affects_embargoed (Union[Unset, bool]): + affects_impact (Union[Unset, OsidbApiV1FlawsListAffectsImpact]): + affects_ps_component (Union[Unset, str]): + affects_ps_module (Union[Unset, str]): + affects_resolution (Union[Unset, OsidbApiV1FlawsListAffectsResolution]): + affects_trackers_created_dt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_date (Union[Unset, datetime.date]): + affects_trackers_created_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_created_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_created_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_created_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_embargoed (Union[Unset, bool]): + affects_trackers_errata_advisory_name (Union[Unset, str]): + affects_trackers_errata_et_id (Union[Unset, int]): + affects_trackers_errata_shipped_dt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_date (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_errata_shipped_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_errata_shipped_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_external_system_id (Union[Unset, str]): + affects_trackers_ps_update_stream (Union[Unset, str]): + affects_trackers_resolution (Union[Unset, str]): + affects_trackers_status (Union[Unset, str]): + affects_trackers_type (Union[Unset, OsidbApiV1FlawsListAffectsTrackersType]): + affects_trackers_updated_dt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_date (Union[Unset, datetime.date]): + affects_trackers_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_trackers_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_trackers_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_trackers_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_trackers_uuid (Union[Unset, UUID]): + affects_updated_dt (Union[Unset, datetime.datetime]): + affects_updated_dt_date (Union[Unset, datetime.date]): + affects_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_uuid (Union[Unset, UUID]): + bz_id (Union[Unset, float]): + changed_after (Union[Unset, datetime.datetime]): + changed_before (Union[Unset, datetime.datetime]): + comment_zero (Union[Unset, str]): + components (Union[Unset, list[str]]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + cve_description (Union[Unset, str]): + cve_description_isempty (Union[Unset, bool]): + cve_id (Union[Unset, list[str]]): + cve_id_isempty (Union[Unset, bool]): + cvss2_nist_isempty (Union[Unset, bool]): + cvss2_rh_isempty (Union[Unset, bool]): + cvss3_nist_isempty (Union[Unset, bool]): + cvss3_rh_isempty (Union[Unset, bool]): + cvss4_nist_isempty (Union[Unset, bool]): + cvss4_rh_isempty (Union[Unset, bool]): + cvss_scores_comment (Union[Unset, str]): + cvss_scores_created_dt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_date (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_created_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_created_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_created_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_cvss_version (Union[Unset, str]): + cvss_scores_issuer (Union[Unset, OsidbApiV1FlawsListCvssScoresIssuer]): + cvss_scores_score (Union[Unset, float]): + cvss_scores_updated_dt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_date (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_gte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_date_lte (Union[Unset, datetime.date]): + cvss_scores_updated_dt_gt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_gte (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lt (Union[Unset, datetime.datetime]): + cvss_scores_updated_dt_lte (Union[Unset, datetime.datetime]): + cvss_scores_uuid (Union[Unset, UUID]): + cvss_scores_vector (Union[Unset, str]): + cwe_id (Union[Unset, str]): + cwe_id_isempty (Union[Unset, bool]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + impact (Union[Unset, OsidbApiV1FlawsListImpact]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + major_incident_start_dt (Union[Unset, datetime.datetime]): + major_incident_start_dt_date (Union[Unset, datetime.date]): + major_incident_start_dt_date_gte (Union[Unset, datetime.date]): + major_incident_start_dt_date_lte (Union[Unset, datetime.date]): + major_incident_start_dt_gt (Union[Unset, datetime.datetime]): + major_incident_start_dt_gte (Union[Unset, datetime.datetime]): + major_incident_start_dt_lt (Union[Unset, datetime.datetime]): + major_incident_start_dt_lte (Union[Unset, datetime.datetime]): + major_incident_state (Union[Unset, OsidbApiV1FlawsListMajorIncidentState]): + mitigation_isempty (Union[Unset, bool]): + nist_cvss_validation (Union[Unset, OsidbApiV1FlawsListNistCvssValidation]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1FlawsListOrderItem]]): + owner (Union[Unset, str]): + owner_isempty (Union[Unset, bool]): + query (Union[Unset, str]): + references_created_dt (Union[Unset, datetime.datetime]): + references_created_dt_date (Union[Unset, datetime.date]): + references_created_dt_date_gte (Union[Unset, datetime.date]): + references_created_dt_date_lte (Union[Unset, datetime.date]): + references_created_dt_gt (Union[Unset, datetime.datetime]): + references_created_dt_gte (Union[Unset, datetime.datetime]): + references_created_dt_lt (Union[Unset, datetime.datetime]): + references_created_dt_lte (Union[Unset, datetime.datetime]): + references_description (Union[Unset, str]): + references_type (Union[Unset, OsidbApiV1FlawsListReferencesType]): + references_updated_dt (Union[Unset, datetime.datetime]): + references_updated_dt_date (Union[Unset, datetime.date]): + references_updated_dt_date_gte (Union[Unset, datetime.date]): + references_updated_dt_date_lte (Union[Unset, datetime.date]): + references_updated_dt_gt (Union[Unset, datetime.datetime]): + references_updated_dt_gte (Union[Unset, datetime.datetime]): + references_updated_dt_lt (Union[Unset, datetime.datetime]): + references_updated_dt_lte (Union[Unset, datetime.datetime]): + references_url (Union[Unset, str]): + references_uuid (Union[Unset, UUID]): + reported_dt (Union[Unset, datetime.datetime]): + reported_dt_date (Union[Unset, datetime.date]): + reported_dt_date_gte (Union[Unset, datetime.date]): + reported_dt_date_lte (Union[Unset, datetime.date]): + reported_dt_gt (Union[Unset, datetime.datetime]): + reported_dt_gte (Union[Unset, datetime.datetime]): + reported_dt_lt (Union[Unset, datetime.datetime]): + reported_dt_lte (Union[Unset, datetime.datetime]): + requires_cve_description (Union[Unset, OsidbApiV1FlawsListRequiresCveDescription]): + search (Union[Unset, str]): + source (Union[Unset, OsidbApiV1FlawsListSource]): + statement (Union[Unset, str]): + statement_isempty (Union[Unset, bool]): + team_id (Union[Unset, str]): + title (Union[Unset, str]): + tracker_ids (Union[Unset, list[str]]): + unembargo_dt (Union[Unset, datetime.datetime]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + workflow_state (Union[Unset, list[OsidbApiV1FlawsListWorkflowStateItem]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, acknowledgments_affiliation=acknowledgments_affiliation, acknowledgments_created_dt=acknowledgments_created_dt, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_create.py index 9fe9003..c2c0202 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_create.py @@ -1,50 +1,52 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.flaw_package_version_post import FlawPackageVersionPost from ...models.osidb_api_v1_flaws_package_versions_create_response_201 import ( OsidbApiV1FlawsPackageVersionsCreateResponse201, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawPackageVersionPost +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPost, - multipart_data: FlawPackageVersionPost, - json_body: FlawPackageVersionPost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/package_versions".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawPackageVersionPost, + FlawPackageVersionPost, + FlawPackageVersionPost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/package_versions".format( + flaw_id=flaw_id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawPackageVersionPost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsPackageVersionsCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -52,39 +54,56 @@ def _parse_response( if isinstance(_response_201, Unset): response_201 = UNSET else: - response_201 = OsidbApiV1FlawsPackageVersionsCreateResponse201.from_dict( - _response_201 - ) + response_201 = OsidbApiV1FlawsPackageVersionsCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsPackageVersionsCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPost, - multipart_data: FlawPackageVersionPost, - json_body: FlawPackageVersionPost, + body: Union[ + FlawPackageVersionPost, + FlawPackageVersionPost, + FlawPackageVersionPost, + ], ) -> Response[OsidbApiV1FlawsPackageVersionsCreateResponse201]: + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawPackageVersionPost): Package model serializer + body (FlawPackageVersionPost): Package model serializer + body (FlawPackageVersionPost): Package model serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -95,71 +114,108 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPost, - multipart_data: FlawPackageVersionPost, - json_body: FlawPackageVersionPost, + body: Union[ + FlawPackageVersionPost, + FlawPackageVersionPost, + FlawPackageVersionPost, + ], ) -> Optional[OsidbApiV1FlawsPackageVersionsCreateResponse201]: - """ """ + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawPackageVersionPost): Package model serializer + body (FlawPackageVersionPost): Package model serializer + body (FlawPackageVersionPost): Package model serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsCreateResponse201 + """ return sync_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPost, - multipart_data: FlawPackageVersionPost, - json_body: FlawPackageVersionPost, + body: Union[ + FlawPackageVersionPost, + FlawPackageVersionPost, + FlawPackageVersionPost, + ], ) -> Response[OsidbApiV1FlawsPackageVersionsCreateResponse201]: + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawPackageVersionPost): Package model serializer + body (FlawPackageVersionPost): Package model serializer + body (FlawPackageVersionPost): Package model serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPost, - multipart_data: FlawPackageVersionPost, - json_body: FlawPackageVersionPost, + body: Union[ + FlawPackageVersionPost, + FlawPackageVersionPost, + FlawPackageVersionPost, + ], ) -> Optional[OsidbApiV1FlawsPackageVersionsCreateResponse201]: - """ """ + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawPackageVersionPost): Package model serializer + body (FlawPackageVersionPost): Package model serializer + body (FlawPackageVersionPost): Package model serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_destroy.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_destroy.py index 445f25d..5083905 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_destroy.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_destroy.py @@ -1,38 +1,40 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_flaws_package_versions_destroy_response_200 import ( OsidbApiV1FlawsPackageVersionsDestroyResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/package_versions/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/package_versions/{id}".format( + flaw_id=flaw_id, + id=id, + ), } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsPackageVersionsDestroyResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -40,31 +42,47 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsPackageVersionsDestroyResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsPackageVersionsDestroyResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsPackageVersionsDestroyResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsPackageVersionsDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsDestroyResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, @@ -79,16 +97,29 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1FlawsPackageVersionsDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsDestroyResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -97,39 +128,60 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsPackageVersionsDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsDestroyResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, ) - async with client.get_async_session().delete( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1FlawsPackageVersionsDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsDestroyResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_list.py index 6b40dc1..facb379 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_list.py @@ -1,198 +1,186 @@ -import datetime -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_flaws_package_versions_list_response_200 import ( OsidbApiV1FlawsPackageVersionsListResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "created_dt": datetime.datetime, - "created_dt__date": datetime.date, - "created_dt__date__gte": datetime.date, - "created_dt__date__lte": datetime.date, - "created_dt__gt": datetime.datetime, - "created_dt__gte": datetime.datetime, - "created_dt__lt": datetime.datetime, - "created_dt__lte": datetime.datetime, - "exclude_fields": List[str], - "include_fields": List[str], - "limit": int, - "offset": int, - "package": str, - "updated_dt": datetime.datetime, - "updated_dt__date": datetime.date, - "updated_dt__date__gte": datetime.date, - "updated_dt__date__lte": datetime.date, - "updated_dt__gt": datetime.datetime, - "updated_dt__gte": datetime.datetime, - "updated_dt__lt": datetime.datetime, - "updated_dt__lte": datetime.datetime, - "uuid": str, - "versions__version": str, -} +from uuid import UUID +import datetime def _get_kwargs( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - package: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - versions_version: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/package_versions".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_created_dt: Union[Unset, None, str] = UNSET + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + package: Union[Unset, str] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + versions_version: Union[Unset, str] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_created_dt: Union[Unset, str] = UNSET if not isinstance(created_dt, Unset): - json_created_dt = created_dt.isoformat() if created_dt else None + json_created_dt = created_dt.isoformat() + + params["created_dt"] = json_created_dt - json_created_dt_date: Union[Unset, None, str] = UNSET + json_created_dt_date: Union[Unset, str] = UNSET if not isinstance(created_dt_date, Unset): - json_created_dt_date = created_dt_date.isoformat() if created_dt_date else None + json_created_dt_date = created_dt_date.isoformat() + + params["created_dt__date"] = json_created_dt_date - json_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_gte, Unset): - json_created_dt_date_gte = ( - created_dt_date_gte.isoformat() if created_dt_date_gte else None - ) + json_created_dt_date_gte = created_dt_date_gte.isoformat() + + params["created_dt__date__gte"] = json_created_dt_date_gte - json_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_lte, Unset): - json_created_dt_date_lte = ( - created_dt_date_lte.isoformat() if created_dt_date_lte else None - ) + json_created_dt_date_lte = created_dt_date_lte.isoformat() + + params["created_dt__date__lte"] = json_created_dt_date_lte - json_created_dt_gt: Union[Unset, None, str] = UNSET + json_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(created_dt_gt, Unset): - json_created_dt_gt = created_dt_gt.isoformat() if created_dt_gt else None + json_created_dt_gt = created_dt_gt.isoformat() + + params["created_dt__gt"] = json_created_dt_gt - json_created_dt_gte: Union[Unset, None, str] = UNSET + json_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_gte, Unset): - json_created_dt_gte = created_dt_gte.isoformat() if created_dt_gte else None + json_created_dt_gte = created_dt_gte.isoformat() - json_created_dt_lt: Union[Unset, None, str] = UNSET + params["created_dt__gte"] = json_created_dt_gte + + json_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(created_dt_lt, Unset): - json_created_dt_lt = created_dt_lt.isoformat() if created_dt_lt else None + json_created_dt_lt = created_dt_lt.isoformat() + + params["created_dt__lt"] = json_created_dt_lt - json_created_dt_lte: Union[Unset, None, str] = UNSET + json_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_lte, Unset): - json_created_dt_lte = created_dt_lte.isoformat() if created_dt_lte else None + json_created_dt_lte = created_dt_lte.isoformat() + + params["created_dt__lte"] = json_created_dt_lte - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields + + params["limit"] = limit - json_updated_dt: Union[Unset, None, str] = UNSET + params["offset"] = offset + + params["package"] = package + + json_updated_dt: Union[Unset, str] = UNSET if not isinstance(updated_dt, Unset): - json_updated_dt = updated_dt.isoformat() if updated_dt else None + json_updated_dt = updated_dt.isoformat() + + params["updated_dt"] = json_updated_dt - json_updated_dt_date: Union[Unset, None, str] = UNSET + json_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(updated_dt_date, Unset): - json_updated_dt_date = updated_dt_date.isoformat() if updated_dt_date else None + json_updated_dt_date = updated_dt_date.isoformat() - json_updated_dt_date_gte: Union[Unset, None, str] = UNSET + params["updated_dt__date"] = json_updated_dt_date + + json_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_gte, Unset): - json_updated_dt_date_gte = ( - updated_dt_date_gte.isoformat() if updated_dt_date_gte else None - ) + json_updated_dt_date_gte = updated_dt_date_gte.isoformat() + + params["updated_dt__date__gte"] = json_updated_dt_date_gte - json_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_lte, Unset): - json_updated_dt_date_lte = ( - updated_dt_date_lte.isoformat() if updated_dt_date_lte else None - ) + json_updated_dt_date_lte = updated_dt_date_lte.isoformat() + + params["updated_dt__date__lte"] = json_updated_dt_date_lte - json_updated_dt_gt: Union[Unset, None, str] = UNSET + json_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(updated_dt_gt, Unset): - json_updated_dt_gt = updated_dt_gt.isoformat() if updated_dt_gt else None + json_updated_dt_gt = updated_dt_gt.isoformat() + + params["updated_dt__gt"] = json_updated_dt_gt - json_updated_dt_gte: Union[Unset, None, str] = UNSET + json_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_gte, Unset): - json_updated_dt_gte = updated_dt_gte.isoformat() if updated_dt_gte else None + json_updated_dt_gte = updated_dt_gte.isoformat() - json_updated_dt_lt: Union[Unset, None, str] = UNSET + params["updated_dt__gte"] = json_updated_dt_gte + + json_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(updated_dt_lt, Unset): - json_updated_dt_lt = updated_dt_lt.isoformat() if updated_dt_lt else None + json_updated_dt_lt = updated_dt_lt.isoformat() + + params["updated_dt__lt"] = json_updated_dt_lt - json_updated_dt_lte: Union[Unset, None, str] = UNSET + json_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_lte, Unset): - json_updated_dt_lte = updated_dt_lte.isoformat() if updated_dt_lte else None - - params: Dict[str, Any] = { - "created_dt": json_created_dt, - "created_dt__date": json_created_dt_date, - "created_dt__date__gte": json_created_dt_date_gte, - "created_dt__date__lte": json_created_dt_date_lte, - "created_dt__gt": json_created_dt_gt, - "created_dt__gte": json_created_dt_gte, - "created_dt__lt": json_created_dt_lt, - "created_dt__lte": json_created_dt_lte, - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - "limit": limit, - "offset": offset, - "package": package, - "updated_dt": json_updated_dt, - "updated_dt__date": json_updated_dt_date, - "updated_dt__date__gte": json_updated_dt_date_gte, - "updated_dt__date__lte": json_updated_dt_date_lte, - "updated_dt__gt": json_updated_dt_gt, - "updated_dt__gte": json_updated_dt_gte, - "updated_dt__lt": json_updated_dt_lt, - "updated_dt__lte": json_updated_dt_lte, - "uuid": uuid, - "versions__version": versions_version, - } + json_updated_dt_lte = updated_dt_lte.isoformat() + + params["updated_dt__lte"] = json_updated_dt_lte + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid + + params["versions__version"] = versions_version + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/package_versions".format( + flaw_id=flaw_id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsPackageVersionsListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -200,53 +188,89 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsPackageVersionsListResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsPackageVersionsListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsPackageVersionsListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - package: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - versions_version: Union[Unset, None, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + package: Union[Unset, str] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + versions_version: Union[Unset, str] = UNSET, ) -> Response[OsidbApiV1FlawsPackageVersionsListResponse200]: + """ + Args: + flaw_id (UUID): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + package (Union[Unset, str]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + versions_version (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, @@ -283,38 +307,71 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - package: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - versions_version: Union[Unset, None, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + package: Union[Unset, str] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + versions_version: Union[Unset, str] = UNSET, ) -> Optional[OsidbApiV1FlawsPackageVersionsListResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + package (Union[Unset, str]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + versions_version (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsListResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -345,37 +402,71 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - package: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - versions_version: Union[Unset, None, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + package: Union[Unset, str] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + versions_version: Union[Unset, str] = UNSET, ) -> Response[OsidbApiV1FlawsPackageVersionsListResponse200]: + """ + Args: + flaw_id (UUID): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + package (Union[Unset, str]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + versions_version (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, created_dt=created_dt, created_dt_date=created_dt_date, created_dt_date_gte=created_dt_date_gte, @@ -401,49 +492,76 @@ async def async_detailed( versions_version=versions_version, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - package: Union[Unset, None, str] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, - versions_version: Union[Unset, None, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + package: Union[Unset, str] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, + versions_version: Union[Unset, str] = UNSET, ) -> Optional[OsidbApiV1FlawsPackageVersionsListResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + package (Union[Unset, str]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + versions_version (Union[Unset, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, created_dt=created_dt, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_retrieve.py index f7ad815..40867e6 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_retrieve.py @@ -1,64 +1,56 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_flaws_package_versions_retrieve_response_200 import ( OsidbApiV1FlawsPackageVersionsRetrieveResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], -} +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/package_versions/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + params["exclude_fields"] = json_exclude_fields + + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/package_versions/{id}".format( + flaw_id=flaw_id, + id=id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsPackageVersionsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -66,33 +58,49 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsPackageVersionsRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsPackageVersionsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsPackageVersionsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsPackageVersionsRetrieveResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, @@ -109,18 +117,31 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsPackageVersionsRetrieveResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsRetrieveResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -131,45 +152,66 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsPackageVersionsRetrieveResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsPackageVersionsRetrieveResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_update.py index 2289f9e..2234743 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_package_versions_update.py @@ -1,52 +1,54 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.flaw_package_version_put import FlawPackageVersionPut from ...models.osidb_api_v1_flaws_package_versions_update_response_200 import ( OsidbApiV1FlawsPackageVersionsUpdateResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawPackageVersionPut +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPut, - multipart_data: FlawPackageVersionPut, - json_body: FlawPackageVersionPut, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/package_versions/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawPackageVersionPut, + FlawPackageVersionPut, + FlawPackageVersionPut, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/package_versions/{id}".format( + flaw_id=flaw_id, + id=id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawPackageVersionPut): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsPackageVersionsUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -54,41 +56,59 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsPackageVersionsUpdateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsPackageVersionsUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsPackageVersionsUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPut, - multipart_data: FlawPackageVersionPut, - json_body: FlawPackageVersionPut, + body: Union[ + FlawPackageVersionPut, + FlawPackageVersionPut, + FlawPackageVersionPut, + ], ) -> Response[OsidbApiV1FlawsPackageVersionsUpdateResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawPackageVersionPut): Package model serializer + body (FlawPackageVersionPut): Package model serializer + body (FlawPackageVersionPut): Package model serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsUpdateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -99,77 +119,117 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPut, - multipart_data: FlawPackageVersionPut, - json_body: FlawPackageVersionPut, + body: Union[ + FlawPackageVersionPut, + FlawPackageVersionPut, + FlawPackageVersionPut, + ], ) -> Optional[OsidbApiV1FlawsPackageVersionsUpdateResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawPackageVersionPut): Package model serializer + body (FlawPackageVersionPut): Package model serializer + body (FlawPackageVersionPut): Package model serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsUpdateResponse200 + """ return sync_detailed( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPut, - multipart_data: FlawPackageVersionPut, - json_body: FlawPackageVersionPut, + body: Union[ + FlawPackageVersionPut, + FlawPackageVersionPut, + FlawPackageVersionPut, + ], ) -> Response[OsidbApiV1FlawsPackageVersionsUpdateResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawPackageVersionPut): Package model serializer + body (FlawPackageVersionPut): Package model serializer + body (FlawPackageVersionPut): Package model serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPackageVersionsUpdateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawPackageVersionPut, - multipart_data: FlawPackageVersionPut, - json_body: FlawPackageVersionPut, + body: Union[ + FlawPackageVersionPut, + FlawPackageVersionPut, + FlawPackageVersionPut, + ], ) -> Optional[OsidbApiV1FlawsPackageVersionsUpdateResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawPackageVersionPut): Package model serializer + body (FlawPackageVersionPut): Package model serializer + body (FlawPackageVersionPut): Package model serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPackageVersionsUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_promote_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_promote_create.py index f3faf82..a1a6db7 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_promote_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_promote_create.py @@ -1,36 +1,35 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_promote_create_response_200 import ( - OsidbApiV1FlawsPromoteCreateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_api_v1_flaws_promote_create_response_200 import OsidbApiV1FlawsPromoteCreateResponse200 def _get_kwargs( flaw_id: str, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/promote".format( - client.base_url, - flaw_id=flaw_id, - ) +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/promote".format( + flaw_id=flaw_id, + ), } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsPromoteCreateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -38,22 +37,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsPromoteCreateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsPromoteCreateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsPromoteCreateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -62,6 +62,24 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsPromoteCreateResponse200]: + """workflow promotion API endpoint + + try to adjust workflow classification of flaw to the next state available + return its workflow:state classification or errors if not possible to promote + + Args: + flaw_id (str): + bugzilla_api_key (str): + jira_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPromoteCreateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, @@ -75,7 +93,7 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( @@ -86,7 +104,20 @@ def sync( """workflow promotion API endpoint try to adjust workflow classification of flaw to the next state available - return its workflow:state classification or errors if not possible to promote""" + return its workflow:state classification or errors if not possible to promote + + Args: + flaw_id (str): + bugzilla_api_key (str): + jira_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPromoteCreateResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -94,28 +125,39 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( flaw_id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsPromoteCreateResponse200]: + """workflow promotion API endpoint + + try to adjust workflow classification of flaw to the next state available + return its workflow:state classification or errors if not possible to promote + + Args: + flaw_id (str): + bugzilla_api_key (str): + jira_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsPromoteCreateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( flaw_id: str, *, client: AuthenticatedClient, @@ -123,10 +165,23 @@ async def async_( """workflow promotion API endpoint try to adjust workflow classification of flaw to the next state available - return its workflow:state classification or errors if not possible to promote""" + return its workflow:state classification or errors if not possible to promote + + Args: + flaw_id (str): + bugzilla_api_key (str): + jira_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsPromoteCreateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, ) diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_create.py index a08bb46..ce1e307 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_create.py @@ -1,50 +1,50 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.flaw_reference_post import FlawReferencePost -from ...models.osidb_api_v1_flaws_references_create_response_201 import ( - OsidbApiV1FlawsReferencesCreateResponse201, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawReferencePost +from ...models.flaw_reference_post import FlawReferencePost +from ...models.osidb_api_v1_flaws_references_create_response_201 import OsidbApiV1FlawsReferencesCreateResponse201 +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawReferencePost, - multipart_data: FlawReferencePost, - json_body: FlawReferencePost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/references".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawReferencePost, + FlawReferencePost, + FlawReferencePost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/references".format( + flaw_id=flaw_id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawReferencePost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsReferencesCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -52,39 +52,56 @@ def _parse_response( if isinstance(_response_201, Unset): response_201 = UNSET else: - response_201 = OsidbApiV1FlawsReferencesCreateResponse201.from_dict( - _response_201 - ) + response_201 = OsidbApiV1FlawsReferencesCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsReferencesCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawReferencePost, - multipart_data: FlawReferencePost, - json_body: FlawReferencePost, + body: Union[ + FlawReferencePost, + FlawReferencePost, + FlawReferencePost, + ], ) -> Response[OsidbApiV1FlawsReferencesCreateResponse201]: + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawReferencePost): FlawReference serializer + body (FlawReferencePost): FlawReference serializer + body (FlawReferencePost): FlawReference serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -95,71 +112,108 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawReferencePost, - multipart_data: FlawReferencePost, - json_body: FlawReferencePost, + body: Union[ + FlawReferencePost, + FlawReferencePost, + FlawReferencePost, + ], ) -> Optional[OsidbApiV1FlawsReferencesCreateResponse201]: - """ """ + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawReferencePost): FlawReference serializer + body (FlawReferencePost): FlawReference serializer + body (FlawReferencePost): FlawReference serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesCreateResponse201 + """ return sync_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawReferencePost, - multipart_data: FlawReferencePost, - json_body: FlawReferencePost, + body: Union[ + FlawReferencePost, + FlawReferencePost, + FlawReferencePost, + ], ) -> Response[OsidbApiV1FlawsReferencesCreateResponse201]: + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawReferencePost): FlawReference serializer + body (FlawReferencePost): FlawReference serializer + body (FlawReferencePost): FlawReference serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesCreateResponse201] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, *, client: AuthenticatedClient, - form_data: FlawReferencePost, - multipart_data: FlawReferencePost, - json_body: FlawReferencePost, + body: Union[ + FlawReferencePost, + FlawReferencePost, + FlawReferencePost, + ], ) -> Optional[OsidbApiV1FlawsReferencesCreateResponse201]: - """ """ + """ + Args: + flaw_id (UUID): + bugzilla_api_key (str): + body (FlawReferencePost): FlawReference serializer + body (FlawReferencePost): FlawReference serializer + body (FlawReferencePost): FlawReference serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_destroy.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_destroy.py index 67a3a61..438db0a 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_destroy.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_destroy.py @@ -1,38 +1,38 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_references_destroy_response_200 import ( - OsidbApiV1FlawsReferencesDestroyResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_api_v1_flaws_references_destroy_response_200 import OsidbApiV1FlawsReferencesDestroyResponse200 +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/references/{id}".format( + flaw_id=flaw_id, + id=id, + ), } + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsReferencesDestroyResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -40,31 +40,47 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsReferencesDestroyResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsReferencesDestroyResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsReferencesDestroyResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsReferencesDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesDestroyResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, @@ -79,16 +95,29 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1FlawsReferencesDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesDestroyResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -97,39 +126,60 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Response[OsidbApiV1FlawsReferencesDestroyResponse200]: + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesDestroyResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, ) - async with client.get_async_session().delete( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1FlawsReferencesDestroyResponse200]: - """Destroy the instance and proxy the delete to Bugzilla""" + """Destroy the instance and proxy the delete to Bugzilla + + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesDestroyResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_list.py index 5c3c09b..57fbfd7 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_list.py @@ -1,209 +1,193 @@ -import datetime -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_references_list_response_200 import ( - OsidbApiV1FlawsReferencesListResponse200, -) -from ...models.osidb_api_v1_flaws_references_list_type import ( - OsidbApiV1FlawsReferencesListType, -) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "created_dt": datetime.datetime, - "created_dt__date": datetime.date, - "created_dt__date__gte": datetime.date, - "created_dt__date__lte": datetime.date, - "created_dt__gt": datetime.datetime, - "created_dt__gte": datetime.datetime, - "created_dt__lt": datetime.datetime, - "created_dt__lte": datetime.datetime, - "description": str, - "exclude_fields": List[str], - "include_fields": List[str], - "limit": int, - "offset": int, - "type": OsidbApiV1FlawsReferencesListType, - "updated_dt": datetime.datetime, - "updated_dt__date": datetime.date, - "updated_dt__date__gte": datetime.date, - "updated_dt__date__lte": datetime.date, - "updated_dt__gt": datetime.datetime, - "updated_dt__gte": datetime.datetime, - "updated_dt__lt": datetime.datetime, - "updated_dt__lte": datetime.datetime, - "url": str, - "uuid": str, -} +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + +from ...models.osidb_api_v1_flaws_references_list_response_200 import OsidbApiV1FlawsReferencesListResponse200 +from ...models.osidb_api_v1_flaws_references_list_type import OsidbApiV1FlawsReferencesListType +from uuid import UUID +import datetime def _get_kwargs( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - description: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - type: Union[Unset, None, OsidbApiV1FlawsReferencesListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - url: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/references".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_created_dt: Union[Unset, None, str] = UNSET + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + description: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + type_: Union[Unset, OsidbApiV1FlawsReferencesListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + url_query: Union[Unset, str] = UNSET, + uuid: Union[Unset, UUID] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + json_created_dt: Union[Unset, str] = UNSET if not isinstance(created_dt, Unset): - json_created_dt = created_dt.isoformat() if created_dt else None + json_created_dt = created_dt.isoformat() + + params["created_dt"] = json_created_dt - json_created_dt_date: Union[Unset, None, str] = UNSET + json_created_dt_date: Union[Unset, str] = UNSET if not isinstance(created_dt_date, Unset): - json_created_dt_date = created_dt_date.isoformat() if created_dt_date else None + json_created_dt_date = created_dt_date.isoformat() + + params["created_dt__date"] = json_created_dt_date - json_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_gte, Unset): - json_created_dt_date_gte = ( - created_dt_date_gte.isoformat() if created_dt_date_gte else None - ) + json_created_dt_date_gte = created_dt_date_gte.isoformat() + + params["created_dt__date__gte"] = json_created_dt_date_gte - json_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_lte, Unset): - json_created_dt_date_lte = ( - created_dt_date_lte.isoformat() if created_dt_date_lte else None - ) + json_created_dt_date_lte = created_dt_date_lte.isoformat() + + params["created_dt__date__lte"] = json_created_dt_date_lte - json_created_dt_gt: Union[Unset, None, str] = UNSET + json_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(created_dt_gt, Unset): - json_created_dt_gt = created_dt_gt.isoformat() if created_dt_gt else None + json_created_dt_gt = created_dt_gt.isoformat() + + params["created_dt__gt"] = json_created_dt_gt - json_created_dt_gte: Union[Unset, None, str] = UNSET + json_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_gte, Unset): - json_created_dt_gte = created_dt_gte.isoformat() if created_dt_gte else None + json_created_dt_gte = created_dt_gte.isoformat() - json_created_dt_lt: Union[Unset, None, str] = UNSET + params["created_dt__gte"] = json_created_dt_gte + + json_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(created_dt_lt, Unset): - json_created_dt_lt = created_dt_lt.isoformat() if created_dt_lt else None + json_created_dt_lt = created_dt_lt.isoformat() + + params["created_dt__lt"] = json_created_dt_lt - json_created_dt_lte: Union[Unset, None, str] = UNSET + json_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_lte, Unset): - json_created_dt_lte = created_dt_lte.isoformat() if created_dt_lte else None + json_created_dt_lte = created_dt_lte.isoformat() + + params["created_dt__lte"] = json_created_dt_lte - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + params["description"] = description + + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - json_type: Union[Unset, None, str] = UNSET - if not isinstance(type, Unset): + params["limit"] = limit - json_type = OsidbApiV1FlawsReferencesListType(type).value if type else None + params["offset"] = offset - json_updated_dt: Union[Unset, None, str] = UNSET + print(OsidbApiV1FlawsReferencesListType) + json_type_: Union[Unset, str] = UNSET + if not isinstance(type_, Unset): + json_type_ = type_.value + + params["type"] = json_type_ + + json_updated_dt: Union[Unset, str] = UNSET if not isinstance(updated_dt, Unset): - json_updated_dt = updated_dt.isoformat() if updated_dt else None + json_updated_dt = updated_dt.isoformat() + + params["updated_dt"] = json_updated_dt - json_updated_dt_date: Union[Unset, None, str] = UNSET + json_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(updated_dt_date, Unset): - json_updated_dt_date = updated_dt_date.isoformat() if updated_dt_date else None + json_updated_dt_date = updated_dt_date.isoformat() - json_updated_dt_date_gte: Union[Unset, None, str] = UNSET + params["updated_dt__date"] = json_updated_dt_date + + json_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_gte, Unset): - json_updated_dt_date_gte = ( - updated_dt_date_gte.isoformat() if updated_dt_date_gte else None - ) + json_updated_dt_date_gte = updated_dt_date_gte.isoformat() + + params["updated_dt__date__gte"] = json_updated_dt_date_gte - json_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_lte, Unset): - json_updated_dt_date_lte = ( - updated_dt_date_lte.isoformat() if updated_dt_date_lte else None - ) + json_updated_dt_date_lte = updated_dt_date_lte.isoformat() + + params["updated_dt__date__lte"] = json_updated_dt_date_lte - json_updated_dt_gt: Union[Unset, None, str] = UNSET + json_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(updated_dt_gt, Unset): - json_updated_dt_gt = updated_dt_gt.isoformat() if updated_dt_gt else None + json_updated_dt_gt = updated_dt_gt.isoformat() + + params["updated_dt__gt"] = json_updated_dt_gt - json_updated_dt_gte: Union[Unset, None, str] = UNSET + json_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_gte, Unset): - json_updated_dt_gte = updated_dt_gte.isoformat() if updated_dt_gte else None + json_updated_dt_gte = updated_dt_gte.isoformat() - json_updated_dt_lt: Union[Unset, None, str] = UNSET + params["updated_dt__gte"] = json_updated_dt_gte + + json_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(updated_dt_lt, Unset): - json_updated_dt_lt = updated_dt_lt.isoformat() if updated_dt_lt else None + json_updated_dt_lt = updated_dt_lt.isoformat() + + params["updated_dt__lt"] = json_updated_dt_lt - json_updated_dt_lte: Union[Unset, None, str] = UNSET + json_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_lte, Unset): - json_updated_dt_lte = updated_dt_lte.isoformat() if updated_dt_lte else None - - params: Dict[str, Any] = { - "created_dt": json_created_dt, - "created_dt__date": json_created_dt_date, - "created_dt__date__gte": json_created_dt_date_gte, - "created_dt__date__lte": json_created_dt_date_lte, - "created_dt__gt": json_created_dt_gt, - "created_dt__gte": json_created_dt_gte, - "created_dt__lt": json_created_dt_lt, - "created_dt__lte": json_created_dt_lte, - "description": description, - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - "limit": limit, - "offset": offset, - "type": json_type, - "updated_dt": json_updated_dt, - "updated_dt__date": json_updated_dt_date, - "updated_dt__date__gte": json_updated_dt_date_gte, - "updated_dt__date__lte": json_updated_dt_date_lte, - "updated_dt__gt": json_updated_dt_gt, - "updated_dt__gte": json_updated_dt_gte, - "updated_dt__lt": json_updated_dt_lt, - "updated_dt__lte": json_updated_dt_lte, - "url": url, - "uuid": uuid, - } + json_updated_dt_lte = updated_dt_lte.isoformat() + + params["updated_dt__lte"] = json_updated_dt_lte + + params["url"] = url_query + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/references".format( + flaw_id=flaw_id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsReferencesListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -211,54 +195,91 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsReferencesListResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsReferencesListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsReferencesListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - description: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - type: Union[Unset, None, OsidbApiV1FlawsReferencesListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - url: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + description: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + type_: Union[Unset, OsidbApiV1FlawsReferencesListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + url_query: Union[Unset, str] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1FlawsReferencesListResponse200]: + """ + Args: + flaw_id (UUID): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + description (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + type_ (Union[Unset, OsidbApiV1FlawsReferencesListType]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + url_query (Union[Unset, str]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, @@ -275,7 +296,7 @@ def sync_detailed( include_fields=include_fields, limit=limit, offset=offset, - type=type, + type_=type_, updated_dt=updated_dt, updated_dt_date=updated_dt_date, updated_dt_date_gte=updated_dt_date_gte, @@ -284,7 +305,7 @@ def sync_detailed( updated_dt_gte=updated_dt_gte, updated_dt_lt=updated_dt_lt, updated_dt_lte=updated_dt_lte, - url=url, + url_query=url_query, uuid=uuid, ) @@ -296,39 +317,73 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - description: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - type: Union[Unset, None, OsidbApiV1FlawsReferencesListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - url: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + description: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + type_: Union[Unset, OsidbApiV1FlawsReferencesListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + url_query: Union[Unset, str] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1FlawsReferencesListResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + description (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + type_ (Union[Unset, OsidbApiV1FlawsReferencesListType]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + url_query (Union[Unset, str]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesListResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -346,7 +401,7 @@ def sync( include_fields=include_fields, limit=limit, offset=offset, - type=type, + type_=type_, updated_dt=updated_dt, updated_dt_date=updated_dt_date, updated_dt_date_gte=updated_dt_date_gte, @@ -355,43 +410,78 @@ def sync( updated_dt_gte=updated_dt_gte, updated_dt_lt=updated_dt_lt, updated_dt_lte=updated_dt_lte, - url=url, + url_query=url_query, uuid=uuid, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - description: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - type: Union[Unset, None, OsidbApiV1FlawsReferencesListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - url: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + description: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + type_: Union[Unset, OsidbApiV1FlawsReferencesListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + url_query: Union[Unset, str] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1FlawsReferencesListResponse200]: + """ + Args: + flaw_id (UUID): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + description (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + type_ (Union[Unset, OsidbApiV1FlawsReferencesListType]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + url_query (Union[Unset, str]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesListResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, created_dt=created_dt, created_dt_date=created_dt_date, created_dt_date_gte=created_dt_date_gte, @@ -405,7 +495,7 @@ async def async_detailed( include_fields=include_fields, limit=limit, offset=offset, - type=type, + type_=type_, updated_dt=updated_dt, updated_dt_date=updated_dt_date, updated_dt_date_gte=updated_dt_date_gte, @@ -414,54 +504,82 @@ async def async_detailed( updated_dt_gte=updated_dt_gte, updated_dt_lt=updated_dt_lt, updated_dt_lte=updated_dt_lte, - url=url, + url_query=url_query, uuid=uuid, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, *, client: AuthenticatedClient, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - description: Union[Unset, None, str] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - type: Union[Unset, None, OsidbApiV1FlawsReferencesListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - url: Union[Unset, None, str] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + description: Union[Unset, str] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + type_: Union[Unset, OsidbApiV1FlawsReferencesListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + url_query: Union[Unset, str] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1FlawsReferencesListResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + description (Union[Unset, str]): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + type_ (Union[Unset, OsidbApiV1FlawsReferencesListType]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + url_query (Union[Unset, str]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, created_dt=created_dt, @@ -477,7 +595,7 @@ async def async_( include_fields=include_fields, limit=limit, offset=offset, - type=type, + type_=type_, updated_dt=updated_dt, updated_dt_date=updated_dt_date, updated_dt_date_gte=updated_dt_date_gte, @@ -486,7 +604,7 @@ async def async_( updated_dt_gte=updated_dt_gte, updated_dt_lt=updated_dt_lt, updated_dt_lte=updated_dt_lte, - url=url, + url_query=url_query, uuid=uuid, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_retrieve.py index 5d1543d..4dc5fe1 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_retrieve.py @@ -1,64 +1,54 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_references_retrieve_response_200 import ( - OsidbApiV1FlawsReferencesRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], -} +from ...models.osidb_api_v1_flaws_references_retrieve_response_200 import OsidbApiV1FlawsReferencesRetrieveResponse200 +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() - - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/references/{id}".format( + flaw_id=flaw_id, + id=id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsReferencesRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -66,33 +56,49 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsReferencesRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsReferencesRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsReferencesRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsReferencesRetrieveResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, @@ -109,18 +115,31 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsReferencesRetrieveResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesRetrieveResponse200 + """ return sync_detailed( flaw_id=flaw_id, @@ -131,45 +150,66 @@ def sync( ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsReferencesRetrieveResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesRetrieveResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsReferencesRetrieveResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_update.py index 6da1ceb..35bab1c 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_update.py @@ -1,52 +1,52 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.flaw_reference_put import FlawReferencePut -from ...models.osidb_api_v1_flaws_references_update_response_200 import ( - OsidbApiV1FlawsReferencesUpdateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawReferencePut +from ...models.flaw_reference_put import FlawReferencePut +from ...models.osidb_api_v1_flaws_references_update_response_200 import OsidbApiV1FlawsReferencesUpdateResponse200 +from uuid import UUID def _get_kwargs( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawReferencePut, - multipart_data: FlawReferencePut, - json_body: FlawReferencePut, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{id}".format( - client.base_url, - flaw_id=flaw_id, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawReferencePut, + FlawReferencePut, + FlawReferencePut, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/references/{id}".format( + flaw_id=flaw_id, + id=id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawReferencePut): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsReferencesUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -54,41 +54,59 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsReferencesUpdateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsReferencesUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsReferencesUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawReferencePut, - multipart_data: FlawReferencePut, - json_body: FlawReferencePut, + body: Union[ + FlawReferencePut, + FlawReferencePut, + FlawReferencePut, + ], ) -> Response[OsidbApiV1FlawsReferencesUpdateResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawReferencePut): FlawReference serializer + body (FlawReferencePut): FlawReference serializer + body (FlawReferencePut): FlawReference serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesUpdateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -99,77 +117,117 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - flaw_id: str, + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawReferencePut, - multipart_data: FlawReferencePut, - json_body: FlawReferencePut, + body: Union[ + FlawReferencePut, + FlawReferencePut, + FlawReferencePut, + ], ) -> Optional[OsidbApiV1FlawsReferencesUpdateResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawReferencePut): FlawReference serializer + body (FlawReferencePut): FlawReference serializer + body (FlawReferencePut): FlawReference serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesUpdateResponse200 + """ return sync_detailed( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - flaw_id: str, +async def asyncio_detailed( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawReferencePut, - multipart_data: FlawReferencePut, - json_body: FlawReferencePut, + body: Union[ + FlawReferencePut, + FlawReferencePut, + FlawReferencePut, + ], ) -> Response[OsidbApiV1FlawsReferencesUpdateResponse200]: + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawReferencePut): FlawReference serializer + body (FlawReferencePut): FlawReference serializer + body (FlawReferencePut): FlawReference serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsReferencesUpdateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, id=id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - flaw_id: str, +async def asyncio( + flaw_id: UUID, id: str, *, client: AuthenticatedClient, - form_data: FlawReferencePut, - multipart_data: FlawReferencePut, - json_body: FlawReferencePut, + body: Union[ + FlawReferencePut, + FlawReferencePut, + FlawReferencePut, + ], ) -> Optional[OsidbApiV1FlawsReferencesUpdateResponse200]: - """ """ + """ + Args: + flaw_id (UUID): + id (str): + bugzilla_api_key (str): + body (FlawReferencePut): FlawReference serializer + body (FlawReferencePut): FlawReference serializer + body (FlawReferencePut): FlawReference serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsReferencesUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_reject_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_reject_create.py index 1a66793..66fa5a5 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_reject_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_reject_create.py @@ -1,50 +1,49 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_reject_create_response_200 import ( - OsidbApiV1FlawsRejectCreateResponse200, -) -from ...models.reject import Reject -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = Reject +from ...models.osidb_api_v1_flaws_reject_create_response_200 import OsidbApiV1FlawsRejectCreateResponse200 +from ...models.reject import Reject def _get_kwargs( flaw_id: str, *, client: AuthenticatedClient, - form_data: Reject, - multipart_data: Reject, - json_body: Reject, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{flaw_id}/reject".format( - client.base_url, - flaw_id=flaw_id, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + Reject, + Reject, + Reject, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{flaw_id}/reject".format( + flaw_id=flaw_id, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, Reject): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsRejectCreateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -52,22 +51,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1FlawsRejectCreateResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1FlawsRejectCreateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsRejectCreateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -75,16 +75,36 @@ def sync_detailed( flaw_id: str, *, client: AuthenticatedClient, - form_data: Reject, - multipart_data: Reject, - json_body: Reject, + body: Union[ + Reject, + Reject, + Reject, + ], ) -> Response[OsidbApiV1FlawsRejectCreateResponse200]: + """workflow promotion API endpoint + + try to reject a flaw / task + + Args: + flaw_id (str): + bugzilla_api_key (str): + jira_api_key (str): + body (Reject): Task rejection serializer + body (Reject): Task rejection serializer + body (Reject): Task rejection serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsRejectCreateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -95,75 +115,120 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( flaw_id: str, *, client: AuthenticatedClient, - form_data: Reject, - multipart_data: Reject, - json_body: Reject, + body: Union[ + Reject, + Reject, + Reject, + ], ) -> Optional[OsidbApiV1FlawsRejectCreateResponse200]: """workflow promotion API endpoint - try to reject a flaw / task""" + try to reject a flaw / task + + Args: + flaw_id (str): + bugzilla_api_key (str): + jira_api_key (str): + body (Reject): Task rejection serializer + body (Reject): Task rejection serializer + body (Reject): Task rejection serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsRejectCreateResponse200 + """ return sync_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( flaw_id: str, *, client: AuthenticatedClient, - form_data: Reject, - multipart_data: Reject, - json_body: Reject, + body: Union[ + Reject, + Reject, + Reject, + ], ) -> Response[OsidbApiV1FlawsRejectCreateResponse200]: + """workflow promotion API endpoint + + try to reject a flaw / task + + Args: + flaw_id (str): + bugzilla_api_key (str): + jira_api_key (str): + body (Reject): Task rejection serializer + body (Reject): Task rejection serializer + body (Reject): Task rejection serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsRejectCreateResponse200] + """ + kwargs = _get_kwargs( flaw_id=flaw_id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( flaw_id: str, *, client: AuthenticatedClient, - form_data: Reject, - multipart_data: Reject, - json_body: Reject, + body: Union[ + Reject, + Reject, + Reject, + ], ) -> Optional[OsidbApiV1FlawsRejectCreateResponse200]: """workflow promotion API endpoint - try to reject a flaw / task""" + try to reject a flaw / task + + Args: + flaw_id (str): + bugzilla_api_key (str): + jira_api_key (str): + body (Reject): Task rejection serializer + body (Reject): Task rejection serializer + body (Reject): Task rejection serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsRejectCreateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( flaw_id=flaw_id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_retrieve.py index db22c86..e42e80d 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_retrieve.py @@ -1,85 +1,68 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_flaws_retrieve_response_200 import ( - OsidbApiV1FlawsRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], - "include_meta_attr": List[str], - "query": str, - "tracker_ids": List[str], -} +from ...models.osidb_api_v1_flaws_retrieve_response_200 import OsidbApiV1FlawsRetrieveResponse200 def _get_kwargs( id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - query: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{id}".format( - client.base_url, - id=id, - ) + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + query: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() - - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + params["exclude_fields"] = json_exclude_fields + + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields + + params["include_fields"] = json_include_fields - json_include_meta_attr: Union[Unset, None, List[str]] = UNSET + json_include_meta_attr: Union[Unset, list[str]] = UNSET if not isinstance(include_meta_attr, Unset): - if include_meta_attr is None: - json_include_meta_attr = None - else: - json_include_meta_attr = include_meta_attr + json_include_meta_attr = include_meta_attr + + params["include_meta_attr"] = json_include_meta_attr - json_tracker_ids: Union[Unset, None, List[str]] = UNSET + params["query"] = query + + json_tracker_ids: Union[Unset, list[str]] = UNSET if not isinstance(tracker_ids, Unset): - if tracker_ids is None: - json_tracker_ids = None - else: - json_tracker_ids = tracker_ids - - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - "include_meta_attr": json_include_meta_attr, - "query": query, - "tracker_ids": json_tracker_ids, - } + json_tracker_ids = tracker_ids + + params["tracker_ids"] = json_tracker_ids + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{id}".format( + id=id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -90,17 +73,20 @@ def _parse_response( response_200 = OsidbApiV1FlawsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -108,12 +94,29 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - query: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + query: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsRetrieveResponse200]: + """ + Args: + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + query (Union[Unset, str]): + tracker_ids (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsRetrieveResponse200] + """ + kwargs = _get_kwargs( id=id, client=client, @@ -132,20 +135,35 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - query: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + query: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsRetrieveResponse200]: - """ """ + """ + Args: + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + query (Union[Unset, str]): + tracker_ids (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsRetrieveResponse200 + """ return sync_detailed( id=id, @@ -158,19 +176,35 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - query: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + query: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1FlawsRetrieveResponse200]: + """ + Args: + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + query (Union[Unset, str]): + tracker_ids (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsRetrieveResponse200] + """ + kwargs = _get_kwargs( id=id, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, include_meta_attr=include_meta_attr, @@ -178,31 +212,40 @@ async def async_detailed( tracker_ids=tracker_ids, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( id: str, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - query: Union[Unset, None, str] = UNSET, - tracker_ids: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + query: Union[Unset, str] = UNSET, + tracker_ids: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1FlawsRetrieveResponse200]: - """ """ + """ + Args: + id (str): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + query (Union[Unset, str]): + tracker_ids (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( id=id, client=client, exclude_fields=exclude_fields, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_update.py index 25eb5de..1e0b367 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_update.py @@ -1,59 +1,57 @@ -from typing import Any, Dict, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.flaw import Flaw -from ...models.osidb_api_v1_flaws_update_response_200 import ( - OsidbApiV1FlawsUpdateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "create_jira_task": bool, -} -REQUEST_BODY_TYPE = Flaw +from ...models.flaw import Flaw +from ...models.osidb_api_v1_flaws_update_response_200 import OsidbApiV1FlawsUpdateResponse200 def _get_kwargs( id: str, *, client: AuthenticatedClient, - form_data: Flaw, - multipart_data: Flaw, - json_body: Flaw, - create_jira_task: Union[Unset, None, bool] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/flaws/{id}".format( - client.base_url, - id=id, - ) + body: Union[ + Flaw, + Flaw, + Flaw, + ], + create_jira_task: Union[Unset, bool] = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() - headers: Dict[str, Any] = client.get_headers() + params: dict[str, Any] = {} - params: Dict[str, Any] = { - "create_jira_task": create_jira_task, - } - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + params["create_jira_task"] = create_jira_task - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() - - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/flaws/{id}".format( + id=id, + ), "params": params, } + if isinstance(body, Flaw): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() + + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1FlawsUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -64,17 +62,20 @@ def _parse_response( response_200 = OsidbApiV1FlawsUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1FlawsUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -82,17 +83,35 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - form_data: Flaw, - multipart_data: Flaw, - json_body: Flaw, - create_jira_task: Union[Unset, None, bool] = UNSET, + body: Union[ + Flaw, + Flaw, + Flaw, + ], + create_jira_task: Union[Unset, bool] = UNSET, ) -> Response[OsidbApiV1FlawsUpdateResponse200]: + """ + Args: + id (str): + create_jira_task (Union[Unset, bool]): + bugzilla_api_key (str): + jira_api_key (str): + body (Flaw): serialize flaw model + body (Flaw): serialize flaw model + body (Flaw): serialize flaw model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsUpdateResponse200] + """ + kwargs = _get_kwargs( id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, create_jira_task=create_jira_task, ) @@ -104,77 +123,120 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( id: str, *, client: AuthenticatedClient, - form_data: Flaw, - multipart_data: Flaw, - json_body: Flaw, - create_jira_task: Union[Unset, None, bool] = UNSET, + body: Union[ + Flaw, + Flaw, + Flaw, + ], + create_jira_task: Union[Unset, bool] = UNSET, ) -> Optional[OsidbApiV1FlawsUpdateResponse200]: - """ """ + """ + Args: + id (str): + create_jira_task (Union[Unset, bool]): + bugzilla_api_key (str): + jira_api_key (str): + body (Flaw): serialize flaw model + body (Flaw): serialize flaw model + body (Flaw): serialize flaw model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsUpdateResponse200 + """ return sync_detailed( id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, create_jira_task=create_jira_task, ).parsed -async def async_detailed( +async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - form_data: Flaw, - multipart_data: Flaw, - json_body: Flaw, - create_jira_task: Union[Unset, None, bool] = UNSET, + body: Union[ + Flaw, + Flaw, + Flaw, + ], + create_jira_task: Union[Unset, bool] = UNSET, ) -> Response[OsidbApiV1FlawsUpdateResponse200]: + """ + Args: + id (str): + create_jira_task (Union[Unset, bool]): + bugzilla_api_key (str): + jira_api_key (str): + body (Flaw): serialize flaw model + body (Flaw): serialize flaw model + body (Flaw): serialize flaw model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1FlawsUpdateResponse200] + """ + kwargs = _get_kwargs( id=id, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, create_jira_task=create_jira_task, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( id: str, *, client: AuthenticatedClient, - form_data: Flaw, - multipart_data: Flaw, - json_body: Flaw, - create_jira_task: Union[Unset, None, bool] = UNSET, + body: Union[ + Flaw, + Flaw, + Flaw, + ], + create_jira_task: Union[Unset, bool] = UNSET, ) -> Optional[OsidbApiV1FlawsUpdateResponse200]: - """ """ + """ + Args: + id (str): + create_jira_task (Union[Unset, bool]): + bugzilla_api_key (str): + jira_api_key (str): + body (Flaw): serialize flaw model + body (Flaw): serialize flaw model + body (Flaw): serialize flaw model + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1FlawsUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( id=id, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, create_jira_task=create_jira_task, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_manifest_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_manifest_retrieve.py index 2378803..985a36b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_manifest_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_manifest_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_manifest_retrieve_response_200 import ( - OsidbApiV1ManifestRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_api_v1_manifest_retrieve_response_200 import OsidbApiV1ManifestRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/manifest".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/manifest", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1ManifestRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +31,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1ManifestRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1ManifestRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1ManifestRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbApiV1ManifestRetrieveResponse200]: + """HTTP get /manifest + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1ManifestRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1ManifestRetrieveResponse200]: - """HTTP get /manifest""" + """HTTP get /manifest + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1ManifestRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbApiV1ManifestRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """HTTP get /manifest + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[OsidbApiV1ManifestRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1ManifestRetrieveResponse200]: - """HTTP get /manifest""" + """HTTP get /manifest + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1ManifestRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_schema_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_schema_retrieve.py index 19afe12..5620fd6 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_schema_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_schema_retrieve.py @@ -1,60 +1,52 @@ -from typing import Any, Dict, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.osidb_api_v1_schema_retrieve_format import OsidbApiV1SchemaRetrieveFormat from ...models.osidb_api_v1_schema_retrieve_lang import OsidbApiV1SchemaRetrieveLang -from ...models.osidb_api_v1_schema_retrieve_response_200 import ( - OsidbApiV1SchemaRetrieveResponse200, -) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "format": OsidbApiV1SchemaRetrieveFormat, - "lang": OsidbApiV1SchemaRetrieveLang, -} +from ...models.osidb_api_v1_schema_retrieve_response_200 import OsidbApiV1SchemaRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, - format_: Union[Unset, None, OsidbApiV1SchemaRetrieveFormat] = UNSET, - lang: Union[Unset, None, OsidbApiV1SchemaRetrieveLang] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/schema/".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() + format_: Union[Unset, OsidbApiV1SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, OsidbApiV1SchemaRetrieveLang] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - json_format_: Union[Unset, None, str] = UNSET + print(OsidbApiV1SchemaRetrieveFormat) + json_format_: Union[Unset, str] = UNSET if not isinstance(format_, Unset): + json_format_ = format_.value - json_format_ = ( - OsidbApiV1SchemaRetrieveFormat(format_).value if format_ else None - ) + params["format"] = json_format_ - json_lang: Union[Unset, None, str] = UNSET + print(OsidbApiV1SchemaRetrieveLang) + json_lang: Union[Unset, str] = UNSET if not isinstance(lang, Unset): + json_lang = lang.value - json_lang = OsidbApiV1SchemaRetrieveLang(lang).value if lang else None + params["lang"] = json_lang - params: Dict[str, Any] = { - "format": json_format_, - "lang": json_lang, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/schema/", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1SchemaRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -65,26 +57,46 @@ def _parse_response( response_200 = OsidbApiV1SchemaRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1SchemaRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - format_: Union[Unset, None, OsidbApiV1SchemaRetrieveFormat] = UNSET, - lang: Union[Unset, None, OsidbApiV1SchemaRetrieveLang] = UNSET, + format_: Union[Unset, OsidbApiV1SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, OsidbApiV1SchemaRetrieveLang] = UNSET, ) -> Response[OsidbApiV1SchemaRetrieveResponse200]: + """OpenApi3 schema for this API. Format can be selected via content negotiation. + + - YAML: application/vnd.oai.openapi + - JSON: application/vnd.oai.openapi+json + + Args: + format_ (Union[Unset, OsidbApiV1SchemaRetrieveFormat]): + lang (Union[Unset, OsidbApiV1SchemaRetrieveLang]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1SchemaRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, format_=format_, @@ -99,19 +111,31 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - format_: Union[Unset, None, OsidbApiV1SchemaRetrieveFormat] = UNSET, - lang: Union[Unset, None, OsidbApiV1SchemaRetrieveLang] = UNSET, + format_: Union[Unset, OsidbApiV1SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, OsidbApiV1SchemaRetrieveLang] = UNSET, ) -> Optional[OsidbApiV1SchemaRetrieveResponse200]: """OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - - JSON: application/vnd.oai.openapi+json""" + - JSON: application/vnd.oai.openapi+json + + Args: + format_ (Union[Unset, OsidbApiV1SchemaRetrieveFormat]): + lang (Union[Unset, OsidbApiV1SchemaRetrieveLang]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1SchemaRetrieveResponse200 + """ return sync_detailed( client=client, @@ -120,42 +144,64 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - format_: Union[Unset, None, OsidbApiV1SchemaRetrieveFormat] = UNSET, - lang: Union[Unset, None, OsidbApiV1SchemaRetrieveLang] = UNSET, + format_: Union[Unset, OsidbApiV1SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, OsidbApiV1SchemaRetrieveLang] = UNSET, ) -> Response[OsidbApiV1SchemaRetrieveResponse200]: + """OpenApi3 schema for this API. Format can be selected via content negotiation. + + - YAML: application/vnd.oai.openapi + - JSON: application/vnd.oai.openapi+json + + Args: + format_ (Union[Unset, OsidbApiV1SchemaRetrieveFormat]): + lang (Union[Unset, OsidbApiV1SchemaRetrieveLang]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1SchemaRetrieveResponse200] + """ + kwargs = _get_kwargs( - client=client, format_=format_, lang=lang, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - format_: Union[Unset, None, OsidbApiV1SchemaRetrieveFormat] = UNSET, - lang: Union[Unset, None, OsidbApiV1SchemaRetrieveLang] = UNSET, + format_: Union[Unset, OsidbApiV1SchemaRetrieveFormat] = UNSET, + lang: Union[Unset, OsidbApiV1SchemaRetrieveLang] = UNSET, ) -> Optional[OsidbApiV1SchemaRetrieveResponse200]: """OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - - JSON: application/vnd.oai.openapi+json""" + - JSON: application/vnd.oai.openapi+json + + Args: + format_ (Union[Unset, OsidbApiV1SchemaRetrieveFormat]): + lang (Union[Unset, OsidbApiV1SchemaRetrieveLang]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1SchemaRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, format_=format_, lang=lang, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_status_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_status_retrieve.py index 10a3dba..b6d0a99 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_status_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_status_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_status_retrieve_response_200 import ( - OsidbApiV1StatusRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_api_v1_status_retrieve_response_200 import OsidbApiV1StatusRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/status".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/status", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1StatusRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -39,17 +34,20 @@ def _parse_response( response_200 = OsidbApiV1StatusRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1StatusRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -57,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbApiV1StatusRetrieveResponse200]: + """HTTP get /status + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1StatusRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -69,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1StatusRetrieveResponse200]: - """HTTP get /status""" + """HTTP get /status + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1StatusRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbApiV1StatusRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """HTTP get /status + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[OsidbApiV1StatusRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[OsidbApiV1StatusRetrieveResponse200]: - """HTTP get /status""" + """HTTP get /status + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1StatusRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_create.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_create.py index 0d42c68..3b15d5b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_create.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_create.py @@ -1,48 +1,46 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_trackers_create_response_201 import ( - OsidbApiV1TrackersCreateResponse201, -) -from ...models.tracker_post import TrackerPost -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = TrackerPost +from ...models.osidb_api_v1_trackers_create_response_201 import OsidbApiV1TrackersCreateResponse201 +from ...models.tracker_post import TrackerPost def _get_kwargs( *, client: AuthenticatedClient, - form_data: TrackerPost, - multipart_data: TrackerPost, - json_body: TrackerPost, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/trackers".format( - client.base_url, - ) + body: Union[ + TrackerPost, + TrackerPost, + TrackerPost, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/trackers", + } - headers: Dict[str, Any] = client.get_headers() + if isinstance(body, TrackerPost): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() - - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1TrackersCreateResponse201]: if response.status_code == 201: _response_201 = response.json() @@ -53,32 +51,51 @@ def _parse_response( response_201 = OsidbApiV1TrackersCreateResponse201.from_dict(_response_201) return response_201 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1TrackersCreateResponse201]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - form_data: TrackerPost, - multipart_data: TrackerPost, - json_body: TrackerPost, + body: Union[ + TrackerPost, + TrackerPost, + TrackerPost, + ], ) -> Response[OsidbApiV1TrackersCreateResponse201]: + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (TrackerPost): Tracker serializer + body (TrackerPost): Tracker serializer + body (TrackerPost): Tracker serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1TrackersCreateResponse201] + """ + kwargs = _get_kwargs( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -89,65 +106,102 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - form_data: TrackerPost, - multipart_data: TrackerPost, - json_body: TrackerPost, + body: Union[ + TrackerPost, + TrackerPost, + TrackerPost, + ], ) -> Optional[OsidbApiV1TrackersCreateResponse201]: - """ """ + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (TrackerPost): Tracker serializer + body (TrackerPost): Tracker serializer + body (TrackerPost): Tracker serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1TrackersCreateResponse201 + """ return sync_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - form_data: TrackerPost, - multipart_data: TrackerPost, - json_body: TrackerPost, + body: Union[ + TrackerPost, + TrackerPost, + TrackerPost, + ], ) -> Response[OsidbApiV1TrackersCreateResponse201]: + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (TrackerPost): Tracker serializer + body (TrackerPost): Tracker serializer + body (TrackerPost): Tracker serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1TrackersCreateResponse201] + """ + kwargs = _get_kwargs( - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - form_data: TrackerPost, - multipart_data: TrackerPost, - json_body: TrackerPost, + body: Union[ + TrackerPost, + TrackerPost, + TrackerPost, + ], ) -> Optional[OsidbApiV1TrackersCreateResponse201]: - """ """ + """ + Args: + bugzilla_api_key (str): + jira_api_key (str): + body (TrackerPost): Tracker serializer + body (TrackerPost): Tracker serializer + body (TrackerPost): Tracker serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1TrackersCreateResponse201 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_list.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_list.py index fe2191c..ef9459b 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_list.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_list.py @@ -1,780 +1,592 @@ -import datetime -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_trackers_list_affects_affectedness import ( - OsidbApiV1TrackersListAffectsAffectedness, -) -from ...models.osidb_api_v1_trackers_list_affects_flaw_impact import ( - OsidbApiV1TrackersListAffectsFlawImpact, -) -from ...models.osidb_api_v1_trackers_list_affects_flaw_source import ( - OsidbApiV1TrackersListAffectsFlawSource, -) -from ...models.osidb_api_v1_trackers_list_affects_impact import ( - OsidbApiV1TrackersListAffectsImpact, -) -from ...models.osidb_api_v1_trackers_list_affects_resolution import ( - OsidbApiV1TrackersListAffectsResolution, -) -from ...models.osidb_api_v1_trackers_list_order_item import ( - OsidbApiV1TrackersListOrderItem, -) -from ...models.osidb_api_v1_trackers_list_response_200 import ( - OsidbApiV1TrackersListResponse200, -) +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + +from ...models.osidb_api_v1_trackers_list_affects_affectedness import OsidbApiV1TrackersListAffectsAffectedness +from ...models.osidb_api_v1_trackers_list_affects_flaw_impact import OsidbApiV1TrackersListAffectsFlawImpact +from ...models.osidb_api_v1_trackers_list_affects_flaw_source import OsidbApiV1TrackersListAffectsFlawSource +from ...models.osidb_api_v1_trackers_list_affects_impact import OsidbApiV1TrackersListAffectsImpact +from ...models.osidb_api_v1_trackers_list_affects_resolution import OsidbApiV1TrackersListAffectsResolution +from ...models.osidb_api_v1_trackers_list_order_item import OsidbApiV1TrackersListOrderItem +from ...models.osidb_api_v1_trackers_list_response_200 import OsidbApiV1TrackersListResponse200 from ...models.osidb_api_v1_trackers_list_type import OsidbApiV1TrackersListType -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = { - "affects__affectedness": OsidbApiV1TrackersListAffectsAffectedness, - "affects__created_dt": datetime.datetime, - "affects__created_dt__date": datetime.date, - "affects__created_dt__date__gte": datetime.date, - "affects__created_dt__date__lte": datetime.date, - "affects__created_dt__gt": datetime.datetime, - "affects__created_dt__gte": datetime.datetime, - "affects__created_dt__lt": datetime.datetime, - "affects__created_dt__lte": datetime.datetime, - "affects__embargoed": bool, - "affects__flaw__components": List[str], - "affects__flaw__created_dt": datetime.datetime, - "affects__flaw__created_dt__date": datetime.date, - "affects__flaw__created_dt__date__gte": datetime.date, - "affects__flaw__created_dt__date__lte": datetime.date, - "affects__flaw__created_dt__gt": datetime.datetime, - "affects__flaw__created_dt__gte": datetime.datetime, - "affects__flaw__created_dt__lt": datetime.datetime, - "affects__flaw__created_dt__lte": datetime.datetime, - "affects__flaw__cve_id": str, - "affects__flaw__cwe_id": str, - "affects__flaw__embargoed": bool, - "affects__flaw__impact": OsidbApiV1TrackersListAffectsFlawImpact, - "affects__flaw__reported_dt": datetime.datetime, - "affects__flaw__reported_dt__date": datetime.date, - "affects__flaw__reported_dt__date__gte": datetime.date, - "affects__flaw__reported_dt__date__lte": datetime.date, - "affects__flaw__reported_dt__gt": datetime.datetime, - "affects__flaw__reported_dt__gte": datetime.datetime, - "affects__flaw__reported_dt__lt": datetime.datetime, - "affects__flaw__reported_dt__lte": datetime.datetime, - "affects__flaw__source": OsidbApiV1TrackersListAffectsFlawSource, - "affects__flaw__unembargo_dt": datetime.datetime, - "affects__flaw__updated_dt": datetime.datetime, - "affects__flaw__updated_dt__date": datetime.date, - "affects__flaw__updated_dt__date__gte": datetime.date, - "affects__flaw__updated_dt__date__lte": datetime.date, - "affects__flaw__updated_dt__gt": datetime.datetime, - "affects__flaw__updated_dt__gte": datetime.datetime, - "affects__flaw__updated_dt__lt": datetime.datetime, - "affects__flaw__updated_dt__lte": datetime.datetime, - "affects__flaw__uuid": str, - "affects__impact": OsidbApiV1TrackersListAffectsImpact, - "affects__ps_component": str, - "affects__ps_module": str, - "affects__resolution": OsidbApiV1TrackersListAffectsResolution, - "affects__updated_dt": datetime.datetime, - "affects__updated_dt__date": datetime.date, - "affects__updated_dt__date__gte": datetime.date, - "affects__updated_dt__date__lte": datetime.date, - "affects__updated_dt__gt": datetime.datetime, - "affects__updated_dt__gte": datetime.datetime, - "affects__updated_dt__lt": datetime.datetime, - "affects__updated_dt__lte": datetime.datetime, - "affects__uuid": str, - "created_dt": datetime.datetime, - "created_dt__date": datetime.date, - "created_dt__date__gte": datetime.date, - "created_dt__date__lte": datetime.date, - "created_dt__gt": datetime.datetime, - "created_dt__gte": datetime.datetime, - "created_dt__lt": datetime.datetime, - "created_dt__lte": datetime.datetime, - "embargoed": bool, - "exclude_fields": List[str], - "external_system_id": str, - "include_fields": List[str], - "include_meta_attr": List[str], - "limit": int, - "offset": int, - "order": List[OsidbApiV1TrackersListOrderItem], - "ps_update_stream": str, - "resolution": str, - "status": str, - "type": OsidbApiV1TrackersListType, - "updated_dt": datetime.datetime, - "updated_dt__date": datetime.date, - "updated_dt__date__gte": datetime.date, - "updated_dt__date__lte": datetime.date, - "updated_dt__gt": datetime.datetime, - "updated_dt__gte": datetime.datetime, - "updated_dt__lt": datetime.datetime, - "updated_dt__lte": datetime.datetime, - "uuid": str, -} +from uuid import UUID +import datetime def _get_kwargs( *, client: AuthenticatedClient, - affects_affectedness: Union[ - Unset, None, OsidbApiV1TrackersListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_components: Union[Unset, None, List[str]] = UNSET, - affects_flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_cve_id: Union[Unset, None, str] = UNSET, - affects_flaw_cwe_id: Union[Unset, None, str] = UNSET, - affects_flaw_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_impact: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawImpact - ] = UNSET, - affects_flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_source: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawSource - ] = UNSET, - affects_flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_uuid: Union[Unset, None, str] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1TrackersListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1TrackersListAffectsResolution - ] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1TrackersListOrderItem]] = UNSET, - ps_update_stream: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, str] = UNSET, - status: Union[Unset, None, str] = UNSET, - type: Union[Unset, None, OsidbApiV1TrackersListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/trackers".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - json_affects_affectedness: Union[Unset, None, str] = UNSET + affects_affectedness: Union[Unset, OsidbApiV1TrackersListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_components: Union[Unset, list[str]] = UNSET, + affects_flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_cve_id: Union[Unset, str] = UNSET, + affects_flaw_cwe_id: Union[Unset, str] = UNSET, + affects_flaw_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_impact: Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact] = UNSET, + affects_flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_source: Union[Unset, OsidbApiV1TrackersListAffectsFlawSource] = UNSET, + affects_flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_uuid: Union[Unset, UUID] = UNSET, + affects_impact: Union[Unset, OsidbApiV1TrackersListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1TrackersListAffectsResolution] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1TrackersListOrderItem]] = UNSET, + ps_update_stream: Union[Unset, str] = UNSET, + resolution: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + type_: Union[Unset, OsidbApiV1TrackersListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + print(OsidbApiV1TrackersListAffectsAffectedness) + json_affects_affectedness: Union[Unset, str] = UNSET if not isinstance(affects_affectedness, Unset): + json_affects_affectedness = affects_affectedness.value - json_affects_affectedness = ( - OsidbApiV1TrackersListAffectsAffectedness(affects_affectedness).value - if affects_affectedness - else None - ) + params["affects__affectedness"] = json_affects_affectedness - json_affects_created_dt: Union[Unset, None, str] = UNSET + json_affects_created_dt: Union[Unset, str] = UNSET if not isinstance(affects_created_dt, Unset): - json_affects_created_dt = ( - affects_created_dt.isoformat() if affects_created_dt else None - ) + json_affects_created_dt = affects_created_dt.isoformat() + + params["affects__created_dt"] = json_affects_created_dt - json_affects_created_dt_date: Union[Unset, None, str] = UNSET + json_affects_created_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_date, Unset): - json_affects_created_dt_date = ( - affects_created_dt_date.isoformat() if affects_created_dt_date else None - ) + json_affects_created_dt_date = affects_created_dt_date.isoformat() + + params["affects__created_dt__date"] = json_affects_created_dt_date - json_affects_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_affects_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_date_gte, Unset): - json_affects_created_dt_date_gte = ( - affects_created_dt_date_gte.isoformat() - if affects_created_dt_date_gte - else None - ) + json_affects_created_dt_date_gte = affects_created_dt_date_gte.isoformat() + + params["affects__created_dt__date__gte"] = json_affects_created_dt_date_gte - json_affects_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_affects_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_date_lte, Unset): - json_affects_created_dt_date_lte = ( - affects_created_dt_date_lte.isoformat() - if affects_created_dt_date_lte - else None - ) + json_affects_created_dt_date_lte = affects_created_dt_date_lte.isoformat() - json_affects_created_dt_gt: Union[Unset, None, str] = UNSET + params["affects__created_dt__date__lte"] = json_affects_created_dt_date_lte + + json_affects_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_gt, Unset): - json_affects_created_dt_gt = ( - affects_created_dt_gt.isoformat() if affects_created_dt_gt else None - ) + json_affects_created_dt_gt = affects_created_dt_gt.isoformat() - json_affects_created_dt_gte: Union[Unset, None, str] = UNSET + params["affects__created_dt__gt"] = json_affects_created_dt_gt + + json_affects_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_gte, Unset): - json_affects_created_dt_gte = ( - affects_created_dt_gte.isoformat() if affects_created_dt_gte else None - ) + json_affects_created_dt_gte = affects_created_dt_gte.isoformat() - json_affects_created_dt_lt: Union[Unset, None, str] = UNSET + params["affects__created_dt__gte"] = json_affects_created_dt_gte + + json_affects_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_lt, Unset): - json_affects_created_dt_lt = ( - affects_created_dt_lt.isoformat() if affects_created_dt_lt else None - ) + json_affects_created_dt_lt = affects_created_dt_lt.isoformat() - json_affects_created_dt_lte: Union[Unset, None, str] = UNSET + params["affects__created_dt__lt"] = json_affects_created_dt_lt + + json_affects_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_created_dt_lte, Unset): - json_affects_created_dt_lte = ( - affects_created_dt_lte.isoformat() if affects_created_dt_lte else None - ) + json_affects_created_dt_lte = affects_created_dt_lte.isoformat() + + params["affects__created_dt__lte"] = json_affects_created_dt_lte - json_affects_flaw_components: Union[Unset, None, List[str]] = UNSET + params["affects__embargoed"] = affects_embargoed + + json_affects_flaw_components: Union[Unset, list[str]] = UNSET if not isinstance(affects_flaw_components, Unset): - if affects_flaw_components is None: - json_affects_flaw_components = None - else: - json_affects_flaw_components = affects_flaw_components + json_affects_flaw_components = affects_flaw_components - json_affects_flaw_created_dt: Union[Unset, None, str] = UNSET + params["affects__flaw__components"] = json_affects_flaw_components + + json_affects_flaw_created_dt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_created_dt, Unset): - json_affects_flaw_created_dt = ( - affects_flaw_created_dt.isoformat() if affects_flaw_created_dt else None - ) + json_affects_flaw_created_dt = affects_flaw_created_dt.isoformat() - json_affects_flaw_created_dt_date: Union[Unset, None, str] = UNSET + params["affects__flaw__created_dt"] = json_affects_flaw_created_dt + + json_affects_flaw_created_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_flaw_created_dt_date, Unset): - json_affects_flaw_created_dt_date = ( - affects_flaw_created_dt_date.isoformat() - if affects_flaw_created_dt_date - else None - ) + json_affects_flaw_created_dt_date = affects_flaw_created_dt_date.isoformat() - json_affects_flaw_created_dt_date_gte: Union[Unset, None, str] = UNSET + params["affects__flaw__created_dt__date"] = json_affects_flaw_created_dt_date + + json_affects_flaw_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_created_dt_date_gte, Unset): - json_affects_flaw_created_dt_date_gte = ( - affects_flaw_created_dt_date_gte.isoformat() - if affects_flaw_created_dt_date_gte - else None - ) + json_affects_flaw_created_dt_date_gte = affects_flaw_created_dt_date_gte.isoformat() + + params["affects__flaw__created_dt__date__gte"] = json_affects_flaw_created_dt_date_gte - json_affects_flaw_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_affects_flaw_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_created_dt_date_lte, Unset): - json_affects_flaw_created_dt_date_lte = ( - affects_flaw_created_dt_date_lte.isoformat() - if affects_flaw_created_dt_date_lte - else None - ) + json_affects_flaw_created_dt_date_lte = affects_flaw_created_dt_date_lte.isoformat() + + params["affects__flaw__created_dt__date__lte"] = json_affects_flaw_created_dt_date_lte - json_affects_flaw_created_dt_gt: Union[Unset, None, str] = UNSET + json_affects_flaw_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_created_dt_gt, Unset): - json_affects_flaw_created_dt_gt = ( - affects_flaw_created_dt_gt.isoformat() - if affects_flaw_created_dt_gt - else None - ) + json_affects_flaw_created_dt_gt = affects_flaw_created_dt_gt.isoformat() + + params["affects__flaw__created_dt__gt"] = json_affects_flaw_created_dt_gt - json_affects_flaw_created_dt_gte: Union[Unset, None, str] = UNSET + json_affects_flaw_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_created_dt_gte, Unset): - json_affects_flaw_created_dt_gte = ( - affects_flaw_created_dt_gte.isoformat() - if affects_flaw_created_dt_gte - else None - ) + json_affects_flaw_created_dt_gte = affects_flaw_created_dt_gte.isoformat() + + params["affects__flaw__created_dt__gte"] = json_affects_flaw_created_dt_gte - json_affects_flaw_created_dt_lt: Union[Unset, None, str] = UNSET + json_affects_flaw_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_created_dt_lt, Unset): - json_affects_flaw_created_dt_lt = ( - affects_flaw_created_dt_lt.isoformat() - if affects_flaw_created_dt_lt - else None - ) + json_affects_flaw_created_dt_lt = affects_flaw_created_dt_lt.isoformat() + + params["affects__flaw__created_dt__lt"] = json_affects_flaw_created_dt_lt - json_affects_flaw_created_dt_lte: Union[Unset, None, str] = UNSET + json_affects_flaw_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_created_dt_lte, Unset): - json_affects_flaw_created_dt_lte = ( - affects_flaw_created_dt_lte.isoformat() - if affects_flaw_created_dt_lte - else None - ) + json_affects_flaw_created_dt_lte = affects_flaw_created_dt_lte.isoformat() + + params["affects__flaw__created_dt__lte"] = json_affects_flaw_created_dt_lte + + params["affects__flaw__cve_id"] = affects_flaw_cve_id - json_affects_flaw_impact: Union[Unset, None, str] = UNSET + params["affects__flaw__cwe_id"] = affects_flaw_cwe_id + + params["affects__flaw__embargoed"] = affects_flaw_embargoed + + print(OsidbApiV1TrackersListAffectsFlawImpact) + json_affects_flaw_impact: Union[Unset, str] = UNSET if not isinstance(affects_flaw_impact, Unset): + json_affects_flaw_impact = affects_flaw_impact.value - json_affects_flaw_impact = ( - OsidbApiV1TrackersListAffectsFlawImpact(affects_flaw_impact).value - if affects_flaw_impact - else None - ) + params["affects__flaw__impact"] = json_affects_flaw_impact - json_affects_flaw_reported_dt: Union[Unset, None, str] = UNSET + json_affects_flaw_reported_dt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_reported_dt, Unset): - json_affects_flaw_reported_dt = ( - affects_flaw_reported_dt.isoformat() if affects_flaw_reported_dt else None - ) + json_affects_flaw_reported_dt = affects_flaw_reported_dt.isoformat() - json_affects_flaw_reported_dt_date: Union[Unset, None, str] = UNSET + params["affects__flaw__reported_dt"] = json_affects_flaw_reported_dt + + json_affects_flaw_reported_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_flaw_reported_dt_date, Unset): - json_affects_flaw_reported_dt_date = ( - affects_flaw_reported_dt_date.isoformat() - if affects_flaw_reported_dt_date - else None - ) + json_affects_flaw_reported_dt_date = affects_flaw_reported_dt_date.isoformat() + + params["affects__flaw__reported_dt__date"] = json_affects_flaw_reported_dt_date - json_affects_flaw_reported_dt_date_gte: Union[Unset, None, str] = UNSET + json_affects_flaw_reported_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_reported_dt_date_gte, Unset): - json_affects_flaw_reported_dt_date_gte = ( - affects_flaw_reported_dt_date_gte.isoformat() - if affects_flaw_reported_dt_date_gte - else None - ) + json_affects_flaw_reported_dt_date_gte = affects_flaw_reported_dt_date_gte.isoformat() + + params["affects__flaw__reported_dt__date__gte"] = json_affects_flaw_reported_dt_date_gte - json_affects_flaw_reported_dt_date_lte: Union[Unset, None, str] = UNSET + json_affects_flaw_reported_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_reported_dt_date_lte, Unset): - json_affects_flaw_reported_dt_date_lte = ( - affects_flaw_reported_dt_date_lte.isoformat() - if affects_flaw_reported_dt_date_lte - else None - ) + json_affects_flaw_reported_dt_date_lte = affects_flaw_reported_dt_date_lte.isoformat() + + params["affects__flaw__reported_dt__date__lte"] = json_affects_flaw_reported_dt_date_lte - json_affects_flaw_reported_dt_gt: Union[Unset, None, str] = UNSET + json_affects_flaw_reported_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_reported_dt_gt, Unset): - json_affects_flaw_reported_dt_gt = ( - affects_flaw_reported_dt_gt.isoformat() - if affects_flaw_reported_dt_gt - else None - ) + json_affects_flaw_reported_dt_gt = affects_flaw_reported_dt_gt.isoformat() + + params["affects__flaw__reported_dt__gt"] = json_affects_flaw_reported_dt_gt - json_affects_flaw_reported_dt_gte: Union[Unset, None, str] = UNSET + json_affects_flaw_reported_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_reported_dt_gte, Unset): - json_affects_flaw_reported_dt_gte = ( - affects_flaw_reported_dt_gte.isoformat() - if affects_flaw_reported_dt_gte - else None - ) + json_affects_flaw_reported_dt_gte = affects_flaw_reported_dt_gte.isoformat() + + params["affects__flaw__reported_dt__gte"] = json_affects_flaw_reported_dt_gte - json_affects_flaw_reported_dt_lt: Union[Unset, None, str] = UNSET + json_affects_flaw_reported_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_reported_dt_lt, Unset): - json_affects_flaw_reported_dt_lt = ( - affects_flaw_reported_dt_lt.isoformat() - if affects_flaw_reported_dt_lt - else None - ) + json_affects_flaw_reported_dt_lt = affects_flaw_reported_dt_lt.isoformat() - json_affects_flaw_reported_dt_lte: Union[Unset, None, str] = UNSET + params["affects__flaw__reported_dt__lt"] = json_affects_flaw_reported_dt_lt + + json_affects_flaw_reported_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_reported_dt_lte, Unset): - json_affects_flaw_reported_dt_lte = ( - affects_flaw_reported_dt_lte.isoformat() - if affects_flaw_reported_dt_lte - else None - ) + json_affects_flaw_reported_dt_lte = affects_flaw_reported_dt_lte.isoformat() - json_affects_flaw_source: Union[Unset, None, str] = UNSET + params["affects__flaw__reported_dt__lte"] = json_affects_flaw_reported_dt_lte + + print(OsidbApiV1TrackersListAffectsFlawSource) + json_affects_flaw_source: Union[Unset, str] = UNSET if not isinstance(affects_flaw_source, Unset): + json_affects_flaw_source = affects_flaw_source.value - json_affects_flaw_source = ( - OsidbApiV1TrackersListAffectsFlawSource(affects_flaw_source).value - if affects_flaw_source - else None - ) + params["affects__flaw__source"] = json_affects_flaw_source - json_affects_flaw_unembargo_dt: Union[Unset, None, str] = UNSET + json_affects_flaw_unembargo_dt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_unembargo_dt, Unset): - json_affects_flaw_unembargo_dt = ( - affects_flaw_unembargo_dt.isoformat() if affects_flaw_unembargo_dt else None - ) + json_affects_flaw_unembargo_dt = affects_flaw_unembargo_dt.isoformat() + + params["affects__flaw__unembargo_dt"] = json_affects_flaw_unembargo_dt - json_affects_flaw_updated_dt: Union[Unset, None, str] = UNSET + json_affects_flaw_updated_dt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_updated_dt, Unset): - json_affects_flaw_updated_dt = ( - affects_flaw_updated_dt.isoformat() if affects_flaw_updated_dt else None - ) + json_affects_flaw_updated_dt = affects_flaw_updated_dt.isoformat() + + params["affects__flaw__updated_dt"] = json_affects_flaw_updated_dt - json_affects_flaw_updated_dt_date: Union[Unset, None, str] = UNSET + json_affects_flaw_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_flaw_updated_dt_date, Unset): - json_affects_flaw_updated_dt_date = ( - affects_flaw_updated_dt_date.isoformat() - if affects_flaw_updated_dt_date - else None - ) + json_affects_flaw_updated_dt_date = affects_flaw_updated_dt_date.isoformat() - json_affects_flaw_updated_dt_date_gte: Union[Unset, None, str] = UNSET + params["affects__flaw__updated_dt__date"] = json_affects_flaw_updated_dt_date + + json_affects_flaw_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_updated_dt_date_gte, Unset): - json_affects_flaw_updated_dt_date_gte = ( - affects_flaw_updated_dt_date_gte.isoformat() - if affects_flaw_updated_dt_date_gte - else None - ) + json_affects_flaw_updated_dt_date_gte = affects_flaw_updated_dt_date_gte.isoformat() - json_affects_flaw_updated_dt_date_lte: Union[Unset, None, str] = UNSET + params["affects__flaw__updated_dt__date__gte"] = json_affects_flaw_updated_dt_date_gte + + json_affects_flaw_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_updated_dt_date_lte, Unset): - json_affects_flaw_updated_dt_date_lte = ( - affects_flaw_updated_dt_date_lte.isoformat() - if affects_flaw_updated_dt_date_lte - else None - ) + json_affects_flaw_updated_dt_date_lte = affects_flaw_updated_dt_date_lte.isoformat() - json_affects_flaw_updated_dt_gt: Union[Unset, None, str] = UNSET + params["affects__flaw__updated_dt__date__lte"] = json_affects_flaw_updated_dt_date_lte + + json_affects_flaw_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_updated_dt_gt, Unset): - json_affects_flaw_updated_dt_gt = ( - affects_flaw_updated_dt_gt.isoformat() - if affects_flaw_updated_dt_gt - else None - ) + json_affects_flaw_updated_dt_gt = affects_flaw_updated_dt_gt.isoformat() - json_affects_flaw_updated_dt_gte: Union[Unset, None, str] = UNSET + params["affects__flaw__updated_dt__gt"] = json_affects_flaw_updated_dt_gt + + json_affects_flaw_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_updated_dt_gte, Unset): - json_affects_flaw_updated_dt_gte = ( - affects_flaw_updated_dt_gte.isoformat() - if affects_flaw_updated_dt_gte - else None - ) + json_affects_flaw_updated_dt_gte = affects_flaw_updated_dt_gte.isoformat() + + params["affects__flaw__updated_dt__gte"] = json_affects_flaw_updated_dt_gte - json_affects_flaw_updated_dt_lt: Union[Unset, None, str] = UNSET + json_affects_flaw_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_flaw_updated_dt_lt, Unset): - json_affects_flaw_updated_dt_lt = ( - affects_flaw_updated_dt_lt.isoformat() - if affects_flaw_updated_dt_lt - else None - ) + json_affects_flaw_updated_dt_lt = affects_flaw_updated_dt_lt.isoformat() + + params["affects__flaw__updated_dt__lt"] = json_affects_flaw_updated_dt_lt - json_affects_flaw_updated_dt_lte: Union[Unset, None, str] = UNSET + json_affects_flaw_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_flaw_updated_dt_lte, Unset): - json_affects_flaw_updated_dt_lte = ( - affects_flaw_updated_dt_lte.isoformat() - if affects_flaw_updated_dt_lte - else None - ) + json_affects_flaw_updated_dt_lte = affects_flaw_updated_dt_lte.isoformat() + + params["affects__flaw__updated_dt__lte"] = json_affects_flaw_updated_dt_lte + + json_affects_flaw_uuid: Union[Unset, str] = UNSET + if not isinstance(affects_flaw_uuid, Unset): + json_affects_flaw_uuid = str(affects_flaw_uuid) - json_affects_impact: Union[Unset, None, str] = UNSET + params["affects__flaw__uuid"] = json_affects_flaw_uuid + + print(OsidbApiV1TrackersListAffectsImpact) + json_affects_impact: Union[Unset, str] = UNSET if not isinstance(affects_impact, Unset): + json_affects_impact = affects_impact.value - json_affects_impact = ( - OsidbApiV1TrackersListAffectsImpact(affects_impact).value - if affects_impact - else None - ) + params["affects__impact"] = json_affects_impact - json_affects_resolution: Union[Unset, None, str] = UNSET + params["affects__ps_component"] = affects_ps_component + + params["affects__ps_module"] = affects_ps_module + + print(OsidbApiV1TrackersListAffectsResolution) + json_affects_resolution: Union[Unset, str] = UNSET if not isinstance(affects_resolution, Unset): + json_affects_resolution = affects_resolution.value - json_affects_resolution = ( - OsidbApiV1TrackersListAffectsResolution(affects_resolution).value - if affects_resolution - else None - ) + params["affects__resolution"] = json_affects_resolution - json_affects_updated_dt: Union[Unset, None, str] = UNSET + json_affects_updated_dt: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt, Unset): - json_affects_updated_dt = ( - affects_updated_dt.isoformat() if affects_updated_dt else None - ) + json_affects_updated_dt = affects_updated_dt.isoformat() + + params["affects__updated_dt"] = json_affects_updated_dt - json_affects_updated_dt_date: Union[Unset, None, str] = UNSET + json_affects_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_date, Unset): - json_affects_updated_dt_date = ( - affects_updated_dt_date.isoformat() if affects_updated_dt_date else None - ) + json_affects_updated_dt_date = affects_updated_dt_date.isoformat() + + params["affects__updated_dt__date"] = json_affects_updated_dt_date - json_affects_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_affects_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_date_gte, Unset): - json_affects_updated_dt_date_gte = ( - affects_updated_dt_date_gte.isoformat() - if affects_updated_dt_date_gte - else None - ) + json_affects_updated_dt_date_gte = affects_updated_dt_date_gte.isoformat() + + params["affects__updated_dt__date__gte"] = json_affects_updated_dt_date_gte - json_affects_updated_dt_date_lte: Union[Unset, None, str] = UNSET + json_affects_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_date_lte, Unset): - json_affects_updated_dt_date_lte = ( - affects_updated_dt_date_lte.isoformat() - if affects_updated_dt_date_lte - else None - ) + json_affects_updated_dt_date_lte = affects_updated_dt_date_lte.isoformat() + + params["affects__updated_dt__date__lte"] = json_affects_updated_dt_date_lte - json_affects_updated_dt_gt: Union[Unset, None, str] = UNSET + json_affects_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_gt, Unset): - json_affects_updated_dt_gt = ( - affects_updated_dt_gt.isoformat() if affects_updated_dt_gt else None - ) + json_affects_updated_dt_gt = affects_updated_dt_gt.isoformat() - json_affects_updated_dt_gte: Union[Unset, None, str] = UNSET + params["affects__updated_dt__gt"] = json_affects_updated_dt_gt + + json_affects_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_gte, Unset): - json_affects_updated_dt_gte = ( - affects_updated_dt_gte.isoformat() if affects_updated_dt_gte else None - ) + json_affects_updated_dt_gte = affects_updated_dt_gte.isoformat() - json_affects_updated_dt_lt: Union[Unset, None, str] = UNSET + params["affects__updated_dt__gte"] = json_affects_updated_dt_gte + + json_affects_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_lt, Unset): - json_affects_updated_dt_lt = ( - affects_updated_dt_lt.isoformat() if affects_updated_dt_lt else None - ) + json_affects_updated_dt_lt = affects_updated_dt_lt.isoformat() - json_affects_updated_dt_lte: Union[Unset, None, str] = UNSET + params["affects__updated_dt__lt"] = json_affects_updated_dt_lt + + json_affects_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(affects_updated_dt_lte, Unset): - json_affects_updated_dt_lte = ( - affects_updated_dt_lte.isoformat() if affects_updated_dt_lte else None - ) + json_affects_updated_dt_lte = affects_updated_dt_lte.isoformat() - json_created_dt: Union[Unset, None, str] = UNSET + params["affects__updated_dt__lte"] = json_affects_updated_dt_lte + + json_affects_uuid: Union[Unset, str] = UNSET + if not isinstance(affects_uuid, Unset): + json_affects_uuid = str(affects_uuid) + + params["affects__uuid"] = json_affects_uuid + + json_created_dt: Union[Unset, str] = UNSET if not isinstance(created_dt, Unset): - json_created_dt = created_dt.isoformat() if created_dt else None + json_created_dt = created_dt.isoformat() - json_created_dt_date: Union[Unset, None, str] = UNSET + params["created_dt"] = json_created_dt + + json_created_dt_date: Union[Unset, str] = UNSET if not isinstance(created_dt_date, Unset): - json_created_dt_date = created_dt_date.isoformat() if created_dt_date else None + json_created_dt_date = created_dt_date.isoformat() + + params["created_dt__date"] = json_created_dt_date - json_created_dt_date_gte: Union[Unset, None, str] = UNSET + json_created_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_gte, Unset): - json_created_dt_date_gte = ( - created_dt_date_gte.isoformat() if created_dt_date_gte else None - ) + json_created_dt_date_gte = created_dt_date_gte.isoformat() + + params["created_dt__date__gte"] = json_created_dt_date_gte - json_created_dt_date_lte: Union[Unset, None, str] = UNSET + json_created_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_date_lte, Unset): - json_created_dt_date_lte = ( - created_dt_date_lte.isoformat() if created_dt_date_lte else None - ) + json_created_dt_date_lte = created_dt_date_lte.isoformat() + + params["created_dt__date__lte"] = json_created_dt_date_lte - json_created_dt_gt: Union[Unset, None, str] = UNSET + json_created_dt_gt: Union[Unset, str] = UNSET if not isinstance(created_dt_gt, Unset): - json_created_dt_gt = created_dt_gt.isoformat() if created_dt_gt else None + json_created_dt_gt = created_dt_gt.isoformat() - json_created_dt_gte: Union[Unset, None, str] = UNSET + params["created_dt__gt"] = json_created_dt_gt + + json_created_dt_gte: Union[Unset, str] = UNSET if not isinstance(created_dt_gte, Unset): - json_created_dt_gte = created_dt_gte.isoformat() if created_dt_gte else None + json_created_dt_gte = created_dt_gte.isoformat() + + params["created_dt__gte"] = json_created_dt_gte - json_created_dt_lt: Union[Unset, None, str] = UNSET + json_created_dt_lt: Union[Unset, str] = UNSET if not isinstance(created_dt_lt, Unset): - json_created_dt_lt = created_dt_lt.isoformat() if created_dt_lt else None + json_created_dt_lt = created_dt_lt.isoformat() + + params["created_dt__lt"] = json_created_dt_lt - json_created_dt_lte: Union[Unset, None, str] = UNSET + json_created_dt_lte: Union[Unset, str] = UNSET if not isinstance(created_dt_lte, Unset): - json_created_dt_lte = created_dt_lte.isoformat() if created_dt_lte else None + json_created_dt_lte = created_dt_lte.isoformat() + + params["created_dt__lte"] = json_created_dt_lte + + params["embargoed"] = embargoed - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + params["external_system_id"] = external_system_id + + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields - json_include_meta_attr: Union[Unset, None, List[str]] = UNSET + params["include_fields"] = json_include_fields + + json_include_meta_attr: Union[Unset, list[str]] = UNSET if not isinstance(include_meta_attr, Unset): - if include_meta_attr is None: - json_include_meta_attr = None - else: - json_include_meta_attr = include_meta_attr + json_include_meta_attr = include_meta_attr + + params["include_meta_attr"] = json_include_meta_attr + + params["limit"] = limit + + params["offset"] = offset - json_order: Union[Unset, None, List[str]] = UNSET + json_order: Union[Unset, list[str]] = UNSET if not isinstance(order, Unset): - if order is None: - json_order = None - else: - json_order = [] - for order_item_data in order: - order_item: str = UNSET - if not isinstance(order_item_data, Unset): + json_order = [] + for order_item_data in order: + print(OsidbApiV1TrackersListOrderItem) + order_item: str = UNSET + if not isinstance(order_item_data, Unset): + order_item = order_item_data.value + + json_order.append(order_item) + + params["order"] = json_order + + params["ps_update_stream"] = ps_update_stream - order_item = OsidbApiV1TrackersListOrderItem(order_item_data).value + params["resolution"] = resolution - json_order.append(order_item) + params["status"] = status - json_type: Union[Unset, None, str] = UNSET - if not isinstance(type, Unset): + print(OsidbApiV1TrackersListType) + json_type_: Union[Unset, str] = UNSET + if not isinstance(type_, Unset): + json_type_ = type_.value - json_type = OsidbApiV1TrackersListType(type).value if type else None + params["type"] = json_type_ - json_updated_dt: Union[Unset, None, str] = UNSET + json_updated_dt: Union[Unset, str] = UNSET if not isinstance(updated_dt, Unset): - json_updated_dt = updated_dt.isoformat() if updated_dt else None + json_updated_dt = updated_dt.isoformat() - json_updated_dt_date: Union[Unset, None, str] = UNSET + params["updated_dt"] = json_updated_dt + + json_updated_dt_date: Union[Unset, str] = UNSET if not isinstance(updated_dt_date, Unset): - json_updated_dt_date = updated_dt_date.isoformat() if updated_dt_date else None + json_updated_dt_date = updated_dt_date.isoformat() + + params["updated_dt__date"] = json_updated_dt_date - json_updated_dt_date_gte: Union[Unset, None, str] = UNSET + json_updated_dt_date_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_gte, Unset): - json_updated_dt_date_gte = ( - updated_dt_date_gte.isoformat() if updated_dt_date_gte else None - ) + json_updated_dt_date_gte = updated_dt_date_gte.isoformat() - json_updated_dt_date_lte: Union[Unset, None, str] = UNSET + params["updated_dt__date__gte"] = json_updated_dt_date_gte + + json_updated_dt_date_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_date_lte, Unset): - json_updated_dt_date_lte = ( - updated_dt_date_lte.isoformat() if updated_dt_date_lte else None - ) + json_updated_dt_date_lte = updated_dt_date_lte.isoformat() - json_updated_dt_gt: Union[Unset, None, str] = UNSET + params["updated_dt__date__lte"] = json_updated_dt_date_lte + + json_updated_dt_gt: Union[Unset, str] = UNSET if not isinstance(updated_dt_gt, Unset): - json_updated_dt_gt = updated_dt_gt.isoformat() if updated_dt_gt else None + json_updated_dt_gt = updated_dt_gt.isoformat() + + params["updated_dt__gt"] = json_updated_dt_gt - json_updated_dt_gte: Union[Unset, None, str] = UNSET + json_updated_dt_gte: Union[Unset, str] = UNSET if not isinstance(updated_dt_gte, Unset): - json_updated_dt_gte = updated_dt_gte.isoformat() if updated_dt_gte else None + json_updated_dt_gte = updated_dt_gte.isoformat() - json_updated_dt_lt: Union[Unset, None, str] = UNSET + params["updated_dt__gte"] = json_updated_dt_gte + + json_updated_dt_lt: Union[Unset, str] = UNSET if not isinstance(updated_dt_lt, Unset): - json_updated_dt_lt = updated_dt_lt.isoformat() if updated_dt_lt else None + json_updated_dt_lt = updated_dt_lt.isoformat() + + params["updated_dt__lt"] = json_updated_dt_lt - json_updated_dt_lte: Union[Unset, None, str] = UNSET + json_updated_dt_lte: Union[Unset, str] = UNSET if not isinstance(updated_dt_lte, Unset): - json_updated_dt_lte = updated_dt_lte.isoformat() if updated_dt_lte else None - - params: Dict[str, Any] = { - "affects__affectedness": json_affects_affectedness, - "affects__created_dt": json_affects_created_dt, - "affects__created_dt__date": json_affects_created_dt_date, - "affects__created_dt__date__gte": json_affects_created_dt_date_gte, - "affects__created_dt__date__lte": json_affects_created_dt_date_lte, - "affects__created_dt__gt": json_affects_created_dt_gt, - "affects__created_dt__gte": json_affects_created_dt_gte, - "affects__created_dt__lt": json_affects_created_dt_lt, - "affects__created_dt__lte": json_affects_created_dt_lte, - "affects__embargoed": affects_embargoed, - "affects__flaw__components": json_affects_flaw_components, - "affects__flaw__created_dt": json_affects_flaw_created_dt, - "affects__flaw__created_dt__date": json_affects_flaw_created_dt_date, - "affects__flaw__created_dt__date__gte": json_affects_flaw_created_dt_date_gte, - "affects__flaw__created_dt__date__lte": json_affects_flaw_created_dt_date_lte, - "affects__flaw__created_dt__gt": json_affects_flaw_created_dt_gt, - "affects__flaw__created_dt__gte": json_affects_flaw_created_dt_gte, - "affects__flaw__created_dt__lt": json_affects_flaw_created_dt_lt, - "affects__flaw__created_dt__lte": json_affects_flaw_created_dt_lte, - "affects__flaw__cve_id": affects_flaw_cve_id, - "affects__flaw__cwe_id": affects_flaw_cwe_id, - "affects__flaw__embargoed": affects_flaw_embargoed, - "affects__flaw__impact": json_affects_flaw_impact, - "affects__flaw__reported_dt": json_affects_flaw_reported_dt, - "affects__flaw__reported_dt__date": json_affects_flaw_reported_dt_date, - "affects__flaw__reported_dt__date__gte": json_affects_flaw_reported_dt_date_gte, - "affects__flaw__reported_dt__date__lte": json_affects_flaw_reported_dt_date_lte, - "affects__flaw__reported_dt__gt": json_affects_flaw_reported_dt_gt, - "affects__flaw__reported_dt__gte": json_affects_flaw_reported_dt_gte, - "affects__flaw__reported_dt__lt": json_affects_flaw_reported_dt_lt, - "affects__flaw__reported_dt__lte": json_affects_flaw_reported_dt_lte, - "affects__flaw__source": json_affects_flaw_source, - "affects__flaw__unembargo_dt": json_affects_flaw_unembargo_dt, - "affects__flaw__updated_dt": json_affects_flaw_updated_dt, - "affects__flaw__updated_dt__date": json_affects_flaw_updated_dt_date, - "affects__flaw__updated_dt__date__gte": json_affects_flaw_updated_dt_date_gte, - "affects__flaw__updated_dt__date__lte": json_affects_flaw_updated_dt_date_lte, - "affects__flaw__updated_dt__gt": json_affects_flaw_updated_dt_gt, - "affects__flaw__updated_dt__gte": json_affects_flaw_updated_dt_gte, - "affects__flaw__updated_dt__lt": json_affects_flaw_updated_dt_lt, - "affects__flaw__updated_dt__lte": json_affects_flaw_updated_dt_lte, - "affects__flaw__uuid": affects_flaw_uuid, - "affects__impact": json_affects_impact, - "affects__ps_component": affects_ps_component, - "affects__ps_module": affects_ps_module, - "affects__resolution": json_affects_resolution, - "affects__updated_dt": json_affects_updated_dt, - "affects__updated_dt__date": json_affects_updated_dt_date, - "affects__updated_dt__date__gte": json_affects_updated_dt_date_gte, - "affects__updated_dt__date__lte": json_affects_updated_dt_date_lte, - "affects__updated_dt__gt": json_affects_updated_dt_gt, - "affects__updated_dt__gte": json_affects_updated_dt_gte, - "affects__updated_dt__lt": json_affects_updated_dt_lt, - "affects__updated_dt__lte": json_affects_updated_dt_lte, - "affects__uuid": affects_uuid, - "created_dt": json_created_dt, - "created_dt__date": json_created_dt_date, - "created_dt__date__gte": json_created_dt_date_gte, - "created_dt__date__lte": json_created_dt_date_lte, - "created_dt__gt": json_created_dt_gt, - "created_dt__gte": json_created_dt_gte, - "created_dt__lt": json_created_dt_lt, - "created_dt__lte": json_created_dt_lte, - "embargoed": embargoed, - "exclude_fields": json_exclude_fields, - "external_system_id": external_system_id, - "include_fields": json_include_fields, - "include_meta_attr": json_include_meta_attr, - "limit": limit, - "offset": offset, - "order": json_order, - "ps_update_stream": ps_update_stream, - "resolution": resolution, - "status": status, - "type": json_type, - "updated_dt": json_updated_dt, - "updated_dt__date": json_updated_dt_date, - "updated_dt__date__gte": json_updated_dt_date_gte, - "updated_dt__date__lte": json_updated_dt_date_lte, - "updated_dt__gt": json_updated_dt_gt, - "updated_dt__gte": json_updated_dt_gte, - "updated_dt__lt": json_updated_dt_lt, - "updated_dt__lte": json_updated_dt_lte, - "uuid": uuid, - } + json_updated_dt_lte = updated_dt_lte.isoformat() + + params["updated_dt__lte"] = json_updated_dt_lte + + json_uuid: Union[Unset, str] = UNSET + if not isinstance(uuid, Unset): + json_uuid = str(uuid) + + params["uuid"] = json_uuid + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/api/v1/trackers", "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1TrackersListResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -785,116 +597,206 @@ def _parse_response( response_200 = OsidbApiV1TrackersListResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1TrackersListResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - affects_affectedness: Union[ - Unset, None, OsidbApiV1TrackersListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_components: Union[Unset, None, List[str]] = UNSET, - affects_flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_cve_id: Union[Unset, None, str] = UNSET, - affects_flaw_cwe_id: Union[Unset, None, str] = UNSET, - affects_flaw_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_impact: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawImpact - ] = UNSET, - affects_flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_source: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawSource - ] = UNSET, - affects_flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_uuid: Union[Unset, None, str] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1TrackersListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1TrackersListAffectsResolution - ] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1TrackersListOrderItem]] = UNSET, - ps_update_stream: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, str] = UNSET, - status: Union[Unset, None, str] = UNSET, - type: Union[Unset, None, OsidbApiV1TrackersListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1TrackersListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_components: Union[Unset, list[str]] = UNSET, + affects_flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_cve_id: Union[Unset, str] = UNSET, + affects_flaw_cwe_id: Union[Unset, str] = UNSET, + affects_flaw_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_impact: Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact] = UNSET, + affects_flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_source: Union[Unset, OsidbApiV1TrackersListAffectsFlawSource] = UNSET, + affects_flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_uuid: Union[Unset, UUID] = UNSET, + affects_impact: Union[Unset, OsidbApiV1TrackersListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1TrackersListAffectsResolution] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1TrackersListOrderItem]] = UNSET, + ps_update_stream: Union[Unset, str] = UNSET, + resolution: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + type_: Union[Unset, OsidbApiV1TrackersListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1TrackersListResponse200]: + """ + Args: + affects_affectedness (Union[Unset, OsidbApiV1TrackersListAffectsAffectedness]): + affects_created_dt (Union[Unset, datetime.datetime]): + affects_created_dt_date (Union[Unset, datetime.date]): + affects_created_dt_date_gte (Union[Unset, datetime.date]): + affects_created_dt_date_lte (Union[Unset, datetime.date]): + affects_created_dt_gt (Union[Unset, datetime.datetime]): + affects_created_dt_gte (Union[Unset, datetime.datetime]): + affects_created_dt_lt (Union[Unset, datetime.datetime]): + affects_created_dt_lte (Union[Unset, datetime.datetime]): + affects_embargoed (Union[Unset, bool]): + affects_flaw_components (Union[Unset, list[str]]): + affects_flaw_created_dt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_date (Union[Unset, datetime.date]): + affects_flaw_created_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_created_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_created_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_cve_id (Union[Unset, str]): + affects_flaw_cwe_id (Union[Unset, str]): + affects_flaw_embargoed (Union[Unset, bool]): + affects_flaw_impact (Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact]): + affects_flaw_reported_dt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_date (Union[Unset, datetime.date]): + affects_flaw_reported_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_reported_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_reported_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_source (Union[Unset, OsidbApiV1TrackersListAffectsFlawSource]): + affects_flaw_unembargo_dt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_date (Union[Unset, datetime.date]): + affects_flaw_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_uuid (Union[Unset, UUID]): + affects_impact (Union[Unset, OsidbApiV1TrackersListAffectsImpact]): + affects_ps_component (Union[Unset, str]): + affects_ps_module (Union[Unset, str]): + affects_resolution (Union[Unset, OsidbApiV1TrackersListAffectsResolution]): + affects_updated_dt (Union[Unset, datetime.datetime]): + affects_updated_dt_date (Union[Unset, datetime.date]): + affects_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_uuid (Union[Unset, UUID]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + external_system_id (Union[Unset, str]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1TrackersListOrderItem]]): + ps_update_stream (Union[Unset, str]): + resolution (Union[Unset, str]): + status (Union[Unset, str]): + type_ (Union[Unset, OsidbApiV1TrackersListType]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1TrackersListResponse200] + """ + kwargs = _get_kwargs( client=client, affects_affectedness=affects_affectedness, @@ -971,7 +873,7 @@ def sync_detailed( ps_update_stream=ps_update_stream, resolution=resolution, status=status, - type=type, + type_=type_, updated_dt=updated_dt, updated_dt_date=updated_dt_date, updated_dt_date_gte=updated_dt_date_gte, @@ -991,106 +893,191 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - affects_affectedness: Union[ - Unset, None, OsidbApiV1TrackersListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_components: Union[Unset, None, List[str]] = UNSET, - affects_flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_cve_id: Union[Unset, None, str] = UNSET, - affects_flaw_cwe_id: Union[Unset, None, str] = UNSET, - affects_flaw_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_impact: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawImpact - ] = UNSET, - affects_flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_source: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawSource - ] = UNSET, - affects_flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_uuid: Union[Unset, None, str] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1TrackersListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1TrackersListAffectsResolution - ] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1TrackersListOrderItem]] = UNSET, - ps_update_stream: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, str] = UNSET, - status: Union[Unset, None, str] = UNSET, - type: Union[Unset, None, OsidbApiV1TrackersListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1TrackersListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_components: Union[Unset, list[str]] = UNSET, + affects_flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_cve_id: Union[Unset, str] = UNSET, + affects_flaw_cwe_id: Union[Unset, str] = UNSET, + affects_flaw_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_impact: Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact] = UNSET, + affects_flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_source: Union[Unset, OsidbApiV1TrackersListAffectsFlawSource] = UNSET, + affects_flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_uuid: Union[Unset, UUID] = UNSET, + affects_impact: Union[Unset, OsidbApiV1TrackersListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1TrackersListAffectsResolution] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1TrackersListOrderItem]] = UNSET, + ps_update_stream: Union[Unset, str] = UNSET, + resolution: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + type_: Union[Unset, OsidbApiV1TrackersListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1TrackersListResponse200]: - """ """ + """ + Args: + affects_affectedness (Union[Unset, OsidbApiV1TrackersListAffectsAffectedness]): + affects_created_dt (Union[Unset, datetime.datetime]): + affects_created_dt_date (Union[Unset, datetime.date]): + affects_created_dt_date_gte (Union[Unset, datetime.date]): + affects_created_dt_date_lte (Union[Unset, datetime.date]): + affects_created_dt_gt (Union[Unset, datetime.datetime]): + affects_created_dt_gte (Union[Unset, datetime.datetime]): + affects_created_dt_lt (Union[Unset, datetime.datetime]): + affects_created_dt_lte (Union[Unset, datetime.datetime]): + affects_embargoed (Union[Unset, bool]): + affects_flaw_components (Union[Unset, list[str]]): + affects_flaw_created_dt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_date (Union[Unset, datetime.date]): + affects_flaw_created_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_created_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_created_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_cve_id (Union[Unset, str]): + affects_flaw_cwe_id (Union[Unset, str]): + affects_flaw_embargoed (Union[Unset, bool]): + affects_flaw_impact (Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact]): + affects_flaw_reported_dt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_date (Union[Unset, datetime.date]): + affects_flaw_reported_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_reported_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_reported_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_source (Union[Unset, OsidbApiV1TrackersListAffectsFlawSource]): + affects_flaw_unembargo_dt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_date (Union[Unset, datetime.date]): + affects_flaw_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_uuid (Union[Unset, UUID]): + affects_impact (Union[Unset, OsidbApiV1TrackersListAffectsImpact]): + affects_ps_component (Union[Unset, str]): + affects_ps_module (Union[Unset, str]): + affects_resolution (Union[Unset, OsidbApiV1TrackersListAffectsResolution]): + affects_updated_dt (Union[Unset, datetime.datetime]): + affects_updated_dt_date (Union[Unset, datetime.date]): + affects_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_uuid (Union[Unset, UUID]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + external_system_id (Union[Unset, str]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1TrackersListOrderItem]]): + ps_update_stream (Union[Unset, str]): + resolution (Union[Unset, str]): + status (Union[Unset, str]): + type_ (Union[Unset, OsidbApiV1TrackersListType]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1TrackersListResponse200 + """ return sync_detailed( client=client, @@ -1168,7 +1155,7 @@ def sync( ps_update_stream=ps_update_stream, resolution=resolution, status=status, - type=type, + type_=type_, updated_dt=updated_dt, updated_dt_date=updated_dt_date, updated_dt_date_gte=updated_dt_date_gte, @@ -1181,104 +1168,190 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - affects_affectedness: Union[ - Unset, None, OsidbApiV1TrackersListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_components: Union[Unset, None, List[str]] = UNSET, - affects_flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_cve_id: Union[Unset, None, str] = UNSET, - affects_flaw_cwe_id: Union[Unset, None, str] = UNSET, - affects_flaw_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_impact: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawImpact - ] = UNSET, - affects_flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_source: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawSource - ] = UNSET, - affects_flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_uuid: Union[Unset, None, str] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1TrackersListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1TrackersListAffectsResolution - ] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1TrackersListOrderItem]] = UNSET, - ps_update_stream: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, str] = UNSET, - status: Union[Unset, None, str] = UNSET, - type: Union[Unset, None, OsidbApiV1TrackersListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1TrackersListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_components: Union[Unset, list[str]] = UNSET, + affects_flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_cve_id: Union[Unset, str] = UNSET, + affects_flaw_cwe_id: Union[Unset, str] = UNSET, + affects_flaw_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_impact: Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact] = UNSET, + affects_flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_source: Union[Unset, OsidbApiV1TrackersListAffectsFlawSource] = UNSET, + affects_flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_uuid: Union[Unset, UUID] = UNSET, + affects_impact: Union[Unset, OsidbApiV1TrackersListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1TrackersListAffectsResolution] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1TrackersListOrderItem]] = UNSET, + ps_update_stream: Union[Unset, str] = UNSET, + resolution: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + type_: Union[Unset, OsidbApiV1TrackersListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Response[OsidbApiV1TrackersListResponse200]: + """ + Args: + affects_affectedness (Union[Unset, OsidbApiV1TrackersListAffectsAffectedness]): + affects_created_dt (Union[Unset, datetime.datetime]): + affects_created_dt_date (Union[Unset, datetime.date]): + affects_created_dt_date_gte (Union[Unset, datetime.date]): + affects_created_dt_date_lte (Union[Unset, datetime.date]): + affects_created_dt_gt (Union[Unset, datetime.datetime]): + affects_created_dt_gte (Union[Unset, datetime.datetime]): + affects_created_dt_lt (Union[Unset, datetime.datetime]): + affects_created_dt_lte (Union[Unset, datetime.datetime]): + affects_embargoed (Union[Unset, bool]): + affects_flaw_components (Union[Unset, list[str]]): + affects_flaw_created_dt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_date (Union[Unset, datetime.date]): + affects_flaw_created_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_created_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_created_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_cve_id (Union[Unset, str]): + affects_flaw_cwe_id (Union[Unset, str]): + affects_flaw_embargoed (Union[Unset, bool]): + affects_flaw_impact (Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact]): + affects_flaw_reported_dt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_date (Union[Unset, datetime.date]): + affects_flaw_reported_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_reported_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_reported_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_source (Union[Unset, OsidbApiV1TrackersListAffectsFlawSource]): + affects_flaw_unembargo_dt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_date (Union[Unset, datetime.date]): + affects_flaw_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_uuid (Union[Unset, UUID]): + affects_impact (Union[Unset, OsidbApiV1TrackersListAffectsImpact]): + affects_ps_component (Union[Unset, str]): + affects_ps_module (Union[Unset, str]): + affects_resolution (Union[Unset, OsidbApiV1TrackersListAffectsResolution]): + affects_updated_dt (Union[Unset, datetime.datetime]): + affects_updated_dt_date (Union[Unset, datetime.date]): + affects_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_uuid (Union[Unset, UUID]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + external_system_id (Union[Unset, str]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1TrackersListOrderItem]]): + ps_update_stream (Union[Unset, str]): + resolution (Union[Unset, str]): + status (Union[Unset, str]): + type_ (Union[Unset, OsidbApiV1TrackersListType]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1TrackersListResponse200] + """ + kwargs = _get_kwargs( - client=client, affects_affectedness=affects_affectedness, affects_created_dt=affects_created_dt, affects_created_dt_date=affects_created_dt_date, @@ -1353,7 +1426,7 @@ async def async_detailed( ps_update_stream=ps_update_stream, resolution=resolution, status=status, - type=type, + type_=type_, updated_dt=updated_dt, updated_dt_date=updated_dt_date, updated_dt_date_gte=updated_dt_date_gte, @@ -1365,117 +1438,196 @@ async def async_detailed( uuid=uuid, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - affects_affectedness: Union[ - Unset, None, OsidbApiV1TrackersListAffectsAffectedness - ] = UNSET, - affects_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_components: Union[Unset, None, List[str]] = UNSET, - affects_flaw_created_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_cve_id: Union[Unset, None, str] = UNSET, - affects_flaw_cwe_id: Union[Unset, None, str] = UNSET, - affects_flaw_embargoed: Union[Unset, None, bool] = UNSET, - affects_flaw_impact: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawImpact - ] = UNSET, - affects_flaw_reported_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_reported_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_reported_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_source: Union[ - Unset, None, OsidbApiV1TrackersListAffectsFlawSource - ] = UNSET, - affects_flaw_unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_flaw_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_flaw_uuid: Union[Unset, None, str] = UNSET, - affects_impact: Union[Unset, None, OsidbApiV1TrackersListAffectsImpact] = UNSET, - affects_ps_component: Union[Unset, None, str] = UNSET, - affects_ps_module: Union[Unset, None, str] = UNSET, - affects_resolution: Union[ - Unset, None, OsidbApiV1TrackersListAffectsResolution - ] = UNSET, - affects_updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - affects_updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - affects_updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - affects_uuid: Union[Unset, None, str] = UNSET, - created_dt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_date: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - created_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - created_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - created_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - embargoed: Union[Unset, None, bool] = UNSET, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - external_system_id: Union[Unset, None, str] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, - limit: Union[Unset, None, int] = UNSET, - offset: Union[Unset, None, int] = UNSET, - order: Union[Unset, None, List[OsidbApiV1TrackersListOrderItem]] = UNSET, - ps_update_stream: Union[Unset, None, str] = UNSET, - resolution: Union[Unset, None, str] = UNSET, - status: Union[Unset, None, str] = UNSET, - type: Union[Unset, None, OsidbApiV1TrackersListType] = UNSET, - updated_dt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_date: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_gte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_date_lte: Union[Unset, None, datetime.date] = UNSET, - updated_dt_gt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_gte: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lt: Union[Unset, None, datetime.datetime] = UNSET, - updated_dt_lte: Union[Unset, None, datetime.datetime] = UNSET, - uuid: Union[Unset, None, str] = UNSET, + affects_affectedness: Union[Unset, OsidbApiV1TrackersListAffectsAffectedness] = UNSET, + affects_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_components: Union[Unset, list[str]] = UNSET, + affects_flaw_created_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_cve_id: Union[Unset, str] = UNSET, + affects_flaw_cwe_id: Union[Unset, str] = UNSET, + affects_flaw_embargoed: Union[Unset, bool] = UNSET, + affects_flaw_impact: Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact] = UNSET, + affects_flaw_reported_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_reported_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_reported_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_source: Union[Unset, OsidbApiV1TrackersListAffectsFlawSource] = UNSET, + affects_flaw_unembargo_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_flaw_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_flaw_uuid: Union[Unset, UUID] = UNSET, + affects_impact: Union[Unset, OsidbApiV1TrackersListAffectsImpact] = UNSET, + affects_ps_component: Union[Unset, str] = UNSET, + affects_ps_module: Union[Unset, str] = UNSET, + affects_resolution: Union[Unset, OsidbApiV1TrackersListAffectsResolution] = UNSET, + affects_updated_dt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_date: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + affects_updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + affects_updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + affects_uuid: Union[Unset, UUID] = UNSET, + created_dt: Union[Unset, datetime.datetime] = UNSET, + created_dt_date: Union[Unset, datetime.date] = UNSET, + created_dt_date_gte: Union[Unset, datetime.date] = UNSET, + created_dt_date_lte: Union[Unset, datetime.date] = UNSET, + created_dt_gt: Union[Unset, datetime.datetime] = UNSET, + created_dt_gte: Union[Unset, datetime.datetime] = UNSET, + created_dt_lt: Union[Unset, datetime.datetime] = UNSET, + created_dt_lte: Union[Unset, datetime.datetime] = UNSET, + embargoed: Union[Unset, bool] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + external_system_id: Union[Unset, str] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + order: Union[Unset, list[OsidbApiV1TrackersListOrderItem]] = UNSET, + ps_update_stream: Union[Unset, str] = UNSET, + resolution: Union[Unset, str] = UNSET, + status: Union[Unset, str] = UNSET, + type_: Union[Unset, OsidbApiV1TrackersListType] = UNSET, + updated_dt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_date: Union[Unset, datetime.date] = UNSET, + updated_dt_date_gte: Union[Unset, datetime.date] = UNSET, + updated_dt_date_lte: Union[Unset, datetime.date] = UNSET, + updated_dt_gt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_gte: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lt: Union[Unset, datetime.datetime] = UNSET, + updated_dt_lte: Union[Unset, datetime.datetime] = UNSET, + uuid: Union[Unset, UUID] = UNSET, ) -> Optional[OsidbApiV1TrackersListResponse200]: - """ """ + """ + Args: + affects_affectedness (Union[Unset, OsidbApiV1TrackersListAffectsAffectedness]): + affects_created_dt (Union[Unset, datetime.datetime]): + affects_created_dt_date (Union[Unset, datetime.date]): + affects_created_dt_date_gte (Union[Unset, datetime.date]): + affects_created_dt_date_lte (Union[Unset, datetime.date]): + affects_created_dt_gt (Union[Unset, datetime.datetime]): + affects_created_dt_gte (Union[Unset, datetime.datetime]): + affects_created_dt_lt (Union[Unset, datetime.datetime]): + affects_created_dt_lte (Union[Unset, datetime.datetime]): + affects_embargoed (Union[Unset, bool]): + affects_flaw_components (Union[Unset, list[str]]): + affects_flaw_created_dt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_date (Union[Unset, datetime.date]): + affects_flaw_created_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_created_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_created_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_created_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_cve_id (Union[Unset, str]): + affects_flaw_cwe_id (Union[Unset, str]): + affects_flaw_embargoed (Union[Unset, bool]): + affects_flaw_impact (Union[Unset, OsidbApiV1TrackersListAffectsFlawImpact]): + affects_flaw_reported_dt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_date (Union[Unset, datetime.date]): + affects_flaw_reported_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_reported_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_reported_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_reported_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_source (Union[Unset, OsidbApiV1TrackersListAffectsFlawSource]): + affects_flaw_unembargo_dt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_date (Union[Unset, datetime.date]): + affects_flaw_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_flaw_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_flaw_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_flaw_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_flaw_uuid (Union[Unset, UUID]): + affects_impact (Union[Unset, OsidbApiV1TrackersListAffectsImpact]): + affects_ps_component (Union[Unset, str]): + affects_ps_module (Union[Unset, str]): + affects_resolution (Union[Unset, OsidbApiV1TrackersListAffectsResolution]): + affects_updated_dt (Union[Unset, datetime.datetime]): + affects_updated_dt_date (Union[Unset, datetime.date]): + affects_updated_dt_date_gte (Union[Unset, datetime.date]): + affects_updated_dt_date_lte (Union[Unset, datetime.date]): + affects_updated_dt_gt (Union[Unset, datetime.datetime]): + affects_updated_dt_gte (Union[Unset, datetime.datetime]): + affects_updated_dt_lt (Union[Unset, datetime.datetime]): + affects_updated_dt_lte (Union[Unset, datetime.datetime]): + affects_uuid (Union[Unset, UUID]): + created_dt (Union[Unset, datetime.datetime]): + created_dt_date (Union[Unset, datetime.date]): + created_dt_date_gte (Union[Unset, datetime.date]): + created_dt_date_lte (Union[Unset, datetime.date]): + created_dt_gt (Union[Unset, datetime.datetime]): + created_dt_gte (Union[Unset, datetime.datetime]): + created_dt_lt (Union[Unset, datetime.datetime]): + created_dt_lte (Union[Unset, datetime.datetime]): + embargoed (Union[Unset, bool]): + exclude_fields (Union[Unset, list[str]]): + external_system_id (Union[Unset, str]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + limit (Union[Unset, int]): + offset (Union[Unset, int]): + order (Union[Unset, list[OsidbApiV1TrackersListOrderItem]]): + ps_update_stream (Union[Unset, str]): + resolution (Union[Unset, str]): + status (Union[Unset, str]): + type_ (Union[Unset, OsidbApiV1TrackersListType]): + updated_dt (Union[Unset, datetime.datetime]): + updated_dt_date (Union[Unset, datetime.date]): + updated_dt_date_gte (Union[Unset, datetime.date]): + updated_dt_date_lte (Union[Unset, datetime.date]): + updated_dt_gt (Union[Unset, datetime.datetime]): + updated_dt_gte (Union[Unset, datetime.datetime]): + updated_dt_lt (Union[Unset, datetime.datetime]): + updated_dt_lte (Union[Unset, datetime.datetime]): + uuid (Union[Unset, UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1TrackersListResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, affects_affectedness=affects_affectedness, affects_created_dt=affects_created_dt, @@ -1551,7 +1703,7 @@ async def async_( ps_update_stream=ps_update_stream, resolution=resolution, status=status, - type=type, + type_=type_, updated_dt=updated_dt, updated_dt_date=updated_dt_date, updated_dt_date_gte=updated_dt_date_gte, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_retrieve.py index 0edec26..23c8e33 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_retrieve.py @@ -1,72 +1,59 @@ -from typing import Any, Dict, List, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_trackers_retrieve_response_200 import ( - OsidbApiV1TrackersRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "exclude_fields": List[str], - "include_fields": List[str], - "include_meta_attr": List[str], -} +from ...models.osidb_api_v1_trackers_retrieve_response_200 import OsidbApiV1TrackersRetrieveResponse200 +from uuid import UUID def _get_kwargs( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/trackers/{uuid}".format( - client.base_url, - uuid=uuid, - ) - - headers: Dict[str, Any] = client.get_headers() + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - json_exclude_fields: Union[Unset, None, List[str]] = UNSET + json_exclude_fields: Union[Unset, list[str]] = UNSET if not isinstance(exclude_fields, Unset): - if exclude_fields is None: - json_exclude_fields = None - else: - json_exclude_fields = exclude_fields + json_exclude_fields = exclude_fields + + params["exclude_fields"] = json_exclude_fields - json_include_fields: Union[Unset, None, List[str]] = UNSET + json_include_fields: Union[Unset, list[str]] = UNSET if not isinstance(include_fields, Unset): - if include_fields is None: - json_include_fields = None - else: - json_include_fields = include_fields + json_include_fields = include_fields - json_include_meta_attr: Union[Unset, None, List[str]] = UNSET + params["include_fields"] = json_include_fields + + json_include_meta_attr: Union[Unset, list[str]] = UNSET if not isinstance(include_meta_attr, Unset): - if include_meta_attr is None: - json_include_meta_attr = None - else: - json_include_meta_attr = include_meta_attr + json_include_meta_attr = include_meta_attr + + params["include_meta_attr"] = json_include_meta_attr - params: Dict[str, Any] = { - "exclude_fields": json_exclude_fields, - "include_fields": json_include_fields, - "include_meta_attr": json_include_meta_attr, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/trackers/{uuid}".format( + uuid=uuid, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1TrackersRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -74,33 +61,49 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = OsidbApiV1TrackersRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = OsidbApiV1TrackersRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1TrackersRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1TrackersRetrieveResponse200]: + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1TrackersRetrieveResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, client=client, @@ -117,18 +120,31 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1TrackersRetrieveResponse200]: - """ """ + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1TrackersRetrieveResponse200 + """ return sync_detailed( uuid=uuid, @@ -139,45 +155,66 @@ def sync( ).parsed -async def async_detailed( - uuid: str, +async def asyncio_detailed( + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, ) -> Response[OsidbApiV1TrackersRetrieveResponse200]: + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1TrackersRetrieveResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, - client=client, exclude_fields=exclude_fields, include_fields=include_fields, include_meta_attr=include_meta_attr, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - uuid: str, +async def asyncio( + uuid: UUID, *, client: AuthenticatedClient, - exclude_fields: Union[Unset, None, List[str]] = UNSET, - include_fields: Union[Unset, None, List[str]] = UNSET, - include_meta_attr: Union[Unset, None, List[str]] = UNSET, + exclude_fields: Union[Unset, list[str]] = UNSET, + include_fields: Union[Unset, list[str]] = UNSET, + include_meta_attr: Union[Unset, list[str]] = UNSET, ) -> Optional[OsidbApiV1TrackersRetrieveResponse200]: - """ """ + """ + Args: + uuid (UUID): + exclude_fields (Union[Unset, list[str]]): + include_fields (Union[Unset, list[str]]): + include_meta_attr (Union[Unset, list[str]]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1TrackersRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( uuid=uuid, client=client, exclude_fields=exclude_fields, diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_update.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_update.py index b27805f..9386a62 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_update.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_trackers_update.py @@ -1,50 +1,50 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_api_v1_trackers_update_response_200 import ( - OsidbApiV1TrackersUpdateResponse200, -) -from ...models.tracker import Tracker -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = Tracker +from ...models.osidb_api_v1_trackers_update_response_200 import OsidbApiV1TrackersUpdateResponse200 +from ...models.tracker import Tracker +from uuid import UUID def _get_kwargs( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - form_data: Tracker, - multipart_data: Tracker, - json_body: Tracker, -) -> Dict[str, Any]: - url = "{}/osidb/api/v1/trackers/{uuid}".format( - client.base_url, - uuid=uuid, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + Tracker, + Tracker, + Tracker, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//osidb/api/v1/trackers/{uuid}".format( + uuid=uuid, + ), + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, Tracker): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbApiV1TrackersUpdateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -55,34 +55,54 @@ def _parse_response( response_200 = OsidbApiV1TrackersUpdateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbApiV1TrackersUpdateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - form_data: Tracker, - multipart_data: Tracker, - json_body: Tracker, + body: Union[ + Tracker, + Tracker, + Tracker, + ], ) -> Response[OsidbApiV1TrackersUpdateResponse200]: + """ + Args: + uuid (UUID): + bugzilla_api_key (str): + jira_api_key (str): + body (Tracker): Tracker serializer + body (Tracker): Tracker serializer + body (Tracker): Tracker serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1TrackersUpdateResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.put( @@ -93,71 +113,111 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, - form_data: Tracker, - multipart_data: Tracker, - json_body: Tracker, + body: Union[ + Tracker, + Tracker, + Tracker, + ], ) -> Optional[OsidbApiV1TrackersUpdateResponse200]: - """ """ + """ + Args: + uuid (UUID): + bugzilla_api_key (str): + jira_api_key (str): + body (Tracker): Tracker serializer + body (Tracker): Tracker serializer + body (Tracker): Tracker serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1TrackersUpdateResponse200 + """ return sync_detailed( uuid=uuid, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( - uuid: str, +async def asyncio_detailed( + uuid: UUID, *, client: AuthenticatedClient, - form_data: Tracker, - multipart_data: Tracker, - json_body: Tracker, + body: Union[ + Tracker, + Tracker, + Tracker, + ], ) -> Response[OsidbApiV1TrackersUpdateResponse200]: + """ + Args: + uuid (UUID): + bugzilla_api_key (str): + jira_api_key (str): + body (Tracker): Tracker serializer + body (Tracker): Tracker serializer + body (Tracker): Tracker serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbApiV1TrackersUpdateResponse200] + """ + kwargs = _get_kwargs( uuid=uuid, - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().put( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( - uuid: str, +async def asyncio( + uuid: UUID, *, client: AuthenticatedClient, - form_data: Tracker, - multipart_data: Tracker, - json_body: Tracker, + body: Union[ + Tracker, + Tracker, + Tracker, + ], ) -> Optional[OsidbApiV1TrackersUpdateResponse200]: - """ """ + """ + Args: + uuid (UUID): + bugzilla_api_key (str): + jira_api_key (str): + body (Tracker): Tracker serializer + body (Tracker): Tracker serializer + body (Tracker): Tracker serializer + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbApiV1TrackersUpdateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( uuid=uuid, client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_healthy_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_healthy_retrieve.py index 8368471..8237776 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_healthy_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_healthy_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_healthy_retrieve_response_200 import ( - OsidbHealthyRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_healthy_retrieve_response_200 import OsidbHealthyRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/healthy".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/healthy", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbHealthyRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -39,17 +34,20 @@ def _parse_response( response_200 = OsidbHealthyRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbHealthyRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -57,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbHealthyRetrieveResponse200]: + """unauthenticated view providing healthcheck on osidb service + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbHealthyRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -69,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[OsidbHealthyRetrieveResponse200]: - """unauthenticated view providing healthcheck on osidb service""" + """unauthenticated view providing healthcheck on osidb service + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbHealthyRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbHealthyRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """unauthenticated view providing healthcheck on osidb service + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[OsidbHealthyRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[OsidbHealthyRetrieveResponse200]: - """unauthenticated view providing healthcheck on osidb service""" + """unauthenticated view providing healthcheck on osidb service + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbHealthyRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/osidb/osidb_whoami_retrieve.py b/osidb_bindings/bindings/python_client/api/osidb/osidb_whoami_retrieve.py index 92aa8c2..2c5ed95 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/osidb_whoami_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_whoami_retrieve.py @@ -1,32 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.osidb_whoami_retrieve_response_200 import OsidbWhoamiRetrieveResponse200 -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.osidb_whoami_retrieve_response_200 import OsidbWhoamiRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/osidb/whoami".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/osidb/whoami", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[OsidbWhoamiRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -37,17 +34,20 @@ def _parse_response( response_200 = OsidbWhoamiRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[OsidbWhoamiRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -55,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbWhoamiRetrieveResponse200]: + """View that provides information about the currently logged-in user + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[OsidbWhoamiRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -67,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[OsidbWhoamiRetrieveResponse200]: - """View that provides information about the currently logged-in user""" + """View that provides information about the currently logged-in user + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbWhoamiRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[OsidbWhoamiRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """View that provides information about the currently logged-in user + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[OsidbWhoamiRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[OsidbWhoamiRetrieveResponse200]: - """View that provides information about the currently logged-in user""" + """View that provides information about the currently logged-in user + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + OsidbWhoamiRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/trackers/trackers_api_v1_file_create.py b/osidb_bindings/bindings/python_client/api/trackers/trackers_api_v1_file_create.py index 2e13e54..8fe8d09 100644 --- a/osidb_bindings/bindings/python_client/api/trackers/trackers_api_v1_file_create.py +++ b/osidb_bindings/bindings/python_client/api/trackers/trackers_api_v1_file_create.py @@ -1,48 +1,46 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.flaw_uuid_list import FlawUUIDList -from ...models.trackers_api_v1_file_create_response_200 import ( - TrackersApiV1FileCreateResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} -REQUEST_BODY_TYPE = FlawUUIDList +from ...models.flaw_uuid_list import FlawUUIDList +from ...models.trackers_api_v1_file_create_response_200 import TrackersApiV1FileCreateResponse200 def _get_kwargs( *, client: AuthenticatedClient, - form_data: FlawUUIDList, - multipart_data: FlawUUIDList, - json_body: FlawUUIDList, -) -> Dict[str, Any]: - url = "{}/trackers/api/v1/file".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() + body: Union[ + FlawUUIDList, + FlawUUIDList, + FlawUUIDList, + ], +) -> dict[str, Any]: + headers: dict[str, Any] = client.get_headers() + + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/trackers/api/v1/file", + } - json_json_body: Dict[str, Any] = UNSET - if not isinstance(json_body, Unset): - json_body.to_dict() + if isinstance(body, FlawUUIDList): + _json_body: dict[str, Any] = UNSET + if not isinstance(body, Unset): + _json_body = body.to_dict() - multipart_multipart_data: Dict[str, Any] = UNSET - if not isinstance(multipart_data, Unset): - multipart_data.to_multipart() + _kwargs["json"] = _json_body + headers["Content-Type"] = "application/json" - return { - "url": url, - "headers": headers, - "json": form_data.to_dict(), - } + _kwargs["headers"] = headers + return _kwargs def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[TrackersApiV1FileCreateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -53,32 +51,50 @@ def _parse_response( response_200 = TrackersApiV1FileCreateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[TrackersApiV1FileCreateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) def sync_detailed( *, client: AuthenticatedClient, - form_data: FlawUUIDList, - multipart_data: FlawUUIDList, - json_body: FlawUUIDList, + body: Union[ + FlawUUIDList, + FlawUUIDList, + FlawUUIDList, + ], ) -> Response[TrackersApiV1FileCreateResponse200]: + """Given a list of flaws, generates a list of suggested trackers to file. + + Args: + body (FlawUUIDList): + body (FlawUUIDList): + body (FlawUUIDList): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TrackersApiV1FileCreateResponse200] + """ + kwargs = _get_kwargs( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) response = requests.post( @@ -89,65 +105,99 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, - form_data: FlawUUIDList, - multipart_data: FlawUUIDList, - json_body: FlawUUIDList, + body: Union[ + FlawUUIDList, + FlawUUIDList, + FlawUUIDList, + ], ) -> Optional[TrackersApiV1FileCreateResponse200]: - """Given a list of flaws, generates a list of suggested trackers to file.""" + """Given a list of flaws, generates a list of suggested trackers to file. + + Args: + body (FlawUUIDList): + body (FlawUUIDList): + body (FlawUUIDList): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TrackersApiV1FileCreateResponse200 + """ return sync_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, - form_data: FlawUUIDList, - multipart_data: FlawUUIDList, - json_body: FlawUUIDList, + body: Union[ + FlawUUIDList, + FlawUUIDList, + FlawUUIDList, + ], ) -> Response[TrackersApiV1FileCreateResponse200]: + """Given a list of flaws, generates a list of suggested trackers to file. + + Args: + body (FlawUUIDList): + body (FlawUUIDList): + body (FlawUUIDList): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TrackersApiV1FileCreateResponse200] + """ + kwargs = _get_kwargs( - client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( *, client: AuthenticatedClient, - form_data: FlawUUIDList, - multipart_data: FlawUUIDList, - json_body: FlawUUIDList, + body: Union[ + FlawUUIDList, + FlawUUIDList, + FlawUUIDList, + ], ) -> Optional[TrackersApiV1FileCreateResponse200]: - """Given a list of flaws, generates a list of suggested trackers to file.""" + """Given a list of flaws, generates a list of suggested trackers to file. + + Args: + body (FlawUUIDList): + body (FlawUUIDList): + body (FlawUUIDList): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TrackersApiV1FileCreateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, - form_data=form_data, - multipart_data=multipart_data, - json_body=json_body, + body=body, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/workflows/__init__.py b/osidb_bindings/bindings/python_client/api/workflows/__init__.py index bca00ab..483bedf 100644 --- a/osidb_bindings/bindings/python_client/api/workflows/__init__.py +++ b/osidb_bindings/bindings/python_client/api/workflows/__init__.py @@ -1,5 +1,5 @@ -from .workflows_api_v1_workflows_adjust_create import * +from .workflows_retrieve import * from .workflows_api_v1_workflows_retrieve import * from .workflows_api_v1_workflows_retrieve_2 import * +from .workflows_api_v1_workflows_adjust_create import * from .workflows_healthy_retrieve import * -from .workflows_retrieve import * diff --git a/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_adjust_create.py b/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_adjust_create.py index 3759077..5e39441 100644 --- a/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_adjust_create.py +++ b/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_adjust_create.py @@ -1,36 +1,34 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors + from ...models.workflows_api_v1_workflows_adjust_create_response_200 import ( WorkflowsApiV1WorkflowsAdjustCreateResponse200, ) -from ...types import UNSET, Response, Unset - -QUERY_PARAMS = {} def _get_kwargs( id: str, *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/workflows/api/v1/workflows/{id}/adjust".format( - client.base_url, - id=id, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//workflows/api/v1/workflows/{id}/adjust".format( + id=id, + ), } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[WorkflowsApiV1WorkflowsAdjustCreateResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -38,22 +36,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = WorkflowsApiV1WorkflowsAdjustCreateResponse200.from_dict( - _response_200 - ) + response_200 = WorkflowsApiV1WorkflowsAdjustCreateResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WorkflowsApiV1WorkflowsAdjustCreateResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -62,6 +61,25 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[WorkflowsApiV1WorkflowsAdjustCreateResponse200]: + """workflow adjustion API endpoint + + adjust workflow classification of flaw identified by UUID or CVE + and return its workflow:state classification (new if changed and old otherwise) + + adjust operation is idempotent so when the classification + is already adjusted running it results in no operation + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[WorkflowsApiV1WorkflowsAdjustCreateResponse200] + """ + kwargs = _get_kwargs( id=id, client=client, @@ -75,7 +93,7 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( @@ -89,7 +107,18 @@ def sync( and return its workflow:state classification (new if changed and old otherwise) adjust operation is idempotent so when the classification - is already adjusted running it results in no operation""" + is already adjusted running it results in no operation + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsApiV1WorkflowsAdjustCreateResponse200 + """ return sync_detailed( id=id, @@ -97,28 +126,40 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( id: str, *, client: AuthenticatedClient, ) -> Response[WorkflowsApiV1WorkflowsAdjustCreateResponse200]: + """workflow adjustion API endpoint + + adjust workflow classification of flaw identified by UUID or CVE + and return its workflow:state classification (new if changed and old otherwise) + + adjust operation is idempotent so when the classification + is already adjusted running it results in no operation + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[WorkflowsApiV1WorkflowsAdjustCreateResponse200] + """ + kwargs = _get_kwargs( id=id, - client=client, ) - async with client.get_async_session().post( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( id: str, *, client: AuthenticatedClient, @@ -129,10 +170,21 @@ async def async_( and return its workflow:state classification (new if changed and old otherwise) adjust operation is idempotent so when the classification - is already adjusted running it results in no operation""" + is already adjusted running it results in no operation + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsApiV1WorkflowsAdjustCreateResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( id=id, client=client, ) diff --git a/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_retrieve.py b/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_retrieve.py index 5622123..1fb1f8b 100644 --- a/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.workflows_api_v1_workflows_retrieve_response_200 import ( - WorkflowsApiV1WorkflowsRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.workflows_api_v1_workflows_retrieve_response_200 import WorkflowsApiV1WorkflowsRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/workflows/api/v1/workflows".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/workflows/api/v1/workflows", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[WorkflowsApiV1WorkflowsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -36,22 +31,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = WorkflowsApiV1WorkflowsRetrieveResponse200.from_dict( - _response_200 - ) + response_200 = WorkflowsApiV1WorkflowsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WorkflowsApiV1WorkflowsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -59,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[WorkflowsApiV1WorkflowsRetrieveResponse200]: + """workflow info API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[WorkflowsApiV1WorkflowsRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -71,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[WorkflowsApiV1WorkflowsRetrieveResponse200]: - """workflow info API endpoint""" + """workflow info API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsApiV1WorkflowsRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[WorkflowsApiV1WorkflowsRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """workflow info API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[WorkflowsApiV1WorkflowsRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[WorkflowsApiV1WorkflowsRetrieveResponse200]: - """workflow info API endpoint""" + """workflow info API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsApiV1WorkflowsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_retrieve_2.py b/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_retrieve_2.py index e29fd1f..29ab421 100644 --- a/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_retrieve_2.py +++ b/osidb_bindings/bindings/python_client/api/workflows/workflows_api_v1_workflows_retrieve_2.py @@ -1,45 +1,40 @@ -from typing import Any, Dict, Optional, Union +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.workflows_api_v1_workflows_retrieve_2_response_200 import ( - WorkflowsApiV1WorkflowsRetrieve2Response200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = { - "verbose": bool, -} +from ...models.workflows_api_v1_workflows_retrieve_2_response_200 import WorkflowsApiV1WorkflowsRetrieve2Response200 def _get_kwargs( id: str, *, client: AuthenticatedClient, - verbose: Union[Unset, None, bool] = UNSET, -) -> Dict[str, Any]: - url = "{}/workflows/api/v1/workflows/{id}".format( - client.base_url, - id=id, - ) + verbose: Union[Unset, bool] = UNSET, +) -> dict[str, Any]: + params: dict[str, Any] = {} - headers: Dict[str, Any] = client.get_headers() + params["verbose"] = verbose - params: Dict[str, Any] = { - "verbose": verbose, - } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - return { - "url": url, - "headers": headers, + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}//workflows/api/v1/workflows/{id}".format( + id=id, + ), "params": params, } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[WorkflowsApiV1WorkflowsRetrieve2Response200]: if response.status_code == 200: _response_200 = response.json() @@ -47,22 +42,23 @@ def _parse_response( if isinstance(_response_200, Unset): response_200 = UNSET else: - response_200 = WorkflowsApiV1WorkflowsRetrieve2Response200.from_dict( - _response_200 - ) + response_200 = WorkflowsApiV1WorkflowsRetrieve2Response200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WorkflowsApiV1WorkflowsRetrieve2Response200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -70,8 +66,29 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - verbose: Union[Unset, None, bool] = UNSET, + verbose: Union[Unset, bool] = UNSET, ) -> Response[WorkflowsApiV1WorkflowsRetrieve2Response200]: + """workflow classification API endpoint + + for flaw identified by UUID or CVE returns its workflow:state classification + + params: + + verbose - return also workflows with flaw classification + which represents the reasoning of the result + + Args: + id (str): + verbose (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[WorkflowsApiV1WorkflowsRetrieve2Response200] + """ + kwargs = _get_kwargs( id=id, client=client, @@ -86,14 +103,14 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( id: str, *, client: AuthenticatedClient, - verbose: Union[Unset, None, bool] = UNSET, + verbose: Union[Unset, bool] = UNSET, ) -> Optional[WorkflowsApiV1WorkflowsRetrieve2Response200]: """workflow classification API endpoint @@ -102,7 +119,19 @@ def sync( params: verbose - return also workflows with flaw classification - which represents the reasoning of the result""" + which represents the reasoning of the result + + Args: + id (str): + verbose (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsApiV1WorkflowsRetrieve2Response200 + """ return sync_detailed( id=id, @@ -111,34 +140,48 @@ def sync( ).parsed -async def async_detailed( +async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - verbose: Union[Unset, None, bool] = UNSET, + verbose: Union[Unset, bool] = UNSET, ) -> Response[WorkflowsApiV1WorkflowsRetrieve2Response200]: + """workflow classification API endpoint + + for flaw identified by UUID or CVE returns its workflow:state classification + + params: + + verbose - return also workflows with flaw classification + which represents the reasoning of the result + + Args: + id (str): + verbose (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[WorkflowsApiV1WorkflowsRetrieve2Response200] + """ + kwargs = _get_kwargs( id=id, - client=client, verbose=verbose, ) - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + response = await client.get_async_httpx_client().request(**kwargs) - return _build_response(response=resp) + return _build_response(client=client, response=response) -async def async_( +async def asyncio( id: str, *, client: AuthenticatedClient, - verbose: Union[Unset, None, bool] = UNSET, + verbose: Union[Unset, bool] = UNSET, ) -> Optional[WorkflowsApiV1WorkflowsRetrieve2Response200]: """workflow classification API endpoint @@ -147,10 +190,22 @@ async def async_( params: verbose - return also workflows with flaw classification - which represents the reasoning of the result""" + which represents the reasoning of the result + + Args: + id (str): + verbose (Union[Unset, bool]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsApiV1WorkflowsRetrieve2Response200 + """ return ( - await async_detailed( + await asyncio_detailed( id=id, client=client, verbose=verbose, diff --git a/osidb_bindings/bindings/python_client/api/workflows/workflows_healthy_retrieve.py b/osidb_bindings/bindings/python_client/api/workflows/workflows_healthy_retrieve.py index bc1d14a..bba626f 100644 --- a/osidb_bindings/bindings/python_client/api/workflows/workflows_healthy_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/workflows/workflows_healthy_retrieve.py @@ -1,34 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.workflows_healthy_retrieve_response_200 import ( - WorkflowsHealthyRetrieveResponse200, -) -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.workflows_healthy_retrieve_response_200 import WorkflowsHealthyRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/workflows/healthy".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/workflows/healthy", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[WorkflowsHealthyRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -39,17 +34,20 @@ def _parse_response( response_200 = WorkflowsHealthyRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WorkflowsHealthyRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -57,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[WorkflowsHealthyRetrieveResponse200]: + """unauthenticated health check API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[WorkflowsHealthyRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -69,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[WorkflowsHealthyRetrieveResponse200]: - """unauthenticated health check API endpoint""" + """unauthenticated health check API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsHealthyRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[WorkflowsHealthyRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """unauthenticated health check API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[WorkflowsHealthyRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[WorkflowsHealthyRetrieveResponse200]: - """unauthenticated health check API endpoint""" + """unauthenticated health check API endpoint + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsHealthyRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/api/workflows/workflows_retrieve.py b/osidb_bindings/bindings/python_client/api/workflows/workflows_retrieve.py index 89cc139..acb511e 100644 --- a/osidb_bindings/bindings/python_client/api/workflows/workflows_retrieve.py +++ b/osidb_bindings/bindings/python_client/api/workflows/workflows_retrieve.py @@ -1,32 +1,29 @@ -from typing import Any, Dict, Optional +from http import HTTPStatus +from typing import Any, Optional, Union +import httpx import requests -from ...client import AuthenticatedClient -from ...models.workflows_retrieve_response_200 import WorkflowsRetrieveResponse200 -from ...types import UNSET, Response, Unset +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET, Unset +from ... import errors -QUERY_PARAMS = {} +from ...models.workflows_retrieve_response_200 import WorkflowsRetrieveResponse200 def _get_kwargs( *, client: AuthenticatedClient, -) -> Dict[str, Any]: - url = "{}/workflows/".format( - client.base_url, - ) - - headers: Dict[str, Any] = client.get_headers() - - return { - "url": url, - "headers": headers, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "url": f"{client.base_url}/workflows/", } + return _kwargs + def _parse_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Optional[WorkflowsRetrieveResponse200]: if response.status_code == 200: _response_200 = response.json() @@ -37,17 +34,20 @@ def _parse_response( response_200 = WorkflowsRetrieveResponse200.from_dict(_response_200) return response_200 - return None + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None def _build_response( - *, response: requests.Response + *, client: Union[AuthenticatedClient, Client], response: httpx.Response ) -> Response[WorkflowsRetrieveResponse200]: return Response( - status_code=response.status_code, + status_code=HTTPStatus(response.status_code), content=response.content, headers=response.headers, - parsed=_parse_response(response=response), + parsed=_parse_response(client=client, response=response), ) @@ -55,6 +55,16 @@ def sync_detailed( *, client: AuthenticatedClient, ) -> Response[WorkflowsRetrieveResponse200]: + """index API endpoint listing available API endpoints + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[WorkflowsRetrieveResponse200] + """ + kwargs = _get_kwargs( client=client, ) @@ -67,47 +77,65 @@ def sync_detailed( ) response.raise_for_status() - return _build_response(response=response) + return _build_response(client=client, response=response) def sync( *, client: AuthenticatedClient, ) -> Optional[WorkflowsRetrieveResponse200]: - """index API endpoint listing available API endpoints""" + """index API endpoint listing available API endpoints + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsRetrieveResponse200 + """ return sync_detailed( client=client, ).parsed -async def async_detailed( +async def asyncio_detailed( *, client: AuthenticatedClient, ) -> Response[WorkflowsRetrieveResponse200]: - kwargs = _get_kwargs( - client=client, - ) + """index API endpoint listing available API endpoints + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. - async with client.get_async_session().get( - verify_ssl=client.verify_ssl, raise_for_status=True, **kwargs - ) as response: - content = await response.read() - resp = requests.Response() - resp.status_code = response.status - resp._content = content + Returns: + Response[WorkflowsRetrieveResponse200] + """ - return _build_response(response=resp) + kwargs = _get_kwargs() + response = await client.get_async_httpx_client().request(**kwargs) -async def async_( + return _build_response(client=client, response=response) + + +async def asyncio( *, client: AuthenticatedClient, ) -> Optional[WorkflowsRetrieveResponse200]: - """index API endpoint listing available API endpoints""" + """index API endpoint listing available API endpoints + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + WorkflowsRetrieveResponse200 + """ return ( - await async_detailed( + await asyncio_detailed( client=client, ) ).parsed diff --git a/osidb_bindings/bindings/python_client/client.py b/osidb_bindings/bindings/python_client/client.py index e4bc772..27c5796 100644 --- a/osidb_bindings/bindings/python_client/client.py +++ b/osidb_bindings/bindings/python_client/client.py @@ -1,5 +1,5 @@ import ssl -from typing import Dict, Tuple, Type, Union +from typing import Dict, Union, Tuple, Type import aiohttp import attr @@ -43,25 +43,19 @@ def with_timeout(self, timeout: float) -> "Client": class AuthenticatedClient(Client): """A Client which has been authenticated for use on secured endpoints""" - auth: Union[None, Tuple[str, str], Type[requests.auth.AuthBase]] = attr.ib( - None, kw_only=True - ) + auth: Union[None, Tuple[str, str], Type[requests.auth.AuthBase]] = attr.ib(None, kw_only=True) async_session: Union[None, aiohttp.ClientSession] = attr.ib(None, kw_only=True) def get_auth(self) -> Union[None, Tuple[str, str], Type[requests.auth.AuthBase]]: return self.auth - def with_auth( - self, auth: Union[None, Tuple[str, str], Type[requests.auth.AuthBase]] - ) -> "Client": + def with_auth(self, auth: Union[None, Tuple[str, str], Type[requests.auth.AuthBase]]) -> "Client": """Get a new client matching this one with a new auth method""" return attr.evolve(self, auth=auth) def get_async_session(self) -> Union[None, aiohttp.ClientSession]: return self.async_session - def with_async_session( - self, async_session: Union[None, aiohttp.ClientSession] - ) -> "Client": + def with_async_session(self, async_session: Union[None, aiohttp.ClientSession]) -> "Client": """Get a new client matching this one with a new async session""" return attr.evolve(self, async_session=async_session) diff --git a/osidb_bindings/bindings/python_client/errors.py b/osidb_bindings/bindings/python_client/errors.py new file mode 100644 index 0000000..5f92e76 --- /dev/null +++ b/osidb_bindings/bindings/python_client/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +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}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/osidb_bindings/bindings/python_client/models/__init__.py b/osidb_bindings/bindings/python_client/models/__init__.py index 502a24e..0f32ad7 100644 --- a/osidb_bindings/bindings/python_client/models/__init__.py +++ b/osidb_bindings/bindings/python_client/models/__init__.py @@ -1,4 +1,4 @@ -""" Contains all the data models used in inputs/outputs """ +"""Contains all the data models used in inputs/outputs""" from .affect import Affect from .affect_bulk_post_put_response import AffectBulkPostPutResponse @@ -17,24 +17,20 @@ from .auth_token_retrieve_response_200 import AuthTokenRetrieveResponse200 from .auth_token_verify_create_response_200 import AuthTokenVerifyCreateResponse200 from .blank_enum import BlankEnum -from .collectors_api_v1_status_retrieve_response_200 import ( - CollectorsApiV1StatusRetrieveResponse200, -) +from .collectors_api_v1_status_retrieve_response_200 import CollectorsApiV1StatusRetrieveResponse200 from .collectors_api_v1_status_retrieve_response_200_collectors_item import ( CollectorsApiV1StatusRetrieveResponse200CollectorsItem, ) from .collectors_api_v1_status_retrieve_response_200_collectors_item_data import ( CollectorsApiV1StatusRetrieveResponse200CollectorsItemData, ) -from .collectors_api_v1_status_retrieve_response_200_collectors_item_error import ( - CollectorsApiV1StatusRetrieveResponse200CollectorsItemError, +from .collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0 import ( + CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0, ) from .collectors_api_v1_status_retrieve_response_200_collectors_item_state import ( CollectorsApiV1StatusRetrieveResponse200CollectorsItemState, ) -from .collectors_healthy_retrieve_response_200 import ( - CollectorsHealthyRetrieveResponse200, -) +from .collectors_healthy_retrieve_response_200 import CollectorsHealthyRetrieveResponse200 from .collectors_retrieve_response_200 import CollectorsRetrieveResponse200 from .comment import Comment from .cvss_version_enum import CvssVersionEnum @@ -42,25 +38,13 @@ from .erratum import Erratum from .exploit_only_report_data import ExploitOnlyReportData from .exploit_only_report_data_source_enum import ExploitOnlyReportDataSourceEnum -from .exploits_api_v1_collect_update_response_200 import ( - ExploitsApiV1CollectUpdateResponse200, -) -from .exploits_api_v1_cve_map_retrieve_response_200 import ( - ExploitsApiV1CveMapRetrieveResponse200, -) -from .exploits_api_v1_cve_map_retrieve_response_200_cves import ( - ExploitsApiV1CveMapRetrieveResponse200Cves, -) +from .exploits_api_v1_collect_update_response_200 import ExploitsApiV1CollectUpdateResponse200 +from .exploits_api_v1_cve_map_retrieve_response_200 import ExploitsApiV1CveMapRetrieveResponse200 +from .exploits_api_v1_cve_map_retrieve_response_200_cves import ExploitsApiV1CveMapRetrieveResponse200Cves from .exploits_api_v1_epss_list_response_200 import ExploitsApiV1EpssListResponse200 -from .exploits_api_v1_flaw_data_list_response_200 import ( - ExploitsApiV1FlawDataListResponse200, -) -from .exploits_api_v1_report_data_list_response_200 import ( - ExploitsApiV1ReportDataListResponse200, -) -from .exploits_api_v1_report_date_retrieve_response_200 import ( - ExploitsApiV1ReportDateRetrieveResponse200, -) +from .exploits_api_v1_flaw_data_list_response_200 import ExploitsApiV1FlawDataListResponse200 +from .exploits_api_v1_report_data_list_response_200 import ExploitsApiV1ReportDataListResponse200 +from .exploits_api_v1_report_date_retrieve_response_200 import ExploitsApiV1ReportDateRetrieveResponse200 from .exploits_api_v1_report_date_retrieve_response_200_action_required_item import ( ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem, ) @@ -76,18 +60,12 @@ from .exploits_api_v1_report_explanations_retrieve_response_200_explanations_item import ( ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem, ) -from .exploits_api_v1_report_pending_retrieve_response_200 import ( - ExploitsApiV1ReportPendingRetrieveResponse200, -) +from .exploits_api_v1_report_pending_retrieve_response_200 import ExploitsApiV1ReportPendingRetrieveResponse200 from .exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item import ( ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem, ) -from .exploits_api_v1_status_retrieve_response_200 import ( - ExploitsApiV1StatusRetrieveResponse200, -) -from .exploits_api_v1_supported_products_list_response_200 import ( - ExploitsApiV1SupportedProductsListResponse200, -) +from .exploits_api_v1_status_retrieve_response_200 import ExploitsApiV1StatusRetrieveResponse200 +from .exploits_api_v1_supported_products_list_response_200 import ExploitsApiV1SupportedProductsListResponse200 from .flaw import Flaw from .flaw_acknowledgment import FlawAcknowledgment from .flaw_acknowledgment_post import FlawAcknowledgmentPost @@ -118,41 +96,19 @@ from .maturity_preliminary_enum import MaturityPreliminaryEnum from .module_component import ModuleComponent from .nist_cvss_validation_enum import NistCvssValidationEnum -from .osidb_api_v1_affects_bulk_create_response_200 import ( - OsidbApiV1AffectsBulkCreateResponse200, -) -from .osidb_api_v1_affects_bulk_destroy_response_200 import ( - OsidbApiV1AffectsBulkDestroyResponse200, -) -from .osidb_api_v1_affects_bulk_update_response_200 import ( - OsidbApiV1AffectsBulkUpdateResponse200, -) +from .osidb_api_v1_affects_bulk_create_response_200 import OsidbApiV1AffectsBulkCreateResponse200 +from .osidb_api_v1_affects_bulk_destroy_response_200 import OsidbApiV1AffectsBulkDestroyResponse200 +from .osidb_api_v1_affects_bulk_update_response_200 import OsidbApiV1AffectsBulkUpdateResponse200 from .osidb_api_v1_affects_create_response_201 import OsidbApiV1AffectsCreateResponse201 -from .osidb_api_v1_affects_cvss_scores_create_response_201 import ( - OsidbApiV1AffectsCvssScoresCreateResponse201, -) -from .osidb_api_v1_affects_cvss_scores_destroy_response_200 import ( - OsidbApiV1AffectsCvssScoresDestroyResponse200, -) -from .osidb_api_v1_affects_cvss_scores_list_issuer import ( - OsidbApiV1AffectsCvssScoresListIssuer, -) -from .osidb_api_v1_affects_cvss_scores_list_response_200 import ( - OsidbApiV1AffectsCvssScoresListResponse200, -) -from .osidb_api_v1_affects_cvss_scores_retrieve_response_200 import ( - OsidbApiV1AffectsCvssScoresRetrieveResponse200, -) -from .osidb_api_v1_affects_cvss_scores_update_response_200 import ( - OsidbApiV1AffectsCvssScoresUpdateResponse200, -) -from .osidb_api_v1_affects_destroy_response_200 import ( - OsidbApiV1AffectsDestroyResponse200, -) +from .osidb_api_v1_affects_cvss_scores_create_response_201 import OsidbApiV1AffectsCvssScoresCreateResponse201 +from .osidb_api_v1_affects_cvss_scores_destroy_response_200 import OsidbApiV1AffectsCvssScoresDestroyResponse200 +from .osidb_api_v1_affects_cvss_scores_list_issuer import OsidbApiV1AffectsCvssScoresListIssuer +from .osidb_api_v1_affects_cvss_scores_list_response_200 import OsidbApiV1AffectsCvssScoresListResponse200 +from .osidb_api_v1_affects_cvss_scores_retrieve_response_200 import OsidbApiV1AffectsCvssScoresRetrieveResponse200 +from .osidb_api_v1_affects_cvss_scores_update_response_200 import OsidbApiV1AffectsCvssScoresUpdateResponse200 +from .osidb_api_v1_affects_destroy_response_200 import OsidbApiV1AffectsDestroyResponse200 from .osidb_api_v1_affects_list_affectedness import OsidbApiV1AffectsListAffectedness -from .osidb_api_v1_affects_list_cvss_scores_issuer import ( - OsidbApiV1AffectsListCvssScoresIssuer, -) +from .osidb_api_v1_affects_list_cvss_scores_issuer import OsidbApiV1AffectsListCvssScoresIssuer from .osidb_api_v1_affects_list_flaw_impact import OsidbApiV1AffectsListFlawImpact from .osidb_api_v1_affects_list_flaw_source import OsidbApiV1AffectsListFlawSource from .osidb_api_v1_affects_list_impact import OsidbApiV1AffectsListImpact @@ -160,180 +116,80 @@ from .osidb_api_v1_affects_list_resolution import OsidbApiV1AffectsListResolution from .osidb_api_v1_affects_list_response_200 import OsidbApiV1AffectsListResponse200 from .osidb_api_v1_affects_list_trackers_type import OsidbApiV1AffectsListTrackersType -from .osidb_api_v1_affects_retrieve_response_200 import ( - OsidbApiV1AffectsRetrieveResponse200, -) +from .osidb_api_v1_affects_retrieve_response_200 import OsidbApiV1AffectsRetrieveResponse200 from .osidb_api_v1_affects_update_response_200 import OsidbApiV1AffectsUpdateResponse200 from .osidb_api_v1_alerts_list_alert_type import OsidbApiV1AlertsListAlertType from .osidb_api_v1_alerts_list_parent_model import OsidbApiV1AlertsListParentModel from .osidb_api_v1_alerts_list_response_200 import OsidbApiV1AlertsListResponse200 -from .osidb_api_v1_alerts_retrieve_response_200 import ( - OsidbApiV1AlertsRetrieveResponse200, -) +from .osidb_api_v1_alerts_retrieve_response_200 import OsidbApiV1AlertsRetrieveResponse200 from .osidb_api_v1_audit_list_response_200 import OsidbApiV1AuditListResponse200 from .osidb_api_v1_audit_retrieve_response_200 import OsidbApiV1AuditRetrieveResponse200 from .osidb_api_v1_audit_update_response_200 import OsidbApiV1AuditUpdateResponse200 -from .osidb_api_v1_flaws_acknowledgments_create_response_201 import ( - OsidbApiV1FlawsAcknowledgmentsCreateResponse201, -) -from .osidb_api_v1_flaws_acknowledgments_destroy_response_200 import ( - OsidbApiV1FlawsAcknowledgmentsDestroyResponse200, -) -from .osidb_api_v1_flaws_acknowledgments_list_response_200 import ( - OsidbApiV1FlawsAcknowledgmentsListResponse200, -) -from .osidb_api_v1_flaws_acknowledgments_retrieve_response_200 import ( - OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200, -) -from .osidb_api_v1_flaws_acknowledgments_update_response_200 import ( - OsidbApiV1FlawsAcknowledgmentsUpdateResponse200, -) -from .osidb_api_v1_flaws_comments_create_response_201 import ( - OsidbApiV1FlawsCommentsCreateResponse201, -) -from .osidb_api_v1_flaws_comments_list_response_200 import ( - OsidbApiV1FlawsCommentsListResponse200, -) -from .osidb_api_v1_flaws_comments_retrieve_response_200 import ( - OsidbApiV1FlawsCommentsRetrieveResponse200, -) +from .osidb_api_v1_flaws_acknowledgments_create_response_201 import OsidbApiV1FlawsAcknowledgmentsCreateResponse201 +from .osidb_api_v1_flaws_acknowledgments_destroy_response_200 import OsidbApiV1FlawsAcknowledgmentsDestroyResponse200 +from .osidb_api_v1_flaws_acknowledgments_list_response_200 import OsidbApiV1FlawsAcknowledgmentsListResponse200 +from .osidb_api_v1_flaws_acknowledgments_retrieve_response_200 import OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200 +from .osidb_api_v1_flaws_acknowledgments_update_response_200 import OsidbApiV1FlawsAcknowledgmentsUpdateResponse200 +from .osidb_api_v1_flaws_comments_create_response_201 import OsidbApiV1FlawsCommentsCreateResponse201 +from .osidb_api_v1_flaws_comments_list_response_200 import OsidbApiV1FlawsCommentsListResponse200 +from .osidb_api_v1_flaws_comments_retrieve_response_200 import OsidbApiV1FlawsCommentsRetrieveResponse200 from .osidb_api_v1_flaws_create_response_201 import OsidbApiV1FlawsCreateResponse201 -from .osidb_api_v1_flaws_cvss_scores_create_response_201 import ( - OsidbApiV1FlawsCvssScoresCreateResponse201, -) -from .osidb_api_v1_flaws_cvss_scores_destroy_response_200 import ( - OsidbApiV1FlawsCvssScoresDestroyResponse200, -) -from .osidb_api_v1_flaws_cvss_scores_list_issuer import ( - OsidbApiV1FlawsCvssScoresListIssuer, -) -from .osidb_api_v1_flaws_cvss_scores_list_response_200 import ( - OsidbApiV1FlawsCvssScoresListResponse200, -) -from .osidb_api_v1_flaws_cvss_scores_retrieve_response_200 import ( - OsidbApiV1FlawsCvssScoresRetrieveResponse200, -) -from .osidb_api_v1_flaws_cvss_scores_update_response_200 import ( - OsidbApiV1FlawsCvssScoresUpdateResponse200, -) -from .osidb_api_v1_flaws_list_affects_affectedness import ( - OsidbApiV1FlawsListAffectsAffectedness, -) +from .osidb_api_v1_flaws_cvss_scores_create_response_201 import OsidbApiV1FlawsCvssScoresCreateResponse201 +from .osidb_api_v1_flaws_cvss_scores_destroy_response_200 import OsidbApiV1FlawsCvssScoresDestroyResponse200 +from .osidb_api_v1_flaws_cvss_scores_list_issuer import OsidbApiV1FlawsCvssScoresListIssuer +from .osidb_api_v1_flaws_cvss_scores_list_response_200 import OsidbApiV1FlawsCvssScoresListResponse200 +from .osidb_api_v1_flaws_cvss_scores_retrieve_response_200 import OsidbApiV1FlawsCvssScoresRetrieveResponse200 +from .osidb_api_v1_flaws_cvss_scores_update_response_200 import OsidbApiV1FlawsCvssScoresUpdateResponse200 +from .osidb_api_v1_flaws_list_affects_affectedness import OsidbApiV1FlawsListAffectsAffectedness from .osidb_api_v1_flaws_list_affects_impact import OsidbApiV1FlawsListAffectsImpact -from .osidb_api_v1_flaws_list_affects_resolution import ( - OsidbApiV1FlawsListAffectsResolution, -) -from .osidb_api_v1_flaws_list_affects_trackers_type import ( - OsidbApiV1FlawsListAffectsTrackersType, -) -from .osidb_api_v1_flaws_list_cvss_scores_issuer import ( - OsidbApiV1FlawsListCvssScoresIssuer, -) +from .osidb_api_v1_flaws_list_affects_resolution import OsidbApiV1FlawsListAffectsResolution +from .osidb_api_v1_flaws_list_affects_trackers_type import OsidbApiV1FlawsListAffectsTrackersType +from .osidb_api_v1_flaws_list_cvss_scores_issuer import OsidbApiV1FlawsListCvssScoresIssuer from .osidb_api_v1_flaws_list_impact import OsidbApiV1FlawsListImpact -from .osidb_api_v1_flaws_list_major_incident_state import ( - OsidbApiV1FlawsListMajorIncidentState, -) -from .osidb_api_v1_flaws_list_nist_cvss_validation import ( - OsidbApiV1FlawsListNistCvssValidation, -) +from .osidb_api_v1_flaws_list_major_incident_state import OsidbApiV1FlawsListMajorIncidentState +from .osidb_api_v1_flaws_list_nist_cvss_validation import OsidbApiV1FlawsListNistCvssValidation from .osidb_api_v1_flaws_list_order_item import OsidbApiV1FlawsListOrderItem from .osidb_api_v1_flaws_list_references_type import OsidbApiV1FlawsListReferencesType -from .osidb_api_v1_flaws_list_requires_cve_description import ( - OsidbApiV1FlawsListRequiresCveDescription, -) +from .osidb_api_v1_flaws_list_requires_cve_description import OsidbApiV1FlawsListRequiresCveDescription from .osidb_api_v1_flaws_list_response_200 import OsidbApiV1FlawsListResponse200 from .osidb_api_v1_flaws_list_source import OsidbApiV1FlawsListSource -from .osidb_api_v1_flaws_list_workflow_state_item import ( - OsidbApiV1FlawsListWorkflowStateItem, -) -from .osidb_api_v1_flaws_package_versions_create_response_201 import ( - OsidbApiV1FlawsPackageVersionsCreateResponse201, -) -from .osidb_api_v1_flaws_package_versions_destroy_response_200 import ( - OsidbApiV1FlawsPackageVersionsDestroyResponse200, -) -from .osidb_api_v1_flaws_package_versions_list_response_200 import ( - OsidbApiV1FlawsPackageVersionsListResponse200, -) -from .osidb_api_v1_flaws_package_versions_retrieve_response_200 import ( - OsidbApiV1FlawsPackageVersionsRetrieveResponse200, -) -from .osidb_api_v1_flaws_package_versions_update_response_200 import ( - OsidbApiV1FlawsPackageVersionsUpdateResponse200, -) -from .osidb_api_v1_flaws_promote_create_response_200 import ( - OsidbApiV1FlawsPromoteCreateResponse200, -) -from .osidb_api_v1_flaws_references_create_response_201 import ( - OsidbApiV1FlawsReferencesCreateResponse201, -) -from .osidb_api_v1_flaws_references_destroy_response_200 import ( - OsidbApiV1FlawsReferencesDestroyResponse200, -) -from .osidb_api_v1_flaws_references_list_response_200 import ( - OsidbApiV1FlawsReferencesListResponse200, -) +from .osidb_api_v1_flaws_list_workflow_state_item import OsidbApiV1FlawsListWorkflowStateItem +from .osidb_api_v1_flaws_package_versions_create_response_201 import OsidbApiV1FlawsPackageVersionsCreateResponse201 +from .osidb_api_v1_flaws_package_versions_destroy_response_200 import OsidbApiV1FlawsPackageVersionsDestroyResponse200 +from .osidb_api_v1_flaws_package_versions_list_response_200 import OsidbApiV1FlawsPackageVersionsListResponse200 +from .osidb_api_v1_flaws_package_versions_retrieve_response_200 import OsidbApiV1FlawsPackageVersionsRetrieveResponse200 +from .osidb_api_v1_flaws_package_versions_update_response_200 import OsidbApiV1FlawsPackageVersionsUpdateResponse200 +from .osidb_api_v1_flaws_promote_create_response_200 import OsidbApiV1FlawsPromoteCreateResponse200 +from .osidb_api_v1_flaws_references_create_response_201 import OsidbApiV1FlawsReferencesCreateResponse201 +from .osidb_api_v1_flaws_references_destroy_response_200 import OsidbApiV1FlawsReferencesDestroyResponse200 +from .osidb_api_v1_flaws_references_list_response_200 import OsidbApiV1FlawsReferencesListResponse200 from .osidb_api_v1_flaws_references_list_type import OsidbApiV1FlawsReferencesListType -from .osidb_api_v1_flaws_references_retrieve_response_200 import ( - OsidbApiV1FlawsReferencesRetrieveResponse200, -) -from .osidb_api_v1_flaws_references_update_response_200 import ( - OsidbApiV1FlawsReferencesUpdateResponse200, -) -from .osidb_api_v1_flaws_reject_create_response_200 import ( - OsidbApiV1FlawsRejectCreateResponse200, -) +from .osidb_api_v1_flaws_references_retrieve_response_200 import OsidbApiV1FlawsReferencesRetrieveResponse200 +from .osidb_api_v1_flaws_references_update_response_200 import OsidbApiV1FlawsReferencesUpdateResponse200 +from .osidb_api_v1_flaws_reject_create_response_200 import OsidbApiV1FlawsRejectCreateResponse200 from .osidb_api_v1_flaws_retrieve_response_200 import OsidbApiV1FlawsRetrieveResponse200 from .osidb_api_v1_flaws_update_response_200 import OsidbApiV1FlawsUpdateResponse200 -from .osidb_api_v1_manifest_retrieve_response_200 import ( - OsidbApiV1ManifestRetrieveResponse200, -) +from .osidb_api_v1_manifest_retrieve_response_200 import OsidbApiV1ManifestRetrieveResponse200 from .osidb_api_v1_schema_retrieve_format import OsidbApiV1SchemaRetrieveFormat from .osidb_api_v1_schema_retrieve_lang import OsidbApiV1SchemaRetrieveLang -from .osidb_api_v1_schema_retrieve_response_200 import ( - OsidbApiV1SchemaRetrieveResponse200, -) -from .osidb_api_v1_status_retrieve_response_200 import ( - OsidbApiV1StatusRetrieveResponse200, -) -from .osidb_api_v1_status_retrieve_response_200_osidb_data import ( - OsidbApiV1StatusRetrieveResponse200OsidbData, -) -from .osidb_api_v1_status_retrieve_response_200_osidb_service import ( - OsidbApiV1StatusRetrieveResponse200OsidbService, -) -from .osidb_api_v1_trackers_create_response_201 import ( - OsidbApiV1TrackersCreateResponse201, -) -from .osidb_api_v1_trackers_list_affects_affectedness import ( - OsidbApiV1TrackersListAffectsAffectedness, -) -from .osidb_api_v1_trackers_list_affects_flaw_impact import ( - OsidbApiV1TrackersListAffectsFlawImpact, -) -from .osidb_api_v1_trackers_list_affects_flaw_source import ( - OsidbApiV1TrackersListAffectsFlawSource, -) -from .osidb_api_v1_trackers_list_affects_impact import ( - OsidbApiV1TrackersListAffectsImpact, -) -from .osidb_api_v1_trackers_list_affects_resolution import ( - OsidbApiV1TrackersListAffectsResolution, -) +from .osidb_api_v1_schema_retrieve_response_200 import OsidbApiV1SchemaRetrieveResponse200 +from .osidb_api_v1_status_retrieve_response_200 import OsidbApiV1StatusRetrieveResponse200 +from .osidb_api_v1_status_retrieve_response_200_osidb_data import OsidbApiV1StatusRetrieveResponse200OsidbData +from .osidb_api_v1_status_retrieve_response_200_osidb_service import OsidbApiV1StatusRetrieveResponse200OsidbService +from .osidb_api_v1_trackers_create_response_201 import OsidbApiV1TrackersCreateResponse201 +from .osidb_api_v1_trackers_list_affects_affectedness import OsidbApiV1TrackersListAffectsAffectedness +from .osidb_api_v1_trackers_list_affects_flaw_impact import OsidbApiV1TrackersListAffectsFlawImpact +from .osidb_api_v1_trackers_list_affects_flaw_source import OsidbApiV1TrackersListAffectsFlawSource +from .osidb_api_v1_trackers_list_affects_impact import OsidbApiV1TrackersListAffectsImpact +from .osidb_api_v1_trackers_list_affects_resolution import OsidbApiV1TrackersListAffectsResolution from .osidb_api_v1_trackers_list_order_item import OsidbApiV1TrackersListOrderItem from .osidb_api_v1_trackers_list_response_200 import OsidbApiV1TrackersListResponse200 from .osidb_api_v1_trackers_list_type import OsidbApiV1TrackersListType -from .osidb_api_v1_trackers_retrieve_response_200 import ( - OsidbApiV1TrackersRetrieveResponse200, -) -from .osidb_api_v1_trackers_update_response_200 import ( - OsidbApiV1TrackersUpdateResponse200, -) +from .osidb_api_v1_trackers_retrieve_response_200 import OsidbApiV1TrackersRetrieveResponse200 +from .osidb_api_v1_trackers_update_response_200 import OsidbApiV1TrackersUpdateResponse200 from .osidb_healthy_retrieve_response_200 import OsidbHealthyRetrieveResponse200 from .osidb_whoami_retrieve_response_200 import OsidbWhoamiRetrieveResponse200 -from .osidb_whoami_retrieve_response_200_profile import ( - OsidbWhoamiRetrieveResponse200Profile, -) +from .osidb_whoami_retrieve_response_200_profile import OsidbWhoamiRetrieveResponse200Profile from .package import Package from .package_ver import PackageVer from .paginated_affect_cvss_list import PaginatedAffectCVSSList @@ -366,14 +222,218 @@ from .tracker_suggestion import TrackerSuggestion from .tracker_type import TrackerType from .trackers_api_v1_file_create_response_200 import TrackersApiV1FileCreateResponse200 -from .workflows_api_v1_workflows_adjust_create_response_200 import ( - WorkflowsApiV1WorkflowsAdjustCreateResponse200, -) -from .workflows_api_v1_workflows_retrieve_2_response_200 import ( - WorkflowsApiV1WorkflowsRetrieve2Response200, -) -from .workflows_api_v1_workflows_retrieve_response_200 import ( - WorkflowsApiV1WorkflowsRetrieveResponse200, -) +from .workflows_api_v1_workflows_adjust_create_response_200 import WorkflowsApiV1WorkflowsAdjustCreateResponse200 +from .workflows_api_v1_workflows_retrieve_2_response_200 import WorkflowsApiV1WorkflowsRetrieve2Response200 +from .workflows_api_v1_workflows_retrieve_response_200 import WorkflowsApiV1WorkflowsRetrieveResponse200 from .workflows_healthy_retrieve_response_200 import WorkflowsHealthyRetrieveResponse200 from .workflows_retrieve_response_200 import WorkflowsRetrieveResponse200 + +__all__ = ( + "Affect", + "AffectBulkPostPutResponse", + "AffectBulkPut", + "AffectCVSS", + "AffectCVSSPost", + "AffectCVSSPut", + "AffectednessEnum", + "AffectPost", + "AffectReportData", + "Alert", + "AlertTypeEnum", + "Audit", + "AuthTokenCreateResponse200", + "AuthTokenRefreshCreateResponse200", + "AuthTokenRetrieveResponse200", + "AuthTokenVerifyCreateResponse200", + "BlankEnum", + "CollectorsApiV1StatusRetrieveResponse200", + "CollectorsApiV1StatusRetrieveResponse200CollectorsItem", + "CollectorsApiV1StatusRetrieveResponse200CollectorsItemData", + "CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0", + "CollectorsApiV1StatusRetrieveResponse200CollectorsItemState", + "CollectorsHealthyRetrieveResponse200", + "CollectorsRetrieveResponse200", + "Comment", + "CvssVersionEnum", + "EPSS", + "Erratum", + "ExploitOnlyReportData", + "ExploitOnlyReportDataSourceEnum", + "ExploitsApiV1CollectUpdateResponse200", + "ExploitsApiV1CveMapRetrieveResponse200", + "ExploitsApiV1CveMapRetrieveResponse200Cves", + "ExploitsApiV1EpssListResponse200", + "ExploitsApiV1FlawDataListResponse200", + "ExploitsApiV1ReportDataListResponse200", + "ExploitsApiV1ReportDateRetrieveResponse200", + "ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem", + "ExploitsApiV1ReportDateRetrieveResponse200NoActionItem", + "ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem", + "ExploitsApiV1ReportExplanationsRetrieveResponse200", + "ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem", + "ExploitsApiV1ReportPendingRetrieveResponse200", + "ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem", + "ExploitsApiV1StatusRetrieveResponse200", + "ExploitsApiV1SupportedProductsListResponse200", + "Flaw", + "FlawAcknowledgment", + "FlawAcknowledgmentPost", + "FlawAcknowledgmentPut", + "FlawClassification", + "FlawClassificationState", + "FlawComment", + "FlawCommentPost", + "FlawCVSS", + "FlawCVSSPost", + "FlawCVSSPut", + "FlawPackageVersion", + "FlawPackageVersionPost", + "FlawPackageVersionPut", + "FlawPost", + "FlawPostClassification", + "FlawPostClassificationState", + "FlawReference", + "FlawReferencePost", + "FlawReferencePut", + "FlawReferenceType", + "FlawReportData", + "FlawUUIDList", + "FlawVersion", + "ImpactEnum", + "IssuerEnum", + "MajorIncidentStateEnum", + "MaturityPreliminaryEnum", + "ModuleComponent", + "NistCvssValidationEnum", + "OsidbApiV1AffectsBulkCreateResponse200", + "OsidbApiV1AffectsBulkDestroyResponse200", + "OsidbApiV1AffectsBulkUpdateResponse200", + "OsidbApiV1AffectsCreateResponse201", + "OsidbApiV1AffectsCvssScoresCreateResponse201", + "OsidbApiV1AffectsCvssScoresDestroyResponse200", + "OsidbApiV1AffectsCvssScoresListIssuer", + "OsidbApiV1AffectsCvssScoresListResponse200", + "OsidbApiV1AffectsCvssScoresRetrieveResponse200", + "OsidbApiV1AffectsCvssScoresUpdateResponse200", + "OsidbApiV1AffectsDestroyResponse200", + "OsidbApiV1AffectsListAffectedness", + "OsidbApiV1AffectsListCvssScoresIssuer", + "OsidbApiV1AffectsListFlawImpact", + "OsidbApiV1AffectsListFlawSource", + "OsidbApiV1AffectsListImpact", + "OsidbApiV1AffectsListOrderItem", + "OsidbApiV1AffectsListResolution", + "OsidbApiV1AffectsListResponse200", + "OsidbApiV1AffectsListTrackersType", + "OsidbApiV1AffectsRetrieveResponse200", + "OsidbApiV1AffectsUpdateResponse200", + "OsidbApiV1AlertsListAlertType", + "OsidbApiV1AlertsListParentModel", + "OsidbApiV1AlertsListResponse200", + "OsidbApiV1AlertsRetrieveResponse200", + "OsidbApiV1AuditListResponse200", + "OsidbApiV1AuditRetrieveResponse200", + "OsidbApiV1AuditUpdateResponse200", + "OsidbApiV1FlawsAcknowledgmentsCreateResponse201", + "OsidbApiV1FlawsAcknowledgmentsDestroyResponse200", + "OsidbApiV1FlawsAcknowledgmentsListResponse200", + "OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200", + "OsidbApiV1FlawsAcknowledgmentsUpdateResponse200", + "OsidbApiV1FlawsCommentsCreateResponse201", + "OsidbApiV1FlawsCommentsListResponse200", + "OsidbApiV1FlawsCommentsRetrieveResponse200", + "OsidbApiV1FlawsCreateResponse201", + "OsidbApiV1FlawsCvssScoresCreateResponse201", + "OsidbApiV1FlawsCvssScoresDestroyResponse200", + "OsidbApiV1FlawsCvssScoresListIssuer", + "OsidbApiV1FlawsCvssScoresListResponse200", + "OsidbApiV1FlawsCvssScoresRetrieveResponse200", + "OsidbApiV1FlawsCvssScoresUpdateResponse200", + "OsidbApiV1FlawsListAffectsAffectedness", + "OsidbApiV1FlawsListAffectsImpact", + "OsidbApiV1FlawsListAffectsResolution", + "OsidbApiV1FlawsListAffectsTrackersType", + "OsidbApiV1FlawsListCvssScoresIssuer", + "OsidbApiV1FlawsListImpact", + "OsidbApiV1FlawsListMajorIncidentState", + "OsidbApiV1FlawsListNistCvssValidation", + "OsidbApiV1FlawsListOrderItem", + "OsidbApiV1FlawsListReferencesType", + "OsidbApiV1FlawsListRequiresCveDescription", + "OsidbApiV1FlawsListResponse200", + "OsidbApiV1FlawsListSource", + "OsidbApiV1FlawsListWorkflowStateItem", + "OsidbApiV1FlawsPackageVersionsCreateResponse201", + "OsidbApiV1FlawsPackageVersionsDestroyResponse200", + "OsidbApiV1FlawsPackageVersionsListResponse200", + "OsidbApiV1FlawsPackageVersionsRetrieveResponse200", + "OsidbApiV1FlawsPackageVersionsUpdateResponse200", + "OsidbApiV1FlawsPromoteCreateResponse200", + "OsidbApiV1FlawsReferencesCreateResponse201", + "OsidbApiV1FlawsReferencesDestroyResponse200", + "OsidbApiV1FlawsReferencesListResponse200", + "OsidbApiV1FlawsReferencesListType", + "OsidbApiV1FlawsReferencesRetrieveResponse200", + "OsidbApiV1FlawsReferencesUpdateResponse200", + "OsidbApiV1FlawsRejectCreateResponse200", + "OsidbApiV1FlawsRetrieveResponse200", + "OsidbApiV1FlawsUpdateResponse200", + "OsidbApiV1ManifestRetrieveResponse200", + "OsidbApiV1SchemaRetrieveFormat", + "OsidbApiV1SchemaRetrieveLang", + "OsidbApiV1SchemaRetrieveResponse200", + "OsidbApiV1StatusRetrieveResponse200", + "OsidbApiV1StatusRetrieveResponse200OsidbData", + "OsidbApiV1StatusRetrieveResponse200OsidbService", + "OsidbApiV1TrackersCreateResponse201", + "OsidbApiV1TrackersListAffectsAffectedness", + "OsidbApiV1TrackersListAffectsFlawImpact", + "OsidbApiV1TrackersListAffectsFlawSource", + "OsidbApiV1TrackersListAffectsImpact", + "OsidbApiV1TrackersListAffectsResolution", + "OsidbApiV1TrackersListOrderItem", + "OsidbApiV1TrackersListResponse200", + "OsidbApiV1TrackersListType", + "OsidbApiV1TrackersRetrieveResponse200", + "OsidbApiV1TrackersUpdateResponse200", + "OsidbHealthyRetrieveResponse200", + "OsidbWhoamiRetrieveResponse200", + "OsidbWhoamiRetrieveResponse200Profile", + "Package", + "PackageVer", + "PaginatedAffectCVSSList", + "PaginatedAffectList", + "PaginatedAlertList", + "PaginatedAuditList", + "PaginatedEPSSList", + "PaginatedExploitOnlyReportDataList", + "PaginatedFlawAcknowledgmentList", + "PaginatedFlawCommentList", + "PaginatedFlawCVSSList", + "PaginatedFlawList", + "PaginatedFlawPackageVersionList", + "PaginatedFlawReferenceList", + "PaginatedFlawReportDataList", + "PaginatedSupportedProductsList", + "PaginatedTrackerList", + "PsStreamSelection", + "Reject", + "RequiresCveDescriptionEnum", + "ResolutionEnum", + "SourceBe0Enum", + "SupportedProducts", + "TokenObtainPair", + "TokenRefresh", + "TokenVerify", + "Tracker", + "TrackerPost", + "TrackerReportData", + "TrackersApiV1FileCreateResponse200", + "TrackerSuggestion", + "TrackerType", + "WorkflowsApiV1WorkflowsAdjustCreateResponse200", + "WorkflowsApiV1WorkflowsRetrieve2Response200", + "WorkflowsApiV1WorkflowsRetrieveResponse200", + "WorkflowsHealthyRetrieveResponse200", + "WorkflowsRetrieveResponse200", +) diff --git a/osidb_bindings/bindings/python_client/models/affect.py b/osidb_bindings/bindings/python_client/models/affect.py index f65522d..311b59b 100644 --- a/osidb_bindings/bindings/python_client/models/affect.py +++ b/osidb_bindings/bindings/python_client/models/affect.py @@ -1,75 +1,119 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect_cvss import AffectCVSS from ..models.affectedness_enum import AffectednessEnum -from ..models.alert import Alert from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum -from ..models.tracker import Tracker -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + T = TypeVar("T", bound="Affect") -@attr.s(auto_attribs=True) +@_attrs_define class Affect(OSIDBModel): - """Affect serializer""" - - uuid: str + """Affect serializer + + Attributes: + uuid (UUID): + flaw (Union[None, UUID]): + ps_module (str): + ps_product (str): + trackers (list['Tracker']): + delegated_resolution (str): + cvss_scores (list['AffectCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affectedness (Union[AffectednessEnum, BlankEnum, Unset]): + resolution (Union[BlankEnum, ResolutionEnum, Unset]): + ps_component (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + purl (Union[None, Unset, str]): + """ + + uuid: UUID + flaw: Union[None, UUID] ps_module: str ps_product: str - trackers: List[Tracker] + trackers: list["Tracker"] delegated_resolution: str - cvss_scores: List[AffectCVSS] + cvss_scores: list["AffectCVSS"] embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Optional[str] affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET - ps_component: Union[Unset, None, str] = UNSET + ps_component: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - purl: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + purl: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + flaw: Union[None, str] + if isinstance(self.flaw, UUID): + flaw = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + else: + flaw = self.flaw - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid ps_module = self.ps_module + ps_product = self.ps_product - trackers: List[Dict[str, Any]] = UNSET + + trackers: list[dict[str, Any]] = UNSET if not isinstance(self.trackers, Unset): trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() trackers.append(trackers_item) delegated_resolution = self.delegated_resolution - cvss_scores: List[Dict[str, Any]] = UNSET + + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -83,254 +127,292 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): + print(AffectednessEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value + affectedness = self.affectedness.value else: + print(BlankEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = BlankEnum(self.affectedness).value + affectedness = self.affectedness.value resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): + print(ResolutionEnum) resolution = UNSET if not isinstance(self.resolution, Unset): - - resolution = ResolutionEnum(self.resolution).value + resolution = self.resolution.value else: + print(BlankEnum) resolution = UNSET if not isinstance(self.resolution, Unset): + resolution = self.resolution.value - resolution = BlankEnum(self.resolution).value + ps_component: Union[None, Unset, str] + if isinstance(self.ps_component, Unset): + ps_component = UNSET + else: + ps_component = self.ps_component - ps_component = self.ps_component impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value - - purl = self.purl + purl: Union[None, Unset, str] + if isinstance(self.purl, Unset): + purl = UNSET + else: + purl = self.purl - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(ps_module, Unset): + if flaw is not UNSET: + field_dict["flaw"] = flaw + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_product, Unset): + if ps_product is not UNSET: field_dict["ps_product"] = ps_product - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(delegated_resolution, Unset): + if delegated_resolution is not UNSET: field_dict["delegated_resolution"] = delegated_resolution - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): - field_dict["flaw"] = flaw - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(purl, Unset): + if purl is not UNSET: field_dict["purl"] = purl return field_dict - def to_multipart(self) -> Dict[str, Any]: - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - ps_module = ( - self.ps_module - if self.ps_module is UNSET - else (None, str(self.ps_module), "text/plain") - ) - ps_product = ( - self.ps_product - if self.ps_product is UNSET - else (None, str(self.ps_product), "text/plain") - ) - trackers: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + flaw: tuple[None, bytes, str] + + if isinstance(self.flaw, UUID): + flaw: bytes = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + else: + flaw = (None, str(self.flaw).encode(), "text/plain") + + ps_module = (None, str(self.ps_module).encode(), "text/plain") + + ps_product = (None, str(self.ps_product).encode(), "text/plain") + + trackers: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.trackers, Unset): _temp_trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() _temp_trackers.append(trackers_item) - trackers = (None, json.dumps(_temp_trackers), "application/json") + trackers = (None, json.dumps(_temp_trackers).encode(), "application/json") - delegated_resolution = ( - self.delegated_resolution - if self.delegated_resolution is UNSET - else (None, str(self.delegated_resolution), "text/plain") - ) - cvss_scores: Union[Unset, Tuple[None, str, str]] = UNSET + delegated_resolution = (None, str(self.delegated_resolution).encode(), "text/plain") + + cvss_scores: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.cvss_scores, Unset): _temp_cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() _temp_cvss_scores.append(cvss_scores_item) - cvss_scores = (None, json.dumps(_temp_cvss_scores), "application/json") + cvss_scores = (None, json.dumps(_temp_cvss_scores).encode(), "application/json") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() + + affectedness: Union[Unset, tuple[None, bytes, str]] - flaw = self.flaw if self.flaw is UNSET else (None, str(self.flaw), "text/plain") - affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): - affectedness = UNSET + affectedness: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value - + affectedness = (None, str(self.affectedness.value).encode(), "text/plain") else: - affectedness = UNSET + affectedness: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.affectedness, Unset): + affectedness = (None, str(self.affectedness.value).encode(), "text/plain") - affectedness = BlankEnum(self.affectedness).value + resolution: Union[Unset, tuple[None, bytes, str]] - resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): - resolution = UNSET + resolution: Union[Unset, tuple[None, bytes, str]] = UNSET + if not isinstance(self.resolution, Unset): + resolution = (None, str(self.resolution.value).encode(), "text/plain") + else: + resolution: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.resolution, Unset): + resolution = (None, str(self.resolution.value).encode(), "text/plain") - resolution = ResolutionEnum(self.resolution).value + ps_component: Union[Unset, tuple[None, bytes, str]] + if isinstance(self.ps_component, Unset): + ps_component = UNSET + elif isinstance(self.ps_component, str): + ps_component = (None, str(self.ps_component).encode(), "text/plain") else: - resolution = UNSET - if not isinstance(self.resolution, Unset): + ps_component = (None, str(self.ps_component).encode(), "text/plain") - resolution = BlankEnum(self.resolution).value + impact: Union[Unset, tuple[None, bytes, str]] - ps_component = ( - self.ps_component - if self.ps_component is UNSET - else (None, str(self.ps_component), "text/plain") - ) - impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): - impact = UNSET + impact: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value - + impact = (None, str(self.impact.value).encode(), "text/plain") else: - impact = UNSET + impact: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.impact, Unset): + impact = (None, str(self.impact.value).encode(), "text/plain") + + purl: Union[Unset, tuple[None, bytes, str]] - impact = BlankEnum(self.impact).value + if isinstance(self.purl, Unset): + purl = UNSET + elif isinstance(self.purl, str): + purl = (None, str(self.purl).encode(), "text/plain") + else: + purl = (None, str(self.purl).encode(), "text/plain") - purl = self.purl if self.purl is UNSET else (None, str(self.purl), "text/plain") + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(ps_module, Unset): + if flaw is not UNSET: + field_dict["flaw"] = flaw + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_product, Unset): + if ps_product is not UNSET: field_dict["ps_product"] = ps_product - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(delegated_resolution, Unset): + if delegated_resolution is not UNSET: field_dict["delegated_resolution"] = delegated_resolution - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): - field_dict["flaw"] = flaw - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(purl, Unset): + if purl is not UNSET: field_dict["purl"] = purl return field_dict @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: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) + + def _parse_flaw(data: object) -> Union[None, UUID]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + _flaw_type_0 = data + flaw_type_0: UUID + if isinstance(_flaw_type_0, Unset): + flaw_type_0 = UNSET + else: + flaw_type_0 = UUID(_flaw_type_0) + + return flaw_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID], data) + + flaw = _parse_flaw(d.pop("flaw", UNSET)) ps_module = d.pop("ps_module", UNSET) @@ -338,52 +420,43 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: trackers = [] _trackers = d.pop("trackers", UNSET) - if _trackers is UNSET: - trackers = UNSET - else: - for trackers_item_data in _trackers or []: - _trackers_item = trackers_item_data - trackers_item: Tracker - if isinstance(_trackers_item, Unset): - trackers_item = UNSET - else: - trackers_item = Tracker.from_dict(_trackers_item) + for trackers_item_data in _trackers or []: + _trackers_item = trackers_item_data + trackers_item: Tracker + if isinstance(_trackers_item, Unset): + trackers_item = UNSET + else: + trackers_item = Tracker.from_dict(_trackers_item) - trackers.append(trackers_item) + trackers.append(trackers_item) delegated_resolution = d.pop("delegated_resolution", UNSET) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: AffectCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: AffectCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -399,18 +472,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) - - def _parse_affectedness( - data: object, - ) -> Union[AffectednessEnum, BlankEnum, Unset]: + def _parse_affectedness(data: object) -> Union[AffectednessEnum, BlankEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _affectedness_type_0 = data - affectedness_type_0: Union[Unset, AffectednessEnum] + affectedness_type_0: AffectednessEnum if isinstance(_affectedness_type_0, Unset): affectedness_type_0 = UNSET else: @@ -422,7 +491,7 @@ def _parse_affectedness( if not isinstance(data, str): raise TypeError() _affectedness_type_1 = data - affectedness_type_1: Union[Unset, BlankEnum] + affectedness_type_1: BlankEnum if isinstance(_affectedness_type_1, Unset): affectedness_type_1 = UNSET else: @@ -439,7 +508,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_0 = data - resolution_type_0: Union[Unset, ResolutionEnum] + resolution_type_0: ResolutionEnum if isinstance(_resolution_type_0, Unset): resolution_type_0 = UNSET else: @@ -451,7 +520,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_1 = data - resolution_type_1: Union[Unset, BlankEnum] + resolution_type_1: BlankEnum if isinstance(_resolution_type_1, Unset): resolution_type_1 = UNSET else: @@ -461,7 +530,14 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: resolution = _parse_resolution(d.pop("resolution", UNSET)) - ps_component = d.pop("ps_component", UNSET) + def _parse_ps_component(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + ps_component = _parse_ps_component(d.pop("ps_component", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -470,7 +546,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -482,7 +558,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -492,10 +568,18 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - purl = d.pop("purl", UNSET) + def _parse_purl(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + purl = _parse_purl(d.pop("purl", UNSET)) affect = cls( uuid=uuid, + flaw=flaw, ps_module=ps_module, ps_product=ps_product, trackers=trackers, @@ -505,7 +589,6 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: alerts=alerts, created_dt=created_dt, updated_dt=updated_dt, - flaw=flaw, affectedness=affectedness, resolution=resolution, ps_component=ps_component, @@ -516,29 +599,8 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: affect.additional_properties = d return affect - @staticmethod - def get_fields(): - return { - "uuid": str, - "ps_module": str, - "ps_product": str, - "trackers": List[Tracker], - "delegated_resolution": str, - "cvss_scores": List[AffectCVSS], - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "affectedness": Union[AffectednessEnum, BlankEnum], - "resolution": Union[BlankEnum, ResolutionEnum], - "ps_component": str, - "impact": Union[BlankEnum, ImpactEnum], - "purl": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/affect_bulk_post_put_response.py b/osidb_bindings/bindings/python_client/models/affect_bulk_post_put_response.py index cf75138..0f34f8f 100644 --- a/osidb_bindings/bindings/python_client/models/affect_bulk_post_put_response.py +++ b/osidb_bindings/bindings/python_client/models/affect_bulk_post_put_response.py @@ -1,55 +1,62 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar, TYPE_CHECKING -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + + +if TYPE_CHECKING: + from ..models.affect import Affect -from ..models.affect import Affect -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="AffectBulkPostPutResponse") -@attr.s(auto_attribs=True) +@_attrs_define class AffectBulkPostPutResponse(OSIDBModel): - """ """ + """ + Attributes: + results (list['Affect']): + """ - results: List[Affect] - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["Affect"] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - results: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results return field_dict @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: + from ..models.affect import Affect + d = src_dict.copy() results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Affect - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Affect.from_dict(_results_item) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Affect + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Affect.from_dict(_results_item) - results.append(results_item) + results.append(results_item) affect_bulk_post_put_response = cls( results=results, @@ -58,14 +65,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: affect_bulk_post_put_response.additional_properties = d return affect_bulk_post_put_response - @staticmethod - def get_fields(): - return { - "results": List[Affect], - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/affect_bulk_put.py b/osidb_bindings/bindings/python_client/models/affect_bulk_put.py index e2040f2..e4cd325 100644 --- a/osidb_bindings/bindings/python_client/models/affect_bulk_put.py +++ b/osidb_bindings/bindings/python_client/models/affect_bulk_put.py @@ -1,74 +1,118 @@ -import datetime -from typing import Any, Dict, List, Optional, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect_cvss import AffectCVSS from ..models.affectedness_enum import AffectednessEnum -from ..models.alert import Alert from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum -from ..models.tracker import Tracker -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + T = TypeVar("T", bound="AffectBulkPut") -@attr.s(auto_attribs=True) +@_attrs_define class AffectBulkPut(OSIDBModel): - """Affect serializer""" - - uuid: str + """Affect serializer + + Attributes: + uuid (UUID): + flaw (Union[None, UUID]): + ps_module (str): + ps_product (str): + trackers (list['Tracker']): + delegated_resolution (str): + cvss_scores (list['AffectCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affectedness (Union[AffectednessEnum, BlankEnum, Unset]): + resolution (Union[BlankEnum, ResolutionEnum, Unset]): + ps_component (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + purl (Union[None, Unset, str]): + """ + + uuid: UUID + flaw: Union[None, UUID] ps_module: str ps_product: str - trackers: List[Tracker] + trackers: list["Tracker"] delegated_resolution: str - cvss_scores: List[AffectCVSS] + cvss_scores: list["AffectCVSS"] embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Optional[str] affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET - ps_component: Union[Unset, None, str] = UNSET + ps_component: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - purl: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + purl: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + flaw: Union[None, str] + if isinstance(self.flaw, UUID): + flaw = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + else: + flaw = self.flaw - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid ps_module = self.ps_module + ps_product = self.ps_product - trackers: List[Dict[str, Any]] = UNSET + + trackers: list[dict[str, Any]] = UNSET if not isinstance(self.trackers, Unset): trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() trackers.append(trackers_item) delegated_resolution = self.delegated_resolution - cvss_scores: List[Dict[str, Any]] = UNSET + + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -82,96 +126,133 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): + print(AffectednessEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value + affectedness = self.affectedness.value else: + print(BlankEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = BlankEnum(self.affectedness).value + affectedness = self.affectedness.value resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): + print(ResolutionEnum) resolution = UNSET if not isinstance(self.resolution, Unset): - - resolution = ResolutionEnum(self.resolution).value + resolution = self.resolution.value else: + print(BlankEnum) resolution = UNSET if not isinstance(self.resolution, Unset): + resolution = self.resolution.value - resolution = BlankEnum(self.resolution).value + ps_component: Union[None, Unset, str] + if isinstance(self.ps_component, Unset): + ps_component = UNSET + else: + ps_component = self.ps_component - ps_component = self.ps_component impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value - - purl = self.purl + purl: Union[None, Unset, str] + if isinstance(self.purl, Unset): + purl = UNSET + else: + purl = self.purl - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(ps_module, Unset): + if flaw is not UNSET: + field_dict["flaw"] = flaw + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_product, Unset): + if ps_product is not UNSET: field_dict["ps_product"] = ps_product - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(delegated_resolution, Unset): + if delegated_resolution is not UNSET: field_dict["delegated_resolution"] = delegated_resolution - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): - field_dict["flaw"] = flaw - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(purl, Unset): + if purl is not UNSET: field_dict["purl"] = purl return field_dict @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: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) + + def _parse_flaw(data: object) -> Union[None, UUID]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + _flaw_type_0 = data + flaw_type_0: UUID + if isinstance(_flaw_type_0, Unset): + flaw_type_0 = UNSET + else: + flaw_type_0 = UUID(_flaw_type_0) + + return flaw_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID], data) + + flaw = _parse_flaw(d.pop("flaw", UNSET)) ps_module = d.pop("ps_module", UNSET) @@ -179,52 +260,43 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: trackers = [] _trackers = d.pop("trackers", UNSET) - if _trackers is UNSET: - trackers = UNSET - else: - for trackers_item_data in _trackers or []: - _trackers_item = trackers_item_data - trackers_item: Tracker - if isinstance(_trackers_item, Unset): - trackers_item = UNSET - else: - trackers_item = Tracker.from_dict(_trackers_item) + for trackers_item_data in _trackers or []: + _trackers_item = trackers_item_data + trackers_item: Tracker + if isinstance(_trackers_item, Unset): + trackers_item = UNSET + else: + trackers_item = Tracker.from_dict(_trackers_item) - trackers.append(trackers_item) + trackers.append(trackers_item) delegated_resolution = d.pop("delegated_resolution", UNSET) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: AffectCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: AffectCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -240,18 +312,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) - - def _parse_affectedness( - data: object, - ) -> Union[AffectednessEnum, BlankEnum, Unset]: + def _parse_affectedness(data: object) -> Union[AffectednessEnum, BlankEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _affectedness_type_0 = data - affectedness_type_0: Union[Unset, AffectednessEnum] + affectedness_type_0: AffectednessEnum if isinstance(_affectedness_type_0, Unset): affectedness_type_0 = UNSET else: @@ -263,7 +331,7 @@ def _parse_affectedness( if not isinstance(data, str): raise TypeError() _affectedness_type_1 = data - affectedness_type_1: Union[Unset, BlankEnum] + affectedness_type_1: BlankEnum if isinstance(_affectedness_type_1, Unset): affectedness_type_1 = UNSET else: @@ -280,7 +348,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_0 = data - resolution_type_0: Union[Unset, ResolutionEnum] + resolution_type_0: ResolutionEnum if isinstance(_resolution_type_0, Unset): resolution_type_0 = UNSET else: @@ -292,7 +360,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_1 = data - resolution_type_1: Union[Unset, BlankEnum] + resolution_type_1: BlankEnum if isinstance(_resolution_type_1, Unset): resolution_type_1 = UNSET else: @@ -302,7 +370,14 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: resolution = _parse_resolution(d.pop("resolution", UNSET)) - ps_component = d.pop("ps_component", UNSET) + def _parse_ps_component(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + ps_component = _parse_ps_component(d.pop("ps_component", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -311,7 +386,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -323,7 +398,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -333,10 +408,18 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - purl = d.pop("purl", UNSET) + def _parse_purl(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + purl = _parse_purl(d.pop("purl", UNSET)) affect_bulk_put = cls( uuid=uuid, + flaw=flaw, ps_module=ps_module, ps_product=ps_product, trackers=trackers, @@ -346,7 +429,6 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: alerts=alerts, created_dt=created_dt, updated_dt=updated_dt, - flaw=flaw, affectedness=affectedness, resolution=resolution, ps_component=ps_component, @@ -357,29 +439,8 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: affect_bulk_put.additional_properties = d return affect_bulk_put - @staticmethod - def get_fields(): - return { - "uuid": str, - "ps_module": str, - "ps_product": str, - "trackers": List[Tracker], - "delegated_resolution": str, - "cvss_scores": List[AffectCVSS], - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "affectedness": Union[AffectednessEnum, BlankEnum], - "resolution": Union[BlankEnum, ResolutionEnum], - "ps_component": str, - "impact": Union[BlankEnum, ImpactEnum], - "purl": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/affect_cvss.py b/osidb_bindings/bindings/python_client/models/affect_cvss.py index 9bfd471..e837cdb 100644 --- a/osidb_bindings/bindings/python_client/models/affect_cvss.py +++ b/osidb_bindings/bindings/python_client/models/affect_cvss.py @@ -1,54 +1,83 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="AffectCVSS") -@attr.s(auto_attribs=True) +@_attrs_define class AffectCVSS(OSIDBModel): - """AffectCVSS serializer""" + """AffectCVSS serializer + + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affect (Union[Unset, UUID]): + comment (Union[None, Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affect: Union[Unset, str] = UNSET - comment: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + affect: Union[Unset, UUID] = UNSET + comment: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -62,38 +91,47 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affect = self.affect - comment = self.comment + affect: Union[Unset, str] = UNSET + if not isinstance(self.affect, Unset): + affect = str(self.affect) + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affect, Unset): + if affect is not UNSET: field_dict["affect"] = affect - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -111,7 +149,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -119,18 +162,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -146,9 +186,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affect = d.pop("affect", UNSET) + _affect = d.pop("affect", UNSET) + affect: Union[Unset, UUID] + if isinstance(_affect, Unset): + affect = UNSET + else: + affect = UUID(_affect) - comment = d.pop("comment", UNSET) + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + comment = _parse_comment(d.pop("comment", UNSET)) affect_cvss = cls( cvss_version=cvss_version, @@ -167,24 +219,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: affect_cvss.additional_properties = d return affect_cvss - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affect": str, - "comment": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/affect_cvss_post.py b/osidb_bindings/bindings/python_client/models/affect_cvss_post.py index 9908b87..993a8b7 100644 --- a/osidb_bindings/bindings/python_client/models/affect_cvss_post.py +++ b/osidb_bindings/bindings/python_client/models/affect_cvss_post.py @@ -1,53 +1,79 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="AffectCVSSPost") -@attr.s(auto_attribs=True) +@_attrs_define class AffectCVSSPost(OSIDBModel): - """AffectCVSS serializer""" + """AffectCVSS serializer + + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + comment (Union[None, Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime - comment: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + comment: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -57,107 +83,107 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() - comment = self.comment + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict - def to_multipart(self) -> Dict[str, Any]: - cvss_version: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + cvss_version: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = (None, str(self.cvss_version.value).encode(), "text/plain") - cvss_version = CvssVersionEnum(self.cvss_version).value - - issuer: Union[Unset, Tuple[None, str, str]] = UNSET + issuer: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.issuer, Unset): + issuer = (None, str(self.issuer.value).encode(), "text/plain") - issuer = IssuerEnum(self.issuer).value + score = (None, str(self.score).encode(), "text/plain") - score = ( - self.score if self.score is UNSET else (None, str(self.score), "text/plain") - ) - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - vector = ( - self.vector - if self.vector is UNSET - else (None, str(self.vector), "text/plain") - ) - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + vector = (None, str(self.vector).encode(), "text/plain") + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - comment = ( - self.comment - if self.comment is UNSET - else (None, str(self.comment), "text/plain") - ) + comment: Union[Unset, tuple[None, bytes, str]] - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(cvss_version, Unset): + if isinstance(self.comment, Unset): + comment = UNSET + elif isinstance(self.comment, str): + comment = (None, str(self.comment).encode(), "text/plain") + else: + comment = (None, str(self.comment).encode(), "text/plain") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -175,7 +201,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -183,18 +214,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -203,7 +231,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: created_dt = isoparse(_created_dt) - comment = d.pop("comment", UNSET) + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + comment = _parse_comment(d.pop("comment", UNSET)) affect_cvss_post = cls( cvss_version=cvss_version, @@ -220,22 +255,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: affect_cvss_post.additional_properties = d return affect_cvss_post - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "comment": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/affect_cvss_put.py b/osidb_bindings/bindings/python_client/models/affect_cvss_put.py index c17cf4f..e00638c 100644 --- a/osidb_bindings/bindings/python_client/models/affect_cvss_put.py +++ b/osidb_bindings/bindings/python_client/models/affect_cvss_put.py @@ -1,54 +1,82 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="AffectCVSSPut") -@attr.s(auto_attribs=True) +@_attrs_define class AffectCVSSPut(OSIDBModel): - """AffectCVSS serializer""" + """AffectCVSS serializer + + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + comment (Union[None, Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - comment: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + comment: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -62,115 +90,115 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - comment = self.comment + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict - def to_multipart(self) -> Dict[str, Any]: - cvss_version: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + cvss_version: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = (None, str(self.cvss_version.value).encode(), "text/plain") - cvss_version = CvssVersionEnum(self.cvss_version).value - - issuer: Union[Unset, Tuple[None, str, str]] = UNSET + issuer: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.issuer, Unset): + issuer = (None, str(self.issuer.value).encode(), "text/plain") - issuer = IssuerEnum(self.issuer).value + score = (None, str(self.score).encode(), "text/plain") - score = ( - self.score if self.score is UNSET else (None, str(self.score), "text/plain") - ) - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - vector = ( - self.vector - if self.vector is UNSET - else (None, str(self.vector), "text/plain") - ) - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + vector = (None, str(self.vector).encode(), "text/plain") + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() - comment = ( - self.comment - if self.comment is UNSET - else (None, str(self.comment), "text/plain") - ) + comment: Union[Unset, tuple[None, bytes, str]] - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(cvss_version, Unset): + if isinstance(self.comment, Unset): + comment = UNSET + elif isinstance(self.comment, str): + comment = (None, str(self.comment).encode(), "text/plain") + else: + comment = (None, str(self.comment).encode(), "text/plain") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -188,7 +216,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -196,18 +229,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -223,7 +253,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - comment = d.pop("comment", UNSET) + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + comment = _parse_comment(d.pop("comment", UNSET)) affect_cvss_put = cls( cvss_version=cvss_version, @@ -241,23 +278,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: affect_cvss_put.additional_properties = d return affect_cvss_put - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "comment": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/affect_post.py b/osidb_bindings/bindings/python_client/models/affect_post.py index da5e945..e47fea7 100644 --- a/osidb_bindings/bindings/python_client/models/affect_post.py +++ b/osidb_bindings/bindings/python_client/models/affect_post.py @@ -1,74 +1,116 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect_cvss import AffectCVSS from ..models.affectedness_enum import AffectednessEnum -from ..models.alert import Alert from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum -from ..models.tracker import Tracker -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + T = TypeVar("T", bound="AffectPost") -@attr.s(auto_attribs=True) +@_attrs_define class AffectPost(OSIDBModel): - """Affect serializer""" - - uuid: str + """Affect serializer + + Attributes: + uuid (UUID): + flaw (Union[None, UUID]): + ps_module (str): + ps_product (str): + trackers (list['Tracker']): + delegated_resolution (str): + cvss_scores (list['AffectCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + affectedness (Union[AffectednessEnum, BlankEnum, Unset]): + resolution (Union[BlankEnum, ResolutionEnum, Unset]): + ps_component (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + purl (Union[None, Unset, str]): + """ + + uuid: UUID + flaw: Union[None, UUID] ps_module: str ps_product: str - trackers: List[Tracker] + trackers: list["Tracker"] delegated_resolution: str - cvss_scores: List[AffectCVSS] + cvss_scores: list["AffectCVSS"] embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime - flaw: Optional[str] affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET - ps_component: Union[Unset, None, str] = UNSET + ps_component: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - purl: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + purl: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + flaw: Union[None, str] + if isinstance(self.flaw, UUID): + flaw = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + else: + flaw = self.flaw - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid ps_module = self.ps_module + ps_product = self.ps_product - trackers: List[Dict[str, Any]] = UNSET + + trackers: list[dict[str, Any]] = UNSET if not isinstance(self.trackers, Unset): trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() trackers.append(trackers_item) delegated_resolution = self.delegated_resolution - cvss_scores: List[Dict[str, Any]] = UNSET + + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -78,246 +120,284 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() - flaw = self.flaw affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): + print(AffectednessEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value + affectedness = self.affectedness.value else: + print(BlankEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = BlankEnum(self.affectedness).value + affectedness = self.affectedness.value resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): + print(ResolutionEnum) resolution = UNSET if not isinstance(self.resolution, Unset): - - resolution = ResolutionEnum(self.resolution).value + resolution = self.resolution.value else: + print(BlankEnum) resolution = UNSET if not isinstance(self.resolution, Unset): + resolution = self.resolution.value - resolution = BlankEnum(self.resolution).value + ps_component: Union[None, Unset, str] + if isinstance(self.ps_component, Unset): + ps_component = UNSET + else: + ps_component = self.ps_component - ps_component = self.ps_component impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value - - purl = self.purl + purl: Union[None, Unset, str] + if isinstance(self.purl, Unset): + purl = UNSET + else: + purl = self.purl - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(ps_module, Unset): + if flaw is not UNSET: + field_dict["flaw"] = flaw + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_product, Unset): + if ps_product is not UNSET: field_dict["ps_product"] = ps_product - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(delegated_resolution, Unset): + if delegated_resolution is not UNSET: field_dict["delegated_resolution"] = delegated_resolution - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(flaw, Unset): - field_dict["flaw"] = flaw - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(purl, Unset): + if purl is not UNSET: field_dict["purl"] = purl return field_dict - def to_multipart(self) -> Dict[str, Any]: - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - ps_module = ( - self.ps_module - if self.ps_module is UNSET - else (None, str(self.ps_module), "text/plain") - ) - ps_product = ( - self.ps_product - if self.ps_product is UNSET - else (None, str(self.ps_product), "text/plain") - ) - trackers: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + flaw: tuple[None, bytes, str] + + if isinstance(self.flaw, UUID): + flaw: bytes = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + else: + flaw = (None, str(self.flaw).encode(), "text/plain") + + ps_module = (None, str(self.ps_module).encode(), "text/plain") + + ps_product = (None, str(self.ps_product).encode(), "text/plain") + + trackers: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.trackers, Unset): _temp_trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() _temp_trackers.append(trackers_item) - trackers = (None, json.dumps(_temp_trackers), "application/json") + trackers = (None, json.dumps(_temp_trackers).encode(), "application/json") - delegated_resolution = ( - self.delegated_resolution - if self.delegated_resolution is UNSET - else (None, str(self.delegated_resolution), "text/plain") - ) - cvss_scores: Union[Unset, Tuple[None, str, str]] = UNSET + delegated_resolution = (None, str(self.delegated_resolution).encode(), "text/plain") + + cvss_scores: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.cvss_scores, Unset): _temp_cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() _temp_cvss_scores.append(cvss_scores_item) - cvss_scores = (None, json.dumps(_temp_cvss_scores), "application/json") + cvss_scores = (None, json.dumps(_temp_cvss_scores).encode(), "application/json") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() + + affectedness: Union[Unset, tuple[None, bytes, str]] - flaw = self.flaw if self.flaw is UNSET else (None, str(self.flaw), "text/plain") - affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): - affectedness = UNSET + affectedness: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value - + affectedness = (None, str(self.affectedness.value).encode(), "text/plain") else: - affectedness = UNSET + affectedness: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.affectedness, Unset): + affectedness = (None, str(self.affectedness.value).encode(), "text/plain") - affectedness = BlankEnum(self.affectedness).value + resolution: Union[Unset, tuple[None, bytes, str]] - resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): - resolution = UNSET + resolution: Union[Unset, tuple[None, bytes, str]] = UNSET + if not isinstance(self.resolution, Unset): + resolution = (None, str(self.resolution.value).encode(), "text/plain") + else: + resolution: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.resolution, Unset): + resolution = (None, str(self.resolution.value).encode(), "text/plain") - resolution = ResolutionEnum(self.resolution).value + ps_component: Union[Unset, tuple[None, bytes, str]] + if isinstance(self.ps_component, Unset): + ps_component = UNSET + elif isinstance(self.ps_component, str): + ps_component = (None, str(self.ps_component).encode(), "text/plain") else: - resolution = UNSET - if not isinstance(self.resolution, Unset): + ps_component = (None, str(self.ps_component).encode(), "text/plain") - resolution = BlankEnum(self.resolution).value + impact: Union[Unset, tuple[None, bytes, str]] - ps_component = ( - self.ps_component - if self.ps_component is UNSET - else (None, str(self.ps_component), "text/plain") - ) - impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): - impact = UNSET + impact: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value - + impact = (None, str(self.impact.value).encode(), "text/plain") else: - impact = UNSET + impact: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.impact, Unset): + impact = (None, str(self.impact.value).encode(), "text/plain") - impact = BlankEnum(self.impact).value + purl: Union[Unset, tuple[None, bytes, str]] - purl = self.purl if self.purl is UNSET else (None, str(self.purl), "text/plain") + if isinstance(self.purl, Unset): + purl = UNSET + elif isinstance(self.purl, str): + purl = (None, str(self.purl).encode(), "text/plain") + else: + purl = (None, str(self.purl).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(uuid, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(ps_module, Unset): + if flaw is not UNSET: + field_dict["flaw"] = flaw + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_product, Unset): + if ps_product is not UNSET: field_dict["ps_product"] = ps_product - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(delegated_resolution, Unset): + if delegated_resolution is not UNSET: field_dict["delegated_resolution"] = delegated_resolution - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(flaw, Unset): - field_dict["flaw"] = flaw - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(purl, Unset): + if purl is not UNSET: field_dict["purl"] = purl return field_dict @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: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) + + def _parse_flaw(data: object) -> Union[None, UUID]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + _flaw_type_0 = data + flaw_type_0: UUID + if isinstance(_flaw_type_0, Unset): + flaw_type_0 = UNSET + else: + flaw_type_0 = UUID(_flaw_type_0) + + return flaw_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID], data) + + flaw = _parse_flaw(d.pop("flaw", UNSET)) ps_module = d.pop("ps_module", UNSET) @@ -325,52 +405,43 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: trackers = [] _trackers = d.pop("trackers", UNSET) - if _trackers is UNSET: - trackers = UNSET - else: - for trackers_item_data in _trackers or []: - _trackers_item = trackers_item_data - trackers_item: Tracker - if isinstance(_trackers_item, Unset): - trackers_item = UNSET - else: - trackers_item = Tracker.from_dict(_trackers_item) + for trackers_item_data in _trackers or []: + _trackers_item = trackers_item_data + trackers_item: Tracker + if isinstance(_trackers_item, Unset): + trackers_item = UNSET + else: + trackers_item = Tracker.from_dict(_trackers_item) - trackers.append(trackers_item) + trackers.append(trackers_item) delegated_resolution = d.pop("delegated_resolution", UNSET) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: AffectCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: AffectCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -379,18 +450,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: created_dt = isoparse(_created_dt) - flaw = d.pop("flaw", UNSET) - - def _parse_affectedness( - data: object, - ) -> Union[AffectednessEnum, BlankEnum, Unset]: + def _parse_affectedness(data: object) -> Union[AffectednessEnum, BlankEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _affectedness_type_0 = data - affectedness_type_0: Union[Unset, AffectednessEnum] + affectedness_type_0: AffectednessEnum if isinstance(_affectedness_type_0, Unset): affectedness_type_0 = UNSET else: @@ -402,7 +469,7 @@ def _parse_affectedness( if not isinstance(data, str): raise TypeError() _affectedness_type_1 = data - affectedness_type_1: Union[Unset, BlankEnum] + affectedness_type_1: BlankEnum if isinstance(_affectedness_type_1, Unset): affectedness_type_1 = UNSET else: @@ -419,7 +486,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_0 = data - resolution_type_0: Union[Unset, ResolutionEnum] + resolution_type_0: ResolutionEnum if isinstance(_resolution_type_0, Unset): resolution_type_0 = UNSET else: @@ -431,7 +498,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_1 = data - resolution_type_1: Union[Unset, BlankEnum] + resolution_type_1: BlankEnum if isinstance(_resolution_type_1, Unset): resolution_type_1 = UNSET else: @@ -441,7 +508,14 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: resolution = _parse_resolution(d.pop("resolution", UNSET)) - ps_component = d.pop("ps_component", UNSET) + def _parse_ps_component(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + ps_component = _parse_ps_component(d.pop("ps_component", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -450,7 +524,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -462,7 +536,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -472,10 +546,18 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - purl = d.pop("purl", UNSET) + def _parse_purl(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + purl = _parse_purl(d.pop("purl", UNSET)) affect_post = cls( uuid=uuid, + flaw=flaw, ps_module=ps_module, ps_product=ps_product, trackers=trackers, @@ -484,7 +566,6 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: embargoed=embargoed, alerts=alerts, created_dt=created_dt, - flaw=flaw, affectedness=affectedness, resolution=resolution, ps_component=ps_component, @@ -495,28 +576,8 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: affect_post.additional_properties = d return affect_post - @staticmethod - def get_fields(): - return { - "uuid": str, - "ps_module": str, - "ps_product": str, - "trackers": List[Tracker], - "delegated_resolution": str, - "cvss_scores": List[AffectCVSS], - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "flaw": str, - "affectedness": Union[AffectednessEnum, BlankEnum], - "resolution": Union[BlankEnum, ResolutionEnum], - "ps_component": str, - "impact": Union[BlankEnum, ImpactEnum], - "purl": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/affect_report_data.py b/osidb_bindings/bindings/python_client/models/affect_report_data.py index 2ed7d98..8e4f28a 100644 --- a/osidb_bindings/bindings/python_client/models/affect_report_data.py +++ b/osidb_bindings/bindings/python_client/models/affect_report_data.py @@ -1,102 +1,116 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel from ..models.affectedness_enum import AffectednessEnum from ..models.blank_enum import BlankEnum from ..models.resolution_enum import ResolutionEnum -from ..models.tracker_report_data import TrackerReportData -from ..types import UNSET, OSIDBModel, Unset + +if TYPE_CHECKING: + from ..models.tracker_report_data import TrackerReportData + T = TypeVar("T", bound="AffectReportData") -@attr.s(auto_attribs=True) +@_attrs_define class AffectReportData(OSIDBModel): - """ """ + """ + Attributes: + ps_module (str): + ps_component (str): + affectedness (Union[AffectednessEnum, BlankEnum, Unset]): + resolution (Union[BlankEnum, ResolutionEnum, Unset]): + trackers (Union[Unset, list['TrackerReportData']]): + """ ps_module: str ps_component: str affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET - trackers: Union[Unset, List[TrackerReportData]] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + trackers: Union[Unset, list["TrackerReportData"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: ps_module = self.ps_module + ps_component = self.ps_component + affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): + print(AffectednessEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value + affectedness = self.affectedness.value else: + print(BlankEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = BlankEnum(self.affectedness).value + affectedness = self.affectedness.value resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): + print(ResolutionEnum) resolution = UNSET if not isinstance(self.resolution, Unset): - - resolution = ResolutionEnum(self.resolution).value + resolution = self.resolution.value else: + print(BlankEnum) resolution = UNSET if not isinstance(self.resolution, Unset): + resolution = self.resolution.value - resolution = BlankEnum(self.resolution).value - - trackers: Union[Unset, List[Dict[str, Any]]] = UNSET + trackers: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.trackers, Unset): trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() trackers.append(trackers_item) - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(ps_module, Unset): + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers return field_dict @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: + from ..models.tracker_report_data import TrackerReportData + d = src_dict.copy() ps_module = d.pop("ps_module", UNSET) ps_component = d.pop("ps_component", UNSET) - def _parse_affectedness( - data: object, - ) -> Union[AffectednessEnum, BlankEnum, Unset]: + def _parse_affectedness(data: object) -> Union[AffectednessEnum, BlankEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _affectedness_type_0 = data - affectedness_type_0: Union[Unset, AffectednessEnum] + affectedness_type_0: AffectednessEnum if isinstance(_affectedness_type_0, Unset): affectedness_type_0 = UNSET else: @@ -108,7 +122,7 @@ def _parse_affectedness( if not isinstance(data, str): raise TypeError() _affectedness_type_1 = data - affectedness_type_1: Union[Unset, BlankEnum] + affectedness_type_1: BlankEnum if isinstance(_affectedness_type_1, Unset): affectedness_type_1 = UNSET else: @@ -125,7 +139,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_0 = data - resolution_type_0: Union[Unset, ResolutionEnum] + resolution_type_0: ResolutionEnum if isinstance(_resolution_type_0, Unset): resolution_type_0 = UNSET else: @@ -137,7 +151,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_1 = data - resolution_type_1: Union[Unset, BlankEnum] + resolution_type_1: BlankEnum if isinstance(_resolution_type_1, Unset): resolution_type_1 = UNSET else: @@ -149,18 +163,15 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: trackers = [] _trackers = d.pop("trackers", UNSET) - if _trackers is UNSET: - trackers = UNSET - else: - for trackers_item_data in _trackers or []: - _trackers_item = trackers_item_data - trackers_item: TrackerReportData - if isinstance(_trackers_item, Unset): - trackers_item = UNSET - else: - trackers_item = TrackerReportData.from_dict(_trackers_item) + for trackers_item_data in _trackers or []: + _trackers_item = trackers_item_data + trackers_item: TrackerReportData + if isinstance(_trackers_item, Unset): + trackers_item = UNSET + else: + trackers_item = TrackerReportData.from_dict(_trackers_item) - trackers.append(trackers_item) + trackers.append(trackers_item) affect_report_data = cls( ps_module=ps_module, @@ -173,18 +184,8 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: affect_report_data.additional_properties = d return affect_report_data - @staticmethod - def get_fields(): - return { - "ps_module": str, - "ps_component": str, - "affectedness": Union[AffectednessEnum, BlankEnum], - "resolution": Union[BlankEnum, ResolutionEnum], - "trackers": List[TrackerReportData], - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/affectedness_enum.py b/osidb_bindings/bindings/python_client/models/affectedness_enum.py index 313f7d1..2fb6fe5 100644 --- a/osidb_bindings/bindings/python_client/models/affectedness_enum.py +++ b/osidb_bindings/bindings/python_client/models/affectedness_enum.py @@ -2,8 +2,8 @@ class AffectednessEnum(str, Enum): - NEW = "NEW" AFFECTED = "AFFECTED" + NEW = "NEW" NOTAFFECTED = "NOTAFFECTED" def __str__(self) -> str: diff --git a/osidb_bindings/bindings/python_client/models/alert.py b/osidb_bindings/bindings/python_client/models/alert.py index 725c569..d5f577c 100644 --- a/osidb_bindings/bindings/python_client/models/alert.py +++ b/osidb_bindings/bindings/python_client/models/alert.py @@ -1,68 +1,101 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel from ..models.alert_type_enum import AlertTypeEnum -from ..types import UNSET, OSIDBModel, Unset +from uuid import UUID + T = TypeVar("T", bound="Alert") -@attr.s(auto_attribs=True) +@_attrs_define class Alert(OSIDBModel): - """Alerts indicate some inconsistency in a linked flaw, affect, tracker or other models.""" - - uuid: str + """Alerts indicate some inconsistency in a linked flaw, affect, tracker or other models. + + Attributes: + uuid (UUID): + name (str): + description (str): + parent_uuid (UUID): + parent_model (str): + alert_type (Union[Unset, AlertTypeEnum]): + resolution_steps (Union[Unset, str]): + """ + + uuid: UUID name: str description: str - parent_uuid: str + parent_uuid: UUID parent_model: str alert_type: Union[Unset, AlertTypeEnum] = UNSET resolution_steps: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid name = self.name + description = self.description - parent_uuid = self.parent_uuid + + parent_uuid: str = UNSET + if not isinstance(self.parent_uuid, Unset): + parent_uuid = str(self.parent_uuid) + parent_model = self.parent_model + + print(AlertTypeEnum) alert_type: Union[Unset, str] = UNSET if not isinstance(self.alert_type, Unset): - - alert_type = AlertTypeEnum(self.alert_type).value + alert_type = self.alert_type.value resolution_steps = self.resolution_steps - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(parent_uuid, Unset): + if parent_uuid is not UNSET: field_dict["parent_uuid"] = parent_uuid - if not isinstance(parent_model, Unset): + if parent_model is not UNSET: field_dict["parent_model"] = parent_model - if not isinstance(alert_type, Unset): + if alert_type is not UNSET: field_dict["alert_type"] = alert_type - if not isinstance(resolution_steps, Unset): + if resolution_steps is not UNSET: field_dict["resolution_steps"] = resolution_steps return field_dict @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() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) name = d.pop("name", UNSET) description = d.pop("description", UNSET) - parent_uuid = d.pop("parent_uuid", UNSET) + _parent_uuid = d.pop("parent_uuid", UNSET) + parent_uuid: UUID + if isinstance(_parent_uuid, Unset): + parent_uuid = UNSET + else: + parent_uuid = UUID(_parent_uuid) parent_model = d.pop("parent_model", UNSET) @@ -88,20 +121,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alert.additional_properties = d return alert - @staticmethod - def get_fields(): - return { - "uuid": str, - "name": str, - "description": str, - "parent_uuid": str, - "parent_model": str, - "alert_type": AlertTypeEnum, - "resolution_steps": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/alert_type_enum.py b/osidb_bindings/bindings/python_client/models/alert_type_enum.py index efdb766..35a0d4a 100644 --- a/osidb_bindings/bindings/python_client/models/alert_type_enum.py +++ b/osidb_bindings/bindings/python_client/models/alert_type_enum.py @@ -2,8 +2,8 @@ class AlertTypeEnum(str, Enum): - WARNING = "WARNING" ERROR = "ERROR" + WARNING = "WARNING" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/audit.py b/osidb_bindings/bindings/python_client/models/audit.py index 56bd0fb..6995c87 100644 --- a/osidb_bindings/bindings/python_client/models/audit.py +++ b/osidb_bindings/bindings/python_client/models/audit.py @@ -1,17 +1,31 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Audit") -@attr.s(auto_attribs=True) +@_attrs_define class Audit(OSIDBModel): - """ """ + """ + Attributes: + pgh_created_at (datetime.datetime): When the event was created. + pgh_slug (str): The unique identifier across all event tables. + pgh_obj_model (str): The object model. + pgh_label (str): The event label. + pgh_diff (Any): The diff between the previous event of the same label. + pgh_data (str): + pgh_obj_id (Union[None, Unset, str]): The primary key of the object. + pgh_context (Union[Unset, Any]): The context associated with the event. + """ pgh_created_at: datetime.datetime pgh_slug: str @@ -19,107 +33,109 @@ class Audit(OSIDBModel): pgh_label: str pgh_diff: Any pgh_data: str - pgh_obj_id: Union[Unset, None, str] = UNSET + pgh_obj_id: Union[None, Unset, str] = UNSET pgh_context: Union[Unset, Any] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: pgh_created_at: str = UNSET if not isinstance(self.pgh_created_at, Unset): pgh_created_at = self.pgh_created_at.isoformat() pgh_slug = self.pgh_slug + pgh_obj_model = self.pgh_obj_model + pgh_label = self.pgh_label + pgh_diff = self.pgh_diff pgh_data = self.pgh_data - pgh_obj_id = self.pgh_obj_id + + pgh_obj_id: Union[None, Unset, str] + if isinstance(self.pgh_obj_id, Unset): + pgh_obj_id = UNSET + else: + pgh_obj_id = self.pgh_obj_id + pgh_context = self.pgh_context - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(pgh_created_at, Unset): + if pgh_created_at is not UNSET: field_dict["pgh_created_at"] = pgh_created_at - if not isinstance(pgh_slug, Unset): + if pgh_slug is not UNSET: field_dict["pgh_slug"] = pgh_slug - if not isinstance(pgh_obj_model, Unset): + if pgh_obj_model is not UNSET: field_dict["pgh_obj_model"] = pgh_obj_model - if not isinstance(pgh_label, Unset): + if pgh_label is not UNSET: field_dict["pgh_label"] = pgh_label - if not isinstance(pgh_diff, Unset): + if pgh_diff is not UNSET: field_dict["pgh_diff"] = pgh_diff - if not isinstance(pgh_data, Unset): + if pgh_data is not UNSET: field_dict["pgh_data"] = pgh_data - if not isinstance(pgh_obj_id, Unset): + if pgh_obj_id is not UNSET: field_dict["pgh_obj_id"] = pgh_obj_id - if not isinstance(pgh_context, Unset): + if pgh_context is not UNSET: field_dict["pgh_context"] = pgh_context return field_dict - def to_multipart(self) -> Dict[str, Any]: - pgh_created_at: str = UNSET + def to_multipart(self) -> dict[str, Any]: + pgh_created_at: bytes = UNSET if not isinstance(self.pgh_created_at, Unset): - pgh_created_at = self.pgh_created_at.isoformat() + pgh_created_at = self.pgh_created_at.isoformat().encode() - pgh_slug = ( - self.pgh_slug - if self.pgh_slug is UNSET - else (None, str(self.pgh_slug), "text/plain") - ) - pgh_obj_model = ( - self.pgh_obj_model - if self.pgh_obj_model is UNSET - else (None, str(self.pgh_obj_model), "text/plain") - ) - pgh_label = ( - self.pgh_label - if self.pgh_label is UNSET - else (None, str(self.pgh_label), "text/plain") - ) - pgh_diff = self.pgh_diff + pgh_slug = (None, str(self.pgh_slug).encode(), "text/plain") - pgh_data = ( - self.pgh_data - if self.pgh_data is UNSET - else (None, str(self.pgh_data), "text/plain") - ) - pgh_obj_id = ( - self.pgh_obj_id - if self.pgh_obj_id is UNSET - else (None, str(self.pgh_obj_id), "text/plain") - ) - pgh_context = self.pgh_context + pgh_obj_model = (None, str(self.pgh_obj_model).encode(), "text/plain") + + pgh_label = (None, str(self.pgh_label).encode(), "text/plain") + + pgh_diff = (None, str(self.pgh_diff).encode(), "text/plain") + + pgh_data = (None, str(self.pgh_data).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } + pgh_obj_id: Union[Unset, tuple[None, bytes, str]] + + if isinstance(self.pgh_obj_id, Unset): + pgh_obj_id = UNSET + elif isinstance(self.pgh_obj_id, str): + pgh_obj_id = (None, str(self.pgh_obj_id).encode(), "text/plain") + else: + pgh_obj_id = (None, str(self.pgh_obj_id).encode(), "text/plain") + + pgh_context = ( + self.pgh_context + if isinstance(self.pgh_context, Unset) + else (None, str(self.pgh_context).encode(), "text/plain") ) - if not isinstance(pgh_created_at, Unset): + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if pgh_created_at is not UNSET: field_dict["pgh_created_at"] = pgh_created_at - if not isinstance(pgh_slug, Unset): + if pgh_slug is not UNSET: field_dict["pgh_slug"] = pgh_slug - if not isinstance(pgh_obj_model, Unset): + if pgh_obj_model is not UNSET: field_dict["pgh_obj_model"] = pgh_obj_model - if not isinstance(pgh_label, Unset): + if pgh_label is not UNSET: field_dict["pgh_label"] = pgh_label - if not isinstance(pgh_diff, Unset): + if pgh_diff is not UNSET: field_dict["pgh_diff"] = pgh_diff - if not isinstance(pgh_data, Unset): + if pgh_data is not UNSET: field_dict["pgh_data"] = pgh_data - if not isinstance(pgh_obj_id, Unset): + if pgh_obj_id is not UNSET: field_dict["pgh_obj_id"] = pgh_obj_id - if not isinstance(pgh_context, Unset): + if pgh_context is not UNSET: field_dict["pgh_context"] = pgh_context return field_dict @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() _pgh_created_at = d.pop("pgh_created_at", UNSET) pgh_created_at: datetime.datetime @@ -138,7 +154,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: pgh_data = d.pop("pgh_data", UNSET) - pgh_obj_id = d.pop("pgh_obj_id", UNSET) + def _parse_pgh_obj_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + pgh_obj_id = _parse_pgh_obj_id(d.pop("pgh_obj_id", UNSET)) pgh_context = d.pop("pgh_context", UNSET) @@ -156,21 +179,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: audit.additional_properties = d return audit - @staticmethod - def get_fields(): - return { - "pgh_created_at": datetime.datetime, - "pgh_slug": str, - "pgh_obj_model": str, - "pgh_label": str, - "pgh_diff": Any, - "pgh_data": str, - "pgh_obj_id": str, - "pgh_context": Any, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/auth_token_create_response_200.py b/osidb_bindings/bindings/python_client/models/auth_token_create_response_200.py index 7c33c56..13998ce 100644 --- a/osidb_bindings/bindings/python_client/models/auth_token_create_response_200.py +++ b/osidb_bindings/bindings/python_client/models/auth_token_create_response_200.py @@ -1,17 +1,30 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="AuthTokenCreateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class AuthTokenCreateResponse200(OSIDBModel): - """ """ + """ + Attributes: + username (str): + password (str): + access (str): + refresh (str): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ username: str password: str @@ -21,44 +34,50 @@ class AuthTokenCreateResponse200(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: username = self.username + password = self.password + access = self.access + refresh = self.refresh + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(username, Unset): + if username is not UNSET: field_dict["username"] = username - if not isinstance(password, Unset): + if password is not UNSET: field_dict["password"] = password - if not isinstance(access, Unset): + if access is not UNSET: field_dict["access"] = access - if not isinstance(refresh, Unset): + if refresh is not UNSET: field_dict["refresh"] = refresh - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() username = d.pop("username", UNSET) @@ -95,21 +114,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: auth_token_create_response_200.additional_properties = d return auth_token_create_response_200 - @staticmethod - def get_fields(): - return { - "username": str, - "password": str, - "access": str, - "refresh": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/auth_token_refresh_create_response_200.py b/osidb_bindings/bindings/python_client/models/auth_token_refresh_create_response_200.py index 2da53dc..a4f83d1 100644 --- a/osidb_bindings/bindings/python_client/models/auth_token_refresh_create_response_200.py +++ b/osidb_bindings/bindings/python_client/models/auth_token_refresh_create_response_200.py @@ -1,17 +1,28 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="AuthTokenRefreshCreateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class AuthTokenRefreshCreateResponse200(OSIDBModel): - """ """ + """ + Attributes: + access (str): + refresh (str): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ access: str refresh: str @@ -19,38 +30,42 @@ class AuthTokenRefreshCreateResponse200(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: access = self.access + refresh = self.refresh + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(access, Unset): + if access is not UNSET: field_dict["access"] = access - if not isinstance(refresh, Unset): + if refresh is not UNSET: field_dict["refresh"] = refresh - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() access = d.pop("access", UNSET) @@ -81,19 +96,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: auth_token_refresh_create_response_200.additional_properties = d return auth_token_refresh_create_response_200 - @staticmethod - def get_fields(): - return { - "access": str, - "refresh": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/auth_token_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/auth_token_retrieve_response_200.py index 39dd50b..dc500ed 100644 --- a/osidb_bindings/bindings/python_client/models/auth_token_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/auth_token_retrieve_response_200.py @@ -1,17 +1,28 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="AuthTokenRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class AuthTokenRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + access (Union[Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + refresh (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ access: Union[Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET @@ -19,38 +30,42 @@ class AuthTokenRetrieveResponse200(OSIDBModel): refresh: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: access = self.access + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + refresh = self.refresh + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(access, Unset): + if access is not UNSET: field_dict["access"] = access - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(refresh, Unset): + if refresh is not UNSET: field_dict["refresh"] = refresh - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() access = d.pop("access", UNSET) @@ -81,19 +96,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: auth_token_retrieve_response_200.additional_properties = d return auth_token_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "access": str, - "dt": datetime.datetime, - "env": str, - "refresh": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/auth_token_verify_create_response_200.py b/osidb_bindings/bindings/python_client/models/auth_token_verify_create_response_200.py index cc99a97..0529c61 100644 --- a/osidb_bindings/bindings/python_client/models/auth_token_verify_create_response_200.py +++ b/osidb_bindings/bindings/python_client/models/auth_token_verify_create_response_200.py @@ -1,52 +1,65 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="AuthTokenVerifyCreateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class AuthTokenVerifyCreateResponse200(OSIDBModel): - """ """ + """ + Attributes: + token (str): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ token: str dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: token = self.token + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(token, Unset): + if token is not UNSET: field_dict["token"] = token - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() token = d.pop("token", UNSET) @@ -74,18 +87,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: auth_token_verify_create_response_200.additional_properties = d return auth_token_verify_create_response_200 - @staticmethod - def get_fields(): - return { - "token": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200.py index 5520599..5d4ef86 100644 --- a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200.py @@ -1,36 +1,46 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item import ( + CollectorsApiV1StatusRetrieveResponse200CollectorsItem, + ) -from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item import ( - CollectorsApiV1StatusRetrieveResponse200CollectorsItem, -) -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="CollectorsApiV1StatusRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class CollectorsApiV1StatusRetrieveResponse200(OSIDBModel): - """ """ - - collectors: Union[ - Unset, List[CollectorsApiV1StatusRetrieveResponse200CollectorsItem] - ] = UNSET + """ + Attributes: + collectors (Union[Unset, list['CollectorsApiV1StatusRetrieveResponse200CollectorsItem']]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + collectors: Union[Unset, list["CollectorsApiV1StatusRetrieveResponse200CollectorsItem"]] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - collectors: Union[Unset, List[Dict[str, Any]]] = UNSET + def to_dict(self) -> dict[str, Any]: + collectors: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.collectors, Unset): collectors = [] for collectors_item_data in self.collectors: - collectors_item: Dict[str, Any] = UNSET + collectors_item: dict[str, Any] = UNSET if not isinstance(collectors_item_data, Unset): collectors_item = collectors_item_data.to_dict() @@ -41,43 +51,44 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(collectors, Unset): + if collectors is not UNSET: field_dict["collectors"] = collectors - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item import ( + CollectorsApiV1StatusRetrieveResponse200CollectorsItem, + ) + d = src_dict.copy() collectors = [] _collectors = d.pop("collectors", UNSET) - if _collectors is UNSET: - collectors = UNSET - else: - for collectors_item_data in _collectors or []: - _collectors_item = collectors_item_data - collectors_item: CollectorsApiV1StatusRetrieveResponse200CollectorsItem - if isinstance(_collectors_item, Unset): - collectors_item = UNSET - else: - collectors_item = CollectorsApiV1StatusRetrieveResponse200CollectorsItem.from_dict( - _collectors_item - ) + for collectors_item_data in _collectors or []: + _collectors_item = collectors_item_data + collectors_item: CollectorsApiV1StatusRetrieveResponse200CollectorsItem + if isinstance(_collectors_item, Unset): + collectors_item = UNSET + else: + collectors_item = CollectorsApiV1StatusRetrieveResponse200CollectorsItem.from_dict(_collectors_item) - collectors.append(collectors_item) + collectors.append(collectors_item) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -103,18 +114,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: collectors_api_v1_status_retrieve_response_200.additional_properties = d return collectors_api_v1_status_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "collectors": List[CollectorsApiV1StatusRetrieveResponse200CollectorsItem], - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item.py b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item.py index d60fa3d..6aed530 100644 --- a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item.py +++ b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item.py @@ -1,99 +1,122 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item_data import ( CollectorsApiV1StatusRetrieveResponse200CollectorsItemData, ) -from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item_error import ( - CollectorsApiV1StatusRetrieveResponse200CollectorsItemError, -) from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item_state import ( CollectorsApiV1StatusRetrieveResponse200CollectorsItemState, ) -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0 import ( + CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0, + ) + T = TypeVar("T", bound="CollectorsApiV1StatusRetrieveResponse200CollectorsItem") -@attr.s(auto_attribs=True) +@_attrs_define class CollectorsApiV1StatusRetrieveResponse200CollectorsItem(OSIDBModel): - """ """ - - data: Union[ - Unset, CollectorsApiV1StatusRetrieveResponse200CollectorsItemData - ] = UNSET - depends_on: Union[Unset, List[str]] = UNSET - error: Union[ - Unset, None, CollectorsApiV1StatusRetrieveResponse200CollectorsItemError - ] = UNSET + """ + Attributes: + data (Union[Unset, CollectorsApiV1StatusRetrieveResponse200CollectorsItemData]): + depends_on (Union[Unset, list[str]]): + error (Union['CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0', None, Unset]): + is_complete (Union[Unset, bool]): + is_up2date (Union[Unset, bool]): + data_models (Union[Unset, list[str]]): + state (Union[Unset, CollectorsApiV1StatusRetrieveResponse200CollectorsItemState]): + updated_until (Union[Unset, datetime.datetime]): + """ + + data: Union[Unset, CollectorsApiV1StatusRetrieveResponse200CollectorsItemData] = UNSET + depends_on: Union[Unset, list[str]] = UNSET + error: Union["CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0", None, Unset] = UNSET is_complete: Union[Unset, bool] = UNSET is_up2date: Union[Unset, bool] = UNSET - data_models: Union[Unset, List[str]] = UNSET - state: Union[ - Unset, CollectorsApiV1StatusRetrieveResponse200CollectorsItemState - ] = UNSET + data_models: Union[Unset, list[str]] = UNSET + state: Union[Unset, CollectorsApiV1StatusRetrieveResponse200CollectorsItemState] = UNSET updated_until: Union[Unset, datetime.datetime] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0 import ( + CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0, + ) - def to_dict(self) -> Dict[str, Any]: + print(CollectorsApiV1StatusRetrieveResponse200CollectorsItemData) data: Union[Unset, str] = UNSET if not isinstance(self.data, Unset): + data = self.data.value - data = CollectorsApiV1StatusRetrieveResponse200CollectorsItemData( - self.data - ).value - - depends_on: Union[Unset, List[str]] = UNSET + depends_on: Union[Unset, list[str]] = UNSET if not isinstance(self.depends_on, Unset): depends_on = self.depends_on - error: Union[Unset, None, Dict[str, Any]] = UNSET - if not isinstance(self.error, Unset): - error = self.error.to_dict() if self.error else None + error: Union[None, Unset, dict[str, Any]] + if isinstance(self.error, Unset): + error = UNSET + elif isinstance(self.error, CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0): + error = UNSET + if not isinstance(self.error, Unset): + error = self.error.to_dict() + + else: + error = self.error is_complete = self.is_complete + is_up2date = self.is_up2date - data_models: Union[Unset, List[str]] = UNSET + + data_models: Union[Unset, list[str]] = UNSET if not isinstance(self.data_models, Unset): data_models = self.data_models + print(CollectorsApiV1StatusRetrieveResponse200CollectorsItemState) state: Union[Unset, str] = UNSET if not isinstance(self.state, Unset): - - state = CollectorsApiV1StatusRetrieveResponse200CollectorsItemState( - self.state - ).value + state = self.state.value updated_until: Union[Unset, str] = UNSET if not isinstance(self.updated_until, Unset): updated_until = self.updated_until.isoformat() - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(data, Unset): + if data is not UNSET: field_dict["data"] = data - if not isinstance(depends_on, Unset): + if depends_on is not UNSET: field_dict["depends_on"] = depends_on - if not isinstance(error, Unset): + if error is not UNSET: field_dict["error"] = error - if not isinstance(is_complete, Unset): + if is_complete is not UNSET: field_dict["is_complete"] = is_complete - if not isinstance(is_up2date, Unset): + if is_up2date is not UNSET: field_dict["is_up2date"] = is_up2date - if not isinstance(data_models, Unset): + if data_models is not UNSET: field_dict["data_models"] = data_models - if not isinstance(state, Unset): + if state is not UNSET: field_dict["state"] = state - if not isinstance(updated_until, Unset): + if updated_until is not UNSET: field_dict["updated_until"] = updated_until return field_dict @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: + from ..models.collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0 import ( + CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0, + ) + d = src_dict.copy() _data = d.pop("data", UNSET) data: Union[Unset, CollectorsApiV1StatusRetrieveResponse200CollectorsItemData] @@ -102,28 +125,39 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: data = CollectorsApiV1StatusRetrieveResponse200CollectorsItemData(_data) - depends_on = cast(List[str], d.pop("depends_on", UNSET)) - - _error = d.pop("error", UNSET) - error: Union[ - Unset, None, CollectorsApiV1StatusRetrieveResponse200CollectorsItemError - ] - if _error is None: - error = None - elif isinstance(_error, Unset): - error = UNSET - else: - error = ( - CollectorsApiV1StatusRetrieveResponse200CollectorsItemError.from_dict( - _error - ) - ) + depends_on = cast(list[str], d.pop("depends_on", UNSET)) + + def _parse_error( + data: object, + ) -> Union["CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + _error_type_0 = data + error_type_0: CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0 + if isinstance(_error_type_0, Unset): + error_type_0 = UNSET + else: + error_type_0 = CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0.from_dict( + _error_type_0 + ) + + return error_type_0 + except: # noqa: E722 + pass + return cast(Union["CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0", None, Unset], data) + + error = _parse_error(d.pop("error", UNSET)) is_complete = d.pop("is_complete", UNSET) is_up2date = d.pop("is_up2date", UNSET) - data_models = cast(List[str], d.pop("data_models", UNSET)) + data_models = cast(list[str], d.pop("data_models", UNSET)) _state = d.pop("state", UNSET) state: Union[Unset, CollectorsApiV1StatusRetrieveResponse200CollectorsItemState] @@ -150,26 +184,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: updated_until=updated_until, ) - collectors_api_v1_status_retrieve_response_200_collectors_item.additional_properties = ( - d - ) + collectors_api_v1_status_retrieve_response_200_collectors_item.additional_properties = d return collectors_api_v1_status_retrieve_response_200_collectors_item - @staticmethod - def get_fields(): - return { - "data": CollectorsApiV1StatusRetrieveResponse200CollectorsItemData, - "depends_on": List[str], - "error": CollectorsApiV1StatusRetrieveResponse200CollectorsItemError, - "is_complete": bool, - "is_up2date": bool, - "data_models": List[str], - "state": CollectorsApiV1StatusRetrieveResponse200CollectorsItemState, - "updated_until": datetime.datetime, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_data.py b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_data.py index 3bdeb3e..c029e84 100644 --- a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_data.py +++ b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_data.py @@ -2,9 +2,9 @@ class CollectorsApiV1StatusRetrieveResponse200CollectorsItemData(str, Enum): + COMPLETE = "COMPLETE" EMPTY = "EMPTY" PARTIAL = "PARTIAL" - COMPLETE = "COMPLETE" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_error.py b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0.py similarity index 63% rename from osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_error.py rename to osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0.py index b46f572..f68e318 100644 --- a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_error.py +++ b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0.py @@ -1,41 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field from ..types import OSIDBModel -T = TypeVar("T", bound="CollectorsApiV1StatusRetrieveResponse200CollectorsItemError") +T = TypeVar("T", bound="CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0") -@attr.s(auto_attribs=True) -class CollectorsApiV1StatusRetrieveResponse200CollectorsItemError(OSIDBModel): - """ """ - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) +@_attrs_define +class CollectorsApiV1StatusRetrieveResponse200CollectorsItemErrorType0(OSIDBModel): + """ """ - def to_dict(self) -> Dict[str, Any]: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) return field_dict @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() - collectors_api_v1_status_retrieve_response_200_collectors_item_error = cls() - - collectors_api_v1_status_retrieve_response_200_collectors_item_error.additional_properties = ( - d - ) - return collectors_api_v1_status_retrieve_response_200_collectors_item_error + collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0 = cls() - @staticmethod - def get_fields(): - return {} + collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0.additional_properties = d + return collectors_api_v1_status_retrieve_response_200_collectors_item_error_type_0 @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_state.py b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_state.py index fcf8828..90341b5 100644 --- a/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_state.py +++ b/osidb_bindings/bindings/python_client/models/collectors_api_v1_status_retrieve_response_200_collectors_item_state.py @@ -2,8 +2,8 @@ class CollectorsApiV1StatusRetrieveResponse200CollectorsItemState(str, Enum): - PENDING = "PENDING" BLOCKED = "BLOCKED" + PENDING = "PENDING" READY = "READY" RUNNING = "RUNNING" diff --git a/osidb_bindings/bindings/python_client/models/collectors_healthy_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/collectors_healthy_retrieve_response_200.py index 8570429..015b127 100644 --- a/osidb_bindings/bindings/python_client/models/collectors_healthy_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/collectors_healthy_retrieve_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="CollectorsHealthyRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class CollectorsHealthyRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: collectors_healthy_retrieve_response_200.additional_properties = d return collectors_healthy_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/collectors_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/collectors_retrieve_response_200.py index a6f9dba..1278996 100644 --- a/osidb_bindings/bindings/python_client/models/collectors_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/collectors_retrieve_response_200.py @@ -1,55 +1,68 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="CollectorsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class CollectorsRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + index (Union[Unset, list[str]]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET - index: Union[Unset, List[str]] = UNSET + index: Union[Unset, list[str]] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env - index: Union[Unset, List[str]] = UNSET + + index: Union[Unset, list[str]] = UNSET if not isinstance(self.index, Unset): index = self.index revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(index, Unset): + if index is not UNSET: field_dict["index"] = index - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -60,7 +73,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: env = d.pop("env", UNSET) - index = cast(List[str], d.pop("index", UNSET)) + index = cast(list[str], d.pop("index", UNSET)) revision = d.pop("revision", UNSET) @@ -77,18 +90,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: collectors_retrieve_response_200.additional_properties = d return collectors_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "index": List[str], - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/comment.py b/osidb_bindings/bindings/python_client/models/comment.py index 01b4335..24bf79e 100644 --- a/osidb_bindings/bindings/python_client/models/comment.py +++ b/osidb_bindings/bindings/python_client/models/comment.py @@ -1,38 +1,62 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Comment") -@attr.s(auto_attribs=True) +@_attrs_define class Comment(OSIDBModel): - """FlawComment serializer for use by FlawSerializer""" - - uuid: str + """FlawComment serializer for use by FlawSerializer + + Attributes: + uuid (UUID): + text (str): + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + external_system_id (Union[Unset, str]): + order (Union[None, Unset, int]): + creator (Union[Unset, str]): + is_private (Union[Unset, bool]): + """ + + uuid: UUID text: str - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime external_system_id: Union[Unset, str] = UNSET - order: Union[Unset, None, int] = UNSET + order: Union[None, Unset, int] = UNSET creator: Union[Unset, str] = UNSET is_private: Union[Unset, bool] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid text = self.text - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -47,54 +71,65 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() external_system_id = self.external_system_id - order = self.order + + order: Union[None, Unset, int] + if isinstance(self.order, Unset): + order = UNSET + else: + order = self.order + creator = self.creator + is_private = self.is_private - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(text, Unset): + if text is not UNSET: field_dict["text"] = text - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(external_system_id, Unset): + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(order, Unset): + if order is not UNSET: field_dict["order"] = order - if not isinstance(creator, Unset): + if creator is not UNSET: field_dict["creator"] = creator - if not isinstance(is_private, Unset): + if is_private is not UNSET: field_dict["is_private"] = is_private return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) text = d.pop("text", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -112,7 +147,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: external_system_id = d.pop("external_system_id", UNSET) - order = d.pop("order", UNSET) + def _parse_order(data: object) -> Union[None, Unset, int]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, int], data) + + order = _parse_order(d.pop("order", UNSET)) creator = d.pop("creator", UNSET) @@ -133,22 +175,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: comment.additional_properties = d return comment - @staticmethod - def get_fields(): - return { - "uuid": str, - "text": str, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "external_system_id": str, - "order": int, - "creator": str, - "is_private": bool, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/epss.py b/osidb_bindings/bindings/python_client/models/epss.py index 2839a56..9b9b6ca 100644 --- a/osidb_bindings/bindings/python_client/models/epss.py +++ b/osidb_bindings/bindings/python_client/models/epss.py @@ -1,35 +1,42 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="EPSS") -@attr.s(auto_attribs=True) +@_attrs_define class EPSS(OSIDBModel): - """ """ + """ + Attributes: + cve (str): + epss (float): + """ cve: str epss: float - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: cve = self.cve + epss = self.epss - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cve, Unset): + if cve is not UNSET: field_dict["cve"] = cve - if not isinstance(epss, Unset): + if epss is not UNSET: field_dict["epss"] = epss return field_dict @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() cve = d.pop("cve", UNSET) @@ -43,15 +50,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: epss.additional_properties = d return epss - @staticmethod - def get_fields(): - return { - "cve": str, - "epss": float, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/erratum.py b/osidb_bindings/bindings/python_client/models/erratum.py index 5d94997..b40ec97 100644 --- a/osidb_bindings/bindings/python_client/models/erratum.py +++ b/osidb_bindings/bindings/python_client/models/erratum.py @@ -1,28 +1,52 @@ -import datetime -from typing import Any, Dict, List, Optional, Type, TypeVar +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Erratum") -@attr.s(auto_attribs=True) +@_attrs_define class Erratum(OSIDBModel): - """Erratum serializer""" + """Erratum serializer + + Attributes: + et_id (int): + advisory_name (str): + shipped_dt (Union[None, datetime.datetime]): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + """ et_id: int advisory_name: str + shipped_dt: Union[None, datetime.datetime] created_dt: datetime.datetime updated_dt: datetime.datetime - shipped_dt: Optional[datetime.datetime] - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: et_id = self.et_id + advisory_name = self.advisory_name + + shipped_dt: Union[None, str] + if isinstance(self.shipped_dt, datetime.datetime): + shipped_dt = UNSET + if not isinstance(self.shipped_dt, Unset): + shipped_dt = self.shipped_dt.isoformat() + + else: + shipped_dt = self.shipped_dt + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -31,32 +55,48 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - shipped_dt: Optional[str] = UNSET - if not isinstance(self.shipped_dt, Unset): - shipped_dt = self.shipped_dt.isoformat() if self.shipped_dt else None - - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(et_id, Unset): + if et_id is not UNSET: field_dict["et_id"] = et_id - if not isinstance(advisory_name, Unset): + if advisory_name is not UNSET: field_dict["advisory_name"] = advisory_name - if not isinstance(created_dt, Unset): + if shipped_dt is not UNSET: + field_dict["shipped_dt"] = shipped_dt + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(shipped_dt, Unset): - field_dict["shipped_dt"] = shipped_dt return field_dict @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() et_id = d.pop("et_id", UNSET) advisory_name = d.pop("advisory_name", UNSET) + def _parse_shipped_dt(data: object) -> Union[None, datetime.datetime]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + _shipped_dt_type_0 = data + shipped_dt_type_0: datetime.datetime + if isinstance(_shipped_dt_type_0, Unset): + shipped_dt_type_0 = UNSET + else: + shipped_dt_type_0 = isoparse(_shipped_dt_type_0) + + return shipped_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, datetime.datetime], data) + + shipped_dt = _parse_shipped_dt(d.pop("shipped_dt", UNSET)) + _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime if isinstance(_created_dt, Unset): @@ -71,38 +111,19 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - _shipped_dt = d.pop("shipped_dt", UNSET) - shipped_dt: Optional[datetime.datetime] - if _shipped_dt is None: - shipped_dt = None - elif isinstance(_shipped_dt, Unset): - shipped_dt = UNSET - else: - shipped_dt = isoparse(_shipped_dt) - erratum = cls( et_id=et_id, advisory_name=advisory_name, + shipped_dt=shipped_dt, created_dt=created_dt, updated_dt=updated_dt, - shipped_dt=shipped_dt, ) erratum.additional_properties = d return erratum - @staticmethod - def get_fields(): - return { - "et_id": int, - "advisory_name": str, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "shipped_dt": datetime.datetime, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploit_only_report_data.py b/osidb_bindings/bindings/python_client/models/exploit_only_report_data.py index 148efc3..e0765b0 100644 --- a/osidb_bindings/bindings/python_client/models/exploit_only_report_data.py +++ b/osidb_bindings/bindings/python_client/models/exploit_only_report_data.py @@ -1,70 +1,87 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.exploit_only_report_data_source_enum import ( - ExploitOnlyReportDataSourceEnum, -) +from ..models.exploit_only_report_data_source_enum import ExploitOnlyReportDataSourceEnum from ..models.maturity_preliminary_enum import MaturityPreliminaryEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +import datetime + T = TypeVar("T", bound="ExploitOnlyReportData") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitOnlyReportData(OSIDBModel): - """ """ + """ + Attributes: + cve (str): + source (ExploitOnlyReportDataSourceEnum): + maturity_preliminary (MaturityPreliminaryEnum): + flaw (bool): + date (Union[None, Unset, datetime.date]): + reference (Union[Unset, str]): Default: 'N/A'. + """ cve: str source: ExploitOnlyReportDataSourceEnum maturity_preliminary: MaturityPreliminaryEnum flaw: bool - date: Union[Unset, None, datetime.date] = UNSET + date: Union[None, Unset, datetime.date] = UNSET reference: Union[Unset, str] = "N/A" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: cve = self.cve + + print(ExploitOnlyReportDataSourceEnum) source: str = UNSET if not isinstance(self.source, Unset): + source = self.source.value - source = ExploitOnlyReportDataSourceEnum(self.source).value - + print(MaturityPreliminaryEnum) maturity_preliminary: int = UNSET if not isinstance(self.maturity_preliminary, Unset): - - maturity_preliminary = MaturityPreliminaryEnum( - self.maturity_preliminary - ).value + maturity_preliminary = self.maturity_preliminary.value flaw = self.flaw - date: Union[Unset, None, str] = UNSET - if not isinstance(self.date, Unset): - date = self.date.isoformat() if self.date else None + + date: Union[None, Unset, str] + if isinstance(self.date, Unset): + date = UNSET + elif isinstance(self.date, datetime.date): + date = UNSET + if not isinstance(self.date, Unset): + date = self.date.isoformat() + + else: + date = self.date reference = self.reference - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cve, Unset): + if cve is not UNSET: field_dict["cve"] = cve - if not isinstance(source, Unset): + if source is not UNSET: field_dict["source"] = source - if not isinstance(maturity_preliminary, Unset): + if maturity_preliminary is not UNSET: field_dict["maturity_preliminary"] = maturity_preliminary - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(date, Unset): + if date is not UNSET: field_dict["date"] = date - if not isinstance(reference, Unset): + if reference is not UNSET: field_dict["reference"] = reference return field_dict @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() cve = d.pop("cve", UNSET) @@ -84,14 +101,27 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw = d.pop("flaw", UNSET) - _date = d.pop("date", UNSET) - date: Union[Unset, None, datetime.date] - if _date is None: - date = None - elif isinstance(_date, Unset): - date = UNSET - else: - date = isoparse(_date).date() + def _parse_date(data: object) -> Union[None, Unset, datetime.date]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _date_type_0 = data + date_type_0: datetime.date + if isinstance(_date_type_0, Unset): + date_type_0 = UNSET + else: + date_type_0 = isoparse(_date_type_0).date() + + return date_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.date], data) + + date = _parse_date(d.pop("date", UNSET)) reference = d.pop("reference", UNSET) @@ -107,19 +137,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploit_only_report_data.additional_properties = d return exploit_only_report_data - @staticmethod - def get_fields(): - return { - "cve": str, - "source": ExploitOnlyReportDataSourceEnum, - "maturity_preliminary": MaturityPreliminaryEnum, - "flaw": bool, - "date": datetime.date, - "reference": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploit_only_report_data_source_enum.py b/osidb_bindings/bindings/python_client/models/exploit_only_report_data_source_enum.py index f69d1a3..544cbe0 100644 --- a/osidb_bindings/bindings/python_client/models/exploit_only_report_data_source_enum.py +++ b/osidb_bindings/bindings/python_client/models/exploit_only_report_data_source_enum.py @@ -3,8 +3,8 @@ class ExploitOnlyReportDataSourceEnum(str, Enum): CISA = "CISA" - METASPLOIT = "Metasploit" EXPLOIT_DB = "Exploit-DB" + METASPLOIT = "Metasploit" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_collect_update_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_collect_update_response_200.py index 37ee758..4839fc8 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_collect_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_collect_update_response_200.py @@ -1,52 +1,65 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1CollectUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1CollectUpdateResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + result_cisa (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET result_cisa: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + result_cisa = self.result_cisa + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(result_cisa, Unset): + if result_cisa is not UNSET: field_dict["result_cisa"] = result_cisa - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -74,18 +87,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_collect_update_response_200.additional_properties = d return exploits_api_v1_collect_update_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "result_cisa": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_cve_map_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_cve_map_retrieve_response_200.py index aeaf809..fe310ef 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_cve_map_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_cve_map_retrieve_response_200.py @@ -1,31 +1,42 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.exploits_api_v1_cve_map_retrieve_response_200_cves import ExploitsApiV1CveMapRetrieveResponse200Cves -from ..models.exploits_api_v1_cve_map_retrieve_response_200_cves import ( - ExploitsApiV1CveMapRetrieveResponse200Cves, -) -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1CveMapRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1CveMapRetrieveResponse200(OSIDBModel): - """ """ - - cves: Union[Unset, ExploitsApiV1CveMapRetrieveResponse200Cves] = UNSET + """ + Attributes: + cves (Union[Unset, ExploitsApiV1CveMapRetrieveResponse200Cves]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + page_size (Union[Unset, int]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + cves: Union[Unset, "ExploitsApiV1CveMapRetrieveResponse200Cves"] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET page_size: Union[Unset, int] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - cves: Union[Unset, Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + cves: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.cves, Unset): cves = self.cves.to_dict() @@ -34,29 +45,36 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + page_size = self.page_size + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cves, Unset): + if cves is not UNSET: field_dict["cves"] = cves - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(page_size, Unset): + if page_size is not UNSET: field_dict["page_size"] = page_size - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.exploits_api_v1_cve_map_retrieve_response_200_cves import ( + ExploitsApiV1CveMapRetrieveResponse200Cves, + ) + d = src_dict.copy() _cves = d.pop("cves", UNSET) cves: Union[Unset, ExploitsApiV1CveMapRetrieveResponse200Cves] @@ -92,19 +110,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_cve_map_retrieve_response_200.additional_properties = d return exploits_api_v1_cve_map_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "cves": ExploitsApiV1CveMapRetrieveResponse200Cves, - "dt": datetime.datetime, - "env": str, - "page_size": int, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_cve_map_retrieve_response_200_cves.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_cve_map_retrieve_response_200_cves.py index 7d1ccb8..4dc9ffe 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_cve_map_retrieve_response_200_cves.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_cve_map_retrieve_response_200_cves.py @@ -1,39 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field from ..types import OSIDBModel + T = TypeVar("T", bound="ExploitsApiV1CveMapRetrieveResponse200Cves") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1CveMapRetrieveResponse200Cves(OSIDBModel): """ """ - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) return field_dict @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() exploits_api_v1_cve_map_retrieve_response_200_cves = cls() exploits_api_v1_cve_map_retrieve_response_200_cves.additional_properties = d return exploits_api_v1_cve_map_retrieve_response_200_cves - @staticmethod - def get_fields(): - return {} - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_epss_list_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_epss_list_response_200.py index f274f7e..bba08c3 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_epss_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_epss_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.epss import EPSS -from ..models.epss import EPSS -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1EpssListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1EpssListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['EPSS']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[EPSS] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["EPSS"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.epss import EPSS + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: EPSS - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = EPSS.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: EPSS + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = EPSS.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_epss_list_response_200.additional_properties = d return exploits_api_v1_epss_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[EPSS], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_flaw_data_list_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_flaw_data_list_response_200.py index 7fdcd55..42ffa60 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_flaw_data_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_flaw_data_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.flaw_report_data import FlawReportData -from ..models.flaw_report_data import FlawReportData -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1FlawDataListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1FlawDataListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawReportData']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[FlawReportData] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["FlawReportData"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_report_data import FlawReportData + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawReportData - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawReportData.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawReportData + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawReportData.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_flaw_data_list_response_200.additional_properties = d return exploits_api_v1_flaw_data_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawReportData], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_data_list_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_data_list_response_200.py index 8410479..e1d6a7a 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_data_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_data_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.exploit_only_report_data import ExploitOnlyReportData -from ..models.exploit_only_report_data import ExploitOnlyReportData -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1ReportDataListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1ReportDataListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['ExploitOnlyReportData']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[ExploitOnlyReportData] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["ExploitOnlyReportData"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.exploit_only_report_data import ExploitOnlyReportData + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: ExploitOnlyReportData - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = ExploitOnlyReportData.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: ExploitOnlyReportData + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = ExploitOnlyReportData.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_report_data_list_response_200.additional_properties = d return exploits_api_v1_report_data_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[ExploitOnlyReportData], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200.py index 5fc5a3b..58346ac 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200.py @@ -1,127 +1,148 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.exploits_api_v1_report_date_retrieve_response_200_not_relevant_item import ( + ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem, + ) + from ..models.exploits_api_v1_report_date_retrieve_response_200_action_required_item import ( + ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem, + ) + from ..models.exploits_api_v1_report_date_retrieve_response_200_no_action_item import ( + ExploitsApiV1ReportDateRetrieveResponse200NoActionItem, + ) -from ..models.exploits_api_v1_report_date_retrieve_response_200_action_required_item import ( - ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem, -) -from ..models.exploits_api_v1_report_date_retrieve_response_200_no_action_item import ( - ExploitsApiV1ReportDateRetrieveResponse200NoActionItem, -) -from ..models.exploits_api_v1_report_date_retrieve_response_200_not_relevant_item import ( - ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem, -) -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1ReportDateRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1ReportDateRetrieveResponse200(OSIDBModel): - """ """ - - action_required: Union[ - Unset, List[ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem] - ] = UNSET + """ + Attributes: + action_required (Union[Unset, list['ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem']]): + cutoff_date (Union[Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + evaluated_cves (Union[Unset, int]): + no_action (Union[Unset, list['ExploitsApiV1ReportDateRetrieveResponse200NoActionItem']]): + not_relevant (Union[Unset, list['ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem']]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + action_required: Union[Unset, list["ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem"]] = UNSET cutoff_date: Union[Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET evaluated_cves: Union[Unset, int] = UNSET - no_action: Union[ - Unset, List[ExploitsApiV1ReportDateRetrieveResponse200NoActionItem] - ] = UNSET - not_relevant: Union[ - Unset, List[ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem] - ] = UNSET + no_action: Union[Unset, list["ExploitsApiV1ReportDateRetrieveResponse200NoActionItem"]] = UNSET + not_relevant: Union[Unset, list["ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem"]] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - action_required: Union[Unset, List[Dict[str, Any]]] = UNSET + def to_dict(self) -> dict[str, Any]: + action_required: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.action_required, Unset): action_required = [] for action_required_item_data in self.action_required: - action_required_item: Dict[str, Any] = UNSET + action_required_item: dict[str, Any] = UNSET if not isinstance(action_required_item_data, Unset): action_required_item = action_required_item_data.to_dict() action_required.append(action_required_item) cutoff_date = self.cutoff_date + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + evaluated_cves = self.evaluated_cves - no_action: Union[Unset, List[Dict[str, Any]]] = UNSET + + no_action: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.no_action, Unset): no_action = [] for no_action_item_data in self.no_action: - no_action_item: Dict[str, Any] = UNSET + no_action_item: dict[str, Any] = UNSET if not isinstance(no_action_item_data, Unset): no_action_item = no_action_item_data.to_dict() no_action.append(no_action_item) - not_relevant: Union[Unset, List[Dict[str, Any]]] = UNSET + not_relevant: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.not_relevant, Unset): not_relevant = [] for not_relevant_item_data in self.not_relevant: - not_relevant_item: Dict[str, Any] = UNSET + not_relevant_item: dict[str, Any] = UNSET if not isinstance(not_relevant_item_data, Unset): not_relevant_item = not_relevant_item_data.to_dict() not_relevant.append(not_relevant_item) revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(action_required, Unset): + if action_required is not UNSET: field_dict["action_required"] = action_required - if not isinstance(cutoff_date, Unset): + if cutoff_date is not UNSET: field_dict["cutoff_date"] = cutoff_date - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(evaluated_cves, Unset): + if evaluated_cves is not UNSET: field_dict["evaluated_cves"] = evaluated_cves - if not isinstance(no_action, Unset): + if no_action is not UNSET: field_dict["no_action"] = no_action - if not isinstance(not_relevant, Unset): + if not_relevant is not UNSET: field_dict["not_relevant"] = not_relevant - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.exploits_api_v1_report_date_retrieve_response_200_not_relevant_item import ( + ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem, + ) + from ..models.exploits_api_v1_report_date_retrieve_response_200_action_required_item import ( + ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem, + ) + from ..models.exploits_api_v1_report_date_retrieve_response_200_no_action_item import ( + ExploitsApiV1ReportDateRetrieveResponse200NoActionItem, + ) + d = src_dict.copy() action_required = [] _action_required = d.pop("action_required", UNSET) - if _action_required is UNSET: - action_required = UNSET - else: - for action_required_item_data in _action_required or []: - _action_required_item = action_required_item_data - action_required_item: ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem - if isinstance(_action_required_item, Unset): - action_required_item = UNSET - else: - action_required_item = ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem.from_dict( - _action_required_item - ) - - action_required.append(action_required_item) + for action_required_item_data in _action_required or []: + _action_required_item = action_required_item_data + action_required_item: ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem + if isinstance(_action_required_item, Unset): + action_required_item = UNSET + else: + action_required_item = ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem.from_dict( + _action_required_item + ) + + action_required.append(action_required_item) cutoff_date = d.pop("cutoff_date", UNSET) @@ -138,37 +159,29 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: no_action = [] _no_action = d.pop("no_action", UNSET) - if _no_action is UNSET: - no_action = UNSET - else: - for no_action_item_data in _no_action or []: - _no_action_item = no_action_item_data - no_action_item: ExploitsApiV1ReportDateRetrieveResponse200NoActionItem - if isinstance(_no_action_item, Unset): - no_action_item = UNSET - else: - no_action_item = ExploitsApiV1ReportDateRetrieveResponse200NoActionItem.from_dict( - _no_action_item - ) + for no_action_item_data in _no_action or []: + _no_action_item = no_action_item_data + no_action_item: ExploitsApiV1ReportDateRetrieveResponse200NoActionItem + if isinstance(_no_action_item, Unset): + no_action_item = UNSET + else: + no_action_item = ExploitsApiV1ReportDateRetrieveResponse200NoActionItem.from_dict(_no_action_item) - no_action.append(no_action_item) + no_action.append(no_action_item) not_relevant = [] _not_relevant = d.pop("not_relevant", UNSET) - if _not_relevant is UNSET: - not_relevant = UNSET - else: - for not_relevant_item_data in _not_relevant or []: - _not_relevant_item = not_relevant_item_data - not_relevant_item: ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem - if isinstance(_not_relevant_item, Unset): - not_relevant_item = UNSET - else: - not_relevant_item = ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem.from_dict( - _not_relevant_item - ) - - not_relevant.append(not_relevant_item) + for not_relevant_item_data in _not_relevant or []: + _not_relevant_item = not_relevant_item_data + not_relevant_item: ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem + if isinstance(_not_relevant_item, Unset): + not_relevant_item = UNSET + else: + not_relevant_item = ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem.from_dict( + _not_relevant_item + ) + + not_relevant.append(not_relevant_item) revision = d.pop("revision", UNSET) @@ -189,26 +202,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_report_date_retrieve_response_200.additional_properties = d return exploits_api_v1_report_date_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "action_required": List[ - ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem - ], - "cutoff_date": str, - "dt": datetime.datetime, - "env": str, - "evaluated_cves": int, - "no_action": List[ExploitsApiV1ReportDateRetrieveResponse200NoActionItem], - "not_relevant": List[ - ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem - ], - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_action_required_item.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_action_required_item.py index a677fcd..f1bee8f 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_action_required_item.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_action_required_item.py @@ -1,41 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field from ..types import OSIDBModel + T = TypeVar("T", bound="ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1ReportDateRetrieveResponse200ActionRequiredItem(OSIDBModel): """ """ - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) return field_dict @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() exploits_api_v1_report_date_retrieve_response_200_action_required_item = cls() - exploits_api_v1_report_date_retrieve_response_200_action_required_item.additional_properties = ( - d - ) + exploits_api_v1_report_date_retrieve_response_200_action_required_item.additional_properties = d return exploits_api_v1_report_date_retrieve_response_200_action_required_item - @staticmethod - def get_fields(): - return {} - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_no_action_item.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_no_action_item.py index 0665adb..0d4f764 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_no_action_item.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_no_action_item.py @@ -1,41 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field from ..types import OSIDBModel + T = TypeVar("T", bound="ExploitsApiV1ReportDateRetrieveResponse200NoActionItem") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1ReportDateRetrieveResponse200NoActionItem(OSIDBModel): """ """ - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) return field_dict @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() exploits_api_v1_report_date_retrieve_response_200_no_action_item = cls() - exploits_api_v1_report_date_retrieve_response_200_no_action_item.additional_properties = ( - d - ) + exploits_api_v1_report_date_retrieve_response_200_no_action_item.additional_properties = d return exploits_api_v1_report_date_retrieve_response_200_no_action_item - @staticmethod - def get_fields(): - return {} - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_not_relevant_item.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_not_relevant_item.py index 6a54ca6..92e4013 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_not_relevant_item.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_date_retrieve_response_200_not_relevant_item.py @@ -1,41 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field from ..types import OSIDBModel + T = TypeVar("T", bound="ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1ReportDateRetrieveResponse200NotRelevantItem(OSIDBModel): """ """ - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) return field_dict @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() exploits_api_v1_report_date_retrieve_response_200_not_relevant_item = cls() - exploits_api_v1_report_date_retrieve_response_200_not_relevant_item.additional_properties = ( - d - ) + exploits_api_v1_report_date_retrieve_response_200_not_relevant_item.additional_properties = d return exploits_api_v1_report_date_retrieve_response_200_not_relevant_item - @staticmethod - def get_fields(): - return {} - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_explanations_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_explanations_retrieve_response_200.py index 4e57c1f..c75dd89 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_explanations_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_explanations_retrieve_response_200.py @@ -1,70 +1,88 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.exploits_api_v1_report_explanations_retrieve_response_200_explanations_item import ( + ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem, + ) -from ..models.exploits_api_v1_report_explanations_retrieve_response_200_explanations_item import ( - ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem, -) -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1ReportExplanationsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1ReportExplanationsRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + explanations (Union[Unset, list['ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem']]): + page_size (Union[Unset, int]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET - explanations: Union[ - Unset, List[ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem] - ] = UNSET + explanations: Union[Unset, list["ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem"]] = UNSET page_size: Union[Unset, int] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env - explanations: Union[Unset, List[Dict[str, Any]]] = UNSET + + explanations: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.explanations, Unset): explanations = [] for explanations_item_data in self.explanations: - explanations_item: Dict[str, Any] = UNSET + explanations_item: dict[str, Any] = UNSET if not isinstance(explanations_item_data, Unset): explanations_item = explanations_item_data.to_dict() explanations.append(explanations_item) page_size = self.page_size + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(explanations, Unset): + if explanations is not UNSET: field_dict["explanations"] = explanations - if not isinstance(page_size, Unset): + if page_size is not UNSET: field_dict["page_size"] = page_size - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.exploits_api_v1_report_explanations_retrieve_response_200_explanations_item import ( + ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem, + ) + d = src_dict.copy() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -77,20 +95,17 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: explanations = [] _explanations = d.pop("explanations", UNSET) - if _explanations is UNSET: - explanations = UNSET - else: - for explanations_item_data in _explanations or []: - _explanations_item = explanations_item_data - explanations_item: ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem - if isinstance(_explanations_item, Unset): - explanations_item = UNSET - else: - explanations_item = ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem.from_dict( - _explanations_item - ) - - explanations.append(explanations_item) + for explanations_item_data in _explanations or []: + _explanations_item = explanations_item_data + explanations_item: ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem + if isinstance(_explanations_item, Unset): + explanations_item = UNSET + else: + explanations_item = ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem.from_dict( + _explanations_item + ) + + explanations.append(explanations_item) page_size = d.pop("page_size", UNSET) @@ -107,26 +122,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version=version, ) - exploits_api_v1_report_explanations_retrieve_response_200.additional_properties = ( - d - ) + exploits_api_v1_report_explanations_retrieve_response_200.additional_properties = d return exploits_api_v1_report_explanations_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "explanations": List[ - ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem - ], - "page_size": int, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_explanations_retrieve_response_200_explanations_item.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_explanations_retrieve_response_200_explanations_item.py index 55e16ab..537ef64 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_explanations_retrieve_response_200_explanations_item.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_explanations_retrieve_response_200_explanations_item.py @@ -1,47 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field from ..types import OSIDBModel -T = TypeVar( - "T", bound="ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem" -) +T = TypeVar("T", bound="ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem") -@attr.s(auto_attribs=True) + +@_attrs_define class ExploitsApiV1ReportExplanationsRetrieveResponse200ExplanationsItem(OSIDBModel): """ """ - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) return field_dict @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() - exploits_api_v1_report_explanations_retrieve_response_200_explanations_item = ( - cls() - ) - - exploits_api_v1_report_explanations_retrieve_response_200_explanations_item.additional_properties = ( - d - ) - return ( - exploits_api_v1_report_explanations_retrieve_response_200_explanations_item - ) + exploits_api_v1_report_explanations_retrieve_response_200_explanations_item = cls() - @staticmethod - def get_fields(): - return {} + exploits_api_v1_report_explanations_retrieve_response_200_explanations_item.additional_properties = d + return exploits_api_v1_report_explanations_retrieve_response_200_explanations_item @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_pending_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_pending_retrieve_response_200.py index 5f14d69..e0922bc 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_pending_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_pending_retrieve_response_200.py @@ -1,70 +1,88 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item import ( + ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem, + ) -from ..models.exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item import ( - ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem, -) -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1ReportPendingRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1ReportPendingRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + pending_actions (Union[Unset, list['ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem']]): + pending_actions_count (Union[Unset, int]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET - pending_actions: Union[ - Unset, List[ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem] - ] = UNSET + pending_actions: Union[Unset, list["ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem"]] = UNSET pending_actions_count: Union[Unset, int] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env - pending_actions: Union[Unset, List[Dict[str, Any]]] = UNSET + + pending_actions: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.pending_actions, Unset): pending_actions = [] for pending_actions_item_data in self.pending_actions: - pending_actions_item: Dict[str, Any] = UNSET + pending_actions_item: dict[str, Any] = UNSET if not isinstance(pending_actions_item_data, Unset): pending_actions_item = pending_actions_item_data.to_dict() pending_actions.append(pending_actions_item) pending_actions_count = self.pending_actions_count + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(pending_actions, Unset): + if pending_actions is not UNSET: field_dict["pending_actions"] = pending_actions - if not isinstance(pending_actions_count, Unset): + if pending_actions_count is not UNSET: field_dict["pending_actions_count"] = pending_actions_count - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item import ( + ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem, + ) + d = src_dict.copy() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -77,20 +95,17 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: pending_actions = [] _pending_actions = d.pop("pending_actions", UNSET) - if _pending_actions is UNSET: - pending_actions = UNSET - else: - for pending_actions_item_data in _pending_actions or []: - _pending_actions_item = pending_actions_item_data - pending_actions_item: ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem - if isinstance(_pending_actions_item, Unset): - pending_actions_item = UNSET - else: - pending_actions_item = ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem.from_dict( - _pending_actions_item - ) - - pending_actions.append(pending_actions_item) + for pending_actions_item_data in _pending_actions or []: + _pending_actions_item = pending_actions_item_data + pending_actions_item: ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem + if isinstance(_pending_actions_item, Unset): + pending_actions_item = UNSET + else: + pending_actions_item = ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem.from_dict( + _pending_actions_item + ) + + pending_actions.append(pending_actions_item) pending_actions_count = d.pop("pending_actions_count", UNSET) @@ -110,21 +125,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_report_pending_retrieve_response_200.additional_properties = d return exploits_api_v1_report_pending_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "pending_actions": List[ - ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem - ], - "pending_actions_count": int, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item.py index e619cdc..9f471a4 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item.py @@ -1,45 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field from ..types import OSIDBModel -T = TypeVar( - "T", bound="ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem" -) +T = TypeVar("T", bound="ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem") -@attr.s(auto_attribs=True) + +@_attrs_define class ExploitsApiV1ReportPendingRetrieveResponse200PendingActionsItem(OSIDBModel): """ """ - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) return field_dict @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() - exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item = ( - cls() - ) + exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item = cls() - exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item.additional_properties = ( - d - ) + exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item.additional_properties = d return exploits_api_v1_report_pending_retrieve_response_200_pending_actions_item - @staticmethod - def get_fields(): - return {} - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_status_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_status_retrieve_response_200.py index 9077b17..284928d 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_status_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_status_retrieve_response_200.py @@ -1,17 +1,29 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1StatusRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1StatusRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + exploits_count (Union[Unset, int]): + exploits_count_relevant (Union[Unset, int]): + last_exploit (Union[Unset, int]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET @@ -20,41 +32,46 @@ class ExploitsApiV1StatusRetrieveResponse200(OSIDBModel): last_exploit: Union[Unset, int] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + exploits_count = self.exploits_count + exploits_count_relevant = self.exploits_count_relevant + last_exploit = self.last_exploit + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(exploits_count, Unset): + if exploits_count is not UNSET: field_dict["exploits_count"] = exploits_count - if not isinstance(exploits_count_relevant, Unset): + if exploits_count_relevant is not UNSET: field_dict["exploits_count_relevant"] = exploits_count_relevant - if not isinstance(last_exploit, Unset): + if last_exploit is not UNSET: field_dict["last_exploit"] = last_exploit - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -88,20 +105,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_status_retrieve_response_200.additional_properties = d return exploits_api_v1_status_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "exploits_count": int, - "exploits_count_relevant": int, - "last_exploit": int, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/exploits_api_v1_supported_products_list_response_200.py b/osidb_bindings/bindings/python_client/models/exploits_api_v1_supported_products_list_response_200.py index 16c620e..9676892 100644 --- a/osidb_bindings/bindings/python_client/models/exploits_api_v1_supported_products_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/exploits_api_v1_supported_products_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.supported_products import SupportedProducts -from ..models.supported_products import SupportedProducts -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ExploitsApiV1SupportedProductsListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class ExploitsApiV1SupportedProductsListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['SupportedProducts']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[SupportedProducts] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["SupportedProducts"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.supported_products import SupportedProducts + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: SupportedProducts - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = SupportedProducts.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: SupportedProducts + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = SupportedProducts.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: exploits_api_v1_supported_products_list_response_200.additional_properties = d return exploits_api_v1_supported_products_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[SupportedProducts], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw.py b/osidb_bindings/bindings/python_client/models/flaw.py index c6a6817..f521e03 100644 --- a/osidb_bindings/bindings/python_client/models/flaw.py +++ b/osidb_bindings/bindings/python_client/models/flaw.py @@ -1,139 +1,188 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union, cast -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect import Affect -from ..models.alert import Alert from ..models.blank_enum import BlankEnum -from ..models.comment import Comment -from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..models.flaw_classification import FlawClassification -from ..models.flaw_cvss import FlawCVSS -from ..models.flaw_reference import FlawReference from ..models.impact_enum import ImpactEnum from ..models.major_incident_state_enum import MajorIncidentStateEnum from ..models.nist_cvss_validation_enum import NistCvssValidationEnum -from ..models.package import Package from ..models.requires_cve_description_enum import RequiresCveDescriptionEnum from ..models.source_be_0_enum import SourceBe0Enum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.flaw_classification import FlawClassification + from ..models.package import Package + from ..models.alert import Alert + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_reference import FlawReference + T = TypeVar("T", bound="Flaw") -@attr.s(auto_attribs=True) +@_attrs_define class Flaw(OSIDBModel): - """serialize flaw model""" - - uuid: str + """serialize flaw model + + Attributes: + uuid (UUID): + title (str): + trackers (list[str]): + comment_zero (str): + affects (list['Affect']): + comments (list['Comment']): + package_versions (list['Package']): + acknowledgments (list['FlawAcknowledgment']): + references (list['FlawReference']): + cvss_scores (list['FlawCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + classification (FlawClassification): + alerts (list['Alert']): + cve_id (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + components (Union[Unset, list[str]]): + cve_description (Union[Unset, str]): + requires_cve_description (Union[BlankEnum, RequiresCveDescriptionEnum, Unset]): + statement (Union[Unset, str]): + cwe_id (Union[Unset, str]): + unembargo_dt (Union[None, Unset, datetime.datetime]): + source (Union[BlankEnum, SourceBe0Enum, Unset]): + reported_dt (Union[None, Unset, datetime.datetime]): + mitigation (Union[Unset, str]): + major_incident_state (Union[BlankEnum, MajorIncidentStateEnum, Unset]): + major_incident_start_dt (Union[None, Unset, datetime.datetime]): + nist_cvss_validation (Union[BlankEnum, NistCvssValidationEnum, Unset]): + group_key (Union[Unset, str]): + owner (Union[Unset, str]): + task_key (Union[Unset, str]): + team_id (Union[Unset, str]): + """ + + uuid: UUID title: str - trackers: List[str] + trackers: list[str] comment_zero: str - affects: List[Affect] - comments: List[Comment] - package_versions: List[Package] - acknowledgments: List[FlawAcknowledgment] - references: List[FlawReference] - cvss_scores: List[FlawCVSS] + affects: list["Affect"] + comments: list["Comment"] + package_versions: list["Package"] + acknowledgments: list["FlawAcknowledgment"] + references: list["FlawReference"] + cvss_scores: list["FlawCVSS"] embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime - classification: FlawClassification - alerts: List[Alert] - cve_id: Union[Unset, None, str] = UNSET + classification: "FlawClassification" + alerts: list["Alert"] + cve_id: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET cve_description: Union[Unset, str] = UNSET - requires_cve_description: Union[ - BlankEnum, RequiresCveDescriptionEnum, Unset - ] = UNSET + requires_cve_description: Union[BlankEnum, RequiresCveDescriptionEnum, Unset] = UNSET statement: Union[Unset, str] = UNSET cwe_id: Union[Unset, str] = UNSET - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET + unembargo_dt: Union[None, Unset, datetime.datetime] = UNSET source: Union[BlankEnum, SourceBe0Enum, Unset] = UNSET - reported_dt: Union[Unset, None, datetime.datetime] = UNSET + reported_dt: Union[None, Unset, datetime.datetime] = UNSET mitigation: Union[Unset, str] = UNSET major_incident_state: Union[BlankEnum, MajorIncidentStateEnum, Unset] = UNSET - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET + major_incident_start_dt: Union[None, Unset, datetime.datetime] = UNSET nist_cvss_validation: Union[BlankEnum, NistCvssValidationEnum, Unset] = UNSET group_key: Union[Unset, str] = UNSET owner: Union[Unset, str] = UNSET task_key: Union[Unset, str] = UNSET team_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid title = self.title - trackers: List[str] = UNSET + + trackers: list[str] = UNSET if not isinstance(self.trackers, Unset): trackers = self.trackers comment_zero = self.comment_zero - affects: List[Dict[str, Any]] = UNSET + + affects: list[dict[str, Any]] = UNSET if not isinstance(self.affects, Unset): affects = [] for affects_item_data in self.affects: - affects_item: Dict[str, Any] = UNSET + affects_item: dict[str, Any] = UNSET if not isinstance(affects_item_data, Unset): affects_item = affects_item_data.to_dict() affects.append(affects_item) - comments: List[Dict[str, Any]] = UNSET + comments: list[dict[str, Any]] = UNSET if not isinstance(self.comments, Unset): comments = [] for comments_item_data in self.comments: - comments_item: Dict[str, Any] = UNSET + comments_item: dict[str, Any] = UNSET if not isinstance(comments_item_data, Unset): comments_item = comments_item_data.to_dict() comments.append(comments_item) - package_versions: List[Dict[str, Any]] = UNSET + package_versions: list[dict[str, Any]] = UNSET if not isinstance(self.package_versions, Unset): package_versions = [] for package_versions_item_data in self.package_versions: - package_versions_item: Dict[str, Any] = UNSET + package_versions_item: dict[str, Any] = UNSET if not isinstance(package_versions_item_data, Unset): package_versions_item = package_versions_item_data.to_dict() package_versions.append(package_versions_item) - acknowledgments: List[Dict[str, Any]] = UNSET + acknowledgments: list[dict[str, Any]] = UNSET if not isinstance(self.acknowledgments, Unset): acknowledgments = [] for acknowledgments_item_data in self.acknowledgments: - acknowledgments_item: Dict[str, Any] = UNSET + acknowledgments_item: dict[str, Any] = UNSET if not isinstance(acknowledgments_item_data, Unset): acknowledgments_item = acknowledgments_item_data.to_dict() acknowledgments.append(acknowledgments_item) - references: List[Dict[str, Any]] = UNSET + references: list[dict[str, Any]] = UNSET if not isinstance(self.references, Unset): references = [] for references_item_data in self.references: - references_item: Dict[str, Any] = UNSET + references_item: dict[str, Any] = UNSET if not isinstance(references_item_data, Unset): references_item = references_item_data.to_dict() references.append(references_item) - cvss_scores: List[Dict[str, Any]] = UNSET + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -142,651 +191,641 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - classification: Dict[str, Any] = UNSET + classification: dict[str, Any] = UNSET if not isinstance(self.classification, Unset): classification = self.classification.to_dict() - alerts: List[Dict[str, Any]] = UNSET + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() alerts.append(alerts_item) - cve_id = self.cve_id + cve_id: Union[None, Unset, str] + if isinstance(self.cve_id, Unset): + cve_id = UNSET + else: + cve_id = self.cve_id + impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value - - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET if not isinstance(self.components, Unset): components = self.components cve_description = self.cve_description + requires_cve_description: Union[Unset, str] if isinstance(self.requires_cve_description, Unset): requires_cve_description = UNSET elif isinstance(self.requires_cve_description, RequiresCveDescriptionEnum): + print(RequiresCveDescriptionEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = RequiresCveDescriptionEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value else: + print(BlankEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = BlankEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value statement = self.statement + cwe_id = self.cwe_id - unembargo_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.unembargo_dt, Unset): - unembargo_dt = self.unembargo_dt.isoformat() if self.unembargo_dt else None + + unembargo_dt: Union[None, Unset, str] + if isinstance(self.unembargo_dt, Unset): + unembargo_dt = UNSET + elif isinstance(self.unembargo_dt, datetime.datetime): + unembargo_dt = UNSET + if not isinstance(self.unembargo_dt, Unset): + unembargo_dt = self.unembargo_dt.isoformat() + + else: + unembargo_dt = self.unembargo_dt source: Union[Unset, str] if isinstance(self.source, Unset): source = UNSET elif isinstance(self.source, SourceBe0Enum): + print(SourceBe0Enum) source = UNSET if not isinstance(self.source, Unset): - - source = SourceBe0Enum(self.source).value + source = self.source.value else: + print(BlankEnum) source = UNSET if not isinstance(self.source, Unset): + source = self.source.value - source = BlankEnum(self.source).value + reported_dt: Union[None, Unset, str] + if isinstance(self.reported_dt, Unset): + reported_dt = UNSET + elif isinstance(self.reported_dt, datetime.datetime): + reported_dt = UNSET + if not isinstance(self.reported_dt, Unset): + reported_dt = self.reported_dt.isoformat() - reported_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.reported_dt, Unset): - reported_dt = self.reported_dt.isoformat() if self.reported_dt else None + else: + reported_dt = self.reported_dt mitigation = self.mitigation + major_incident_state: Union[Unset, str] if isinstance(self.major_incident_state, Unset): major_incident_state = UNSET elif isinstance(self.major_incident_state, MajorIncidentStateEnum): + print(MajorIncidentStateEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): - - major_incident_state = MajorIncidentStateEnum( - self.major_incident_state - ).value + major_incident_state = self.major_incident_state.value else: + print(BlankEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): + major_incident_state = self.major_incident_state.value - major_incident_state = BlankEnum(self.major_incident_state).value + major_incident_start_dt: Union[None, Unset, str] + if isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = UNSET + elif isinstance(self.major_incident_start_dt, datetime.datetime): + major_incident_start_dt = UNSET + if not isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = self.major_incident_start_dt.isoformat() - major_incident_start_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.major_incident_start_dt, Unset): - major_incident_start_dt = ( - self.major_incident_start_dt.isoformat() - if self.major_incident_start_dt - else None - ) + else: + major_incident_start_dt = self.major_incident_start_dt nist_cvss_validation: Union[Unset, str] if isinstance(self.nist_cvss_validation, Unset): nist_cvss_validation = UNSET elif isinstance(self.nist_cvss_validation, NistCvssValidationEnum): + print(NistCvssValidationEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = NistCvssValidationEnum( - self.nist_cvss_validation - ).value + nist_cvss_validation = self.nist_cvss_validation.value else: + print(BlankEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = BlankEnum(self.nist_cvss_validation).value + nist_cvss_validation = self.nist_cvss_validation.value group_key = self.group_key + owner = self.owner + task_key = self.task_key + team_id = self.team_id - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(title, Unset): + if title is not UNSET: field_dict["title"] = title - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(comment_zero, Unset): + if comment_zero is not UNSET: field_dict["comment_zero"] = comment_zero - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(comments, Unset): + if comments is not UNSET: field_dict["comments"] = comments - if not isinstance(package_versions, Unset): + if package_versions is not UNSET: field_dict["package_versions"] = package_versions - if not isinstance(acknowledgments, Unset): + if acknowledgments is not UNSET: field_dict["acknowledgments"] = acknowledgments - if not isinstance(references, Unset): + if references is not UNSET: field_dict["references"] = references - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(classification, Unset): + if classification is not UNSET: field_dict["classification"] = classification - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(cve_id, Unset): + if cve_id is not UNSET: field_dict["cve_id"] = cve_id - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(components, Unset): + if components is not UNSET: field_dict["components"] = components - if not isinstance(cve_description, Unset): + if cve_description is not UNSET: field_dict["cve_description"] = cve_description - if not isinstance(requires_cve_description, Unset): + if requires_cve_description is not UNSET: field_dict["requires_cve_description"] = requires_cve_description - if not isinstance(statement, Unset): + if statement is not UNSET: field_dict["statement"] = statement - if not isinstance(cwe_id, Unset): + if cwe_id is not UNSET: field_dict["cwe_id"] = cwe_id - if not isinstance(unembargo_dt, Unset): + if unembargo_dt is not UNSET: field_dict["unembargo_dt"] = unembargo_dt - if not isinstance(source, Unset): + if source is not UNSET: field_dict["source"] = source - if not isinstance(reported_dt, Unset): + if reported_dt is not UNSET: field_dict["reported_dt"] = reported_dt - if not isinstance(mitigation, Unset): + if mitigation is not UNSET: field_dict["mitigation"] = mitigation - if not isinstance(major_incident_state, Unset): + if major_incident_state is not UNSET: field_dict["major_incident_state"] = major_incident_state - if not isinstance(major_incident_start_dt, Unset): + if major_incident_start_dt is not UNSET: field_dict["major_incident_start_dt"] = major_incident_start_dt - if not isinstance(nist_cvss_validation, Unset): + if nist_cvss_validation is not UNSET: field_dict["nist_cvss_validation"] = nist_cvss_validation - if not isinstance(group_key, Unset): + if group_key is not UNSET: field_dict["group_key"] = group_key - if not isinstance(owner, Unset): + if owner is not UNSET: field_dict["owner"] = owner - if not isinstance(task_key, Unset): + if task_key is not UNSET: field_dict["task_key"] = task_key - if not isinstance(team_id, Unset): + if team_id is not UNSET: field_dict["team_id"] = team_id return field_dict - def to_multipart(self) -> Dict[str, Any]: - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - title = ( - self.title if self.title is UNSET else (None, str(self.title), "text/plain") - ) - trackers: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + title = (None, str(self.title).encode(), "text/plain") + + trackers: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.trackers, Unset): _temp_trackers = self.trackers - trackers = (None, json.dumps(_temp_trackers), "application/json") + trackers = (None, json.dumps(_temp_trackers).encode(), "application/json") - comment_zero = ( - self.comment_zero - if self.comment_zero is UNSET - else (None, str(self.comment_zero), "text/plain") - ) - affects: Union[Unset, Tuple[None, str, str]] = UNSET + comment_zero = (None, str(self.comment_zero).encode(), "text/plain") + + affects: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.affects, Unset): _temp_affects = [] for affects_item_data in self.affects: - affects_item: Dict[str, Any] = UNSET + affects_item: dict[str, Any] = UNSET if not isinstance(affects_item_data, Unset): affects_item = affects_item_data.to_dict() _temp_affects.append(affects_item) - affects = (None, json.dumps(_temp_affects), "application/json") + affects = (None, json.dumps(_temp_affects).encode(), "application/json") - comments: Union[Unset, Tuple[None, str, str]] = UNSET + comments: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.comments, Unset): _temp_comments = [] for comments_item_data in self.comments: - comments_item: Dict[str, Any] = UNSET + comments_item: dict[str, Any] = UNSET if not isinstance(comments_item_data, Unset): comments_item = comments_item_data.to_dict() _temp_comments.append(comments_item) - comments = (None, json.dumps(_temp_comments), "application/json") + comments = (None, json.dumps(_temp_comments).encode(), "application/json") - package_versions: Union[Unset, Tuple[None, str, str]] = UNSET + package_versions: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.package_versions, Unset): _temp_package_versions = [] for package_versions_item_data in self.package_versions: - package_versions_item: Dict[str, Any] = UNSET + package_versions_item: dict[str, Any] = UNSET if not isinstance(package_versions_item_data, Unset): package_versions_item = package_versions_item_data.to_dict() _temp_package_versions.append(package_versions_item) - package_versions = ( - None, - json.dumps(_temp_package_versions), - "application/json", - ) + package_versions = (None, json.dumps(_temp_package_versions).encode(), "application/json") - acknowledgments: Union[Unset, Tuple[None, str, str]] = UNSET + acknowledgments: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.acknowledgments, Unset): _temp_acknowledgments = [] for acknowledgments_item_data in self.acknowledgments: - acknowledgments_item: Dict[str, Any] = UNSET + acknowledgments_item: dict[str, Any] = UNSET if not isinstance(acknowledgments_item_data, Unset): acknowledgments_item = acknowledgments_item_data.to_dict() _temp_acknowledgments.append(acknowledgments_item) - acknowledgments = ( - None, - json.dumps(_temp_acknowledgments), - "application/json", - ) + acknowledgments = (None, json.dumps(_temp_acknowledgments).encode(), "application/json") - references: Union[Unset, Tuple[None, str, str]] = UNSET + references: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.references, Unset): _temp_references = [] for references_item_data in self.references: - references_item: Dict[str, Any] = UNSET + references_item: dict[str, Any] = UNSET if not isinstance(references_item_data, Unset): references_item = references_item_data.to_dict() _temp_references.append(references_item) - references = (None, json.dumps(_temp_references), "application/json") + references = (None, json.dumps(_temp_references).encode(), "application/json") - cvss_scores: Union[Unset, Tuple[None, str, str]] = UNSET + cvss_scores: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.cvss_scores, Unset): _temp_cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() _temp_cvss_scores.append(cvss_scores_item) - cvss_scores = (None, json.dumps(_temp_cvss_scores), "application/json") + cvss_scores = (None, json.dumps(_temp_cvss_scores).encode(), "application/json") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - created_dt: str = UNSET + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() - classification: Union[Unset, Tuple[None, str, str]] = UNSET + classification: tuple[None, bytes, str] = UNSET if not isinstance(self.classification, Unset): - classification = ( - None, - json.dumps(self.classification.to_dict()), - "application/json", - ) + classification = (None, json.dumps(self.classification.to_dict()).encode(), "application/json") - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") + + cve_id: Union[Unset, tuple[None, bytes, str]] + + if isinstance(self.cve_id, Unset): + cve_id = UNSET + elif isinstance(self.cve_id, str): + cve_id = (None, str(self.cve_id).encode(), "text/plain") + else: + cve_id = (None, str(self.cve_id).encode(), "text/plain") + + impact: Union[Unset, tuple[None, bytes, str]] - cve_id = ( - self.cve_id - if self.cve_id is UNSET - else (None, str(self.cve_id), "text/plain") - ) - impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): - impact = UNSET + impact: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value - + impact = (None, str(self.impact.value).encode(), "text/plain") else: - impact = UNSET + impact: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.impact, Unset): + impact = (None, str(self.impact.value).encode(), "text/plain") - impact = BlankEnum(self.impact).value - - components: Union[Unset, Tuple[None, str, str]] = UNSET + components: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.components, Unset): _temp_components = self.components - components = (None, json.dumps(_temp_components), "application/json") + components = (None, json.dumps(_temp_components).encode(), "application/json") cve_description = ( self.cve_description - if self.cve_description is UNSET - else (None, str(self.cve_description), "text/plain") + if isinstance(self.cve_description, Unset) + else (None, str(self.cve_description).encode(), "text/plain") ) - requires_cve_description: Union[Unset, str] + + requires_cve_description: Union[Unset, tuple[None, bytes, str]] + if isinstance(self.requires_cve_description, Unset): requires_cve_description = UNSET elif isinstance(self.requires_cve_description, RequiresCveDescriptionEnum): - requires_cve_description = UNSET + requires_cve_description: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = RequiresCveDescriptionEnum( - self.requires_cve_description - ).value - + requires_cve_description = (None, str(self.requires_cve_description.value).encode(), "text/plain") else: - requires_cve_description = UNSET + requires_cve_description: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = BlankEnum( - self.requires_cve_description - ).value + requires_cve_description = (None, str(self.requires_cve_description.value).encode(), "text/plain") statement = ( - self.statement - if self.statement is UNSET - else (None, str(self.statement), "text/plain") + self.statement if isinstance(self.statement, Unset) else (None, str(self.statement).encode(), "text/plain") ) - cwe_id = ( - self.cwe_id - if self.cwe_id is UNSET - else (None, str(self.cwe_id), "text/plain") - ) - unembargo_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.unembargo_dt, Unset): - unembargo_dt = self.unembargo_dt.isoformat() if self.unembargo_dt else None - source: Union[Unset, str] + cwe_id = self.cwe_id if isinstance(self.cwe_id, Unset) else (None, str(self.cwe_id).encode(), "text/plain") + + unembargo_dt: Union[Unset, tuple[None, bytes, str]] + + if isinstance(self.unembargo_dt, Unset): + unembargo_dt = UNSET + elif isinstance(self.unembargo_dt, datetime.datetime): + unembargo_dt: bytes = UNSET + if not isinstance(self.unembargo_dt, Unset): + unembargo_dt = self.unembargo_dt.isoformat().encode() + else: + unembargo_dt = (None, str(self.unembargo_dt).encode(), "text/plain") + + source: Union[Unset, tuple[None, bytes, str]] + if isinstance(self.source, Unset): source = UNSET elif isinstance(self.source, SourceBe0Enum): - source = UNSET + source: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.source, Unset): - - source = SourceBe0Enum(self.source).value - + source = (None, str(self.source.value).encode(), "text/plain") else: - source = UNSET + source: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.source, Unset): + source = (None, str(self.source.value).encode(), "text/plain") - source = BlankEnum(self.source).value + reported_dt: Union[Unset, tuple[None, bytes, str]] - reported_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.reported_dt, Unset): - reported_dt = self.reported_dt.isoformat() if self.reported_dt else None + if isinstance(self.reported_dt, Unset): + reported_dt = UNSET + elif isinstance(self.reported_dt, datetime.datetime): + reported_dt: bytes = UNSET + if not isinstance(self.reported_dt, Unset): + reported_dt = self.reported_dt.isoformat().encode() + else: + reported_dt = (None, str(self.reported_dt).encode(), "text/plain") mitigation = ( self.mitigation - if self.mitigation is UNSET - else (None, str(self.mitigation), "text/plain") + if isinstance(self.mitigation, Unset) + else (None, str(self.mitigation).encode(), "text/plain") ) - major_incident_state: Union[Unset, str] + + major_incident_state: Union[Unset, tuple[None, bytes, str]] + if isinstance(self.major_incident_state, Unset): major_incident_state = UNSET elif isinstance(self.major_incident_state, MajorIncidentStateEnum): - major_incident_state = UNSET + major_incident_state: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.major_incident_state, Unset): - - major_incident_state = MajorIncidentStateEnum( - self.major_incident_state - ).value - + major_incident_state = (None, str(self.major_incident_state.value).encode(), "text/plain") else: - major_incident_state = UNSET + major_incident_state: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.major_incident_state, Unset): + major_incident_state = (None, str(self.major_incident_state.value).encode(), "text/plain") - major_incident_state = BlankEnum(self.major_incident_state).value + major_incident_start_dt: Union[Unset, tuple[None, bytes, str]] - major_incident_start_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.major_incident_start_dt, Unset): - major_incident_start_dt = ( - self.major_incident_start_dt.isoformat() - if self.major_incident_start_dt - else None - ) + if isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = UNSET + elif isinstance(self.major_incident_start_dt, datetime.datetime): + major_incident_start_dt: bytes = UNSET + if not isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = self.major_incident_start_dt.isoformat().encode() + else: + major_incident_start_dt = (None, str(self.major_incident_start_dt).encode(), "text/plain") + + nist_cvss_validation: Union[Unset, tuple[None, bytes, str]] - nist_cvss_validation: Union[Unset, str] if isinstance(self.nist_cvss_validation, Unset): nist_cvss_validation = UNSET elif isinstance(self.nist_cvss_validation, NistCvssValidationEnum): - nist_cvss_validation = UNSET + nist_cvss_validation: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = NistCvssValidationEnum( - self.nist_cvss_validation - ).value - + nist_cvss_validation = (None, str(self.nist_cvss_validation.value).encode(), "text/plain") else: - nist_cvss_validation = UNSET + nist_cvss_validation: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = BlankEnum(self.nist_cvss_validation).value + nist_cvss_validation = (None, str(self.nist_cvss_validation.value).encode(), "text/plain") group_key = ( - self.group_key - if self.group_key is UNSET - else (None, str(self.group_key), "text/plain") - ) - owner = ( - self.owner if self.owner is UNSET else (None, str(self.owner), "text/plain") + self.group_key if isinstance(self.group_key, Unset) else (None, str(self.group_key).encode(), "text/plain") ) + + owner = self.owner if isinstance(self.owner, Unset) else (None, str(self.owner).encode(), "text/plain") + task_key = ( - self.task_key - if self.task_key is UNSET - else (None, str(self.task_key), "text/plain") - ) - team_id = ( - self.team_id - if self.team_id is UNSET - else (None, str(self.team_id), "text/plain") + self.task_key if isinstance(self.task_key, Unset) else (None, str(self.task_key).encode(), "text/plain") ) - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(uuid, Unset): + team_id = self.team_id if isinstance(self.team_id, Unset) else (None, str(self.team_id).encode(), "text/plain") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(title, Unset): + if title is not UNSET: field_dict["title"] = title - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(comment_zero, Unset): + if comment_zero is not UNSET: field_dict["comment_zero"] = comment_zero - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(comments, Unset): + if comments is not UNSET: field_dict["comments"] = comments - if not isinstance(package_versions, Unset): + if package_versions is not UNSET: field_dict["package_versions"] = package_versions - if not isinstance(acknowledgments, Unset): + if acknowledgments is not UNSET: field_dict["acknowledgments"] = acknowledgments - if not isinstance(references, Unset): + if references is not UNSET: field_dict["references"] = references - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(classification, Unset): + if classification is not UNSET: field_dict["classification"] = classification - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(cve_id, Unset): + if cve_id is not UNSET: field_dict["cve_id"] = cve_id - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(components, Unset): + if components is not UNSET: field_dict["components"] = components - if not isinstance(cve_description, Unset): + if cve_description is not UNSET: field_dict["cve_description"] = cve_description - if not isinstance(requires_cve_description, Unset): + if requires_cve_description is not UNSET: field_dict["requires_cve_description"] = requires_cve_description - if not isinstance(statement, Unset): + if statement is not UNSET: field_dict["statement"] = statement - if not isinstance(cwe_id, Unset): + if cwe_id is not UNSET: field_dict["cwe_id"] = cwe_id - if not isinstance(unembargo_dt, Unset): + if unembargo_dt is not UNSET: field_dict["unembargo_dt"] = unembargo_dt - if not isinstance(source, Unset): + if source is not UNSET: field_dict["source"] = source - if not isinstance(reported_dt, Unset): + if reported_dt is not UNSET: field_dict["reported_dt"] = reported_dt - if not isinstance(mitigation, Unset): + if mitigation is not UNSET: field_dict["mitigation"] = mitigation - if not isinstance(major_incident_state, Unset): + if major_incident_state is not UNSET: field_dict["major_incident_state"] = major_incident_state - if not isinstance(major_incident_start_dt, Unset): + if major_incident_start_dt is not UNSET: field_dict["major_incident_start_dt"] = major_incident_start_dt - if not isinstance(nist_cvss_validation, Unset): + if nist_cvss_validation is not UNSET: field_dict["nist_cvss_validation"] = nist_cvss_validation - if not isinstance(group_key, Unset): + if group_key is not UNSET: field_dict["group_key"] = group_key - if not isinstance(owner, Unset): + if owner is not UNSET: field_dict["owner"] = owner - if not isinstance(task_key, Unset): + if task_key is not UNSET: field_dict["task_key"] = task_key - if not isinstance(team_id, Unset): + if team_id is not UNSET: field_dict["team_id"] = team_id return field_dict @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: + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.flaw_classification import FlawClassification + from ..models.package import Package + from ..models.alert import Alert + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_reference import FlawReference + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) title = d.pop("title", UNSET) - trackers = cast(List[str], d.pop("trackers", UNSET)) + trackers = cast(list[str], d.pop("trackers", UNSET)) comment_zero = d.pop("comment_zero", UNSET) affects = [] _affects = d.pop("affects", UNSET) - if _affects is UNSET: - affects = UNSET - else: - for affects_item_data in _affects or []: - _affects_item = affects_item_data - affects_item: Affect - if isinstance(_affects_item, Unset): - affects_item = UNSET - else: - affects_item = Affect.from_dict(_affects_item) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: Affect + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = Affect.from_dict(_affects_item) - affects.append(affects_item) + affects.append(affects_item) comments = [] _comments = d.pop("comments", UNSET) - if _comments is UNSET: - comments = UNSET - else: - for comments_item_data in _comments or []: - _comments_item = comments_item_data - comments_item: Comment - if isinstance(_comments_item, Unset): - comments_item = UNSET - else: - comments_item = Comment.from_dict(_comments_item) + for comments_item_data in _comments or []: + _comments_item = comments_item_data + comments_item: Comment + if isinstance(_comments_item, Unset): + comments_item = UNSET + else: + comments_item = Comment.from_dict(_comments_item) - comments.append(comments_item) + comments.append(comments_item) package_versions = [] _package_versions = d.pop("package_versions", UNSET) - if _package_versions is UNSET: - package_versions = UNSET - else: - for package_versions_item_data in _package_versions or []: - _package_versions_item = package_versions_item_data - package_versions_item: Package - if isinstance(_package_versions_item, Unset): - package_versions_item = UNSET - else: - package_versions_item = Package.from_dict(_package_versions_item) + for package_versions_item_data in _package_versions or []: + _package_versions_item = package_versions_item_data + package_versions_item: Package + if isinstance(_package_versions_item, Unset): + package_versions_item = UNSET + else: + package_versions_item = Package.from_dict(_package_versions_item) - package_versions.append(package_versions_item) + package_versions.append(package_versions_item) acknowledgments = [] _acknowledgments = d.pop("acknowledgments", UNSET) - if _acknowledgments is UNSET: - acknowledgments = UNSET - else: - for acknowledgments_item_data in _acknowledgments or []: - _acknowledgments_item = acknowledgments_item_data - acknowledgments_item: FlawAcknowledgment - if isinstance(_acknowledgments_item, Unset): - acknowledgments_item = UNSET - else: - acknowledgments_item = FlawAcknowledgment.from_dict( - _acknowledgments_item - ) + for acknowledgments_item_data in _acknowledgments or []: + _acknowledgments_item = acknowledgments_item_data + acknowledgments_item: FlawAcknowledgment + if isinstance(_acknowledgments_item, Unset): + acknowledgments_item = UNSET + else: + acknowledgments_item = FlawAcknowledgment.from_dict(_acknowledgments_item) - acknowledgments.append(acknowledgments_item) + acknowledgments.append(acknowledgments_item) references = [] _references = d.pop("references", UNSET) - if _references is UNSET: - references = UNSET - else: - for references_item_data in _references or []: - _references_item = references_item_data - references_item: FlawReference - if isinstance(_references_item, Unset): - references_item = UNSET - else: - references_item = FlawReference.from_dict(_references_item) + for references_item_data in _references or []: + _references_item = references_item_data + references_item: FlawReference + if isinstance(_references_item, Unset): + references_item = UNSET + else: + references_item = FlawReference.from_dict(_references_item) - references.append(references_item) + references.append(references_item) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: FlawCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: FlawCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) @@ -813,20 +852,24 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) - cve_id = d.pop("cve_id", UNSET) + def _parse_cve_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + cve_id = _parse_cve_id(d.pop("cve_id", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -835,7 +878,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -847,7 +890,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -857,28 +900,22 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - components = cast(List[str], d.pop("components", UNSET)) + components = cast(list[str], d.pop("components", UNSET)) cve_description = d.pop("cve_description", UNSET) - def _parse_requires_cve_description( - data: object, - ) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: + def _parse_requires_cve_description(data: object) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _requires_cve_description_type_0 = data - requires_cve_description_type_0: Union[ - Unset, RequiresCveDescriptionEnum - ] + requires_cve_description_type_0: RequiresCveDescriptionEnum if isinstance(_requires_cve_description_type_0, Unset): requires_cve_description_type_0 = UNSET else: - requires_cve_description_type_0 = RequiresCveDescriptionEnum( - _requires_cve_description_type_0 - ) + requires_cve_description_type_0 = RequiresCveDescriptionEnum(_requires_cve_description_type_0) return requires_cve_description_type_0 except: # noqa: E722 @@ -886,32 +923,41 @@ def _parse_requires_cve_description( if not isinstance(data, str): raise TypeError() _requires_cve_description_type_1 = data - requires_cve_description_type_1: Union[Unset, BlankEnum] + requires_cve_description_type_1: BlankEnum if isinstance(_requires_cve_description_type_1, Unset): requires_cve_description_type_1 = UNSET else: - requires_cve_description_type_1 = BlankEnum( - _requires_cve_description_type_1 - ) + requires_cve_description_type_1 = BlankEnum(_requires_cve_description_type_1) return requires_cve_description_type_1 - requires_cve_description = _parse_requires_cve_description( - d.pop("requires_cve_description", UNSET) - ) + requires_cve_description = _parse_requires_cve_description(d.pop("requires_cve_description", UNSET)) statement = d.pop("statement", UNSET) cwe_id = d.pop("cwe_id", UNSET) - _unembargo_dt = d.pop("unembargo_dt", UNSET) - unembargo_dt: Union[Unset, None, datetime.datetime] - if _unembargo_dt is None: - unembargo_dt = None - elif isinstance(_unembargo_dt, Unset): - unembargo_dt = UNSET - else: - unembargo_dt = isoparse(_unembargo_dt) + def _parse_unembargo_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _unembargo_dt_type_0 = data + unembargo_dt_type_0: datetime.datetime + if isinstance(_unembargo_dt_type_0, Unset): + unembargo_dt_type_0 = UNSET + else: + unembargo_dt_type_0 = isoparse(_unembargo_dt_type_0) + + return unembargo_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + unembargo_dt = _parse_unembargo_dt(d.pop("unembargo_dt", UNSET)) def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if isinstance(data, Unset): @@ -920,7 +966,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_0 = data - source_type_0: Union[Unset, SourceBe0Enum] + source_type_0: SourceBe0Enum if isinstance(_source_type_0, Unset): source_type_0 = UNSET else: @@ -932,7 +978,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_1 = data - source_type_1: Union[Unset, BlankEnum] + source_type_1: BlankEnum if isinstance(_source_type_1, Unset): source_type_1 = UNSET else: @@ -942,33 +988,42 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: source = _parse_source(d.pop("source", UNSET)) - _reported_dt = d.pop("reported_dt", UNSET) - reported_dt: Union[Unset, None, datetime.datetime] - if _reported_dt is None: - reported_dt = None - elif isinstance(_reported_dt, Unset): - reported_dt = UNSET - else: - reported_dt = isoparse(_reported_dt) + def _parse_reported_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _reported_dt_type_0 = data + reported_dt_type_0: datetime.datetime + if isinstance(_reported_dt_type_0, Unset): + reported_dt_type_0 = UNSET + else: + reported_dt_type_0 = isoparse(_reported_dt_type_0) + + return reported_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + reported_dt = _parse_reported_dt(d.pop("reported_dt", UNSET)) mitigation = d.pop("mitigation", UNSET) - def _parse_major_incident_state( - data: object, - ) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: + def _parse_major_incident_state(data: object) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _major_incident_state_type_0 = data - major_incident_state_type_0: Union[Unset, MajorIncidentStateEnum] + major_incident_state_type_0: MajorIncidentStateEnum if isinstance(_major_incident_state_type_0, Unset): major_incident_state_type_0 = UNSET else: - major_incident_state_type_0 = MajorIncidentStateEnum( - _major_incident_state_type_0 - ) + major_incident_state_type_0 = MajorIncidentStateEnum(_major_incident_state_type_0) return major_incident_state_type_0 except: # noqa: E722 @@ -976,7 +1031,7 @@ def _parse_major_incident_state( if not isinstance(data, str): raise TypeError() _major_incident_state_type_1 = data - major_incident_state_type_1: Union[Unset, BlankEnum] + major_incident_state_type_1: BlankEnum if isinstance(_major_incident_state_type_1, Unset): major_incident_state_type_1 = UNSET else: @@ -984,35 +1039,42 @@ def _parse_major_incident_state( return major_incident_state_type_1 - major_incident_state = _parse_major_incident_state( - d.pop("major_incident_state", UNSET) - ) + major_incident_state = _parse_major_incident_state(d.pop("major_incident_state", UNSET)) - _major_incident_start_dt = d.pop("major_incident_start_dt", UNSET) - major_incident_start_dt: Union[Unset, None, datetime.datetime] - if _major_incident_start_dt is None: - major_incident_start_dt = None - elif isinstance(_major_incident_start_dt, Unset): - major_incident_start_dt = UNSET - else: - major_incident_start_dt = isoparse(_major_incident_start_dt) + def _parse_major_incident_start_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _major_incident_start_dt_type_0 = data + major_incident_start_dt_type_0: datetime.datetime + if isinstance(_major_incident_start_dt_type_0, Unset): + major_incident_start_dt_type_0 = UNSET + else: + major_incident_start_dt_type_0 = isoparse(_major_incident_start_dt_type_0) - def _parse_nist_cvss_validation( - data: object, - ) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: + return major_incident_start_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + major_incident_start_dt = _parse_major_incident_start_dt(d.pop("major_incident_start_dt", UNSET)) + + def _parse_nist_cvss_validation(data: object) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_0 = data - nist_cvss_validation_type_0: Union[Unset, NistCvssValidationEnum] + nist_cvss_validation_type_0: NistCvssValidationEnum if isinstance(_nist_cvss_validation_type_0, Unset): nist_cvss_validation_type_0 = UNSET else: - nist_cvss_validation_type_0 = NistCvssValidationEnum( - _nist_cvss_validation_type_0 - ) + nist_cvss_validation_type_0 = NistCvssValidationEnum(_nist_cvss_validation_type_0) return nist_cvss_validation_type_0 except: # noqa: E722 @@ -1020,7 +1082,7 @@ def _parse_nist_cvss_validation( if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_1 = data - nist_cvss_validation_type_1: Union[Unset, BlankEnum] + nist_cvss_validation_type_1: BlankEnum if isinstance(_nist_cvss_validation_type_1, Unset): nist_cvss_validation_type_1 = UNSET else: @@ -1028,9 +1090,7 @@ def _parse_nist_cvss_validation( return nist_cvss_validation_type_1 - nist_cvss_validation = _parse_nist_cvss_validation( - d.pop("nist_cvss_validation", UNSET) - ) + nist_cvss_validation = _parse_nist_cvss_validation(d.pop("nist_cvss_validation", UNSET)) group_key = d.pop("group_key", UNSET) @@ -1079,46 +1139,8 @@ def _parse_nist_cvss_validation( flaw.additional_properties = d return flaw - @staticmethod - def get_fields(): - return { - "uuid": str, - "title": str, - "trackers": List[str], - "comment_zero": str, - "affects": List[Affect], - "comments": List[Comment], - "package_versions": List[Package], - "acknowledgments": List[FlawAcknowledgment], - "references": List[FlawReference], - "cvss_scores": List[FlawCVSS], - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "classification": FlawClassification, - "alerts": List[Alert], - "cve_id": str, - "impact": Union[BlankEnum, ImpactEnum], - "components": List[str], - "cve_description": str, - "requires_cve_description": Union[BlankEnum, RequiresCveDescriptionEnum], - "statement": str, - "cwe_id": str, - "unembargo_dt": datetime.datetime, - "source": Union[BlankEnum, SourceBe0Enum], - "reported_dt": datetime.datetime, - "mitigation": str, - "major_incident_state": Union[BlankEnum, MajorIncidentStateEnum], - "major_incident_start_dt": datetime.datetime, - "nist_cvss_validation": Union[BlankEnum, NistCvssValidationEnum], - "group_key": str, - "owner": str, - "task_key": str, - "team_id": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_acknowledgment.py b/osidb_bindings/bindings/python_client/models/flaw_acknowledgment.py index 87771cd..4adb488 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_acknowledgment.py +++ b/osidb_bindings/bindings/python_client/models/flaw_acknowledgment.py @@ -1,42 +1,72 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar, TYPE_CHECKING + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawAcknowledgment") -@attr.s(auto_attribs=True) +@_attrs_define class FlawAcknowledgment(OSIDBModel): - """FlawAcknowledgment serializer""" + """FlawAcknowledgment serializer + + Attributes: + name (str): + affiliation (str): + from_upstream (bool): + flaw (UUID): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + """ name: str affiliation: str from_upstream: bool - flaw: str - uuid: str + flaw: UUID + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: name = self.name + affiliation = self.affiliation + from_upstream = self.from_upstream - flaw = self.flaw - uuid = self.uuid + + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -50,31 +80,33 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name - if not isinstance(affiliation, Unset): + if affiliation is not UNSET: field_dict["affiliation"] = affiliation - if not isinstance(from_upstream, Unset): + if from_upstream is not UNSET: field_dict["from_upstream"] = from_upstream - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() name = d.pop("name", UNSET) @@ -82,26 +114,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from_upstream = d.pop("from_upstream", UNSET) - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -132,22 +171,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_acknowledgment.additional_properties = d return flaw_acknowledgment - @staticmethod - def get_fields(): - return { - "name": str, - "affiliation": str, - "from_upstream": bool, - "flaw": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_acknowledgment_post.py b/osidb_bindings/bindings/python_client/models/flaw_acknowledgment_post.py index 983ff38..8b4e68a 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_acknowledgment_post.py +++ b/osidb_bindings/bindings/python_client/models/flaw_acknowledgment_post.py @@ -1,40 +1,64 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr +from ..types import UNSET, Unset, OSIDBModel + from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawAcknowledgmentPost") -@attr.s(auto_attribs=True) +@_attrs_define class FlawAcknowledgmentPost(OSIDBModel): - """FlawAcknowledgment serializer""" + """FlawAcknowledgment serializer + + Attributes: + name (str): + affiliation (str): + from_upstream (bool): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + """ name: str affiliation: str from_upstream: bool - uuid: str + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: name = self.name + affiliation = self.affiliation + from_upstream = self.from_upstream - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -44,84 +68,78 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name - if not isinstance(affiliation, Unset): + if affiliation is not UNSET: field_dict["affiliation"] = affiliation - if not isinstance(from_upstream, Unset): + if from_upstream is not UNSET: field_dict["from_upstream"] = from_upstream - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt return field_dict - def to_multipart(self) -> Dict[str, Any]: - name = self.name if self.name is UNSET else (None, str(self.name), "text/plain") - affiliation = ( - self.affiliation - if self.affiliation is UNSET - else (None, str(self.affiliation), "text/plain") - ) - from_upstream = ( - self.from_upstream - if self.from_upstream is UNSET - else (None, str(self.from_upstream), "text/plain") - ) - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + name = (None, str(self.name).encode(), "text/plain") + + affiliation = (None, str(self.affiliation).encode(), "text/plain") + + from_upstream = (None, str(self.from_upstream).encode(), "text/plain") + + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(name, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if name is not UNSET: field_dict["name"] = name - if not isinstance(affiliation, Unset): + if affiliation is not UNSET: field_dict["affiliation"] = affiliation - if not isinstance(from_upstream, Unset): + if from_upstream is not UNSET: field_dict["from_upstream"] = from_upstream - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() name = d.pop("name", UNSET) @@ -129,24 +147,26 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from_upstream = d.pop("from_upstream", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -168,20 +188,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_acknowledgment_post.additional_properties = d return flaw_acknowledgment_post - @staticmethod - def get_fields(): - return { - "name": str, - "affiliation": str, - "from_upstream": bool, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_acknowledgment_put.py b/osidb_bindings/bindings/python_client/models/flaw_acknowledgment_put.py index 4d0854a..157f109 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_acknowledgment_put.py +++ b/osidb_bindings/bindings/python_client/models/flaw_acknowledgment_put.py @@ -1,41 +1,67 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr +from ..types import UNSET, Unset, OSIDBModel + from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawAcknowledgmentPut") -@attr.s(auto_attribs=True) +@_attrs_define class FlawAcknowledgmentPut(OSIDBModel): - """FlawAcknowledgment serializer""" + """FlawAcknowledgment serializer + + Attributes: + name (str): + affiliation (str): + from_upstream (bool): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + """ name: str affiliation: str from_upstream: bool - uuid: str + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: name = self.name + affiliation = self.affiliation + from_upstream = self.from_upstream - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -49,92 +75,86 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name - if not isinstance(affiliation, Unset): + if affiliation is not UNSET: field_dict["affiliation"] = affiliation - if not isinstance(from_upstream, Unset): + if from_upstream is not UNSET: field_dict["from_upstream"] = from_upstream - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt return field_dict - def to_multipart(self) -> Dict[str, Any]: - name = self.name if self.name is UNSET else (None, str(self.name), "text/plain") - affiliation = ( - self.affiliation - if self.affiliation is UNSET - else (None, str(self.affiliation), "text/plain") - ) - from_upstream = ( - self.from_upstream - if self.from_upstream is UNSET - else (None, str(self.from_upstream), "text/plain") - ) - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + name = (None, str(self.name).encode(), "text/plain") + + affiliation = (None, str(self.affiliation).encode(), "text/plain") + + from_upstream = (None, str(self.from_upstream).encode(), "text/plain") + + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(name, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if name is not UNSET: field_dict["name"] = name - if not isinstance(affiliation, Unset): + if affiliation is not UNSET: field_dict["affiliation"] = affiliation - if not isinstance(from_upstream, Unset): + if from_upstream is not UNSET: field_dict["from_upstream"] = from_upstream - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() name = d.pop("name", UNSET) @@ -142,24 +162,26 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from_upstream = d.pop("from_upstream", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -189,21 +211,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_acknowledgment_put.additional_properties = d return flaw_acknowledgment_put - @staticmethod - def get_fields(): - return { - "name": str, - "affiliation": str, - "from_upstream": bool, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_classification.py b/osidb_bindings/bindings/python_client/models/flaw_classification.py index a394e4f..4abcde6 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_classification.py +++ b/osidb_bindings/bindings/python_client/models/flaw_classification.py @@ -1,39 +1,47 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel from ..models.flaw_classification_state import FlawClassificationState -from ..types import UNSET, OSIDBModel, Unset + T = TypeVar("T", bound="FlawClassification") -@attr.s(auto_attribs=True) +@_attrs_define class FlawClassification(OSIDBModel): - """ """ + """ + Attributes: + workflow (Union[Unset, str]): + state (Union[Unset, FlawClassificationState]): + """ workflow: Union[Unset, str] = UNSET state: Union[Unset, FlawClassificationState] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: workflow = self.workflow + + print(FlawClassificationState) state: Union[Unset, str] = UNSET if not isinstance(self.state, Unset): + state = self.state.value - state = FlawClassificationState(self.state).value - - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(workflow, Unset): + if workflow is not UNSET: field_dict["workflow"] = workflow - if not isinstance(state, Unset): + if state is not UNSET: field_dict["state"] = state return field_dict @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() workflow = d.pop("workflow", UNSET) @@ -52,15 +60,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_classification.additional_properties = d return flaw_classification - @staticmethod - def get_fields(): - return { - "workflow": str, - "state": FlawClassificationState, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_classification_state.py b/osidb_bindings/bindings/python_client/models/flaw_classification_state.py index 1810a64..f7032c4 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_classification_state.py +++ b/osidb_bindings/bindings/python_client/models/flaw_classification_state.py @@ -2,13 +2,13 @@ class FlawClassificationState(str, Enum): - VALUE_0 = "" + DONE = "DONE" NEW = "NEW" - TRIAGE = "TRIAGE" PRE_SECONDARY_ASSESSMENT = "PRE_SECONDARY_ASSESSMENT" - SECONDARY_ASSESSMENT = "SECONDARY_ASSESSMENT" - DONE = "DONE" REJECTED = "REJECTED" + SECONDARY_ASSESSMENT = "SECONDARY_ASSESSMENT" + TRIAGE = "TRIAGE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/flaw_comment.py b/osidb_bindings/bindings/python_client/models/flaw_comment.py index a6fdecf..a0473d9 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_comment.py +++ b/osidb_bindings/bindings/python_client/models/flaw_comment.py @@ -1,42 +1,72 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawComment") -@attr.s(auto_attribs=True) +@_attrs_define class FlawComment(OSIDBModel): - """FlawComment serializer for use by flaw_comments endpoint""" - - flaw: str + """FlawComment serializer for use by flaw_comments endpoint + + Attributes: + flaw (UUID): + text (str): + uuid (UUID): + external_system_id (str): + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + order (Union[Unset, int]): + creator (Union[Unset, str]): + is_private (Union[Unset, bool]): + """ + + flaw: UUID text: str - uuid: str + uuid: UUID external_system_id: str - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime embargoed: bool order: Union[Unset, int] = UNSET creator: Union[Unset, str] = UNSET is_private: Union[Unset, bool] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) - def to_dict(self) -> Dict[str, Any]: - flaw = self.flaw text = self.text - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + external_system_id = self.external_system_id - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -51,62 +81,74 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() embargoed = self.embargoed + order = self.order + creator = self.creator + is_private = self.is_private - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(text, Unset): + if text is not UNSET: field_dict["text"] = text - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(external_system_id, Unset): + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(order, Unset): + if order is not UNSET: field_dict["order"] = order - if not isinstance(creator, Unset): + if creator is not UNSET: field_dict["creator"] = creator - if not isinstance(is_private, Unset): + if is_private is not UNSET: field_dict["is_private"] = is_private return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) text = d.pop("text", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) external_system_id = d.pop("external_system_id", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -147,24 +189,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_comment.additional_properties = d return flaw_comment - @staticmethod - def get_fields(): - return { - "flaw": str, - "text": str, - "uuid": str, - "external_system_id": str, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "embargoed": bool, - "order": int, - "creator": str, - "is_private": bool, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_comment_post.py b/osidb_bindings/bindings/python_client/models/flaw_comment_post.py index 90a6689..600fe1a 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_comment_post.py +++ b/osidb_bindings/bindings/python_client/models/flaw_comment_post.py @@ -1,37 +1,58 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr +from ..types import UNSET, Unset, OSIDBModel + from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawCommentPost") -@attr.s(auto_attribs=True) +@_attrs_define class FlawCommentPost(OSIDBModel): - """FlawComment serializer for use by flaw_comments endpoint""" + """FlawComment serializer for use by flaw_comments endpoint + + Attributes: + text (str): + uuid (UUID): + alerts (list['Alert']): + created_dt (datetime.datetime): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + creator (Union[Unset, str]): + is_private (Union[Unset, bool]): + """ text: str - uuid: str - alerts: List[Alert] + uuid: UUID + alerts: list["Alert"] created_dt: datetime.datetime embargoed: bool creator: Union[Unset, str] = UNSET is_private: Union[Unset, bool] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: text = self.text - uuid = self.uuid - alerts: List[Dict[str, Any]] = UNSET + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -42,107 +63,108 @@ def to_dict(self) -> Dict[str, Any]: created_dt = self.created_dt.isoformat() embargoed = self.embargoed + creator = self.creator + is_private = self.is_private - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(text, Unset): + if text is not UNSET: field_dict["text"] = text - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(creator, Unset): + if creator is not UNSET: field_dict["creator"] = creator - if not isinstance(is_private, Unset): + if is_private is not UNSET: field_dict["is_private"] = is_private return field_dict - def to_multipart(self) -> Dict[str, Any]: - text = self.text if self.text is UNSET else (None, str(self.text), "text/plain") - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + text = (None, str(self.text).encode(), "text/plain") + + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + creator = self.creator if isinstance(self.creator, Unset) else (None, str(self.creator).encode(), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - creator = ( - self.creator - if self.creator is UNSET - else (None, str(self.creator), "text/plain") - ) is_private = ( self.is_private - if self.is_private is UNSET - else (None, str(self.is_private), "text/plain") + if isinstance(self.is_private, Unset) + else (None, str(self.is_private).encode(), "text/plain") ) - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(text, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if text is not UNSET: field_dict["text"] = text - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(creator, Unset): + if creator is not UNSET: field_dict["creator"] = creator - if not isinstance(is_private, Unset): + if is_private is not UNSET: field_dict["is_private"] = is_private return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() text = d.pop("text", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -170,20 +192,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_comment_post.additional_properties = d return flaw_comment_post - @staticmethod - def get_fields(): - return { - "text": str, - "uuid": str, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "embargoed": bool, - "creator": str, - "is_private": bool, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_cvss.py b/osidb_bindings/bindings/python_client/models/flaw_cvss.py index 84a3196..215ba44 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_cvss.py +++ b/osidb_bindings/bindings/python_client/models/flaw_cvss.py @@ -1,54 +1,83 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="FlawCVSS") -@attr.s(auto_attribs=True) +@_attrs_define class FlawCVSS(OSIDBModel): - """FlawCVSS serializer""" + """FlawCVSS serializer + + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + flaw (Union[Unset, UUID]): + comment (Union[None, Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Union[Unset, str] = UNSET - comment: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + flaw: Union[Unset, UUID] = UNSET + comment: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -62,38 +91,47 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw - comment = self.comment + flaw: Union[Unset, str] = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -111,7 +149,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -119,18 +162,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -146,9 +186,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: Union[Unset, UUID] + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) - comment = d.pop("comment", UNSET) + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + comment = _parse_comment(d.pop("comment", UNSET)) flaw_cvss = cls( cvss_version=cvss_version, @@ -167,24 +219,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_cvss.additional_properties = d return flaw_cvss - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "comment": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_cvss_post.py b/osidb_bindings/bindings/python_client/models/flaw_cvss_post.py index c6c486e..807cb47 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_cvss_post.py +++ b/osidb_bindings/bindings/python_client/models/flaw_cvss_post.py @@ -1,53 +1,79 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="FlawCVSSPost") -@attr.s(auto_attribs=True) +@_attrs_define class FlawCVSSPost(OSIDBModel): - """FlawCVSS serializer""" + """FlawCVSS serializer + + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + comment (Union[None, Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime - comment: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + comment: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -57,107 +83,107 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() - comment = self.comment + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict - def to_multipart(self) -> Dict[str, Any]: - cvss_version: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + cvss_version: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = (None, str(self.cvss_version.value).encode(), "text/plain") - cvss_version = CvssVersionEnum(self.cvss_version).value - - issuer: Union[Unset, Tuple[None, str, str]] = UNSET + issuer: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.issuer, Unset): + issuer = (None, str(self.issuer.value).encode(), "text/plain") - issuer = IssuerEnum(self.issuer).value + score = (None, str(self.score).encode(), "text/plain") - score = ( - self.score if self.score is UNSET else (None, str(self.score), "text/plain") - ) - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - vector = ( - self.vector - if self.vector is UNSET - else (None, str(self.vector), "text/plain") - ) - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + vector = (None, str(self.vector).encode(), "text/plain") + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - comment = ( - self.comment - if self.comment is UNSET - else (None, str(self.comment), "text/plain") - ) + comment: Union[Unset, tuple[None, bytes, str]] - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(cvss_version, Unset): + if isinstance(self.comment, Unset): + comment = UNSET + elif isinstance(self.comment, str): + comment = (None, str(self.comment).encode(), "text/plain") + else: + comment = (None, str(self.comment).encode(), "text/plain") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -175,7 +201,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -183,18 +214,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -203,7 +231,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: created_dt = isoparse(_created_dt) - comment = d.pop("comment", UNSET) + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + comment = _parse_comment(d.pop("comment", UNSET)) flaw_cvss_post = cls( cvss_version=cvss_version, @@ -220,22 +255,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_cvss_post.additional_properties = d return flaw_cvss_post - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "comment": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_cvss_put.py b/osidb_bindings/bindings/python_client/models/flaw_cvss_put.py index cf5371b..29d2fd9 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_cvss_put.py +++ b/osidb_bindings/bindings/python_client/models/flaw_cvss_put.py @@ -1,54 +1,82 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="FlawCVSSPut") -@attr.s(auto_attribs=True) +@_attrs_define class FlawCVSSPut(OSIDBModel): - """FlawCVSS serializer""" + """FlawCVSS serializer + + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + comment (Union[None, Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - comment: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + comment: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -62,115 +90,115 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - comment = self.comment + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict - def to_multipart(self) -> Dict[str, Any]: - cvss_version: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + cvss_version: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = (None, str(self.cvss_version.value).encode(), "text/plain") - cvss_version = CvssVersionEnum(self.cvss_version).value - - issuer: Union[Unset, Tuple[None, str, str]] = UNSET + issuer: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.issuer, Unset): + issuer = (None, str(self.issuer.value).encode(), "text/plain") - issuer = IssuerEnum(self.issuer).value + score = (None, str(self.score).encode(), "text/plain") - score = ( - self.score if self.score is UNSET else (None, str(self.score), "text/plain") - ) - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - vector = ( - self.vector - if self.vector is UNSET - else (None, str(self.vector), "text/plain") - ) - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + vector = (None, str(self.vector).encode(), "text/plain") + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() - comment = ( - self.comment - if self.comment is UNSET - else (None, str(self.comment), "text/plain") - ) + comment: Union[Unset, tuple[None, bytes, str]] - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(cvss_version, Unset): + if isinstance(self.comment, Unset): + comment = UNSET + elif isinstance(self.comment, str): + comment = (None, str(self.comment).encode(), "text/plain") + else: + comment = (None, str(self.comment).encode(), "text/plain") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -188,7 +216,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -196,18 +229,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -223,7 +253,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - comment = d.pop("comment", UNSET) + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + comment = _parse_comment(d.pop("comment", UNSET)) flaw_cvss_put = cls( cvss_version=cvss_version, @@ -241,23 +278,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_cvss_put.additional_properties = d return flaw_cvss_put - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "comment": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_package_version.py b/osidb_bindings/bindings/python_client/models/flaw_package_version.py index 0cf1e35..3a969ed 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_package_version.py +++ b/osidb_bindings/bindings/python_client/models/flaw_package_version.py @@ -1,43 +1,69 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar, TYPE_CHECKING + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.flaw_version import FlawVersion -from ..models.flaw_version import FlawVersion -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawPackageVersion") -@attr.s(auto_attribs=True) +@_attrs_define class FlawPackageVersion(OSIDBModel): - """Package model serializer""" + """Package model serializer + + Attributes: + package (str): + versions (list['FlawVersion']): + flaw (UUID): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + """ package: str - versions: List[FlawVersion] - flaw: str - uuid: str + versions: list["FlawVersion"] + flaw: UUID + uuid: UUID embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: package = self.package - versions: List[Dict[str, Any]] = UNSET + + versions: list[dict[str, Any]] = UNSET if not isinstance(self.versions, Unset): versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() versions.append(versions_item) - flaw = self.flaw - uuid = self.uuid + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -46,48 +72,57 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(package, Unset): + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt return field_dict @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: + from ..models.flaw_version import FlawVersion + d = src_dict.copy() package = d.pop("package", UNSET) versions = [] _versions = d.pop("versions", UNSET) - if _versions is UNSET: - versions = UNSET + for versions_item_data in _versions or []: + _versions_item = versions_item_data + versions_item: FlawVersion + if isinstance(_versions_item, Unset): + versions_item = UNSET + else: + versions_item = FlawVersion.from_dict(_versions_item) + + versions.append(versions_item) + + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET else: - for versions_item_data in _versions or []: - _versions_item = versions_item_data - versions_item: FlawVersion - if isinstance(_versions_item, Unset): - versions_item = UNSET - else: - versions_item = FlawVersion.from_dict(_versions_item) - - versions.append(versions_item) + flaw = UUID(_flaw) - flaw = d.pop("flaw", UNSET) - - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) @@ -118,20 +153,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_package_version.additional_properties = d return flaw_package_version - @staticmethod - def get_fields(): - return { - "package": str, - "versions": List[FlawVersion], - "flaw": str, - "uuid": str, - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_package_version_post.py b/osidb_bindings/bindings/python_client/models/flaw_package_version_post.py index b2f3255..0b03a6e 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_package_version_post.py +++ b/osidb_bindings/bindings/python_client/models/flaw_package_version_post.py @@ -1,128 +1,146 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr +from ..types import UNSET, Unset, OSIDBModel + from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.flaw_version import FlawVersion -from ..models.flaw_version import FlawVersion -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawPackageVersionPost") -@attr.s(auto_attribs=True) +@_attrs_define class FlawPackageVersionPost(OSIDBModel): - """Package model serializer""" + """Package model serializer + + Attributes: + package (str): + versions (list['FlawVersion']): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + """ package: str - versions: List[FlawVersion] - uuid: str + versions: list["FlawVersion"] + uuid: UUID embargoed: bool created_dt: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: package = self.package - versions: List[Dict[str, Any]] = UNSET + + versions: list[dict[str, Any]] = UNSET if not isinstance(self.versions, Unset): versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() versions.append(versions_item) - uuid = self.uuid + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(package, Unset): + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt return field_dict - def to_multipart(self) -> Dict[str, Any]: - package = ( - self.package - if self.package is UNSET - else (None, str(self.package), "text/plain") - ) - versions: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + package = (None, str(self.package).encode(), "text/plain") + + versions: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.versions, Unset): _temp_versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() _temp_versions.append(versions_item) - versions = (None, json.dumps(_temp_versions), "application/json") + versions = (None, json.dumps(_temp_versions).encode(), "application/json") - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - created_dt: str = UNSET + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(package, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt return field_dict @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: + from ..models.flaw_version import FlawVersion + d = src_dict.copy() package = d.pop("package", UNSET) versions = [] _versions = d.pop("versions", UNSET) - if _versions is UNSET: - versions = UNSET + for versions_item_data in _versions or []: + _versions_item = versions_item_data + versions_item: FlawVersion + if isinstance(_versions_item, Unset): + versions_item = UNSET + else: + versions_item = FlawVersion.from_dict(_versions_item) + + versions.append(versions_item) + + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET else: - for versions_item_data in _versions or []: - _versions_item = versions_item_data - versions_item: FlawVersion - if isinstance(_versions_item, Unset): - versions_item = UNSET - else: - versions_item = FlawVersion.from_dict(_versions_item) - - versions.append(versions_item) - - uuid = d.pop("uuid", UNSET) + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) @@ -144,18 +162,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_package_version_post.additional_properties = d return flaw_package_version_post - @staticmethod - def get_fields(): - return { - "package": str, - "versions": List[FlawVersion], - "uuid": str, - "embargoed": bool, - "created_dt": datetime.datetime, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_package_version_put.py b/osidb_bindings/bindings/python_client/models/flaw_package_version_put.py index faf4cbf..15d36cb 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_package_version_put.py +++ b/osidb_bindings/bindings/python_client/models/flaw_package_version_put.py @@ -1,42 +1,64 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr +from ..types import UNSET, Unset, OSIDBModel + from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.flaw_version import FlawVersion -from ..models.flaw_version import FlawVersion -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawPackageVersionPut") -@attr.s(auto_attribs=True) +@_attrs_define class FlawPackageVersionPut(OSIDBModel): - """Package model serializer""" + """Package model serializer + + Attributes: + package (str): + versions (list['FlawVersion']): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + """ package: str - versions: List[FlawVersion] - uuid: str + versions: list["FlawVersion"] + uuid: UUID embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: package = self.package - versions: List[Dict[str, Any]] = UNSET + + versions: list[dict[str, Any]] = UNSET if not isinstance(self.versions, Unset): versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() versions.append(versions_item) - uuid = self.uuid + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -45,97 +67,95 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(package, Unset): + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt return field_dict - def to_multipart(self) -> Dict[str, Any]: - package = ( - self.package - if self.package is UNSET - else (None, str(self.package), "text/plain") - ) - versions: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + package = (None, str(self.package).encode(), "text/plain") + + versions: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.versions, Unset): _temp_versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() _temp_versions.append(versions_item) - versions = (None, json.dumps(_temp_versions), "application/json") + versions = (None, json.dumps(_temp_versions).encode(), "application/json") - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - created_dt: str = UNSET + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(package, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt return field_dict @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: + from ..models.flaw_version import FlawVersion + d = src_dict.copy() package = d.pop("package", UNSET) versions = [] _versions = d.pop("versions", UNSET) - if _versions is UNSET: - versions = UNSET + for versions_item_data in _versions or []: + _versions_item = versions_item_data + versions_item: FlawVersion + if isinstance(_versions_item, Unset): + versions_item = UNSET + else: + versions_item = FlawVersion.from_dict(_versions_item) + + versions.append(versions_item) + + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET else: - for versions_item_data in _versions or []: - _versions_item = versions_item_data - versions_item: FlawVersion - if isinstance(_versions_item, Unset): - versions_item = UNSET - else: - versions_item = FlawVersion.from_dict(_versions_item) - - versions.append(versions_item) - - uuid = d.pop("uuid", UNSET) + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) @@ -165,19 +185,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_package_version_put.additional_properties = d return flaw_package_version_put - @staticmethod - def get_fields(): - return { - "package": str, - "versions": List[FlawVersion], - "uuid": str, - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_post.py b/osidb_bindings/bindings/python_client/models/flaw_post.py index ec9d766..c8cc2af 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_post.py +++ b/osidb_bindings/bindings/python_client/models/flaw_post.py @@ -1,779 +1,816 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union, cast -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect import Affect -from ..models.alert import Alert from ..models.blank_enum import BlankEnum -from ..models.comment import Comment -from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..models.flaw_cvss import FlawCVSS -from ..models.flaw_post_classification import FlawPostClassification -from ..models.flaw_reference import FlawReference from ..models.impact_enum import ImpactEnum from ..models.major_incident_state_enum import MajorIncidentStateEnum from ..models.nist_cvss_validation_enum import NistCvssValidationEnum -from ..models.package import Package from ..models.requires_cve_description_enum import RequiresCveDescriptionEnum from ..models.source_be_0_enum import SourceBe0Enum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.package import Package + from ..models.flaw_post_classification import FlawPostClassification + from ..models.alert import Alert + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_reference import FlawReference + T = TypeVar("T", bound="FlawPost") -@attr.s(auto_attribs=True) +@_attrs_define class FlawPost(OSIDBModel): - """serialize flaw model""" - - uuid: str + """serialize flaw model + + Attributes: + uuid (UUID): + title (str): + trackers (list[str]): + comment_zero (str): + affects (list['Affect']): + comments (list['Comment']): + package_versions (list['Package']): + acknowledgments (list['FlawAcknowledgment']): + references (list['FlawReference']): + cvss_scores (list['FlawCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + classification (FlawPostClassification): + alerts (list['Alert']): + cve_id (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + components (Union[Unset, list[str]]): + cve_description (Union[Unset, str]): + requires_cve_description (Union[BlankEnum, RequiresCveDescriptionEnum, Unset]): + statement (Union[Unset, str]): + cwe_id (Union[Unset, str]): + unembargo_dt (Union[None, Unset, datetime.datetime]): + source (Union[BlankEnum, SourceBe0Enum, Unset]): + reported_dt (Union[None, Unset, datetime.datetime]): + mitigation (Union[Unset, str]): + major_incident_state (Union[BlankEnum, MajorIncidentStateEnum, Unset]): + major_incident_start_dt (Union[None, Unset, datetime.datetime]): + nist_cvss_validation (Union[BlankEnum, NistCvssValidationEnum, Unset]): + group_key (Union[Unset, str]): + owner (Union[Unset, str]): + task_key (Union[Unset, str]): + team_id (Union[Unset, str]): + """ + + uuid: UUID title: str - trackers: List[str] + trackers: list[str] comment_zero: str - affects: List[Affect] - comments: List[Comment] - package_versions: List[Package] - acknowledgments: List[FlawAcknowledgment] - references: List[FlawReference] - cvss_scores: List[FlawCVSS] + affects: list["Affect"] + comments: list["Comment"] + package_versions: list["Package"] + acknowledgments: list["FlawAcknowledgment"] + references: list["FlawReference"] + cvss_scores: list["FlawCVSS"] embargoed: bool created_dt: datetime.datetime - classification: FlawPostClassification - alerts: List[Alert] - cve_id: Union[Unset, None, str] = UNSET + classification: "FlawPostClassification" + alerts: list["Alert"] + cve_id: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET cve_description: Union[Unset, str] = UNSET - requires_cve_description: Union[ - BlankEnum, RequiresCveDescriptionEnum, Unset - ] = UNSET + requires_cve_description: Union[BlankEnum, RequiresCveDescriptionEnum, Unset] = UNSET statement: Union[Unset, str] = UNSET cwe_id: Union[Unset, str] = UNSET - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET + unembargo_dt: Union[None, Unset, datetime.datetime] = UNSET source: Union[BlankEnum, SourceBe0Enum, Unset] = UNSET - reported_dt: Union[Unset, None, datetime.datetime] = UNSET + reported_dt: Union[None, Unset, datetime.datetime] = UNSET mitigation: Union[Unset, str] = UNSET major_incident_state: Union[BlankEnum, MajorIncidentStateEnum, Unset] = UNSET - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET + major_incident_start_dt: Union[None, Unset, datetime.datetime] = UNSET nist_cvss_validation: Union[BlankEnum, NistCvssValidationEnum, Unset] = UNSET group_key: Union[Unset, str] = UNSET owner: Union[Unset, str] = UNSET task_key: Union[Unset, str] = UNSET team_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid title = self.title - trackers: List[str] = UNSET + + trackers: list[str] = UNSET if not isinstance(self.trackers, Unset): trackers = self.trackers comment_zero = self.comment_zero - affects: List[Dict[str, Any]] = UNSET + + affects: list[dict[str, Any]] = UNSET if not isinstance(self.affects, Unset): affects = [] for affects_item_data in self.affects: - affects_item: Dict[str, Any] = UNSET + affects_item: dict[str, Any] = UNSET if not isinstance(affects_item_data, Unset): affects_item = affects_item_data.to_dict() affects.append(affects_item) - comments: List[Dict[str, Any]] = UNSET + comments: list[dict[str, Any]] = UNSET if not isinstance(self.comments, Unset): comments = [] for comments_item_data in self.comments: - comments_item: Dict[str, Any] = UNSET + comments_item: dict[str, Any] = UNSET if not isinstance(comments_item_data, Unset): comments_item = comments_item_data.to_dict() comments.append(comments_item) - package_versions: List[Dict[str, Any]] = UNSET + package_versions: list[dict[str, Any]] = UNSET if not isinstance(self.package_versions, Unset): package_versions = [] for package_versions_item_data in self.package_versions: - package_versions_item: Dict[str, Any] = UNSET + package_versions_item: dict[str, Any] = UNSET if not isinstance(package_versions_item_data, Unset): package_versions_item = package_versions_item_data.to_dict() package_versions.append(package_versions_item) - acknowledgments: List[Dict[str, Any]] = UNSET + acknowledgments: list[dict[str, Any]] = UNSET if not isinstance(self.acknowledgments, Unset): acknowledgments = [] for acknowledgments_item_data in self.acknowledgments: - acknowledgments_item: Dict[str, Any] = UNSET + acknowledgments_item: dict[str, Any] = UNSET if not isinstance(acknowledgments_item_data, Unset): acknowledgments_item = acknowledgments_item_data.to_dict() acknowledgments.append(acknowledgments_item) - references: List[Dict[str, Any]] = UNSET + references: list[dict[str, Any]] = UNSET if not isinstance(self.references, Unset): references = [] for references_item_data in self.references: - references_item: Dict[str, Any] = UNSET + references_item: dict[str, Any] = UNSET if not isinstance(references_item_data, Unset): references_item = references_item_data.to_dict() references.append(references_item) - cvss_scores: List[Dict[str, Any]] = UNSET + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() - classification: Dict[str, Any] = UNSET + classification: dict[str, Any] = UNSET if not isinstance(self.classification, Unset): classification = self.classification.to_dict() - alerts: List[Dict[str, Any]] = UNSET + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() alerts.append(alerts_item) - cve_id = self.cve_id + cve_id: Union[None, Unset, str] + if isinstance(self.cve_id, Unset): + cve_id = UNSET + else: + cve_id = self.cve_id + impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value - - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET if not isinstance(self.components, Unset): components = self.components cve_description = self.cve_description + requires_cve_description: Union[Unset, str] if isinstance(self.requires_cve_description, Unset): requires_cve_description = UNSET elif isinstance(self.requires_cve_description, RequiresCveDescriptionEnum): + print(RequiresCveDescriptionEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = RequiresCveDescriptionEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value else: + print(BlankEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = BlankEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value statement = self.statement + cwe_id = self.cwe_id - unembargo_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.unembargo_dt, Unset): - unembargo_dt = self.unembargo_dt.isoformat() if self.unembargo_dt else None + + unembargo_dt: Union[None, Unset, str] + if isinstance(self.unembargo_dt, Unset): + unembargo_dt = UNSET + elif isinstance(self.unembargo_dt, datetime.datetime): + unembargo_dt = UNSET + if not isinstance(self.unembargo_dt, Unset): + unembargo_dt = self.unembargo_dt.isoformat() + + else: + unembargo_dt = self.unembargo_dt source: Union[Unset, str] if isinstance(self.source, Unset): source = UNSET elif isinstance(self.source, SourceBe0Enum): + print(SourceBe0Enum) source = UNSET if not isinstance(self.source, Unset): - - source = SourceBe0Enum(self.source).value + source = self.source.value else: + print(BlankEnum) source = UNSET if not isinstance(self.source, Unset): + source = self.source.value - source = BlankEnum(self.source).value + reported_dt: Union[None, Unset, str] + if isinstance(self.reported_dt, Unset): + reported_dt = UNSET + elif isinstance(self.reported_dt, datetime.datetime): + reported_dt = UNSET + if not isinstance(self.reported_dt, Unset): + reported_dt = self.reported_dt.isoformat() - reported_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.reported_dt, Unset): - reported_dt = self.reported_dt.isoformat() if self.reported_dt else None + else: + reported_dt = self.reported_dt mitigation = self.mitigation + major_incident_state: Union[Unset, str] if isinstance(self.major_incident_state, Unset): major_incident_state = UNSET elif isinstance(self.major_incident_state, MajorIncidentStateEnum): + print(MajorIncidentStateEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): - - major_incident_state = MajorIncidentStateEnum( - self.major_incident_state - ).value + major_incident_state = self.major_incident_state.value else: + print(BlankEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): + major_incident_state = self.major_incident_state.value - major_incident_state = BlankEnum(self.major_incident_state).value + major_incident_start_dt: Union[None, Unset, str] + if isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = UNSET + elif isinstance(self.major_incident_start_dt, datetime.datetime): + major_incident_start_dt = UNSET + if not isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = self.major_incident_start_dt.isoformat() - major_incident_start_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.major_incident_start_dt, Unset): - major_incident_start_dt = ( - self.major_incident_start_dt.isoformat() - if self.major_incident_start_dt - else None - ) + else: + major_incident_start_dt = self.major_incident_start_dt nist_cvss_validation: Union[Unset, str] if isinstance(self.nist_cvss_validation, Unset): nist_cvss_validation = UNSET elif isinstance(self.nist_cvss_validation, NistCvssValidationEnum): + print(NistCvssValidationEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = NistCvssValidationEnum( - self.nist_cvss_validation - ).value + nist_cvss_validation = self.nist_cvss_validation.value else: + print(BlankEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = BlankEnum(self.nist_cvss_validation).value + nist_cvss_validation = self.nist_cvss_validation.value group_key = self.group_key + owner = self.owner + task_key = self.task_key + team_id = self.team_id - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(title, Unset): + if title is not UNSET: field_dict["title"] = title - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(comment_zero, Unset): + if comment_zero is not UNSET: field_dict["comment_zero"] = comment_zero - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(comments, Unset): + if comments is not UNSET: field_dict["comments"] = comments - if not isinstance(package_versions, Unset): + if package_versions is not UNSET: field_dict["package_versions"] = package_versions - if not isinstance(acknowledgments, Unset): + if acknowledgments is not UNSET: field_dict["acknowledgments"] = acknowledgments - if not isinstance(references, Unset): + if references is not UNSET: field_dict["references"] = references - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(classification, Unset): + if classification is not UNSET: field_dict["classification"] = classification - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(cve_id, Unset): + if cve_id is not UNSET: field_dict["cve_id"] = cve_id - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(components, Unset): + if components is not UNSET: field_dict["components"] = components - if not isinstance(cve_description, Unset): + if cve_description is not UNSET: field_dict["cve_description"] = cve_description - if not isinstance(requires_cve_description, Unset): + if requires_cve_description is not UNSET: field_dict["requires_cve_description"] = requires_cve_description - if not isinstance(statement, Unset): + if statement is not UNSET: field_dict["statement"] = statement - if not isinstance(cwe_id, Unset): + if cwe_id is not UNSET: field_dict["cwe_id"] = cwe_id - if not isinstance(unembargo_dt, Unset): + if unembargo_dt is not UNSET: field_dict["unembargo_dt"] = unembargo_dt - if not isinstance(source, Unset): + if source is not UNSET: field_dict["source"] = source - if not isinstance(reported_dt, Unset): + if reported_dt is not UNSET: field_dict["reported_dt"] = reported_dt - if not isinstance(mitigation, Unset): + if mitigation is not UNSET: field_dict["mitigation"] = mitigation - if not isinstance(major_incident_state, Unset): + if major_incident_state is not UNSET: field_dict["major_incident_state"] = major_incident_state - if not isinstance(major_incident_start_dt, Unset): + if major_incident_start_dt is not UNSET: field_dict["major_incident_start_dt"] = major_incident_start_dt - if not isinstance(nist_cvss_validation, Unset): + if nist_cvss_validation is not UNSET: field_dict["nist_cvss_validation"] = nist_cvss_validation - if not isinstance(group_key, Unset): + if group_key is not UNSET: field_dict["group_key"] = group_key - if not isinstance(owner, Unset): + if owner is not UNSET: field_dict["owner"] = owner - if not isinstance(task_key, Unset): + if task_key is not UNSET: field_dict["task_key"] = task_key - if not isinstance(team_id, Unset): + if team_id is not UNSET: field_dict["team_id"] = team_id return field_dict - def to_multipart(self) -> Dict[str, Any]: - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - title = ( - self.title if self.title is UNSET else (None, str(self.title), "text/plain") - ) - trackers: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + title = (None, str(self.title).encode(), "text/plain") + + trackers: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.trackers, Unset): _temp_trackers = self.trackers - trackers = (None, json.dumps(_temp_trackers), "application/json") + trackers = (None, json.dumps(_temp_trackers).encode(), "application/json") - comment_zero = ( - self.comment_zero - if self.comment_zero is UNSET - else (None, str(self.comment_zero), "text/plain") - ) - affects: Union[Unset, Tuple[None, str, str]] = UNSET + comment_zero = (None, str(self.comment_zero).encode(), "text/plain") + + affects: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.affects, Unset): _temp_affects = [] for affects_item_data in self.affects: - affects_item: Dict[str, Any] = UNSET + affects_item: dict[str, Any] = UNSET if not isinstance(affects_item_data, Unset): affects_item = affects_item_data.to_dict() _temp_affects.append(affects_item) - affects = (None, json.dumps(_temp_affects), "application/json") + affects = (None, json.dumps(_temp_affects).encode(), "application/json") - comments: Union[Unset, Tuple[None, str, str]] = UNSET + comments: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.comments, Unset): _temp_comments = [] for comments_item_data in self.comments: - comments_item: Dict[str, Any] = UNSET + comments_item: dict[str, Any] = UNSET if not isinstance(comments_item_data, Unset): comments_item = comments_item_data.to_dict() _temp_comments.append(comments_item) - comments = (None, json.dumps(_temp_comments), "application/json") + comments = (None, json.dumps(_temp_comments).encode(), "application/json") - package_versions: Union[Unset, Tuple[None, str, str]] = UNSET + package_versions: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.package_versions, Unset): _temp_package_versions = [] for package_versions_item_data in self.package_versions: - package_versions_item: Dict[str, Any] = UNSET + package_versions_item: dict[str, Any] = UNSET if not isinstance(package_versions_item_data, Unset): package_versions_item = package_versions_item_data.to_dict() _temp_package_versions.append(package_versions_item) - package_versions = ( - None, - json.dumps(_temp_package_versions), - "application/json", - ) + package_versions = (None, json.dumps(_temp_package_versions).encode(), "application/json") - acknowledgments: Union[Unset, Tuple[None, str, str]] = UNSET + acknowledgments: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.acknowledgments, Unset): _temp_acknowledgments = [] for acknowledgments_item_data in self.acknowledgments: - acknowledgments_item: Dict[str, Any] = UNSET + acknowledgments_item: dict[str, Any] = UNSET if not isinstance(acknowledgments_item_data, Unset): acknowledgments_item = acknowledgments_item_data.to_dict() _temp_acknowledgments.append(acknowledgments_item) - acknowledgments = ( - None, - json.dumps(_temp_acknowledgments), - "application/json", - ) + acknowledgments = (None, json.dumps(_temp_acknowledgments).encode(), "application/json") - references: Union[Unset, Tuple[None, str, str]] = UNSET + references: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.references, Unset): _temp_references = [] for references_item_data in self.references: - references_item: Dict[str, Any] = UNSET + references_item: dict[str, Any] = UNSET if not isinstance(references_item_data, Unset): references_item = references_item_data.to_dict() _temp_references.append(references_item) - references = (None, json.dumps(_temp_references), "application/json") + references = (None, json.dumps(_temp_references).encode(), "application/json") - cvss_scores: Union[Unset, Tuple[None, str, str]] = UNSET + cvss_scores: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.cvss_scores, Unset): _temp_cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() _temp_cvss_scores.append(cvss_scores_item) - cvss_scores = (None, json.dumps(_temp_cvss_scores), "application/json") + cvss_scores = (None, json.dumps(_temp_cvss_scores).encode(), "application/json") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - created_dt: str = UNSET + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - classification: Union[Unset, Tuple[None, str, str]] = UNSET + classification: tuple[None, bytes, str] = UNSET if not isinstance(self.classification, Unset): - classification = ( - None, - json.dumps(self.classification.to_dict()), - "application/json", - ) + classification = (None, json.dumps(self.classification.to_dict()).encode(), "application/json") - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") + + cve_id: Union[Unset, tuple[None, bytes, str]] + + if isinstance(self.cve_id, Unset): + cve_id = UNSET + elif isinstance(self.cve_id, str): + cve_id = (None, str(self.cve_id).encode(), "text/plain") + else: + cve_id = (None, str(self.cve_id).encode(), "text/plain") + + impact: Union[Unset, tuple[None, bytes, str]] - cve_id = ( - self.cve_id - if self.cve_id is UNSET - else (None, str(self.cve_id), "text/plain") - ) - impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): - impact = UNSET + impact: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value - + impact = (None, str(self.impact.value).encode(), "text/plain") else: - impact = UNSET + impact: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.impact, Unset): + impact = (None, str(self.impact.value).encode(), "text/plain") - impact = BlankEnum(self.impact).value - - components: Union[Unset, Tuple[None, str, str]] = UNSET + components: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.components, Unset): _temp_components = self.components - components = (None, json.dumps(_temp_components), "application/json") + components = (None, json.dumps(_temp_components).encode(), "application/json") cve_description = ( self.cve_description - if self.cve_description is UNSET - else (None, str(self.cve_description), "text/plain") + if isinstance(self.cve_description, Unset) + else (None, str(self.cve_description).encode(), "text/plain") ) - requires_cve_description: Union[Unset, str] + + requires_cve_description: Union[Unset, tuple[None, bytes, str]] + if isinstance(self.requires_cve_description, Unset): requires_cve_description = UNSET elif isinstance(self.requires_cve_description, RequiresCveDescriptionEnum): - requires_cve_description = UNSET + requires_cve_description: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = RequiresCveDescriptionEnum( - self.requires_cve_description - ).value - + requires_cve_description = (None, str(self.requires_cve_description.value).encode(), "text/plain") else: - requires_cve_description = UNSET + requires_cve_description: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = BlankEnum( - self.requires_cve_description - ).value + requires_cve_description = (None, str(self.requires_cve_description.value).encode(), "text/plain") statement = ( - self.statement - if self.statement is UNSET - else (None, str(self.statement), "text/plain") + self.statement if isinstance(self.statement, Unset) else (None, str(self.statement).encode(), "text/plain") ) - cwe_id = ( - self.cwe_id - if self.cwe_id is UNSET - else (None, str(self.cwe_id), "text/plain") - ) - unembargo_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.unembargo_dt, Unset): - unembargo_dt = self.unembargo_dt.isoformat() if self.unembargo_dt else None - source: Union[Unset, str] + cwe_id = self.cwe_id if isinstance(self.cwe_id, Unset) else (None, str(self.cwe_id).encode(), "text/plain") + + unembargo_dt: Union[Unset, tuple[None, bytes, str]] + + if isinstance(self.unembargo_dt, Unset): + unembargo_dt = UNSET + elif isinstance(self.unembargo_dt, datetime.datetime): + unembargo_dt: bytes = UNSET + if not isinstance(self.unembargo_dt, Unset): + unembargo_dt = self.unembargo_dt.isoformat().encode() + else: + unembargo_dt = (None, str(self.unembargo_dt).encode(), "text/plain") + + source: Union[Unset, tuple[None, bytes, str]] + if isinstance(self.source, Unset): source = UNSET elif isinstance(self.source, SourceBe0Enum): - source = UNSET + source: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.source, Unset): - - source = SourceBe0Enum(self.source).value - + source = (None, str(self.source.value).encode(), "text/plain") else: - source = UNSET + source: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.source, Unset): + source = (None, str(self.source.value).encode(), "text/plain") - source = BlankEnum(self.source).value + reported_dt: Union[Unset, tuple[None, bytes, str]] - reported_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.reported_dt, Unset): - reported_dt = self.reported_dt.isoformat() if self.reported_dt else None + if isinstance(self.reported_dt, Unset): + reported_dt = UNSET + elif isinstance(self.reported_dt, datetime.datetime): + reported_dt: bytes = UNSET + if not isinstance(self.reported_dt, Unset): + reported_dt = self.reported_dt.isoformat().encode() + else: + reported_dt = (None, str(self.reported_dt).encode(), "text/plain") mitigation = ( self.mitigation - if self.mitigation is UNSET - else (None, str(self.mitigation), "text/plain") + if isinstance(self.mitigation, Unset) + else (None, str(self.mitigation).encode(), "text/plain") ) - major_incident_state: Union[Unset, str] + + major_incident_state: Union[Unset, tuple[None, bytes, str]] + if isinstance(self.major_incident_state, Unset): major_incident_state = UNSET elif isinstance(self.major_incident_state, MajorIncidentStateEnum): - major_incident_state = UNSET + major_incident_state: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.major_incident_state, Unset): - - major_incident_state = MajorIncidentStateEnum( - self.major_incident_state - ).value - + major_incident_state = (None, str(self.major_incident_state.value).encode(), "text/plain") else: - major_incident_state = UNSET + major_incident_state: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.major_incident_state, Unset): + major_incident_state = (None, str(self.major_incident_state.value).encode(), "text/plain") - major_incident_state = BlankEnum(self.major_incident_state).value + major_incident_start_dt: Union[Unset, tuple[None, bytes, str]] - major_incident_start_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.major_incident_start_dt, Unset): - major_incident_start_dt = ( - self.major_incident_start_dt.isoformat() - if self.major_incident_start_dt - else None - ) + if isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = UNSET + elif isinstance(self.major_incident_start_dt, datetime.datetime): + major_incident_start_dt: bytes = UNSET + if not isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = self.major_incident_start_dt.isoformat().encode() + else: + major_incident_start_dt = (None, str(self.major_incident_start_dt).encode(), "text/plain") + + nist_cvss_validation: Union[Unset, tuple[None, bytes, str]] - nist_cvss_validation: Union[Unset, str] if isinstance(self.nist_cvss_validation, Unset): nist_cvss_validation = UNSET elif isinstance(self.nist_cvss_validation, NistCvssValidationEnum): - nist_cvss_validation = UNSET + nist_cvss_validation: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = NistCvssValidationEnum( - self.nist_cvss_validation - ).value - + nist_cvss_validation = (None, str(self.nist_cvss_validation.value).encode(), "text/plain") else: - nist_cvss_validation = UNSET + nist_cvss_validation: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = BlankEnum(self.nist_cvss_validation).value + nist_cvss_validation = (None, str(self.nist_cvss_validation.value).encode(), "text/plain") group_key = ( - self.group_key - if self.group_key is UNSET - else (None, str(self.group_key), "text/plain") - ) - owner = ( - self.owner if self.owner is UNSET else (None, str(self.owner), "text/plain") + self.group_key if isinstance(self.group_key, Unset) else (None, str(self.group_key).encode(), "text/plain") ) + + owner = self.owner if isinstance(self.owner, Unset) else (None, str(self.owner).encode(), "text/plain") + task_key = ( - self.task_key - if self.task_key is UNSET - else (None, str(self.task_key), "text/plain") - ) - team_id = ( - self.team_id - if self.team_id is UNSET - else (None, str(self.team_id), "text/plain") + self.task_key if isinstance(self.task_key, Unset) else (None, str(self.task_key).encode(), "text/plain") ) - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(uuid, Unset): + team_id = self.team_id if isinstance(self.team_id, Unset) else (None, str(self.team_id).encode(), "text/plain") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(title, Unset): + if title is not UNSET: field_dict["title"] = title - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(comment_zero, Unset): + if comment_zero is not UNSET: field_dict["comment_zero"] = comment_zero - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(comments, Unset): + if comments is not UNSET: field_dict["comments"] = comments - if not isinstance(package_versions, Unset): + if package_versions is not UNSET: field_dict["package_versions"] = package_versions - if not isinstance(acknowledgments, Unset): + if acknowledgments is not UNSET: field_dict["acknowledgments"] = acknowledgments - if not isinstance(references, Unset): + if references is not UNSET: field_dict["references"] = references - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(classification, Unset): + if classification is not UNSET: field_dict["classification"] = classification - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(cve_id, Unset): + if cve_id is not UNSET: field_dict["cve_id"] = cve_id - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(components, Unset): + if components is not UNSET: field_dict["components"] = components - if not isinstance(cve_description, Unset): + if cve_description is not UNSET: field_dict["cve_description"] = cve_description - if not isinstance(requires_cve_description, Unset): + if requires_cve_description is not UNSET: field_dict["requires_cve_description"] = requires_cve_description - if not isinstance(statement, Unset): + if statement is not UNSET: field_dict["statement"] = statement - if not isinstance(cwe_id, Unset): + if cwe_id is not UNSET: field_dict["cwe_id"] = cwe_id - if not isinstance(unembargo_dt, Unset): + if unembargo_dt is not UNSET: field_dict["unembargo_dt"] = unembargo_dt - if not isinstance(source, Unset): + if source is not UNSET: field_dict["source"] = source - if not isinstance(reported_dt, Unset): + if reported_dt is not UNSET: field_dict["reported_dt"] = reported_dt - if not isinstance(mitigation, Unset): + if mitigation is not UNSET: field_dict["mitigation"] = mitigation - if not isinstance(major_incident_state, Unset): + if major_incident_state is not UNSET: field_dict["major_incident_state"] = major_incident_state - if not isinstance(major_incident_start_dt, Unset): + if major_incident_start_dt is not UNSET: field_dict["major_incident_start_dt"] = major_incident_start_dt - if not isinstance(nist_cvss_validation, Unset): + if nist_cvss_validation is not UNSET: field_dict["nist_cvss_validation"] = nist_cvss_validation - if not isinstance(group_key, Unset): + if group_key is not UNSET: field_dict["group_key"] = group_key - if not isinstance(owner, Unset): + if owner is not UNSET: field_dict["owner"] = owner - if not isinstance(task_key, Unset): + if task_key is not UNSET: field_dict["task_key"] = task_key - if not isinstance(team_id, Unset): + if team_id is not UNSET: field_dict["team_id"] = team_id return field_dict @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: + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.package import Package + from ..models.flaw_post_classification import FlawPostClassification + from ..models.alert import Alert + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_reference import FlawReference + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) title = d.pop("title", UNSET) - trackers = cast(List[str], d.pop("trackers", UNSET)) + trackers = cast(list[str], d.pop("trackers", UNSET)) comment_zero = d.pop("comment_zero", UNSET) affects = [] _affects = d.pop("affects", UNSET) - if _affects is UNSET: - affects = UNSET - else: - for affects_item_data in _affects or []: - _affects_item = affects_item_data - affects_item: Affect - if isinstance(_affects_item, Unset): - affects_item = UNSET - else: - affects_item = Affect.from_dict(_affects_item) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: Affect + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = Affect.from_dict(_affects_item) - affects.append(affects_item) + affects.append(affects_item) comments = [] _comments = d.pop("comments", UNSET) - if _comments is UNSET: - comments = UNSET - else: - for comments_item_data in _comments or []: - _comments_item = comments_item_data - comments_item: Comment - if isinstance(_comments_item, Unset): - comments_item = UNSET - else: - comments_item = Comment.from_dict(_comments_item) + for comments_item_data in _comments or []: + _comments_item = comments_item_data + comments_item: Comment + if isinstance(_comments_item, Unset): + comments_item = UNSET + else: + comments_item = Comment.from_dict(_comments_item) - comments.append(comments_item) + comments.append(comments_item) package_versions = [] _package_versions = d.pop("package_versions", UNSET) - if _package_versions is UNSET: - package_versions = UNSET - else: - for package_versions_item_data in _package_versions or []: - _package_versions_item = package_versions_item_data - package_versions_item: Package - if isinstance(_package_versions_item, Unset): - package_versions_item = UNSET - else: - package_versions_item = Package.from_dict(_package_versions_item) + for package_versions_item_data in _package_versions or []: + _package_versions_item = package_versions_item_data + package_versions_item: Package + if isinstance(_package_versions_item, Unset): + package_versions_item = UNSET + else: + package_versions_item = Package.from_dict(_package_versions_item) - package_versions.append(package_versions_item) + package_versions.append(package_versions_item) acknowledgments = [] _acknowledgments = d.pop("acknowledgments", UNSET) - if _acknowledgments is UNSET: - acknowledgments = UNSET - else: - for acknowledgments_item_data in _acknowledgments or []: - _acknowledgments_item = acknowledgments_item_data - acknowledgments_item: FlawAcknowledgment - if isinstance(_acknowledgments_item, Unset): - acknowledgments_item = UNSET - else: - acknowledgments_item = FlawAcknowledgment.from_dict( - _acknowledgments_item - ) + for acknowledgments_item_data in _acknowledgments or []: + _acknowledgments_item = acknowledgments_item_data + acknowledgments_item: FlawAcknowledgment + if isinstance(_acknowledgments_item, Unset): + acknowledgments_item = UNSET + else: + acknowledgments_item = FlawAcknowledgment.from_dict(_acknowledgments_item) - acknowledgments.append(acknowledgments_item) + acknowledgments.append(acknowledgments_item) references = [] _references = d.pop("references", UNSET) - if _references is UNSET: - references = UNSET - else: - for references_item_data in _references or []: - _references_item = references_item_data - references_item: FlawReference - if isinstance(_references_item, Unset): - references_item = UNSET - else: - references_item = FlawReference.from_dict(_references_item) + for references_item_data in _references or []: + _references_item = references_item_data + references_item: FlawReference + if isinstance(_references_item, Unset): + references_item = UNSET + else: + references_item = FlawReference.from_dict(_references_item) - references.append(references_item) + references.append(references_item) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: FlawCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: FlawCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) @@ -793,20 +830,24 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) + + def _parse_cve_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - cve_id = d.pop("cve_id", UNSET) + cve_id = _parse_cve_id(d.pop("cve_id", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -815,7 +856,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -827,7 +868,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -837,28 +878,22 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - components = cast(List[str], d.pop("components", UNSET)) + components = cast(list[str], d.pop("components", UNSET)) cve_description = d.pop("cve_description", UNSET) - def _parse_requires_cve_description( - data: object, - ) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: + def _parse_requires_cve_description(data: object) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _requires_cve_description_type_0 = data - requires_cve_description_type_0: Union[ - Unset, RequiresCveDescriptionEnum - ] + requires_cve_description_type_0: RequiresCveDescriptionEnum if isinstance(_requires_cve_description_type_0, Unset): requires_cve_description_type_0 = UNSET else: - requires_cve_description_type_0 = RequiresCveDescriptionEnum( - _requires_cve_description_type_0 - ) + requires_cve_description_type_0 = RequiresCveDescriptionEnum(_requires_cve_description_type_0) return requires_cve_description_type_0 except: # noqa: E722 @@ -866,32 +901,41 @@ def _parse_requires_cve_description( if not isinstance(data, str): raise TypeError() _requires_cve_description_type_1 = data - requires_cve_description_type_1: Union[Unset, BlankEnum] + requires_cve_description_type_1: BlankEnum if isinstance(_requires_cve_description_type_1, Unset): requires_cve_description_type_1 = UNSET else: - requires_cve_description_type_1 = BlankEnum( - _requires_cve_description_type_1 - ) + requires_cve_description_type_1 = BlankEnum(_requires_cve_description_type_1) return requires_cve_description_type_1 - requires_cve_description = _parse_requires_cve_description( - d.pop("requires_cve_description", UNSET) - ) + requires_cve_description = _parse_requires_cve_description(d.pop("requires_cve_description", UNSET)) statement = d.pop("statement", UNSET) cwe_id = d.pop("cwe_id", UNSET) - _unembargo_dt = d.pop("unembargo_dt", UNSET) - unembargo_dt: Union[Unset, None, datetime.datetime] - if _unembargo_dt is None: - unembargo_dt = None - elif isinstance(_unembargo_dt, Unset): - unembargo_dt = UNSET - else: - unembargo_dt = isoparse(_unembargo_dt) + def _parse_unembargo_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _unembargo_dt_type_0 = data + unembargo_dt_type_0: datetime.datetime + if isinstance(_unembargo_dt_type_0, Unset): + unembargo_dt_type_0 = UNSET + else: + unembargo_dt_type_0 = isoparse(_unembargo_dt_type_0) + + return unembargo_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + unembargo_dt = _parse_unembargo_dt(d.pop("unembargo_dt", UNSET)) def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if isinstance(data, Unset): @@ -900,7 +944,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_0 = data - source_type_0: Union[Unset, SourceBe0Enum] + source_type_0: SourceBe0Enum if isinstance(_source_type_0, Unset): source_type_0 = UNSET else: @@ -912,7 +956,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_1 = data - source_type_1: Union[Unset, BlankEnum] + source_type_1: BlankEnum if isinstance(_source_type_1, Unset): source_type_1 = UNSET else: @@ -922,33 +966,42 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: source = _parse_source(d.pop("source", UNSET)) - _reported_dt = d.pop("reported_dt", UNSET) - reported_dt: Union[Unset, None, datetime.datetime] - if _reported_dt is None: - reported_dt = None - elif isinstance(_reported_dt, Unset): - reported_dt = UNSET - else: - reported_dt = isoparse(_reported_dt) + def _parse_reported_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _reported_dt_type_0 = data + reported_dt_type_0: datetime.datetime + if isinstance(_reported_dt_type_0, Unset): + reported_dt_type_0 = UNSET + else: + reported_dt_type_0 = isoparse(_reported_dt_type_0) + + return reported_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + reported_dt = _parse_reported_dt(d.pop("reported_dt", UNSET)) mitigation = d.pop("mitigation", UNSET) - def _parse_major_incident_state( - data: object, - ) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: + def _parse_major_incident_state(data: object) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _major_incident_state_type_0 = data - major_incident_state_type_0: Union[Unset, MajorIncidentStateEnum] + major_incident_state_type_0: MajorIncidentStateEnum if isinstance(_major_incident_state_type_0, Unset): major_incident_state_type_0 = UNSET else: - major_incident_state_type_0 = MajorIncidentStateEnum( - _major_incident_state_type_0 - ) + major_incident_state_type_0 = MajorIncidentStateEnum(_major_incident_state_type_0) return major_incident_state_type_0 except: # noqa: E722 @@ -956,7 +1009,7 @@ def _parse_major_incident_state( if not isinstance(data, str): raise TypeError() _major_incident_state_type_1 = data - major_incident_state_type_1: Union[Unset, BlankEnum] + major_incident_state_type_1: BlankEnum if isinstance(_major_incident_state_type_1, Unset): major_incident_state_type_1 = UNSET else: @@ -964,35 +1017,42 @@ def _parse_major_incident_state( return major_incident_state_type_1 - major_incident_state = _parse_major_incident_state( - d.pop("major_incident_state", UNSET) - ) + major_incident_state = _parse_major_incident_state(d.pop("major_incident_state", UNSET)) - _major_incident_start_dt = d.pop("major_incident_start_dt", UNSET) - major_incident_start_dt: Union[Unset, None, datetime.datetime] - if _major_incident_start_dt is None: - major_incident_start_dt = None - elif isinstance(_major_incident_start_dt, Unset): - major_incident_start_dt = UNSET - else: - major_incident_start_dt = isoparse(_major_incident_start_dt) + def _parse_major_incident_start_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _major_incident_start_dt_type_0 = data + major_incident_start_dt_type_0: datetime.datetime + if isinstance(_major_incident_start_dt_type_0, Unset): + major_incident_start_dt_type_0 = UNSET + else: + major_incident_start_dt_type_0 = isoparse(_major_incident_start_dt_type_0) - def _parse_nist_cvss_validation( - data: object, - ) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: + return major_incident_start_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + major_incident_start_dt = _parse_major_incident_start_dt(d.pop("major_incident_start_dt", UNSET)) + + def _parse_nist_cvss_validation(data: object) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_0 = data - nist_cvss_validation_type_0: Union[Unset, NistCvssValidationEnum] + nist_cvss_validation_type_0: NistCvssValidationEnum if isinstance(_nist_cvss_validation_type_0, Unset): nist_cvss_validation_type_0 = UNSET else: - nist_cvss_validation_type_0 = NistCvssValidationEnum( - _nist_cvss_validation_type_0 - ) + nist_cvss_validation_type_0 = NistCvssValidationEnum(_nist_cvss_validation_type_0) return nist_cvss_validation_type_0 except: # noqa: E722 @@ -1000,7 +1060,7 @@ def _parse_nist_cvss_validation( if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_1 = data - nist_cvss_validation_type_1: Union[Unset, BlankEnum] + nist_cvss_validation_type_1: BlankEnum if isinstance(_nist_cvss_validation_type_1, Unset): nist_cvss_validation_type_1 = UNSET else: @@ -1008,9 +1068,7 @@ def _parse_nist_cvss_validation( return nist_cvss_validation_type_1 - nist_cvss_validation = _parse_nist_cvss_validation( - d.pop("nist_cvss_validation", UNSET) - ) + nist_cvss_validation = _parse_nist_cvss_validation(d.pop("nist_cvss_validation", UNSET)) group_key = d.pop("group_key", UNSET) @@ -1058,45 +1116,8 @@ def _parse_nist_cvss_validation( flaw_post.additional_properties = d return flaw_post - @staticmethod - def get_fields(): - return { - "uuid": str, - "title": str, - "trackers": List[str], - "comment_zero": str, - "affects": List[Affect], - "comments": List[Comment], - "package_versions": List[Package], - "acknowledgments": List[FlawAcknowledgment], - "references": List[FlawReference], - "cvss_scores": List[FlawCVSS], - "embargoed": bool, - "created_dt": datetime.datetime, - "classification": FlawPostClassification, - "alerts": List[Alert], - "cve_id": str, - "impact": Union[BlankEnum, ImpactEnum], - "components": List[str], - "cve_description": str, - "requires_cve_description": Union[BlankEnum, RequiresCveDescriptionEnum], - "statement": str, - "cwe_id": str, - "unembargo_dt": datetime.datetime, - "source": Union[BlankEnum, SourceBe0Enum], - "reported_dt": datetime.datetime, - "mitigation": str, - "major_incident_state": Union[BlankEnum, MajorIncidentStateEnum], - "major_incident_start_dt": datetime.datetime, - "nist_cvss_validation": Union[BlankEnum, NistCvssValidationEnum], - "group_key": str, - "owner": str, - "task_key": str, - "team_id": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_post_classification.py b/osidb_bindings/bindings/python_client/models/flaw_post_classification.py index 30d87c0..6e243cf 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_post_classification.py +++ b/osidb_bindings/bindings/python_client/models/flaw_post_classification.py @@ -1,39 +1,47 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel from ..models.flaw_post_classification_state import FlawPostClassificationState -from ..types import UNSET, OSIDBModel, Unset + T = TypeVar("T", bound="FlawPostClassification") -@attr.s(auto_attribs=True) +@_attrs_define class FlawPostClassification(OSIDBModel): - """ """ + """ + Attributes: + workflow (Union[Unset, str]): + state (Union[Unset, FlawPostClassificationState]): + """ workflow: Union[Unset, str] = UNSET state: Union[Unset, FlawPostClassificationState] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: workflow = self.workflow + + print(FlawPostClassificationState) state: Union[Unset, str] = UNSET if not isinstance(self.state, Unset): + state = self.state.value - state = FlawPostClassificationState(self.state).value - - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(workflow, Unset): + if workflow is not UNSET: field_dict["workflow"] = workflow - if not isinstance(state, Unset): + if state is not UNSET: field_dict["state"] = state return field_dict @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() workflow = d.pop("workflow", UNSET) @@ -52,15 +60,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_post_classification.additional_properties = d return flaw_post_classification - @staticmethod - def get_fields(): - return { - "workflow": str, - "state": FlawPostClassificationState, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_post_classification_state.py b/osidb_bindings/bindings/python_client/models/flaw_post_classification_state.py index 6549611..2d2140e 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_post_classification_state.py +++ b/osidb_bindings/bindings/python_client/models/flaw_post_classification_state.py @@ -2,13 +2,13 @@ class FlawPostClassificationState(str, Enum): - VALUE_0 = "" + DONE = "DONE" NEW = "NEW" - TRIAGE = "TRIAGE" PRE_SECONDARY_ASSESSMENT = "PRE_SECONDARY_ASSESSMENT" - SECONDARY_ASSESSMENT = "SECONDARY_ASSESSMENT" - DONE = "DONE" REJECTED = "REJECTED" + SECONDARY_ASSESSMENT = "SECONDARY_ASSESSMENT" + TRIAGE = "TRIAGE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/flaw_reference.py b/osidb_bindings/bindings/python_client/models/flaw_reference.py index ea481d8..810c8e5 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_reference.py +++ b/osidb_bindings/bindings/python_client/models/flaw_reference.py @@ -1,41 +1,69 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.flaw_reference_type import FlawReferenceType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="FlawReference") -@attr.s(auto_attribs=True) +@_attrs_define class FlawReference(OSIDBModel): - """FlawReference serializer""" - - flaw: str + """FlawReference serializer + + Attributes: + flaw (UUID): + url (str): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + description (Union[Unset, str]): + type_ (Union[Unset, FlawReferenceType]): + """ + + flaw: UUID url: str - uuid: str + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime description: Union[Unset, str] = UNSET - type: Union[Unset, FlawReferenceType] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + type_: Union[Unset, FlawReferenceType] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) - def to_dict(self) -> Dict[str, Any]: - flaw = self.flaw url = self.url - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -50,59 +78,69 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() description = self.description - type: Union[Unset, str] = UNSET - if not isinstance(self.type, Unset): - type = FlawReferenceType(self.type).value + print(FlawReferenceType) + type_: Union[Unset, str] = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(url, Unset): + if url is not UNSET: field_dict["url"] = url - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(type, Unset): - field_dict["type"] = type + if type_ is not UNSET: + field_dict["type"] = type_ return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) url = d.pop("url", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -120,12 +158,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: description = d.pop("description", UNSET) - _type = d.pop("type", UNSET) - type: Union[Unset, FlawReferenceType] - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: Union[Unset, FlawReferenceType] + if isinstance(_type_, Unset): + type_ = UNSET else: - type = FlawReferenceType(_type) + type_ = FlawReferenceType(_type_) flaw_reference = cls( flaw=flaw, @@ -136,28 +174,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: created_dt=created_dt, updated_dt=updated_dt, description=description, - type=type, + type_=type_, ) flaw_reference.additional_properties = d return flaw_reference - @staticmethod - def get_fields(): - return { - "flaw": str, - "url": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "description": str, - "type": FlawReferenceType, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_reference_post.py b/osidb_bindings/bindings/python_client/models/flaw_reference_post.py index 2f61d82..ded5976 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_reference_post.py +++ b/osidb_bindings/bindings/python_client/models/flaw_reference_post.py @@ -1,39 +1,61 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.flaw_reference_type import FlawReferenceType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="FlawReferencePost") -@attr.s(auto_attribs=True) +@_attrs_define class FlawReferencePost(OSIDBModel): - """FlawReference serializer""" + """FlawReference serializer + + Attributes: + url (str): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + description (Union[Unset, str]): + type_ (Union[Unset, FlawReferenceType]): + """ url: str - uuid: str + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime description: Union[Unset, str] = UNSET - type: Union[Unset, FlawReferenceType] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + type_: Union[Unset, FlawReferenceType] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: url = self.url - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -44,110 +66,113 @@ def to_dict(self) -> Dict[str, Any]: created_dt = self.created_dt.isoformat() description = self.description - type: Union[Unset, str] = UNSET - if not isinstance(self.type, Unset): - type = FlawReferenceType(self.type).value + print(FlawReferenceType) + type_: Union[Unset, str] = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(url, Unset): + if url is not UNSET: field_dict["url"] = url - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(type, Unset): - field_dict["type"] = type + if type_ is not UNSET: + field_dict["type"] = type_ return field_dict - def to_multipart(self) -> Dict[str, Any]: - url = self.url if self.url is UNSET else (None, str(self.url), "text/plain") - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + url = (None, str(self.url).encode(), "text/plain") + + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() description = ( self.description - if self.description is UNSET - else (None, str(self.description), "text/plain") + if isinstance(self.description, Unset) + else (None, str(self.description).encode(), "text/plain") ) - type: Union[Unset, Tuple[None, str, str]] = UNSET - if not isinstance(self.type, Unset): - type = FlawReferenceType(self.type).value + type_: Union[Unset, tuple[None, bytes, str]] = UNSET + if not isinstance(self.type_, Unset): + type_ = (None, str(self.type_.value).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(url, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if url is not UNSET: field_dict["url"] = url - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(type, Unset): - field_dict["type"] = type + if type_ is not UNSET: + field_dict["type"] = type_ return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() url = d.pop("url", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -158,12 +183,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: description = d.pop("description", UNSET) - _type = d.pop("type", UNSET) - type: Union[Unset, FlawReferenceType] - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: Union[Unset, FlawReferenceType] + if isinstance(_type_, Unset): + type_ = UNSET else: - type = FlawReferenceType(_type) + type_ = FlawReferenceType(_type_) flaw_reference_post = cls( url=url, @@ -172,26 +197,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts=alerts, created_dt=created_dt, description=description, - type=type, + type_=type_, ) flaw_reference_post.additional_properties = d return flaw_reference_post - @staticmethod - def get_fields(): - return { - "url": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "description": str, - "type": FlawReferenceType, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_reference_put.py b/osidb_bindings/bindings/python_client/models/flaw_reference_put.py index 9fafd75..d743ecf 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_reference_put.py +++ b/osidb_bindings/bindings/python_client/models/flaw_reference_put.py @@ -1,40 +1,64 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.flaw_reference_type import FlawReferenceType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="FlawReferencePut") -@attr.s(auto_attribs=True) +@_attrs_define class FlawReferencePut(OSIDBModel): - """FlawReference serializer""" + """FlawReference serializer + + Attributes: + url (str): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + description (Union[Unset, str]): + type_ (Union[Unset, FlawReferenceType]): + """ url: str - uuid: str + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime description: Union[Unset, str] = UNSET - type: Union[Unset, FlawReferenceType] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + type_: Union[Unset, FlawReferenceType] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: url = self.url - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -49,118 +73,121 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() description = self.description - type: Union[Unset, str] = UNSET - if not isinstance(self.type, Unset): - type = FlawReferenceType(self.type).value + print(FlawReferenceType) + type_: Union[Unset, str] = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(url, Unset): + if url is not UNSET: field_dict["url"] = url - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(type, Unset): - field_dict["type"] = type + if type_ is not UNSET: + field_dict["type"] = type_ return field_dict - def to_multipart(self) -> Dict[str, Any]: - url = self.url if self.url is UNSET else (None, str(self.url), "text/plain") - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + url = (None, str(self.url).encode(), "text/plain") + + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() description = ( self.description - if self.description is UNSET - else (None, str(self.description), "text/plain") + if isinstance(self.description, Unset) + else (None, str(self.description).encode(), "text/plain") ) - type: Union[Unset, Tuple[None, str, str]] = UNSET - if not isinstance(self.type, Unset): - type = FlawReferenceType(self.type).value + type_: Union[Unset, tuple[None, bytes, str]] = UNSET + if not isinstance(self.type_, Unset): + type_ = (None, str(self.type_.value).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(url, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if url is not UNSET: field_dict["url"] = url - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(type, Unset): - field_dict["type"] = type + if type_ is not UNSET: + field_dict["type"] = type_ return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() url = d.pop("url", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -178,12 +205,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: description = d.pop("description", UNSET) - _type = d.pop("type", UNSET) - type: Union[Unset, FlawReferenceType] - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: Union[Unset, FlawReferenceType] + if isinstance(_type_, Unset): + type_ = UNSET else: - type = FlawReferenceType(_type) + type_ = FlawReferenceType(_type_) flaw_reference_put = cls( url=url, @@ -193,27 +220,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: created_dt=created_dt, updated_dt=updated_dt, description=description, - type=type, + type_=type_, ) flaw_reference_put.additional_properties = d return flaw_reference_put - @staticmethod - def get_fields(): - return { - "url": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "description": str, - "type": FlawReferenceType, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_report_data.py b/osidb_bindings/bindings/python_client/models/flaw_report_data.py index ce0fa82..2ebc179 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_report_data.py +++ b/osidb_bindings/bindings/python_client/models/flaw_report_data.py @@ -1,61 +1,83 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.affect_report_data import AffectReportData -from ..models.affect_report_data import AffectReportData -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawReportData") -@attr.s(auto_attribs=True) +@_attrs_define class FlawReportData(OSIDBModel): - """ """ - - cve_id: Union[Unset, None, str] = UNSET - affects: Union[Unset, List[AffectReportData]] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + """ + Attributes: + cve_id (Union[None, Unset, str]): + affects (Union[Unset, list['AffectReportData']]): + """ + + cve_id: Union[None, Unset, str] = UNSET + affects: Union[Unset, list["AffectReportData"]] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cve_id: Union[None, Unset, str] + if isinstance(self.cve_id, Unset): + cve_id = UNSET + else: + cve_id = self.cve_id - def to_dict(self) -> Dict[str, Any]: - cve_id = self.cve_id - affects: Union[Unset, List[Dict[str, Any]]] = UNSET + affects: Union[Unset, list[dict[str, Any]]] = UNSET if not isinstance(self.affects, Unset): affects = [] for affects_item_data in self.affects: - affects_item: Dict[str, Any] = UNSET + affects_item: dict[str, Any] = UNSET if not isinstance(affects_item_data, Unset): affects_item = affects_item_data.to_dict() affects.append(affects_item) - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cve_id, Unset): + if cve_id is not UNSET: field_dict["cve_id"] = cve_id - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects return field_dict @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: + from ..models.affect_report_data import AffectReportData + d = src_dict.copy() - cve_id = d.pop("cve_id", UNSET) + + def _parse_cve_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + cve_id = _parse_cve_id(d.pop("cve_id", UNSET)) affects = [] _affects = d.pop("affects", UNSET) - if _affects is UNSET: - affects = UNSET - else: - for affects_item_data in _affects or []: - _affects_item = affects_item_data - affects_item: AffectReportData - if isinstance(_affects_item, Unset): - affects_item = UNSET - else: - affects_item = AffectReportData.from_dict(_affects_item) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: AffectReportData + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = AffectReportData.from_dict(_affects_item) - affects.append(affects_item) + affects.append(affects_item) flaw_report_data = cls( cve_id=cve_id, @@ -65,15 +87,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_report_data.additional_properties = d return flaw_report_data - @staticmethod - def get_fields(): - return { - "cve_id": str, - "affects": List[AffectReportData], - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_uuid_list.py b/osidb_bindings/bindings/python_client/models/flaw_uuid_list.py index 85d8933..aa2180c 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_uuid_list.py +++ b/osidb_bindings/bindings/python_client/models/flaw_uuid_list.py @@ -1,54 +1,80 @@ +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union, cast -import attr +from ..types import UNSET, Unset, OSIDBModel + +from uuid import UUID -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawUUIDList") -@attr.s(auto_attribs=True) +@_attrs_define class FlawUUIDList(OSIDBModel): - """ """ + """ + Attributes: + flaw_uuids (list[UUID]): + """ - flaw_uuids: List[str] - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + flaw_uuids: list[UUID] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - flaw_uuids: List[str] = UNSET + def to_dict(self) -> dict[str, Any]: + flaw_uuids: list[str] = UNSET if not isinstance(self.flaw_uuids, Unset): - flaw_uuids = self.flaw_uuids + flaw_uuids = [] + for flaw_uuids_item_data in self.flaw_uuids: + flaw_uuids_item: str = UNSET + if not isinstance(flaw_uuids_item_data, Unset): + flaw_uuids_item = str(flaw_uuids_item_data) - field_dict: Dict[str, Any] = {} + flaw_uuids.append(flaw_uuids_item) + + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw_uuids, Unset): + if flaw_uuids is not UNSET: field_dict["flaw_uuids"] = flaw_uuids return field_dict - def to_multipart(self) -> Dict[str, Any]: - flaw_uuids: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + flaw_uuids: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.flaw_uuids, Unset): - _temp_flaw_uuids = self.flaw_uuids - flaw_uuids = (None, json.dumps(_temp_flaw_uuids), "application/json") - - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(flaw_uuids, Unset): + _temp_flaw_uuids = [] + for flaw_uuids_item_data in self.flaw_uuids: + flaw_uuids_item: str = UNSET + if not isinstance(flaw_uuids_item_data, Unset): + flaw_uuids_item = str(flaw_uuids_item_data) + + _temp_flaw_uuids.append(flaw_uuids_item) + flaw_uuids = (None, json.dumps(_temp_flaw_uuids).encode(), "application/json") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if flaw_uuids is not UNSET: field_dict["flaw_uuids"] = flaw_uuids return field_dict @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() - flaw_uuids = cast(List[str], d.pop("flaw_uuids", UNSET)) + flaw_uuids = [] + _flaw_uuids = d.pop("flaw_uuids", UNSET) + for flaw_uuids_item_data in _flaw_uuids or []: + _flaw_uuids_item = flaw_uuids_item_data + flaw_uuids_item: UUID + if isinstance(_flaw_uuids_item, Unset): + flaw_uuids_item = UNSET + else: + flaw_uuids_item = UUID(_flaw_uuids_item) + + flaw_uuids.append(flaw_uuids_item) flaw_uuid_list = cls( flaw_uuids=flaw_uuids, @@ -57,14 +83,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_uuid_list.additional_properties = d return flaw_uuid_list - @staticmethod - def get_fields(): - return { - "flaw_uuids": List[str], - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/flaw_version.py b/osidb_bindings/bindings/python_client/models/flaw_version.py index 0438341..f1283c2 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_version.py +++ b/osidb_bindings/bindings/python_client/models/flaw_version.py @@ -1,31 +1,37 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawVersion") -@attr.s(auto_attribs=True) +@_attrs_define class FlawVersion(OSIDBModel): - """PackageVer serializer used by FlawPackageVersionSerializer.""" + """PackageVer serializer used by FlawPackageVersionSerializer. + + Attributes: + version (str): + """ version: str - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() version = d.pop("version", UNSET) @@ -36,14 +42,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw_version.additional_properties = d return flaw_version - @staticmethod - def get_fields(): - return { - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/impact_enum.py b/osidb_bindings/bindings/python_client/models/impact_enum.py index bcfb004..61c9b9a 100644 --- a/osidb_bindings/bindings/python_client/models/impact_enum.py +++ b/osidb_bindings/bindings/python_client/models/impact_enum.py @@ -2,10 +2,10 @@ class ImpactEnum(str, Enum): + CRITICAL = "CRITICAL" + IMPORTANT = "IMPORTANT" LOW = "LOW" MODERATE = "MODERATE" - IMPORTANT = "IMPORTANT" - CRITICAL = "CRITICAL" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/issuer_enum.py b/osidb_bindings/bindings/python_client/models/issuer_enum.py index ef01f1a..9ace496 100644 --- a/osidb_bindings/bindings/python_client/models/issuer_enum.py +++ b/osidb_bindings/bindings/python_client/models/issuer_enum.py @@ -3,9 +3,9 @@ class IssuerEnum(str, Enum): CVEORG = "CVEORG" - RH = "RH" NIST = "NIST" OSV = "OSV" + RH = "RH" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/major_incident_state_enum.py b/osidb_bindings/bindings/python_client/models/major_incident_state_enum.py index f548bcd..f00a1ad 100644 --- a/osidb_bindings/bindings/python_client/models/major_incident_state_enum.py +++ b/osidb_bindings/bindings/python_client/models/major_incident_state_enum.py @@ -2,13 +2,13 @@ class MajorIncidentStateEnum(str, Enum): - REQUESTED = "REQUESTED" - REJECTED = "REJECTED" APPROVED = "APPROVED" CISA_APPROVED = "CISA_APPROVED" + INVALID = "INVALID" MINOR = "MINOR" + REJECTED = "REJECTED" + REQUESTED = "REQUESTED" ZERO_DAY = "ZERO_DAY" - INVALID = "INVALID" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/module_component.py b/osidb_bindings/bindings/python_client/models/module_component.py index d8958cc..c2b0176 100644 --- a/osidb_bindings/bindings/python_client/models/module_component.py +++ b/osidb_bindings/bindings/python_client/models/module_component.py @@ -1,60 +1,78 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar, TYPE_CHECKING -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + + +if TYPE_CHECKING: + from ..models.affect import Affect + from ..models.ps_stream_selection import PsStreamSelection -from ..models.affect import Affect -from ..models.ps_stream_selection import PsStreamSelection -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="ModuleComponent") -@attr.s(auto_attribs=True) +@_attrs_define class ModuleComponent(OSIDBModel): - """ """ + """ + Attributes: + ps_module (str): + ps_component (str): + streams (list['PsStreamSelection']): + selected (bool): + affect (Affect): Affect serializer + """ ps_module: str ps_component: str - streams: List[PsStreamSelection] + streams: list["PsStreamSelection"] selected: bool - affect: Affect - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + affect: "Affect" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: ps_module = self.ps_module + ps_component = self.ps_component - streams: List[Dict[str, Any]] = UNSET + + streams: list[dict[str, Any]] = UNSET if not isinstance(self.streams, Unset): streams = [] for streams_item_data in self.streams: - streams_item: Dict[str, Any] = UNSET + streams_item: dict[str, Any] = UNSET if not isinstance(streams_item_data, Unset): streams_item = streams_item_data.to_dict() streams.append(streams_item) selected = self.selected - affect: Dict[str, Any] = UNSET + + affect: dict[str, Any] = UNSET if not isinstance(self.affect, Unset): affect = self.affect.to_dict() - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(ps_module, Unset): + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(streams, Unset): + if streams is not UNSET: field_dict["streams"] = streams - if not isinstance(selected, Unset): + if selected is not UNSET: field_dict["selected"] = selected - if not isinstance(affect, Unset): + if affect is not UNSET: field_dict["affect"] = affect return field_dict @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: + from ..models.affect import Affect + from ..models.ps_stream_selection import PsStreamSelection + d = src_dict.copy() ps_module = d.pop("ps_module", UNSET) @@ -62,18 +80,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: streams = [] _streams = d.pop("streams", UNSET) - if _streams is UNSET: - streams = UNSET - else: - for streams_item_data in _streams or []: - _streams_item = streams_item_data - streams_item: PsStreamSelection - if isinstance(_streams_item, Unset): - streams_item = UNSET - else: - streams_item = PsStreamSelection.from_dict(_streams_item) + for streams_item_data in _streams or []: + _streams_item = streams_item_data + streams_item: PsStreamSelection + if isinstance(_streams_item, Unset): + streams_item = UNSET + else: + streams_item = PsStreamSelection.from_dict(_streams_item) - streams.append(streams_item) + streams.append(streams_item) selected = d.pop("selected", UNSET) @@ -95,18 +110,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: module_component.additional_properties = d return module_component - @staticmethod - def get_fields(): - return { - "ps_module": str, - "ps_component": str, - "streams": List[PsStreamSelection], - "selected": bool, - "affect": Affect, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/nist_cvss_validation_enum.py b/osidb_bindings/bindings/python_client/models/nist_cvss_validation_enum.py index e12cfda..c51009c 100644 --- a/osidb_bindings/bindings/python_client/models/nist_cvss_validation_enum.py +++ b/osidb_bindings/bindings/python_client/models/nist_cvss_validation_enum.py @@ -2,9 +2,9 @@ class NistCvssValidationEnum(str, Enum): - REQUESTED = "REQUESTED" APPROVED = "APPROVED" REJECTED = "REJECTED" + REQUESTED = "REQUESTED" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_create_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_create_response_200.py index 0c19cb4..39d22a6 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_create_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_create_response_200.py @@ -1,32 +1,44 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.affect import Affect -from ..models.affect import Affect -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsBulkCreateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsBulkCreateResponse200(OSIDBModel): - """ """ - - results: List[Affect] + """ + Attributes: + results (list['Affect']): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + results: list["Affect"] dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - results: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() @@ -37,41 +49,42 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.affect import Affect + d = src_dict.copy() results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Affect - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Affect.from_dict(_results_item) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Affect + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Affect.from_dict(_results_item) - results.append(results_item) + results.append(results_item) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -97,18 +110,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_bulk_create_response_200.additional_properties = d return osidb_api_v1_affects_bulk_create_response_200 - @staticmethod - def get_fields(): - return { - "results": List[Affect], - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_destroy_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_destroy_response_200.py index 550ece8..82d6097 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_destroy_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_destroy_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsBulkDestroyResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsBulkDestroyResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_bulk_destroy_response_200.additional_properties = d return osidb_api_v1_affects_bulk_destroy_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_update_response_200.py index 54aa093..41e0f80 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_bulk_update_response_200.py @@ -1,32 +1,44 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.affect import Affect -from ..models.affect import Affect -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsBulkUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsBulkUpdateResponse200(OSIDBModel): - """ """ - - results: List[Affect] + """ + Attributes: + results (list['Affect']): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + results: list["Affect"] dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - results: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() @@ -37,41 +49,42 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.affect import Affect + d = src_dict.copy() results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Affect - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Affect.from_dict(_results_item) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Affect + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Affect.from_dict(_results_item) - results.append(results_item) + results.append(results_item) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -97,18 +110,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_bulk_update_response_200.additional_properties = d return osidb_api_v1_affects_bulk_update_response_200 - @staticmethod - def get_fields(): - return { - "results": List[Affect], - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_create_response_201.py index 065e332..5f0cf43 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_create_response_201.py @@ -1,78 +1,125 @@ -import datetime -from typing import Any, Dict, List, Optional, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect_cvss import AffectCVSS from ..models.affectedness_enum import AffectednessEnum -from ..models.alert import Alert from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum -from ..models.tracker import Tracker -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + T = TypeVar("T", bound="OsidbApiV1AffectsCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsCreateResponse201(OSIDBModel): - """ """ - - uuid: str + """ + Attributes: + uuid (UUID): + flaw (Union[None, UUID]): + ps_module (str): + ps_product (str): + trackers (list['Tracker']): + delegated_resolution (str): + cvss_scores (list['AffectCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affectedness (Union[AffectednessEnum, BlankEnum, Unset]): + resolution (Union[BlankEnum, ResolutionEnum, Unset]): + ps_component (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + purl (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + uuid: UUID + flaw: Union[None, UUID] ps_module: str ps_product: str - trackers: List[Tracker] + trackers: list["Tracker"] delegated_resolution: str - cvss_scores: List[AffectCVSS] + cvss_scores: list["AffectCVSS"] embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Optional[str] affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET - ps_component: Union[Unset, None, str] = UNSET + ps_component: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - purl: Union[Unset, None, str] = UNSET + purl: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + flaw: Union[None, str] + if isinstance(self.flaw, UUID): + flaw = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + else: + flaw = self.flaw - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid ps_module = self.ps_module + ps_product = self.ps_product - trackers: List[Dict[str, Any]] = UNSET + + trackers: list[dict[str, Any]] = UNSET if not isinstance(self.trackers, Unset): trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() trackers.append(trackers_item) delegated_resolution = self.delegated_resolution - cvss_scores: List[Dict[str, Any]] = UNSET + + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -86,111 +133,151 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): + print(AffectednessEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value + affectedness = self.affectedness.value else: + print(BlankEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = BlankEnum(self.affectedness).value + affectedness = self.affectedness.value resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): + print(ResolutionEnum) resolution = UNSET if not isinstance(self.resolution, Unset): - - resolution = ResolutionEnum(self.resolution).value + resolution = self.resolution.value else: + print(BlankEnum) resolution = UNSET if not isinstance(self.resolution, Unset): + resolution = self.resolution.value - resolution = BlankEnum(self.resolution).value + ps_component: Union[None, Unset, str] + if isinstance(self.ps_component, Unset): + ps_component = UNSET + else: + ps_component = self.ps_component - ps_component = self.ps_component impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value + purl: Union[None, Unset, str] + if isinstance(self.purl, Unset): + purl = UNSET + else: + purl = self.purl - purl = self.purl dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(ps_module, Unset): + if flaw is not UNSET: + field_dict["flaw"] = flaw + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_product, Unset): + if ps_product is not UNSET: field_dict["ps_product"] = ps_product - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(delegated_resolution, Unset): + if delegated_resolution is not UNSET: field_dict["delegated_resolution"] = delegated_resolution - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): - field_dict["flaw"] = flaw - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(purl, Unset): + if purl is not UNSET: field_dict["purl"] = purl - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) + + def _parse_flaw(data: object) -> Union[None, UUID]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + _flaw_type_0 = data + flaw_type_0: UUID + if isinstance(_flaw_type_0, Unset): + flaw_type_0 = UNSET + else: + flaw_type_0 = UUID(_flaw_type_0) + + return flaw_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID], data) + + flaw = _parse_flaw(d.pop("flaw", UNSET)) ps_module = d.pop("ps_module", UNSET) @@ -198,52 +285,43 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: trackers = [] _trackers = d.pop("trackers", UNSET) - if _trackers is UNSET: - trackers = UNSET - else: - for trackers_item_data in _trackers or []: - _trackers_item = trackers_item_data - trackers_item: Tracker - if isinstance(_trackers_item, Unset): - trackers_item = UNSET - else: - trackers_item = Tracker.from_dict(_trackers_item) + for trackers_item_data in _trackers or []: + _trackers_item = trackers_item_data + trackers_item: Tracker + if isinstance(_trackers_item, Unset): + trackers_item = UNSET + else: + trackers_item = Tracker.from_dict(_trackers_item) - trackers.append(trackers_item) + trackers.append(trackers_item) delegated_resolution = d.pop("delegated_resolution", UNSET) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: AffectCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: AffectCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -259,18 +337,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) - - def _parse_affectedness( - data: object, - ) -> Union[AffectednessEnum, BlankEnum, Unset]: + def _parse_affectedness(data: object) -> Union[AffectednessEnum, BlankEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _affectedness_type_0 = data - affectedness_type_0: Union[Unset, AffectednessEnum] + affectedness_type_0: AffectednessEnum if isinstance(_affectedness_type_0, Unset): affectedness_type_0 = UNSET else: @@ -282,7 +356,7 @@ def _parse_affectedness( if not isinstance(data, str): raise TypeError() _affectedness_type_1 = data - affectedness_type_1: Union[Unset, BlankEnum] + affectedness_type_1: BlankEnum if isinstance(_affectedness_type_1, Unset): affectedness_type_1 = UNSET else: @@ -299,7 +373,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_0 = data - resolution_type_0: Union[Unset, ResolutionEnum] + resolution_type_0: ResolutionEnum if isinstance(_resolution_type_0, Unset): resolution_type_0 = UNSET else: @@ -311,7 +385,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_1 = data - resolution_type_1: Union[Unset, BlankEnum] + resolution_type_1: BlankEnum if isinstance(_resolution_type_1, Unset): resolution_type_1 = UNSET else: @@ -321,7 +395,14 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: resolution = _parse_resolution(d.pop("resolution", UNSET)) - ps_component = d.pop("ps_component", UNSET) + def _parse_ps_component(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + ps_component = _parse_ps_component(d.pop("ps_component", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -330,7 +411,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -342,7 +423,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -352,7 +433,14 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - purl = d.pop("purl", UNSET) + def _parse_purl(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + purl = _parse_purl(d.pop("purl", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -369,6 +457,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: osidb_api_v1_affects_create_response_201 = cls( uuid=uuid, + flaw=flaw, ps_module=ps_module, ps_product=ps_product, trackers=trackers, @@ -378,7 +467,6 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: alerts=alerts, created_dt=created_dt, updated_dt=updated_dt, - flaw=flaw, affectedness=affectedness, resolution=resolution, ps_component=ps_component, @@ -393,33 +481,8 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: osidb_api_v1_affects_create_response_201.additional_properties = d return osidb_api_v1_affects_create_response_201 - @staticmethod - def get_fields(): - return { - "uuid": str, - "ps_module": str, - "ps_product": str, - "trackers": List[Tracker], - "delegated_resolution": str, - "cvss_scores": List[AffectCVSS], - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "affectedness": Union[AffectednessEnum, BlankEnum], - "resolution": Union[BlankEnum, ResolutionEnum], - "ps_component": str, - "impact": Union[BlankEnum, ImpactEnum], - "purl": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_create_response_201.py index c177ee7..b2c728b 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_create_response_201.py @@ -1,58 +1,90 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1AffectsCvssScoresCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsCvssScoresCreateResponse201(OSIDBModel): - """ """ + """ + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affect (Union[Unset, UUID]): + comment (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affect: Union[Unset, str] = UNSET - comment: Union[Unset, None, str] = UNSET + affect: Union[Unset, UUID] = UNSET + comment: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -66,53 +98,65 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affect = self.affect - comment = self.comment + affect: Union[Unset, str] = UNSET + if not isinstance(self.affect, Unset): + affect = str(self.affect) + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affect, Unset): + if affect is not UNSET: field_dict["affect"] = affect - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -130,7 +174,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -138,18 +187,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -165,9 +211,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affect = d.pop("affect", UNSET) + _affect = d.pop("affect", UNSET) + affect: Union[Unset, UUID] + if isinstance(_affect, Unset): + affect = UNSET + else: + affect = UUID(_affect) + + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - comment = d.pop("comment", UNSET) + comment = _parse_comment(d.pop("comment", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -203,28 +261,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_cvss_scores_create_response_201.additional_properties = d return osidb_api_v1_affects_cvss_scores_create_response_201 - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affect": str, - "comment": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_destroy_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_destroy_response_200.py index 489d815..dd62194 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_destroy_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_destroy_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsCvssScoresDestroyResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsCvssScoresDestroyResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_cvss_scores_destroy_response_200.additional_properties = d return osidb_api_v1_affects_cvss_scores_destroy_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_list_response_200.py index 4ed052b..900abe9 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.affect_cvss import AffectCVSS -from ..models.affect_cvss import AffectCVSS -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsCvssScoresListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsCvssScoresListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['AffectCVSS']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[AffectCVSS] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["AffectCVSS"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.affect_cvss import AffectCVSS + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: AffectCVSS - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = AffectCVSS.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: AffectCVSS + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = AffectCVSS.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_cvss_scores_list_response_200.additional_properties = d return osidb_api_v1_affects_cvss_scores_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[AffectCVSS], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_retrieve_response_200.py index a2f597e..7b75359 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_retrieve_response_200.py @@ -1,58 +1,90 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1AffectsCvssScoresRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsCvssScoresRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affect (Union[Unset, UUID]): + comment (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affect: Union[Unset, str] = UNSET - comment: Union[Unset, None, str] = UNSET + affect: Union[Unset, UUID] = UNSET + comment: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -66,53 +98,65 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affect = self.affect - comment = self.comment + affect: Union[Unset, str] = UNSET + if not isinstance(self.affect, Unset): + affect = str(self.affect) + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affect, Unset): + if affect is not UNSET: field_dict["affect"] = affect - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -130,7 +174,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -138,18 +187,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -165,9 +211,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affect = d.pop("affect", UNSET) + _affect = d.pop("affect", UNSET) + affect: Union[Unset, UUID] + if isinstance(_affect, Unset): + affect = UNSET + else: + affect = UUID(_affect) + + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - comment = d.pop("comment", UNSET) + comment = _parse_comment(d.pop("comment", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -203,28 +261,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_cvss_scores_retrieve_response_200.additional_properties = d return osidb_api_v1_affects_cvss_scores_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affect": str, - "comment": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_update_response_200.py index 3b31999..5af1653 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_cvss_scores_update_response_200.py @@ -1,58 +1,90 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1AffectsCvssScoresUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsCvssScoresUpdateResponse200(OSIDBModel): - """ """ + """ + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affect (Union[Unset, UUID]): + comment (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affect: Union[Unset, str] = UNSET - comment: Union[Unset, None, str] = UNSET + affect: Union[Unset, UUID] = UNSET + comment: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -66,53 +98,65 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affect = self.affect - comment = self.comment + affect: Union[Unset, str] = UNSET + if not isinstance(self.affect, Unset): + affect = str(self.affect) + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affect, Unset): + if affect is not UNSET: field_dict["affect"] = affect - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -130,7 +174,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -138,18 +187,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -165,9 +211,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affect = d.pop("affect", UNSET) + _affect = d.pop("affect", UNSET) + affect: Union[Unset, UUID] + if isinstance(_affect, Unset): + affect = UNSET + else: + affect = UUID(_affect) + + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - comment = d.pop("comment", UNSET) + comment = _parse_comment(d.pop("comment", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -203,28 +261,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_cvss_scores_update_response_200.additional_properties = d return osidb_api_v1_affects_cvss_scores_update_response_200 - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affect": str, - "comment": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_destroy_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_destroy_response_200.py index 47fea84..eaa55c1 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_destroy_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_destroy_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsDestroyResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsDestroyResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_destroy_response_200.additional_properties = d return osidb_api_v1_affects_destroy_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_affectedness.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_affectedness.py index 781ba64..c6baeda 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_affectedness.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_affectedness.py @@ -2,10 +2,10 @@ class OsidbApiV1AffectsListAffectedness(str, Enum): - VALUE_0 = "" AFFECTED = "AFFECTED" NEW = "NEW" NOTAFFECTED = "NOTAFFECTED" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_flaw_impact.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_flaw_impact.py index 3c9764d..a8c1be5 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_flaw_impact.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_flaw_impact.py @@ -2,11 +2,11 @@ class OsidbApiV1AffectsListFlawImpact(str, Enum): - VALUE_0 = "" CRITICAL = "CRITICAL" IMPORTANT = "IMPORTANT" LOW = "LOW" MODERATE = "MODERATE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_flaw_source.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_flaw_source.py index 36f99fc..72d9d18 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_flaw_source.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_flaw_source.py @@ -2,7 +2,6 @@ class OsidbApiV1AffectsListFlawSource(str, Enum): - VALUE_0 = "" ADOBE = "ADOBE" APPLE = "APPLE" ASF = "ASF" @@ -86,6 +85,7 @@ class OsidbApiV1AffectsListFlawSource(str, Enum): TWITTER = "TWITTER" UBUNTU = "UBUNTU" UPSTREAM = "UPSTREAM" + VALUE_0 = "" VENDORSEC = "VENDORSEC" VULNWATCH = "VULNWATCH" WIRESHARK = "WIRESHARK" diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_impact.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_impact.py index d85b901..5a83e4d 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_impact.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_impact.py @@ -2,11 +2,11 @@ class OsidbApiV1AffectsListImpact(str, Enum): - VALUE_0 = "" CRITICAL = "CRITICAL" IMPORTANT = "IMPORTANT" LOW = "LOW" MODERATE = "MODERATE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_order_item.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_order_item.py index b57f744..fbbb06f 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_order_item.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_order_item.py @@ -2,43 +2,6 @@ class OsidbApiV1AffectsListOrderItem(str, Enum): - VALUE_0 = "-affectedness" - VALUE_1 = "-created_dt" - VALUE_2 = "-cvss_scores__comment" - VALUE_3 = "-cvss_scores__created_dt" - VALUE_4 = "-cvss_scores__cvss_version" - VALUE_5 = "-cvss_scores__issuer" - VALUE_6 = "-cvss_scores__score" - VALUE_7 = "-cvss_scores__updated_dt" - VALUE_8 = "-cvss_scores__uuid" - VALUE_9 = "-cvss_scores__vector" - VALUE_10 = "-embargoed" - VALUE_11 = "-flaw__components" - VALUE_12 = "-flaw__created_dt" - VALUE_13 = "-flaw__cve_id" - VALUE_14 = "-flaw__cwe_id" - VALUE_15 = "-flaw__embargoed" - VALUE_16 = "-flaw__impact" - VALUE_17 = "-flaw__reported_dt" - VALUE_18 = "-flaw__source" - VALUE_19 = "-flaw__unembargo_dt" - VALUE_20 = "-flaw__updated_dt" - VALUE_21 = "-flaw__uuid" - VALUE_22 = "-impact" - VALUE_23 = "-ps_component" - VALUE_24 = "-ps_module" - VALUE_25 = "-resolution" - VALUE_26 = "-trackers__created_dt" - VALUE_27 = "-trackers__embargoed" - VALUE_28 = "-trackers__external_system_id" - VALUE_29 = "-trackers__ps_update_stream" - VALUE_30 = "-trackers__resolution" - VALUE_31 = "-trackers__status" - VALUE_32 = "-trackers__type" - VALUE_33 = "-trackers__updated_dt" - VALUE_34 = "-trackers__uuid" - VALUE_35 = "-updated_dt" - VALUE_36 = "-uuid" AFFECTEDNESS = "affectedness" CREATED_DT = "created_dt" CVSS_SCORES_COMMENT = "cvss_scores__comment" @@ -76,6 +39,43 @@ class OsidbApiV1AffectsListOrderItem(str, Enum): TRACKERS_UUID = "trackers__uuid" UPDATED_DT = "updated_dt" UUID = "uuid" + VALUE_0 = "-affectedness" + VALUE_1 = "-created_dt" + VALUE_10 = "-embargoed" + VALUE_11 = "-flaw__components" + VALUE_12 = "-flaw__created_dt" + VALUE_13 = "-flaw__cve_id" + VALUE_14 = "-flaw__cwe_id" + VALUE_15 = "-flaw__embargoed" + VALUE_16 = "-flaw__impact" + VALUE_17 = "-flaw__reported_dt" + VALUE_18 = "-flaw__source" + VALUE_19 = "-flaw__unembargo_dt" + VALUE_2 = "-cvss_scores__comment" + VALUE_20 = "-flaw__updated_dt" + VALUE_21 = "-flaw__uuid" + VALUE_22 = "-impact" + VALUE_23 = "-ps_component" + VALUE_24 = "-ps_module" + VALUE_25 = "-resolution" + VALUE_26 = "-trackers__created_dt" + VALUE_27 = "-trackers__embargoed" + VALUE_28 = "-trackers__external_system_id" + VALUE_29 = "-trackers__ps_update_stream" + VALUE_3 = "-cvss_scores__created_dt" + VALUE_30 = "-trackers__resolution" + VALUE_31 = "-trackers__status" + VALUE_32 = "-trackers__type" + VALUE_33 = "-trackers__updated_dt" + VALUE_34 = "-trackers__uuid" + VALUE_35 = "-updated_dt" + VALUE_36 = "-uuid" + VALUE_4 = "-cvss_scores__cvss_version" + VALUE_5 = "-cvss_scores__issuer" + VALUE_6 = "-cvss_scores__score" + VALUE_7 = "-cvss_scores__updated_dt" + VALUE_8 = "-cvss_scores__uuid" + VALUE_9 = "-cvss_scores__vector" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_resolution.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_resolution.py index 1843d09..0c2c042 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_resolution.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_resolution.py @@ -2,11 +2,11 @@ class OsidbApiV1AffectsListResolution(str, Enum): - VALUE_0 = "" DEFER = "DEFER" DELEGATED = "DELEGATED" FIX = "FIX" OOSS = "OOSS" + VALUE_0 = "" WONTFIX = "WONTFIX" WONTREPORT = "WONTREPORT" diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_response_200.py index e7ae2b6..a25322c 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.affect import Affect -from ..models.affect import Affect -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Affect']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[Affect] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["Affect"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.affect import Affect + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Affect - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Affect.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Affect + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Affect.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_affects_list_response_200.additional_properties = d return osidb_api_v1_affects_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Affect], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_retrieve_response_200.py index d4ea99c..53e0cf5 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_retrieve_response_200.py @@ -1,78 +1,125 @@ -import datetime -from typing import Any, Dict, List, Optional, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect_cvss import AffectCVSS from ..models.affectedness_enum import AffectednessEnum -from ..models.alert import Alert from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum -from ..models.tracker import Tracker -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + T = TypeVar("T", bound="OsidbApiV1AffectsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsRetrieveResponse200(OSIDBModel): - """ """ - - uuid: str + """ + Attributes: + uuid (UUID): + flaw (Union[None, UUID]): + ps_module (str): + ps_product (str): + trackers (list['Tracker']): + delegated_resolution (str): + cvss_scores (list['AffectCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affectedness (Union[AffectednessEnum, BlankEnum, Unset]): + resolution (Union[BlankEnum, ResolutionEnum, Unset]): + ps_component (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + purl (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + uuid: UUID + flaw: Union[None, UUID] ps_module: str ps_product: str - trackers: List[Tracker] + trackers: list["Tracker"] delegated_resolution: str - cvss_scores: List[AffectCVSS] + cvss_scores: list["AffectCVSS"] embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Optional[str] affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET - ps_component: Union[Unset, None, str] = UNSET + ps_component: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - purl: Union[Unset, None, str] = UNSET + purl: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + flaw: Union[None, str] + if isinstance(self.flaw, UUID): + flaw = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + else: + flaw = self.flaw - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid ps_module = self.ps_module + ps_product = self.ps_product - trackers: List[Dict[str, Any]] = UNSET + + trackers: list[dict[str, Any]] = UNSET if not isinstance(self.trackers, Unset): trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() trackers.append(trackers_item) delegated_resolution = self.delegated_resolution - cvss_scores: List[Dict[str, Any]] = UNSET + + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -86,111 +133,151 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): + print(AffectednessEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value + affectedness = self.affectedness.value else: + print(BlankEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = BlankEnum(self.affectedness).value + affectedness = self.affectedness.value resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): + print(ResolutionEnum) resolution = UNSET if not isinstance(self.resolution, Unset): - - resolution = ResolutionEnum(self.resolution).value + resolution = self.resolution.value else: + print(BlankEnum) resolution = UNSET if not isinstance(self.resolution, Unset): + resolution = self.resolution.value - resolution = BlankEnum(self.resolution).value + ps_component: Union[None, Unset, str] + if isinstance(self.ps_component, Unset): + ps_component = UNSET + else: + ps_component = self.ps_component - ps_component = self.ps_component impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value + purl: Union[None, Unset, str] + if isinstance(self.purl, Unset): + purl = UNSET + else: + purl = self.purl - purl = self.purl dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(ps_module, Unset): + if flaw is not UNSET: + field_dict["flaw"] = flaw + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_product, Unset): + if ps_product is not UNSET: field_dict["ps_product"] = ps_product - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(delegated_resolution, Unset): + if delegated_resolution is not UNSET: field_dict["delegated_resolution"] = delegated_resolution - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): - field_dict["flaw"] = flaw - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(purl, Unset): + if purl is not UNSET: field_dict["purl"] = purl - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) + + def _parse_flaw(data: object) -> Union[None, UUID]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + _flaw_type_0 = data + flaw_type_0: UUID + if isinstance(_flaw_type_0, Unset): + flaw_type_0 = UNSET + else: + flaw_type_0 = UUID(_flaw_type_0) + + return flaw_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID], data) + + flaw = _parse_flaw(d.pop("flaw", UNSET)) ps_module = d.pop("ps_module", UNSET) @@ -198,52 +285,43 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: trackers = [] _trackers = d.pop("trackers", UNSET) - if _trackers is UNSET: - trackers = UNSET - else: - for trackers_item_data in _trackers or []: - _trackers_item = trackers_item_data - trackers_item: Tracker - if isinstance(_trackers_item, Unset): - trackers_item = UNSET - else: - trackers_item = Tracker.from_dict(_trackers_item) + for trackers_item_data in _trackers or []: + _trackers_item = trackers_item_data + trackers_item: Tracker + if isinstance(_trackers_item, Unset): + trackers_item = UNSET + else: + trackers_item = Tracker.from_dict(_trackers_item) - trackers.append(trackers_item) + trackers.append(trackers_item) delegated_resolution = d.pop("delegated_resolution", UNSET) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: AffectCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: AffectCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -259,18 +337,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) - - def _parse_affectedness( - data: object, - ) -> Union[AffectednessEnum, BlankEnum, Unset]: + def _parse_affectedness(data: object) -> Union[AffectednessEnum, BlankEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _affectedness_type_0 = data - affectedness_type_0: Union[Unset, AffectednessEnum] + affectedness_type_0: AffectednessEnum if isinstance(_affectedness_type_0, Unset): affectedness_type_0 = UNSET else: @@ -282,7 +356,7 @@ def _parse_affectedness( if not isinstance(data, str): raise TypeError() _affectedness_type_1 = data - affectedness_type_1: Union[Unset, BlankEnum] + affectedness_type_1: BlankEnum if isinstance(_affectedness_type_1, Unset): affectedness_type_1 = UNSET else: @@ -299,7 +373,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_0 = data - resolution_type_0: Union[Unset, ResolutionEnum] + resolution_type_0: ResolutionEnum if isinstance(_resolution_type_0, Unset): resolution_type_0 = UNSET else: @@ -311,7 +385,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_1 = data - resolution_type_1: Union[Unset, BlankEnum] + resolution_type_1: BlankEnum if isinstance(_resolution_type_1, Unset): resolution_type_1 = UNSET else: @@ -321,7 +395,14 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: resolution = _parse_resolution(d.pop("resolution", UNSET)) - ps_component = d.pop("ps_component", UNSET) + def _parse_ps_component(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + ps_component = _parse_ps_component(d.pop("ps_component", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -330,7 +411,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -342,7 +423,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -352,7 +433,14 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - purl = d.pop("purl", UNSET) + def _parse_purl(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + purl = _parse_purl(d.pop("purl", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -369,6 +457,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: osidb_api_v1_affects_retrieve_response_200 = cls( uuid=uuid, + flaw=flaw, ps_module=ps_module, ps_product=ps_product, trackers=trackers, @@ -378,7 +467,6 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: alerts=alerts, created_dt=created_dt, updated_dt=updated_dt, - flaw=flaw, affectedness=affectedness, resolution=resolution, ps_component=ps_component, @@ -393,33 +481,8 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: osidb_api_v1_affects_retrieve_response_200.additional_properties = d return osidb_api_v1_affects_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "uuid": str, - "ps_module": str, - "ps_product": str, - "trackers": List[Tracker], - "delegated_resolution": str, - "cvss_scores": List[AffectCVSS], - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "affectedness": Union[AffectednessEnum, BlankEnum], - "resolution": Union[BlankEnum, ResolutionEnum], - "ps_component": str, - "impact": Union[BlankEnum, ImpactEnum], - "purl": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_update_response_200.py index 2248473..c4f7736 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_affects_update_response_200.py @@ -1,78 +1,125 @@ -import datetime -from typing import Any, Dict, List, Optional, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect_cvss import AffectCVSS from ..models.affectedness_enum import AffectednessEnum -from ..models.alert import Alert from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum -from ..models.tracker import Tracker -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + T = TypeVar("T", bound="OsidbApiV1AffectsUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AffectsUpdateResponse200(OSIDBModel): - """ """ - - uuid: str + """ + Attributes: + uuid (UUID): + flaw (Union[None, UUID]): + ps_module (str): + ps_product (str): + trackers (list['Tracker']): + delegated_resolution (str): + cvss_scores (list['AffectCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affectedness (Union[AffectednessEnum, BlankEnum, Unset]): + resolution (Union[BlankEnum, ResolutionEnum, Unset]): + ps_component (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + purl (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + uuid: UUID + flaw: Union[None, UUID] ps_module: str ps_product: str - trackers: List[Tracker] + trackers: list["Tracker"] delegated_resolution: str - cvss_scores: List[AffectCVSS] + cvss_scores: list["AffectCVSS"] embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Optional[str] affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET - ps_component: Union[Unset, None, str] = UNSET + ps_component: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - purl: Union[Unset, None, str] = UNSET + purl: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + flaw: Union[None, str] + if isinstance(self.flaw, UUID): + flaw = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + else: + flaw = self.flaw - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid ps_module = self.ps_module + ps_product = self.ps_product - trackers: List[Dict[str, Any]] = UNSET + + trackers: list[dict[str, Any]] = UNSET if not isinstance(self.trackers, Unset): trackers = [] for trackers_item_data in self.trackers: - trackers_item: Dict[str, Any] = UNSET + trackers_item: dict[str, Any] = UNSET if not isinstance(trackers_item_data, Unset): trackers_item = trackers_item_data.to_dict() trackers.append(trackers_item) delegated_resolution = self.delegated_resolution - cvss_scores: List[Dict[str, Any]] = UNSET + + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -86,111 +133,151 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): affectedness = UNSET elif isinstance(self.affectedness, AffectednessEnum): + print(AffectednessEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = AffectednessEnum(self.affectedness).value + affectedness = self.affectedness.value else: + print(BlankEnum) affectedness = UNSET if not isinstance(self.affectedness, Unset): - - affectedness = BlankEnum(self.affectedness).value + affectedness = self.affectedness.value resolution: Union[Unset, str] if isinstance(self.resolution, Unset): resolution = UNSET elif isinstance(self.resolution, ResolutionEnum): + print(ResolutionEnum) resolution = UNSET if not isinstance(self.resolution, Unset): - - resolution = ResolutionEnum(self.resolution).value + resolution = self.resolution.value else: + print(BlankEnum) resolution = UNSET if not isinstance(self.resolution, Unset): + resolution = self.resolution.value - resolution = BlankEnum(self.resolution).value + ps_component: Union[None, Unset, str] + if isinstance(self.ps_component, Unset): + ps_component = UNSET + else: + ps_component = self.ps_component - ps_component = self.ps_component impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value + purl: Union[None, Unset, str] + if isinstance(self.purl, Unset): + purl = UNSET + else: + purl = self.purl - purl = self.purl dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(ps_module, Unset): + if flaw is not UNSET: + field_dict["flaw"] = flaw + if ps_module is not UNSET: field_dict["ps_module"] = ps_module - if not isinstance(ps_product, Unset): + if ps_product is not UNSET: field_dict["ps_product"] = ps_product - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(delegated_resolution, Unset): + if delegated_resolution is not UNSET: field_dict["delegated_resolution"] = delegated_resolution - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): - field_dict["flaw"] = flaw - if not isinstance(affectedness, Unset): + if affectedness is not UNSET: field_dict["affectedness"] = affectedness - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(ps_component, Unset): + if ps_component is not UNSET: field_dict["ps_component"] = ps_component - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(purl, Unset): + if purl is not UNSET: field_dict["purl"] = purl - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.tracker import Tracker + from ..models.affect_cvss import AffectCVSS + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) + + def _parse_flaw(data: object) -> Union[None, UUID]: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + _flaw_type_0 = data + flaw_type_0: UUID + if isinstance(_flaw_type_0, Unset): + flaw_type_0 = UNSET + else: + flaw_type_0 = UUID(_flaw_type_0) + + return flaw_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID], data) + + flaw = _parse_flaw(d.pop("flaw", UNSET)) ps_module = d.pop("ps_module", UNSET) @@ -198,52 +285,43 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: trackers = [] _trackers = d.pop("trackers", UNSET) - if _trackers is UNSET: - trackers = UNSET - else: - for trackers_item_data in _trackers or []: - _trackers_item = trackers_item_data - trackers_item: Tracker - if isinstance(_trackers_item, Unset): - trackers_item = UNSET - else: - trackers_item = Tracker.from_dict(_trackers_item) + for trackers_item_data in _trackers or []: + _trackers_item = trackers_item_data + trackers_item: Tracker + if isinstance(_trackers_item, Unset): + trackers_item = UNSET + else: + trackers_item = Tracker.from_dict(_trackers_item) - trackers.append(trackers_item) + trackers.append(trackers_item) delegated_resolution = d.pop("delegated_resolution", UNSET) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: AffectCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: AffectCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = AffectCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -259,18 +337,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) - - def _parse_affectedness( - data: object, - ) -> Union[AffectednessEnum, BlankEnum, Unset]: + def _parse_affectedness(data: object) -> Union[AffectednessEnum, BlankEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _affectedness_type_0 = data - affectedness_type_0: Union[Unset, AffectednessEnum] + affectedness_type_0: AffectednessEnum if isinstance(_affectedness_type_0, Unset): affectedness_type_0 = UNSET else: @@ -282,7 +356,7 @@ def _parse_affectedness( if not isinstance(data, str): raise TypeError() _affectedness_type_1 = data - affectedness_type_1: Union[Unset, BlankEnum] + affectedness_type_1: BlankEnum if isinstance(_affectedness_type_1, Unset): affectedness_type_1 = UNSET else: @@ -299,7 +373,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_0 = data - resolution_type_0: Union[Unset, ResolutionEnum] + resolution_type_0: ResolutionEnum if isinstance(_resolution_type_0, Unset): resolution_type_0 = UNSET else: @@ -311,7 +385,7 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: if not isinstance(data, str): raise TypeError() _resolution_type_1 = data - resolution_type_1: Union[Unset, BlankEnum] + resolution_type_1: BlankEnum if isinstance(_resolution_type_1, Unset): resolution_type_1 = UNSET else: @@ -321,7 +395,14 @@ def _parse_resolution(data: object) -> Union[BlankEnum, ResolutionEnum, Unset]: resolution = _parse_resolution(d.pop("resolution", UNSET)) - ps_component = d.pop("ps_component", UNSET) + def _parse_ps_component(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + ps_component = _parse_ps_component(d.pop("ps_component", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -330,7 +411,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -342,7 +423,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -352,7 +433,14 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - purl = d.pop("purl", UNSET) + def _parse_purl(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + purl = _parse_purl(d.pop("purl", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -369,6 +457,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: osidb_api_v1_affects_update_response_200 = cls( uuid=uuid, + flaw=flaw, ps_module=ps_module, ps_product=ps_product, trackers=trackers, @@ -378,7 +467,6 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: alerts=alerts, created_dt=created_dt, updated_dt=updated_dt, - flaw=flaw, affectedness=affectedness, resolution=resolution, ps_component=ps_component, @@ -393,33 +481,8 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: osidb_api_v1_affects_update_response_200.additional_properties = d return osidb_api_v1_affects_update_response_200 - @staticmethod - def get_fields(): - return { - "uuid": str, - "ps_module": str, - "ps_product": str, - "trackers": List[Tracker], - "delegated_resolution": str, - "cvss_scores": List[AffectCVSS], - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "affectedness": Union[AffectednessEnum, BlankEnum], - "resolution": Union[BlankEnum, ResolutionEnum], - "ps_component": str, - "impact": Union[BlankEnum, ImpactEnum], - "purl": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_alerts_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_alerts_list_response_200.py index de937f6..46084a7 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_alerts_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_alerts_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AlertsListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AlertsListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Alert']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[Alert] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["Alert"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Alert - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Alert.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Alert + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Alert.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_alerts_list_response_200.additional_properties = d return osidb_api_v1_alerts_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Alert], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_alerts_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_alerts_retrieve_response_200.py index c0b02ad..4456b51 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_alerts_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_alerts_retrieve_response_200.py @@ -1,23 +1,40 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel from ..models.alert_type_enum import AlertTypeEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + T = TypeVar("T", bound="OsidbApiV1AlertsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AlertsRetrieveResponse200(OSIDBModel): - """ """ - - uuid: str + """ + Attributes: + uuid (UUID): + name (str): + description (str): + parent_uuid (UUID): + parent_model (str): + alert_type (Union[Unset, AlertTypeEnum]): + resolution_steps (Union[Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + uuid: UUID name: str description: str - parent_uuid: str + parent_uuid: UUID parent_model: str alert_type: Union[Unset, AlertTypeEnum] = UNSET resolution_steps: Union[Unset, str] = UNSET @@ -25,65 +42,87 @@ class OsidbApiV1AlertsRetrieveResponse200(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid name = self.name + description = self.description - parent_uuid = self.parent_uuid + + parent_uuid: str = UNSET + if not isinstance(self.parent_uuid, Unset): + parent_uuid = str(self.parent_uuid) + parent_model = self.parent_model + + print(AlertTypeEnum) alert_type: Union[Unset, str] = UNSET if not isinstance(self.alert_type, Unset): - - alert_type = AlertTypeEnum(self.alert_type).value + alert_type = self.alert_type.value resolution_steps = self.resolution_steps + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(parent_uuid, Unset): + if parent_uuid is not UNSET: field_dict["parent_uuid"] = parent_uuid - if not isinstance(parent_model, Unset): + if parent_model is not UNSET: field_dict["parent_model"] = parent_model - if not isinstance(alert_type, Unset): + if alert_type is not UNSET: field_dict["alert_type"] = alert_type - if not isinstance(resolution_steps, Unset): + if resolution_steps is not UNSET: field_dict["resolution_steps"] = resolution_steps - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) name = d.pop("name", UNSET) description = d.pop("description", UNSET) - parent_uuid = d.pop("parent_uuid", UNSET) + _parent_uuid = d.pop("parent_uuid", UNSET) + parent_uuid: UUID + if isinstance(_parent_uuid, Unset): + parent_uuid = UNSET + else: + parent_uuid = UUID(_parent_uuid) parent_model = d.pop("parent_model", UNSET) @@ -126,24 +165,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_alerts_retrieve_response_200.additional_properties = d return osidb_api_v1_alerts_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "uuid": str, - "name": str, - "description": str, - "parent_uuid": str, - "parent_model": str, - "alert_type": AlertTypeEnum, - "resolution_steps": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_list_response_200.py index 5832c01..076a31b 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.audit import Audit -from ..models.audit import Audit -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AuditListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AuditListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Audit']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[Audit] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["Audit"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.audit import Audit + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Audit - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Audit.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Audit + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Audit.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_audit_list_response_200.additional_properties = d return osidb_api_v1_audit_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Audit], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_retrieve_response_200.py index ffac840..9eef294 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_retrieve_response_200.py @@ -1,17 +1,35 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AuditRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AuditRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + pgh_created_at (datetime.datetime): When the event was created. + pgh_slug (str): The unique identifier across all event tables. + pgh_obj_model (str): The object model. + pgh_label (str): The event label. + pgh_diff (Any): The diff between the previous event of the same label. + pgh_data (str): + pgh_obj_id (Union[None, Unset, str]): The primary key of the object. + pgh_context (Union[Unset, Any]): The context associated with the event. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ pgh_created_at: datetime.datetime pgh_slug: str @@ -19,26 +37,35 @@ class OsidbApiV1AuditRetrieveResponse200(OSIDBModel): pgh_label: str pgh_diff: Any pgh_data: str - pgh_obj_id: Union[Unset, None, str] = UNSET + pgh_obj_id: Union[None, Unset, str] = UNSET pgh_context: Union[Unset, Any] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: pgh_created_at: str = UNSET if not isinstance(self.pgh_created_at, Unset): pgh_created_at = self.pgh_created_at.isoformat() pgh_slug = self.pgh_slug + pgh_obj_model = self.pgh_obj_model + pgh_label = self.pgh_label + pgh_diff = self.pgh_diff pgh_data = self.pgh_data - pgh_obj_id = self.pgh_obj_id + + pgh_obj_id: Union[None, Unset, str] + if isinstance(self.pgh_obj_id, Unset): + pgh_obj_id = UNSET + else: + pgh_obj_id = self.pgh_obj_id + pgh_context = self.pgh_context dt: Union[Unset, str] = UNSET @@ -46,40 +73,42 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(pgh_created_at, Unset): + if pgh_created_at is not UNSET: field_dict["pgh_created_at"] = pgh_created_at - if not isinstance(pgh_slug, Unset): + if pgh_slug is not UNSET: field_dict["pgh_slug"] = pgh_slug - if not isinstance(pgh_obj_model, Unset): + if pgh_obj_model is not UNSET: field_dict["pgh_obj_model"] = pgh_obj_model - if not isinstance(pgh_label, Unset): + if pgh_label is not UNSET: field_dict["pgh_label"] = pgh_label - if not isinstance(pgh_diff, Unset): + if pgh_diff is not UNSET: field_dict["pgh_diff"] = pgh_diff - if not isinstance(pgh_data, Unset): + if pgh_data is not UNSET: field_dict["pgh_data"] = pgh_data - if not isinstance(pgh_obj_id, Unset): + if pgh_obj_id is not UNSET: field_dict["pgh_obj_id"] = pgh_obj_id - if not isinstance(pgh_context, Unset): + if pgh_context is not UNSET: field_dict["pgh_context"] = pgh_context - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _pgh_created_at = d.pop("pgh_created_at", UNSET) pgh_created_at: datetime.datetime @@ -98,7 +127,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: pgh_data = d.pop("pgh_data", UNSET) - pgh_obj_id = d.pop("pgh_obj_id", UNSET) + def _parse_pgh_obj_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + pgh_obj_id = _parse_pgh_obj_id(d.pop("pgh_obj_id", UNSET)) pgh_context = d.pop("pgh_context", UNSET) @@ -133,25 +169,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_audit_retrieve_response_200.additional_properties = d return osidb_api_v1_audit_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "pgh_created_at": datetime.datetime, - "pgh_slug": str, - "pgh_obj_model": str, - "pgh_label": str, - "pgh_diff": Any, - "pgh_data": str, - "pgh_obj_id": str, - "pgh_context": Any, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_update_response_200.py index 794dce7..f2e1409 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_audit_update_response_200.py @@ -1,17 +1,35 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AuditUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1AuditUpdateResponse200(OSIDBModel): - """ """ + """ + Attributes: + pgh_created_at (datetime.datetime): When the event was created. + pgh_slug (str): The unique identifier across all event tables. + pgh_obj_model (str): The object model. + pgh_label (str): The event label. + pgh_diff (Any): The diff between the previous event of the same label. + pgh_data (str): + pgh_obj_id (Union[None, Unset, str]): The primary key of the object. + pgh_context (Union[Unset, Any]): The context associated with the event. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ pgh_created_at: datetime.datetime pgh_slug: str @@ -19,26 +37,35 @@ class OsidbApiV1AuditUpdateResponse200(OSIDBModel): pgh_label: str pgh_diff: Any pgh_data: str - pgh_obj_id: Union[Unset, None, str] = UNSET + pgh_obj_id: Union[None, Unset, str] = UNSET pgh_context: Union[Unset, Any] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: pgh_created_at: str = UNSET if not isinstance(self.pgh_created_at, Unset): pgh_created_at = self.pgh_created_at.isoformat() pgh_slug = self.pgh_slug + pgh_obj_model = self.pgh_obj_model + pgh_label = self.pgh_label + pgh_diff = self.pgh_diff pgh_data = self.pgh_data - pgh_obj_id = self.pgh_obj_id + + pgh_obj_id: Union[None, Unset, str] + if isinstance(self.pgh_obj_id, Unset): + pgh_obj_id = UNSET + else: + pgh_obj_id = self.pgh_obj_id + pgh_context = self.pgh_context dt: Union[Unset, str] = UNSET @@ -46,40 +73,42 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(pgh_created_at, Unset): + if pgh_created_at is not UNSET: field_dict["pgh_created_at"] = pgh_created_at - if not isinstance(pgh_slug, Unset): + if pgh_slug is not UNSET: field_dict["pgh_slug"] = pgh_slug - if not isinstance(pgh_obj_model, Unset): + if pgh_obj_model is not UNSET: field_dict["pgh_obj_model"] = pgh_obj_model - if not isinstance(pgh_label, Unset): + if pgh_label is not UNSET: field_dict["pgh_label"] = pgh_label - if not isinstance(pgh_diff, Unset): + if pgh_diff is not UNSET: field_dict["pgh_diff"] = pgh_diff - if not isinstance(pgh_data, Unset): + if pgh_data is not UNSET: field_dict["pgh_data"] = pgh_data - if not isinstance(pgh_obj_id, Unset): + if pgh_obj_id is not UNSET: field_dict["pgh_obj_id"] = pgh_obj_id - if not isinstance(pgh_context, Unset): + if pgh_context is not UNSET: field_dict["pgh_context"] = pgh_context - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _pgh_created_at = d.pop("pgh_created_at", UNSET) pgh_created_at: datetime.datetime @@ -98,7 +127,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: pgh_data = d.pop("pgh_data", UNSET) - pgh_obj_id = d.pop("pgh_obj_id", UNSET) + def _parse_pgh_obj_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + pgh_obj_id = _parse_pgh_obj_id(d.pop("pgh_obj_id", UNSET)) pgh_context = d.pop("pgh_context", UNSET) @@ -133,25 +169,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_audit_update_response_200.additional_properties = d return osidb_api_v1_audit_update_response_200 - @staticmethod - def get_fields(): - return { - "pgh_created_at": datetime.datetime, - "pgh_slug": str, - "pgh_obj_model": str, - "pgh_label": str, - "pgh_diff": Any, - "pgh_data": str, - "pgh_obj_id": str, - "pgh_context": Any, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_create_response_201.py index 28b8a13..4dfebec 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_create_response_201.py @@ -1,46 +1,79 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsAcknowledgmentsCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsAcknowledgmentsCreateResponse201(OSIDBModel): - """ """ + """ + Attributes: + name (str): + affiliation (str): + from_upstream (bool): + flaw (UUID): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ name: str affiliation: str from_upstream: bool - flaw: str - uuid: str + flaw: UUID + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: name = self.name + affiliation = self.affiliation + from_upstream = self.from_upstream - flaw = self.flaw - uuid = self.uuid + + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -59,42 +92,46 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name - if not isinstance(affiliation, Unset): + if affiliation is not UNSET: field_dict["affiliation"] = affiliation - if not isinstance(from_upstream, Unset): + if from_upstream is not UNSET: field_dict["from_upstream"] = from_upstream - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() name = d.pop("name", UNSET) @@ -102,26 +139,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from_upstream = d.pop("from_upstream", UNSET) - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -169,26 +213,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_acknowledgments_create_response_201.additional_properties = d return osidb_api_v1_flaws_acknowledgments_create_response_201 - @staticmethod - def get_fields(): - return { - "name": str, - "affiliation": str, - "from_upstream": bool, - "flaw": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_destroy_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_destroy_response_200.py index b1d77fc..e4b87af 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_destroy_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_destroy_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsAcknowledgmentsDestroyResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsAcknowledgmentsDestroyResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -64,22 +75,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version=version, ) - osidb_api_v1_flaws_acknowledgments_destroy_response_200.additional_properties = ( - d - ) + osidb_api_v1_flaws_acknowledgments_destroy_response_200.additional_properties = d return osidb_api_v1_flaws_acknowledgments_destroy_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_list_response_200.py index 2672dbd..727deef 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsAcknowledgmentsListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsAcknowledgmentsListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawAcknowledgment']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[FlawAcknowledgment] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["FlawAcknowledgment"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_acknowledgment import FlawAcknowledgment + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawAcknowledgment - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawAcknowledgment.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawAcknowledgment + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawAcknowledgment.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_acknowledgments_list_response_200.additional_properties = d return osidb_api_v1_flaws_acknowledgments_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawAcknowledgment], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_retrieve_response_200.py index 92b6c05..ded5eee 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_retrieve_response_200.py @@ -1,46 +1,79 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsAcknowledgmentsRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + name (str): + affiliation (str): + from_upstream (bool): + flaw (UUID): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ name: str affiliation: str from_upstream: bool - flaw: str - uuid: str + flaw: UUID + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: name = self.name + affiliation = self.affiliation + from_upstream = self.from_upstream - flaw = self.flaw - uuid = self.uuid + + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -59,42 +92,46 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name - if not isinstance(affiliation, Unset): + if affiliation is not UNSET: field_dict["affiliation"] = affiliation - if not isinstance(from_upstream, Unset): + if from_upstream is not UNSET: field_dict["from_upstream"] = from_upstream - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() name = d.pop("name", UNSET) @@ -102,26 +139,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from_upstream = d.pop("from_upstream", UNSET) - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -166,31 +210,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version=version, ) - osidb_api_v1_flaws_acknowledgments_retrieve_response_200.additional_properties = ( - d - ) + osidb_api_v1_flaws_acknowledgments_retrieve_response_200.additional_properties = d return osidb_api_v1_flaws_acknowledgments_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "name": str, - "affiliation": str, - "from_upstream": bool, - "flaw": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_update_response_200.py index af85fda..afdf00c 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_acknowledgments_update_response_200.py @@ -1,46 +1,79 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsAcknowledgmentsUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsAcknowledgmentsUpdateResponse200(OSIDBModel): - """ """ + """ + Attributes: + name (str): + affiliation (str): + from_upstream (bool): + flaw (UUID): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ name: str affiliation: str from_upstream: bool - flaw: str - uuid: str + flaw: UUID + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: name = self.name + affiliation = self.affiliation + from_upstream = self.from_upstream - flaw = self.flaw - uuid = self.uuid + + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -59,42 +92,46 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name - if not isinstance(affiliation, Unset): + if affiliation is not UNSET: field_dict["affiliation"] = affiliation - if not isinstance(from_upstream, Unset): + if from_upstream is not UNSET: field_dict["from_upstream"] = from_upstream - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() name = d.pop("name", UNSET) @@ -102,26 +139,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from_upstream = d.pop("from_upstream", UNSET) - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -169,26 +213,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_acknowledgments_update_response_200.additional_properties = d return osidb_api_v1_flaws_acknowledgments_update_response_200 - @staticmethod - def get_fields(): - return { - "name": str, - "affiliation": str, - "from_upstream": bool, - "flaw": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_create_response_201.py index da89fed..b3020ea 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_create_response_201.py @@ -1,24 +1,49 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsCommentsCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCommentsCreateResponse201(OSIDBModel): - """ """ - - flaw: str + """ + Attributes: + flaw (UUID): + text (str): + uuid (UUID): + external_system_id (str): + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + order (Union[Unset, int]): + creator (Union[Unset, str]): + is_private (Union[Unset, bool]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + flaw: UUID text: str - uuid: str + uuid: UUID external_system_id: str - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime embargoed: bool @@ -29,18 +54,26 @@ class OsidbApiV1FlawsCommentsCreateResponse201(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) - def to_dict(self) -> Dict[str, Any]: - flaw = self.flaw text = self.text - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + external_system_id = self.external_system_id - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -55,77 +88,92 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() embargoed = self.embargoed + order = self.order + creator = self.creator + is_private = self.is_private + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(text, Unset): + if text is not UNSET: field_dict["text"] = text - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(external_system_id, Unset): + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(order, Unset): + if order is not UNSET: field_dict["order"] = order - if not isinstance(creator, Unset): + if creator is not UNSET: field_dict["creator"] = creator - if not isinstance(is_private, Unset): + if is_private is not UNSET: field_dict["is_private"] = is_private - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) text = d.pop("text", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) external_system_id = d.pop("external_system_id", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -183,28 +231,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_comments_create_response_201.additional_properties = d return osidb_api_v1_flaws_comments_create_response_201 - @staticmethod - def get_fields(): - return { - "flaw": str, - "text": str, - "uuid": str, - "external_system_id": str, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "embargoed": bool, - "order": int, - "creator": str, - "is_private": bool, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_list_response_200.py index 6210862..e572daf 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.flaw_comment import FlawComment -from ..models.flaw_comment import FlawComment -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsCommentsListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCommentsListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawComment']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[FlawComment] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["FlawComment"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_comment import FlawComment + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawComment - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawComment.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawComment + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawComment.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_comments_list_response_200.additional_properties = d return osidb_api_v1_flaws_comments_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawComment], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_retrieve_response_200.py index 7f5eefd..d4084ad 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_retrieve_response_200.py @@ -1,24 +1,49 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsCommentsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCommentsRetrieveResponse200(OSIDBModel): - """ """ - - flaw: str + """ + Attributes: + flaw (UUID): + text (str): + uuid (UUID): + external_system_id (str): + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + order (Union[Unset, int]): + creator (Union[Unset, str]): + is_private (Union[Unset, bool]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + flaw: UUID text: str - uuid: str + uuid: UUID external_system_id: str - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime embargoed: bool @@ -29,18 +54,26 @@ class OsidbApiV1FlawsCommentsRetrieveResponse200(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) - def to_dict(self) -> Dict[str, Any]: - flaw = self.flaw text = self.text - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + external_system_id = self.external_system_id - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -55,77 +88,92 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() embargoed = self.embargoed + order = self.order + creator = self.creator + is_private = self.is_private + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(text, Unset): + if text is not UNSET: field_dict["text"] = text - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(external_system_id, Unset): + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(order, Unset): + if order is not UNSET: field_dict["order"] = order - if not isinstance(creator, Unset): + if creator is not UNSET: field_dict["creator"] = creator - if not isinstance(is_private, Unset): + if is_private is not UNSET: field_dict["is_private"] = is_private - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) text = d.pop("text", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) external_system_id = d.pop("external_system_id", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -183,28 +231,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_comments_retrieve_response_200.additional_properties = d return osidb_api_v1_flaws_comments_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "flaw": str, - "text": str, - "uuid": str, - "external_system_id": str, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "embargoed": bool, - "order": int, - "creator": str, - "is_private": bool, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_create_response_201.py index eb74b14..a9aed21 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_create_response_201.py @@ -1,62 +1,108 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect import Affect -from ..models.alert import Alert from ..models.blank_enum import BlankEnum -from ..models.comment import Comment -from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..models.flaw_classification import FlawClassification -from ..models.flaw_cvss import FlawCVSS -from ..models.flaw_reference import FlawReference from ..models.impact_enum import ImpactEnum from ..models.major_incident_state_enum import MajorIncidentStateEnum from ..models.nist_cvss_validation_enum import NistCvssValidationEnum -from ..models.package import Package from ..models.requires_cve_description_enum import RequiresCveDescriptionEnum from ..models.source_be_0_enum import SourceBe0Enum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_classification import FlawClassification + from ..models.package import Package + from ..models.flaw_reference import FlawReference + T = TypeVar("T", bound="OsidbApiV1FlawsCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCreateResponse201(OSIDBModel): - """ """ - - uuid: str + """ + Attributes: + uuid (UUID): + title (str): + trackers (list[str]): + comment_zero (str): + affects (list['Affect']): + comments (list['Comment']): + package_versions (list['Package']): + acknowledgments (list['FlawAcknowledgment']): + references (list['FlawReference']): + cvss_scores (list['FlawCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + classification (FlawClassification): + alerts (list['Alert']): + cve_id (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + components (Union[Unset, list[str]]): + cve_description (Union[Unset, str]): + requires_cve_description (Union[BlankEnum, RequiresCveDescriptionEnum, Unset]): + statement (Union[Unset, str]): + cwe_id (Union[Unset, str]): + unembargo_dt (Union[None, Unset, datetime.datetime]): + source (Union[BlankEnum, SourceBe0Enum, Unset]): + reported_dt (Union[None, Unset, datetime.datetime]): + mitigation (Union[Unset, str]): + major_incident_state (Union[BlankEnum, MajorIncidentStateEnum, Unset]): + major_incident_start_dt (Union[None, Unset, datetime.datetime]): + nist_cvss_validation (Union[BlankEnum, NistCvssValidationEnum, Unset]): + group_key (Union[Unset, str]): + owner (Union[Unset, str]): + task_key (Union[Unset, str]): + team_id (Union[Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + uuid: UUID title: str - trackers: List[str] + trackers: list[str] comment_zero: str - affects: List[Affect] - comments: List[Comment] - package_versions: List[Package] - acknowledgments: List[FlawAcknowledgment] - references: List[FlawReference] - cvss_scores: List[FlawCVSS] + affects: list["Affect"] + comments: list["Comment"] + package_versions: list["Package"] + acknowledgments: list["FlawAcknowledgment"] + references: list["FlawReference"] + cvss_scores: list["FlawCVSS"] embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime - classification: FlawClassification - alerts: List[Alert] - cve_id: Union[Unset, None, str] = UNSET + classification: "FlawClassification" + alerts: list["Alert"] + cve_id: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET cve_description: Union[Unset, str] = UNSET - requires_cve_description: Union[ - BlankEnum, RequiresCveDescriptionEnum, Unset - ] = UNSET + requires_cve_description: Union[BlankEnum, RequiresCveDescriptionEnum, Unset] = UNSET statement: Union[Unset, str] = UNSET cwe_id: Union[Unset, str] = UNSET - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET + unembargo_dt: Union[None, Unset, datetime.datetime] = UNSET source: Union[BlankEnum, SourceBe0Enum, Unset] = UNSET - reported_dt: Union[Unset, None, datetime.datetime] = UNSET + reported_dt: Union[None, Unset, datetime.datetime] = UNSET mitigation: Union[Unset, str] = UNSET major_incident_state: Union[BlankEnum, MajorIncidentStateEnum, Unset] = UNSET - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET + major_incident_start_dt: Union[None, Unset, datetime.datetime] = UNSET nist_cvss_validation: Union[BlankEnum, NistCvssValidationEnum, Unset] = UNSET group_key: Union[Unset, str] = UNSET owner: Union[Unset, str] = UNSET @@ -66,77 +112,83 @@ class OsidbApiV1FlawsCreateResponse201(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid title = self.title - trackers: List[str] = UNSET + + trackers: list[str] = UNSET if not isinstance(self.trackers, Unset): trackers = self.trackers comment_zero = self.comment_zero - affects: List[Dict[str, Any]] = UNSET + + affects: list[dict[str, Any]] = UNSET if not isinstance(self.affects, Unset): affects = [] for affects_item_data in self.affects: - affects_item: Dict[str, Any] = UNSET + affects_item: dict[str, Any] = UNSET if not isinstance(affects_item_data, Unset): affects_item = affects_item_data.to_dict() affects.append(affects_item) - comments: List[Dict[str, Any]] = UNSET + comments: list[dict[str, Any]] = UNSET if not isinstance(self.comments, Unset): comments = [] for comments_item_data in self.comments: - comments_item: Dict[str, Any] = UNSET + comments_item: dict[str, Any] = UNSET if not isinstance(comments_item_data, Unset): comments_item = comments_item_data.to_dict() comments.append(comments_item) - package_versions: List[Dict[str, Any]] = UNSET + package_versions: list[dict[str, Any]] = UNSET if not isinstance(self.package_versions, Unset): package_versions = [] for package_versions_item_data in self.package_versions: - package_versions_item: Dict[str, Any] = UNSET + package_versions_item: dict[str, Any] = UNSET if not isinstance(package_versions_item_data, Unset): package_versions_item = package_versions_item_data.to_dict() package_versions.append(package_versions_item) - acknowledgments: List[Dict[str, Any]] = UNSET + acknowledgments: list[dict[str, Any]] = UNSET if not isinstance(self.acknowledgments, Unset): acknowledgments = [] for acknowledgments_item_data in self.acknowledgments: - acknowledgments_item: Dict[str, Any] = UNSET + acknowledgments_item: dict[str, Any] = UNSET if not isinstance(acknowledgments_item_data, Unset): acknowledgments_item = acknowledgments_item_data.to_dict() acknowledgments.append(acknowledgments_item) - references: List[Dict[str, Any]] = UNSET + references: list[dict[str, Any]] = UNSET if not isinstance(self.references, Unset): references = [] for references_item_data in self.references: - references_item: Dict[str, Any] = UNSET + references_item: dict[str, Any] = UNSET if not isinstance(references_item_data, Unset): references_item = references_item_data.to_dict() references.append(references_item) - cvss_scores: List[Dict[str, Any]] = UNSET + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -145,321 +197,339 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - classification: Dict[str, Any] = UNSET + classification: dict[str, Any] = UNSET if not isinstance(self.classification, Unset): classification = self.classification.to_dict() - alerts: List[Dict[str, Any]] = UNSET + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() alerts.append(alerts_item) - cve_id = self.cve_id + cve_id: Union[None, Unset, str] + if isinstance(self.cve_id, Unset): + cve_id = UNSET + else: + cve_id = self.cve_id + impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value - - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET if not isinstance(self.components, Unset): components = self.components cve_description = self.cve_description + requires_cve_description: Union[Unset, str] if isinstance(self.requires_cve_description, Unset): requires_cve_description = UNSET elif isinstance(self.requires_cve_description, RequiresCveDescriptionEnum): + print(RequiresCveDescriptionEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = RequiresCveDescriptionEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value else: + print(BlankEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = BlankEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value statement = self.statement + cwe_id = self.cwe_id - unembargo_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.unembargo_dt, Unset): - unembargo_dt = self.unembargo_dt.isoformat() if self.unembargo_dt else None + + unembargo_dt: Union[None, Unset, str] + if isinstance(self.unembargo_dt, Unset): + unembargo_dt = UNSET + elif isinstance(self.unembargo_dt, datetime.datetime): + unembargo_dt = UNSET + if not isinstance(self.unembargo_dt, Unset): + unembargo_dt = self.unembargo_dt.isoformat() + + else: + unembargo_dt = self.unembargo_dt source: Union[Unset, str] if isinstance(self.source, Unset): source = UNSET elif isinstance(self.source, SourceBe0Enum): + print(SourceBe0Enum) source = UNSET if not isinstance(self.source, Unset): - - source = SourceBe0Enum(self.source).value + source = self.source.value else: + print(BlankEnum) source = UNSET if not isinstance(self.source, Unset): + source = self.source.value - source = BlankEnum(self.source).value + reported_dt: Union[None, Unset, str] + if isinstance(self.reported_dt, Unset): + reported_dt = UNSET + elif isinstance(self.reported_dt, datetime.datetime): + reported_dt = UNSET + if not isinstance(self.reported_dt, Unset): + reported_dt = self.reported_dt.isoformat() - reported_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.reported_dt, Unset): - reported_dt = self.reported_dt.isoformat() if self.reported_dt else None + else: + reported_dt = self.reported_dt mitigation = self.mitigation + major_incident_state: Union[Unset, str] if isinstance(self.major_incident_state, Unset): major_incident_state = UNSET elif isinstance(self.major_incident_state, MajorIncidentStateEnum): + print(MajorIncidentStateEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): - - major_incident_state = MajorIncidentStateEnum( - self.major_incident_state - ).value + major_incident_state = self.major_incident_state.value else: + print(BlankEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): + major_incident_state = self.major_incident_state.value - major_incident_state = BlankEnum(self.major_incident_state).value + major_incident_start_dt: Union[None, Unset, str] + if isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = UNSET + elif isinstance(self.major_incident_start_dt, datetime.datetime): + major_incident_start_dt = UNSET + if not isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = self.major_incident_start_dt.isoformat() - major_incident_start_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.major_incident_start_dt, Unset): - major_incident_start_dt = ( - self.major_incident_start_dt.isoformat() - if self.major_incident_start_dt - else None - ) + else: + major_incident_start_dt = self.major_incident_start_dt nist_cvss_validation: Union[Unset, str] if isinstance(self.nist_cvss_validation, Unset): nist_cvss_validation = UNSET elif isinstance(self.nist_cvss_validation, NistCvssValidationEnum): + print(NistCvssValidationEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = NistCvssValidationEnum( - self.nist_cvss_validation - ).value + nist_cvss_validation = self.nist_cvss_validation.value else: + print(BlankEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = BlankEnum(self.nist_cvss_validation).value + nist_cvss_validation = self.nist_cvss_validation.value group_key = self.group_key + owner = self.owner + task_key = self.task_key + team_id = self.team_id + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(title, Unset): + if title is not UNSET: field_dict["title"] = title - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(comment_zero, Unset): + if comment_zero is not UNSET: field_dict["comment_zero"] = comment_zero - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(comments, Unset): + if comments is not UNSET: field_dict["comments"] = comments - if not isinstance(package_versions, Unset): + if package_versions is not UNSET: field_dict["package_versions"] = package_versions - if not isinstance(acknowledgments, Unset): + if acknowledgments is not UNSET: field_dict["acknowledgments"] = acknowledgments - if not isinstance(references, Unset): + if references is not UNSET: field_dict["references"] = references - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(classification, Unset): + if classification is not UNSET: field_dict["classification"] = classification - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(cve_id, Unset): + if cve_id is not UNSET: field_dict["cve_id"] = cve_id - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(components, Unset): + if components is not UNSET: field_dict["components"] = components - if not isinstance(cve_description, Unset): + if cve_description is not UNSET: field_dict["cve_description"] = cve_description - if not isinstance(requires_cve_description, Unset): + if requires_cve_description is not UNSET: field_dict["requires_cve_description"] = requires_cve_description - if not isinstance(statement, Unset): + if statement is not UNSET: field_dict["statement"] = statement - if not isinstance(cwe_id, Unset): + if cwe_id is not UNSET: field_dict["cwe_id"] = cwe_id - if not isinstance(unembargo_dt, Unset): + if unembargo_dt is not UNSET: field_dict["unembargo_dt"] = unembargo_dt - if not isinstance(source, Unset): + if source is not UNSET: field_dict["source"] = source - if not isinstance(reported_dt, Unset): + if reported_dt is not UNSET: field_dict["reported_dt"] = reported_dt - if not isinstance(mitigation, Unset): + if mitigation is not UNSET: field_dict["mitigation"] = mitigation - if not isinstance(major_incident_state, Unset): + if major_incident_state is not UNSET: field_dict["major_incident_state"] = major_incident_state - if not isinstance(major_incident_start_dt, Unset): + if major_incident_start_dt is not UNSET: field_dict["major_incident_start_dt"] = major_incident_start_dt - if not isinstance(nist_cvss_validation, Unset): + if nist_cvss_validation is not UNSET: field_dict["nist_cvss_validation"] = nist_cvss_validation - if not isinstance(group_key, Unset): + if group_key is not UNSET: field_dict["group_key"] = group_key - if not isinstance(owner, Unset): + if owner is not UNSET: field_dict["owner"] = owner - if not isinstance(task_key, Unset): + if task_key is not UNSET: field_dict["task_key"] = task_key - if not isinstance(team_id, Unset): + if team_id is not UNSET: field_dict["team_id"] = team_id - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_classification import FlawClassification + from ..models.package import Package + from ..models.flaw_reference import FlawReference + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) title = d.pop("title", UNSET) - trackers = cast(List[str], d.pop("trackers", UNSET)) + trackers = cast(list[str], d.pop("trackers", UNSET)) comment_zero = d.pop("comment_zero", UNSET) affects = [] _affects = d.pop("affects", UNSET) - if _affects is UNSET: - affects = UNSET - else: - for affects_item_data in _affects or []: - _affects_item = affects_item_data - affects_item: Affect - if isinstance(_affects_item, Unset): - affects_item = UNSET - else: - affects_item = Affect.from_dict(_affects_item) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: Affect + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = Affect.from_dict(_affects_item) - affects.append(affects_item) + affects.append(affects_item) comments = [] _comments = d.pop("comments", UNSET) - if _comments is UNSET: - comments = UNSET - else: - for comments_item_data in _comments or []: - _comments_item = comments_item_data - comments_item: Comment - if isinstance(_comments_item, Unset): - comments_item = UNSET - else: - comments_item = Comment.from_dict(_comments_item) + for comments_item_data in _comments or []: + _comments_item = comments_item_data + comments_item: Comment + if isinstance(_comments_item, Unset): + comments_item = UNSET + else: + comments_item = Comment.from_dict(_comments_item) - comments.append(comments_item) + comments.append(comments_item) package_versions = [] _package_versions = d.pop("package_versions", UNSET) - if _package_versions is UNSET: - package_versions = UNSET - else: - for package_versions_item_data in _package_versions or []: - _package_versions_item = package_versions_item_data - package_versions_item: Package - if isinstance(_package_versions_item, Unset): - package_versions_item = UNSET - else: - package_versions_item = Package.from_dict(_package_versions_item) + for package_versions_item_data in _package_versions or []: + _package_versions_item = package_versions_item_data + package_versions_item: Package + if isinstance(_package_versions_item, Unset): + package_versions_item = UNSET + else: + package_versions_item = Package.from_dict(_package_versions_item) - package_versions.append(package_versions_item) + package_versions.append(package_versions_item) acknowledgments = [] _acknowledgments = d.pop("acknowledgments", UNSET) - if _acknowledgments is UNSET: - acknowledgments = UNSET - else: - for acknowledgments_item_data in _acknowledgments or []: - _acknowledgments_item = acknowledgments_item_data - acknowledgments_item: FlawAcknowledgment - if isinstance(_acknowledgments_item, Unset): - acknowledgments_item = UNSET - else: - acknowledgments_item = FlawAcknowledgment.from_dict( - _acknowledgments_item - ) + for acknowledgments_item_data in _acknowledgments or []: + _acknowledgments_item = acknowledgments_item_data + acknowledgments_item: FlawAcknowledgment + if isinstance(_acknowledgments_item, Unset): + acknowledgments_item = UNSET + else: + acknowledgments_item = FlawAcknowledgment.from_dict(_acknowledgments_item) - acknowledgments.append(acknowledgments_item) + acknowledgments.append(acknowledgments_item) references = [] _references = d.pop("references", UNSET) - if _references is UNSET: - references = UNSET - else: - for references_item_data in _references or []: - _references_item = references_item_data - references_item: FlawReference - if isinstance(_references_item, Unset): - references_item = UNSET - else: - references_item = FlawReference.from_dict(_references_item) + for references_item_data in _references or []: + _references_item = references_item_data + references_item: FlawReference + if isinstance(_references_item, Unset): + references_item = UNSET + else: + references_item = FlawReference.from_dict(_references_item) - references.append(references_item) + references.append(references_item) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: FlawCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: FlawCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) @@ -486,20 +556,24 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) + + def _parse_cve_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - cve_id = d.pop("cve_id", UNSET) + cve_id = _parse_cve_id(d.pop("cve_id", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -508,7 +582,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -520,7 +594,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -530,28 +604,22 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - components = cast(List[str], d.pop("components", UNSET)) + components = cast(list[str], d.pop("components", UNSET)) cve_description = d.pop("cve_description", UNSET) - def _parse_requires_cve_description( - data: object, - ) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: + def _parse_requires_cve_description(data: object) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _requires_cve_description_type_0 = data - requires_cve_description_type_0: Union[ - Unset, RequiresCveDescriptionEnum - ] + requires_cve_description_type_0: RequiresCveDescriptionEnum if isinstance(_requires_cve_description_type_0, Unset): requires_cve_description_type_0 = UNSET else: - requires_cve_description_type_0 = RequiresCveDescriptionEnum( - _requires_cve_description_type_0 - ) + requires_cve_description_type_0 = RequiresCveDescriptionEnum(_requires_cve_description_type_0) return requires_cve_description_type_0 except: # noqa: E722 @@ -559,32 +627,41 @@ def _parse_requires_cve_description( if not isinstance(data, str): raise TypeError() _requires_cve_description_type_1 = data - requires_cve_description_type_1: Union[Unset, BlankEnum] + requires_cve_description_type_1: BlankEnum if isinstance(_requires_cve_description_type_1, Unset): requires_cve_description_type_1 = UNSET else: - requires_cve_description_type_1 = BlankEnum( - _requires_cve_description_type_1 - ) + requires_cve_description_type_1 = BlankEnum(_requires_cve_description_type_1) return requires_cve_description_type_1 - requires_cve_description = _parse_requires_cve_description( - d.pop("requires_cve_description", UNSET) - ) + requires_cve_description = _parse_requires_cve_description(d.pop("requires_cve_description", UNSET)) statement = d.pop("statement", UNSET) cwe_id = d.pop("cwe_id", UNSET) - _unembargo_dt = d.pop("unembargo_dt", UNSET) - unembargo_dt: Union[Unset, None, datetime.datetime] - if _unembargo_dt is None: - unembargo_dt = None - elif isinstance(_unembargo_dt, Unset): - unembargo_dt = UNSET - else: - unembargo_dt = isoparse(_unembargo_dt) + def _parse_unembargo_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _unembargo_dt_type_0 = data + unembargo_dt_type_0: datetime.datetime + if isinstance(_unembargo_dt_type_0, Unset): + unembargo_dt_type_0 = UNSET + else: + unembargo_dt_type_0 = isoparse(_unembargo_dt_type_0) + + return unembargo_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + unembargo_dt = _parse_unembargo_dt(d.pop("unembargo_dt", UNSET)) def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if isinstance(data, Unset): @@ -593,7 +670,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_0 = data - source_type_0: Union[Unset, SourceBe0Enum] + source_type_0: SourceBe0Enum if isinstance(_source_type_0, Unset): source_type_0 = UNSET else: @@ -605,7 +682,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_1 = data - source_type_1: Union[Unset, BlankEnum] + source_type_1: BlankEnum if isinstance(_source_type_1, Unset): source_type_1 = UNSET else: @@ -615,33 +692,42 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: source = _parse_source(d.pop("source", UNSET)) - _reported_dt = d.pop("reported_dt", UNSET) - reported_dt: Union[Unset, None, datetime.datetime] - if _reported_dt is None: - reported_dt = None - elif isinstance(_reported_dt, Unset): - reported_dt = UNSET - else: - reported_dt = isoparse(_reported_dt) + def _parse_reported_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _reported_dt_type_0 = data + reported_dt_type_0: datetime.datetime + if isinstance(_reported_dt_type_0, Unset): + reported_dt_type_0 = UNSET + else: + reported_dt_type_0 = isoparse(_reported_dt_type_0) + + return reported_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + reported_dt = _parse_reported_dt(d.pop("reported_dt", UNSET)) mitigation = d.pop("mitigation", UNSET) - def _parse_major_incident_state( - data: object, - ) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: + def _parse_major_incident_state(data: object) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _major_incident_state_type_0 = data - major_incident_state_type_0: Union[Unset, MajorIncidentStateEnum] + major_incident_state_type_0: MajorIncidentStateEnum if isinstance(_major_incident_state_type_0, Unset): major_incident_state_type_0 = UNSET else: - major_incident_state_type_0 = MajorIncidentStateEnum( - _major_incident_state_type_0 - ) + major_incident_state_type_0 = MajorIncidentStateEnum(_major_incident_state_type_0) return major_incident_state_type_0 except: # noqa: E722 @@ -649,7 +735,7 @@ def _parse_major_incident_state( if not isinstance(data, str): raise TypeError() _major_incident_state_type_1 = data - major_incident_state_type_1: Union[Unset, BlankEnum] + major_incident_state_type_1: BlankEnum if isinstance(_major_incident_state_type_1, Unset): major_incident_state_type_1 = UNSET else: @@ -657,35 +743,42 @@ def _parse_major_incident_state( return major_incident_state_type_1 - major_incident_state = _parse_major_incident_state( - d.pop("major_incident_state", UNSET) - ) + major_incident_state = _parse_major_incident_state(d.pop("major_incident_state", UNSET)) - _major_incident_start_dt = d.pop("major_incident_start_dt", UNSET) - major_incident_start_dt: Union[Unset, None, datetime.datetime] - if _major_incident_start_dt is None: - major_incident_start_dt = None - elif isinstance(_major_incident_start_dt, Unset): - major_incident_start_dt = UNSET - else: - major_incident_start_dt = isoparse(_major_incident_start_dt) + def _parse_major_incident_start_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _major_incident_start_dt_type_0 = data + major_incident_start_dt_type_0: datetime.datetime + if isinstance(_major_incident_start_dt_type_0, Unset): + major_incident_start_dt_type_0 = UNSET + else: + major_incident_start_dt_type_0 = isoparse(_major_incident_start_dt_type_0) + + return major_incident_start_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) - def _parse_nist_cvss_validation( - data: object, - ) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: + major_incident_start_dt = _parse_major_incident_start_dt(d.pop("major_incident_start_dt", UNSET)) + + def _parse_nist_cvss_validation(data: object) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_0 = data - nist_cvss_validation_type_0: Union[Unset, NistCvssValidationEnum] + nist_cvss_validation_type_0: NistCvssValidationEnum if isinstance(_nist_cvss_validation_type_0, Unset): nist_cvss_validation_type_0 = UNSET else: - nist_cvss_validation_type_0 = NistCvssValidationEnum( - _nist_cvss_validation_type_0 - ) + nist_cvss_validation_type_0 = NistCvssValidationEnum(_nist_cvss_validation_type_0) return nist_cvss_validation_type_0 except: # noqa: E722 @@ -693,7 +786,7 @@ def _parse_nist_cvss_validation( if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_1 = data - nist_cvss_validation_type_1: Union[Unset, BlankEnum] + nist_cvss_validation_type_1: BlankEnum if isinstance(_nist_cvss_validation_type_1, Unset): nist_cvss_validation_type_1 = UNSET else: @@ -701,9 +794,7 @@ def _parse_nist_cvss_validation( return nist_cvss_validation_type_1 - nist_cvss_validation = _parse_nist_cvss_validation( - d.pop("nist_cvss_validation", UNSET) - ) + nist_cvss_validation = _parse_nist_cvss_validation(d.pop("nist_cvss_validation", UNSET)) group_key = d.pop("group_key", UNSET) @@ -769,50 +860,8 @@ def _parse_nist_cvss_validation( osidb_api_v1_flaws_create_response_201.additional_properties = d return osidb_api_v1_flaws_create_response_201 - @staticmethod - def get_fields(): - return { - "uuid": str, - "title": str, - "trackers": List[str], - "comment_zero": str, - "affects": List[Affect], - "comments": List[Comment], - "package_versions": List[Package], - "acknowledgments": List[FlawAcknowledgment], - "references": List[FlawReference], - "cvss_scores": List[FlawCVSS], - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "classification": FlawClassification, - "alerts": List[Alert], - "cve_id": str, - "impact": Union[BlankEnum, ImpactEnum], - "components": List[str], - "cve_description": str, - "requires_cve_description": Union[BlankEnum, RequiresCveDescriptionEnum], - "statement": str, - "cwe_id": str, - "unembargo_dt": datetime.datetime, - "source": Union[BlankEnum, SourceBe0Enum], - "reported_dt": datetime.datetime, - "mitigation": str, - "major_incident_state": Union[BlankEnum, MajorIncidentStateEnum], - "major_incident_start_dt": datetime.datetime, - "nist_cvss_validation": Union[BlankEnum, NistCvssValidationEnum], - "group_key": str, - "owner": str, - "task_key": str, - "team_id": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_create_response_201.py index fcacfee..a24e746 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_create_response_201.py @@ -1,58 +1,90 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1FlawsCvssScoresCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCvssScoresCreateResponse201(OSIDBModel): - """ """ + """ + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + flaw (Union[Unset, UUID]): + comment (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Union[Unset, str] = UNSET - comment: Union[Unset, None, str] = UNSET + flaw: Union[Unset, UUID] = UNSET + comment: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -66,53 +98,65 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw - comment = self.comment + flaw: Union[Unset, str] = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -130,7 +174,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -138,18 +187,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -165,9 +211,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: Union[Unset, UUID] + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) + + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - comment = d.pop("comment", UNSET) + comment = _parse_comment(d.pop("comment", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -203,28 +261,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_cvss_scores_create_response_201.additional_properties = d return osidb_api_v1_flaws_cvss_scores_create_response_201 - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "comment": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_destroy_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_destroy_response_200.py index 4613f04..006f77b 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_destroy_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_destroy_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsCvssScoresDestroyResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCvssScoresDestroyResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_cvss_scores_destroy_response_200.additional_properties = d return osidb_api_v1_flaws_cvss_scores_destroy_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_list_response_200.py index 887c3b1..a9bb6bb 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.flaw_cvss import FlawCVSS -from ..models.flaw_cvss import FlawCVSS -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsCvssScoresListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCvssScoresListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawCVSS']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[FlawCVSS] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["FlawCVSS"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_cvss import FlawCVSS + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawCVSS - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawCVSS.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawCVSS + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawCVSS.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_cvss_scores_list_response_200.additional_properties = d return osidb_api_v1_flaws_cvss_scores_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawCVSS], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_retrieve_response_200.py index 86c17ec..a93cc0e 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_retrieve_response_200.py @@ -1,58 +1,90 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1FlawsCvssScoresRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCvssScoresRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + flaw (Union[Unset, UUID]): + comment (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Union[Unset, str] = UNSET - comment: Union[Unset, None, str] = UNSET + flaw: Union[Unset, UUID] = UNSET + comment: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -66,53 +98,65 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw - comment = self.comment + flaw: Union[Unset, str] = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -130,7 +174,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -138,18 +187,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -165,9 +211,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: Union[Unset, UUID] + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) + + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - comment = d.pop("comment", UNSET) + comment = _parse_comment(d.pop("comment", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -203,28 +261,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_cvss_scores_retrieve_response_200.additional_properties = d return osidb_api_v1_flaws_cvss_scores_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "comment": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_update_response_200.py index 5cb1c7b..6ba56b7 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_cvss_scores_update_response_200.py @@ -1,58 +1,90 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.cvss_version_enum import CvssVersionEnum from ..models.issuer_enum import IssuerEnum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1FlawsCvssScoresUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsCvssScoresUpdateResponse200(OSIDBModel): - """ """ + """ + Attributes: + cvss_version (CvssVersionEnum): + issuer (IssuerEnum): + score (float): + uuid (UUID): + vector (str): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + flaw (Union[Unset, UUID]): + comment (Union[None, Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ cvss_version: CvssVersionEnum issuer: IssuerEnum score: float - uuid: str + uuid: UUID vector: str embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - flaw: Union[Unset, str] = UNSET - comment: Union[Unset, None, str] = UNSET + flaw: Union[Unset, UUID] = UNSET + comment: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: + print(CvssVersionEnum) cvss_version: str = UNSET if not isinstance(self.cvss_version, Unset): + cvss_version = self.cvss_version.value - cvss_version = CvssVersionEnum(self.cvss_version).value - + print(IssuerEnum) issuer: str = UNSET if not isinstance(self.issuer, Unset): - - issuer = IssuerEnum(self.issuer).value + issuer = self.issuer.value score = self.score - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + vector = self.vector + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -66,53 +98,65 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - flaw = self.flaw - comment = self.comment + flaw: Union[Unset, str] = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + comment: Union[None, Unset, str] + if isinstance(self.comment, Unset): + comment = UNSET + else: + comment = self.comment + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(cvss_version, Unset): + if cvss_version is not UNSET: field_dict["cvss_version"] = cvss_version - if not isinstance(issuer, Unset): + if issuer is not UNSET: field_dict["issuer"] = issuer - if not isinstance(score, Unset): + if score is not UNSET: field_dict["score"] = score - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(vector, Unset): + if vector is not UNSET: field_dict["vector"] = vector - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(comment, Unset): + if comment is not UNSET: field_dict["comment"] = comment - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() _cvss_version = d.pop("cvss_version", UNSET) cvss_version: CvssVersionEnum @@ -130,7 +174,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: score = d.pop("score", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) vector = d.pop("vector", UNSET) @@ -138,18 +187,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -165,9 +211,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: Union[Unset, UUID] + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) + + def _parse_comment(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - comment = d.pop("comment", UNSET) + comment = _parse_comment(d.pop("comment", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -203,28 +261,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_cvss_scores_update_response_200.additional_properties = d return osidb_api_v1_flaws_cvss_scores_update_response_200 - @staticmethod - def get_fields(): - return { - "cvss_version": CvssVersionEnum, - "issuer": IssuerEnum, - "score": float, - "uuid": str, - "vector": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "flaw": str, - "comment": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_affectedness.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_affectedness.py index 8193ee1..4b0ec0f 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_affectedness.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_affectedness.py @@ -2,10 +2,10 @@ class OsidbApiV1FlawsListAffectsAffectedness(str, Enum): - VALUE_0 = "" AFFECTED = "AFFECTED" NEW = "NEW" NOTAFFECTED = "NOTAFFECTED" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_impact.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_impact.py index 450e54c..a9df79b 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_impact.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_impact.py @@ -2,11 +2,11 @@ class OsidbApiV1FlawsListAffectsImpact(str, Enum): - VALUE_0 = "" CRITICAL = "CRITICAL" IMPORTANT = "IMPORTANT" LOW = "LOW" MODERATE = "MODERATE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_resolution.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_resolution.py index 89ae53b..3d0bea5 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_resolution.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_affects_resolution.py @@ -2,11 +2,11 @@ class OsidbApiV1FlawsListAffectsResolution(str, Enum): - VALUE_0 = "" DEFER = "DEFER" DELEGATED = "DELEGATED" FIX = "FIX" OOSS = "OOSS" + VALUE_0 = "" WONTFIX = "WONTFIX" WONTREPORT = "WONTREPORT" diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_impact.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_impact.py index 72b77df..9692bd5 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_impact.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_impact.py @@ -2,11 +2,11 @@ class OsidbApiV1FlawsListImpact(str, Enum): - VALUE_0 = "" CRITICAL = "CRITICAL" IMPORTANT = "IMPORTANT" LOW = "LOW" MODERATE = "MODERATE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_major_incident_state.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_major_incident_state.py index 8a5485c..ec51986 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_major_incident_state.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_major_incident_state.py @@ -2,13 +2,13 @@ class OsidbApiV1FlawsListMajorIncidentState(str, Enum): - VALUE_0 = "" APPROVED = "APPROVED" CISA_APPROVED = "CISA_APPROVED" INVALID = "INVALID" MINOR = "MINOR" REJECTED = "REJECTED" REQUESTED = "REQUESTED" + VALUE_0 = "" ZERO_DAY = "ZERO_DAY" def __str__(self) -> str: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_nist_cvss_validation.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_nist_cvss_validation.py index d8bbeda..f5d3a6a 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_nist_cvss_validation.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_nist_cvss_validation.py @@ -2,10 +2,10 @@ class OsidbApiV1FlawsListNistCvssValidation(str, Enum): - VALUE_0 = "" APPROVED = "APPROVED" REJECTED = "REJECTED" REQUESTED = "REQUESTED" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_order_item.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_order_item.py index 0ea2c7c..6f7f6ad 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_order_item.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_order_item.py @@ -2,67 +2,6 @@ class OsidbApiV1FlawsListOrderItem(str, Enum): - VALUE_0 = "-acknowledgments__affiliation" - VALUE_1 = "-acknowledgments__created_dt" - VALUE_2 = "-acknowledgments__from_upstream" - VALUE_3 = "-acknowledgments__name" - VALUE_4 = "-acknowledgments__updated_dt" - VALUE_5 = "-acknowledgments__uuid" - VALUE_6 = "-affects__affectedness" - VALUE_7 = "-affects__created_dt" - VALUE_8 = "-affects__impact" - VALUE_9 = "-affects__ps_component" - VALUE_10 = "-affects__ps_module" - VALUE_11 = "-affects__resolution" - VALUE_12 = "-affects__trackers__created_dt" - VALUE_13 = "-affects__trackers__errata__advisory_name" - VALUE_14 = "-affects__trackers__errata__et_id" - VALUE_15 = "-affects__trackers__errata__shipped_dt" - VALUE_16 = "-affects__trackers__external_system_id" - VALUE_17 = "-affects__trackers__ps_update_stream" - VALUE_18 = "-affects__trackers__resolution" - VALUE_19 = "-affects__trackers__status" - VALUE_20 = "-affects__trackers__type" - VALUE_21 = "-affects__trackers__updated_dt" - VALUE_22 = "-affects__trackers__uuid" - VALUE_23 = "-affects__updated_dt" - VALUE_24 = "-affects__uuid" - VALUE_25 = "-bz_id" - VALUE_26 = "-comment_zero" - VALUE_27 = "-components" - VALUE_28 = "-created_dt" - VALUE_29 = "-cve_description" - VALUE_30 = "-cve_id" - VALUE_31 = "-cvss_scores__comment" - VALUE_32 = "-cvss_scores__created_dt" - VALUE_33 = "-cvss_scores__issuer" - VALUE_34 = "-cvss_scores__score" - VALUE_35 = "-cvss_scores__updated_dt" - VALUE_36 = "-cvss_scores__uuid" - VALUE_37 = "-cvss_scores__vector" - VALUE_38 = "-cwe_id" - VALUE_39 = "-embargoed" - VALUE_40 = "-impact" - VALUE_41 = "-major_incident_start_dt" - VALUE_42 = "-major_incident_state" - VALUE_43 = "-nist_cvss_validation" - VALUE_44 = "-owner" - VALUE_45 = "-references__created_dt" - VALUE_46 = "-references__description" - VALUE_47 = "-references__type" - VALUE_48 = "-references__updated_dt" - VALUE_49 = "-references__url" - VALUE_50 = "-references__uuid" - VALUE_51 = "-reported_dt" - VALUE_52 = "-requires_cve_description" - VALUE_53 = "-source" - VALUE_54 = "-statement" - VALUE_55 = "-team_id" - VALUE_56 = "-title" - VALUE_57 = "-unembargo_dt" - VALUE_58 = "-updated_dt" - VALUE_59 = "-uuid" - VALUE_60 = "-workflow_state" ACKNOWLEDGMENTS_AFFILIATION = "acknowledgments__affiliation" ACKNOWLEDGMENTS_CREATED_DT = "acknowledgments__created_dt" ACKNOWLEDGMENTS_FROM_UPSTREAM = "acknowledgments__from_upstream" @@ -123,6 +62,67 @@ class OsidbApiV1FlawsListOrderItem(str, Enum): UNEMBARGO_DT = "unembargo_dt" UPDATED_DT = "updated_dt" UUID = "uuid" + VALUE_0 = "-acknowledgments__affiliation" + VALUE_1 = "-acknowledgments__created_dt" + VALUE_10 = "-affects__ps_module" + VALUE_11 = "-affects__resolution" + VALUE_12 = "-affects__trackers__created_dt" + VALUE_13 = "-affects__trackers__errata__advisory_name" + VALUE_14 = "-affects__trackers__errata__et_id" + VALUE_15 = "-affects__trackers__errata__shipped_dt" + VALUE_16 = "-affects__trackers__external_system_id" + VALUE_17 = "-affects__trackers__ps_update_stream" + VALUE_18 = "-affects__trackers__resolution" + VALUE_19 = "-affects__trackers__status" + VALUE_2 = "-acknowledgments__from_upstream" + VALUE_20 = "-affects__trackers__type" + VALUE_21 = "-affects__trackers__updated_dt" + VALUE_22 = "-affects__trackers__uuid" + VALUE_23 = "-affects__updated_dt" + VALUE_24 = "-affects__uuid" + VALUE_25 = "-bz_id" + VALUE_26 = "-comment_zero" + VALUE_27 = "-components" + VALUE_28 = "-created_dt" + VALUE_29 = "-cve_description" + VALUE_3 = "-acknowledgments__name" + VALUE_30 = "-cve_id" + VALUE_31 = "-cvss_scores__comment" + VALUE_32 = "-cvss_scores__created_dt" + VALUE_33 = "-cvss_scores__issuer" + VALUE_34 = "-cvss_scores__score" + VALUE_35 = "-cvss_scores__updated_dt" + VALUE_36 = "-cvss_scores__uuid" + VALUE_37 = "-cvss_scores__vector" + VALUE_38 = "-cwe_id" + VALUE_39 = "-embargoed" + VALUE_4 = "-acknowledgments__updated_dt" + VALUE_40 = "-impact" + VALUE_41 = "-major_incident_start_dt" + VALUE_42 = "-major_incident_state" + VALUE_43 = "-nist_cvss_validation" + VALUE_44 = "-owner" + VALUE_45 = "-references__created_dt" + VALUE_46 = "-references__description" + VALUE_47 = "-references__type" + VALUE_48 = "-references__updated_dt" + VALUE_49 = "-references__url" + VALUE_5 = "-acknowledgments__uuid" + VALUE_50 = "-references__uuid" + VALUE_51 = "-reported_dt" + VALUE_52 = "-requires_cve_description" + VALUE_53 = "-source" + VALUE_54 = "-statement" + VALUE_55 = "-team_id" + VALUE_56 = "-title" + VALUE_57 = "-unembargo_dt" + VALUE_58 = "-updated_dt" + VALUE_59 = "-uuid" + VALUE_6 = "-affects__affectedness" + VALUE_60 = "-workflow_state" + VALUE_7 = "-affects__created_dt" + VALUE_8 = "-affects__impact" + VALUE_9 = "-affects__ps_component" WORKFLOW_STATE = "workflow_state" def __str__(self) -> str: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_requires_cve_description.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_requires_cve_description.py index 1ed3e40..2f094bb 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_requires_cve_description.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_requires_cve_description.py @@ -2,10 +2,10 @@ class OsidbApiV1FlawsListRequiresCveDescription(str, Enum): - VALUE_0 = "" APPROVED = "APPROVED" REJECTED = "REJECTED" REQUESTED = "REQUESTED" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_response_200.py index d51abed..89219d7 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.flaw import Flaw -from ..models.flaw import Flaw -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Flaw']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[Flaw] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["Flaw"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw import Flaw + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Flaw - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Flaw.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Flaw + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Flaw.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_list_response_200.additional_properties = d return osidb_api_v1_flaws_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Flaw], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_source.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_source.py index 9fea818..a4ba91a 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_source.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_source.py @@ -2,7 +2,6 @@ class OsidbApiV1FlawsListSource(str, Enum): - VALUE_0 = "" ADOBE = "ADOBE" APPLE = "APPLE" ASF = "ASF" @@ -86,6 +85,7 @@ class OsidbApiV1FlawsListSource(str, Enum): TWITTER = "TWITTER" UBUNTU = "UBUNTU" UPSTREAM = "UPSTREAM" + VALUE_0 = "" VENDORSEC = "VENDORSEC" VULNWATCH = "VULNWATCH" WIRESHARK = "WIRESHARK" diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_workflow_state_item.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_workflow_state_item.py index 1cb9d86..bed36b1 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_workflow_state_item.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_list_workflow_state_item.py @@ -2,13 +2,13 @@ class OsidbApiV1FlawsListWorkflowStateItem(str, Enum): - VALUE_0 = "" DONE = "DONE" NEW = "NEW" PRE_SECONDARY_ASSESSMENT = "PRE_SECONDARY_ASSESSMENT" REJECTED = "REJECTED" SECONDARY_ASSESSMENT = "SECONDARY_ASSESSMENT" TRIAGE = "TRIAGE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_create_response_201.py index 96e661e..101cb1f 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_create_response_201.py @@ -1,23 +1,44 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.flaw_version import FlawVersion -from ..models.flaw_version import FlawVersion -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsPackageVersionsCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsPackageVersionsCreateResponse201(OSIDBModel): - """ """ + """ + Attributes: + package (str): + versions (list['FlawVersion']): + flaw (UUID): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ package: str - versions: List[FlawVersion] - flaw: str - uuid: str + versions: list["FlawVersion"] + flaw: UUID + uuid: UUID embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime @@ -25,23 +46,31 @@ class OsidbApiV1FlawsPackageVersionsCreateResponse201(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: package = self.package - versions: List[Dict[str, Any]] = UNSET + + versions: list[dict[str, Any]] = UNSET if not isinstance(self.versions, Unset): versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() versions.append(versions_item) - flaw = self.flaw - uuid = self.uuid + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -55,59 +84,70 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(package, Unset): + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_version import FlawVersion + d = src_dict.copy() package = d.pop("package", UNSET) versions = [] _versions = d.pop("versions", UNSET) - if _versions is UNSET: - versions = UNSET + for versions_item_data in _versions or []: + _versions_item = versions_item_data + versions_item: FlawVersion + if isinstance(_versions_item, Unset): + versions_item = UNSET + else: + versions_item = FlawVersion.from_dict(_versions_item) + + versions.append(versions_item) + + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET else: - for versions_item_data in _versions or []: - _versions_item = versions_item_data - versions_item: FlawVersion - if isinstance(_versions_item, Unset): - versions_item = UNSET - else: - versions_item = FlawVersion.from_dict(_versions_item) - - versions.append(versions_item) + flaw = UUID(_flaw) - flaw = d.pop("flaw", UNSET) - - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) @@ -152,29 +192,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version=version, ) - osidb_api_v1_flaws_package_versions_create_response_201.additional_properties = ( - d - ) + osidb_api_v1_flaws_package_versions_create_response_201.additional_properties = d return osidb_api_v1_flaws_package_versions_create_response_201 - @staticmethod - def get_fields(): - return { - "package": str, - "versions": List[FlawVersion], - "flaw": str, - "uuid": str, - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_destroy_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_destroy_response_200.py index 70e4926..08a7812 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_destroy_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_destroy_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsPackageVersionsDestroyResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsPackageVersionsDestroyResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -64,22 +75,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version=version, ) - osidb_api_v1_flaws_package_versions_destroy_response_200.additional_properties = ( - d - ) + osidb_api_v1_flaws_package_versions_destroy_response_200.additional_properties = d return osidb_api_v1_flaws_package_versions_destroy_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_list_response_200.py index 87472f0..f8c8c9a 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.flaw_package_version import FlawPackageVersion -from ..models.flaw_package_version import FlawPackageVersion -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsPackageVersionsListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsPackageVersionsListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawPackageVersion']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[FlawPackageVersion] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["FlawPackageVersion"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_package_version import FlawPackageVersion + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawPackageVersion - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawPackageVersion.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawPackageVersion + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawPackageVersion.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_package_versions_list_response_200.additional_properties = d return osidb_api_v1_flaws_package_versions_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawPackageVersion], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_retrieve_response_200.py index 4e766af..2836540 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_retrieve_response_200.py @@ -1,23 +1,44 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.flaw_version import FlawVersion -from ..models.flaw_version import FlawVersion -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsPackageVersionsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsPackageVersionsRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + package (str): + versions (list['FlawVersion']): + flaw (UUID): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ package: str - versions: List[FlawVersion] - flaw: str - uuid: str + versions: list["FlawVersion"] + flaw: UUID + uuid: UUID embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime @@ -25,23 +46,31 @@ class OsidbApiV1FlawsPackageVersionsRetrieveResponse200(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: package = self.package - versions: List[Dict[str, Any]] = UNSET + + versions: list[dict[str, Any]] = UNSET if not isinstance(self.versions, Unset): versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() versions.append(versions_item) - flaw = self.flaw - uuid = self.uuid + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -55,59 +84,70 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(package, Unset): + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_version import FlawVersion + d = src_dict.copy() package = d.pop("package", UNSET) versions = [] _versions = d.pop("versions", UNSET) - if _versions is UNSET: - versions = UNSET + for versions_item_data in _versions or []: + _versions_item = versions_item_data + versions_item: FlawVersion + if isinstance(_versions_item, Unset): + versions_item = UNSET + else: + versions_item = FlawVersion.from_dict(_versions_item) + + versions.append(versions_item) + + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET else: - for versions_item_data in _versions or []: - _versions_item = versions_item_data - versions_item: FlawVersion - if isinstance(_versions_item, Unset): - versions_item = UNSET - else: - versions_item = FlawVersion.from_dict(_versions_item) - - versions.append(versions_item) + flaw = UUID(_flaw) - flaw = d.pop("flaw", UNSET) - - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) @@ -152,29 +192,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version=version, ) - osidb_api_v1_flaws_package_versions_retrieve_response_200.additional_properties = ( - d - ) + osidb_api_v1_flaws_package_versions_retrieve_response_200.additional_properties = d return osidb_api_v1_flaws_package_versions_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "package": str, - "versions": List[FlawVersion], - "flaw": str, - "uuid": str, - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_update_response_200.py index 55dcee0..bc88a9a 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_package_versions_update_response_200.py @@ -1,23 +1,44 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.flaw_version import FlawVersion -from ..models.flaw_version import FlawVersion -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsPackageVersionsUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsPackageVersionsUpdateResponse200(OSIDBModel): - """ """ + """ + Attributes: + package (str): + versions (list['FlawVersion']): + flaw (UUID): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ package: str - versions: List[FlawVersion] - flaw: str - uuid: str + versions: list["FlawVersion"] + flaw: UUID + uuid: UUID embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime @@ -25,23 +46,31 @@ class OsidbApiV1FlawsPackageVersionsUpdateResponse200(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: package = self.package - versions: List[Dict[str, Any]] = UNSET + + versions: list[dict[str, Any]] = UNSET if not isinstance(self.versions, Unset): versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() versions.append(versions_item) - flaw = self.flaw - uuid = self.uuid + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -55,59 +84,70 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(package, Unset): + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_version import FlawVersion + d = src_dict.copy() package = d.pop("package", UNSET) versions = [] _versions = d.pop("versions", UNSET) - if _versions is UNSET: - versions = UNSET + for versions_item_data in _versions or []: + _versions_item = versions_item_data + versions_item: FlawVersion + if isinstance(_versions_item, Unset): + versions_item = UNSET + else: + versions_item = FlawVersion.from_dict(_versions_item) + + versions.append(versions_item) + + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET else: - for versions_item_data in _versions or []: - _versions_item = versions_item_data - versions_item: FlawVersion - if isinstance(_versions_item, Unset): - versions_item = UNSET - else: - versions_item = FlawVersion.from_dict(_versions_item) - - versions.append(versions_item) + flaw = UUID(_flaw) - flaw = d.pop("flaw", UNSET) - - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) @@ -152,29 +192,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version=version, ) - osidb_api_v1_flaws_package_versions_update_response_200.additional_properties = ( - d - ) + osidb_api_v1_flaws_package_versions_update_response_200.additional_properties = d return osidb_api_v1_flaws_package_versions_update_response_200 - @staticmethod - def get_fields(): - return { - "package": str, - "versions": List[FlawVersion], - "flaw": str, - "uuid": str, - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_promote_create_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_promote_create_response_200.py index 3dd4b66..6421827 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_promote_create_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_promote_create_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsPromoteCreateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsPromoteCreateResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_promote_create_response_200.additional_properties = d return osidb_api_v1_flaws_promote_create_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_create_response_201.py index 8f712ce..524f15d 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_create_response_201.py @@ -1,45 +1,76 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.flaw_reference_type import FlawReferenceType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1FlawsReferencesCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsReferencesCreateResponse201(OSIDBModel): - """ """ - - flaw: str + """ + Attributes: + flaw (UUID): + url (str): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + description (Union[Unset, str]): + type_ (Union[Unset, FlawReferenceType]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + flaw: UUID url: str - uuid: str + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime description: Union[Unset, str] = UNSET - type: Union[Unset, FlawReferenceType] = UNSET + type_: Union[Unset, FlawReferenceType] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) - def to_dict(self) -> Dict[str, Any]: - flaw = self.flaw url = self.url - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -54,75 +85,87 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() description = self.description - type: Union[Unset, str] = UNSET - if not isinstance(self.type, Unset): - type = FlawReferenceType(self.type).value + print(FlawReferenceType) + type_: Union[Unset, str] = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(url, Unset): + if url is not UNSET: field_dict["url"] = url - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(dt, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) url = d.pop("url", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -140,12 +183,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: description = d.pop("description", UNSET) - _type = d.pop("type", UNSET) - type: Union[Unset, FlawReferenceType] - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: Union[Unset, FlawReferenceType] + if isinstance(_type_, Unset): + type_ = UNSET else: - type = FlawReferenceType(_type) + type_ = FlawReferenceType(_type_) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -169,7 +212,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: created_dt=created_dt, updated_dt=updated_dt, description=description, - type=type, + type_=type_, dt=dt, env=env, revision=revision, @@ -179,26 +222,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_references_create_response_201.additional_properties = d return osidb_api_v1_flaws_references_create_response_201 - @staticmethod - def get_fields(): - return { - "flaw": str, - "url": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "description": str, - "type": FlawReferenceType, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_destroy_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_destroy_response_200.py index 735da72..3212315 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_destroy_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_destroy_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsReferencesDestroyResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsReferencesDestroyResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_references_destroy_response_200.additional_properties = d return osidb_api_v1_flaws_references_destroy_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_list_response_200.py index 1829bc5..53130f3 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.flaw_reference import FlawReference -from ..models.flaw_reference import FlawReference -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsReferencesListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsReferencesListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawReference']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[FlawReference] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["FlawReference"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.flaw_reference import FlawReference + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawReference - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawReference.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawReference + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawReference.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_references_list_response_200.additional_properties = d return osidb_api_v1_flaws_references_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawReference], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_retrieve_response_200.py index e732ec0..a47c509 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_retrieve_response_200.py @@ -1,45 +1,76 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.flaw_reference_type import FlawReferenceType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1FlawsReferencesRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsReferencesRetrieveResponse200(OSIDBModel): - """ """ - - flaw: str + """ + Attributes: + flaw (UUID): + url (str): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + description (Union[Unset, str]): + type_ (Union[Unset, FlawReferenceType]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + flaw: UUID url: str - uuid: str + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime description: Union[Unset, str] = UNSET - type: Union[Unset, FlawReferenceType] = UNSET + type_: Union[Unset, FlawReferenceType] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) - def to_dict(self) -> Dict[str, Any]: - flaw = self.flaw url = self.url - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -54,75 +85,87 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() description = self.description - type: Union[Unset, str] = UNSET - if not isinstance(self.type, Unset): - type = FlawReferenceType(self.type).value + print(FlawReferenceType) + type_: Union[Unset, str] = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(url, Unset): + if url is not UNSET: field_dict["url"] = url - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(dt, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) url = d.pop("url", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -140,12 +183,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: description = d.pop("description", UNSET) - _type = d.pop("type", UNSET) - type: Union[Unset, FlawReferenceType] - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: Union[Unset, FlawReferenceType] + if isinstance(_type_, Unset): + type_ = UNSET else: - type = FlawReferenceType(_type) + type_ = FlawReferenceType(_type_) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -169,7 +212,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: created_dt=created_dt, updated_dt=updated_dt, description=description, - type=type, + type_=type_, dt=dt, env=env, revision=revision, @@ -179,26 +222,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_references_retrieve_response_200.additional_properties = d return osidb_api_v1_flaws_references_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "flaw": str, - "url": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "description": str, - "type": FlawReferenceType, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_update_response_200.py index 6dd7329..abe65d8 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_update_response_200.py @@ -1,45 +1,76 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert from ..models.flaw_reference_type import FlawReferenceType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + T = TypeVar("T", bound="OsidbApiV1FlawsReferencesUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsReferencesUpdateResponse200(OSIDBModel): - """ """ - - flaw: str + """ + Attributes: + flaw (UUID): + url (str): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + description (Union[Unset, str]): + type_ (Union[Unset, FlawReferenceType]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + flaw: UUID url: str - uuid: str + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime description: Union[Unset, str] = UNSET - type: Union[Unset, FlawReferenceType] = UNSET + type_: Union[Unset, FlawReferenceType] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + flaw: str = UNSET + if not isinstance(self.flaw, Unset): + flaw = str(self.flaw) - def to_dict(self) -> Dict[str, Any]: - flaw = self.flaw url = self.url - uuid = self.uuid + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -54,75 +85,87 @@ def to_dict(self) -> Dict[str, Any]: updated_dt = self.updated_dt.isoformat() description = self.description - type: Union[Unset, str] = UNSET - if not isinstance(self.type, Unset): - type = FlawReferenceType(self.type).value + print(FlawReferenceType) + type_: Union[Unset, str] = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw, Unset): + if flaw is not UNSET: field_dict["flaw"] = flaw - if not isinstance(url, Unset): + if url is not UNSET: field_dict["url"] = url - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(description, Unset): + if description is not UNSET: field_dict["description"] = description - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(dt, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() - flaw = d.pop("flaw", UNSET) + _flaw = d.pop("flaw", UNSET) + flaw: UUID + if isinstance(_flaw, Unset): + flaw = UNSET + else: + flaw = UUID(_flaw) url = d.pop("url", UNSET) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -140,12 +183,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: description = d.pop("description", UNSET) - _type = d.pop("type", UNSET) - type: Union[Unset, FlawReferenceType] - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: Union[Unset, FlawReferenceType] + if isinstance(_type_, Unset): + type_ = UNSET else: - type = FlawReferenceType(_type) + type_ = FlawReferenceType(_type_) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -169,7 +212,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: created_dt=created_dt, updated_dt=updated_dt, description=description, - type=type, + type_=type_, dt=dt, env=env, revision=revision, @@ -179,26 +222,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_references_update_response_200.additional_properties = d return osidb_api_v1_flaws_references_update_response_200 - @staticmethod - def get_fields(): - return { - "flaw": str, - "url": str, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "description": str, - "type": FlawReferenceType, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_reject_create_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_reject_create_response_200.py index cea6f14..21db139 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_reject_create_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_reject_create_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsRejectCreateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsRejectCreateResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_flaws_reject_create_response_200.additional_properties = d return osidb_api_v1_flaws_reject_create_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_retrieve_response_200.py index 5cf65aa..fb474e6 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_retrieve_response_200.py @@ -1,62 +1,108 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect import Affect -from ..models.alert import Alert from ..models.blank_enum import BlankEnum -from ..models.comment import Comment -from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..models.flaw_classification import FlawClassification -from ..models.flaw_cvss import FlawCVSS -from ..models.flaw_reference import FlawReference from ..models.impact_enum import ImpactEnum from ..models.major_incident_state_enum import MajorIncidentStateEnum from ..models.nist_cvss_validation_enum import NistCvssValidationEnum -from ..models.package import Package from ..models.requires_cve_description_enum import RequiresCveDescriptionEnum from ..models.source_be_0_enum import SourceBe0Enum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_classification import FlawClassification + from ..models.package import Package + from ..models.flaw_reference import FlawReference + T = TypeVar("T", bound="OsidbApiV1FlawsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsRetrieveResponse200(OSIDBModel): - """ """ - - uuid: str + """ + Attributes: + uuid (UUID): + title (str): + trackers (list[str]): + comment_zero (str): + affects (list['Affect']): + comments (list['Comment']): + package_versions (list['Package']): + acknowledgments (list['FlawAcknowledgment']): + references (list['FlawReference']): + cvss_scores (list['FlawCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + classification (FlawClassification): + alerts (list['Alert']): + cve_id (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + components (Union[Unset, list[str]]): + cve_description (Union[Unset, str]): + requires_cve_description (Union[BlankEnum, RequiresCveDescriptionEnum, Unset]): + statement (Union[Unset, str]): + cwe_id (Union[Unset, str]): + unembargo_dt (Union[None, Unset, datetime.datetime]): + source (Union[BlankEnum, SourceBe0Enum, Unset]): + reported_dt (Union[None, Unset, datetime.datetime]): + mitigation (Union[Unset, str]): + major_incident_state (Union[BlankEnum, MajorIncidentStateEnum, Unset]): + major_incident_start_dt (Union[None, Unset, datetime.datetime]): + nist_cvss_validation (Union[BlankEnum, NistCvssValidationEnum, Unset]): + group_key (Union[Unset, str]): + owner (Union[Unset, str]): + task_key (Union[Unset, str]): + team_id (Union[Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + uuid: UUID title: str - trackers: List[str] + trackers: list[str] comment_zero: str - affects: List[Affect] - comments: List[Comment] - package_versions: List[Package] - acknowledgments: List[FlawAcknowledgment] - references: List[FlawReference] - cvss_scores: List[FlawCVSS] + affects: list["Affect"] + comments: list["Comment"] + package_versions: list["Package"] + acknowledgments: list["FlawAcknowledgment"] + references: list["FlawReference"] + cvss_scores: list["FlawCVSS"] embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime - classification: FlawClassification - alerts: List[Alert] - cve_id: Union[Unset, None, str] = UNSET + classification: "FlawClassification" + alerts: list["Alert"] + cve_id: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET cve_description: Union[Unset, str] = UNSET - requires_cve_description: Union[ - BlankEnum, RequiresCveDescriptionEnum, Unset - ] = UNSET + requires_cve_description: Union[BlankEnum, RequiresCveDescriptionEnum, Unset] = UNSET statement: Union[Unset, str] = UNSET cwe_id: Union[Unset, str] = UNSET - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET + unembargo_dt: Union[None, Unset, datetime.datetime] = UNSET source: Union[BlankEnum, SourceBe0Enum, Unset] = UNSET - reported_dt: Union[Unset, None, datetime.datetime] = UNSET + reported_dt: Union[None, Unset, datetime.datetime] = UNSET mitigation: Union[Unset, str] = UNSET major_incident_state: Union[BlankEnum, MajorIncidentStateEnum, Unset] = UNSET - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET + major_incident_start_dt: Union[None, Unset, datetime.datetime] = UNSET nist_cvss_validation: Union[BlankEnum, NistCvssValidationEnum, Unset] = UNSET group_key: Union[Unset, str] = UNSET owner: Union[Unset, str] = UNSET @@ -66,77 +112,83 @@ class OsidbApiV1FlawsRetrieveResponse200(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid title = self.title - trackers: List[str] = UNSET + + trackers: list[str] = UNSET if not isinstance(self.trackers, Unset): trackers = self.trackers comment_zero = self.comment_zero - affects: List[Dict[str, Any]] = UNSET + + affects: list[dict[str, Any]] = UNSET if not isinstance(self.affects, Unset): affects = [] for affects_item_data in self.affects: - affects_item: Dict[str, Any] = UNSET + affects_item: dict[str, Any] = UNSET if not isinstance(affects_item_data, Unset): affects_item = affects_item_data.to_dict() affects.append(affects_item) - comments: List[Dict[str, Any]] = UNSET + comments: list[dict[str, Any]] = UNSET if not isinstance(self.comments, Unset): comments = [] for comments_item_data in self.comments: - comments_item: Dict[str, Any] = UNSET + comments_item: dict[str, Any] = UNSET if not isinstance(comments_item_data, Unset): comments_item = comments_item_data.to_dict() comments.append(comments_item) - package_versions: List[Dict[str, Any]] = UNSET + package_versions: list[dict[str, Any]] = UNSET if not isinstance(self.package_versions, Unset): package_versions = [] for package_versions_item_data in self.package_versions: - package_versions_item: Dict[str, Any] = UNSET + package_versions_item: dict[str, Any] = UNSET if not isinstance(package_versions_item_data, Unset): package_versions_item = package_versions_item_data.to_dict() package_versions.append(package_versions_item) - acknowledgments: List[Dict[str, Any]] = UNSET + acknowledgments: list[dict[str, Any]] = UNSET if not isinstance(self.acknowledgments, Unset): acknowledgments = [] for acknowledgments_item_data in self.acknowledgments: - acknowledgments_item: Dict[str, Any] = UNSET + acknowledgments_item: dict[str, Any] = UNSET if not isinstance(acknowledgments_item_data, Unset): acknowledgments_item = acknowledgments_item_data.to_dict() acknowledgments.append(acknowledgments_item) - references: List[Dict[str, Any]] = UNSET + references: list[dict[str, Any]] = UNSET if not isinstance(self.references, Unset): references = [] for references_item_data in self.references: - references_item: Dict[str, Any] = UNSET + references_item: dict[str, Any] = UNSET if not isinstance(references_item_data, Unset): references_item = references_item_data.to_dict() references.append(references_item) - cvss_scores: List[Dict[str, Any]] = UNSET + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -145,321 +197,339 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - classification: Dict[str, Any] = UNSET + classification: dict[str, Any] = UNSET if not isinstance(self.classification, Unset): classification = self.classification.to_dict() - alerts: List[Dict[str, Any]] = UNSET + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() alerts.append(alerts_item) - cve_id = self.cve_id + cve_id: Union[None, Unset, str] + if isinstance(self.cve_id, Unset): + cve_id = UNSET + else: + cve_id = self.cve_id + impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value - - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET if not isinstance(self.components, Unset): components = self.components cve_description = self.cve_description + requires_cve_description: Union[Unset, str] if isinstance(self.requires_cve_description, Unset): requires_cve_description = UNSET elif isinstance(self.requires_cve_description, RequiresCveDescriptionEnum): + print(RequiresCveDescriptionEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = RequiresCveDescriptionEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value else: + print(BlankEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = BlankEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value statement = self.statement + cwe_id = self.cwe_id - unembargo_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.unembargo_dt, Unset): - unembargo_dt = self.unembargo_dt.isoformat() if self.unembargo_dt else None + + unembargo_dt: Union[None, Unset, str] + if isinstance(self.unembargo_dt, Unset): + unembargo_dt = UNSET + elif isinstance(self.unembargo_dt, datetime.datetime): + unembargo_dt = UNSET + if not isinstance(self.unembargo_dt, Unset): + unembargo_dt = self.unembargo_dt.isoformat() + + else: + unembargo_dt = self.unembargo_dt source: Union[Unset, str] if isinstance(self.source, Unset): source = UNSET elif isinstance(self.source, SourceBe0Enum): + print(SourceBe0Enum) source = UNSET if not isinstance(self.source, Unset): - - source = SourceBe0Enum(self.source).value + source = self.source.value else: + print(BlankEnum) source = UNSET if not isinstance(self.source, Unset): + source = self.source.value - source = BlankEnum(self.source).value + reported_dt: Union[None, Unset, str] + if isinstance(self.reported_dt, Unset): + reported_dt = UNSET + elif isinstance(self.reported_dt, datetime.datetime): + reported_dt = UNSET + if not isinstance(self.reported_dt, Unset): + reported_dt = self.reported_dt.isoformat() - reported_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.reported_dt, Unset): - reported_dt = self.reported_dt.isoformat() if self.reported_dt else None + else: + reported_dt = self.reported_dt mitigation = self.mitigation + major_incident_state: Union[Unset, str] if isinstance(self.major_incident_state, Unset): major_incident_state = UNSET elif isinstance(self.major_incident_state, MajorIncidentStateEnum): + print(MajorIncidentStateEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): - - major_incident_state = MajorIncidentStateEnum( - self.major_incident_state - ).value + major_incident_state = self.major_incident_state.value else: + print(BlankEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): + major_incident_state = self.major_incident_state.value - major_incident_state = BlankEnum(self.major_incident_state).value + major_incident_start_dt: Union[None, Unset, str] + if isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = UNSET + elif isinstance(self.major_incident_start_dt, datetime.datetime): + major_incident_start_dt = UNSET + if not isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = self.major_incident_start_dt.isoformat() - major_incident_start_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.major_incident_start_dt, Unset): - major_incident_start_dt = ( - self.major_incident_start_dt.isoformat() - if self.major_incident_start_dt - else None - ) + else: + major_incident_start_dt = self.major_incident_start_dt nist_cvss_validation: Union[Unset, str] if isinstance(self.nist_cvss_validation, Unset): nist_cvss_validation = UNSET elif isinstance(self.nist_cvss_validation, NistCvssValidationEnum): + print(NistCvssValidationEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = NistCvssValidationEnum( - self.nist_cvss_validation - ).value + nist_cvss_validation = self.nist_cvss_validation.value else: + print(BlankEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = BlankEnum(self.nist_cvss_validation).value + nist_cvss_validation = self.nist_cvss_validation.value group_key = self.group_key + owner = self.owner + task_key = self.task_key + team_id = self.team_id + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(title, Unset): + if title is not UNSET: field_dict["title"] = title - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(comment_zero, Unset): + if comment_zero is not UNSET: field_dict["comment_zero"] = comment_zero - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(comments, Unset): + if comments is not UNSET: field_dict["comments"] = comments - if not isinstance(package_versions, Unset): + if package_versions is not UNSET: field_dict["package_versions"] = package_versions - if not isinstance(acknowledgments, Unset): + if acknowledgments is not UNSET: field_dict["acknowledgments"] = acknowledgments - if not isinstance(references, Unset): + if references is not UNSET: field_dict["references"] = references - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(classification, Unset): + if classification is not UNSET: field_dict["classification"] = classification - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(cve_id, Unset): + if cve_id is not UNSET: field_dict["cve_id"] = cve_id - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(components, Unset): + if components is not UNSET: field_dict["components"] = components - if not isinstance(cve_description, Unset): + if cve_description is not UNSET: field_dict["cve_description"] = cve_description - if not isinstance(requires_cve_description, Unset): + if requires_cve_description is not UNSET: field_dict["requires_cve_description"] = requires_cve_description - if not isinstance(statement, Unset): + if statement is not UNSET: field_dict["statement"] = statement - if not isinstance(cwe_id, Unset): + if cwe_id is not UNSET: field_dict["cwe_id"] = cwe_id - if not isinstance(unembargo_dt, Unset): + if unembargo_dt is not UNSET: field_dict["unembargo_dt"] = unembargo_dt - if not isinstance(source, Unset): + if source is not UNSET: field_dict["source"] = source - if not isinstance(reported_dt, Unset): + if reported_dt is not UNSET: field_dict["reported_dt"] = reported_dt - if not isinstance(mitigation, Unset): + if mitigation is not UNSET: field_dict["mitigation"] = mitigation - if not isinstance(major_incident_state, Unset): + if major_incident_state is not UNSET: field_dict["major_incident_state"] = major_incident_state - if not isinstance(major_incident_start_dt, Unset): + if major_incident_start_dt is not UNSET: field_dict["major_incident_start_dt"] = major_incident_start_dt - if not isinstance(nist_cvss_validation, Unset): + if nist_cvss_validation is not UNSET: field_dict["nist_cvss_validation"] = nist_cvss_validation - if not isinstance(group_key, Unset): + if group_key is not UNSET: field_dict["group_key"] = group_key - if not isinstance(owner, Unset): + if owner is not UNSET: field_dict["owner"] = owner - if not isinstance(task_key, Unset): + if task_key is not UNSET: field_dict["task_key"] = task_key - if not isinstance(team_id, Unset): + if team_id is not UNSET: field_dict["team_id"] = team_id - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_classification import FlawClassification + from ..models.package import Package + from ..models.flaw_reference import FlawReference + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) title = d.pop("title", UNSET) - trackers = cast(List[str], d.pop("trackers", UNSET)) + trackers = cast(list[str], d.pop("trackers", UNSET)) comment_zero = d.pop("comment_zero", UNSET) affects = [] _affects = d.pop("affects", UNSET) - if _affects is UNSET: - affects = UNSET - else: - for affects_item_data in _affects or []: - _affects_item = affects_item_data - affects_item: Affect - if isinstance(_affects_item, Unset): - affects_item = UNSET - else: - affects_item = Affect.from_dict(_affects_item) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: Affect + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = Affect.from_dict(_affects_item) - affects.append(affects_item) + affects.append(affects_item) comments = [] _comments = d.pop("comments", UNSET) - if _comments is UNSET: - comments = UNSET - else: - for comments_item_data in _comments or []: - _comments_item = comments_item_data - comments_item: Comment - if isinstance(_comments_item, Unset): - comments_item = UNSET - else: - comments_item = Comment.from_dict(_comments_item) + for comments_item_data in _comments or []: + _comments_item = comments_item_data + comments_item: Comment + if isinstance(_comments_item, Unset): + comments_item = UNSET + else: + comments_item = Comment.from_dict(_comments_item) - comments.append(comments_item) + comments.append(comments_item) package_versions = [] _package_versions = d.pop("package_versions", UNSET) - if _package_versions is UNSET: - package_versions = UNSET - else: - for package_versions_item_data in _package_versions or []: - _package_versions_item = package_versions_item_data - package_versions_item: Package - if isinstance(_package_versions_item, Unset): - package_versions_item = UNSET - else: - package_versions_item = Package.from_dict(_package_versions_item) + for package_versions_item_data in _package_versions or []: + _package_versions_item = package_versions_item_data + package_versions_item: Package + if isinstance(_package_versions_item, Unset): + package_versions_item = UNSET + else: + package_versions_item = Package.from_dict(_package_versions_item) - package_versions.append(package_versions_item) + package_versions.append(package_versions_item) acknowledgments = [] _acknowledgments = d.pop("acknowledgments", UNSET) - if _acknowledgments is UNSET: - acknowledgments = UNSET - else: - for acknowledgments_item_data in _acknowledgments or []: - _acknowledgments_item = acknowledgments_item_data - acknowledgments_item: FlawAcknowledgment - if isinstance(_acknowledgments_item, Unset): - acknowledgments_item = UNSET - else: - acknowledgments_item = FlawAcknowledgment.from_dict( - _acknowledgments_item - ) + for acknowledgments_item_data in _acknowledgments or []: + _acknowledgments_item = acknowledgments_item_data + acknowledgments_item: FlawAcknowledgment + if isinstance(_acknowledgments_item, Unset): + acknowledgments_item = UNSET + else: + acknowledgments_item = FlawAcknowledgment.from_dict(_acknowledgments_item) - acknowledgments.append(acknowledgments_item) + acknowledgments.append(acknowledgments_item) references = [] _references = d.pop("references", UNSET) - if _references is UNSET: - references = UNSET - else: - for references_item_data in _references or []: - _references_item = references_item_data - references_item: FlawReference - if isinstance(_references_item, Unset): - references_item = UNSET - else: - references_item = FlawReference.from_dict(_references_item) + for references_item_data in _references or []: + _references_item = references_item_data + references_item: FlawReference + if isinstance(_references_item, Unset): + references_item = UNSET + else: + references_item = FlawReference.from_dict(_references_item) - references.append(references_item) + references.append(references_item) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: FlawCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: FlawCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) @@ -486,20 +556,24 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) + + def _parse_cve_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - cve_id = d.pop("cve_id", UNSET) + cve_id = _parse_cve_id(d.pop("cve_id", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -508,7 +582,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -520,7 +594,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -530,28 +604,22 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - components = cast(List[str], d.pop("components", UNSET)) + components = cast(list[str], d.pop("components", UNSET)) cve_description = d.pop("cve_description", UNSET) - def _parse_requires_cve_description( - data: object, - ) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: + def _parse_requires_cve_description(data: object) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _requires_cve_description_type_0 = data - requires_cve_description_type_0: Union[ - Unset, RequiresCveDescriptionEnum - ] + requires_cve_description_type_0: RequiresCveDescriptionEnum if isinstance(_requires_cve_description_type_0, Unset): requires_cve_description_type_0 = UNSET else: - requires_cve_description_type_0 = RequiresCveDescriptionEnum( - _requires_cve_description_type_0 - ) + requires_cve_description_type_0 = RequiresCveDescriptionEnum(_requires_cve_description_type_0) return requires_cve_description_type_0 except: # noqa: E722 @@ -559,32 +627,41 @@ def _parse_requires_cve_description( if not isinstance(data, str): raise TypeError() _requires_cve_description_type_1 = data - requires_cve_description_type_1: Union[Unset, BlankEnum] + requires_cve_description_type_1: BlankEnum if isinstance(_requires_cve_description_type_1, Unset): requires_cve_description_type_1 = UNSET else: - requires_cve_description_type_1 = BlankEnum( - _requires_cve_description_type_1 - ) + requires_cve_description_type_1 = BlankEnum(_requires_cve_description_type_1) return requires_cve_description_type_1 - requires_cve_description = _parse_requires_cve_description( - d.pop("requires_cve_description", UNSET) - ) + requires_cve_description = _parse_requires_cve_description(d.pop("requires_cve_description", UNSET)) statement = d.pop("statement", UNSET) cwe_id = d.pop("cwe_id", UNSET) - _unembargo_dt = d.pop("unembargo_dt", UNSET) - unembargo_dt: Union[Unset, None, datetime.datetime] - if _unembargo_dt is None: - unembargo_dt = None - elif isinstance(_unembargo_dt, Unset): - unembargo_dt = UNSET - else: - unembargo_dt = isoparse(_unembargo_dt) + def _parse_unembargo_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _unembargo_dt_type_0 = data + unembargo_dt_type_0: datetime.datetime + if isinstance(_unembargo_dt_type_0, Unset): + unembargo_dt_type_0 = UNSET + else: + unembargo_dt_type_0 = isoparse(_unembargo_dt_type_0) + + return unembargo_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + unembargo_dt = _parse_unembargo_dt(d.pop("unembargo_dt", UNSET)) def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if isinstance(data, Unset): @@ -593,7 +670,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_0 = data - source_type_0: Union[Unset, SourceBe0Enum] + source_type_0: SourceBe0Enum if isinstance(_source_type_0, Unset): source_type_0 = UNSET else: @@ -605,7 +682,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_1 = data - source_type_1: Union[Unset, BlankEnum] + source_type_1: BlankEnum if isinstance(_source_type_1, Unset): source_type_1 = UNSET else: @@ -615,33 +692,42 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: source = _parse_source(d.pop("source", UNSET)) - _reported_dt = d.pop("reported_dt", UNSET) - reported_dt: Union[Unset, None, datetime.datetime] - if _reported_dt is None: - reported_dt = None - elif isinstance(_reported_dt, Unset): - reported_dt = UNSET - else: - reported_dt = isoparse(_reported_dt) + def _parse_reported_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _reported_dt_type_0 = data + reported_dt_type_0: datetime.datetime + if isinstance(_reported_dt_type_0, Unset): + reported_dt_type_0 = UNSET + else: + reported_dt_type_0 = isoparse(_reported_dt_type_0) + + return reported_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + reported_dt = _parse_reported_dt(d.pop("reported_dt", UNSET)) mitigation = d.pop("mitigation", UNSET) - def _parse_major_incident_state( - data: object, - ) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: + def _parse_major_incident_state(data: object) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _major_incident_state_type_0 = data - major_incident_state_type_0: Union[Unset, MajorIncidentStateEnum] + major_incident_state_type_0: MajorIncidentStateEnum if isinstance(_major_incident_state_type_0, Unset): major_incident_state_type_0 = UNSET else: - major_incident_state_type_0 = MajorIncidentStateEnum( - _major_incident_state_type_0 - ) + major_incident_state_type_0 = MajorIncidentStateEnum(_major_incident_state_type_0) return major_incident_state_type_0 except: # noqa: E722 @@ -649,7 +735,7 @@ def _parse_major_incident_state( if not isinstance(data, str): raise TypeError() _major_incident_state_type_1 = data - major_incident_state_type_1: Union[Unset, BlankEnum] + major_incident_state_type_1: BlankEnum if isinstance(_major_incident_state_type_1, Unset): major_incident_state_type_1 = UNSET else: @@ -657,35 +743,42 @@ def _parse_major_incident_state( return major_incident_state_type_1 - major_incident_state = _parse_major_incident_state( - d.pop("major_incident_state", UNSET) - ) + major_incident_state = _parse_major_incident_state(d.pop("major_incident_state", UNSET)) - _major_incident_start_dt = d.pop("major_incident_start_dt", UNSET) - major_incident_start_dt: Union[Unset, None, datetime.datetime] - if _major_incident_start_dt is None: - major_incident_start_dt = None - elif isinstance(_major_incident_start_dt, Unset): - major_incident_start_dt = UNSET - else: - major_incident_start_dt = isoparse(_major_incident_start_dt) + def _parse_major_incident_start_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _major_incident_start_dt_type_0 = data + major_incident_start_dt_type_0: datetime.datetime + if isinstance(_major_incident_start_dt_type_0, Unset): + major_incident_start_dt_type_0 = UNSET + else: + major_incident_start_dt_type_0 = isoparse(_major_incident_start_dt_type_0) + + return major_incident_start_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) - def _parse_nist_cvss_validation( - data: object, - ) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: + major_incident_start_dt = _parse_major_incident_start_dt(d.pop("major_incident_start_dt", UNSET)) + + def _parse_nist_cvss_validation(data: object) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_0 = data - nist_cvss_validation_type_0: Union[Unset, NistCvssValidationEnum] + nist_cvss_validation_type_0: NistCvssValidationEnum if isinstance(_nist_cvss_validation_type_0, Unset): nist_cvss_validation_type_0 = UNSET else: - nist_cvss_validation_type_0 = NistCvssValidationEnum( - _nist_cvss_validation_type_0 - ) + nist_cvss_validation_type_0 = NistCvssValidationEnum(_nist_cvss_validation_type_0) return nist_cvss_validation_type_0 except: # noqa: E722 @@ -693,7 +786,7 @@ def _parse_nist_cvss_validation( if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_1 = data - nist_cvss_validation_type_1: Union[Unset, BlankEnum] + nist_cvss_validation_type_1: BlankEnum if isinstance(_nist_cvss_validation_type_1, Unset): nist_cvss_validation_type_1 = UNSET else: @@ -701,9 +794,7 @@ def _parse_nist_cvss_validation( return nist_cvss_validation_type_1 - nist_cvss_validation = _parse_nist_cvss_validation( - d.pop("nist_cvss_validation", UNSET) - ) + nist_cvss_validation = _parse_nist_cvss_validation(d.pop("nist_cvss_validation", UNSET)) group_key = d.pop("group_key", UNSET) @@ -769,50 +860,8 @@ def _parse_nist_cvss_validation( osidb_api_v1_flaws_retrieve_response_200.additional_properties = d return osidb_api_v1_flaws_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "uuid": str, - "title": str, - "trackers": List[str], - "comment_zero": str, - "affects": List[Affect], - "comments": List[Comment], - "package_versions": List[Package], - "acknowledgments": List[FlawAcknowledgment], - "references": List[FlawReference], - "cvss_scores": List[FlawCVSS], - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "classification": FlawClassification, - "alerts": List[Alert], - "cve_id": str, - "impact": Union[BlankEnum, ImpactEnum], - "components": List[str], - "cve_description": str, - "requires_cve_description": Union[BlankEnum, RequiresCveDescriptionEnum], - "statement": str, - "cwe_id": str, - "unembargo_dt": datetime.datetime, - "source": Union[BlankEnum, SourceBe0Enum], - "reported_dt": datetime.datetime, - "mitigation": str, - "major_incident_state": Union[BlankEnum, MajorIncidentStateEnum], - "major_incident_start_dt": datetime.datetime, - "nist_cvss_validation": Union[BlankEnum, NistCvssValidationEnum], - "group_key": str, - "owner": str, - "task_key": str, - "team_id": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_update_response_200.py index 1673404..3d0acc8 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_update_response_200.py @@ -1,62 +1,108 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.affect import Affect -from ..models.alert import Alert from ..models.blank_enum import BlankEnum -from ..models.comment import Comment -from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..models.flaw_classification import FlawClassification -from ..models.flaw_cvss import FlawCVSS -from ..models.flaw_reference import FlawReference from ..models.impact_enum import ImpactEnum from ..models.major_incident_state_enum import MajorIncidentStateEnum from ..models.nist_cvss_validation_enum import NistCvssValidationEnum -from ..models.package import Package from ..models.requires_cve_description_enum import RequiresCveDescriptionEnum from ..models.source_be_0_enum import SourceBe0Enum -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_classification import FlawClassification + from ..models.package import Package + from ..models.flaw_reference import FlawReference + T = TypeVar("T", bound="OsidbApiV1FlawsUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1FlawsUpdateResponse200(OSIDBModel): - """ """ - - uuid: str + """ + Attributes: + uuid (UUID): + title (str): + trackers (list[str]): + comment_zero (str): + affects (list['Affect']): + comments (list['Comment']): + package_versions (list['Package']): + acknowledgments (list['FlawAcknowledgment']): + references (list['FlawReference']): + cvss_scores (list['FlawCVSS']): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + classification (FlawClassification): + alerts (list['Alert']): + cve_id (Union[None, Unset, str]): + impact (Union[BlankEnum, ImpactEnum, Unset]): + components (Union[Unset, list[str]]): + cve_description (Union[Unset, str]): + requires_cve_description (Union[BlankEnum, RequiresCveDescriptionEnum, Unset]): + statement (Union[Unset, str]): + cwe_id (Union[Unset, str]): + unembargo_dt (Union[None, Unset, datetime.datetime]): + source (Union[BlankEnum, SourceBe0Enum, Unset]): + reported_dt (Union[None, Unset, datetime.datetime]): + mitigation (Union[Unset, str]): + major_incident_state (Union[BlankEnum, MajorIncidentStateEnum, Unset]): + major_incident_start_dt (Union[None, Unset, datetime.datetime]): + nist_cvss_validation (Union[BlankEnum, NistCvssValidationEnum, Unset]): + group_key (Union[Unset, str]): + owner (Union[Unset, str]): + task_key (Union[Unset, str]): + team_id (Union[Unset, str]): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + uuid: UUID title: str - trackers: List[str] + trackers: list[str] comment_zero: str - affects: List[Affect] - comments: List[Comment] - package_versions: List[Package] - acknowledgments: List[FlawAcknowledgment] - references: List[FlawReference] - cvss_scores: List[FlawCVSS] + affects: list["Affect"] + comments: list["Comment"] + package_versions: list["Package"] + acknowledgments: list["FlawAcknowledgment"] + references: list["FlawReference"] + cvss_scores: list["FlawCVSS"] embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime - classification: FlawClassification - alerts: List[Alert] - cve_id: Union[Unset, None, str] = UNSET + classification: "FlawClassification" + alerts: list["Alert"] + cve_id: Union[None, Unset, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET cve_description: Union[Unset, str] = UNSET - requires_cve_description: Union[ - BlankEnum, RequiresCveDescriptionEnum, Unset - ] = UNSET + requires_cve_description: Union[BlankEnum, RequiresCveDescriptionEnum, Unset] = UNSET statement: Union[Unset, str] = UNSET cwe_id: Union[Unset, str] = UNSET - unembargo_dt: Union[Unset, None, datetime.datetime] = UNSET + unembargo_dt: Union[None, Unset, datetime.datetime] = UNSET source: Union[BlankEnum, SourceBe0Enum, Unset] = UNSET - reported_dt: Union[Unset, None, datetime.datetime] = UNSET + reported_dt: Union[None, Unset, datetime.datetime] = UNSET mitigation: Union[Unset, str] = UNSET major_incident_state: Union[BlankEnum, MajorIncidentStateEnum, Unset] = UNSET - major_incident_start_dt: Union[Unset, None, datetime.datetime] = UNSET + major_incident_start_dt: Union[None, Unset, datetime.datetime] = UNSET nist_cvss_validation: Union[BlankEnum, NistCvssValidationEnum, Unset] = UNSET group_key: Union[Unset, str] = UNSET owner: Union[Unset, str] = UNSET @@ -66,77 +112,83 @@ class OsidbApiV1FlawsUpdateResponse200(OSIDBModel): env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - def to_dict(self) -> Dict[str, Any]: - uuid = self.uuid title = self.title - trackers: List[str] = UNSET + + trackers: list[str] = UNSET if not isinstance(self.trackers, Unset): trackers = self.trackers comment_zero = self.comment_zero - affects: List[Dict[str, Any]] = UNSET + + affects: list[dict[str, Any]] = UNSET if not isinstance(self.affects, Unset): affects = [] for affects_item_data in self.affects: - affects_item: Dict[str, Any] = UNSET + affects_item: dict[str, Any] = UNSET if not isinstance(affects_item_data, Unset): affects_item = affects_item_data.to_dict() affects.append(affects_item) - comments: List[Dict[str, Any]] = UNSET + comments: list[dict[str, Any]] = UNSET if not isinstance(self.comments, Unset): comments = [] for comments_item_data in self.comments: - comments_item: Dict[str, Any] = UNSET + comments_item: dict[str, Any] = UNSET if not isinstance(comments_item_data, Unset): comments_item = comments_item_data.to_dict() comments.append(comments_item) - package_versions: List[Dict[str, Any]] = UNSET + package_versions: list[dict[str, Any]] = UNSET if not isinstance(self.package_versions, Unset): package_versions = [] for package_versions_item_data in self.package_versions: - package_versions_item: Dict[str, Any] = UNSET + package_versions_item: dict[str, Any] = UNSET if not isinstance(package_versions_item_data, Unset): package_versions_item = package_versions_item_data.to_dict() package_versions.append(package_versions_item) - acknowledgments: List[Dict[str, Any]] = UNSET + acknowledgments: list[dict[str, Any]] = UNSET if not isinstance(self.acknowledgments, Unset): acknowledgments = [] for acknowledgments_item_data in self.acknowledgments: - acknowledgments_item: Dict[str, Any] = UNSET + acknowledgments_item: dict[str, Any] = UNSET if not isinstance(acknowledgments_item_data, Unset): acknowledgments_item = acknowledgments_item_data.to_dict() acknowledgments.append(acknowledgments_item) - references: List[Dict[str, Any]] = UNSET + references: list[dict[str, Any]] = UNSET if not isinstance(self.references, Unset): references = [] for references_item_data in self.references: - references_item: Dict[str, Any] = UNSET + references_item: dict[str, Any] = UNSET if not isinstance(references_item_data, Unset): references_item = references_item_data.to_dict() references.append(references_item) - cvss_scores: List[Dict[str, Any]] = UNSET + cvss_scores: list[dict[str, Any]] = UNSET if not isinstance(self.cvss_scores, Unset): cvss_scores = [] for cvss_scores_item_data in self.cvss_scores: - cvss_scores_item: Dict[str, Any] = UNSET + cvss_scores_item: dict[str, Any] = UNSET if not isinstance(cvss_scores_item_data, Unset): cvss_scores_item = cvss_scores_item_data.to_dict() cvss_scores.append(cvss_scores_item) embargoed = self.embargoed + created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -145,321 +197,339 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - classification: Dict[str, Any] = UNSET + classification: dict[str, Any] = UNSET if not isinstance(self.classification, Unset): classification = self.classification.to_dict() - alerts: List[Dict[str, Any]] = UNSET + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() alerts.append(alerts_item) - cve_id = self.cve_id + cve_id: Union[None, Unset, str] + if isinstance(self.cve_id, Unset): + cve_id = UNSET + else: + cve_id = self.cve_id + impact: Union[Unset, str] if isinstance(self.impact, Unset): impact = UNSET elif isinstance(self.impact, ImpactEnum): + print(ImpactEnum) impact = UNSET if not isinstance(self.impact, Unset): - - impact = ImpactEnum(self.impact).value + impact = self.impact.value else: + print(BlankEnum) impact = UNSET if not isinstance(self.impact, Unset): + impact = self.impact.value - impact = BlankEnum(self.impact).value - - components: Union[Unset, List[str]] = UNSET + components: Union[Unset, list[str]] = UNSET if not isinstance(self.components, Unset): components = self.components cve_description = self.cve_description + requires_cve_description: Union[Unset, str] if isinstance(self.requires_cve_description, Unset): requires_cve_description = UNSET elif isinstance(self.requires_cve_description, RequiresCveDescriptionEnum): + print(RequiresCveDescriptionEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = RequiresCveDescriptionEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value else: + print(BlankEnum) requires_cve_description = UNSET if not isinstance(self.requires_cve_description, Unset): - - requires_cve_description = BlankEnum( - self.requires_cve_description - ).value + requires_cve_description = self.requires_cve_description.value statement = self.statement + cwe_id = self.cwe_id - unembargo_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.unembargo_dt, Unset): - unembargo_dt = self.unembargo_dt.isoformat() if self.unembargo_dt else None + + unembargo_dt: Union[None, Unset, str] + if isinstance(self.unembargo_dt, Unset): + unembargo_dt = UNSET + elif isinstance(self.unembargo_dt, datetime.datetime): + unembargo_dt = UNSET + if not isinstance(self.unembargo_dt, Unset): + unembargo_dt = self.unembargo_dt.isoformat() + + else: + unembargo_dt = self.unembargo_dt source: Union[Unset, str] if isinstance(self.source, Unset): source = UNSET elif isinstance(self.source, SourceBe0Enum): + print(SourceBe0Enum) source = UNSET if not isinstance(self.source, Unset): - - source = SourceBe0Enum(self.source).value + source = self.source.value else: + print(BlankEnum) source = UNSET if not isinstance(self.source, Unset): + source = self.source.value - source = BlankEnum(self.source).value + reported_dt: Union[None, Unset, str] + if isinstance(self.reported_dt, Unset): + reported_dt = UNSET + elif isinstance(self.reported_dt, datetime.datetime): + reported_dt = UNSET + if not isinstance(self.reported_dt, Unset): + reported_dt = self.reported_dt.isoformat() - reported_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.reported_dt, Unset): - reported_dt = self.reported_dt.isoformat() if self.reported_dt else None + else: + reported_dt = self.reported_dt mitigation = self.mitigation + major_incident_state: Union[Unset, str] if isinstance(self.major_incident_state, Unset): major_incident_state = UNSET elif isinstance(self.major_incident_state, MajorIncidentStateEnum): + print(MajorIncidentStateEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): - - major_incident_state = MajorIncidentStateEnum( - self.major_incident_state - ).value + major_incident_state = self.major_incident_state.value else: + print(BlankEnum) major_incident_state = UNSET if not isinstance(self.major_incident_state, Unset): + major_incident_state = self.major_incident_state.value - major_incident_state = BlankEnum(self.major_incident_state).value + major_incident_start_dt: Union[None, Unset, str] + if isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = UNSET + elif isinstance(self.major_incident_start_dt, datetime.datetime): + major_incident_start_dt = UNSET + if not isinstance(self.major_incident_start_dt, Unset): + major_incident_start_dt = self.major_incident_start_dt.isoformat() - major_incident_start_dt: Union[Unset, None, str] = UNSET - if not isinstance(self.major_incident_start_dt, Unset): - major_incident_start_dt = ( - self.major_incident_start_dt.isoformat() - if self.major_incident_start_dt - else None - ) + else: + major_incident_start_dt = self.major_incident_start_dt nist_cvss_validation: Union[Unset, str] if isinstance(self.nist_cvss_validation, Unset): nist_cvss_validation = UNSET elif isinstance(self.nist_cvss_validation, NistCvssValidationEnum): + print(NistCvssValidationEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = NistCvssValidationEnum( - self.nist_cvss_validation - ).value + nist_cvss_validation = self.nist_cvss_validation.value else: + print(BlankEnum) nist_cvss_validation = UNSET if not isinstance(self.nist_cvss_validation, Unset): - - nist_cvss_validation = BlankEnum(self.nist_cvss_validation).value + nist_cvss_validation = self.nist_cvss_validation.value group_key = self.group_key + owner = self.owner + task_key = self.task_key + team_id = self.team_id + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(uuid, Unset): + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(title, Unset): + if title is not UNSET: field_dict["title"] = title - if not isinstance(trackers, Unset): + if trackers is not UNSET: field_dict["trackers"] = trackers - if not isinstance(comment_zero, Unset): + if comment_zero is not UNSET: field_dict["comment_zero"] = comment_zero - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(comments, Unset): + if comments is not UNSET: field_dict["comments"] = comments - if not isinstance(package_versions, Unset): + if package_versions is not UNSET: field_dict["package_versions"] = package_versions - if not isinstance(acknowledgments, Unset): + if acknowledgments is not UNSET: field_dict["acknowledgments"] = acknowledgments - if not isinstance(references, Unset): + if references is not UNSET: field_dict["references"] = references - if not isinstance(cvss_scores, Unset): + if cvss_scores is not UNSET: field_dict["cvss_scores"] = cvss_scores - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(classification, Unset): + if classification is not UNSET: field_dict["classification"] = classification - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(cve_id, Unset): + if cve_id is not UNSET: field_dict["cve_id"] = cve_id - if not isinstance(impact, Unset): + if impact is not UNSET: field_dict["impact"] = impact - if not isinstance(components, Unset): + if components is not UNSET: field_dict["components"] = components - if not isinstance(cve_description, Unset): + if cve_description is not UNSET: field_dict["cve_description"] = cve_description - if not isinstance(requires_cve_description, Unset): + if requires_cve_description is not UNSET: field_dict["requires_cve_description"] = requires_cve_description - if not isinstance(statement, Unset): + if statement is not UNSET: field_dict["statement"] = statement - if not isinstance(cwe_id, Unset): + if cwe_id is not UNSET: field_dict["cwe_id"] = cwe_id - if not isinstance(unembargo_dt, Unset): + if unembargo_dt is not UNSET: field_dict["unembargo_dt"] = unembargo_dt - if not isinstance(source, Unset): + if source is not UNSET: field_dict["source"] = source - if not isinstance(reported_dt, Unset): + if reported_dt is not UNSET: field_dict["reported_dt"] = reported_dt - if not isinstance(mitigation, Unset): + if mitigation is not UNSET: field_dict["mitigation"] = mitigation - if not isinstance(major_incident_state, Unset): + if major_incident_state is not UNSET: field_dict["major_incident_state"] = major_incident_state - if not isinstance(major_incident_start_dt, Unset): + if major_incident_start_dt is not UNSET: field_dict["major_incident_start_dt"] = major_incident_start_dt - if not isinstance(nist_cvss_validation, Unset): + if nist_cvss_validation is not UNSET: field_dict["nist_cvss_validation"] = nist_cvss_validation - if not isinstance(group_key, Unset): + if group_key is not UNSET: field_dict["group_key"] = group_key - if not isinstance(owner, Unset): + if owner is not UNSET: field_dict["owner"] = owner - if not isinstance(task_key, Unset): + if task_key is not UNSET: field_dict["task_key"] = task_key - if not isinstance(team_id, Unset): + if team_id is not UNSET: field_dict["team_id"] = team_id - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.comment import Comment + from ..models.flaw_cvss import FlawCVSS + from ..models.affect import Affect + from ..models.flaw_acknowledgment import FlawAcknowledgment + from ..models.flaw_classification import FlawClassification + from ..models.package import Package + from ..models.flaw_reference import FlawReference + d = src_dict.copy() - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) title = d.pop("title", UNSET) - trackers = cast(List[str], d.pop("trackers", UNSET)) + trackers = cast(list[str], d.pop("trackers", UNSET)) comment_zero = d.pop("comment_zero", UNSET) affects = [] _affects = d.pop("affects", UNSET) - if _affects is UNSET: - affects = UNSET - else: - for affects_item_data in _affects or []: - _affects_item = affects_item_data - affects_item: Affect - if isinstance(_affects_item, Unset): - affects_item = UNSET - else: - affects_item = Affect.from_dict(_affects_item) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: Affect + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = Affect.from_dict(_affects_item) - affects.append(affects_item) + affects.append(affects_item) comments = [] _comments = d.pop("comments", UNSET) - if _comments is UNSET: - comments = UNSET - else: - for comments_item_data in _comments or []: - _comments_item = comments_item_data - comments_item: Comment - if isinstance(_comments_item, Unset): - comments_item = UNSET - else: - comments_item = Comment.from_dict(_comments_item) + for comments_item_data in _comments or []: + _comments_item = comments_item_data + comments_item: Comment + if isinstance(_comments_item, Unset): + comments_item = UNSET + else: + comments_item = Comment.from_dict(_comments_item) - comments.append(comments_item) + comments.append(comments_item) package_versions = [] _package_versions = d.pop("package_versions", UNSET) - if _package_versions is UNSET: - package_versions = UNSET - else: - for package_versions_item_data in _package_versions or []: - _package_versions_item = package_versions_item_data - package_versions_item: Package - if isinstance(_package_versions_item, Unset): - package_versions_item = UNSET - else: - package_versions_item = Package.from_dict(_package_versions_item) + for package_versions_item_data in _package_versions or []: + _package_versions_item = package_versions_item_data + package_versions_item: Package + if isinstance(_package_versions_item, Unset): + package_versions_item = UNSET + else: + package_versions_item = Package.from_dict(_package_versions_item) - package_versions.append(package_versions_item) + package_versions.append(package_versions_item) acknowledgments = [] _acknowledgments = d.pop("acknowledgments", UNSET) - if _acknowledgments is UNSET: - acknowledgments = UNSET - else: - for acknowledgments_item_data in _acknowledgments or []: - _acknowledgments_item = acknowledgments_item_data - acknowledgments_item: FlawAcknowledgment - if isinstance(_acknowledgments_item, Unset): - acknowledgments_item = UNSET - else: - acknowledgments_item = FlawAcknowledgment.from_dict( - _acknowledgments_item - ) + for acknowledgments_item_data in _acknowledgments or []: + _acknowledgments_item = acknowledgments_item_data + acknowledgments_item: FlawAcknowledgment + if isinstance(_acknowledgments_item, Unset): + acknowledgments_item = UNSET + else: + acknowledgments_item = FlawAcknowledgment.from_dict(_acknowledgments_item) - acknowledgments.append(acknowledgments_item) + acknowledgments.append(acknowledgments_item) references = [] _references = d.pop("references", UNSET) - if _references is UNSET: - references = UNSET - else: - for references_item_data in _references or []: - _references_item = references_item_data - references_item: FlawReference - if isinstance(_references_item, Unset): - references_item = UNSET - else: - references_item = FlawReference.from_dict(_references_item) + for references_item_data in _references or []: + _references_item = references_item_data + references_item: FlawReference + if isinstance(_references_item, Unset): + references_item = UNSET + else: + references_item = FlawReference.from_dict(_references_item) - references.append(references_item) + references.append(references_item) cvss_scores = [] _cvss_scores = d.pop("cvss_scores", UNSET) - if _cvss_scores is UNSET: - cvss_scores = UNSET - else: - for cvss_scores_item_data in _cvss_scores or []: - _cvss_scores_item = cvss_scores_item_data - cvss_scores_item: FlawCVSS - if isinstance(_cvss_scores_item, Unset): - cvss_scores_item = UNSET - else: - cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) + for cvss_scores_item_data in _cvss_scores or []: + _cvss_scores_item = cvss_scores_item_data + cvss_scores_item: FlawCVSS + if isinstance(_cvss_scores_item, Unset): + cvss_scores_item = UNSET + else: + cvss_scores_item = FlawCVSS.from_dict(_cvss_scores_item) - cvss_scores.append(cvss_scores_item) + cvss_scores.append(cvss_scores_item) embargoed = d.pop("embargoed", UNSET) @@ -486,20 +556,24 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) + + def _parse_cve_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) - cve_id = d.pop("cve_id", UNSET) + cve_id = _parse_cve_id(d.pop("cve_id", UNSET)) def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if isinstance(data, Unset): @@ -508,7 +582,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_0 = data - impact_type_0: Union[Unset, ImpactEnum] + impact_type_0: ImpactEnum if isinstance(_impact_type_0, Unset): impact_type_0 = UNSET else: @@ -520,7 +594,7 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: if not isinstance(data, str): raise TypeError() _impact_type_1 = data - impact_type_1: Union[Unset, BlankEnum] + impact_type_1: BlankEnum if isinstance(_impact_type_1, Unset): impact_type_1 = UNSET else: @@ -530,28 +604,22 @@ def _parse_impact(data: object) -> Union[BlankEnum, ImpactEnum, Unset]: impact = _parse_impact(d.pop("impact", UNSET)) - components = cast(List[str], d.pop("components", UNSET)) + components = cast(list[str], d.pop("components", UNSET)) cve_description = d.pop("cve_description", UNSET) - def _parse_requires_cve_description( - data: object, - ) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: + def _parse_requires_cve_description(data: object) -> Union[BlankEnum, RequiresCveDescriptionEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _requires_cve_description_type_0 = data - requires_cve_description_type_0: Union[ - Unset, RequiresCveDescriptionEnum - ] + requires_cve_description_type_0: RequiresCveDescriptionEnum if isinstance(_requires_cve_description_type_0, Unset): requires_cve_description_type_0 = UNSET else: - requires_cve_description_type_0 = RequiresCveDescriptionEnum( - _requires_cve_description_type_0 - ) + requires_cve_description_type_0 = RequiresCveDescriptionEnum(_requires_cve_description_type_0) return requires_cve_description_type_0 except: # noqa: E722 @@ -559,32 +627,41 @@ def _parse_requires_cve_description( if not isinstance(data, str): raise TypeError() _requires_cve_description_type_1 = data - requires_cve_description_type_1: Union[Unset, BlankEnum] + requires_cve_description_type_1: BlankEnum if isinstance(_requires_cve_description_type_1, Unset): requires_cve_description_type_1 = UNSET else: - requires_cve_description_type_1 = BlankEnum( - _requires_cve_description_type_1 - ) + requires_cve_description_type_1 = BlankEnum(_requires_cve_description_type_1) return requires_cve_description_type_1 - requires_cve_description = _parse_requires_cve_description( - d.pop("requires_cve_description", UNSET) - ) + requires_cve_description = _parse_requires_cve_description(d.pop("requires_cve_description", UNSET)) statement = d.pop("statement", UNSET) cwe_id = d.pop("cwe_id", UNSET) - _unembargo_dt = d.pop("unembargo_dt", UNSET) - unembargo_dt: Union[Unset, None, datetime.datetime] - if _unembargo_dt is None: - unembargo_dt = None - elif isinstance(_unembargo_dt, Unset): - unembargo_dt = UNSET - else: - unembargo_dt = isoparse(_unembargo_dt) + def _parse_unembargo_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _unembargo_dt_type_0 = data + unembargo_dt_type_0: datetime.datetime + if isinstance(_unembargo_dt_type_0, Unset): + unembargo_dt_type_0 = UNSET + else: + unembargo_dt_type_0 = isoparse(_unembargo_dt_type_0) + + return unembargo_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + unembargo_dt = _parse_unembargo_dt(d.pop("unembargo_dt", UNSET)) def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if isinstance(data, Unset): @@ -593,7 +670,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_0 = data - source_type_0: Union[Unset, SourceBe0Enum] + source_type_0: SourceBe0Enum if isinstance(_source_type_0, Unset): source_type_0 = UNSET else: @@ -605,7 +682,7 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: if not isinstance(data, str): raise TypeError() _source_type_1 = data - source_type_1: Union[Unset, BlankEnum] + source_type_1: BlankEnum if isinstance(_source_type_1, Unset): source_type_1 = UNSET else: @@ -615,33 +692,42 @@ def _parse_source(data: object) -> Union[BlankEnum, SourceBe0Enum, Unset]: source = _parse_source(d.pop("source", UNSET)) - _reported_dt = d.pop("reported_dt", UNSET) - reported_dt: Union[Unset, None, datetime.datetime] - if _reported_dt is None: - reported_dt = None - elif isinstance(_reported_dt, Unset): - reported_dt = UNSET - else: - reported_dt = isoparse(_reported_dt) + def _parse_reported_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _reported_dt_type_0 = data + reported_dt_type_0: datetime.datetime + if isinstance(_reported_dt_type_0, Unset): + reported_dt_type_0 = UNSET + else: + reported_dt_type_0 = isoparse(_reported_dt_type_0) + + return reported_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + reported_dt = _parse_reported_dt(d.pop("reported_dt", UNSET)) mitigation = d.pop("mitigation", UNSET) - def _parse_major_incident_state( - data: object, - ) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: + def _parse_major_incident_state(data: object) -> Union[BlankEnum, MajorIncidentStateEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _major_incident_state_type_0 = data - major_incident_state_type_0: Union[Unset, MajorIncidentStateEnum] + major_incident_state_type_0: MajorIncidentStateEnum if isinstance(_major_incident_state_type_0, Unset): major_incident_state_type_0 = UNSET else: - major_incident_state_type_0 = MajorIncidentStateEnum( - _major_incident_state_type_0 - ) + major_incident_state_type_0 = MajorIncidentStateEnum(_major_incident_state_type_0) return major_incident_state_type_0 except: # noqa: E722 @@ -649,7 +735,7 @@ def _parse_major_incident_state( if not isinstance(data, str): raise TypeError() _major_incident_state_type_1 = data - major_incident_state_type_1: Union[Unset, BlankEnum] + major_incident_state_type_1: BlankEnum if isinstance(_major_incident_state_type_1, Unset): major_incident_state_type_1 = UNSET else: @@ -657,35 +743,42 @@ def _parse_major_incident_state( return major_incident_state_type_1 - major_incident_state = _parse_major_incident_state( - d.pop("major_incident_state", UNSET) - ) + major_incident_state = _parse_major_incident_state(d.pop("major_incident_state", UNSET)) - _major_incident_start_dt = d.pop("major_incident_start_dt", UNSET) - major_incident_start_dt: Union[Unset, None, datetime.datetime] - if _major_incident_start_dt is None: - major_incident_start_dt = None - elif isinstance(_major_incident_start_dt, Unset): - major_incident_start_dt = UNSET - else: - major_incident_start_dt = isoparse(_major_incident_start_dt) + def _parse_major_incident_start_dt(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + _major_incident_start_dt_type_0 = data + major_incident_start_dt_type_0: datetime.datetime + if isinstance(_major_incident_start_dt_type_0, Unset): + major_incident_start_dt_type_0 = UNSET + else: + major_incident_start_dt_type_0 = isoparse(_major_incident_start_dt_type_0) + + return major_incident_start_dt_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) - def _parse_nist_cvss_validation( - data: object, - ) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: + major_incident_start_dt = _parse_major_incident_start_dt(d.pop("major_incident_start_dt", UNSET)) + + def _parse_nist_cvss_validation(data: object) -> Union[BlankEnum, NistCvssValidationEnum, Unset]: if isinstance(data, Unset): return data try: if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_0 = data - nist_cvss_validation_type_0: Union[Unset, NistCvssValidationEnum] + nist_cvss_validation_type_0: NistCvssValidationEnum if isinstance(_nist_cvss_validation_type_0, Unset): nist_cvss_validation_type_0 = UNSET else: - nist_cvss_validation_type_0 = NistCvssValidationEnum( - _nist_cvss_validation_type_0 - ) + nist_cvss_validation_type_0 = NistCvssValidationEnum(_nist_cvss_validation_type_0) return nist_cvss_validation_type_0 except: # noqa: E722 @@ -693,7 +786,7 @@ def _parse_nist_cvss_validation( if not isinstance(data, str): raise TypeError() _nist_cvss_validation_type_1 = data - nist_cvss_validation_type_1: Union[Unset, BlankEnum] + nist_cvss_validation_type_1: BlankEnum if isinstance(_nist_cvss_validation_type_1, Unset): nist_cvss_validation_type_1 = UNSET else: @@ -701,9 +794,7 @@ def _parse_nist_cvss_validation( return nist_cvss_validation_type_1 - nist_cvss_validation = _parse_nist_cvss_validation( - d.pop("nist_cvss_validation", UNSET) - ) + nist_cvss_validation = _parse_nist_cvss_validation(d.pop("nist_cvss_validation", UNSET)) group_key = d.pop("group_key", UNSET) @@ -769,50 +860,8 @@ def _parse_nist_cvss_validation( osidb_api_v1_flaws_update_response_200.additional_properties = d return osidb_api_v1_flaws_update_response_200 - @staticmethod - def get_fields(): - return { - "uuid": str, - "title": str, - "trackers": List[str], - "comment_zero": str, - "affects": List[Affect], - "comments": List[Comment], - "package_versions": List[Package], - "acknowledgments": List[FlawAcknowledgment], - "references": List[FlawReference], - "cvss_scores": List[FlawCVSS], - "embargoed": bool, - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "classification": FlawClassification, - "alerts": List[Alert], - "cve_id": str, - "impact": Union[BlankEnum, ImpactEnum], - "components": List[str], - "cve_description": str, - "requires_cve_description": Union[BlankEnum, RequiresCveDescriptionEnum], - "statement": str, - "cwe_id": str, - "unembargo_dt": datetime.datetime, - "source": Union[BlankEnum, SourceBe0Enum], - "reported_dt": datetime.datetime, - "mitigation": str, - "major_incident_state": Union[BlankEnum, MajorIncidentStateEnum], - "major_incident_start_dt": datetime.datetime, - "nist_cvss_validation": Union[BlankEnum, NistCvssValidationEnum], - "group_key": str, - "owner": str, - "task_key": str, - "team_id": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_manifest_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_manifest_retrieve_response_200.py index acc58be..7fca85f 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_manifest_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_manifest_retrieve_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1ManifestRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1ManifestRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_manifest_retrieve_response_200.additional_properties = d return osidb_api_v1_manifest_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_schema_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_schema_retrieve_response_200.py index 07da2d1..3aab26d 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_schema_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_schema_retrieve_response_200.py @@ -1,83 +1,36 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1SchemaRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1SchemaRetrieveResponse200(OSIDBModel): """ """ - dt: Union[Unset, datetime.datetime] = UNSET - env: Union[Unset, str] = UNSET - revision: Union[Unset, str] = UNSET - version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - dt: Union[Unset, str] = UNSET - if not isinstance(self.dt, Unset): - dt = self.dt.isoformat() + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - env = self.env - revision = self.revision - version = self.version - - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): - field_dict["dt"] = dt - if not isinstance(env, Unset): - field_dict["env"] = env - if not isinstance(revision, Unset): - field_dict["revision"] = revision - if not isinstance(version, Unset): - field_dict["version"] = version return field_dict @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() - _dt = d.pop("dt", UNSET) - dt: Union[Unset, datetime.datetime] - if isinstance(_dt, Unset): - dt = UNSET - else: - dt = isoparse(_dt) - - env = d.pop("env", UNSET) - - revision = d.pop("revision", UNSET) - - version = d.pop("version", UNSET) - - osidb_api_v1_schema_retrieve_response_200 = cls( - dt=dt, - env=env, - revision=revision, - version=version, - ) + osidb_api_v1_schema_retrieve_response_200 = cls() osidb_api_v1_schema_retrieve_response_200.additional_properties = d return osidb_api_v1_schema_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200.py index b08286c..a85a0f4 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200.py @@ -1,68 +1,90 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.osidb_api_v1_status_retrieve_response_200_osidb_service import ( + OsidbApiV1StatusRetrieveResponse200OsidbService, + ) + from ..models.osidb_api_v1_status_retrieve_response_200_osidb_data import ( + OsidbApiV1StatusRetrieveResponse200OsidbData, + ) -from ..models.osidb_api_v1_status_retrieve_response_200_osidb_data import ( - OsidbApiV1StatusRetrieveResponse200OsidbData, -) -from ..models.osidb_api_v1_status_retrieve_response_200_osidb_service import ( - OsidbApiV1StatusRetrieveResponse200OsidbService, -) -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1StatusRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1StatusRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + osidb_data (Union[Unset, OsidbApiV1StatusRetrieveResponse200OsidbData]): + osidb_service (Union[Unset, OsidbApiV1StatusRetrieveResponse200OsidbService]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET - osidb_data: Union[Unset, OsidbApiV1StatusRetrieveResponse200OsidbData] = UNSET - osidb_service: Union[Unset, OsidbApiV1StatusRetrieveResponse200OsidbService] = UNSET + osidb_data: Union[Unset, "OsidbApiV1StatusRetrieveResponse200OsidbData"] = UNSET + osidb_service: Union[Unset, "OsidbApiV1StatusRetrieveResponse200OsidbService"] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env - osidb_data: Union[Unset, Dict[str, Any]] = UNSET + + osidb_data: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.osidb_data, Unset): osidb_data = self.osidb_data.to_dict() - osidb_service: Union[Unset, Dict[str, Any]] = UNSET + osidb_service: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.osidb_service, Unset): osidb_service = self.osidb_service.to_dict() revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(osidb_data, Unset): + if osidb_data is not UNSET: field_dict["osidb_data"] = osidb_data - if not isinstance(osidb_service, Unset): + if osidb_service is not UNSET: field_dict["osidb_service"] = osidb_service - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.osidb_api_v1_status_retrieve_response_200_osidb_service import ( + OsidbApiV1StatusRetrieveResponse200OsidbService, + ) + from ..models.osidb_api_v1_status_retrieve_response_200_osidb_data import ( + OsidbApiV1StatusRetrieveResponse200OsidbData, + ) + d = src_dict.copy() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -78,18 +100,14 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: if isinstance(_osidb_data, Unset): osidb_data = UNSET else: - osidb_data = OsidbApiV1StatusRetrieveResponse200OsidbData.from_dict( - _osidb_data - ) + osidb_data = OsidbApiV1StatusRetrieveResponse200OsidbData.from_dict(_osidb_data) _osidb_service = d.pop("osidb_service", UNSET) osidb_service: Union[Unset, OsidbApiV1StatusRetrieveResponse200OsidbService] if isinstance(_osidb_service, Unset): osidb_service = UNSET else: - osidb_service = OsidbApiV1StatusRetrieveResponse200OsidbService.from_dict( - _osidb_service - ) + osidb_service = OsidbApiV1StatusRetrieveResponse200OsidbService.from_dict(_osidb_service) revision = d.pop("revision", UNSET) @@ -107,19 +125,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_status_retrieve_response_200.additional_properties = d return osidb_api_v1_status_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "osidb_data": OsidbApiV1StatusRetrieveResponse200OsidbData, - "osidb_service": OsidbApiV1StatusRetrieveResponse200OsidbService, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200_osidb_data.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200_osidb_data.py index b90bf44..fc348c8 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200_osidb_data.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200_osidb_data.py @@ -1,31 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1StatusRetrieveResponse200OsidbData") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1StatusRetrieveResponse200OsidbData(OSIDBModel): - """ """ + """ + Attributes: + flaw_count (Union[Unset, int]): + """ flaw_count: Union[Unset, int] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: flaw_count = self.flaw_count - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(flaw_count, Unset): + if flaw_count is not UNSET: field_dict["flaw_count"] = flaw_count return field_dict @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() flaw_count = d.pop("flaw_count", UNSET) @@ -36,14 +41,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_status_retrieve_response_200_osidb_data.additional_properties = d return osidb_api_v1_status_retrieve_response_200_osidb_data - @staticmethod - def get_fields(): - return { - "flaw_count": int, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200_osidb_service.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200_osidb_service.py index 991c6d7..08d33f5 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200_osidb_service.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_status_retrieve_response_200_osidb_service.py @@ -1,41 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field from ..types import OSIDBModel + T = TypeVar("T", bound="OsidbApiV1StatusRetrieveResponse200OsidbService") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1StatusRetrieveResponse200OsidbService(OSIDBModel): """ """ - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - field_dict: Dict[str, Any] = {} + def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) return field_dict @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() osidb_api_v1_status_retrieve_response_200_osidb_service = cls() - osidb_api_v1_status_retrieve_response_200_osidb_service.additional_properties = ( - d - ) + osidb_api_v1_status_retrieve_response_200_osidb_service.additional_properties = d return osidb_api_v1_status_retrieve_response_200_osidb_service - @staticmethod - def get_fields(): - return {} - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_create_response_201.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_create_response_201.py index e8fcf25..51181e7 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_create_response_201.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_create_response_201.py @@ -1,65 +1,100 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert -from ..models.erratum import Erratum from ..models.tracker_type import TrackerType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.erratum import Erratum + T = TypeVar("T", bound="OsidbApiV1TrackersCreateResponse201") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1TrackersCreateResponse201(OSIDBModel): - """ """ - - errata: List[Erratum] + """ + Attributes: + errata (list['Erratum']): + ps_update_stream (str): + status (str): + resolution (str): + type_ (TrackerType): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affects (Union[Unset, list[UUID]]): + sync_to_bz (Union[Unset, bool]): Setting sync_to_bz to false disables flaw sync with Bugzilla after this + operation. Use only as part of bulk actions and trigger a flaw bugzilla sync afterwards. Does nothing if BZ is + disabled. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + errata: list["Erratum"] ps_update_stream: str status: str resolution: str - type: TrackerType - uuid: str + type_: TrackerType + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[UUID]] = UNSET sync_to_bz: Union[Unset, bool] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - errata: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + errata: list[dict[str, Any]] = UNSET if not isinstance(self.errata, Unset): errata = [] for errata_item_data in self.errata: - errata_item: Dict[str, Any] = UNSET + errata_item: dict[str, Any] = UNSET if not isinstance(errata_item_data, Unset): errata_item = errata_item_data.to_dict() errata.append(errata_item) ps_update_stream = self.ps_update_stream + status = self.status + resolution = self.resolution - type: str = UNSET - if not isinstance(self.type, Unset): - type = TrackerType(self.type).value + print(TrackerType) + type_: str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - uuid = self.uuid embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -73,73 +108,82 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[str]] = UNSET if not isinstance(self.affects, Unset): - affects = self.affects + affects = [] + for affects_item_data in self.affects: + affects_item: str = UNSET + if not isinstance(affects_item_data, Unset): + affects_item = str(affects_item_data) + + affects.append(affects_item) sync_to_bz = self.sync_to_bz + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(errata, Unset): + if errata is not UNSET: field_dict["errata"] = errata - if not isinstance(ps_update_stream, Unset): + if ps_update_stream is not UNSET: field_dict["ps_update_stream"] = ps_update_stream - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(uuid, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(sync_to_bz, Unset): + if sync_to_bz is not UNSET: field_dict["sync_to_bz"] = sync_to_bz - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.erratum import Erratum + d = src_dict.copy() errata = [] _errata = d.pop("errata", UNSET) - if _errata is UNSET: - errata = UNSET - else: - for errata_item_data in _errata or []: - _errata_item = errata_item_data - errata_item: Erratum - if isinstance(_errata_item, Unset): - errata_item = UNSET - else: - errata_item = Erratum.from_dict(_errata_item) + for errata_item_data in _errata or []: + _errata_item = errata_item_data + errata_item: Erratum + if isinstance(_errata_item, Unset): + errata_item = UNSET + else: + errata_item = Erratum.from_dict(_errata_item) - errata.append(errata_item) + errata.append(errata_item) ps_update_stream = d.pop("ps_update_stream", UNSET) @@ -147,31 +191,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: resolution = d.pop("resolution", UNSET) - _type = d.pop("type", UNSET) - type: TrackerType - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: TrackerType + if isinstance(_type_, Unset): + type_ = UNSET else: - type = TrackerType(_type) + type_ = TrackerType(_type_) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -187,7 +233,17 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affects = cast(List[str], d.pop("affects", UNSET)) + affects = [] + _affects = d.pop("affects", UNSET) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: UUID + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = UUID(_affects_item) + + affects.append(affects_item) sync_to_bz = d.pop("sync_to_bz", UNSET) @@ -209,7 +265,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: ps_update_stream=ps_update_stream, status=status, resolution=resolution, - type=type, + type_=type_, uuid=uuid, embargoed=embargoed, alerts=alerts, @@ -226,29 +282,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_trackers_create_response_201.additional_properties = d return osidb_api_v1_trackers_create_response_201 - @staticmethod - def get_fields(): - return { - "errata": List[Erratum], - "ps_update_stream": str, - "status": str, - "resolution": str, - "type": TrackerType, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affects": List[str], - "sync_to_bz": bool, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_affectedness.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_affectedness.py index e7a884d..078417d 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_affectedness.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_affectedness.py @@ -2,10 +2,10 @@ class OsidbApiV1TrackersListAffectsAffectedness(str, Enum): - VALUE_0 = "" AFFECTED = "AFFECTED" NEW = "NEW" NOTAFFECTED = "NOTAFFECTED" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_flaw_impact.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_flaw_impact.py index 0b4e95d..320e93c 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_flaw_impact.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_flaw_impact.py @@ -2,11 +2,11 @@ class OsidbApiV1TrackersListAffectsFlawImpact(str, Enum): - VALUE_0 = "" CRITICAL = "CRITICAL" IMPORTANT = "IMPORTANT" LOW = "LOW" MODERATE = "MODERATE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_flaw_source.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_flaw_source.py index 1c320ba..a5b2b53 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_flaw_source.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_flaw_source.py @@ -2,7 +2,6 @@ class OsidbApiV1TrackersListAffectsFlawSource(str, Enum): - VALUE_0 = "" ADOBE = "ADOBE" APPLE = "APPLE" ASF = "ASF" @@ -86,6 +85,7 @@ class OsidbApiV1TrackersListAffectsFlawSource(str, Enum): TWITTER = "TWITTER" UBUNTU = "UBUNTU" UPSTREAM = "UPSTREAM" + VALUE_0 = "" VENDORSEC = "VENDORSEC" VULNWATCH = "VULNWATCH" WIRESHARK = "WIRESHARK" diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_impact.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_impact.py index 81c89a9..dee2253 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_impact.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_impact.py @@ -2,11 +2,11 @@ class OsidbApiV1TrackersListAffectsImpact(str, Enum): - VALUE_0 = "" CRITICAL = "CRITICAL" IMPORTANT = "IMPORTANT" LOW = "LOW" MODERATE = "MODERATE" + VALUE_0 = "" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_resolution.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_resolution.py index 1f1d925..e878365 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_resolution.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_affects_resolution.py @@ -2,11 +2,11 @@ class OsidbApiV1TrackersListAffectsResolution(str, Enum): - VALUE_0 = "" DEFER = "DEFER" DELEGATED = "DELEGATED" FIX = "FIX" OOSS = "OOSS" + VALUE_0 = "" WONTFIX = "WONTFIX" WONTREPORT = "WONTREPORT" diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_order_item.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_order_item.py index 556fff2..91bb85d 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_order_item.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_order_item.py @@ -2,35 +2,6 @@ class OsidbApiV1TrackersListOrderItem(str, Enum): - VALUE_0 = "-affects__affectedness" - VALUE_1 = "-affects__created_dt" - VALUE_2 = "-affects__embargoed" - VALUE_3 = "-affects__flaw__components" - VALUE_4 = "-affects__flaw__created_dt" - VALUE_5 = "-affects__flaw__cve_id" - VALUE_6 = "-affects__flaw__cwe_id" - VALUE_7 = "-affects__flaw__embargoed" - VALUE_8 = "-affects__flaw__impact" - VALUE_9 = "-affects__flaw__reported_dt" - VALUE_10 = "-affects__flaw__source" - VALUE_11 = "-affects__flaw__unembargo_dt" - VALUE_12 = "-affects__flaw__updated_dt" - VALUE_13 = "-affects__flaw__uuid" - VALUE_14 = "-affects__impact" - VALUE_15 = "-affects__ps_component" - VALUE_16 = "-affects__ps_module" - VALUE_17 = "-affects__resolution" - VALUE_18 = "-affects__updated_dt" - VALUE_19 = "-affects__uuid" - VALUE_20 = "-created_dt" - VALUE_21 = "-embargoed" - VALUE_22 = "-external_system_id" - VALUE_23 = "-ps_update_stream" - VALUE_24 = "-resolution" - VALUE_25 = "-status" - VALUE_26 = "-type" - VALUE_27 = "-updated_dt" - VALUE_28 = "-uuid" AFFECTS_AFFECTEDNESS = "affects__affectedness" AFFECTS_CREATED_DT = "affects__created_dt" AFFECTS_EMBARGOED = "affects__embargoed" @@ -60,6 +31,35 @@ class OsidbApiV1TrackersListOrderItem(str, Enum): TYPE = "type" UPDATED_DT = "updated_dt" UUID = "uuid" + VALUE_0 = "-affects__affectedness" + VALUE_1 = "-affects__created_dt" + VALUE_10 = "-affects__flaw__source" + VALUE_11 = "-affects__flaw__unembargo_dt" + VALUE_12 = "-affects__flaw__updated_dt" + VALUE_13 = "-affects__flaw__uuid" + VALUE_14 = "-affects__impact" + VALUE_15 = "-affects__ps_component" + VALUE_16 = "-affects__ps_module" + VALUE_17 = "-affects__resolution" + VALUE_18 = "-affects__updated_dt" + VALUE_19 = "-affects__uuid" + VALUE_2 = "-affects__embargoed" + VALUE_20 = "-created_dt" + VALUE_21 = "-embargoed" + VALUE_22 = "-external_system_id" + VALUE_23 = "-ps_update_stream" + VALUE_24 = "-resolution" + VALUE_25 = "-status" + VALUE_26 = "-type" + VALUE_27 = "-updated_dt" + VALUE_28 = "-uuid" + VALUE_3 = "-affects__flaw__components" + VALUE_4 = "-affects__flaw__created_dt" + VALUE_5 = "-affects__flaw__cve_id" + VALUE_6 = "-affects__flaw__cwe_id" + VALUE_7 = "-affects__flaw__embargoed" + VALUE_8 = "-affects__flaw__impact" + VALUE_9 = "-affects__flaw__reported_dt" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_response_200.py index 5f79254..c14b973 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_list_response_200.py @@ -1,95 +1,137 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.tracker import Tracker -from ..models.tracker import Tracker -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1TrackersListResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1TrackersListResponse200(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Tracker']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ count: int - results: List[Tracker] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET + results: list["Tracker"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.tracker import Tracker + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Tracker - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Tracker.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Tracker + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Tracker.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -118,21 +160,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_trackers_list_response_200.additional_properties = d return osidb_api_v1_trackers_list_response_200 - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Tracker], - "next": str, - "previous": str, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_retrieve_response_200.py index 160963a..6cb1cc2 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_retrieve_response_200.py @@ -1,66 +1,102 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert -from ..models.erratum import Erratum from ..models.tracker_type import TrackerType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.erratum import Erratum + T = TypeVar("T", bound="OsidbApiV1TrackersRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1TrackersRetrieveResponse200(OSIDBModel): - """ """ - - errata: List[Erratum] + """ + Attributes: + errata (list['Erratum']): + external_system_id (str): + status (str): + resolution (str): + type_ (TrackerType): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affects (Union[Unset, list[UUID]]): + ps_update_stream (Union[Unset, str]): + sync_to_bz (Union[Unset, bool]): Setting sync_to_bz to false disables flaw sync with Bugzilla after this + operation. Use only as part of bulk actions and trigger a flaw bugzilla sync afterwards. Does nothing if BZ is + disabled. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + errata: list["Erratum"] external_system_id: str status: str resolution: str - type: TrackerType - uuid: str + type_: TrackerType + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[UUID]] = UNSET ps_update_stream: Union[Unset, str] = UNSET sync_to_bz: Union[Unset, bool] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - errata: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + errata: list[dict[str, Any]] = UNSET if not isinstance(self.errata, Unset): errata = [] for errata_item_data in self.errata: - errata_item: Dict[str, Any] = UNSET + errata_item: dict[str, Any] = UNSET if not isinstance(errata_item_data, Unset): errata_item = errata_item_data.to_dict() errata.append(errata_item) external_system_id = self.external_system_id + status = self.status + resolution = self.resolution - type: str = UNSET - if not isinstance(self.type, Unset): - type = TrackerType(self.type).value + print(TrackerType) + type_: str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - uuid = self.uuid embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -74,76 +110,86 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[str]] = UNSET if not isinstance(self.affects, Unset): - affects = self.affects + affects = [] + for affects_item_data in self.affects: + affects_item: str = UNSET + if not isinstance(affects_item_data, Unset): + affects_item = str(affects_item_data) + + affects.append(affects_item) ps_update_stream = self.ps_update_stream + sync_to_bz = self.sync_to_bz + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(errata, Unset): + if errata is not UNSET: field_dict["errata"] = errata - if not isinstance(external_system_id, Unset): + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(uuid, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(ps_update_stream, Unset): + if ps_update_stream is not UNSET: field_dict["ps_update_stream"] = ps_update_stream - if not isinstance(sync_to_bz, Unset): + if sync_to_bz is not UNSET: field_dict["sync_to_bz"] = sync_to_bz - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.erratum import Erratum + d = src_dict.copy() errata = [] _errata = d.pop("errata", UNSET) - if _errata is UNSET: - errata = UNSET - else: - for errata_item_data in _errata or []: - _errata_item = errata_item_data - errata_item: Erratum - if isinstance(_errata_item, Unset): - errata_item = UNSET - else: - errata_item = Erratum.from_dict(_errata_item) + for errata_item_data in _errata or []: + _errata_item = errata_item_data + errata_item: Erratum + if isinstance(_errata_item, Unset): + errata_item = UNSET + else: + errata_item = Erratum.from_dict(_errata_item) - errata.append(errata_item) + errata.append(errata_item) external_system_id = d.pop("external_system_id", UNSET) @@ -151,31 +197,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: resolution = d.pop("resolution", UNSET) - _type = d.pop("type", UNSET) - type: TrackerType - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: TrackerType + if isinstance(_type_, Unset): + type_ = UNSET else: - type = TrackerType(_type) + type_ = TrackerType(_type_) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -191,7 +239,17 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affects = cast(List[str], d.pop("affects", UNSET)) + affects = [] + _affects = d.pop("affects", UNSET) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: UUID + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = UUID(_affects_item) + + affects.append(affects_item) ps_update_stream = d.pop("ps_update_stream", UNSET) @@ -215,7 +273,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: external_system_id=external_system_id, status=status, resolution=resolution, - type=type, + type_=type_, uuid=uuid, embargoed=embargoed, alerts=alerts, @@ -233,30 +291,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_trackers_retrieve_response_200.additional_properties = d return osidb_api_v1_trackers_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "errata": List[Erratum], - "external_system_id": str, - "status": str, - "resolution": str, - "type": TrackerType, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affects": List[str], - "ps_update_stream": str, - "sync_to_bz": bool, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_update_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_update_response_200.py index fbfab9f..6b8a554 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_update_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_trackers_update_response_200.py @@ -1,66 +1,102 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr -from dateutil.parser import isoparse +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert -from ..models.erratum import Erratum from ..models.tracker_type import TrackerType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.erratum import Erratum + T = TypeVar("T", bound="OsidbApiV1TrackersUpdateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbApiV1TrackersUpdateResponse200(OSIDBModel): - """ """ - - errata: List[Erratum] + """ + Attributes: + errata (list['Erratum']): + external_system_id (str): + status (str): + resolution (str): + type_ (TrackerType): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affects (Union[Unset, list[UUID]]): + ps_update_stream (Union[Unset, str]): + sync_to_bz (Union[Unset, bool]): Setting sync_to_bz to false disables flaw sync with Bugzilla after this + operation. Use only as part of bulk actions and trigger a flaw bugzilla sync afterwards. Does nothing if BZ is + disabled. + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + errata: list["Erratum"] external_system_id: str status: str resolution: str - type: TrackerType - uuid: str + type_: TrackerType + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[UUID]] = UNSET ps_update_stream: Union[Unset, str] = UNSET sync_to_bz: Union[Unset, bool] = UNSET dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - errata: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + errata: list[dict[str, Any]] = UNSET if not isinstance(self.errata, Unset): errata = [] for errata_item_data in self.errata: - errata_item: Dict[str, Any] = UNSET + errata_item: dict[str, Any] = UNSET if not isinstance(errata_item_data, Unset): errata_item = errata_item_data.to_dict() errata.append(errata_item) external_system_id = self.external_system_id + status = self.status + resolution = self.resolution - type: str = UNSET - if not isinstance(self.type, Unset): - type = TrackerType(self.type).value + print(TrackerType) + type_: str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - uuid = self.uuid embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -74,76 +110,86 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[str]] = UNSET if not isinstance(self.affects, Unset): - affects = self.affects + affects = [] + for affects_item_data in self.affects: + affects_item: str = UNSET + if not isinstance(affects_item_data, Unset): + affects_item = str(affects_item_data) + + affects.append(affects_item) ps_update_stream = self.ps_update_stream + sync_to_bz = self.sync_to_bz + dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(errata, Unset): + if errata is not UNSET: field_dict["errata"] = errata - if not isinstance(external_system_id, Unset): + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(uuid, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(ps_update_stream, Unset): + if ps_update_stream is not UNSET: field_dict["ps_update_stream"] = ps_update_stream - if not isinstance(sync_to_bz, Unset): + if sync_to_bz is not UNSET: field_dict["sync_to_bz"] = sync_to_bz - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.alert import Alert + from ..models.erratum import Erratum + d = src_dict.copy() errata = [] _errata = d.pop("errata", UNSET) - if _errata is UNSET: - errata = UNSET - else: - for errata_item_data in _errata or []: - _errata_item = errata_item_data - errata_item: Erratum - if isinstance(_errata_item, Unset): - errata_item = UNSET - else: - errata_item = Erratum.from_dict(_errata_item) + for errata_item_data in _errata or []: + _errata_item = errata_item_data + errata_item: Erratum + if isinstance(_errata_item, Unset): + errata_item = UNSET + else: + errata_item = Erratum.from_dict(_errata_item) - errata.append(errata_item) + errata.append(errata_item) external_system_id = d.pop("external_system_id", UNSET) @@ -151,31 +197,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: resolution = d.pop("resolution", UNSET) - _type = d.pop("type", UNSET) - type: TrackerType - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: TrackerType + if isinstance(_type_, Unset): + type_ = UNSET else: - type = TrackerType(_type) + type_ = TrackerType(_type_) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -191,7 +239,17 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affects = cast(List[str], d.pop("affects", UNSET)) + affects = [] + _affects = d.pop("affects", UNSET) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: UUID + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = UUID(_affects_item) + + affects.append(affects_item) ps_update_stream = d.pop("ps_update_stream", UNSET) @@ -215,7 +273,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: external_system_id=external_system_id, status=status, resolution=resolution, - type=type, + type_=type_, uuid=uuid, embargoed=embargoed, alerts=alerts, @@ -233,30 +291,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_api_v1_trackers_update_response_200.additional_properties = d return osidb_api_v1_trackers_update_response_200 - @staticmethod - def get_fields(): - return { - "errata": List[Erratum], - "external_system_id": str, - "status": str, - "resolution": str, - "type": TrackerType, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affects": List[str], - "ps_update_stream": str, - "sync_to_bz": bool, - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_healthy_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_healthy_retrieve_response_200.py index 8f60a1e..c4028e9 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_healthy_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_healthy_retrieve_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbHealthyRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbHealthyRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_healthy_retrieve_response_200.additional_properties = d return osidb_healthy_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_whoami_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/osidb_whoami_retrieve_response_200.py index 8af997a..384bd14 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_whoami_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/osidb_whoami_retrieve_response_200.py @@ -1,73 +1,93 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union, cast +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.osidb_whoami_retrieve_response_200_profile import OsidbWhoamiRetrieveResponse200Profile -from ..models.osidb_whoami_retrieve_response_200_profile import ( - OsidbWhoamiRetrieveResponse200Profile, -) -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbWhoamiRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbWhoamiRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + email (Union[Unset, str]): + env (Union[Unset, str]): + groups (Union[Unset, list[str]]): + profile (Union[Unset, OsidbWhoamiRetrieveResponse200Profile]): + revision (Union[Unset, str]): + username (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET email: Union[Unset, str] = UNSET env: Union[Unset, str] = UNSET - groups: Union[Unset, List[str]] = UNSET - profile: Union[Unset, OsidbWhoamiRetrieveResponse200Profile] = UNSET + groups: Union[Unset, list[str]] = UNSET + profile: Union[Unset, "OsidbWhoamiRetrieveResponse200Profile"] = UNSET revision: Union[Unset, str] = UNSET username: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() email = self.email + env = self.env - groups: Union[Unset, List[str]] = UNSET + + groups: Union[Unset, list[str]] = UNSET if not isinstance(self.groups, Unset): groups = self.groups - profile: Union[Unset, Dict[str, Any]] = UNSET + profile: Union[Unset, dict[str, Any]] = UNSET if not isinstance(self.profile, Unset): profile = self.profile.to_dict() revision = self.revision + username = self.username + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(email, Unset): + if email is not UNSET: field_dict["email"] = email - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(groups, Unset): + if groups is not UNSET: field_dict["groups"] = groups - if not isinstance(profile, Unset): + if profile is not UNSET: field_dict["profile"] = profile - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(username, Unset): + if username is not UNSET: field_dict["username"] = username - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.osidb_whoami_retrieve_response_200_profile import OsidbWhoamiRetrieveResponse200Profile + d = src_dict.copy() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -80,7 +100,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: env = d.pop("env", UNSET) - groups = cast(List[str], d.pop("groups", UNSET)) + groups = cast(list[str], d.pop("groups", UNSET)) _profile = d.pop("profile", UNSET) profile: Union[Unset, OsidbWhoamiRetrieveResponse200Profile] @@ -109,21 +129,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_whoami_retrieve_response_200.additional_properties = d return osidb_whoami_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "email": str, - "env": str, - "groups": List[str], - "profile": OsidbWhoamiRetrieveResponse200Profile, - "revision": str, - "username": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/osidb_whoami_retrieve_response_200_profile.py b/osidb_bindings/bindings/python_client/models/osidb_whoami_retrieve_response_200_profile.py index a554e68..e1b4bd0 100644 --- a/osidb_bindings/bindings/python_client/models/osidb_whoami_retrieve_response_200_profile.py +++ b/osidb_bindings/bindings/python_client/models/osidb_whoami_retrieve_response_200_profile.py @@ -1,35 +1,42 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbWhoamiRetrieveResponse200Profile") -@attr.s(auto_attribs=True) +@_attrs_define class OsidbWhoamiRetrieveResponse200Profile(OSIDBModel): - """ """ + """ + Attributes: + bz_user_id (Union[Unset, str]): + jira_user_id (Union[Unset, str]): + """ bz_user_id: Union[Unset, str] = UNSET jira_user_id: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: bz_user_id = self.bz_user_id + jira_user_id = self.jira_user_id - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(bz_user_id, Unset): + if bz_user_id is not UNSET: field_dict["bz_user_id"] = bz_user_id - if not isinstance(jira_user_id, Unset): + if jira_user_id is not UNSET: field_dict["jira_user_id"] = jira_user_id return field_dict @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() bz_user_id = d.pop("bz_user_id", UNSET) @@ -43,15 +50,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: osidb_whoami_retrieve_response_200_profile.additional_properties = d return osidb_whoami_retrieve_response_200_profile - @staticmethod - def get_fields(): - return { - "bz_user_id": str, - "jira_user_id": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/package.py b/osidb_bindings/bindings/python_client/models/package.py index 5762e46..1bffd3c 100644 --- a/osidb_bindings/bindings/python_client/models/package.py +++ b/osidb_bindings/bindings/python_client/models/package.py @@ -1,90 +1,99 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar, TYPE_CHECKING -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.package_ver import PackageVer -from ..models.alert import Alert -from ..models.package_ver import PackageVer -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Package") -@attr.s(auto_attribs=True) +@_attrs_define class Package(OSIDBModel): - """package_versions (Package model) serializer for read-only use in FlawSerializer.""" + """package_versions (Package model) serializer for read-only use in FlawSerializer. + + Attributes: + package (str): + versions (list['PackageVer']): + alerts (list['Alert']): + """ package: str - versions: List[PackageVer] - alerts: List[Alert] - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + versions: list["PackageVer"] + alerts: list["Alert"] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: package = self.package - versions: List[Dict[str, Any]] = UNSET + + versions: list[dict[str, Any]] = UNSET if not isinstance(self.versions, Unset): versions = [] for versions_item_data in self.versions: - versions_item: Dict[str, Any] = UNSET + versions_item: dict[str, Any] = UNSET if not isinstance(versions_item_data, Unset): versions_item = versions_item_data.to_dict() versions.append(versions_item) - alerts: List[Dict[str, Any]] = UNSET + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() alerts.append(alerts_item) - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(package, Unset): + if package is not UNSET: field_dict["package"] = package - if not isinstance(versions, Unset): + if versions is not UNSET: field_dict["versions"] = versions - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts return field_dict @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: + from ..models.alert import Alert + from ..models.package_ver import PackageVer + d = src_dict.copy() package = d.pop("package", UNSET) versions = [] _versions = d.pop("versions", UNSET) - if _versions is UNSET: - versions = UNSET - else: - for versions_item_data in _versions or []: - _versions_item = versions_item_data - versions_item: PackageVer - if isinstance(_versions_item, Unset): - versions_item = UNSET - else: - versions_item = PackageVer.from_dict(_versions_item) + for versions_item_data in _versions or []: + _versions_item = versions_item_data + versions_item: PackageVer + if isinstance(_versions_item, Unset): + versions_item = UNSET + else: + versions_item = PackageVer.from_dict(_versions_item) - versions.append(versions_item) + versions.append(versions_item) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) package = cls( package=package, @@ -95,16 +104,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: package.additional_properties = d return package - @staticmethod - def get_fields(): - return { - "package": str, - "versions": List[PackageVer], - "alerts": List[Alert], - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/package_ver.py b/osidb_bindings/bindings/python_client/models/package_ver.py index 03914fd..ccf24fa 100644 --- a/osidb_bindings/bindings/python_client/models/package_ver.py +++ b/osidb_bindings/bindings/python_client/models/package_ver.py @@ -1,36 +1,44 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PackageVer") -@attr.s(auto_attribs=True) +@_attrs_define class PackageVer(OSIDBModel): """PackageVer model serializer for read-only use in FlawSerializer via - PackageVerSerializer.""" + PackageVerSerializer. + + Attributes: + version (str): + status (str): Default: 'UNAFFECTED'. + """ version: str status: str = "UNAFFECTED" - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: version = self.version + status = self.status - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status return field_dict @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() version = d.pop("version", UNSET) @@ -44,15 +52,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: package_ver.additional_properties = d return package_ver - @staticmethod - def get_fields(): - return { - "version": str, - "status": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_affect_cvss_list.py b/osidb_bindings/bindings/python_client/models/paginated_affect_cvss_list.py index 402cc33..fa313c9 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_affect_cvss_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_affect_cvss_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.affect_cvss import AffectCVSS -from ..models.affect_cvss import AffectCVSS -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedAffectCVSSList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedAffectCVSSList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['AffectCVSS']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[AffectCVSS] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["AffectCVSS"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.affect_cvss import AffectCVSS + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: AffectCVSS - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = AffectCVSS.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: AffectCVSS + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = AffectCVSS.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_affect_cvss_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_affect_cvss_list.additional_properties = d return paginated_affect_cvss_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[AffectCVSS], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_affect_list.py b/osidb_bindings/bindings/python_client/models/paginated_affect_list.py index b1a3e14..54221c9 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_affect_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_affect_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.affect import Affect -from ..models.affect import Affect -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedAffectList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedAffectList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Affect']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[Affect] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["Affect"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.affect import Affect + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Affect - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Affect.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Affect + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Affect.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_affect_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_affect_list.additional_properties = d return paginated_affect_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Affect], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_alert_list.py b/osidb_bindings/bindings/python_client/models/paginated_alert_list.py index 2fcb806..60967ae 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_alert_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_alert_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.alert import Alert -from ..models.alert import Alert -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedAlertList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedAlertList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Alert']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[Alert] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["Alert"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.alert import Alert + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Alert - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Alert.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Alert + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Alert.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_alert_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_alert_list.additional_properties = d return paginated_alert_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Alert], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_audit_list.py b/osidb_bindings/bindings/python_client/models/paginated_audit_list.py index 5395aaa..7d126b1 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_audit_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_audit_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.audit import Audit -from ..models.audit import Audit -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedAuditList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedAuditList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Audit']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[Audit] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["Audit"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.audit import Audit + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Audit - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Audit.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Audit + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Audit.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_audit_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_audit_list.additional_properties = d return paginated_audit_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Audit], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_epss_list.py b/osidb_bindings/bindings/python_client/models/paginated_epss_list.py index de02a9d..a8f7f75 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_epss_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_epss_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.epss import EPSS -from ..models.epss import EPSS -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedEPSSList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedEPSSList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['EPSS']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[EPSS] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["EPSS"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.epss import EPSS + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: EPSS - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = EPSS.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: EPSS + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = EPSS.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_epss_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_epss_list.additional_properties = d return paginated_epss_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[EPSS], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_exploit_only_report_data_list.py b/osidb_bindings/bindings/python_client/models/paginated_exploit_only_report_data_list.py index 99e23e4..200ac96 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_exploit_only_report_data_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_exploit_only_report_data_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.exploit_only_report_data import ExploitOnlyReportData -from ..models.exploit_only_report_data import ExploitOnlyReportData -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedExploitOnlyReportDataList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedExploitOnlyReportDataList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['ExploitOnlyReportData']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[ExploitOnlyReportData] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["ExploitOnlyReportData"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.exploit_only_report_data import ExploitOnlyReportData + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: ExploitOnlyReportData - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = ExploitOnlyReportData.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: ExploitOnlyReportData + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = ExploitOnlyReportData.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_exploit_only_report_data_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_exploit_only_report_data_list.additional_properties = d return paginated_exploit_only_report_data_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[ExploitOnlyReportData], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_flaw_acknowledgment_list.py b/osidb_bindings/bindings/python_client/models/paginated_flaw_acknowledgment_list.py index a5f2169..52c4d6a 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_flaw_acknowledgment_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_acknowledgment_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..models.flaw_acknowledgment import FlawAcknowledgment -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedFlawAcknowledgmentList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedFlawAcknowledgmentList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawAcknowledgment']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[FlawAcknowledgment] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["FlawAcknowledgment"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.flaw_acknowledgment import FlawAcknowledgment + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawAcknowledgment - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawAcknowledgment.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawAcknowledgment + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawAcknowledgment.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_flaw_acknowledgment_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_flaw_acknowledgment_list.additional_properties = d return paginated_flaw_acknowledgment_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawAcknowledgment], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_flaw_comment_list.py b/osidb_bindings/bindings/python_client/models/paginated_flaw_comment_list.py index 4fffa4d..10bf3ee 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_flaw_comment_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_comment_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.flaw_comment import FlawComment -from ..models.flaw_comment import FlawComment -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedFlawCommentList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedFlawCommentList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawComment']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[FlawComment] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["FlawComment"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.flaw_comment import FlawComment + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawComment - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawComment.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawComment + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawComment.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_flaw_comment_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_flaw_comment_list.additional_properties = d return paginated_flaw_comment_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawComment], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_flaw_cvss_list.py b/osidb_bindings/bindings/python_client/models/paginated_flaw_cvss_list.py index 8ae6976..8b905f8 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_flaw_cvss_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_cvss_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.flaw_cvss import FlawCVSS -from ..models.flaw_cvss import FlawCVSS -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedFlawCVSSList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedFlawCVSSList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawCVSS']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[FlawCVSS] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["FlawCVSS"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.flaw_cvss import FlawCVSS + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawCVSS - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawCVSS.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawCVSS + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawCVSS.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_flaw_cvss_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_flaw_cvss_list.additional_properties = d return paginated_flaw_cvss_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawCVSS], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_flaw_list.py b/osidb_bindings/bindings/python_client/models/paginated_flaw_list.py index bb041b9..ac4dc93 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_flaw_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.flaw import Flaw -from ..models.flaw import Flaw -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedFlawList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedFlawList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Flaw']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[Flaw] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["Flaw"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.flaw import Flaw + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Flaw - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Flaw.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Flaw + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Flaw.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_flaw_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_flaw_list.additional_properties = d return paginated_flaw_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Flaw], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_flaw_package_version_list.py b/osidb_bindings/bindings/python_client/models/paginated_flaw_package_version_list.py index 1effbe8..2dc41ee 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_flaw_package_version_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_package_version_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.flaw_package_version import FlawPackageVersion -from ..models.flaw_package_version import FlawPackageVersion -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedFlawPackageVersionList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedFlawPackageVersionList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawPackageVersion']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[FlawPackageVersion] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["FlawPackageVersion"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.flaw_package_version import FlawPackageVersion + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawPackageVersion - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawPackageVersion.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawPackageVersion + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawPackageVersion.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_flaw_package_version_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_flaw_package_version_list.additional_properties = d return paginated_flaw_package_version_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawPackageVersion], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_flaw_reference_list.py b/osidb_bindings/bindings/python_client/models/paginated_flaw_reference_list.py index 0e4a633..0000c00 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_flaw_reference_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_reference_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.flaw_reference import FlawReference -from ..models.flaw_reference import FlawReference -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedFlawReferenceList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedFlawReferenceList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawReference']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[FlawReference] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["FlawReference"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.flaw_reference import FlawReference + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawReference - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawReference.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawReference + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawReference.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_flaw_reference_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_flaw_reference_list.additional_properties = d return paginated_flaw_reference_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawReference], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_flaw_report_data_list.py b/osidb_bindings/bindings/python_client/models/paginated_flaw_report_data_list.py index 321cd55..bf6c434 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_flaw_report_data_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_report_data_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.flaw_report_data import FlawReportData -from ..models.flaw_report_data import FlawReportData -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedFlawReportDataList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedFlawReportDataList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['FlawReportData']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[FlawReportData] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["FlawReportData"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.flaw_report_data import FlawReportData + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: FlawReportData - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = FlawReportData.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: FlawReportData + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = FlawReportData.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_flaw_report_data_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_flaw_report_data_list.additional_properties = d return paginated_flaw_report_data_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[FlawReportData], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_supported_products_list.py b/osidb_bindings/bindings/python_client/models/paginated_supported_products_list.py index 394a9e6..9be3d7f 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_supported_products_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_supported_products_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.supported_products import SupportedProducts -from ..models.supported_products import SupportedProducts -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedSupportedProductsList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedSupportedProductsList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['SupportedProducts']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[SupportedProducts] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["SupportedProducts"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.supported_products import SupportedProducts + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: SupportedProducts - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = SupportedProducts.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: SupportedProducts + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = SupportedProducts.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_supported_products_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_supported_products_list.additional_properties = d return paginated_supported_products_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[SupportedProducts], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/paginated_tracker_list.py b/osidb_bindings/bindings/python_client/models/paginated_tracker_list.py index fc25d98..df8efbd 100644 --- a/osidb_bindings/bindings/python_client/models/paginated_tracker_list.py +++ b/osidb_bindings/bindings/python_client/models/paginated_tracker_list.py @@ -1,74 +1,109 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel + +from typing import cast + +if TYPE_CHECKING: + from ..models.tracker import Tracker -from ..models.tracker import Tracker -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PaginatedTrackerList") -@attr.s(auto_attribs=True) +@_attrs_define class PaginatedTrackerList(OSIDBModel): - """ """ + """ + Attributes: + count (int): Example: 123. + results (list['Tracker']): + next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. + previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. + """ count: int - results: List[Tracker] - next_: Union[Unset, None, str] = UNSET - previous: Union[Unset, None, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + results: list["Tracker"] + next_: Union[None, Unset, str] = UNSET + previous: Union[None, Unset, str] = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: count = self.count - results: List[Dict[str, Any]] = UNSET + + results: list[dict[str, Any]] = UNSET if not isinstance(self.results, Unset): results = [] for results_item_data in self.results: - results_item: Dict[str, Any] = UNSET + results_item: dict[str, Any] = UNSET if not isinstance(results_item_data, Unset): results_item = results_item_data.to_dict() results.append(results_item) - next_ = self.next_ - previous = self.previous + next_: Union[None, Unset, str] + if isinstance(self.next_, Unset): + next_ = UNSET + else: + next_ = self.next_ + + previous: Union[None, Unset, str] + if isinstance(self.previous, Unset): + previous = UNSET + else: + previous = self.previous - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(count, Unset): + if count is not UNSET: field_dict["count"] = count - if not isinstance(results, Unset): + if results is not UNSET: field_dict["results"] = results - if not isinstance(next_, Unset): + if next_ is not UNSET: field_dict["next"] = next_ - if not isinstance(previous, Unset): + if previous is not UNSET: field_dict["previous"] = previous return field_dict @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: + from ..models.tracker import Tracker + d = src_dict.copy() count = d.pop("count", UNSET) results = [] _results = d.pop("results", UNSET) - if _results is UNSET: - results = UNSET - else: - for results_item_data in _results or []: - _results_item = results_item_data - results_item: Tracker - if isinstance(_results_item, Unset): - results_item = UNSET - else: - results_item = Tracker.from_dict(_results_item) - - results.append(results_item) - - next_ = d.pop("next", UNSET) - - previous = d.pop("previous", UNSET) + for results_item_data in _results or []: + _results_item = results_item_data + results_item: Tracker + if isinstance(_results_item, Unset): + results_item = UNSET + else: + results_item = Tracker.from_dict(_results_item) + + results.append(results_item) + + def _parse_next_(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + next_ = _parse_next_(d.pop("next", UNSET)) + + def _parse_previous(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + previous = _parse_previous(d.pop("previous", UNSET)) paginated_tracker_list = cls( count=count, @@ -80,17 +115,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: paginated_tracker_list.additional_properties = d return paginated_tracker_list - @staticmethod - def get_fields(): - return { - "count": int, - "results": List[Tracker], - "next": str, - "previous": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/ps_stream_selection.py b/osidb_bindings/bindings/python_client/models/ps_stream_selection.py index 8eb4555..0002d9b 100644 --- a/osidb_bindings/bindings/python_client/models/ps_stream_selection.py +++ b/osidb_bindings/bindings/python_client/models/ps_stream_selection.py @@ -1,47 +1,60 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="PsStreamSelection") -@attr.s(auto_attribs=True) +@_attrs_define class PsStreamSelection(OSIDBModel): - """ """ + """ + Attributes: + ps_update_stream (str): + selected (bool): + acked (bool): + eus (bool): + aus (bool): + """ ps_update_stream: str selected: bool acked: bool eus: bool aus: bool - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: ps_update_stream = self.ps_update_stream + selected = self.selected + acked = self.acked + eus = self.eus + aus = self.aus - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(ps_update_stream, Unset): + if ps_update_stream is not UNSET: field_dict["ps_update_stream"] = ps_update_stream - if not isinstance(selected, Unset): + if selected is not UNSET: field_dict["selected"] = selected - if not isinstance(acked, Unset): + if acked is not UNSET: field_dict["acked"] = acked - if not isinstance(eus, Unset): + if eus is not UNSET: field_dict["eus"] = eus - if not isinstance(aus, Unset): + if aus is not UNSET: field_dict["aus"] = aus return field_dict @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() ps_update_stream = d.pop("ps_update_stream", UNSET) @@ -64,18 +77,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: ps_stream_selection.additional_properties = d return ps_stream_selection - @staticmethod - def get_fields(): - return { - "ps_update_stream": str, - "selected": bool, - "acked": bool, - "eus": bool, - "aus": bool, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/reject.py b/osidb_bindings/bindings/python_client/models/reject.py index 8739613..633ae41 100644 --- a/osidb_bindings/bindings/python_client/models/reject.py +++ b/osidb_bindings/bindings/python_client/models/reject.py @@ -1,50 +1,49 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Reject") -@attr.s(auto_attribs=True) +@_attrs_define class Reject(OSIDBModel): - """Task rejection serializer""" + """Task rejection serializer + + Attributes: + reason (str): + """ reason: str - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: reason = self.reason - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(reason, Unset): + if reason is not UNSET: field_dict["reason"] = reason return field_dict - def to_multipart(self) -> Dict[str, Any]: - reason = ( - self.reason - if self.reason is UNSET - else (None, str(self.reason), "text/plain") - ) + def to_multipart(self) -> dict[str, Any]: + reason = (None, str(self.reason).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(reason, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if reason is not UNSET: field_dict["reason"] = reason return field_dict @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() reason = d.pop("reason", UNSET) @@ -55,14 +54,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: reject.additional_properties = d return reject - @staticmethod - def get_fields(): - return { - "reason": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/requires_cve_description_enum.py b/osidb_bindings/bindings/python_client/models/requires_cve_description_enum.py index 7df54fc..ab3b333 100644 --- a/osidb_bindings/bindings/python_client/models/requires_cve_description_enum.py +++ b/osidb_bindings/bindings/python_client/models/requires_cve_description_enum.py @@ -2,9 +2,9 @@ class RequiresCveDescriptionEnum(str, Enum): - REQUESTED = "REQUESTED" APPROVED = "APPROVED" REJECTED = "REJECTED" + REQUESTED = "REQUESTED" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/resolution_enum.py b/osidb_bindings/bindings/python_client/models/resolution_enum.py index 8b71524..972dcd5 100644 --- a/osidb_bindings/bindings/python_client/models/resolution_enum.py +++ b/osidb_bindings/bindings/python_client/models/resolution_enum.py @@ -2,11 +2,11 @@ class ResolutionEnum(str, Enum): - FIX = "FIX" DEFER = "DEFER" - WONTFIX = "WONTFIX" - OOSS = "OOSS" DELEGATED = "DELEGATED" + FIX = "FIX" + OOSS = "OOSS" + WONTFIX = "WONTFIX" WONTREPORT = "WONTREPORT" def __str__(self) -> str: diff --git a/osidb_bindings/bindings/python_client/models/supported_products.py b/osidb_bindings/bindings/python_client/models/supported_products.py index 0c50e1b..013c777 100644 --- a/osidb_bindings/bindings/python_client/models/supported_products.py +++ b/osidb_bindings/bindings/python_client/models/supported_products.py @@ -1,31 +1,36 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="SupportedProducts") -@attr.s(auto_attribs=True) +@_attrs_define class SupportedProducts(OSIDBModel): - """ """ + """ + Attributes: + name (str): + """ name: str - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: name = self.name - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(name, Unset): + if name is not UNSET: field_dict["name"] = name return field_dict @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() name = d.pop("name", UNSET) @@ -36,14 +41,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: supported_products.additional_properties = d return supported_products - @staticmethod - def get_fields(): - return { - "name": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/token_obtain_pair.py b/osidb_bindings/bindings/python_client/models/token_obtain_pair.py index 478d876..5b72edb 100644 --- a/osidb_bindings/bindings/python_client/models/token_obtain_pair.py +++ b/osidb_bindings/bindings/python_client/models/token_obtain_pair.py @@ -1,83 +1,78 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="TokenObtainPair") -@attr.s(auto_attribs=True) +@_attrs_define class TokenObtainPair(OSIDBModel): - """ """ + """ + Attributes: + username (str): + password (str): + access (str): + refresh (str): + """ username: str password: str access: str refresh: str - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: username = self.username + password = self.password + access = self.access + refresh = self.refresh - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(username, Unset): + if username is not UNSET: field_dict["username"] = username - if not isinstance(password, Unset): + if password is not UNSET: field_dict["password"] = password - if not isinstance(access, Unset): + if access is not UNSET: field_dict["access"] = access - if not isinstance(refresh, Unset): + if refresh is not UNSET: field_dict["refresh"] = refresh return field_dict - def to_multipart(self) -> Dict[str, Any]: - username = ( - self.username - if self.username is UNSET - else (None, str(self.username), "text/plain") - ) - password = ( - self.password - if self.password is UNSET - else (None, str(self.password), "text/plain") - ) - access = ( - self.access - if self.access is UNSET - else (None, str(self.access), "text/plain") - ) - refresh = ( - self.refresh - if self.refresh is UNSET - else (None, str(self.refresh), "text/plain") - ) + def to_multipart(self) -> dict[str, Any]: + username = (None, str(self.username).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(username, Unset): + password = (None, str(self.password).encode(), "text/plain") + + access = (None, str(self.access).encode(), "text/plain") + + refresh = (None, str(self.refresh).encode(), "text/plain") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if username is not UNSET: field_dict["username"] = username - if not isinstance(password, Unset): + if password is not UNSET: field_dict["password"] = password - if not isinstance(access, Unset): + if access is not UNSET: field_dict["access"] = access - if not isinstance(refresh, Unset): + if refresh is not UNSET: field_dict["refresh"] = refresh return field_dict @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() username = d.pop("username", UNSET) @@ -97,17 +92,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: token_obtain_pair.additional_properties = d return token_obtain_pair - @staticmethod - def get_fields(): - return { - "username": str, - "password": str, - "access": str, - "refresh": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/token_refresh.py b/osidb_bindings/bindings/python_client/models/token_refresh.py index f714d53..ad05643 100644 --- a/osidb_bindings/bindings/python_client/models/token_refresh.py +++ b/osidb_bindings/bindings/python_client/models/token_refresh.py @@ -1,61 +1,58 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="TokenRefresh") -@attr.s(auto_attribs=True) +@_attrs_define class TokenRefresh(OSIDBModel): - """ """ + """ + Attributes: + access (str): + refresh (str): + """ access: str refresh: str - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: access = self.access + refresh = self.refresh - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(access, Unset): + if access is not UNSET: field_dict["access"] = access - if not isinstance(refresh, Unset): + if refresh is not UNSET: field_dict["refresh"] = refresh return field_dict - def to_multipart(self) -> Dict[str, Any]: - access = ( - self.access - if self.access is UNSET - else (None, str(self.access), "text/plain") - ) - refresh = ( - self.refresh - if self.refresh is UNSET - else (None, str(self.refresh), "text/plain") - ) + def to_multipart(self) -> dict[str, Any]: + access = (None, str(self.access).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(access, Unset): + refresh = (None, str(self.refresh).encode(), "text/plain") + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if access is not UNSET: field_dict["access"] = access - if not isinstance(refresh, Unset): + if refresh is not UNSET: field_dict["refresh"] = refresh return field_dict @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() access = d.pop("access", UNSET) @@ -69,15 +66,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: token_refresh.additional_properties = d return token_refresh - @staticmethod - def get_fields(): - return { - "access": str, - "refresh": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/token_verify.py b/osidb_bindings/bindings/python_client/models/token_verify.py index 90316e3..7d46a59 100644 --- a/osidb_bindings/bindings/python_client/models/token_verify.py +++ b/osidb_bindings/bindings/python_client/models/token_verify.py @@ -1,48 +1,48 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, OSIDBModel -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="TokenVerify") -@attr.s(auto_attribs=True) +@_attrs_define class TokenVerify(OSIDBModel): - """ """ + """ + Attributes: + token (str): + """ token: str - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: token = self.token - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(token, Unset): + if token is not UNSET: field_dict["token"] = token return field_dict - def to_multipart(self) -> Dict[str, Any]: - token = ( - self.token if self.token is UNSET else (None, str(self.token), "text/plain") - ) + def to_multipart(self) -> dict[str, Any]: + token = (None, str(self.token).encode(), "text/plain") - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(token, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if token is not UNSET: field_dict["token"] = token return field_dict @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() token = d.pop("token", UNSET) @@ -53,14 +53,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: token_verify.additional_properties = d return token_verify - @staticmethod - def get_fields(): - return { - "token": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/tracker.py b/osidb_bindings/bindings/python_client/models/tracker.py index 0a99894..088f09d 100644 --- a/osidb_bindings/bindings/python_client/models/tracker.py +++ b/osidb_bindings/bindings/python_client/models/tracker.py @@ -1,63 +1,96 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union, cast -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert -from ..models.erratum import Erratum from ..models.tracker_type import TrackerType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.erratum import Erratum + T = TypeVar("T", bound="Tracker") -@attr.s(auto_attribs=True) +@_attrs_define class Tracker(OSIDBModel): - """Tracker serializer""" - - errata: List[Erratum] + """Tracker serializer + + Attributes: + errata (list['Erratum']): + external_system_id (str): + status (str): + resolution (str): + type_ (TrackerType): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affects (Union[Unset, list[UUID]]): + ps_update_stream (Union[Unset, str]): + sync_to_bz (Union[Unset, bool]): Setting sync_to_bz to false disables flaw sync with Bugzilla after this + operation. Use only as part of bulk actions and trigger a flaw bugzilla sync afterwards. Does nothing if BZ is + disabled. + """ + + errata: list["Erratum"] external_system_id: str status: str resolution: str - type: TrackerType - uuid: str + type_: TrackerType + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[UUID]] = UNSET ps_update_stream: Union[Unset, str] = UNSET sync_to_bz: Union[Unset, bool] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - errata: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + errata: list[dict[str, Any]] = UNSET if not isinstance(self.errata, Unset): errata = [] for errata_item_data in self.errata: - errata_item: Dict[str, Any] = UNSET + errata_item: dict[str, Any] = UNSET if not isinstance(errata_item_data, Unset): errata_item = errata_item_data.to_dict() errata.append(errata_item) external_system_id = self.external_system_id + status = self.status + resolution = self.resolution - type: str = UNSET - if not isinstance(self.type, Unset): - type = TrackerType(self.type).value + print(TrackerType) + type_: str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - uuid = self.uuid embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -71,170 +104,171 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[str]] = UNSET if not isinstance(self.affects, Unset): - affects = self.affects + affects = [] + for affects_item_data in self.affects: + affects_item: str = UNSET + if not isinstance(affects_item_data, Unset): + affects_item = str(affects_item_data) + + affects.append(affects_item) ps_update_stream = self.ps_update_stream + sync_to_bz = self.sync_to_bz - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(errata, Unset): + if errata is not UNSET: field_dict["errata"] = errata - if not isinstance(external_system_id, Unset): + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(uuid, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(ps_update_stream, Unset): + if ps_update_stream is not UNSET: field_dict["ps_update_stream"] = ps_update_stream - if not isinstance(sync_to_bz, Unset): + if sync_to_bz is not UNSET: field_dict["sync_to_bz"] = sync_to_bz return field_dict - def to_multipart(self) -> Dict[str, Any]: - errata: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + errata: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.errata, Unset): _temp_errata = [] for errata_item_data in self.errata: - errata_item: Dict[str, Any] = UNSET + errata_item: dict[str, Any] = UNSET if not isinstance(errata_item_data, Unset): errata_item = errata_item_data.to_dict() _temp_errata.append(errata_item) - errata = (None, json.dumps(_temp_errata), "application/json") + errata = (None, json.dumps(_temp_errata).encode(), "application/json") - external_system_id = ( - self.external_system_id - if self.external_system_id is UNSET - else (None, str(self.external_system_id), "text/plain") - ) - status = ( - self.status - if self.status is UNSET - else (None, str(self.status), "text/plain") - ) - resolution = ( - self.resolution - if self.resolution is UNSET - else (None, str(self.resolution), "text/plain") - ) - type: Union[Unset, Tuple[None, str, str]] = UNSET - if not isinstance(self.type, Unset): + external_system_id = (None, str(self.external_system_id).encode(), "text/plain") - type = TrackerType(self.type).value + status = (None, str(self.status).encode(), "text/plain") - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + resolution = (None, str(self.resolution).encode(), "text/plain") + + type_: Union[Unset, tuple[None, bytes, str]] = UNSET + if not isinstance(self.type_, Unset): + type_ = (None, str(self.type_.value).encode(), "text/plain") + + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() - affects: Union[Unset, Tuple[None, str, str]] = UNSET + affects: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.affects, Unset): - _temp_affects = self.affects - affects = (None, json.dumps(_temp_affects), "application/json") + _temp_affects = [] + for affects_item_data in self.affects: + affects_item: str = UNSET + if not isinstance(affects_item_data, Unset): + affects_item = str(affects_item_data) + + _temp_affects.append(affects_item) + affects = (None, json.dumps(_temp_affects).encode(), "application/json") ps_update_stream = ( self.ps_update_stream - if self.ps_update_stream is UNSET - else (None, str(self.ps_update_stream), "text/plain") + if isinstance(self.ps_update_stream, Unset) + else (None, str(self.ps_update_stream).encode(), "text/plain") ) + sync_to_bz = ( self.sync_to_bz - if self.sync_to_bz is UNSET - else (None, str(self.sync_to_bz), "text/plain") + if isinstance(self.sync_to_bz, Unset) + else (None, str(self.sync_to_bz).encode(), "text/plain") ) - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(errata, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if errata is not UNSET: field_dict["errata"] = errata - if not isinstance(external_system_id, Unset): + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(uuid, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(ps_update_stream, Unset): + if ps_update_stream is not UNSET: field_dict["ps_update_stream"] = ps_update_stream - if not isinstance(sync_to_bz, Unset): + if sync_to_bz is not UNSET: field_dict["sync_to_bz"] = sync_to_bz return field_dict @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: + from ..models.alert import Alert + from ..models.erratum import Erratum + d = src_dict.copy() errata = [] _errata = d.pop("errata", UNSET) - if _errata is UNSET: - errata = UNSET - else: - for errata_item_data in _errata or []: - _errata_item = errata_item_data - errata_item: Erratum - if isinstance(_errata_item, Unset): - errata_item = UNSET - else: - errata_item = Erratum.from_dict(_errata_item) + for errata_item_data in _errata or []: + _errata_item = errata_item_data + errata_item: Erratum + if isinstance(_errata_item, Unset): + errata_item = UNSET + else: + errata_item = Erratum.from_dict(_errata_item) - errata.append(errata_item) + errata.append(errata_item) external_system_id = d.pop("external_system_id", UNSET) @@ -242,31 +276,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: resolution = d.pop("resolution", UNSET) - _type = d.pop("type", UNSET) - type: TrackerType - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: TrackerType + if isinstance(_type_, Unset): + type_ = UNSET else: - type = TrackerType(_type) + type_ = TrackerType(_type_) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -282,7 +318,17 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affects = cast(List[str], d.pop("affects", UNSET)) + affects = [] + _affects = d.pop("affects", UNSET) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: UUID + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = UUID(_affects_item) + + affects.append(affects_item) ps_update_stream = d.pop("ps_update_stream", UNSET) @@ -293,7 +339,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: external_system_id=external_system_id, status=status, resolution=resolution, - type=type, + type_=type_, uuid=uuid, embargoed=embargoed, alerts=alerts, @@ -307,26 +353,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: tracker.additional_properties = d return tracker - @staticmethod - def get_fields(): - return { - "errata": List[Erratum], - "external_system_id": str, - "status": str, - "resolution": str, - "type": TrackerType, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affects": List[str], - "ps_update_stream": str, - "sync_to_bz": bool, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/tracker_post.py b/osidb_bindings/bindings/python_client/models/tracker_post.py index c70968c..d81cf0b 100644 --- a/osidb_bindings/bindings/python_client/models/tracker_post.py +++ b/osidb_bindings/bindings/python_client/models/tracker_post.py @@ -1,62 +1,94 @@ -import datetime +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field import json -from typing import Any, Dict, List, Tuple, Type, TypeVar, Union, cast -import attr -from dateutil.parser import isoparse +from ..types import UNSET, Unset, OSIDBModel -from ..models.alert import Alert -from ..models.erratum import Erratum from ..models.tracker_type import TrackerType -from ..types import UNSET, OSIDBModel, Unset +from dateutil.parser import isoparse +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.alert import Alert + from ..models.erratum import Erratum + T = TypeVar("T", bound="TrackerPost") -@attr.s(auto_attribs=True) +@_attrs_define class TrackerPost(OSIDBModel): - """Tracker serializer""" - - errata: List[Erratum] + """Tracker serializer + + Attributes: + errata (list['Erratum']): + ps_update_stream (str): + status (str): + resolution (str): + type_ (TrackerType): + uuid (UUID): + embargoed (bool): The embargoed boolean attribute is technically read-only as it just indirectly modifies the + ACLs but is mandatory as it controls the access to the resource. + alerts (list['Alert']): + created_dt (datetime.datetime): + updated_dt (datetime.datetime): The updated_dt timestamp attribute is mandatory on update as it is used to + detect mit-air collisions. + affects (Union[Unset, list[UUID]]): + sync_to_bz (Union[Unset, bool]): Setting sync_to_bz to false disables flaw sync with Bugzilla after this + operation. Use only as part of bulk actions and trigger a flaw bugzilla sync afterwards. Does nothing if BZ is + disabled. + """ + + errata: list["Erratum"] ps_update_stream: str status: str resolution: str - type: TrackerType - uuid: str + type_: TrackerType + uuid: UUID embargoed: bool - alerts: List[Alert] + alerts: list["Alert"] created_dt: datetime.datetime updated_dt: datetime.datetime - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[UUID]] = UNSET sync_to_bz: Union[Unset, bool] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - errata: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + errata: list[dict[str, Any]] = UNSET if not isinstance(self.errata, Unset): errata = [] for errata_item_data in self.errata: - errata_item: Dict[str, Any] = UNSET + errata_item: dict[str, Any] = UNSET if not isinstance(errata_item_data, Unset): errata_item = errata_item_data.to_dict() errata.append(errata_item) ps_update_stream = self.ps_update_stream + status = self.status + resolution = self.resolution - type: str = UNSET - if not isinstance(self.type, Unset): - type = TrackerType(self.type).value + print(TrackerType) + type_: str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uuid: str = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) - uuid = self.uuid embargoed = self.embargoed - alerts: List[Dict[str, Any]] = UNSET + + alerts: list[dict[str, Any]] = UNSET if not isinstance(self.alerts, Unset): alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() @@ -70,160 +102,159 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.updated_dt, Unset): updated_dt = self.updated_dt.isoformat() - affects: Union[Unset, List[str]] = UNSET + affects: Union[Unset, list[str]] = UNSET if not isinstance(self.affects, Unset): - affects = self.affects + affects = [] + for affects_item_data in self.affects: + affects_item: str = UNSET + if not isinstance(affects_item_data, Unset): + affects_item = str(affects_item_data) + + affects.append(affects_item) sync_to_bz = self.sync_to_bz - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(errata, Unset): + if errata is not UNSET: field_dict["errata"] = errata - if not isinstance(ps_update_stream, Unset): + if ps_update_stream is not UNSET: field_dict["ps_update_stream"] = ps_update_stream - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(uuid, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(sync_to_bz, Unset): + if sync_to_bz is not UNSET: field_dict["sync_to_bz"] = sync_to_bz return field_dict - def to_multipart(self) -> Dict[str, Any]: - errata: Union[Unset, Tuple[None, str, str]] = UNSET + def to_multipart(self) -> dict[str, Any]: + errata: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.errata, Unset): _temp_errata = [] for errata_item_data in self.errata: - errata_item: Dict[str, Any] = UNSET + errata_item: dict[str, Any] = UNSET if not isinstance(errata_item_data, Unset): errata_item = errata_item_data.to_dict() _temp_errata.append(errata_item) - errata = (None, json.dumps(_temp_errata), "application/json") + errata = (None, json.dumps(_temp_errata).encode(), "application/json") - ps_update_stream = ( - self.ps_update_stream - if self.ps_update_stream is UNSET - else (None, str(self.ps_update_stream), "text/plain") - ) - status = ( - self.status - if self.status is UNSET - else (None, str(self.status), "text/plain") - ) - resolution = ( - self.resolution - if self.resolution is UNSET - else (None, str(self.resolution), "text/plain") - ) - type: Union[Unset, Tuple[None, str, str]] = UNSET - if not isinstance(self.type, Unset): + ps_update_stream = (None, str(self.ps_update_stream).encode(), "text/plain") - type = TrackerType(self.type).value + status = (None, str(self.status).encode(), "text/plain") - uuid = self.uuid if self.uuid is UNSET else (None, str(self.uuid), "text/plain") - embargoed = ( - self.embargoed - if self.embargoed is UNSET - else (None, str(self.embargoed), "text/plain") - ) - alerts: Union[Unset, Tuple[None, str, str]] = UNSET + resolution = (None, str(self.resolution).encode(), "text/plain") + + type_: Union[Unset, tuple[None, bytes, str]] = UNSET + if not isinstance(self.type_, Unset): + type_ = (None, str(self.type_.value).encode(), "text/plain") + + uuid: bytes = UNSET + if not isinstance(self.uuid, Unset): + uuid = str(self.uuid) + + embargoed = (None, str(self.embargoed).encode(), "text/plain") + + alerts: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.alerts, Unset): _temp_alerts = [] for alerts_item_data in self.alerts: - alerts_item: Dict[str, Any] = UNSET + alerts_item: dict[str, Any] = UNSET if not isinstance(alerts_item_data, Unset): alerts_item = alerts_item_data.to_dict() _temp_alerts.append(alerts_item) - alerts = (None, json.dumps(_temp_alerts), "application/json") + alerts = (None, json.dumps(_temp_alerts).encode(), "application/json") - created_dt: str = UNSET + created_dt: bytes = UNSET if not isinstance(self.created_dt, Unset): - created_dt = self.created_dt.isoformat() + created_dt = self.created_dt.isoformat().encode() - updated_dt: str = UNSET + updated_dt: bytes = UNSET if not isinstance(self.updated_dt, Unset): - updated_dt = self.updated_dt.isoformat() + updated_dt = self.updated_dt.isoformat().encode() - affects: Union[Unset, Tuple[None, str, str]] = UNSET + affects: Union[Unset, tuple[None, bytes, str]] = UNSET if not isinstance(self.affects, Unset): - _temp_affects = self.affects - affects = (None, json.dumps(_temp_affects), "application/json") + _temp_affects = [] + for affects_item_data in self.affects: + affects_item: str = UNSET + if not isinstance(affects_item_data, Unset): + affects_item = str(affects_item_data) + + _temp_affects.append(affects_item) + affects = (None, json.dumps(_temp_affects).encode(), "application/json") sync_to_bz = ( self.sync_to_bz - if self.sync_to_bz is UNSET - else (None, str(self.sync_to_bz), "text/plain") + if isinstance(self.sync_to_bz, Unset) + else (None, str(self.sync_to_bz).encode(), "text/plain") ) - field_dict: Dict[str, Any] = {} - field_dict.update( - { - key: (None, str(value), "text/plain") - for key, value in self.additional_properties.items() - } - ) - if not isinstance(errata, Unset): + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = (None, str(prop).encode(), "text/plain") + + if errata is not UNSET: field_dict["errata"] = errata - if not isinstance(ps_update_stream, Unset): + if ps_update_stream is not UNSET: field_dict["ps_update_stream"] = ps_update_stream - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(uuid, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if uuid is not UNSET: field_dict["uuid"] = uuid - if not isinstance(embargoed, Unset): + if embargoed is not UNSET: field_dict["embargoed"] = embargoed - if not isinstance(alerts, Unset): + if alerts is not UNSET: field_dict["alerts"] = alerts - if not isinstance(created_dt, Unset): + if created_dt is not UNSET: field_dict["created_dt"] = created_dt - if not isinstance(updated_dt, Unset): + if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt - if not isinstance(affects, Unset): + if affects is not UNSET: field_dict["affects"] = affects - if not isinstance(sync_to_bz, Unset): + if sync_to_bz is not UNSET: field_dict["sync_to_bz"] = sync_to_bz return field_dict @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: + from ..models.alert import Alert + from ..models.erratum import Erratum + d = src_dict.copy() errata = [] _errata = d.pop("errata", UNSET) - if _errata is UNSET: - errata = UNSET - else: - for errata_item_data in _errata or []: - _errata_item = errata_item_data - errata_item: Erratum - if isinstance(_errata_item, Unset): - errata_item = UNSET - else: - errata_item = Erratum.from_dict(_errata_item) + for errata_item_data in _errata or []: + _errata_item = errata_item_data + errata_item: Erratum + if isinstance(_errata_item, Unset): + errata_item = UNSET + else: + errata_item = Erratum.from_dict(_errata_item) - errata.append(errata_item) + errata.append(errata_item) ps_update_stream = d.pop("ps_update_stream", UNSET) @@ -231,31 +262,33 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: resolution = d.pop("resolution", UNSET) - _type = d.pop("type", UNSET) - type: TrackerType - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: TrackerType + if isinstance(_type_, Unset): + type_ = UNSET else: - type = TrackerType(_type) + type_ = TrackerType(_type_) - uuid = d.pop("uuid", UNSET) + _uuid = d.pop("uuid", UNSET) + uuid: UUID + if isinstance(_uuid, Unset): + uuid = UNSET + else: + uuid = UUID(_uuid) embargoed = d.pop("embargoed", UNSET) alerts = [] _alerts = d.pop("alerts", UNSET) - if _alerts is UNSET: - alerts = UNSET - else: - for alerts_item_data in _alerts or []: - _alerts_item = alerts_item_data - alerts_item: Alert - if isinstance(_alerts_item, Unset): - alerts_item = UNSET - else: - alerts_item = Alert.from_dict(_alerts_item) + for alerts_item_data in _alerts or []: + _alerts_item = alerts_item_data + alerts_item: Alert + if isinstance(_alerts_item, Unset): + alerts_item = UNSET + else: + alerts_item = Alert.from_dict(_alerts_item) - alerts.append(alerts_item) + alerts.append(alerts_item) _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime @@ -271,7 +304,17 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: updated_dt = isoparse(_updated_dt) - affects = cast(List[str], d.pop("affects", UNSET)) + affects = [] + _affects = d.pop("affects", UNSET) + for affects_item_data in _affects or []: + _affects_item = affects_item_data + affects_item: UUID + if isinstance(_affects_item, Unset): + affects_item = UNSET + else: + affects_item = UUID(_affects_item) + + affects.append(affects_item) sync_to_bz = d.pop("sync_to_bz", UNSET) @@ -280,7 +323,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: ps_update_stream=ps_update_stream, status=status, resolution=resolution, - type=type, + type_=type_, uuid=uuid, embargoed=embargoed, alerts=alerts, @@ -293,25 +336,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: tracker_post.additional_properties = d return tracker_post - @staticmethod - def get_fields(): - return { - "errata": List[Erratum], - "ps_update_stream": str, - "status": str, - "resolution": str, - "type": TrackerType, - "uuid": str, - "embargoed": bool, - "alerts": List[Alert], - "created_dt": datetime.datetime, - "updated_dt": datetime.datetime, - "affects": List[str], - "sync_to_bz": bool, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/tracker_report_data.py b/osidb_bindings/bindings/python_client/models/tracker_report_data.py index af83ebf..14c1b58 100644 --- a/osidb_bindings/bindings/python_client/models/tracker_report_data.py +++ b/osidb_bindings/bindings/python_client/models/tracker_report_data.py @@ -1,55 +1,66 @@ -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel from ..models.tracker_type import TrackerType -from ..types import UNSET, OSIDBModel, Unset + T = TypeVar("T", bound="TrackerReportData") -@attr.s(auto_attribs=True) +@_attrs_define class TrackerReportData(OSIDBModel): - """ """ - - type: TrackerType + """ + Attributes: + type_ (TrackerType): + external_system_id (str): + status (Union[Unset, str]): + resolution (Union[Unset, str]): + """ + + type_: TrackerType external_system_id: str status: Union[Unset, str] = UNSET resolution: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) - - def to_dict(self) -> Dict[str, Any]: - type: str = UNSET - if not isinstance(self.type, Unset): + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - type = TrackerType(self.type).value + def to_dict(self) -> dict[str, Any]: + print(TrackerType) + type_: str = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value external_system_id = self.external_system_id + status = self.status + resolution = self.resolution - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(type, Unset): - field_dict["type"] = type - if not isinstance(external_system_id, Unset): + if type_ is not UNSET: + field_dict["type"] = type_ + if external_system_id is not UNSET: field_dict["external_system_id"] = external_system_id - if not isinstance(status, Unset): + if status is not UNSET: field_dict["status"] = status - if not isinstance(resolution, Unset): + if resolution is not UNSET: field_dict["resolution"] = resolution return field_dict @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() - _type = d.pop("type", UNSET) - type: TrackerType - if isinstance(_type, Unset): - type = UNSET + _type_ = d.pop("type", UNSET) + type_: TrackerType + if isinstance(_type_, Unset): + type_ = UNSET else: - type = TrackerType(_type) + type_ = TrackerType(_type_) external_system_id = d.pop("external_system_id", UNSET) @@ -58,7 +69,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: resolution = d.pop("resolution", UNSET) tracker_report_data = cls( - type=type, + type_=type_, external_system_id=external_system_id, status=status, resolution=resolution, @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: tracker_report_data.additional_properties = d return tracker_report_data - @staticmethod - def get_fields(): - return { - "type": TrackerType, - "external_system_id": str, - "status": str, - "resolution": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/tracker_suggestion.py b/osidb_bindings/bindings/python_client/models/tracker_suggestion.py index 434e81d..127cb6a 100644 --- a/osidb_bindings/bindings/python_client/models/tracker_suggestion.py +++ b/osidb_bindings/bindings/python_client/models/tracker_suggestion.py @@ -1,86 +1,90 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, TypeVar, TYPE_CHECKING -import attr +from attrs import define as _attrs_define +from attrs import field as _attrs_field -from ..models.affect import Affect -from ..models.module_component import ModuleComponent -from ..types import UNSET, OSIDBModel, Unset +from ..types import UNSET, Unset, OSIDBModel -T = TypeVar("T", bound="TrackerSuggestion") +if TYPE_CHECKING: + from ..models.affect import Affect + from ..models.module_component import ModuleComponent -@attr.s(auto_attribs=True) -class TrackerSuggestion(OSIDBModel): - """ """ - modules_components: List[ModuleComponent] - not_applicable: List[Affect] - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) +T = TypeVar("T", bound="TrackerSuggestion") - def to_dict(self) -> Dict[str, Any]: - modules_components: List[Dict[str, Any]] = UNSET + +@_attrs_define +class TrackerSuggestion(OSIDBModel): + """ + Attributes: + modules_components (list['ModuleComponent']): + not_applicable (list['Affect']): + """ + + modules_components: list["ModuleComponent"] + not_applicable: list["Affect"] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + modules_components: list[dict[str, Any]] = UNSET if not isinstance(self.modules_components, Unset): modules_components = [] for modules_components_item_data in self.modules_components: - modules_components_item: Dict[str, Any] = UNSET + modules_components_item: dict[str, Any] = UNSET if not isinstance(modules_components_item_data, Unset): modules_components_item = modules_components_item_data.to_dict() modules_components.append(modules_components_item) - not_applicable: List[Dict[str, Any]] = UNSET + not_applicable: list[dict[str, Any]] = UNSET if not isinstance(self.not_applicable, Unset): not_applicable = [] for not_applicable_item_data in self.not_applicable: - not_applicable_item: Dict[str, Any] = UNSET + not_applicable_item: dict[str, Any] = UNSET if not isinstance(not_applicable_item_data, Unset): not_applicable_item = not_applicable_item_data.to_dict() not_applicable.append(not_applicable_item) - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(modules_components, Unset): + if modules_components is not UNSET: field_dict["modules_components"] = modules_components - if not isinstance(not_applicable, Unset): + if not_applicable is not UNSET: field_dict["not_applicable"] = not_applicable return field_dict @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: + from ..models.affect import Affect + from ..models.module_component import ModuleComponent + d = src_dict.copy() modules_components = [] _modules_components = d.pop("modules_components", UNSET) - if _modules_components is UNSET: - modules_components = UNSET - else: - for modules_components_item_data in _modules_components or []: - _modules_components_item = modules_components_item_data - modules_components_item: ModuleComponent - if isinstance(_modules_components_item, Unset): - modules_components_item = UNSET - else: - modules_components_item = ModuleComponent.from_dict( - _modules_components_item - ) + for modules_components_item_data in _modules_components or []: + _modules_components_item = modules_components_item_data + modules_components_item: ModuleComponent + if isinstance(_modules_components_item, Unset): + modules_components_item = UNSET + else: + modules_components_item = ModuleComponent.from_dict(_modules_components_item) - modules_components.append(modules_components_item) + modules_components.append(modules_components_item) not_applicable = [] _not_applicable = d.pop("not_applicable", UNSET) - if _not_applicable is UNSET: - not_applicable = UNSET - else: - for not_applicable_item_data in _not_applicable or []: - _not_applicable_item = not_applicable_item_data - not_applicable_item: Affect - if isinstance(_not_applicable_item, Unset): - not_applicable_item = UNSET - else: - not_applicable_item = Affect.from_dict(_not_applicable_item) + for not_applicable_item_data in _not_applicable or []: + _not_applicable_item = not_applicable_item_data + not_applicable_item: Affect + if isinstance(_not_applicable_item, Unset): + not_applicable_item = UNSET + else: + not_applicable_item = Affect.from_dict(_not_applicable_item) - not_applicable.append(not_applicable_item) + not_applicable.append(not_applicable_item) tracker_suggestion = cls( modules_components=modules_components, @@ -90,15 +94,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: tracker_suggestion.additional_properties = d return tracker_suggestion - @staticmethod - def get_fields(): - return { - "modules_components": List[ModuleComponent], - "not_applicable": List[Affect], - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/tracker_type.py b/osidb_bindings/bindings/python_client/models/tracker_type.py index b5c51b6..1017c8e 100644 --- a/osidb_bindings/bindings/python_client/models/tracker_type.py +++ b/osidb_bindings/bindings/python_client/models/tracker_type.py @@ -2,8 +2,8 @@ class TrackerType(str, Enum): - JIRA = "JIRA" BUGZILLA = "BUGZILLA" + JIRA = "JIRA" def __str__(self) -> str: return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/trackers_api_v1_file_create_response_200.py b/osidb_bindings/bindings/python_client/models/trackers_api_v1_file_create_response_200.py index 6b03a8c..4d97c2b 100644 --- a/osidb_bindings/bindings/python_client/models/trackers_api_v1_file_create_response_200.py +++ b/osidb_bindings/bindings/python_client/models/trackers_api_v1_file_create_response_200.py @@ -1,44 +1,57 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, TYPE_CHECKING, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime + +if TYPE_CHECKING: + from ..models.affect import Affect + from ..models.module_component import ModuleComponent -from ..models.affect import Affect -from ..models.module_component import ModuleComponent -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="TrackersApiV1FileCreateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class TrackersApiV1FileCreateResponse200(OSIDBModel): - """ """ - - modules_components: List[ModuleComponent] - not_applicable: List[Affect] + """ + Attributes: + modules_components (list['ModuleComponent']): + not_applicable (list['Affect']): + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ + + modules_components: list["ModuleComponent"] + not_applicable: list["Affect"] dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: - modules_components: List[Dict[str, Any]] = UNSET + def to_dict(self) -> dict[str, Any]: + modules_components: list[dict[str, Any]] = UNSET if not isinstance(self.modules_components, Unset): modules_components = [] for modules_components_item_data in self.modules_components: - modules_components_item: Dict[str, Any] = UNSET + modules_components_item: dict[str, Any] = UNSET if not isinstance(modules_components_item_data, Unset): modules_components_item = modules_components_item_data.to_dict() modules_components.append(modules_components_item) - not_applicable: List[Dict[str, Any]] = UNSET + not_applicable: list[dict[str, Any]] = UNSET if not isinstance(self.not_applicable, Unset): not_applicable = [] for not_applicable_item_data in self.not_applicable: - not_applicable_item: Dict[str, Any] = UNSET + not_applicable_item: dict[str, Any] = UNSET if not isinstance(not_applicable_item_data, Unset): not_applicable_item = not_applicable_item_data.to_dict() @@ -49,60 +62,57 @@ def to_dict(self) -> Dict[str, Any]: dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(modules_components, Unset): + if modules_components is not UNSET: field_dict["modules_components"] = modules_components - if not isinstance(not_applicable, Unset): + if not_applicable is not UNSET: field_dict["not_applicable"] = not_applicable - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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: + from ..models.affect import Affect + from ..models.module_component import ModuleComponent + d = src_dict.copy() modules_components = [] _modules_components = d.pop("modules_components", UNSET) - if _modules_components is UNSET: - modules_components = UNSET - else: - for modules_components_item_data in _modules_components or []: - _modules_components_item = modules_components_item_data - modules_components_item: ModuleComponent - if isinstance(_modules_components_item, Unset): - modules_components_item = UNSET - else: - modules_components_item = ModuleComponent.from_dict( - _modules_components_item - ) + for modules_components_item_data in _modules_components or []: + _modules_components_item = modules_components_item_data + modules_components_item: ModuleComponent + if isinstance(_modules_components_item, Unset): + modules_components_item = UNSET + else: + modules_components_item = ModuleComponent.from_dict(_modules_components_item) - modules_components.append(modules_components_item) + modules_components.append(modules_components_item) not_applicable = [] _not_applicable = d.pop("not_applicable", UNSET) - if _not_applicable is UNSET: - not_applicable = UNSET - else: - for not_applicable_item_data in _not_applicable or []: - _not_applicable_item = not_applicable_item_data - not_applicable_item: Affect - if isinstance(_not_applicable_item, Unset): - not_applicable_item = UNSET - else: - not_applicable_item = Affect.from_dict(_not_applicable_item) + for not_applicable_item_data in _not_applicable or []: + _not_applicable_item = not_applicable_item_data + not_applicable_item: Affect + if isinstance(_not_applicable_item, Unset): + not_applicable_item = UNSET + else: + not_applicable_item = Affect.from_dict(_not_applicable_item) - not_applicable.append(not_applicable_item) + not_applicable.append(not_applicable_item) _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -129,19 +139,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: trackers_api_v1_file_create_response_200.additional_properties = d return trackers_api_v1_file_create_response_200 - @staticmethod - def get_fields(): - return { - "modules_components": List[ModuleComponent], - "not_applicable": List[Affect], - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_adjust_create_response_200.py b/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_adjust_create_response_200.py index f420865..13e99ed 100644 --- a/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_adjust_create_response_200.py +++ b/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_adjust_create_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="WorkflowsApiV1WorkflowsAdjustCreateResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class WorkflowsApiV1WorkflowsAdjustCreateResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: workflows_api_v1_workflows_adjust_create_response_200.additional_properties = d return workflows_api_v1_workflows_adjust_create_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_retrieve_2_response_200.py b/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_retrieve_2_response_200.py index b559b9d..a0dcef9 100644 --- a/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_retrieve_2_response_200.py +++ b/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_retrieve_2_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="WorkflowsApiV1WorkflowsRetrieve2Response200") -@attr.s(auto_attribs=True) +@_attrs_define class WorkflowsApiV1WorkflowsRetrieve2Response200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: workflows_api_v1_workflows_retrieve_2_response_200.additional_properties = d return workflows_api_v1_workflows_retrieve_2_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_retrieve_response_200.py index b0c51c5..d7ed092 100644 --- a/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/workflows_api_v1_workflows_retrieve_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="WorkflowsApiV1WorkflowsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class WorkflowsApiV1WorkflowsRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: workflows_api_v1_workflows_retrieve_response_200.additional_properties = d return workflows_api_v1_workflows_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/workflows_healthy_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/workflows_healthy_retrieve_response_200.py index b0ee479..602384c 100644 --- a/osidb_bindings/bindings/python_client/models/workflows_healthy_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/workflows_healthy_retrieve_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="WorkflowsHealthyRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class WorkflowsHealthyRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: workflows_healthy_retrieve_response_200.additional_properties = d return workflows_healthy_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/models/workflows_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/workflows_retrieve_response_200.py index ac58f7c..7360bff 100644 --- a/osidb_bindings/bindings/python_client/models/workflows_retrieve_response_200.py +++ b/osidb_bindings/bindings/python_client/models/workflows_retrieve_response_200.py @@ -1,48 +1,59 @@ -import datetime -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset, OSIDBModel -import attr from dateutil.parser import isoparse +import datetime -from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="WorkflowsRetrieveResponse200") -@attr.s(auto_attribs=True) +@_attrs_define class WorkflowsRetrieveResponse200(OSIDBModel): - """ """ + """ + Attributes: + dt (Union[Unset, datetime.datetime]): + env (Union[Unset, str]): + revision (Union[Unset, str]): + version (Union[Unset, str]): + """ dt: Union[Unset, datetime.datetime] = UNSET env: Union[Unset, str] = UNSET revision: Union[Unset, str] = UNSET version: Union[Unset, str] = UNSET - additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> Dict[str, Any]: + def to_dict(self) -> dict[str, Any]: dt: Union[Unset, str] = UNSET if not isinstance(self.dt, Unset): dt = self.dt.isoformat() env = self.env + revision = self.revision + version = self.version - field_dict: Dict[str, Any] = {} + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - if not isinstance(dt, Unset): + if dt is not UNSET: field_dict["dt"] = dt - if not isinstance(env, Unset): + if env is not UNSET: field_dict["env"] = env - if not isinstance(revision, Unset): + if revision is not UNSET: field_dict["revision"] = revision - if not isinstance(version, Unset): + if version is not UNSET: field_dict["version"] = version return field_dict @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() _dt = d.pop("dt", UNSET) dt: Union[Unset, datetime.datetime] @@ -67,17 +78,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: workflows_retrieve_response_200.additional_properties = d return workflows_retrieve_response_200 - @staticmethod - def get_fields(): - return { - "dt": datetime.datetime, - "env": str, - "revision": str, - "version": str, - } - @property - def additional_keys(self) -> List[str]: + def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: diff --git a/osidb_bindings/bindings/python_client/types.py b/osidb_bindings/bindings/python_client/types.py index 0e4898a..79c355c 100644 --- a/osidb_bindings/bindings/python_client/types.py +++ b/osidb_bindings/bindings/python_client/types.py @@ -1,33 +1,27 @@ -""" Contains some shared types for properties """ -from typing import ( - BinaryIO, - Generic, - MutableMapping, - Optional, - TextIO, - Tuple, - TypeVar, - Union, -) +"""Contains some shared types for properties""" -import attr +from collections.abc import MutableMapping +from http import HTTPStatus +from typing import BinaryIO, Generic, Optional, TypeVar, Literal + +from attrs import define class Unset: - def __bool__(self) -> bool: + def __bool__(self) -> Literal[False]: return False UNSET: Unset = Unset() -FileJsonType = Tuple[Optional[str], Union[BinaryIO, TextIO], Optional[str]] +FileJsonType = tuple[Optional[str], BinaryIO, Optional[str]] -@attr.s(auto_attribs=True) +@define class File: """Contains information for file uploads""" - payload: Union[BinaryIO, TextIO] + payload: BinaryIO file_name: Optional[str] = None mime_type: Optional[str] = None @@ -39,18 +33,20 @@ def to_tuple(self) -> FileJsonType: T = TypeVar("T") -@attr.s(auto_attribs=True) +@define class Response(Generic[T]): """A response from an endpoint""" - status_code: int + status_code: HTTPStatus content: bytes headers: MutableMapping[str, str] parsed: Optional[T] -__all__ = ["File", "Response", "FileJsonType"] - - class OSIDBModel: """Base class for all 'non-primitive' and 'non-enum' models""" + + pass + + +__all__ = ["UNSET", "File", "FileJsonType", "OSIDBModel", "Response", "Unset"] diff --git a/osidb_bindings/bindings_config.yml b/osidb_bindings/bindings_config.yml index 96b1077..e3f0bca 100644 --- a/osidb_bindings/bindings_config.yml +++ b/osidb_bindings/bindings_config.yml @@ -1,5 +1,5 @@ project_name_override: bindings package_name_override: python_client post_hooks: - - "ruff check . --fix" + - "ruff check . --fix --config ../../ruff.toml" - "ruff format ." diff --git a/osidb_bindings/iterators.py b/osidb_bindings/iterators.py index b37742c..23413aa 100644 --- a/osidb_bindings/iterators.py +++ b/osidb_bindings/iterators.py @@ -99,10 +99,10 @@ def make_response_iterable(response, retrieve_list_fn, *args, **kwargs): if param is None: setattr(response, func_name, lambda: None) else: - limit = re.search("limit=(\d+)", param) + limit = re.search(r"limit=(\d+)", param) if limit is not None: kwargs["limit"] = limit.group(1) - offset = re.search("offset=(\d+)", param) + offset = re.search(r"offset=(\d+)", param) if offset is not None: kwargs["offset"] = offset.group(1) diff --git a/osidb_bindings/session.py b/osidb_bindings/session.py index 59b5fab..b43914f 100644 --- a/osidb_bindings/session.py +++ b/osidb_bindings/session.py @@ -322,11 +322,9 @@ def __get_access_token(self) -> str: try: response = auth_token_refresh_create.sync( client=self.__client, - form_data=models.TokenRefresh.from_dict( + body=models.TokenRefresh.from_dict( {"refresh": self.refresh_token} ), - multipart_data=UNSET, - json_body=UNSET, ) except requests.HTTPError: @@ -334,11 +332,9 @@ def __get_access_token(self) -> str: self.refresh_token = self.__get_refresh_token() response = auth_token_refresh_create.sync( client=self.__client, - form_data=models.TokenRefresh.from_dict( + body=models.TokenRefresh.from_dict( {"refresh": self.refresh_token} ), - multipart_data=UNSET, - json_body=UNSET, ) return response.access diff --git a/osidb_bindings/templates_0.22.0/client.py.jinja b/osidb_bindings/templates_0.22.0/client.py.jinja index 332fe41..d5b5c70 100644 --- a/osidb_bindings/templates_0.22.0/client.py.jinja +++ b/osidb_bindings/templates_0.22.0/client.py.jinja @@ -2,7 +2,7 @@ This is a custom template derived from: https://github.com/openapi-generators/openapi-python-client/tree/v0.22.0/openapi_python_client/templates/client.py.jinja #} -import ssl +{# import ssl from typing import Any, Union, Optional from attrs import define, field, evolve @@ -167,4 +167,64 @@ class AuthenticatedClient: auth_header_name: str = "Authorization" {{ builders("AuthenticatedClient") }} -{{ httpx_stuff("AuthenticatedClient", "self._headers[self.auth_header_name] = f\"{self.prefix} {self.token}\" if self.prefix else self.token") }} +{{ httpx_stuff("AuthenticatedClient", "self._headers[self.auth_header_name] = f\"{self.prefix} {self.token}\" if self.prefix else self.token") }} #} + +import ssl +from typing import Dict, Union, Tuple, Type + +import aiohttp +import attr +import requests + +@attr.s(auto_attribs=True) +class Client: + """ A class for keeping track of data related to the API """ + + base_url: str + cookies: Dict[str, str] = attr.ib(factory=dict, kw_only=True) + headers: Dict[str, str] = attr.ib(factory=dict, kw_only=True) + timeout: float = attr.ib(300.0, kw_only=True) + verify_ssl: Union[str, bool, ssl.SSLContext] = attr.ib(True, kw_only=True) + + def get_headers(self) -> Dict[str, str]: + """ Get headers to be used in all endpoints """ + return {**self.headers} + + def with_headers(self, headers: Dict[str, str]) -> "Client": + """ Get a new client matching this one with additional headers """ + return attr.evolve(self, headers={**self.headers, **headers}) + + def get_cookies(self) -> Dict[str, str]: + return {**self.cookies} + + def with_cookies(self, cookies: Dict[str, str]) -> "Client": + """ Get a new client matching this one with additional cookies """ + return attr.evolve(self, cookies={**self.cookies, **cookies}) + + def get_timeout(self) -> float: + return self.timeout + + def with_timeout(self, timeout: float) -> "Client": + """ Get a new client matching this one with a new timeout (in seconds) """ + return attr.evolve(self, timeout=timeout) + +@attr.s(auto_attribs=True) +class AuthenticatedClient(Client): + """ A Client which has been authenticated for use on secured endpoints """ + + auth: Union[None, Tuple[str, str], Type[requests.auth.AuthBase]] = attr.ib(None, kw_only=True) + async_session: Union[None, aiohttp.ClientSession] = attr.ib(None, kw_only=True) + + def get_auth(self) -> Union[None, Tuple[str, str], Type[requests.auth.AuthBase]]: + return self.auth + + def with_auth(self, auth: Union[None, Tuple[str, str], Type[requests.auth.AuthBase]]) -> "Client": + """Get a new client matching this one with a new auth method""" + return attr.evolve(self, auth=auth) + + def get_async_session(self) -> Union[None, aiohttp.ClientSession]: + return self.async_session + + def with_async_session(self, async_session: Union[None, aiohttp.ClientSession]) -> "Client": + """Get a new client matching this one with a new async session""" + return attr.evolve(self, async_session=async_session) diff --git a/osidb_bindings/templates_0.22.0/endpoint_init.py.jinja b/osidb_bindings/templates_0.22.0/endpoint_init.py.jinja index fc98d76..263b85e 100644 --- a/osidb_bindings/templates_0.22.0/endpoint_init.py.jinja +++ b/osidb_bindings/templates_0.22.0/endpoint_init.py.jinja @@ -2,3 +2,6 @@ This is a custom template derived from: https://github.com/openapi-generators/openapi-python-client/tree/v0.22.0/openapi_python_client/templates/endpoint_init.py.jinja #} +{% for endpoint in endpoint_collection.endpoints %} +from .{{ endpoint.name }} import * +{% endfor %} diff --git a/osidb_bindings/templates_0.22.0/endpoint_macros.py.jinja b/osidb_bindings/templates_0.22.0/endpoint_macros.py.jinja index add3e6c..4ac19fc 100644 --- a/osidb_bindings/templates_0.22.0/endpoint_macros.py.jinja +++ b/osidb_bindings/templates_0.22.0/endpoint_macros.py.jinja @@ -7,19 +7,7 @@ {% macro header_params(endpoint) %} {% if endpoint.header_parameters or endpoint.bodies | length > 0 %} -headers: dict[str, Any] = {} -{% if endpoint.header_parameters %} - {% for parameter in endpoint.header_parameters %} - {% import "property_templates/" + parameter.template as param_template %} - {% if param_template.transform_header %} - {% set expression = param_template.transform_header(parameter.python_name) %} - {% else %} - {% set expression = parameter.python_name %} - {% endif %} - {% set statement = 'headers["' + parameter.name + '"]' + " = " + expression %} -{{ guarded_statement(parameter, parameter.python_name, statement) }} - {% endfor %} -{% endif %} +headers: dict[str, Any] = client.get_headers() {% endif %} {% endmacro %} @@ -123,9 +111,9 @@ body: Union[ {% for parameter in endpoint.query_parameters %} {{ parameter.to_string() }}, {% endfor %} -{% for parameter in endpoint.header_parameters %} +{# {% for parameter in endpoint.header_parameters %} {{ parameter.to_string() }}, -{% endfor %} +{% endfor %} #} {# cookie parameters #} {% for parameter in endpoint.cookie_parameters %} {{ parameter.to_string() }}, @@ -146,9 +134,9 @@ body=body, {% for parameter in endpoint.query_parameters %} {{ parameter.python_name }}={{ parameter.python_name }}, {% endfor %} -{% for parameter in endpoint.header_parameters %} +{# {% for parameter in endpoint.header_parameters %} {{ parameter.python_name }}={{ parameter.python_name }}, -{% endfor %} +{% endfor %} #} {% for parameter in endpoint.cookie_parameters %} {{ parameter.python_name }}={{ parameter.python_name }}, {% endfor %} diff --git a/osidb_bindings/templates_0.22.0/endpoint_module.py.jinja b/osidb_bindings/templates_0.22.0/endpoint_module.py.jinja index ce120fb..38fd2f0 100644 --- a/osidb_bindings/templates_0.22.0/endpoint_module.py.jinja +++ b/osidb_bindings/templates_0.22.0/endpoint_module.py.jinja @@ -6,9 +6,10 @@ from http import HTTPStatus from typing import Any, Optional, Union, cast import httpx +import requests from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET +from ...types import Response, UNSET, Unset from ... import errors {% for relative in endpoint.relative_imports | sort %} @@ -22,7 +23,7 @@ from ... import errors {% set parsed_responses = (endpoint.responses | length > 0) and return_string != "Any" %} def _get_kwargs( - {{ arguments(endpoint, include_client=False) | indent(4) }} + {{ arguments(endpoint, include_client=True) | indent(4) }} ) -> dict[str, Any]: {{ header_params(endpoint) | indent(4) }} @@ -31,15 +32,15 @@ def _get_kwargs( {{ query_params(endpoint) | indent(4) }} _kwargs: dict[str, Any] = { - "method": "{{ endpoint.method }}", + {# "method": "{{ endpoint.method }}", #} {% if endpoint.path_parameters %} - "url": "{{ endpoint.path }}".format( + "url": f"{client.base_url}/{{ endpoint.path }}".format( {%- for parameter in endpoint.path_parameters -%} {{parameter.python_name}}={{parameter.python_name}}, {%- endfor -%} ), {% else %} - "url": "{{ endpoint.path }}", + "url": f"{client.base_url}{{ endpoint.path }}", {% endif %} {% if endpoint.query_parameters %} "params": params, @@ -51,11 +52,13 @@ def _get_kwargs( {% if endpoint.bodies | length > 1 %} {% for body in endpoint.bodies %} + {% if body.content_type == "application/json" %} if isinstance(body, {{body.prop.get_type_string() }}): {% set destination = "_" + body.body_type + "_body" %} {{ body_to_kwarg(body, destination) | indent(8) }} _kwargs["{{ body.body_type.value }}"] = {{ destination }} headers["Content-Type"] = "{{ body.content_type }}" + {% endif %} {% endfor %} {% elif endpoint.bodies | length == 1 %} {% set body = endpoint.bodies[0] %} @@ -109,12 +112,16 @@ def sync_detailed( {{ docstring(endpoint, return_string, is_detailed=true) | indent(4) }} kwargs = _get_kwargs( - {{ kwargs(endpoint, include_client=False) }} + {{ kwargs(endpoint, include_client=True) }} ) - response = client.get_httpx_client().request( + response = requests.{{ endpoint.method }}( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, **kwargs, ) + response.raise_for_status() return _build_response(client=client, response=response) diff --git a/osidb_bindings/templates_0.22.0/model.py.jinja b/osidb_bindings/templates_0.22.0/model.py.jinja index 9bf2662..6e6e53c 100644 --- a/osidb_bindings/templates_0.22.0/model.py.jinja +++ b/osidb_bindings/templates_0.22.0/model.py.jinja @@ -2,7 +2,7 @@ This is a custom template derived from: https://github.com/openapi-generators/openapi-python-client/blob/v0.22.0/openapi_python_client/templates/model.py.jinja #} -from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING +from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Union from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -10,7 +10,7 @@ from attrs import field as _attrs_field import json {% endif %} -from ..types import UNSET, Unset +from ..types import UNSET, Unset, OSIDBModel {% for relative in model.relative_imports | sort %} {{ relative }} @@ -59,7 +59,7 @@ T = TypeVar("T", bound="{{ class_name }}") {% endmacro %} @_attrs_define -class {{ class_name }}: +class {{ class_name }}(OSIDBModel): {{ safe_docstring(class_docstring_content(model)) | indent(4) }} {% for property in model.required_properties + model.optional_properties %} @@ -102,7 +102,7 @@ for prop_name, prop in self.additional_properties.items(): field_dict.update(self.additional_properties) {% endif %} {% endif %} -{% if model.required_properties | length > 0 or model.optional_properties | length > 0 %} +{# {% if model.required_properties | length > 0 or model.optional_properties | length > 0 %} field_dict.update({ {% for property in model.required_properties + model.optional_properties %} {% if property.required %} @@ -110,12 +110,10 @@ field_dict.update({ {% endif %} {% endfor %} }) -{% endif %} -{% for property in model.optional_properties %} -{% if not property.required %} +{% endif %} #} +{% for property in model.required_properties + model.optional_properties %} if {{ property.python_name }} is not UNSET: field_dict["{{ property.name }}"] = {{ property.python_name }} -{% endif %} {% endfor %} return field_dict @@ -140,11 +138,7 @@ return field_dict {% if (model.required_properties or model.optional_properties or model.additional_properties) %} d = src_dict.copy() {% for property in model.required_properties + model.optional_properties %} - {% if property.required %} - {% set property_source = 'd.pop("' + property.name + '")' %} - {% else %} - {% set property_source = 'd.pop("' + property.name + '", UNSET)' %} - {% endif %} + {% set property_source = 'd.pop("' + property.name + '", UNSET)' %} {% import "property_templates/" + property.template as prop_template %} {% if prop_template.construct %} {{ prop_template.construct(property, property_source) | indent(8) }} diff --git a/osidb_bindings/templates_0.22.0/property_templates/date_property.py.jinja b/osidb_bindings/templates_0.22.0/property_templates/date_property.py.jinja index d6a0241..7e837cf 100644 --- a/osidb_bindings/templates_0.22.0/property_templates/date_property.py.jinja +++ b/osidb_bindings/templates_0.22.0/property_templates/date_property.py.jinja @@ -16,9 +16,6 @@ isoparse({{ source }}).date() {% macro transform(property, source, destination, declare_type=True) %} {% set transformed = source + ".isoformat()" %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {% if declare_type %} {% set type_annotation = property.get_type_string(json=True) %} {{ destination }}: {{ type_annotation }} = UNSET @@ -27,17 +24,12 @@ isoparse({{ source }}).date() {% endif %} if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{%- endif %} {% endmacro %} {% macro transform_multipart(property, source, destination) %} {% set transformed = source + ".isoformat().encode()" %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {% set type_annotation = property.get_type_string(json=True) | replace("str", "bytes") %} {{ destination }}: {{ type_annotation }} = UNSET if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{%- endif %} {% endmacro %} diff --git a/osidb_bindings/templates_0.22.0/property_templates/datetime_property.py.jinja b/osidb_bindings/templates_0.22.0/property_templates/datetime_property.py.jinja index 895e341..e6a32b9 100644 --- a/osidb_bindings/templates_0.22.0/property_templates/datetime_property.py.jinja +++ b/osidb_bindings/templates_0.22.0/property_templates/datetime_property.py.jinja @@ -16,9 +16,6 @@ isoparse({{ source }}) {% macro transform(property, source, destination, declare_type=True) %} {% set transformed = source + ".isoformat()" %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {% if declare_type %} {% set type_annotation = property.get_type_string(json=True) %} {{ destination }}: {{ type_annotation }} = UNSET @@ -27,17 +24,12 @@ isoparse({{ source }}) {% endif %} if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{%- endif %} {% endmacro %} {% macro transform_multipart(property, source, destination) %} {% set transformed = source + ".isoformat().encode()" %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {% set type_annotation = property.get_type_string(json=True) | replace("str", "bytes") %} {{ destination }}: {{ type_annotation }} = UNSET if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{%- endif %} {% endmacro %} diff --git a/osidb_bindings/templates_0.22.0/property_templates/enum_property.py.jinja b/osidb_bindings/templates_0.22.0/property_templates/enum_property.py.jinja index dd1ae64..b412041 100644 --- a/osidb_bindings/templates_0.22.0/property_templates/enum_property.py.jinja +++ b/osidb_bindings/templates_0.22.0/property_templates/enum_property.py.jinja @@ -17,25 +17,18 @@ {% macro transform(property, source, destination, declare_type=True, multipart=False) %} {% set transformed = source + ".value" %} {% set type_string = property.get_type_string(json=True) %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} +print({{ property.get_type_string(no_optional=True) }}) {{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{% endif %} {% endmacro %} {% macro transform_multipart(property, source, destination) %} {% set transformed = "(None, str(" + source + ".value" + ").encode(), \"text/plain\")" %} {% set type_string = "Union[Unset, tuple[None, bytes, str]]" %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {{ destination }}: {{ type_string }} = UNSET if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{% endif %} {% endmacro %} {% macro transform_header(source) %} diff --git a/osidb_bindings/templates_0.22.0/property_templates/list_property.py.jinja b/osidb_bindings/templates_0.22.0/property_templates/list_property.py.jinja index 4e31e3e..08a6a1e 100644 --- a/osidb_bindings/templates_0.22.0/property_templates/list_property.py.jinja +++ b/osidb_bindings/templates_0.22.0/property_templates/list_property.py.jinja @@ -9,11 +9,7 @@ {% set inner_source = inner_property.python_name + "_data" %} {{ property.python_name }} = [] _{{ property.python_name }} = {{ source }} -{% if property.required %} -for {{ inner_source }} in (_{{ property.python_name }}): -{% else %} for {{ inner_source }} in (_{{ property.python_name }} or []): -{% endif %} {{ inner_template.construct(inner_property, inner_source) | indent(4) }} {{ property.python_name }}.append({{ inner_property.python_name }}) {% else %} @@ -47,35 +43,23 @@ for {{ inner_source }} in {{ source }}: {% macro transform(property, source, destination, declare_type=True) %} {% set inner_property = property.inner_property %} {% set type_string = property.get_type_string(json=True) %} -{% if property.required %} -{{ _transform(property, source, destination, False, "to_dict") }} -{% else %} {{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET if not isinstance({{ source }}, Unset): {{ _transform(property, source, destination, False, "to_dict") | indent(4)}} -{% endif %} {% endmacro %} {% macro transform_multipart(property, source, destination) %} {% set inner_property = property.inner_property %} {% set type_string = "Union[Unset, tuple[None, bytes, str]]" %} -{% if property.required %} -{{ _transform(property, source, destination, True, "to_dict") }} -{% else %} {{ destination }}: {{ type_string }} = UNSET if not isinstance({{ source }}, Unset): {{ _transform(property, source, destination, True, "to_dict") | indent(4)}} -{% endif %} {% endmacro %} {% macro transform_multipart_body(property, source, destination) %} {% set inner_property = property.inner_property %} {% set type_string = property.get_type_string(json=True) %} -{% if property.required %} -{{ _transform(property, source, destination, False, "to_multipart") }} -{% else %} {{ destination }}: {{ type_string }} = UNSET if not isinstance({{ source }}, Unset): {{ _transform(property, source, destination, False, "to_multipart") | indent(4)}} -{% endif %} {% endmacro %} diff --git a/osidb_bindings/templates_0.22.0/property_templates/model_property.py.jinja b/osidb_bindings/templates_0.22.0/property_templates/model_property.py.jinja index 9f0919d..6df15c1 100644 --- a/osidb_bindings/templates_0.22.0/property_templates/model_property.py.jinja +++ b/osidb_bindings/templates_0.22.0/property_templates/model_property.py.jinja @@ -17,35 +17,23 @@ {% macro transform(property, source, destination, declare_type=True) %} {% set transformed = source + ".to_dict()" %} {% set type_string = property.get_type_string(json=True) %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {{ destination }}{% if declare_type %}: {{ type_string }}{% endif %} = UNSET if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{%- endif %} {% endmacro %} {% macro transform_multipart_body(property, source, destination) %} {% set transformed = source + ".to_multipart()" %} {% set type_string = property.get_type_string(multipart=True) %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {{ destination }}: {{ type_string }} = UNSET if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{%- endif %} {% endmacro %} {% macro transform_multipart(property, source, destination) %} {% set transformed = "(None, json.dumps(" + source + ".to_dict()" + ").encode(), 'application/json')" %} {% set type_string = property.get_type_string(multipart=True) %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {{ destination }}: {{ type_string }} = UNSET if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{%- endif %} {% endmacro %} diff --git a/osidb_bindings/templates_0.22.0/property_templates/property_macros.py.jinja b/osidb_bindings/templates_0.22.0/property_templates/property_macros.py.jinja index 6359ddc..a9eb134 100644 --- a/osidb_bindings/templates_0.22.0/property_templates/property_macros.py.jinja +++ b/osidb_bindings/templates_0.22.0/property_templates/property_macros.py.jinja @@ -3,16 +3,10 @@ https://github.com/openapi-generators/openapi-python-client/blob/v0.22.0/openapi_python_client/templates/property_templates/property_macros.py.jinja #} {% macro construct_template(construct_function, property, source) %} -{% if property.required %} -{{ property.python_name }} = {{ construct_function(property, source) }} -{% else %}{# Must be non-required #} _{{ property.python_name }} = {{ source }} {{ property.python_name }}: {{ property.get_type_string() }} - {% if not property.required %} if isinstance(_{{ property.python_name }}, Unset): {{ property.python_name }} = UNSET - {% endif %} else: {{ property.python_name }} = {{ construct_function(property, "_" + property.python_name) }} -{% endif %} {% endmacro %} diff --git a/osidb_bindings/templates_0.22.0/property_templates/uuid_property.py.jinja b/osidb_bindings/templates_0.22.0/property_templates/uuid_property.py.jinja index df51689..d7b6046 100644 --- a/osidb_bindings/templates_0.22.0/property_templates/uuid_property.py.jinja +++ b/osidb_bindings/templates_0.22.0/property_templates/uuid_property.py.jinja @@ -16,9 +16,6 @@ UUID({{ source }}) {% macro transform(property, source, destination, declare_type=True) %} {% set transformed = "str(" + source + ")" %} -{% if property.required %} -{{ destination }} = {{ transformed }} -{%- else %} {% if declare_type %} {% set type_annotation = property.get_type_string(json=True) %} {{ destination }}: {{ type_annotation }} = UNSET @@ -27,16 +24,11 @@ UUID({{ source }}) {% endif %} if not isinstance({{ source }}, Unset): {{ destination }} = {{ transformed }} -{%- endif %} {% endmacro %} {% macro transform_multipart(property, source, destination) %} -{% if property.required %} -{{ destination }} = str({{ source }}) -{%- else %} {% set type_annotation = property.get_type_string(json=True) | replace("str", "bytes") %} {{ destination }}: {{ type_annotation }} = UNSET if not isinstance({{ source }}, Unset): {{ destination }} = str({{ source }}) -{%- endif %} {% endmacro %} diff --git a/osidb_bindings/templates_0.22.0/types.py.jinja b/osidb_bindings/templates_0.22.0/types.py.jinja index d084a4c..1fd71e8 100644 --- a/osidb_bindings/templates_0.22.0/types.py.jinja +++ b/osidb_bindings/templates_0.22.0/types.py.jinja @@ -47,5 +47,8 @@ class Response(Generic[T]): headers: MutableMapping[str, str] parsed: Optional[T] +class OSIDBModel: + """ Base class for all 'non-primitive' and 'non-enum' models """ + pass -__all__ = ["UNSET", "File", "FileJsonType", "Response", "Unset"] +__all__ = ["UNSET", "File", "FileJsonType", "OSIDBModel", "Response", "Unset"] diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..8e9b15e --- /dev/null +++ b/ruff.toml @@ -0,0 +1,77 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.9 +target-version = "py39" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F"] +ignore = ["F403", "UP006"] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic"