diff --git a/.gitignore b/.gitignore index 084d0e2..72088a1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,9 @@ dmypy.json /.coverage local-requirements.* +/instance # Visual Studio Code .vscode + + diff --git a/osidb_bindings/bindings/python_client/api/osidb/__init__.py b/osidb_bindings/bindings/python_client/api/osidb/__init__.py index def66db..c7ed119 100644 --- a/osidb_bindings/bindings/python_client/api/osidb/__init__.py +++ b/osidb_bindings/bindings/python_client/api/osidb/__init__.py @@ -3,8 +3,16 @@ from .osidb_api_v1_affects_list import * from .osidb_api_v1_affects_retrieve import * from .osidb_api_v1_affects_update import * +from .osidb_api_v1_flaws_comments_create import * +from .osidb_api_v1_flaws_comments_list import * +from .osidb_api_v1_flaws_comments_retrieve import * from .osidb_api_v1_flaws_create import * from .osidb_api_v1_flaws_list 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_retrieve import * +from .osidb_api_v1_flaws_references_update import * from .osidb_api_v1_flaws_retrieve import * from .osidb_api_v1_flaws_update import * from .osidb_api_v1_manifest_retrieve import * 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 new file mode 100644 index 0000000..d8e74c6 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_create.py @@ -0,0 +1,117 @@ +from typing import Any, Dict, Optional + +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 + +QUERY_PARAMS = {} +REQUEST_BODY_TYPE = FlawCommentPost + + +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() + + 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() + + return { + "url": url, + "headers": headers, + "data": form_data.to_dict(), + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[OsidbApiV1FlawsCommentsCreateResponse201]: + if response.status_code == 201: + _response_201 = response.json() + response_201: OsidbApiV1FlawsCommentsCreateResponse201 + if isinstance(_response_201, Unset): + response_201 = UNSET + else: + response_201 = OsidbApiV1FlawsCommentsCreateResponse201.from_dict( + _response_201 + ) + + return response_201 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[OsidbApiV1FlawsCommentsCreateResponse201]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + flaw_id: str, + *, + client: AuthenticatedClient, + form_data: FlawCommentPost, + multipart_data: FlawCommentPost, + json_body: FlawCommentPost, +) -> Response[OsidbApiV1FlawsCommentsCreateResponse201]: + kwargs = _get_kwargs( + flaw_id=flaw_id, + client=client, + form_data=form_data, + multipart_data=multipart_data, + json_body=json_body, + ) + + response = requests.post( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + flaw_id: str, + *, + client: AuthenticatedClient, + form_data: FlawCommentPost, + multipart_data: FlawCommentPost, + json_body: 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.""" + + return sync_detailed( + flaw_id=flaw_id, + client=client, + form_data=form_data, + multipart_data=multipart_data, + json_body=json_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 new file mode 100644 index 0000000..a6efaf9 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_list.py @@ -0,0 +1,174 @@ +from typing import Any, Dict, List, Optional, Union + +import requests + +from ...client import AuthenticatedClient +from ...models.osidb_api_v1_flaws_comments_list_response_200 import ( + OsidbApiV1FlawsCommentsListResponse200, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = { + "exclude_fields": List[str], + "external_system_id": str, + "include_fields": List[str], + "include_meta_attr": List[str], + "limit": int, + "offset": int, + "order": int, + "uuid": str, +} + + +def _get_kwargs( + flaw_id: str, + *, + client: AuthenticatedClient, + 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, 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, + ) + + headers: Dict[str, Any] = client.get_headers() + + json_exclude_fields: Union[Unset, None, 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_include_fields: Union[Unset, None, 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_meta_attr: Union[Unset, None, 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 + + params: Dict[str, Any] = { + "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": order, + "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, + "params": params, + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[OsidbApiV1FlawsCommentsListResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: OsidbApiV1FlawsCommentsListResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET + else: + response_200 = OsidbApiV1FlawsCommentsListResponse200.from_dict( + _response_200 + ) + + return response_200 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[OsidbApiV1FlawsCommentsListResponse200]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + flaw_id: str, + *, + client: AuthenticatedClient, + 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, int] = UNSET, + uuid: Union[Unset, None, str] = UNSET, +) -> Response[OsidbApiV1FlawsCommentsListResponse200]: + kwargs = _get_kwargs( + flaw_id=flaw_id, + client=client, + exclude_fields=exclude_fields, + external_system_id=external_system_id, + include_fields=include_fields, + include_meta_attr=include_meta_attr, + limit=limit, + offset=offset, + order=order, + uuid=uuid, + ) + + response = requests.get( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + flaw_id: str, + *, + client: AuthenticatedClient, + 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, int] = UNSET, + uuid: Union[Unset, None, str] = 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.""" + + return sync_detailed( + flaw_id=flaw_id, + client=client, + exclude_fields=exclude_fields, + external_system_id=external_system_id, + include_fields=include_fields, + include_meta_attr=include_meta_attr, + limit=limit, + offset=offset, + order=order, + uuid=uuid, + ).parsed 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 new file mode 100644 index 0000000..4dd8497 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_comments_retrieve.py @@ -0,0 +1,145 @@ +from typing import Any, Dict, List, Optional, Union + +import requests + +from ...client import AuthenticatedClient +from ...models.osidb_api_v1_flaws_comments_retrieve_response_200 import ( + OsidbApiV1FlawsCommentsRetrieveResponse200, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = { + "exclude_fields": List[str], + "include_fields": List[str], + "include_meta_attr": List[str], +} + + +def _get_kwargs( + flaw_id: str, + comment_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, +) -> 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() + + json_exclude_fields: Union[Unset, None, 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_include_fields: Union[Unset, None, 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_meta_attr: Union[Unset, None, 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 + + 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, + "params": params, + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[OsidbApiV1FlawsCommentsRetrieveResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: OsidbApiV1FlawsCommentsRetrieveResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET + else: + response_200 = OsidbApiV1FlawsCommentsRetrieveResponse200.from_dict( + _response_200 + ) + + return response_200 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[OsidbApiV1FlawsCommentsRetrieveResponse200]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_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, + include_meta_attr: Union[Unset, None, List[str]] = UNSET, +) -> Response[OsidbApiV1FlawsCommentsRetrieveResponse200]: + kwargs = _get_kwargs( + flaw_id=flaw_id, + comment_id=comment_id, + client=client, + exclude_fields=exclude_fields, + include_fields=include_fields, + include_meta_attr=include_meta_attr, + ) + + response = requests.get( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + flaw_id: str, + comment_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, +) -> 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.""" + + return sync_detailed( + flaw_id=flaw_id, + comment_id=comment_id, + client=client, + exclude_fields=exclude_fields, + include_fields=include_fields, + include_meta_attr=include_meta_attr, + ).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 859ad3a..6e3755e 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 @@ -64,6 +64,7 @@ "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__external_system_id": str, "affects__trackers__ps_update_stream": str, "affects__trackers__resolution": str, @@ -197,6 +198,7 @@ def _get_kwargs( 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_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, @@ -798,6 +800,7 @@ def _get_kwargs( "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__external_system_id": affects_trackers_external_system_id, "affects__trackers__ps_update_stream": affects_trackers_ps_update_stream, "affects__trackers__resolution": affects_trackers_resolution, @@ -964,6 +967,7 @@ def sync_detailed( 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_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, @@ -1092,6 +1096,7 @@ def sync_detailed( affects_trackers_created_dt_lt=affects_trackers_created_dt_lt, affects_trackers_created_dt_lte=affects_trackers_created_dt_lte, affects_trackers_embargoed=affects_trackers_embargoed, + affects_trackers_errata_advisory_name=affects_trackers_errata_advisory_name, 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, @@ -1235,6 +1240,7 @@ def sync( 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_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, @@ -1365,6 +1371,7 @@ def sync( affects_trackers_created_dt_lt=affects_trackers_created_dt_lt, affects_trackers_created_dt_lte=affects_trackers_created_dt_lte, affects_trackers_embargoed=affects_trackers_embargoed, + affects_trackers_errata_advisory_name=affects_trackers_errata_advisory_name, 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, 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 new file mode 100644 index 0000000..39c4ede --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_create.py @@ -0,0 +1,117 @@ +from typing import Any, Dict, Optional + +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 + +QUERY_PARAMS = {} +REQUEST_BODY_TYPE = FlawReferencePost + + +def _get_kwargs( + flaw_id: str, + *, + 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() + + 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() + + return { + "url": url, + "headers": headers, + "data": form_data.to_dict(), + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[OsidbApiV1FlawsReferencesCreateResponse201]: + if response.status_code == 201: + _response_201 = response.json() + response_201: OsidbApiV1FlawsReferencesCreateResponse201 + if isinstance(_response_201, Unset): + response_201 = UNSET + else: + response_201 = OsidbApiV1FlawsReferencesCreateResponse201.from_dict( + _response_201 + ) + + return response_201 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[OsidbApiV1FlawsReferencesCreateResponse201]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + flaw_id: str, + *, + client: AuthenticatedClient, + form_data: FlawReferencePost, + multipart_data: FlawReferencePost, + json_body: FlawReferencePost, +) -> Response[OsidbApiV1FlawsReferencesCreateResponse201]: + kwargs = _get_kwargs( + flaw_id=flaw_id, + client=client, + form_data=form_data, + multipart_data=multipart_data, + json_body=json_body, + ) + + response = requests.post( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + flaw_id: str, + *, + client: AuthenticatedClient, + form_data: FlawReferencePost, + multipart_data: FlawReferencePost, + json_body: FlawReferencePost, +) -> Optional[OsidbApiV1FlawsReferencesCreateResponse201]: + """ """ + + return sync_detailed( + flaw_id=flaw_id, + client=client, + form_data=form_data, + multipart_data=multipart_data, + json_body=json_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 new file mode 100644 index 0000000..97c2239 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_destroy.py @@ -0,0 +1,97 @@ +from typing import Any, Dict, Optional + +import requests + +from ...client import AuthenticatedClient +from ...models.osidb_api_v1_flaws_references_destroy_response_204 import ( + OsidbApiV1FlawsReferencesDestroyResponse204, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = {} + + +def _get_kwargs( + flaw_id: str, + uuid: str, + *, + client: AuthenticatedClient, +) -> Dict[str, Any]: + url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{uuid}".format( + client.base_url, + flaw_id=flaw_id, + uuid=uuid, + ) + + headers: Dict[str, Any] = client.get_headers() + + return { + "url": url, + "headers": headers, + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[OsidbApiV1FlawsReferencesDestroyResponse204]: + if response.status_code == 204: + _response_204 = response.json() + response_204: OsidbApiV1FlawsReferencesDestroyResponse204 + if isinstance(_response_204, Unset): + response_204 = UNSET + else: + response_204 = OsidbApiV1FlawsReferencesDestroyResponse204.from_dict( + _response_204 + ) + + return response_204 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[OsidbApiV1FlawsReferencesDestroyResponse204]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + flaw_id: str, + uuid: str, + *, + client: AuthenticatedClient, +) -> Response[OsidbApiV1FlawsReferencesDestroyResponse204]: + kwargs = _get_kwargs( + flaw_id=flaw_id, + uuid=uuid, + client=client, + ) + + response = requests.delete( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + flaw_id: str, + uuid: str, + *, + client: AuthenticatedClient, +) -> Optional[OsidbApiV1FlawsReferencesDestroyResponse204]: + """ """ + + return sync_detailed( + flaw_id=flaw_id, + uuid=uuid, + client=client, + ).parsed 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 new file mode 100644 index 0000000..0f89a0c --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_list.py @@ -0,0 +1,153 @@ +from typing import Any, Dict, List, Optional, Union + +import requests + +from ...client import AuthenticatedClient +from ...models.osidb_api_v1_flaws_references_list_response_200 import ( + OsidbApiV1FlawsReferencesListResponse200, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = { + "exclude_fields": List[str], + "include_fields": List[str], + "include_meta_attr": List[str], + "limit": int, + "offset": int, +} + + +def _get_kwargs( + flaw_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, + limit: Union[Unset, None, int] = UNSET, + offset: Union[Unset, None, int] = 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_exclude_fields: Union[Unset, None, 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_include_fields: Union[Unset, None, 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_meta_attr: Union[Unset, None, 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 + + params: Dict[str, Any] = { + "exclude_fields": json_exclude_fields, + "include_fields": json_include_fields, + "include_meta_attr": json_include_meta_attr, + "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, + "params": params, + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[OsidbApiV1FlawsReferencesListResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: OsidbApiV1FlawsReferencesListResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET + else: + response_200 = OsidbApiV1FlawsReferencesListResponse200.from_dict( + _response_200 + ) + + return response_200 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[OsidbApiV1FlawsReferencesListResponse200]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + flaw_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, + limit: Union[Unset, None, int] = UNSET, + offset: Union[Unset, None, int] = UNSET, +) -> Response[OsidbApiV1FlawsReferencesListResponse200]: + kwargs = _get_kwargs( + flaw_id=flaw_id, + client=client, + exclude_fields=exclude_fields, + include_fields=include_fields, + include_meta_attr=include_meta_attr, + limit=limit, + offset=offset, + ) + + response = requests.get( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + flaw_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, + limit: Union[Unset, None, int] = UNSET, + offset: Union[Unset, None, int] = UNSET, +) -> Optional[OsidbApiV1FlawsReferencesListResponse200]: + """ """ + + return sync_detailed( + flaw_id=flaw_id, + client=client, + exclude_fields=exclude_fields, + include_fields=include_fields, + include_meta_attr=include_meta_attr, + limit=limit, + offset=offset, + ).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 new file mode 100644 index 0000000..6470717 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_retrieve.py @@ -0,0 +1,145 @@ +from typing import Any, Dict, List, Optional, Union + +import requests + +from ...client import AuthenticatedClient +from ...models.osidb_api_v1_flaws_references_retrieve_response_200 import ( + OsidbApiV1FlawsReferencesRetrieveResponse200, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = { + "exclude_fields": List[str], + "include_fields": List[str], + "include_meta_attr": List[str], +} + + +def _get_kwargs( + flaw_id: str, + uuid: 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, +) -> Dict[str, Any]: + url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{uuid}".format( + client.base_url, + flaw_id=flaw_id, + uuid=uuid, + ) + + headers: Dict[str, Any] = client.get_headers() + + json_exclude_fields: Union[Unset, None, 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_include_fields: Union[Unset, None, 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_meta_attr: Union[Unset, None, 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 + + 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, + "params": params, + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[OsidbApiV1FlawsReferencesRetrieveResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: OsidbApiV1FlawsReferencesRetrieveResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET + else: + response_200 = OsidbApiV1FlawsReferencesRetrieveResponse200.from_dict( + _response_200 + ) + + return response_200 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[OsidbApiV1FlawsReferencesRetrieveResponse200]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + flaw_id: str, + uuid: 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, +) -> Response[OsidbApiV1FlawsReferencesRetrieveResponse200]: + kwargs = _get_kwargs( + flaw_id=flaw_id, + uuid=uuid, + client=client, + exclude_fields=exclude_fields, + include_fields=include_fields, + include_meta_attr=include_meta_attr, + ) + + response = requests.get( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + flaw_id: str, + uuid: 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, +) -> Optional[OsidbApiV1FlawsReferencesRetrieveResponse200]: + """ """ + + return sync_detailed( + flaw_id=flaw_id, + uuid=uuid, + client=client, + exclude_fields=exclude_fields, + include_fields=include_fields, + include_meta_attr=include_meta_attr, + ).parsed 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 new file mode 100644 index 0000000..94e7900 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/osidb/osidb_api_v1_flaws_references_update.py @@ -0,0 +1,123 @@ +from typing import Any, Dict, Optional + +import requests + +from ...client import AuthenticatedClient +from ...models.flaw_reference import FlawReference +from ...models.osidb_api_v1_flaws_references_update_response_200 import ( + OsidbApiV1FlawsReferencesUpdateResponse200, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = {} +REQUEST_BODY_TYPE = FlawReference + + +def _get_kwargs( + flaw_id: str, + uuid: str, + *, + client: AuthenticatedClient, + form_data: FlawReference, + multipart_data: FlawReference, + json_body: FlawReference, +) -> Dict[str, Any]: + url = "{}/osidb/api/v1/flaws/{flaw_id}/references/{uuid}".format( + client.base_url, + flaw_id=flaw_id, + uuid=uuid, + ) + + headers: Dict[str, Any] = client.get_headers() + + 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() + + return { + "url": url, + "headers": headers, + "data": form_data.to_dict(), + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[OsidbApiV1FlawsReferencesUpdateResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: OsidbApiV1FlawsReferencesUpdateResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET + else: + response_200 = OsidbApiV1FlawsReferencesUpdateResponse200.from_dict( + _response_200 + ) + + return response_200 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[OsidbApiV1FlawsReferencesUpdateResponse200]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + flaw_id: str, + uuid: str, + *, + client: AuthenticatedClient, + form_data: FlawReference, + multipart_data: FlawReference, + json_body: FlawReference, +) -> Response[OsidbApiV1FlawsReferencesUpdateResponse200]: + kwargs = _get_kwargs( + flaw_id=flaw_id, + uuid=uuid, + client=client, + form_data=form_data, + multipart_data=multipart_data, + json_body=json_body, + ) + + response = requests.put( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + flaw_id: str, + uuid: str, + *, + client: AuthenticatedClient, + form_data: FlawReference, + multipart_data: FlawReference, + json_body: FlawReference, +) -> Optional[OsidbApiV1FlawsReferencesUpdateResponse200]: + """ """ + + return sync_detailed( + flaw_id=flaw_id, + uuid=uuid, + client=client, + form_data=form_data, + multipart_data=multipart_data, + json_body=json_body, + ).parsed diff --git a/osidb_bindings/bindings/python_client/api/taskman/__init__.py b/osidb_bindings/bindings/python_client/api/taskman/__init__.py index 100a982..88f9072 100644 --- a/osidb_bindings/bindings/python_client/api/taskman/__init__.py +++ b/osidb_bindings/bindings/python_client/api/taskman/__init__.py @@ -1,6 +1,8 @@ from .taskman_api_v1_group_create import * from .taskman_api_v1_group_retrieve import * from .taskman_api_v1_group_update import * +from .taskman_api_v1_task_assignee_retrieve import * +from .taskman_api_v1_task_assignee_update import * from .taskman_api_v1_task_comment_create import * from .taskman_api_v1_task_comment_update import * from .taskman_api_v1_task_flaw_create import * @@ -8,4 +10,5 @@ from .taskman_api_v1_task_flaw_update import * from .taskman_api_v1_task_retrieve import * from .taskman_api_v1_task_status_update import * +from .taskman_api_v1_task_unassigned_retrieve import * from .taskman_healthy_retrieve import * diff --git a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_group_update.py b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_group_update.py index 4b18d47..7badf45 100644 --- a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_group_update.py +++ b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_group_update.py @@ -3,8 +3,8 @@ import requests from ...client import AuthenticatedClient -from ...models.taskman_api_v1_group_update_response_204 import ( - TaskmanApiV1GroupUpdateResponse204, +from ...models.taskman_api_v1_group_update_response_200 import ( + TaskmanApiV1GroupUpdateResponse200, ) from ...types import UNSET, Response, Unset @@ -43,22 +43,22 @@ def _get_kwargs( def _parse_response( *, response: requests.Response -) -> Optional[TaskmanApiV1GroupUpdateResponse204]: - if response.status_code == 204: - _response_204 = response.json() - response_204: TaskmanApiV1GroupUpdateResponse204 - if isinstance(_response_204, Unset): - response_204 = UNSET +) -> Optional[TaskmanApiV1GroupUpdateResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: TaskmanApiV1GroupUpdateResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET else: - response_204 = TaskmanApiV1GroupUpdateResponse204.from_dict(_response_204) + response_200 = TaskmanApiV1GroupUpdateResponse200.from_dict(_response_200) - return response_204 + return response_200 return None def _build_response( *, response: requests.Response -) -> Response[TaskmanApiV1GroupUpdateResponse204]: +) -> Response[TaskmanApiV1GroupUpdateResponse200]: return Response( status_code=response.status_code, content=response.content, @@ -73,7 +73,7 @@ def sync_detailed( client: AuthenticatedClient, task_key: str, jira_authentication: str, -) -> Response[TaskmanApiV1GroupUpdateResponse204]: +) -> Response[TaskmanApiV1GroupUpdateResponse200]: kwargs = _get_kwargs( group_key=group_key, client=client, @@ -98,7 +98,7 @@ def sync( client: AuthenticatedClient, task_key: str, jira_authentication: str, -) -> Optional[TaskmanApiV1GroupUpdateResponse204]: +) -> Optional[TaskmanApiV1GroupUpdateResponse200]: """Add a task into a group""" return sync_detailed( diff --git a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_assignee_retrieve.py b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_assignee_retrieve.py new file mode 100644 index 0000000..f7107f2 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_assignee_retrieve.py @@ -0,0 +1,98 @@ +from typing import Any, Dict, Optional + +import requests + +from ...client import AuthenticatedClient +from ...models.taskman_api_v1_task_assignee_retrieve_response_200 import ( + TaskmanApiV1TaskAssigneeRetrieveResponse200, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = {} + + +def _get_kwargs( + user: str, + *, + client: AuthenticatedClient, + jira_authentication: str, +) -> Dict[str, Any]: + url = "{}/taskman/api/v1/task/assignee/{user}".format( + client.base_url, + user=user, + ) + + headers: Dict[str, Any] = client.get_headers() + + headers["jira-authentication"] = jira_authentication + + return { + "url": url, + "headers": headers, + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[TaskmanApiV1TaskAssigneeRetrieveResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: TaskmanApiV1TaskAssigneeRetrieveResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET + else: + response_200 = TaskmanApiV1TaskAssigneeRetrieveResponse200.from_dict( + _response_200 + ) + + return response_200 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[TaskmanApiV1TaskAssigneeRetrieveResponse200]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + user: str, + *, + client: AuthenticatedClient, + jira_authentication: str, +) -> Response[TaskmanApiV1TaskAssigneeRetrieveResponse200]: + kwargs = _get_kwargs( + user=user, + client=client, + jira_authentication=jira_authentication, + ) + + response = requests.get( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + user: str, + *, + client: AuthenticatedClient, + jira_authentication: str, +) -> Optional[TaskmanApiV1TaskAssigneeRetrieveResponse200]: + """Get a list of tasks from a user""" + + return sync_detailed( + user=user, + client=client, + jira_authentication=jira_authentication, + ).parsed diff --git a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_assignee_update.py b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_assignee_update.py new file mode 100644 index 0000000..87dea34 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_assignee_update.py @@ -0,0 +1,111 @@ +from typing import Any, Dict, Optional + +import requests + +from ...client import AuthenticatedClient +from ...models.taskman_api_v1_task_assignee_update_response_200 import ( + TaskmanApiV1TaskAssigneeUpdateResponse200, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = { + "task_key": str, +} + + +def _get_kwargs( + user: str, + *, + client: AuthenticatedClient, + task_key: str, + jira_authentication: str, +) -> Dict[str, Any]: + url = "{}/taskman/api/v1/task/assignee/{user}".format( + client.base_url, + user=user, + ) + + headers: Dict[str, Any] = client.get_headers() + + headers["jira-authentication"] = jira_authentication + + params: Dict[str, Any] = { + "task_key": task_key, + } + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + return { + "url": url, + "headers": headers, + "params": params, + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[TaskmanApiV1TaskAssigneeUpdateResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: TaskmanApiV1TaskAssigneeUpdateResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET + else: + response_200 = TaskmanApiV1TaskAssigneeUpdateResponse200.from_dict( + _response_200 + ) + + return response_200 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[TaskmanApiV1TaskAssigneeUpdateResponse200]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + user: str, + *, + client: AuthenticatedClient, + task_key: str, + jira_authentication: str, +) -> Response[TaskmanApiV1TaskAssigneeUpdateResponse200]: + kwargs = _get_kwargs( + user=user, + client=client, + task_key=task_key, + jira_authentication=jira_authentication, + ) + + response = requests.put( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + user: str, + *, + client: AuthenticatedClient, + task_key: str, + jira_authentication: str, +) -> Optional[TaskmanApiV1TaskAssigneeUpdateResponse200]: + """Assign a task to a user""" + + return sync_detailed( + user=user, + client=client, + task_key=task_key, + jira_authentication=jira_authentication, + ).parsed diff --git a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_flaw_update.py b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_flaw_update.py index bec6a31..1bf5909 100644 --- a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_flaw_update.py +++ b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_flaw_update.py @@ -3,8 +3,8 @@ import requests from ...client import AuthenticatedClient -from ...models.taskman_api_v1_task_flaw_update_response_204 import ( - TaskmanApiV1TaskFlawUpdateResponse204, +from ...models.taskman_api_v1_task_flaw_update_response_200 import ( + TaskmanApiV1TaskFlawUpdateResponse200, ) from ...types import UNSET, Response, Unset @@ -34,24 +34,24 @@ def _get_kwargs( def _parse_response( *, response: requests.Response -) -> Optional[TaskmanApiV1TaskFlawUpdateResponse204]: - if response.status_code == 204: - _response_204 = response.json() - response_204: TaskmanApiV1TaskFlawUpdateResponse204 - if isinstance(_response_204, Unset): - response_204 = UNSET +) -> Optional[TaskmanApiV1TaskFlawUpdateResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: TaskmanApiV1TaskFlawUpdateResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET else: - response_204 = TaskmanApiV1TaskFlawUpdateResponse204.from_dict( - _response_204 + response_200 = TaskmanApiV1TaskFlawUpdateResponse200.from_dict( + _response_200 ) - return response_204 + return response_200 return None def _build_response( *, response: requests.Response -) -> Response[TaskmanApiV1TaskFlawUpdateResponse204]: +) -> Response[TaskmanApiV1TaskFlawUpdateResponse200]: return Response( status_code=response.status_code, content=response.content, @@ -65,7 +65,7 @@ def sync_detailed( *, client: AuthenticatedClient, jira_authentication: str, -) -> Response[TaskmanApiV1TaskFlawUpdateResponse204]: +) -> Response[TaskmanApiV1TaskFlawUpdateResponse200]: kwargs = _get_kwargs( flaw_uuid=flaw_uuid, client=client, @@ -88,7 +88,7 @@ def sync( *, client: AuthenticatedClient, jira_authentication: str, -) -> Optional[TaskmanApiV1TaskFlawUpdateResponse204]: +) -> Optional[TaskmanApiV1TaskFlawUpdateResponse200]: """Update a task in Jira from a Flaw""" return sync_detailed( diff --git a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_status_update.py b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_status_update.py index 3b17379..e6d8146 100644 --- a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_status_update.py +++ b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_status_update.py @@ -1,10 +1,16 @@ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, Union import requests from ...client import AuthenticatedClient -from ...models.taskman_api_v1_task_status_update_response_204 import ( - TaskmanApiV1TaskStatusUpdateResponse204, +from ...models.taskman_api_v1_task_status_update_reason import ( + TaskmanApiV1TaskStatusUpdateReason, +) +from ...models.taskman_api_v1_task_status_update_resolution import ( + TaskmanApiV1TaskStatusUpdateResolution, +) +from ...models.taskman_api_v1_task_status_update_response_200 import ( + TaskmanApiV1TaskStatusUpdateResponse200, ) from ...models.taskman_api_v1_task_status_update_status import ( TaskmanApiV1TaskStatusUpdateStatus, @@ -12,6 +18,8 @@ from ...types import UNSET, Response, Unset QUERY_PARAMS = { + "reason": TaskmanApiV1TaskStatusUpdateReason, + "resolution": TaskmanApiV1TaskStatusUpdateResolution, "status": TaskmanApiV1TaskStatusUpdateStatus, } @@ -20,6 +28,8 @@ def _get_kwargs( task_key: str, *, client: AuthenticatedClient, + reason: Union[Unset, None, TaskmanApiV1TaskStatusUpdateReason] = UNSET, + resolution: Union[Unset, None, TaskmanApiV1TaskStatusUpdateResolution] = UNSET, status: TaskmanApiV1TaskStatusUpdateStatus, jira_authentication: str, ) -> Dict[str, Any]: @@ -32,12 +42,30 @@ def _get_kwargs( headers["jira-authentication"] = jira_authentication + json_reason: Union[Unset, None, str] = UNSET + if not isinstance(reason, Unset): + + json_reason = ( + TaskmanApiV1TaskStatusUpdateReason(reason).value if reason else None + ) + + json_resolution: Union[Unset, None, str] = UNSET + if not isinstance(resolution, Unset): + + json_resolution = ( + TaskmanApiV1TaskStatusUpdateResolution(resolution).value + if resolution + else None + ) + json_status: str = UNSET if not isinstance(status, Unset): json_status = TaskmanApiV1TaskStatusUpdateStatus(status).value params: Dict[str, Any] = { + "reason": json_reason, + "resolution": json_resolution, "status": json_status, } params = {k: v for k, v in params.items() if v is not UNSET and v is not None} @@ -51,24 +79,24 @@ def _get_kwargs( def _parse_response( *, response: requests.Response -) -> Optional[TaskmanApiV1TaskStatusUpdateResponse204]: - if response.status_code == 204: - _response_204 = response.json() - response_204: TaskmanApiV1TaskStatusUpdateResponse204 - if isinstance(_response_204, Unset): - response_204 = UNSET +) -> Optional[TaskmanApiV1TaskStatusUpdateResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: TaskmanApiV1TaskStatusUpdateResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET else: - response_204 = TaskmanApiV1TaskStatusUpdateResponse204.from_dict( - _response_204 + response_200 = TaskmanApiV1TaskStatusUpdateResponse200.from_dict( + _response_200 ) - return response_204 + return response_200 return None def _build_response( *, response: requests.Response -) -> Response[TaskmanApiV1TaskStatusUpdateResponse204]: +) -> Response[TaskmanApiV1TaskStatusUpdateResponse200]: return Response( status_code=response.status_code, content=response.content, @@ -81,12 +109,16 @@ def sync_detailed( task_key: str, *, client: AuthenticatedClient, + reason: Union[Unset, None, TaskmanApiV1TaskStatusUpdateReason] = UNSET, + resolution: Union[Unset, None, TaskmanApiV1TaskStatusUpdateResolution] = UNSET, status: TaskmanApiV1TaskStatusUpdateStatus, jira_authentication: str, -) -> Response[TaskmanApiV1TaskStatusUpdateResponse204]: +) -> Response[TaskmanApiV1TaskStatusUpdateResponse200]: kwargs = _get_kwargs( task_key=task_key, client=client, + reason=reason, + resolution=resolution, status=status, jira_authentication=jira_authentication, ) @@ -106,14 +138,18 @@ def sync( task_key: str, *, client: AuthenticatedClient, + reason: Union[Unset, None, TaskmanApiV1TaskStatusUpdateReason] = UNSET, + resolution: Union[Unset, None, TaskmanApiV1TaskStatusUpdateResolution] = UNSET, status: TaskmanApiV1TaskStatusUpdateStatus, jira_authentication: str, -) -> Optional[TaskmanApiV1TaskStatusUpdateResponse204]: +) -> Optional[TaskmanApiV1TaskStatusUpdateResponse200]: """Change a task workflow status""" return sync_detailed( task_key=task_key, client=client, + reason=reason, + resolution=resolution, status=status, jira_authentication=jira_authentication, ).parsed diff --git a/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_unassigned_retrieve.py b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_unassigned_retrieve.py new file mode 100644 index 0000000..aa8f670 --- /dev/null +++ b/osidb_bindings/bindings/python_client/api/taskman/taskman_api_v1_task_unassigned_retrieve.py @@ -0,0 +1,92 @@ +from typing import Any, Dict, Optional + +import requests + +from ...client import AuthenticatedClient +from ...models.taskman_api_v1_task_unassigned_retrieve_response_200 import ( + TaskmanApiV1TaskUnassignedRetrieveResponse200, +) +from ...types import UNSET, Response, Unset + +QUERY_PARAMS = {} + + +def _get_kwargs( + *, + client: AuthenticatedClient, + jira_authentication: str, +) -> Dict[str, Any]: + url = "{}/taskman/api/v1/task/unassigned/".format( + client.base_url, + ) + + headers: Dict[str, Any] = client.get_headers() + + headers["jira-authentication"] = jira_authentication + + return { + "url": url, + "headers": headers, + } + + +def _parse_response( + *, response: requests.Response +) -> Optional[TaskmanApiV1TaskUnassignedRetrieveResponse200]: + if response.status_code == 200: + _response_200 = response.json() + response_200: TaskmanApiV1TaskUnassignedRetrieveResponse200 + if isinstance(_response_200, Unset): + response_200 = UNSET + else: + response_200 = TaskmanApiV1TaskUnassignedRetrieveResponse200.from_dict( + _response_200 + ) + + return response_200 + return None + + +def _build_response( + *, response: requests.Response +) -> Response[TaskmanApiV1TaskUnassignedRetrieveResponse200]: + return Response( + status_code=response.status_code, + content=response.content, + headers=response.headers, + parsed=_parse_response(response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + jira_authentication: str, +) -> Response[TaskmanApiV1TaskUnassignedRetrieveResponse200]: + kwargs = _get_kwargs( + client=client, + jira_authentication=jira_authentication, + ) + + response = requests.get( + verify=client.verify_ssl, + auth=client.auth, + timeout=client.timeout, + **kwargs, + ) + response.raise_for_status() + + return _build_response(response=response) + + +def sync( + *, + client: AuthenticatedClient, + jira_authentication: str, +) -> Optional[TaskmanApiV1TaskUnassignedRetrieveResponse200]: + """Get a list of tasks without an user assigned""" + + return sync_detailed( + client=client, + jira_authentication=jira_authentication, + ).parsed diff --git a/osidb_bindings/bindings/python_client/models/__init__.py b/osidb_bindings/bindings/python_client/models/__init__.py index 97949d8..bac9fa9 100644 --- a/osidb_bindings/bindings/python_client/models/__init__.py +++ b/osidb_bindings/bindings/python_client/models/__init__.py @@ -5,6 +5,7 @@ from .affect_post import AffectPost from .affect_post_meta_attr import AffectPostMetaAttr from .affect_report_data import AffectReportData +from .affect_type import AffectType from .affectedness_enum import AffectednessEnum from .auth_token_create_response_200 import AuthTokenCreateResponse200 from .auth_token_refresh_create_response_200 import AuthTokenRefreshCreateResponse200 @@ -32,7 +33,6 @@ from .collectors_retrieve_response_200 import CollectorsRetrieveResponse200 from .comment import Comment from .comment_meta_attr import CommentMetaAttr -from .comment_type_enum import CommentTypeEnum from .cv_ev_5_package_versions import CVEv5PackageVersions from .cv_ev_5_versions import CVEv5Versions from .epss import EPSS @@ -88,12 +88,21 @@ from .flaw import Flaw from .flaw_classification import FlawClassification from .flaw_classification_state import FlawClassificationState +from .flaw_comment import FlawComment +from .flaw_comment_post import FlawCommentPost +from .flaw_comment_post_meta_attr import FlawCommentPostMetaAttr +from .flaw_comment_type import FlawCommentType from .flaw_meta_attr import FlawMetaAttr +from .flaw_meta_type import FlawMetaType from .flaw_post import FlawPost from .flaw_post_classification import FlawPostClassification from .flaw_post_classification_state import FlawPostClassificationState from .flaw_post_meta_attr import FlawPostMetaAttr +from .flaw_reference import FlawReference +from .flaw_reference_post import FlawReferencePost +from .flaw_reference_type import FlawReferenceType from .flaw_report_data import FlawReportData +from .flaw_type import FlawType from .impact_enum import ImpactEnum from .jira_comment import JiraComment from .jira_issue import JiraIssue @@ -104,7 +113,6 @@ from .maturity_preliminary_enum import MaturityPreliminaryEnum from .meta import Meta from .meta_meta_attr import MetaMetaAttr -from .meta_type_enum import MetaTypeEnum from .osidb_api_v1_affects_create_response_201 import OsidbApiV1AffectsCreateResponse201 from .osidb_api_v1_affects_destroy_response_204 import ( OsidbApiV1AffectsDestroyResponse204, @@ -123,6 +131,15 @@ OsidbApiV1AffectsRetrieveResponse200, ) from .osidb_api_v1_affects_update_response_200 import OsidbApiV1AffectsUpdateResponse200 +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_list_affects_affectedness import ( OsidbApiV1FlawsListAffectsAffectedness, @@ -140,6 +157,21 @@ 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_type import OsidbApiV1FlawsListType +from .osidb_api_v1_flaws_references_create_response_201 import ( + OsidbApiV1FlawsReferencesCreateResponse201, +) +from .osidb_api_v1_flaws_references_destroy_response_204 import ( + OsidbApiV1FlawsReferencesDestroyResponse204, +) +from .osidb_api_v1_flaws_references_list_response_200 import ( + OsidbApiV1FlawsReferencesListResponse200, +) +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_retrieve_response_200 import OsidbApiV1FlawsRetrieveResponse200 from .osidb_api_v1_flaws_update_response_200 import OsidbApiV1FlawsUpdateResponse200 from .osidb_api_v1_manifest_retrieve_response_200 import ( @@ -203,7 +235,9 @@ from .paginated_affect_list import PaginatedAffectList from .paginated_epss_list import PaginatedEPSSList from .paginated_exploit_only_report_data_list import PaginatedExploitOnlyReportDataList +from .paginated_flaw_comment_list import PaginatedFlawCommentList from .paginated_flaw_list import PaginatedFlawList +from .paginated_flaw_reference_list import PaginatedFlawReferenceList from .paginated_flaw_report_data_list import PaginatedFlawReportDataList from .paginated_supported_products_list import PaginatedSupportedProductsList from .paginated_tracker_list import PaginatedTrackerList @@ -215,7 +249,13 @@ from .taskman_api_v1_group_retrieve_response_200 import ( TaskmanApiV1GroupRetrieveResponse200, ) -from .taskman_api_v1_group_update_response_204 import TaskmanApiV1GroupUpdateResponse204 +from .taskman_api_v1_group_update_response_200 import TaskmanApiV1GroupUpdateResponse200 +from .taskman_api_v1_task_assignee_retrieve_response_200 import ( + TaskmanApiV1TaskAssigneeRetrieveResponse200, +) +from .taskman_api_v1_task_assignee_update_response_200 import ( + TaskmanApiV1TaskAssigneeUpdateResponse200, +) from .taskman_api_v1_task_comment_create_response_200 import ( TaskmanApiV1TaskCommentCreateResponse200, ) @@ -228,16 +268,23 @@ from .taskman_api_v1_task_flaw_retrieve_response_200 import ( TaskmanApiV1TaskFlawRetrieveResponse200, ) -from .taskman_api_v1_task_flaw_update_response_204 import ( - TaskmanApiV1TaskFlawUpdateResponse204, +from .taskman_api_v1_task_flaw_update_response_200 import ( + TaskmanApiV1TaskFlawUpdateResponse200, ) from .taskman_api_v1_task_retrieve_response_200 import ( TaskmanApiV1TaskRetrieveResponse200, ) -from .taskman_api_v1_task_status_update_response_204 import ( - TaskmanApiV1TaskStatusUpdateResponse204, +from .taskman_api_v1_task_status_update_reason import TaskmanApiV1TaskStatusUpdateReason +from .taskman_api_v1_task_status_update_resolution import ( + TaskmanApiV1TaskStatusUpdateResolution, +) +from .taskman_api_v1_task_status_update_response_200 import ( + TaskmanApiV1TaskStatusUpdateResponse200, ) from .taskman_api_v1_task_status_update_status import TaskmanApiV1TaskStatusUpdateStatus +from .taskman_api_v1_task_unassigned_retrieve_response_200 import ( + TaskmanApiV1TaskUnassignedRetrieveResponse200, +) from .taskman_healthy_retrieve_response_200 import TaskmanHealthyRetrieveResponse200 from .token_obtain_pair import TokenObtainPair from .token_refresh import TokenRefresh @@ -245,6 +292,4 @@ from .tracker import Tracker from .tracker_meta_attr import TrackerMetaAttr from .tracker_report_data import TrackerReportData -from .type_0d0_enum import Type0D0Enum -from .type_5b2_enum import Type5B2Enum -from .type_824_enum import Type824Enum +from .tracker_type import TrackerType diff --git a/osidb_bindings/bindings/python_client/models/affect.py b/osidb_bindings/bindings/python_client/models/affect.py index c3f64e0..dade290 100644 --- a/osidb_bindings/bindings/python_client/models/affect.py +++ b/osidb_bindings/bindings/python_client/models/affect.py @@ -6,12 +6,12 @@ from dateutil.parser import isoparse from ..models.affect_meta_attr import AffectMetaAttr +from ..models.affect_type import AffectType from ..models.affectedness_enum import AffectednessEnum from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum from ..models.tracker import Tracker -from ..models.type_5b2_enum import Type5B2Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Affect") @@ -31,7 +31,7 @@ class Affect(OSIDBModel): created_dt: datetime.datetime updated_dt: datetime.datetime flaw: Optional[str] - type: Union[Unset, Type5B2Enum] = UNSET + type: Union[Unset, AffectType] = UNSET affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type5B2Enum(self.type).value + type = AffectType(self.type).value affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): @@ -215,7 +215,7 @@ def to_multipart(self) -> Dict[str, Any]: type: Union[Unset, Tuple[None, str, str]] = UNSET if not isinstance(self.type, Unset): - type = Type5B2Enum(self.type).value + type = AffectType(self.type).value affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): @@ -377,11 +377,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw = d.pop("flaw", UNSET) _type = d.pop("type", UNSET) - type: Union[Unset, Type5B2Enum] + type: Union[Unset, AffectType] if isinstance(_type, Unset): type = UNSET else: - type = Type5B2Enum(_type) + type = AffectType(_type) def _parse_affectedness( data: object, @@ -517,7 +517,7 @@ def get_fields(): "created_dt": datetime.datetime, "updated_dt": datetime.datetime, "flaw": str, - "type": Type5B2Enum, + "type": AffectType, "affectedness": Union[AffectednessEnum, BlankEnum], "resolution": Union[BlankEnum, ResolutionEnum], "impact": Union[BlankEnum, ImpactEnum], diff --git a/osidb_bindings/bindings/python_client/models/affect_post.py b/osidb_bindings/bindings/python_client/models/affect_post.py index 969037b..e0211e2 100644 --- a/osidb_bindings/bindings/python_client/models/affect_post.py +++ b/osidb_bindings/bindings/python_client/models/affect_post.py @@ -6,12 +6,12 @@ from dateutil.parser import isoparse from ..models.affect_post_meta_attr import AffectPostMetaAttr +from ..models.affect_type import AffectType from ..models.affectedness_enum import AffectednessEnum from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum from ..models.tracker import Tracker -from ..models.type_5b2_enum import Type5B2Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="AffectPost") @@ -30,7 +30,7 @@ class AffectPost(OSIDBModel): embargoed: bool created_dt: datetime.datetime flaw: Optional[str] - type: Union[Unset, Type5B2Enum] = UNSET + type: Union[Unset, AffectType] = UNSET affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET @@ -68,7 +68,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type5B2Enum(self.type).value + type = AffectType(self.type).value affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): @@ -204,7 +204,7 @@ def to_multipart(self) -> Dict[str, Any]: type: Union[Unset, Tuple[None, str, str]] = UNSET if not isinstance(self.type, Unset): - type = Type5B2Enum(self.type).value + type = AffectType(self.type).value affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): @@ -357,11 +357,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw = d.pop("flaw", UNSET) _type = d.pop("type", UNSET) - type: Union[Unset, Type5B2Enum] + type: Union[Unset, AffectType] if isinstance(_type, Unset): type = UNSET else: - type = Type5B2Enum(_type) + type = AffectType(_type) def _parse_affectedness( data: object, @@ -495,7 +495,7 @@ def get_fields(): "embargoed": bool, "created_dt": datetime.datetime, "flaw": str, - "type": Type5B2Enum, + "type": AffectType, "affectedness": Union[AffectednessEnum, BlankEnum], "resolution": Union[BlankEnum, ResolutionEnum], "impact": Union[BlankEnum, ImpactEnum], diff --git a/osidb_bindings/bindings/python_client/models/type_5b2_enum.py b/osidb_bindings/bindings/python_client/models/affect_type.py similarity index 78% rename from osidb_bindings/bindings/python_client/models/type_5b2_enum.py rename to osidb_bindings/bindings/python_client/models/affect_type.py index 3dc60cc..89f41eb 100644 --- a/osidb_bindings/bindings/python_client/models/type_5b2_enum.py +++ b/osidb_bindings/bindings/python_client/models/affect_type.py @@ -1,7 +1,7 @@ from enum import Enum -class Type5B2Enum(str, Enum): +class AffectType(str, Enum): DEFAULT = "DEFAULT" def __str__(self) -> str: diff --git a/osidb_bindings/bindings/python_client/models/comment.py b/osidb_bindings/bindings/python_client/models/comment.py index c1d4716..0fd0289 100644 --- a/osidb_bindings/bindings/python_client/models/comment.py +++ b/osidb_bindings/bindings/python_client/models/comment.py @@ -5,7 +5,7 @@ from dateutil.parser import isoparse from ..models.comment_meta_attr import CommentMetaAttr -from ..models.comment_type_enum import CommentTypeEnum +from ..models.flaw_comment_type import FlawCommentType from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Comment") @@ -13,20 +13,19 @@ @attr.s(auto_attribs=True) class Comment(OSIDBModel): - """FlawComment serializer""" + """FlawComment serializer for use by FlawSerializer""" uuid: str - external_system_id: str created_dt: datetime.datetime updated_dt: datetime.datetime - type: Union[Unset, CommentTypeEnum] = UNSET + type: Union[Unset, FlawCommentType] = UNSET + external_system_id: Union[Unset, str] = UNSET order: Union[Unset, None, int] = UNSET meta_attr: Union[Unset, CommentMetaAttr] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: uuid = self.uuid - external_system_id = self.external_system_id created_dt: str = UNSET if not isinstance(self.created_dt, Unset): created_dt = self.created_dt.isoformat() @@ -38,8 +37,9 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = CommentTypeEnum(self.type).value + type = FlawCommentType(self.type).value + external_system_id = self.external_system_id order = self.order meta_attr: Union[Unset, Dict[str, Any]] = UNSET if not isinstance(self.meta_attr, Unset): @@ -49,14 +49,14 @@ def to_dict(self) -> Dict[str, Any]: field_dict.update(self.additional_properties) if uuid is not UNSET: field_dict["uuid"] = uuid - if external_system_id is not UNSET: - field_dict["external_system_id"] = external_system_id if created_dt is not UNSET: field_dict["created_dt"] = created_dt if updated_dt is not UNSET: field_dict["updated_dt"] = updated_dt 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 order is not UNSET: field_dict["order"] = order if meta_attr is not UNSET: @@ -69,8 +69,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() uuid = d.pop("uuid", UNSET) - external_system_id = d.pop("external_system_id", UNSET) - _created_dt = d.pop("created_dt", UNSET) created_dt: datetime.datetime if isinstance(_created_dt, Unset): @@ -86,11 +84,13 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: updated_dt = isoparse(_updated_dt) _type = d.pop("type", UNSET) - type: Union[Unset, CommentTypeEnum] + type: Union[Unset, FlawCommentType] if isinstance(_type, Unset): type = UNSET else: - type = CommentTypeEnum(_type) + type = FlawCommentType(_type) + + external_system_id = d.pop("external_system_id", UNSET) order = d.pop("order", UNSET) @@ -103,10 +103,10 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: comment = cls( uuid=uuid, - external_system_id=external_system_id, created_dt=created_dt, updated_dt=updated_dt, type=type, + external_system_id=external_system_id, order=order, meta_attr=meta_attr, ) @@ -118,10 +118,10 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def get_fields(): return { "uuid": str, - "external_system_id": str, "created_dt": datetime.datetime, "updated_dt": datetime.datetime, - "type": CommentTypeEnum, + "type": FlawCommentType, + "external_system_id": str, "order": int, "meta_attr": CommentMetaAttr, } diff --git a/osidb_bindings/bindings/python_client/models/flaw.py b/osidb_bindings/bindings/python_client/models/flaw.py index 1a3e732..825351d 100644 --- a/osidb_bindings/bindings/python_client/models/flaw.py +++ b/osidb_bindings/bindings/python_client/models/flaw.py @@ -11,10 +11,11 @@ from ..models.cv_ev_5_package_versions import CVEv5PackageVersions from ..models.flaw_classification import FlawClassification from ..models.flaw_meta_attr import FlawMetaAttr +from ..models.flaw_reference import FlawReference +from ..models.flaw_type import FlawType from ..models.impact_enum import ImpactEnum from ..models.meta import Meta from ..models.source_666_enum import Source666Enum -from ..models.type_824_enum import Type824Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Flaw") @@ -35,11 +36,12 @@ class Flaw(OSIDBModel): comments: List[Comment] meta_attr: FlawMetaAttr package_versions: List[CVEv5PackageVersions] + references: List[FlawReference] embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime classification: FlawClassification - type: Union[Unset, Type824Enum] = UNSET + type: Union[Unset, FlawType] = UNSET cve_id: Union[Unset, None, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET component: Union[Unset, str] = UNSET @@ -113,6 +115,16 @@ def to_dict(self) -> Dict[str, Any]: package_versions.append(package_versions_item) + 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 + if not isinstance(references_item_data, Unset): + references_item = references_item_data.to_dict() + + references.append(references_item) + embargoed = self.embargoed created_dt: str = UNSET if not isinstance(self.created_dt, Unset): @@ -129,7 +141,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type824Enum(self.type).value + type = FlawType(self.type).value cve_id = self.cve_id impact: Union[Unset, str] @@ -207,6 +219,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["meta_attr"] = meta_attr if package_versions is not UNSET: field_dict["package_versions"] = package_versions + if references is not UNSET: + field_dict["references"] = references if embargoed is not UNSET: field_dict["embargoed"] = embargoed if created_dt is not UNSET: @@ -329,6 +343,17 @@ def to_multipart(self) -> Dict[str, Any]: "application/json", ) + references: Union[Unset, Tuple[None, str, str]] = UNSET + if not isinstance(self.references, Unset): + _temp_references = [] + for references_item_data in self.references: + 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") + embargoed = ( self.embargoed if self.embargoed is UNSET @@ -353,7 +378,7 @@ def to_multipart(self) -> Dict[str, Any]: type: Union[Unset, Tuple[None, str, str]] = UNSET if not isinstance(self.type, Unset): - type = Type824Enum(self.type).value + type = FlawType(self.type).value cve_id = ( self.cve_id @@ -484,6 +509,8 @@ def to_multipart(self) -> Dict[str, Any]: field_dict["meta_attr"] = meta_attr if package_versions is not UNSET: field_dict["package_versions"] = package_versions + if references is not UNSET: + field_dict["references"] = references if embargoed is not UNSET: field_dict["embargoed"] = embargoed if created_dt is not UNSET: @@ -615,6 +642,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: package_versions.append(package_versions_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) + + references.append(references_item) + embargoed = d.pop("embargoed", UNSET) _created_dt = d.pop("created_dt", UNSET) @@ -639,11 +681,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: classification = FlawClassification.from_dict(_classification) _type = d.pop("type", UNSET) - type: Union[Unset, Type824Enum] + type: Union[Unset, FlawType] if isinstance(_type, Unset): type = UNSET else: - type = Type824Enum(_type) + type = FlawType(_type) cve_id = d.pop("cve_id", UNSET) @@ -759,6 +801,7 @@ def _parse_source(data: object) -> Union[BlankEnum, Source666Enum, Unset]: comments=comments, meta_attr=meta_attr, package_versions=package_versions, + references=references, embargoed=embargoed, created_dt=created_dt, updated_dt=updated_dt, @@ -800,11 +843,12 @@ def get_fields(): "comments": List[Comment], "meta_attr": FlawMetaAttr, "package_versions": List[CVEv5PackageVersions], + "references": List[FlawReference], "embargoed": bool, "created_dt": datetime.datetime, "updated_dt": datetime.datetime, "classification": FlawClassification, - "type": Type824Enum, + "type": FlawType, "cve_id": str, "impact": Union[BlankEnum, ImpactEnum], "component": str, diff --git a/osidb_bindings/bindings/python_client/models/flaw_comment.py b/osidb_bindings/bindings/python_client/models/flaw_comment.py new file mode 100644 index 0000000..30595d0 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/flaw_comment.py @@ -0,0 +1,151 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_comment_type import FlawCommentType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="FlawComment") + + +@attr.s(auto_attribs=True) +class FlawComment(OSIDBModel): + """FlawComment serializer for use by flaw_comments endpoint""" + + flaw: str + text: str + uuid: str + external_system_id: str + created_dt: datetime.datetime + updated_dt: datetime.datetime + embargoed: bool + type: Union[Unset, FlawCommentType] = UNSET + order: Union[Unset, None, int] = UNSET + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + flaw = self.flaw + text = self.text + uuid = self.uuid + external_system_id = self.external_system_id + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + updated_dt: str = UNSET + if not isinstance(self.updated_dt, Unset): + updated_dt = self.updated_dt.isoformat() + + embargoed = self.embargoed + type: Union[Unset, str] = UNSET + if not isinstance(self.type, Unset): + + type = FlawCommentType(self.type).value + + order = self.order + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if text is not UNSET: + field_dict["text"] = text + if uuid is not UNSET: + field_dict["uuid"] = uuid + if external_system_id is not UNSET: + field_dict["external_system_id"] = external_system_id + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if updated_dt is not UNSET: + field_dict["updated_dt"] = updated_dt + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if type is not UNSET: + field_dict["type"] = type + if order is not UNSET: + field_dict["order"] = order + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + flaw = d.pop("flaw", UNSET) + + text = d.pop("text", UNSET) + + uuid = d.pop("uuid", UNSET) + + external_system_id = d.pop("external_system_id", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + _updated_dt = d.pop("updated_dt", UNSET) + updated_dt: datetime.datetime + if isinstance(_updated_dt, Unset): + updated_dt = UNSET + else: + updated_dt = isoparse(_updated_dt) + + embargoed = d.pop("embargoed", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawCommentType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawCommentType(_type) + + order = d.pop("order", UNSET) + + flaw_comment = cls( + flaw=flaw, + text=text, + uuid=uuid, + external_system_id=external_system_id, + created_dt=created_dt, + updated_dt=updated_dt, + embargoed=embargoed, + type=type, + order=order, + ) + + flaw_comment.additional_properties = d + return flaw_comment + + @staticmethod + def get_fields(): + return { + "flaw": str, + "text": str, + "uuid": str, + "external_system_id": str, + "created_dt": datetime.datetime, + "updated_dt": datetime.datetime, + "embargoed": bool, + "type": FlawCommentType, + "order": int, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/flaw_comment_post.py b/osidb_bindings/bindings/python_client/models/flaw_comment_post.py new file mode 100644 index 0000000..4fa11c8 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/flaw_comment_post.py @@ -0,0 +1,171 @@ +import datetime +import json +from typing import Any, Dict, List, Tuple, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_comment_post_meta_attr import FlawCommentPostMetaAttr +from ..models.flaw_comment_type import FlawCommentType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="FlawCommentPost") + + +@attr.s(auto_attribs=True) +class FlawCommentPost(OSIDBModel): + """FlawComment serializer for use by flaw_comments endpoint""" + + text: str + uuid: str + created_dt: datetime.datetime + embargoed: bool + type: Union[Unset, FlawCommentType] = UNSET + meta_attr: Union[Unset, FlawCommentPostMetaAttr] = UNSET + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + text = self.text + uuid = self.uuid + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + embargoed = self.embargoed + type: Union[Unset, str] = UNSET + if not isinstance(self.type, Unset): + + type = FlawCommentType(self.type).value + + meta_attr: Union[Unset, Dict[str, Any]] = UNSET + if not isinstance(self.meta_attr, Unset): + meta_attr = self.meta_attr.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + if text is not UNSET: + field_dict["text"] = text + if uuid is not UNSET: + field_dict["uuid"] = uuid + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if type is not UNSET: + field_dict["type"] = type + if meta_attr is not UNSET: + field_dict["meta_attr"] = meta_attr + + 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") + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + embargoed = ( + self.embargoed + if self.embargoed is UNSET + else (None, str(self.embargoed), "text/plain") + ) + type: Union[Unset, Tuple[None, str, str]] = UNSET + if not isinstance(self.type, Unset): + + type = FlawCommentType(self.type).value + + meta_attr: Union[Unset, Tuple[None, str, str]] = UNSET + if not isinstance(self.meta_attr, Unset): + meta_attr = (None, json.dumps(self.meta_attr.to_dict()), "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 text is not UNSET: + field_dict["text"] = text + if uuid is not UNSET: + field_dict["uuid"] = uuid + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if type is not UNSET: + field_dict["type"] = type + if meta_attr is not UNSET: + field_dict["meta_attr"] = meta_attr + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + text = d.pop("text", UNSET) + + uuid = d.pop("uuid", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + embargoed = d.pop("embargoed", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawCommentType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawCommentType(_type) + + _meta_attr = d.pop("meta_attr", UNSET) + meta_attr: Union[Unset, FlawCommentPostMetaAttr] + if isinstance(_meta_attr, Unset): + meta_attr = UNSET + else: + meta_attr = FlawCommentPostMetaAttr.from_dict(_meta_attr) + + flaw_comment_post = cls( + text=text, + uuid=uuid, + created_dt=created_dt, + embargoed=embargoed, + type=type, + meta_attr=meta_attr, + ) + + flaw_comment_post.additional_properties = d + return flaw_comment_post + + @staticmethod + def get_fields(): + return { + "text": str, + "uuid": str, + "created_dt": datetime.datetime, + "embargoed": bool, + "type": FlawCommentType, + "meta_attr": FlawCommentPostMetaAttr, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/flaw_comment_post_meta_attr.py b/osidb_bindings/bindings/python_client/models/flaw_comment_post_meta_attr.py new file mode 100644 index 0000000..9782165 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/flaw_comment_post_meta_attr.py @@ -0,0 +1,49 @@ +from typing import Any, Dict, List, Optional, Type, TypeVar + +import attr + +from ..types import OSIDBModel + +T = TypeVar("T", bound="FlawCommentPostMetaAttr") + + +@attr.s(auto_attribs=True) +class FlawCommentPostMetaAttr(OSIDBModel): + """ """ + + additional_properties: Dict[str, Optional[str]] = attr.ib(init=False, factory=dict) + + 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: + d = src_dict.copy() + flaw_comment_post_meta_attr = cls() + + flaw_comment_post_meta_attr.additional_properties = d + return flaw_comment_post_meta_attr + + @staticmethod + def get_fields(): + return {} + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Optional[str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Optional[str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/comment_type_enum.py b/osidb_bindings/bindings/python_client/models/flaw_comment_type.py similarity index 76% rename from osidb_bindings/bindings/python_client/models/comment_type_enum.py rename to osidb_bindings/bindings/python_client/models/flaw_comment_type.py index 9b64585..967605e 100644 --- a/osidb_bindings/bindings/python_client/models/comment_type_enum.py +++ b/osidb_bindings/bindings/python_client/models/flaw_comment_type.py @@ -1,7 +1,7 @@ from enum import Enum -class CommentTypeEnum(str, Enum): +class FlawCommentType(str, Enum): BUGZILLA = "BUGZILLA" def __str__(self) -> str: diff --git a/osidb_bindings/bindings/python_client/models/meta_type_enum.py b/osidb_bindings/bindings/python_client/models/flaw_meta_type.py similarity index 93% rename from osidb_bindings/bindings/python_client/models/meta_type_enum.py rename to osidb_bindings/bindings/python_client/models/flaw_meta_type.py index 6476ffc..870db37 100644 --- a/osidb_bindings/bindings/python_client/models/meta_type_enum.py +++ b/osidb_bindings/bindings/python_client/models/flaw_meta_type.py @@ -1,7 +1,7 @@ from enum import Enum -class MetaTypeEnum(str, Enum): +class FlawMetaType(str, Enum): ERRATA = "ERRATA" REFERENCE = "REFERENCE" ACKNOWLEDGMENT = "ACKNOWLEDGMENT" diff --git a/osidb_bindings/bindings/python_client/models/flaw_post.py b/osidb_bindings/bindings/python_client/models/flaw_post.py index 8f16550..59d50db 100644 --- a/osidb_bindings/bindings/python_client/models/flaw_post.py +++ b/osidb_bindings/bindings/python_client/models/flaw_post.py @@ -11,10 +11,11 @@ from ..models.cv_ev_5_package_versions import CVEv5PackageVersions from ..models.flaw_post_classification import FlawPostClassification from ..models.flaw_post_meta_attr import FlawPostMetaAttr +from ..models.flaw_reference import FlawReference +from ..models.flaw_type import FlawType from ..models.impact_enum import ImpactEnum from ..models.meta import Meta from ..models.source_666_enum import Source666Enum -from ..models.type_824_enum import Type824Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="FlawPost") @@ -35,10 +36,11 @@ class FlawPost(OSIDBModel): comments: List[Comment] meta_attr: FlawPostMetaAttr package_versions: List[CVEv5PackageVersions] + references: List[FlawReference] embargoed: bool created_dt: datetime.datetime classification: FlawPostClassification - type: Union[Unset, Type824Enum] = UNSET + type: Union[Unset, FlawType] = UNSET cve_id: Union[Unset, None, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET component: Union[Unset, str] = UNSET @@ -112,6 +114,16 @@ def to_dict(self) -> Dict[str, Any]: package_versions.append(package_versions_item) + 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 + if not isinstance(references_item_data, Unset): + references_item = references_item_data.to_dict() + + references.append(references_item) + embargoed = self.embargoed created_dt: str = UNSET if not isinstance(self.created_dt, Unset): @@ -124,7 +136,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type824Enum(self.type).value + type = FlawType(self.type).value cve_id = self.cve_id impact: Union[Unset, str] @@ -202,6 +214,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["meta_attr"] = meta_attr if package_versions is not UNSET: field_dict["package_versions"] = package_versions + if references is not UNSET: + field_dict["references"] = references if embargoed is not UNSET: field_dict["embargoed"] = embargoed if created_dt is not UNSET: @@ -322,6 +336,17 @@ def to_multipart(self) -> Dict[str, Any]: "application/json", ) + references: Union[Unset, Tuple[None, str, str]] = UNSET + if not isinstance(self.references, Unset): + _temp_references = [] + for references_item_data in self.references: + 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") + embargoed = ( self.embargoed if self.embargoed is UNSET @@ -342,7 +367,7 @@ def to_multipart(self) -> Dict[str, Any]: type: Union[Unset, Tuple[None, str, str]] = UNSET if not isinstance(self.type, Unset): - type = Type824Enum(self.type).value + type = FlawType(self.type).value cve_id = ( self.cve_id @@ -473,6 +498,8 @@ def to_multipart(self) -> Dict[str, Any]: field_dict["meta_attr"] = meta_attr if package_versions is not UNSET: field_dict["package_versions"] = package_versions + if references is not UNSET: + field_dict["references"] = references if embargoed is not UNSET: field_dict["embargoed"] = embargoed if created_dt is not UNSET: @@ -602,6 +629,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: package_versions.append(package_versions_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) + + references.append(references_item) + embargoed = d.pop("embargoed", UNSET) _created_dt = d.pop("created_dt", UNSET) @@ -619,11 +661,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: classification = FlawPostClassification.from_dict(_classification) _type = d.pop("type", UNSET) - type: Union[Unset, Type824Enum] + type: Union[Unset, FlawType] if isinstance(_type, Unset): type = UNSET else: - type = Type824Enum(_type) + type = FlawType(_type) cve_id = d.pop("cve_id", UNSET) @@ -739,6 +781,7 @@ def _parse_source(data: object) -> Union[BlankEnum, Source666Enum, Unset]: comments=comments, meta_attr=meta_attr, package_versions=package_versions, + references=references, embargoed=embargoed, created_dt=created_dt, classification=classification, @@ -779,10 +822,11 @@ def get_fields(): "comments": List[Comment], "meta_attr": FlawPostMetaAttr, "package_versions": List[CVEv5PackageVersions], + "references": List[FlawReference], "embargoed": bool, "created_dt": datetime.datetime, "classification": FlawPostClassification, - "type": Type824Enum, + "type": FlawType, "cve_id": str, "impact": Union[BlankEnum, ImpactEnum], "component": str, diff --git a/osidb_bindings/bindings/python_client/models/flaw_reference.py b/osidb_bindings/bindings/python_client/models/flaw_reference.py new file mode 100644 index 0000000..2883bce --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/flaw_reference.py @@ -0,0 +1,195 @@ +import datetime +from typing import Any, Dict, List, Tuple, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_reference_type import FlawReferenceType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="FlawReference") + + +@attr.s(auto_attribs=True) +class FlawReference(OSIDBModel): + """FlawReference serializer""" + + flaw: str + url: str + uuid: str + embargoed: bool + 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) + + def to_dict(self) -> Dict[str, Any]: + flaw = self.flaw + url = self.url + uuid = self.uuid + embargoed = self.embargoed + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + updated_dt: str = UNSET + if not isinstance(self.updated_dt, Unset): + 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 + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if url is not UNSET: + field_dict["url"] = url + if uuid is not UNSET: + field_dict["uuid"] = uuid + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if updated_dt is not UNSET: + field_dict["updated_dt"] = updated_dt + if description is not UNSET: + field_dict["description"] = description + if type is not UNSET: + field_dict["type"] = type + + return field_dict + + def to_multipart(self) -> Dict[str, Any]: + flaw = self.flaw if self.flaw is UNSET else (None, str(self.flaw), "text/plain") + 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") + ) + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + updated_dt: str = UNSET + if not isinstance(self.updated_dt, Unset): + updated_dt = self.updated_dt.isoformat() + + description = ( + self.description + if self.description is UNSET + else (None, str(self.description), "text/plain") + ) + type: Union[Unset, Tuple[None, str, str]] = UNSET + if not isinstance(self.type, Unset): + + type = FlawReferenceType(self.type).value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + key: (None, str(value), "text/plain") + for key, value in self.additional_properties.items() + } + ) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if url is not UNSET: + field_dict["url"] = url + if uuid is not UNSET: + field_dict["uuid"] = uuid + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if updated_dt is not UNSET: + field_dict["updated_dt"] = updated_dt + if description is not UNSET: + field_dict["description"] = description + 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: + d = src_dict.copy() + flaw = d.pop("flaw", UNSET) + + url = d.pop("url", UNSET) + + uuid = d.pop("uuid", UNSET) + + embargoed = d.pop("embargoed", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + _updated_dt = d.pop("updated_dt", UNSET) + updated_dt: datetime.datetime + if isinstance(_updated_dt, Unset): + updated_dt = UNSET + else: + updated_dt = isoparse(_updated_dt) + + description = d.pop("description", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawReferenceType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawReferenceType(_type) + + flaw_reference = cls( + flaw=flaw, + url=url, + uuid=uuid, + embargoed=embargoed, + created_dt=created_dt, + updated_dt=updated_dt, + description=description, + type=type, + ) + + flaw_reference.additional_properties = d + return flaw_reference + + @staticmethod + def get_fields(): + return { + "flaw": str, + "url": str, + "uuid": str, + "embargoed": bool, + "created_dt": datetime.datetime, + "updated_dt": datetime.datetime, + "description": str, + "type": FlawReferenceType, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/flaw_reference_post.py b/osidb_bindings/bindings/python_client/models/flaw_reference_post.py new file mode 100644 index 0000000..afe7e71 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/flaw_reference_post.py @@ -0,0 +1,173 @@ +import datetime +from typing import Any, Dict, List, Tuple, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_reference_type import FlawReferenceType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="FlawReferencePost") + + +@attr.s(auto_attribs=True) +class FlawReferencePost(OSIDBModel): + """FlawReference serializer""" + + flaw: str + url: str + uuid: str + embargoed: bool + 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) + + def to_dict(self) -> Dict[str, Any]: + flaw = self.flaw + url = self.url + uuid = self.uuid + embargoed = self.embargoed + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + 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 + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if url is not UNSET: + field_dict["url"] = url + if uuid is not UNSET: + field_dict["uuid"] = uuid + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if description is not UNSET: + field_dict["description"] = description + if type is not UNSET: + field_dict["type"] = type + + return field_dict + + def to_multipart(self) -> Dict[str, Any]: + flaw = self.flaw if self.flaw is UNSET else (None, str(self.flaw), "text/plain") + 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") + ) + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + description = ( + self.description + if self.description is UNSET + else (None, str(self.description), "text/plain") + ) + type: Union[Unset, Tuple[None, str, str]] = UNSET + if not isinstance(self.type, Unset): + + type = FlawReferenceType(self.type).value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + key: (None, str(value), "text/plain") + for key, value in self.additional_properties.items() + } + ) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if url is not UNSET: + field_dict["url"] = url + if uuid is not UNSET: + field_dict["uuid"] = uuid + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if description is not UNSET: + field_dict["description"] = description + 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: + d = src_dict.copy() + flaw = d.pop("flaw", UNSET) + + url = d.pop("url", UNSET) + + uuid = d.pop("uuid", UNSET) + + embargoed = d.pop("embargoed", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + description = d.pop("description", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawReferenceType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawReferenceType(_type) + + flaw_reference_post = cls( + flaw=flaw, + url=url, + uuid=uuid, + embargoed=embargoed, + created_dt=created_dt, + description=description, + type=type, + ) + + flaw_reference_post.additional_properties = d + return flaw_reference_post + + @staticmethod + def get_fields(): + return { + "flaw": str, + "url": str, + "uuid": str, + "embargoed": bool, + "created_dt": datetime.datetime, + "description": str, + "type": FlawReferenceType, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/flaw_reference_type.py b/osidb_bindings/bindings/python_client/models/flaw_reference_type.py new file mode 100644 index 0000000..29d851a --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/flaw_reference_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class FlawReferenceType(str, Enum): + ARTICLE = "ARTICLE" + EXTERNAL = "EXTERNAL" + + def __str__(self) -> str: + return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/type_824_enum.py b/osidb_bindings/bindings/python_client/models/flaw_type.py similarity index 83% rename from osidb_bindings/bindings/python_client/models/type_824_enum.py rename to osidb_bindings/bindings/python_client/models/flaw_type.py index a294d5c..9c007f5 100644 --- a/osidb_bindings/bindings/python_client/models/type_824_enum.py +++ b/osidb_bindings/bindings/python_client/models/flaw_type.py @@ -1,7 +1,7 @@ from enum import Enum -class Type824Enum(str, Enum): +class FlawType(str, Enum): VULNERABILITY = "VULNERABILITY" WEAKNESS = "WEAKNESS" diff --git a/osidb_bindings/bindings/python_client/models/jira_issue_fields.py b/osidb_bindings/bindings/python_client/models/jira_issue_fields.py index d6a215a..2d46c25 100644 --- a/osidb_bindings/bindings/python_client/models/jira_issue_fields.py +++ b/osidb_bindings/bindings/python_client/models/jira_issue_fields.py @@ -17,6 +17,8 @@ class JiraIssueFields(OSIDBModel): summary: str description: str assignee: JiraUser + reporter: JiraUser + creator: JiraUser customfield_12311140: str additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -31,6 +33,14 @@ def to_dict(self) -> Dict[str, Any]: if not isinstance(self.assignee, Unset): assignee = self.assignee.to_dict() + reporter: Dict[str, Any] = UNSET + if not isinstance(self.reporter, Unset): + reporter = self.reporter.to_dict() + + creator: Dict[str, Any] = UNSET + if not isinstance(self.creator, Unset): + creator = self.creator.to_dict() + customfield_12311140 = self.customfield_12311140 field_dict: Dict[str, Any] = {} @@ -43,6 +53,10 @@ def to_dict(self) -> Dict[str, Any]: field_dict["description"] = description if assignee is not UNSET: field_dict["assignee"] = assignee + if reporter is not UNSET: + field_dict["reporter"] = reporter + if creator is not UNSET: + field_dict["creator"] = creator if customfield_12311140 is not UNSET: field_dict["customfield_12311140"] = customfield_12311140 @@ -69,6 +83,20 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: else: assignee = JiraUser.from_dict(_assignee) + _reporter = d.pop("reporter", UNSET) + reporter: JiraUser + if isinstance(_reporter, Unset): + reporter = UNSET + else: + reporter = JiraUser.from_dict(_reporter) + + _creator = d.pop("creator", UNSET) + creator: JiraUser + if isinstance(_creator, Unset): + creator = UNSET + else: + creator = JiraUser.from_dict(_creator) + customfield_12311140 = d.pop("customfield_12311140", UNSET) jira_issue_fields = cls( @@ -76,6 +104,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: summary=summary, description=description, assignee=assignee, + reporter=reporter, + creator=creator, customfield_12311140=customfield_12311140, ) @@ -89,6 +119,8 @@ def get_fields(): "summary": str, "description": str, "assignee": JiraUser, + "reporter": JiraUser, + "creator": JiraUser, "customfield_12311140": str, } diff --git a/osidb_bindings/bindings/python_client/models/meta.py b/osidb_bindings/bindings/python_client/models/meta.py index 22de096..031766e 100644 --- a/osidb_bindings/bindings/python_client/models/meta.py +++ b/osidb_bindings/bindings/python_client/models/meta.py @@ -4,8 +4,8 @@ import attr from dateutil.parser import isoparse +from ..models.flaw_meta_type import FlawMetaType from ..models.meta_meta_attr import MetaMetaAttr -from ..models.meta_type_enum import MetaTypeEnum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Meta") @@ -16,7 +16,7 @@ class Meta(OSIDBModel): """FlawMeta serializer""" uuid: str - type: MetaTypeEnum + type: FlawMetaType embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime @@ -28,7 +28,7 @@ def to_dict(self) -> Dict[str, Any]: type: str = UNSET if not isinstance(self.type, Unset): - type = MetaTypeEnum(self.type).value + type = FlawMetaType(self.type).value embargoed = self.embargoed created_dt: str = UNSET @@ -66,11 +66,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: uuid = d.pop("uuid", UNSET) _type = d.pop("type", UNSET) - type: MetaTypeEnum + type: FlawMetaType if isinstance(_type, Unset): type = UNSET else: - type = MetaTypeEnum(_type) + type = FlawMetaType(_type) embargoed = d.pop("embargoed", UNSET) @@ -111,7 +111,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def get_fields(): return { "uuid": str, - "type": MetaTypeEnum, + "type": FlawMetaType, "embargoed": bool, "created_dt": datetime.datetime, "updated_dt": datetime.datetime, 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 1da58ad..2b10ca7 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 @@ -5,12 +5,12 @@ from dateutil.parser import isoparse from ..models.affect_meta_attr import AffectMetaAttr +from ..models.affect_type import AffectType from ..models.affectedness_enum import AffectednessEnum from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum from ..models.tracker import Tracker -from ..models.type_5b2_enum import Type5B2Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsCreateResponse201") @@ -30,7 +30,7 @@ class OsidbApiV1AffectsCreateResponse201(OSIDBModel): created_dt: datetime.datetime updated_dt: datetime.datetime flaw: Optional[str] - type: Union[Unset, Type5B2Enum] = UNSET + type: Union[Unset, AffectType] = UNSET affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type5B2Enum(self.type).value + type = AffectType(self.type).value affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): @@ -236,11 +236,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw = d.pop("flaw", UNSET) _type = d.pop("type", UNSET) - type: Union[Unset, Type5B2Enum] + type: Union[Unset, AffectType] if isinstance(_type, Unset): type = UNSET else: - type = Type5B2Enum(_type) + type = AffectType(_type) def _parse_affectedness( data: object, @@ -393,7 +393,7 @@ def get_fields(): "created_dt": datetime.datetime, "updated_dt": datetime.datetime, "flaw": str, - "type": Type5B2Enum, + "type": AffectType, "affectedness": Union[AffectednessEnum, BlankEnum], "resolution": Union[BlankEnum, ResolutionEnum], "impact": Union[BlankEnum, ImpactEnum], 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 c45e0d9..04fde95 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 @@ -5,12 +5,12 @@ from dateutil.parser import isoparse from ..models.affect_meta_attr import AffectMetaAttr +from ..models.affect_type import AffectType from ..models.affectedness_enum import AffectednessEnum from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum from ..models.tracker import Tracker -from ..models.type_5b2_enum import Type5B2Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsRetrieveResponse200") @@ -30,7 +30,7 @@ class OsidbApiV1AffectsRetrieveResponse200(OSIDBModel): created_dt: datetime.datetime updated_dt: datetime.datetime flaw: Optional[str] - type: Union[Unset, Type5B2Enum] = UNSET + type: Union[Unset, AffectType] = UNSET affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type5B2Enum(self.type).value + type = AffectType(self.type).value affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): @@ -236,11 +236,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw = d.pop("flaw", UNSET) _type = d.pop("type", UNSET) - type: Union[Unset, Type5B2Enum] + type: Union[Unset, AffectType] if isinstance(_type, Unset): type = UNSET else: - type = Type5B2Enum(_type) + type = AffectType(_type) def _parse_affectedness( data: object, @@ -393,7 +393,7 @@ def get_fields(): "created_dt": datetime.datetime, "updated_dt": datetime.datetime, "flaw": str, - "type": Type5B2Enum, + "type": AffectType, "affectedness": Union[AffectednessEnum, BlankEnum], "resolution": Union[BlankEnum, ResolutionEnum], "impact": Union[BlankEnum, ImpactEnum], 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 28b2263..0ca9d93 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 @@ -5,12 +5,12 @@ from dateutil.parser import isoparse from ..models.affect_meta_attr import AffectMetaAttr +from ..models.affect_type import AffectType from ..models.affectedness_enum import AffectednessEnum from ..models.blank_enum import BlankEnum from ..models.impact_enum import ImpactEnum from ..models.resolution_enum import ResolutionEnum from ..models.tracker import Tracker -from ..models.type_5b2_enum import Type5B2Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1AffectsUpdateResponse200") @@ -30,7 +30,7 @@ class OsidbApiV1AffectsUpdateResponse200(OSIDBModel): created_dt: datetime.datetime updated_dt: datetime.datetime flaw: Optional[str] - type: Union[Unset, Type5B2Enum] = UNSET + type: Union[Unset, AffectType] = UNSET affectedness: Union[AffectednessEnum, BlankEnum, Unset] = UNSET resolution: Union[BlankEnum, ResolutionEnum, Unset] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type5B2Enum(self.type).value + type = AffectType(self.type).value affectedness: Union[Unset, str] if isinstance(self.affectedness, Unset): @@ -236,11 +236,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: flaw = d.pop("flaw", UNSET) _type = d.pop("type", UNSET) - type: Union[Unset, Type5B2Enum] + type: Union[Unset, AffectType] if isinstance(_type, Unset): type = UNSET else: - type = Type5B2Enum(_type) + type = AffectType(_type) def _parse_affectedness( data: object, @@ -393,7 +393,7 @@ def get_fields(): "created_dt": datetime.datetime, "updated_dt": datetime.datetime, "flaw": str, - "type": Type5B2Enum, + "type": AffectType, "affectedness": Union[AffectednessEnum, BlankEnum], "resolution": Union[BlankEnum, ResolutionEnum], "impact": Union[BlankEnum, ImpactEnum], 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 new file mode 100644 index 0000000..36a936e --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_create_response_201.py @@ -0,0 +1,191 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_comment_type import FlawCommentType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="OsidbApiV1FlawsCommentsCreateResponse201") + + +@attr.s(auto_attribs=True) +class OsidbApiV1FlawsCommentsCreateResponse201(OSIDBModel): + """ """ + + flaw: str + text: str + uuid: str + external_system_id: str + created_dt: datetime.datetime + updated_dt: datetime.datetime + embargoed: bool + type: Union[Unset, FlawCommentType] = UNSET + order: Union[Unset, None, int] = 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) + + def to_dict(self) -> Dict[str, Any]: + flaw = self.flaw + text = self.text + uuid = self.uuid + external_system_id = self.external_system_id + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + updated_dt: str = UNSET + if not isinstance(self.updated_dt, Unset): + updated_dt = self.updated_dt.isoformat() + + embargoed = self.embargoed + type: Union[Unset, str] = UNSET + if not isinstance(self.type, Unset): + + type = FlawCommentType(self.type).value + + order = self.order + 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.update(self.additional_properties) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if text is not UNSET: + field_dict["text"] = text + if uuid is not UNSET: + field_dict["uuid"] = uuid + if external_system_id is not UNSET: + field_dict["external_system_id"] = external_system_id + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if updated_dt is not UNSET: + field_dict["updated_dt"] = updated_dt + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if type is not UNSET: + field_dict["type"] = type + if order is not UNSET: + field_dict["order"] = order + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + flaw = d.pop("flaw", UNSET) + + text = d.pop("text", UNSET) + + uuid = d.pop("uuid", UNSET) + + external_system_id = d.pop("external_system_id", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + _updated_dt = d.pop("updated_dt", UNSET) + updated_dt: datetime.datetime + if isinstance(_updated_dt, Unset): + updated_dt = UNSET + else: + updated_dt = isoparse(_updated_dt) + + embargoed = d.pop("embargoed", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawCommentType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawCommentType(_type) + + order = d.pop("order", UNSET) + + _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_flaws_comments_create_response_201 = cls( + flaw=flaw, + text=text, + uuid=uuid, + external_system_id=external_system_id, + created_dt=created_dt, + updated_dt=updated_dt, + embargoed=embargoed, + type=type, + order=order, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + 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, + "created_dt": datetime.datetime, + "updated_dt": datetime.datetime, + "embargoed": bool, + "type": FlawCommentType, + "order": int, + "dt": datetime.datetime, + "env": str, + "revision": str, + "version": str, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties 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 new file mode 100644 index 0000000..12421f9 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_list_response_200.py @@ -0,0 +1,148 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_comment import FlawComment +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="OsidbApiV1FlawsCommentsListResponse200") + + +@attr.s(auto_attribs=True) +class OsidbApiV1FlawsCommentsListResponse200(OSIDBModel): + """ """ + + count: Union[Unset, int] = UNSET + next_: Union[Unset, None, str] = UNSET + previous: Union[Unset, None, str] = UNSET + results: Union[Unset, List[FlawComment]] = 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) + + def to_dict(self) -> Dict[str, Any]: + count = self.count + next_ = self.next_ + previous = self.previous + results: Union[Unset, 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 + if not isinstance(results_item_data, Unset): + results_item = results_item_data.to_dict() + + results.append(results_item) + + 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.update(self.additional_properties) + if count is not UNSET: + field_dict["count"] = count + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + if results is not UNSET: + field_dict["results"] = results + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + count = d.pop("count", UNSET) + + next_ = d.pop("next", UNSET) + + previous = d.pop("previous", 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) + + _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_flaws_comments_list_response_200 = cls( + count=count, + next_=next_, + previous=previous, + results=results, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + 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, + "next": str, + "previous": str, + "results": List[FlawComment], + "dt": datetime.datetime, + "env": str, + "revision": str, + "version": str, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties 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 new file mode 100644 index 0000000..15e4ce5 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_comments_retrieve_response_200.py @@ -0,0 +1,191 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_comment_type import FlawCommentType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="OsidbApiV1FlawsCommentsRetrieveResponse200") + + +@attr.s(auto_attribs=True) +class OsidbApiV1FlawsCommentsRetrieveResponse200(OSIDBModel): + """ """ + + flaw: str + text: str + uuid: str + external_system_id: str + created_dt: datetime.datetime + updated_dt: datetime.datetime + embargoed: bool + type: Union[Unset, FlawCommentType] = UNSET + order: Union[Unset, None, int] = 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) + + def to_dict(self) -> Dict[str, Any]: + flaw = self.flaw + text = self.text + uuid = self.uuid + external_system_id = self.external_system_id + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + updated_dt: str = UNSET + if not isinstance(self.updated_dt, Unset): + updated_dt = self.updated_dt.isoformat() + + embargoed = self.embargoed + type: Union[Unset, str] = UNSET + if not isinstance(self.type, Unset): + + type = FlawCommentType(self.type).value + + order = self.order + 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.update(self.additional_properties) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if text is not UNSET: + field_dict["text"] = text + if uuid is not UNSET: + field_dict["uuid"] = uuid + if external_system_id is not UNSET: + field_dict["external_system_id"] = external_system_id + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if updated_dt is not UNSET: + field_dict["updated_dt"] = updated_dt + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if type is not UNSET: + field_dict["type"] = type + if order is not UNSET: + field_dict["order"] = order + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + flaw = d.pop("flaw", UNSET) + + text = d.pop("text", UNSET) + + uuid = d.pop("uuid", UNSET) + + external_system_id = d.pop("external_system_id", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + _updated_dt = d.pop("updated_dt", UNSET) + updated_dt: datetime.datetime + if isinstance(_updated_dt, Unset): + updated_dt = UNSET + else: + updated_dt = isoparse(_updated_dt) + + embargoed = d.pop("embargoed", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawCommentType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawCommentType(_type) + + order = d.pop("order", UNSET) + + _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_flaws_comments_retrieve_response_200 = cls( + flaw=flaw, + text=text, + uuid=uuid, + external_system_id=external_system_id, + created_dt=created_dt, + updated_dt=updated_dt, + embargoed=embargoed, + type=type, + order=order, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + 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, + "created_dt": datetime.datetime, + "updated_dt": datetime.datetime, + "embargoed": bool, + "type": FlawCommentType, + "order": int, + "dt": datetime.datetime, + "env": str, + "revision": str, + "version": str, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties 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 8f75609..3e64264 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 @@ -10,10 +10,11 @@ from ..models.cv_ev_5_package_versions import CVEv5PackageVersions from ..models.flaw_classification import FlawClassification from ..models.flaw_meta_attr import FlawMetaAttr +from ..models.flaw_reference import FlawReference +from ..models.flaw_type import FlawType from ..models.impact_enum import ImpactEnum from ..models.meta import Meta from ..models.source_666_enum import Source666Enum -from ..models.type_824_enum import Type824Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsCreateResponse201") @@ -34,11 +35,12 @@ class OsidbApiV1FlawsCreateResponse201(OSIDBModel): comments: List[Comment] meta_attr: FlawMetaAttr package_versions: List[CVEv5PackageVersions] + references: List[FlawReference] embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime classification: FlawClassification - type: Union[Unset, Type824Enum] = UNSET + type: Union[Unset, FlawType] = UNSET cve_id: Union[Unset, None, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET component: Union[Unset, str] = UNSET @@ -116,6 +118,16 @@ def to_dict(self) -> Dict[str, Any]: package_versions.append(package_versions_item) + 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 + if not isinstance(references_item_data, Unset): + references_item = references_item_data.to_dict() + + references.append(references_item) + embargoed = self.embargoed created_dt: str = UNSET if not isinstance(self.created_dt, Unset): @@ -132,7 +144,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type824Enum(self.type).value + type = FlawType(self.type).value cve_id = self.cve_id impact: Union[Unset, str] @@ -217,6 +229,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["meta_attr"] = meta_attr if package_versions is not UNSET: field_dict["package_versions"] = package_versions + if references is not UNSET: + field_dict["references"] = references if embargoed is not UNSET: field_dict["embargoed"] = embargoed if created_dt is not UNSET: @@ -356,6 +370,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: package_versions.append(package_versions_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) + + references.append(references_item) + embargoed = d.pop("embargoed", UNSET) _created_dt = d.pop("created_dt", UNSET) @@ -380,11 +409,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: classification = FlawClassification.from_dict(_classification) _type = d.pop("type", UNSET) - type: Union[Unset, Type824Enum] + type: Union[Unset, FlawType] if isinstance(_type, Unset): type = UNSET else: - type = Type824Enum(_type) + type = FlawType(_type) cve_id = d.pop("cve_id", UNSET) @@ -513,6 +542,7 @@ def _parse_source(data: object) -> Union[BlankEnum, Source666Enum, Unset]: comments=comments, meta_attr=meta_attr, package_versions=package_versions, + references=references, embargoed=embargoed, created_dt=created_dt, updated_dt=updated_dt, @@ -558,11 +588,12 @@ def get_fields(): "comments": List[Comment], "meta_attr": FlawMetaAttr, "package_versions": List[CVEv5PackageVersions], + "references": List[FlawReference], "embargoed": bool, "created_dt": datetime.datetime, "updated_dt": datetime.datetime, "classification": FlawClassification, - "type": Type824Enum, + "type": FlawType, "cve_id": str, "impact": Union[BlankEnum, ImpactEnum], "component": str, 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 f67718f..edd5b97 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 @@ -13,34 +13,35 @@ class OsidbApiV1FlawsListOrderItem(str, Enum): VALUE_8 = "-affects__ps_module" VALUE_9 = "-affects__resolution" VALUE_10 = "-affects__trackers__created_dt" - VALUE_11 = "-affects__trackers__external_system_id" - VALUE_12 = "-affects__trackers__ps_update_stream" - VALUE_13 = "-affects__trackers__resolution" - VALUE_14 = "-affects__trackers__status" - VALUE_15 = "-affects__trackers__type" - VALUE_16 = "-affects__trackers__updated_dt" - VALUE_17 = "-affects__trackers__uuid" - VALUE_18 = "-affects__type" - VALUE_19 = "-affects__updated_dt" - VALUE_20 = "-affects__uuid" - VALUE_21 = "-component" - VALUE_22 = "-created_dt" - VALUE_23 = "-cve_id" - VALUE_24 = "-cvss2" - VALUE_25 = "-cvss2_score" - VALUE_26 = "-cvss3" - VALUE_27 = "-cvss3_score" - VALUE_28 = "-cwe_id" - VALUE_29 = "-impact" - VALUE_30 = "-is_major_incident" - VALUE_31 = "-nvd_cvss2" - VALUE_32 = "-nvd_cvss3" - VALUE_33 = "-reported_dt" - VALUE_34 = "-source" - VALUE_35 = "-type" - VALUE_36 = "-unembargo_dt" - VALUE_37 = "-updated_dt" - VALUE_38 = "-uuid" + VALUE_11 = "-affects__trackers__errata__advisory_name" + VALUE_12 = "-affects__trackers__external_system_id" + VALUE_13 = "-affects__trackers__ps_update_stream" + VALUE_14 = "-affects__trackers__resolution" + VALUE_15 = "-affects__trackers__status" + VALUE_16 = "-affects__trackers__type" + VALUE_17 = "-affects__trackers__updated_dt" + VALUE_18 = "-affects__trackers__uuid" + VALUE_19 = "-affects__type" + VALUE_20 = "-affects__updated_dt" + VALUE_21 = "-affects__uuid" + VALUE_22 = "-component" + VALUE_23 = "-created_dt" + VALUE_24 = "-cve_id" + VALUE_25 = "-cvss2" + VALUE_26 = "-cvss2_score" + VALUE_27 = "-cvss3" + VALUE_28 = "-cvss3_score" + VALUE_29 = "-cwe_id" + VALUE_30 = "-impact" + VALUE_31 = "-is_major_incident" + VALUE_32 = "-nvd_cvss2" + VALUE_33 = "-nvd_cvss3" + VALUE_34 = "-reported_dt" + VALUE_35 = "-source" + VALUE_36 = "-type" + VALUE_37 = "-unembargo_dt" + VALUE_38 = "-updated_dt" + VALUE_39 = "-uuid" AFFECTS_AFFECTEDNESS = "affects__affectedness" AFFECTS_CREATED_DT = "affects__created_dt" AFFECTS_CVSS2 = "affects__cvss2" @@ -52,6 +53,7 @@ class OsidbApiV1FlawsListOrderItem(str, Enum): AFFECTS_PS_MODULE = "affects__ps_module" AFFECTS_RESOLUTION = "affects__resolution" AFFECTS_TRACKERS_CREATED_DT = "affects__trackers__created_dt" + AFFECTS_TRACKERS_ERRATA_ADVISORY_NAME = "affects__trackers__errata__advisory_name" 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" 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 new file mode 100644 index 0000000..9364383 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_create_response_201.py @@ -0,0 +1,183 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_reference_type import FlawReferenceType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="OsidbApiV1FlawsReferencesCreateResponse201") + + +@attr.s(auto_attribs=True) +class OsidbApiV1FlawsReferencesCreateResponse201(OSIDBModel): + """ """ + + flaw: str + url: str + uuid: str + embargoed: bool + created_dt: datetime.datetime + updated_dt: datetime.datetime + description: Union[Unset, str] = 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) + + def to_dict(self) -> Dict[str, Any]: + flaw = self.flaw + url = self.url + uuid = self.uuid + embargoed = self.embargoed + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + updated_dt: str = UNSET + if not isinstance(self.updated_dt, Unset): + 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 + + 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.update(self.additional_properties) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if url is not UNSET: + field_dict["url"] = url + if uuid is not UNSET: + field_dict["uuid"] = uuid + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if updated_dt is not UNSET: + field_dict["updated_dt"] = updated_dt + if description is not UNSET: + field_dict["description"] = description + if type is not UNSET: + field_dict["type"] = type + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + flaw = d.pop("flaw", UNSET) + + url = d.pop("url", UNSET) + + uuid = d.pop("uuid", UNSET) + + embargoed = d.pop("embargoed", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + _updated_dt = d.pop("updated_dt", UNSET) + updated_dt: datetime.datetime + if isinstance(_updated_dt, Unset): + updated_dt = UNSET + else: + updated_dt = isoparse(_updated_dt) + + description = d.pop("description", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawReferenceType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawReferenceType(_type) + + _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_flaws_references_create_response_201 = cls( + flaw=flaw, + url=url, + uuid=uuid, + embargoed=embargoed, + created_dt=created_dt, + updated_dt=updated_dt, + description=description, + type=type, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + 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, + "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]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_destroy_response_204.py b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_destroy_response_204.py new file mode 100644 index 0000000..9ba7958 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_destroy_response_204.py @@ -0,0 +1,93 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="OsidbApiV1FlawsReferencesDestroyResponse204") + + +@attr.s(auto_attribs=True) +class OsidbApiV1FlawsReferencesDestroyResponse204(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() + + env = self.env + revision = self.revision + version = self.version + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + 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_flaws_references_destroy_response_204 = cls( + dt=dt, + env=env, + revision=revision, + version=version, + ) + + osidb_api_v1_flaws_references_destroy_response_204.additional_properties = d + return osidb_api_v1_flaws_references_destroy_response_204 + + @staticmethod + def get_fields(): + return { + "dt": datetime.datetime, + "env": str, + "revision": str, + "version": str, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties 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 new file mode 100644 index 0000000..99b4402 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_list_response_200.py @@ -0,0 +1,148 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_reference import FlawReference +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="OsidbApiV1FlawsReferencesListResponse200") + + +@attr.s(auto_attribs=True) +class OsidbApiV1FlawsReferencesListResponse200(OSIDBModel): + """ """ + + count: Union[Unset, int] = UNSET + next_: Union[Unset, None, str] = UNSET + previous: Union[Unset, None, str] = UNSET + results: Union[Unset, List[FlawReference]] = 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) + + def to_dict(self) -> Dict[str, Any]: + count = self.count + next_ = self.next_ + previous = self.previous + results: Union[Unset, 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 + if not isinstance(results_item_data, Unset): + results_item = results_item_data.to_dict() + + results.append(results_item) + + 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.update(self.additional_properties) + if count is not UNSET: + field_dict["count"] = count + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + if results is not UNSET: + field_dict["results"] = results + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + count = d.pop("count", UNSET) + + next_ = d.pop("next", UNSET) + + previous = d.pop("previous", 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) + + _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_flaws_references_list_response_200 = cls( + count=count, + next_=next_, + previous=previous, + results=results, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + 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, + "next": str, + "previous": str, + "results": List[FlawReference], + "dt": datetime.datetime, + "env": str, + "revision": str, + "version": str, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties 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 new file mode 100644 index 0000000..e7ce003 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_retrieve_response_200.py @@ -0,0 +1,183 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_reference_type import FlawReferenceType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="OsidbApiV1FlawsReferencesRetrieveResponse200") + + +@attr.s(auto_attribs=True) +class OsidbApiV1FlawsReferencesRetrieveResponse200(OSIDBModel): + """ """ + + flaw: str + url: str + uuid: str + embargoed: bool + created_dt: datetime.datetime + updated_dt: datetime.datetime + description: Union[Unset, str] = 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) + + def to_dict(self) -> Dict[str, Any]: + flaw = self.flaw + url = self.url + uuid = self.uuid + embargoed = self.embargoed + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + updated_dt: str = UNSET + if not isinstance(self.updated_dt, Unset): + 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 + + 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.update(self.additional_properties) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if url is not UNSET: + field_dict["url"] = url + if uuid is not UNSET: + field_dict["uuid"] = uuid + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if updated_dt is not UNSET: + field_dict["updated_dt"] = updated_dt + if description is not UNSET: + field_dict["description"] = description + if type is not UNSET: + field_dict["type"] = type + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + flaw = d.pop("flaw", UNSET) + + url = d.pop("url", UNSET) + + uuid = d.pop("uuid", UNSET) + + embargoed = d.pop("embargoed", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + _updated_dt = d.pop("updated_dt", UNSET) + updated_dt: datetime.datetime + if isinstance(_updated_dt, Unset): + updated_dt = UNSET + else: + updated_dt = isoparse(_updated_dt) + + description = d.pop("description", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawReferenceType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawReferenceType(_type) + + _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_flaws_references_retrieve_response_200 = cls( + flaw=flaw, + url=url, + uuid=uuid, + embargoed=embargoed, + created_dt=created_dt, + updated_dt=updated_dt, + description=description, + type=type, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + 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, + "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]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties 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 new file mode 100644 index 0000000..c2663e6 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/osidb_api_v1_flaws_references_update_response_200.py @@ -0,0 +1,183 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.flaw_reference_type import FlawReferenceType +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="OsidbApiV1FlawsReferencesUpdateResponse200") + + +@attr.s(auto_attribs=True) +class OsidbApiV1FlawsReferencesUpdateResponse200(OSIDBModel): + """ """ + + flaw: str + url: str + uuid: str + embargoed: bool + created_dt: datetime.datetime + updated_dt: datetime.datetime + description: Union[Unset, str] = 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) + + def to_dict(self) -> Dict[str, Any]: + flaw = self.flaw + url = self.url + uuid = self.uuid + embargoed = self.embargoed + created_dt: str = UNSET + if not isinstance(self.created_dt, Unset): + created_dt = self.created_dt.isoformat() + + updated_dt: str = UNSET + if not isinstance(self.updated_dt, Unset): + 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 + + 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.update(self.additional_properties) + if flaw is not UNSET: + field_dict["flaw"] = flaw + if url is not UNSET: + field_dict["url"] = url + if uuid is not UNSET: + field_dict["uuid"] = uuid + if embargoed is not UNSET: + field_dict["embargoed"] = embargoed + if created_dt is not UNSET: + field_dict["created_dt"] = created_dt + if updated_dt is not UNSET: + field_dict["updated_dt"] = updated_dt + if description is not UNSET: + field_dict["description"] = description + if type is not UNSET: + field_dict["type"] = type + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + flaw = d.pop("flaw", UNSET) + + url = d.pop("url", UNSET) + + uuid = d.pop("uuid", UNSET) + + embargoed = d.pop("embargoed", UNSET) + + _created_dt = d.pop("created_dt", UNSET) + created_dt: datetime.datetime + if isinstance(_created_dt, Unset): + created_dt = UNSET + else: + created_dt = isoparse(_created_dt) + + _updated_dt = d.pop("updated_dt", UNSET) + updated_dt: datetime.datetime + if isinstance(_updated_dt, Unset): + updated_dt = UNSET + else: + updated_dt = isoparse(_updated_dt) + + description = d.pop("description", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, FlawReferenceType] + if isinstance(_type, Unset): + type = UNSET + else: + type = FlawReferenceType(_type) + + _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_flaws_references_update_response_200 = cls( + flaw=flaw, + url=url, + uuid=uuid, + embargoed=embargoed, + created_dt=created_dt, + updated_dt=updated_dt, + description=description, + type=type, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + 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, + "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]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties 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 773582c..09054c7 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 @@ -10,10 +10,11 @@ from ..models.cv_ev_5_package_versions import CVEv5PackageVersions from ..models.flaw_classification import FlawClassification from ..models.flaw_meta_attr import FlawMetaAttr +from ..models.flaw_reference import FlawReference +from ..models.flaw_type import FlawType from ..models.impact_enum import ImpactEnum from ..models.meta import Meta from ..models.source_666_enum import Source666Enum -from ..models.type_824_enum import Type824Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsRetrieveResponse200") @@ -34,11 +35,12 @@ class OsidbApiV1FlawsRetrieveResponse200(OSIDBModel): comments: List[Comment] meta_attr: FlawMetaAttr package_versions: List[CVEv5PackageVersions] + references: List[FlawReference] embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime classification: FlawClassification - type: Union[Unset, Type824Enum] = UNSET + type: Union[Unset, FlawType] = UNSET cve_id: Union[Unset, None, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET component: Union[Unset, str] = UNSET @@ -116,6 +118,16 @@ def to_dict(self) -> Dict[str, Any]: package_versions.append(package_versions_item) + 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 + if not isinstance(references_item_data, Unset): + references_item = references_item_data.to_dict() + + references.append(references_item) + embargoed = self.embargoed created_dt: str = UNSET if not isinstance(self.created_dt, Unset): @@ -132,7 +144,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type824Enum(self.type).value + type = FlawType(self.type).value cve_id = self.cve_id impact: Union[Unset, str] @@ -217,6 +229,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["meta_attr"] = meta_attr if package_versions is not UNSET: field_dict["package_versions"] = package_versions + if references is not UNSET: + field_dict["references"] = references if embargoed is not UNSET: field_dict["embargoed"] = embargoed if created_dt is not UNSET: @@ -356,6 +370,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: package_versions.append(package_versions_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) + + references.append(references_item) + embargoed = d.pop("embargoed", UNSET) _created_dt = d.pop("created_dt", UNSET) @@ -380,11 +409,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: classification = FlawClassification.from_dict(_classification) _type = d.pop("type", UNSET) - type: Union[Unset, Type824Enum] + type: Union[Unset, FlawType] if isinstance(_type, Unset): type = UNSET else: - type = Type824Enum(_type) + type = FlawType(_type) cve_id = d.pop("cve_id", UNSET) @@ -513,6 +542,7 @@ def _parse_source(data: object) -> Union[BlankEnum, Source666Enum, Unset]: comments=comments, meta_attr=meta_attr, package_versions=package_versions, + references=references, embargoed=embargoed, created_dt=created_dt, updated_dt=updated_dt, @@ -558,11 +588,12 @@ def get_fields(): "comments": List[Comment], "meta_attr": FlawMetaAttr, "package_versions": List[CVEv5PackageVersions], + "references": List[FlawReference], "embargoed": bool, "created_dt": datetime.datetime, "updated_dt": datetime.datetime, "classification": FlawClassification, - "type": Type824Enum, + "type": FlawType, "cve_id": str, "impact": Union[BlankEnum, ImpactEnum], "component": str, 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 0f7d70e..38ab7e0 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 @@ -10,10 +10,11 @@ from ..models.cv_ev_5_package_versions import CVEv5PackageVersions from ..models.flaw_classification import FlawClassification from ..models.flaw_meta_attr import FlawMetaAttr +from ..models.flaw_reference import FlawReference +from ..models.flaw_type import FlawType from ..models.impact_enum import ImpactEnum from ..models.meta import Meta from ..models.source_666_enum import Source666Enum -from ..models.type_824_enum import Type824Enum from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1FlawsUpdateResponse200") @@ -34,11 +35,12 @@ class OsidbApiV1FlawsUpdateResponse200(OSIDBModel): comments: List[Comment] meta_attr: FlawMetaAttr package_versions: List[CVEv5PackageVersions] + references: List[FlawReference] embargoed: bool created_dt: datetime.datetime updated_dt: datetime.datetime classification: FlawClassification - type: Union[Unset, Type824Enum] = UNSET + type: Union[Unset, FlawType] = UNSET cve_id: Union[Unset, None, str] = UNSET impact: Union[BlankEnum, ImpactEnum, Unset] = UNSET component: Union[Unset, str] = UNSET @@ -116,6 +118,16 @@ def to_dict(self) -> Dict[str, Any]: package_versions.append(package_versions_item) + 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 + if not isinstance(references_item_data, Unset): + references_item = references_item_data.to_dict() + + references.append(references_item) + embargoed = self.embargoed created_dt: str = UNSET if not isinstance(self.created_dt, Unset): @@ -132,7 +144,7 @@ def to_dict(self) -> Dict[str, Any]: type: Union[Unset, str] = UNSET if not isinstance(self.type, Unset): - type = Type824Enum(self.type).value + type = FlawType(self.type).value cve_id = self.cve_id impact: Union[Unset, str] @@ -217,6 +229,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["meta_attr"] = meta_attr if package_versions is not UNSET: field_dict["package_versions"] = package_versions + if references is not UNSET: + field_dict["references"] = references if embargoed is not UNSET: field_dict["embargoed"] = embargoed if created_dt is not UNSET: @@ -356,6 +370,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: package_versions.append(package_versions_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) + + references.append(references_item) + embargoed = d.pop("embargoed", UNSET) _created_dt = d.pop("created_dt", UNSET) @@ -380,11 +409,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: classification = FlawClassification.from_dict(_classification) _type = d.pop("type", UNSET) - type: Union[Unset, Type824Enum] + type: Union[Unset, FlawType] if isinstance(_type, Unset): type = UNSET else: - type = Type824Enum(_type) + type = FlawType(_type) cve_id = d.pop("cve_id", UNSET) @@ -513,6 +542,7 @@ def _parse_source(data: object) -> Union[BlankEnum, Source666Enum, Unset]: comments=comments, meta_attr=meta_attr, package_versions=package_versions, + references=references, embargoed=embargoed, created_dt=created_dt, updated_dt=updated_dt, @@ -558,11 +588,12 @@ def get_fields(): "comments": List[Comment], "meta_attr": FlawMetaAttr, "package_versions": List[CVEv5PackageVersions], + "references": List[FlawReference], "embargoed": bool, "created_dt": datetime.datetime, "updated_dt": datetime.datetime, "classification": FlawClassification, - "type": Type824Enum, + "type": FlawType, "cve_id": str, "impact": Union[BlankEnum, ImpactEnum], "component": str, 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 2675caf..349603c 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 @@ -6,7 +6,7 @@ from ..models.erratum import Erratum from ..models.tracker_meta_attr import TrackerMetaAttr -from ..models.type_0d0_enum import Type0D0Enum +from ..models.tracker_type import TrackerType from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="OsidbApiV1TrackersRetrieveResponse200") @@ -17,7 +17,7 @@ class OsidbApiV1TrackersRetrieveResponse200(OSIDBModel): """ """ uuid: str - type: Type0D0Enum + type: TrackerType external_system_id: str status: str errata: List[Erratum] @@ -37,7 +37,7 @@ def to_dict(self) -> Dict[str, Any]: type: str = UNSET if not isinstance(self.type, Unset): - type = Type0D0Enum(self.type).value + type = TrackerType(self.type).value external_system_id = self.external_system_id status = self.status @@ -115,11 +115,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: uuid = d.pop("uuid", UNSET) _type = d.pop("type", UNSET) - type: Type0D0Enum + type: TrackerType if isinstance(_type, Unset): type = UNSET else: - type = Type0D0Enum(_type) + type = TrackerType(_type) external_system_id = d.pop("external_system_id", UNSET) @@ -202,7 +202,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def get_fields(): return { "uuid": str, - "type": Type0D0Enum, + "type": TrackerType, "external_system_id": str, "status": str, "errata": List[Erratum], 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 new file mode 100644 index 0000000..1d21038 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_comment_list.py @@ -0,0 +1,105 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.flaw_comment import FlawComment +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="PaginatedFlawCommentList") + + +@attr.s(auto_attribs=True) +class PaginatedFlawCommentList(OSIDBModel): + """ """ + + count: Union[Unset, int] = UNSET + next_: Union[Unset, None, str] = UNSET + previous: Union[Unset, None, str] = UNSET + results: Union[Unset, List[FlawComment]] = UNSET + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + count = self.count + next_ = self.next_ + previous = self.previous + results: Union[Unset, 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 + 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.update(self.additional_properties) + if count is not UNSET: + field_dict["count"] = count + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + 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: + d = src_dict.copy() + count = d.pop("count", UNSET) + + next_ = d.pop("next", UNSET) + + previous = d.pop("previous", 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) + + paginated_flaw_comment_list = cls( + count=count, + next_=next_, + previous=previous, + results=results, + ) + + paginated_flaw_comment_list.additional_properties = d + return paginated_flaw_comment_list + + @staticmethod + def get_fields(): + return { + "count": int, + "next": str, + "previous": str, + "results": List[FlawComment], + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties 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 new file mode 100644 index 0000000..70241bd --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/paginated_flaw_reference_list.py @@ -0,0 +1,105 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from ..models.flaw_reference import FlawReference +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="PaginatedFlawReferenceList") + + +@attr.s(auto_attribs=True) +class PaginatedFlawReferenceList(OSIDBModel): + """ """ + + count: Union[Unset, int] = UNSET + next_: Union[Unset, None, str] = UNSET + previous: Union[Unset, None, str] = UNSET + results: Union[Unset, List[FlawReference]] = UNSET + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + count = self.count + next_ = self.next_ + previous = self.previous + results: Union[Unset, 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 + 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.update(self.additional_properties) + if count is not UNSET: + field_dict["count"] = count + if next_ is not UNSET: + field_dict["next"] = next_ + if previous is not UNSET: + field_dict["previous"] = previous + 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: + d = src_dict.copy() + count = d.pop("count", UNSET) + + next_ = d.pop("next", UNSET) + + previous = d.pop("previous", 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) + + paginated_flaw_reference_list = cls( + count=count, + next_=next_, + previous=previous, + results=results, + ) + + paginated_flaw_reference_list.additional_properties = d + return paginated_flaw_reference_list + + @staticmethod + def get_fields(): + return { + "count": int, + "next": str, + "previous": str, + "results": List[FlawReference], + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/taskman_api_v1_group_update_response_204.py b/osidb_bindings/bindings/python_client/models/taskman_api_v1_group_update_response_200.py similarity index 88% rename from osidb_bindings/bindings/python_client/models/taskman_api_v1_group_update_response_204.py rename to osidb_bindings/bindings/python_client/models/taskman_api_v1_group_update_response_200.py index 5a4880e..056d1bf 100644 --- a/osidb_bindings/bindings/python_client/models/taskman_api_v1_group_update_response_204.py +++ b/osidb_bindings/bindings/python_client/models/taskman_api_v1_group_update_response_200.py @@ -6,11 +6,11 @@ from ..types import UNSET, OSIDBModel, Unset -T = TypeVar("T", bound="TaskmanApiV1GroupUpdateResponse204") +T = TypeVar("T", bound="TaskmanApiV1GroupUpdateResponse200") @attr.s(auto_attribs=True) -class TaskmanApiV1GroupUpdateResponse204(OSIDBModel): +class TaskmanApiV1GroupUpdateResponse200(OSIDBModel): """ """ dt: Union[Unset, datetime.datetime] = UNSET @@ -57,15 +57,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version = d.pop("version", UNSET) - taskman_api_v1_group_update_response_204 = cls( + taskman_api_v1_group_update_response_200 = cls( dt=dt, env=env, revision=revision, version=version, ) - taskman_api_v1_group_update_response_204.additional_properties = d - return taskman_api_v1_group_update_response_204 + taskman_api_v1_group_update_response_200.additional_properties = d + return taskman_api_v1_group_update_response_200 @staticmethod def get_fields(): diff --git a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_assignee_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_assignee_retrieve_response_200.py new file mode 100644 index 0000000..f6ef9dc --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_assignee_retrieve_response_200.py @@ -0,0 +1,132 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.jira_issue import JiraIssue +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="TaskmanApiV1TaskAssigneeRetrieveResponse200") + + +@attr.s(auto_attribs=True) +class TaskmanApiV1TaskAssigneeRetrieveResponse200(OSIDBModel): + """ """ + + total: int + issues: List[JiraIssue] + 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]: + total = self.total + issues: List[Dict[str, Any]] = UNSET + if not isinstance(self.issues, Unset): + issues = [] + for issues_item_data in self.issues: + issues_item: Dict[str, Any] = UNSET + if not isinstance(issues_item_data, Unset): + issues_item = issues_item_data.to_dict() + + issues.append(issues_item) + + 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.update(self.additional_properties) + if total is not UNSET: + field_dict["total"] = total + if issues is not UNSET: + field_dict["issues"] = issues + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + total = d.pop("total", UNSET) + + issues = [] + _issues = d.pop("issues", UNSET) + if _issues is UNSET: + issues = UNSET + else: + for issues_item_data in _issues or []: + _issues_item = issues_item_data + issues_item: JiraIssue + if isinstance(_issues_item, Unset): + issues_item = UNSET + else: + issues_item = JiraIssue.from_dict(_issues_item) + + issues.append(issues_item) + + _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) + + taskman_api_v1_task_assignee_retrieve_response_200 = cls( + total=total, + issues=issues, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + taskman_api_v1_task_assignee_retrieve_response_200.additional_properties = d + return taskman_api_v1_task_assignee_retrieve_response_200 + + @staticmethod + def get_fields(): + return { + "total": int, + "issues": List[JiraIssue], + "dt": datetime.datetime, + "env": str, + "revision": str, + "version": str, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_assignee_update_response_200.py b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_assignee_update_response_200.py new file mode 100644 index 0000000..8009739 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_assignee_update_response_200.py @@ -0,0 +1,93 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="TaskmanApiV1TaskAssigneeUpdateResponse200") + + +@attr.s(auto_attribs=True) +class TaskmanApiV1TaskAssigneeUpdateResponse200(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() + + env = self.env + revision = self.revision + version = self.version + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + 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) + + taskman_api_v1_task_assignee_update_response_200 = cls( + dt=dt, + env=env, + revision=revision, + version=version, + ) + + taskman_api_v1_task_assignee_update_response_200.additional_properties = d + return taskman_api_v1_task_assignee_update_response_200 + + @staticmethod + def get_fields(): + return { + "dt": datetime.datetime, + "env": str, + "revision": str, + "version": str, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_flaw_update_response_204.py b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_flaw_update_response_200.py similarity index 88% rename from osidb_bindings/bindings/python_client/models/taskman_api_v1_task_flaw_update_response_204.py rename to osidb_bindings/bindings/python_client/models/taskman_api_v1_task_flaw_update_response_200.py index cf65cc7..9302764 100644 --- a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_flaw_update_response_204.py +++ b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_flaw_update_response_200.py @@ -6,11 +6,11 @@ from ..types import UNSET, OSIDBModel, Unset -T = TypeVar("T", bound="TaskmanApiV1TaskFlawUpdateResponse204") +T = TypeVar("T", bound="TaskmanApiV1TaskFlawUpdateResponse200") @attr.s(auto_attribs=True) -class TaskmanApiV1TaskFlawUpdateResponse204(OSIDBModel): +class TaskmanApiV1TaskFlawUpdateResponse200(OSIDBModel): """ """ dt: Union[Unset, datetime.datetime] = UNSET @@ -57,15 +57,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version = d.pop("version", UNSET) - taskman_api_v1_task_flaw_update_response_204 = cls( + taskman_api_v1_task_flaw_update_response_200 = cls( dt=dt, env=env, revision=revision, version=version, ) - taskman_api_v1_task_flaw_update_response_204.additional_properties = d - return taskman_api_v1_task_flaw_update_response_204 + taskman_api_v1_task_flaw_update_response_200.additional_properties = d + return taskman_api_v1_task_flaw_update_response_200 @staticmethod def get_fields(): diff --git a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_reason.py b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_reason.py new file mode 100644 index 0000000..06bbaf0 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_reason.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class TaskmanApiV1TaskStatusUpdateReason(str, Enum): + CLOSED = "Closed" + IN_PROGRESS = "In Progress" + NEW = "New" + REFINEMENT = "Refinement" + + def __str__(self) -> str: + return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_resolution.py b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_resolution.py new file mode 100644 index 0000000..ac30397 --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_resolution.py @@ -0,0 +1,17 @@ +from enum import Enum + + +class TaskmanApiV1TaskStatusUpdateResolution(str, Enum): + CANT_DO = "Can't Do" + CANNOT_REPRODUCE = "Cannot Reproduce" + DONE = "Done" + DONE_ERRATA = "Done-Errata" + DUPLICATE = "Duplicate" + MIRRORORPHAN = "MirrorOrphan" + NOT_A_BUG = "Not a Bug" + OBSOLETE = "Obsolete" + TEST_PENDING = "Test Pending" + WONT_DO = "Won't Do" + + def __str__(self) -> str: + return str(self.value) diff --git a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_response_204.py b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_response_200.py similarity index 88% rename from osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_response_204.py rename to osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_response_200.py index 9391bf4..409406b 100644 --- a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_response_204.py +++ b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_status_update_response_200.py @@ -6,11 +6,11 @@ from ..types import UNSET, OSIDBModel, Unset -T = TypeVar("T", bound="TaskmanApiV1TaskStatusUpdateResponse204") +T = TypeVar("T", bound="TaskmanApiV1TaskStatusUpdateResponse200") @attr.s(auto_attribs=True) -class TaskmanApiV1TaskStatusUpdateResponse204(OSIDBModel): +class TaskmanApiV1TaskStatusUpdateResponse200(OSIDBModel): """ """ dt: Union[Unset, datetime.datetime] = UNSET @@ -57,15 +57,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: version = d.pop("version", UNSET) - taskman_api_v1_task_status_update_response_204 = cls( + taskman_api_v1_task_status_update_response_200 = cls( dt=dt, env=env, revision=revision, version=version, ) - taskman_api_v1_task_status_update_response_204.additional_properties = d - return taskman_api_v1_task_status_update_response_204 + taskman_api_v1_task_status_update_response_200.additional_properties = d + return taskman_api_v1_task_status_update_response_200 @staticmethod def get_fields(): diff --git a/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_unassigned_retrieve_response_200.py b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_unassigned_retrieve_response_200.py new file mode 100644 index 0000000..15ac24b --- /dev/null +++ b/osidb_bindings/bindings/python_client/models/taskman_api_v1_task_unassigned_retrieve_response_200.py @@ -0,0 +1,132 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr +from dateutil.parser import isoparse + +from ..models.jira_issue import JiraIssue +from ..types import UNSET, OSIDBModel, Unset + +T = TypeVar("T", bound="TaskmanApiV1TaskUnassignedRetrieveResponse200") + + +@attr.s(auto_attribs=True) +class TaskmanApiV1TaskUnassignedRetrieveResponse200(OSIDBModel): + """ """ + + total: int + issues: List[JiraIssue] + 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]: + total = self.total + issues: List[Dict[str, Any]] = UNSET + if not isinstance(self.issues, Unset): + issues = [] + for issues_item_data in self.issues: + issues_item: Dict[str, Any] = UNSET + if not isinstance(issues_item_data, Unset): + issues_item = issues_item_data.to_dict() + + issues.append(issues_item) + + 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.update(self.additional_properties) + if total is not UNSET: + field_dict["total"] = total + if issues is not UNSET: + field_dict["issues"] = issues + if dt is not UNSET: + field_dict["dt"] = dt + if env is not UNSET: + field_dict["env"] = env + if revision is not UNSET: + field_dict["revision"] = revision + 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: + d = src_dict.copy() + total = d.pop("total", UNSET) + + issues = [] + _issues = d.pop("issues", UNSET) + if _issues is UNSET: + issues = UNSET + else: + for issues_item_data in _issues or []: + _issues_item = issues_item_data + issues_item: JiraIssue + if isinstance(_issues_item, Unset): + issues_item = UNSET + else: + issues_item = JiraIssue.from_dict(_issues_item) + + issues.append(issues_item) + + _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) + + taskman_api_v1_task_unassigned_retrieve_response_200 = cls( + total=total, + issues=issues, + dt=dt, + env=env, + revision=revision, + version=version, + ) + + taskman_api_v1_task_unassigned_retrieve_response_200.additional_properties = d + return taskman_api_v1_task_unassigned_retrieve_response_200 + + @staticmethod + def get_fields(): + return { + "total": int, + "issues": List[JiraIssue], + "dt": datetime.datetime, + "env": str, + "revision": str, + "version": str, + } + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/osidb_bindings/bindings/python_client/models/tracker.py b/osidb_bindings/bindings/python_client/models/tracker.py index d7add84..6b3a61e 100644 --- a/osidb_bindings/bindings/python_client/models/tracker.py +++ b/osidb_bindings/bindings/python_client/models/tracker.py @@ -6,7 +6,7 @@ from ..models.erratum import Erratum from ..models.tracker_meta_attr import TrackerMetaAttr -from ..models.type_0d0_enum import Type0D0Enum +from ..models.tracker_type import TrackerType from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="Tracker") @@ -17,7 +17,7 @@ class Tracker(OSIDBModel): """Tracker serializer""" uuid: str - type: Type0D0Enum + type: TrackerType external_system_id: str status: str errata: List[Erratum] @@ -33,7 +33,7 @@ def to_dict(self) -> Dict[str, Any]: type: str = UNSET if not isinstance(self.type, Unset): - type = Type0D0Enum(self.type).value + type = TrackerType(self.type).value external_system_id = self.external_system_id status = self.status @@ -96,11 +96,11 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: uuid = d.pop("uuid", UNSET) _type = d.pop("type", UNSET) - type: Type0D0Enum + type: TrackerType if isinstance(_type, Unset): type = UNSET else: - type = Type0D0Enum(_type) + type = TrackerType(_type) external_system_id = d.pop("external_system_id", UNSET) @@ -166,7 +166,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: def get_fields(): return { "uuid": str, - "type": Type0D0Enum, + "type": TrackerType, "external_system_id": str, "status": str, "errata": List[Erratum], 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 c5d5e54..af32927 100644 --- a/osidb_bindings/bindings/python_client/models/tracker_report_data.py +++ b/osidb_bindings/bindings/python_client/models/tracker_report_data.py @@ -2,7 +2,7 @@ import attr -from ..models.type_0d0_enum import Type0D0Enum +from ..models.tracker_type import TrackerType from ..types import UNSET, OSIDBModel, Unset T = TypeVar("T", bound="TrackerReportData") @@ -12,7 +12,7 @@ class TrackerReportData(OSIDBModel): """ """ - type: Type0D0Enum + type: TrackerType external_system_id: str status: str resolution: Union[Unset, str] = UNSET @@ -22,7 +22,7 @@ def to_dict(self) -> Dict[str, Any]: type: str = UNSET if not isinstance(self.type, Unset): - type = Type0D0Enum(self.type).value + type = TrackerType(self.type).value external_system_id = self.external_system_id status = self.status @@ -45,11 +45,11 @@ def to_dict(self) -> Dict[str, Any]: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() _type = d.pop("type", UNSET) - type: Type0D0Enum + type: TrackerType if isinstance(_type, Unset): type = UNSET else: - type = Type0D0Enum(_type) + type = TrackerType(_type) external_system_id = d.pop("external_system_id", UNSET) @@ -70,7 +70,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: @staticmethod def get_fields(): return { - "type": Type0D0Enum, + "type": TrackerType, "external_system_id": str, "status": str, "resolution": str, diff --git a/osidb_bindings/bindings/python_client/models/type_0d0_enum.py b/osidb_bindings/bindings/python_client/models/tracker_type.py similarity index 81% rename from osidb_bindings/bindings/python_client/models/type_0d0_enum.py rename to osidb_bindings/bindings/python_client/models/tracker_type.py index b781538..b5c51b6 100644 --- a/osidb_bindings/bindings/python_client/models/type_0d0_enum.py +++ b/osidb_bindings/bindings/python_client/models/tracker_type.py @@ -1,7 +1,7 @@ from enum import Enum -class Type0D0Enum(str, Enum): +class TrackerType(str, Enum): JIRA = "JIRA" BUGZILLA = "BUGZILLA" diff --git a/osidb_bindings/constants.py b/osidb_bindings/constants.py index db08ad5..d9aa028 100644 --- a/osidb_bindings/constants.py +++ b/osidb_bindings/constants.py @@ -1,7 +1,8 @@ -from typing import Dict, List +from typing import List OSIDB_API_VERSION: str = "v1" -OSIDB_BINDINGS_USERAGENT: str = "osidb-bindings-3.1.0" +OSIDB_BINDINGS_VERSION: str = "3.1.0" +OSIDB_BINDINGS_USERAGENT: str = f"osidb-bindings-{OSIDB_BINDINGS_VERSION}" OSIDB_BINDINGS_API_PATH: str = ".bindings.python_client.api.osidb" # all available session operations @@ -13,6 +14,3 @@ "destroy", "search", ) - -# mapping for resources which model names are different from the endpoint name -RESOURCE_TO_MODEL_MAPPING: Dict[str, str] = {} diff --git a/osidb_bindings/openapi_schema.yml b/osidb_bindings/openapi_schema.yml index c5eb2e6..aaddd5e 100644 --- a/osidb_bindings/openapi_schema.yml +++ b/osidb_bindings/openapi_schema.yml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: OSIDB API - version: 3.1.1 + version: 3.2.2 description: REST API autogenerated docs for the OSIDB and its components paths: /auth/token: @@ -1838,6 +1838,10 @@ paths: name: affects__trackers__embargoed schema: type: boolean + - in: query + name: affects__trackers__errata__advisory_name + schema: + type: string - in: query name: affects__trackers__external_system_id schema: @@ -2184,6 +2188,7 @@ paths: - -affects__ps_module - -affects__resolution - -affects__trackers__created_dt + - -affects__trackers__errata__advisory_name - -affects__trackers__external_system_id - -affects__trackers__ps_update_stream - -affects__trackers__resolution @@ -2223,6 +2228,7 @@ paths: - affects__ps_module - affects__resolution - affects__trackers__created_dt + - affects__trackers__errata__advisory_name - affects__trackers__external_system_id - affects__trackers__ps_update_stream - affects__trackers__resolution @@ -2403,71 +2409,517 @@ paths: schema: type: string - in: query - name: tracker_ids + name: tracker_ids + schema: + type: array + items: + type: string + description: Filter only Flaws which are related to specified Trackers (through + Affects). Multiple tracker IDs may be separated by commas. Also only Affects + that have the specified Trackers related will be shown. + - in: query + name: type + schema: + type: string + enum: + - VULNERABILITY + - WEAKNESS + - in: query + name: unembargo_dt + schema: + type: string + format: date-time + - in: query + name: updated_dt + schema: + type: string + format: date-time + - in: query + name: updated_dt__date + schema: + type: string + format: date + - in: query + name: updated_dt__date__gte + schema: + type: string + format: date + - in: query + name: updated_dt__date__lte + schema: + type: string + format: date + - in: query + name: updated_dt__gt + schema: + type: string + format: date-time + - in: query + name: updated_dt__gte + schema: + type: string + format: date-time + - in: query + name: updated_dt__lt + schema: + type: string + format: date-time + - in: query + name: updated_dt__lte + schema: + type: string + format: date-time + - in: query + name: uuid + schema: + type: string + format: uuid + tags: + - osidb + security: + - OsidbTokenAuthentication: [] + - {} + responses: + '200': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PaginatedFlawList' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + post: + operationId: osidb_api_v1_flaws_create + tags: + - osidb + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FlawPost' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/FlawPost' + multipart/form-data: + schema: + $ref: '#/components/schemas/FlawPost' + required: true + security: + - OsidbTokenAuthentication: [] + responses: + '201': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Flaw' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + /osidb/api/v1/flaws/{flaw_id}/comments: + get: + operationId: osidb_api_v1_flaws_comments_list + description: 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. + parameters: + - in: query + name: exclude_fields + schema: + type: array + items: + type: string + description: 'Exclude specified fields from the response. Multiple values + may be separated by commas. Dot notation can be used to filter on related + model fields. Example: `exclude_fields=field,related_model_field.field`' + - in: query + name: external_system_id + schema: + type: string + - in: path + name: flaw_id + schema: + type: string + description: A string representing either the internal OSIDB UUID of the Flaw + resource or the CVE number corresponding to a Flaw + required: true + - in: query + name: include_fields + schema: + type: array + items: + type: string + description: 'Include only specified fields in the response. Multiple values + may be separated by commas. Dot notation can be used to filter on related + model fields. Example: `include_fields=field,related_model_field.field`' + - in: query + name: include_meta_attr + schema: + type: array + items: + type: string + description: 'Specify which keys from meta_attr field should be retrieved, + multiple values may be separated by commas. Dot notation can be used to + specify meta_attr keys on related models. Example: `include_meta_attr=key,related_model.key`Use + wildcards eg. `include_meta_attr=*,related_model.*` for retrieving all the + keys from meta_attr. Omit this parameter to not include meta_attr fields + at all. ' + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + - in: query + name: order + schema: + type: integer + description: Retrieve only FlawComment resource with the specified order number. + Regular flaw comments are numbered from 1 up. + - in: query + name: uuid + schema: + type: string + format: uuid + tags: + - osidb + security: + - OsidbTokenAuthentication: [] + - {} + responses: + '200': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PaginatedFlawCommentList' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + post: + operationId: osidb_api_v1_flaws_comments_create + description: 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. + parameters: + - in: path + name: flaw_id + schema: + type: string + description: A string representing either the internal OSIDB UUID of the Flaw + resource or the CVE number corresponding to a Flaw + required: true + tags: + - osidb + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FlawCommentPost' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/FlawCommentPost' + multipart/form-data: + schema: + $ref: '#/components/schemas/FlawCommentPost' + required: true + security: + - OsidbTokenAuthentication: [] + responses: + '201': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/FlawComment' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + /osidb/api/v1/flaws/{flaw_id}/comments/{comment_id}: + get: + operationId: osidb_api_v1_flaws_comments_retrieve + description: 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. + parameters: + - in: path + name: comment_id + schema: + type: string + description: A string representing the internal OSIDB UUID of the FlawComment + resource. + required: true + - in: query + name: exclude_fields + schema: + type: array + items: + type: string + description: 'Exclude specified fields from the response. Multiple values + may be separated by commas. Dot notation can be used to filter on related + model fields. Example: `exclude_fields=field,related_model_field.field`' + - in: path + name: flaw_id + schema: + type: string + description: A string representing either the internal OSIDB UUID of the Flaw + resource or the CVE number corresponding to a Flaw + required: true + - in: query + name: include_fields + schema: + type: array + items: + type: string + description: 'Include only specified fields in the response. Multiple values + may be separated by commas. Dot notation can be used to filter on related + model fields. Example: `include_fields=field,related_model_field.field`' + - in: query + name: include_meta_attr + schema: + type: array + items: + type: string + description: 'Specify which keys from meta_attr field should be retrieved, + multiple values may be separated by commas. Dot notation can be used to + specify meta_attr keys on related models. Example: `include_meta_attr=key,related_model.key`Use + wildcards eg. `include_meta_attr=*,related_model.*` for retrieving all the + keys from meta_attr. Omit this parameter to not include meta_attr fields + at all. ' + tags: + - osidb + security: + - OsidbTokenAuthentication: [] + - {} + responses: + '200': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/FlawComment' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + /osidb/api/v1/flaws/{flaw_id}/references: + get: + operationId: osidb_api_v1_flaws_references_list + parameters: + - in: query + name: exclude_fields + schema: + type: array + items: + type: string + description: 'Exclude specified fields from the response. Multiple values + may be separated by commas. Dot notation can be used to filter on related + model fields. Example: `exclude_fields=field,related_model_field.field`' + - in: path + name: flaw_id + schema: + type: string + format: uuid + required: true + - in: query + name: include_fields + schema: + type: array + items: + type: string + description: 'Include only specified fields in the response. Multiple values + may be separated by commas. Dot notation can be used to filter on related + model fields. Example: `include_fields=field,related_model_field.field`' + - in: query + name: include_meta_attr + schema: + type: array + items: + type: string + description: 'Specify which keys from meta_attr field should be retrieved, + multiple values may be separated by commas. Dot notation can be used to + specify meta_attr keys on related models. Example: `include_meta_attr=key,related_model.key`Use + wildcards eg. `include_meta_attr=*,related_model.*` for retrieving all the + keys from meta_attr. Omit this parameter to not include meta_attr fields + at all. ' + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - osidb + security: + - OsidbTokenAuthentication: [] + - {} + responses: + '200': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PaginatedFlawReferenceList' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + post: + operationId: osidb_api_v1_flaws_references_create + parameters: + - in: path + name: flaw_id + schema: + type: string + format: uuid + required: true + tags: + - osidb + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FlawReferencePost' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/FlawReferencePost' + multipart/form-data: + schema: + $ref: '#/components/schemas/FlawReferencePost' + required: true + security: + - OsidbTokenAuthentication: [] + responses: + '201': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/FlawReference' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + /osidb/api/v1/flaws/{flaw_id}/references/{uuid}: + get: + operationId: osidb_api_v1_flaws_references_retrieve + parameters: + - in: query + name: exclude_fields schema: type: array items: type: string - description: Filter only Flaws which are related to specified Trackers (through - Affects). Multiple tracker IDs may be separated by commas. Also only Affects - that have the specified Trackers related will be shown. - - in: query - name: type - schema: - type: string - enum: - - VULNERABILITY - - WEAKNESS - - in: query - name: unembargo_dt - schema: - type: string - format: date-time - - in: query - name: updated_dt - schema: - type: string - format: date-time - - in: query - name: updated_dt__date - schema: - type: string - format: date - - in: query - name: updated_dt__date__gte - schema: - type: string - format: date - - in: query - name: updated_dt__date__lte - schema: - type: string - format: date - - in: query - name: updated_dt__gt - schema: - type: string - format: date-time - - in: query - name: updated_dt__gte + description: 'Exclude specified fields from the response. Multiple values + may be separated by commas. Dot notation can be used to filter on related + model fields. Example: `exclude_fields=field,related_model_field.field`' + - in: path + name: flaw_id schema: type: string - format: date-time + format: uuid + required: true - in: query - name: updated_dt__lt + name: include_fields schema: - type: string - format: date-time + type: array + items: + type: string + description: 'Include only specified fields in the response. Multiple values + may be separated by commas. Dot notation can be used to filter on related + model fields. Example: `include_fields=field,related_model_field.field`' - in: query - name: updated_dt__lte + name: include_meta_attr schema: - type: string - format: date-time - - in: query + type: array + items: + type: string + description: 'Specify which keys from meta_attr field should be retrieved, + multiple values may be separated by commas. Dot notation can be used to + specify meta_attr keys on related models. Example: `include_meta_attr=key,related_model.key`Use + wildcards eg. `include_meta_attr=*,related_model.*` for retrieving all the + keys from meta_attr. Omit this parameter to not include meta_attr fields + at all. ' + - in: path name: uuid schema: type: string format: uuid + description: A UUID string identifying this flaw reference. + required: true tags: - osidb security: @@ -2479,7 +2931,7 @@ paths: application/json: schema: allOf: - - $ref: '#/components/schemas/PaginatedFlawList' + - $ref: '#/components/schemas/FlawReference' - type: object properties: dt: @@ -2492,31 +2944,45 @@ paths: version: type: string description: '' - post: - operationId: osidb_api_v1_flaws_create + put: + operationId: osidb_api_v1_flaws_references_update + parameters: + - in: path + name: flaw_id + schema: + type: string + format: uuid + required: true + - in: path + name: uuid + schema: + type: string + format: uuid + description: A UUID string identifying this flaw reference. + required: true tags: - osidb requestBody: content: application/json: schema: - $ref: '#/components/schemas/FlawPost' + $ref: '#/components/schemas/FlawReference' application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/FlawPost' + $ref: '#/components/schemas/FlawReference' multipart/form-data: schema: - $ref: '#/components/schemas/FlawPost' + $ref: '#/components/schemas/FlawReference' required: true security: - OsidbTokenAuthentication: [] responses: - '201': + '200': content: application/json: schema: allOf: - - $ref: '#/components/schemas/Flaw' + - $ref: '#/components/schemas/FlawReference' - type: object properties: dt: @@ -2529,6 +2995,43 @@ paths: version: type: string description: '' + delete: + operationId: osidb_api_v1_flaws_references_destroy + parameters: + - in: path + name: flaw_id + schema: + type: string + format: uuid + required: true + - in: path + name: uuid + schema: + type: string + format: uuid + description: A UUID string identifying this flaw reference. + required: true + tags: + - osidb + security: + - OsidbTokenAuthentication: [] + responses: + '204': + content: + application/json: + schema: + type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' /osidb/api/v1/flaws/{id}: get: operationId: osidb_api_v1_flaws_retrieve @@ -4053,7 +4556,7 @@ paths: security: - OsidbTokenAuthentication: [] responses: - '204': + '200': content: application/json: schema: @@ -4212,6 +4715,32 @@ paths: type: string description: User generated token for Jira authentication. required: true + - in: query + name: reason + schema: + type: string + enum: + - Closed + - In Progress + - New + - Refinement + description: Reason of status change. Mandatory for rejecting a task. + - in: query + name: resolution + schema: + type: string + enum: + - Can't Do + - Cannot Reproduce + - Done + - Done-Errata + - Duplicate + - MirrorOrphan + - Not a Bug + - Obsolete + - Test Pending + - Won't Do + description: Resolution of a CLOSED task. - in: query name: status schema: @@ -4232,7 +4761,87 @@ paths: security: - OsidbTokenAuthentication: [] responses: - '204': + '200': + content: + application/json: + schema: + type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + /taskman/api/v1/task/assignee/{user}: + get: + operationId: taskman_api_v1_task_assignee_retrieve + description: Get a list of tasks from a user + parameters: + - in: header + name: JiraAuthentication + schema: + type: string + description: User generated token for Jira authentication. + required: true + - in: path + name: user + schema: + type: string + required: true + tags: + - taskman + security: + - OsidbTokenAuthentication: [] + responses: + '200': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/JiraIssueQueryResult' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' + put: + operationId: taskman_api_v1_task_assignee_update + description: Assign a task to a user + parameters: + - in: header + name: JiraAuthentication + schema: + type: string + description: User generated token for Jira authentication. + required: true + - in: query + name: task_key + schema: + type: string + required: true + - in: path + name: user + schema: + type: string + required: true + tags: + - taskman + security: + - OsidbTokenAuthentication: [] + responses: + '200': content: application/json: schema: @@ -4343,7 +4952,7 @@ paths: security: - OsidbTokenAuthentication: [] responses: - '204': + '200': content: application/json: schema: @@ -4359,6 +4968,40 @@ paths: version: type: string description: '' + /taskman/api/v1/task/unassigned/: + get: + operationId: taskman_api_v1_task_unassigned_retrieve + description: Get a list of tasks without an user assigned + parameters: + - in: header + name: JiraAuthentication + schema: + type: string + description: User generated token for Jira authentication. + required: true + tags: + - taskman + security: + - OsidbTokenAuthentication: [] + responses: + '200': + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/JiraIssueQueryResult' + - type: object + properties: + dt: + type: string + format: date-time + env: + type: string + revision: + type: string + version: + type: string + description: '' /taskman/healthy: get: operationId: taskman_healthy_retrieve @@ -4400,7 +5043,7 @@ components: format: uuid nullable: true type: - $ref: '#/components/schemas/Type5b2Enum' + $ref: '#/components/schemas/AffectType' affectedness: oneOf: - $ref: '#/components/schemas/AffectednessEnum' @@ -4503,7 +5146,7 @@ components: format: uuid nullable: true type: - $ref: '#/components/schemas/Type5b2Enum' + $ref: '#/components/schemas/AffectType' affectedness: oneOf: - $ref: '#/components/schemas/AffectednessEnum' @@ -4611,6 +5254,10 @@ components: required: - ps_component - ps_module + AffectType: + enum: + - DEFAULT + type: string AffectednessEnum: enum: - NEW @@ -4648,14 +5295,14 @@ components: - version Comment: type: object - description: FlawComment serializer + description: FlawComment serializer for use by FlawSerializer properties: uuid: type: string format: uuid readOnly: true type: - $ref: '#/components/schemas/CommentTypeEnum' + $ref: '#/components/schemas/FlawCommentType' external_system_id: type: string maxLength: 100 @@ -4680,13 +5327,8 @@ components: it is used to detect mit-air collisions. required: - created_dt - - external_system_id - updated_dt - uuid - CommentTypeEnum: - enum: - - BUGZILLA - type: string EPSS: type: object properties: @@ -4765,7 +5407,7 @@ components: format: uuid readOnly: true type: - $ref: '#/components/schemas/Type824Enum' + $ref: '#/components/schemas/FlawType' cve_id: type: string nullable: true @@ -4920,6 +5562,11 @@ components: items: $ref: '#/components/schemas/CVEv5PackageVersions' readOnly: true + references: + type: array + items: + $ref: '#/components/schemas/FlawReference' + readOnly: true embargoed: type: boolean description: The embargoed boolean attribute is technically read-only as @@ -4959,12 +5606,107 @@ components: - meta - meta_attr - package_versions + - references - resolution - state - title - trackers - updated_dt - uuid + FlawComment: + type: object + description: FlawComment serializer for use by flaw_comments endpoint + properties: + flaw: + type: string + format: uuid + text: + type: string + uuid: + type: string + format: uuid + readOnly: true + type: + $ref: '#/components/schemas/FlawCommentType' + external_system_id: + type: string + readOnly: true + order: + type: integer + maximum: 2147483647 + minimum: -2147483648 + nullable: true + created_dt: + type: string + format: date-time + readOnly: true + updated_dt: + type: string + format: date-time + description: The updated_dt timestamp attribute is mandatory on update as + it is used to detect mit-air collisions. + embargoed: + type: boolean + description: 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. + required: + - created_dt + - embargoed + - external_system_id + - flaw + - text + - updated_dt + - uuid + FlawCommentPost: + type: object + description: FlawComment serializer for use by flaw_comments endpoint + properties: + text: + type: string + uuid: + type: string + format: uuid + readOnly: true + type: + $ref: '#/components/schemas/FlawCommentType' + meta_attr: + type: object + additionalProperties: + type: string + nullable: true + created_dt: + type: string + format: date-time + readOnly: true + embargoed: + type: boolean + description: 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. + required: + - created_dt + - embargoed + - text + - uuid + FlawCommentType: + enum: + - BUGZILLA + type: string + FlawMetaType: + enum: + - ERRATA + - REFERENCE + - ACKNOWLEDGMENT + - EXPLOIT + - MAJOR_INCIDENT + - MAJOR_INCIDENT_LITE + - REQUIRES_SUMMARY + - NIST_CVSS_VALIDATION + - NEED_INFO + - CHECKLIST + - NVD_CVSS + type: string FlawPost: type: object description: serialize flaw model @@ -4974,7 +5716,7 @@ components: format: uuid readOnly: true type: - $ref: '#/components/schemas/Type824Enum' + $ref: '#/components/schemas/FlawType' cve_id: type: string nullable: true @@ -5129,6 +5871,11 @@ components: items: $ref: '#/components/schemas/CVEv5PackageVersions' readOnly: true + references: + type: array + items: + $ref: '#/components/schemas/FlawReference' + readOnly: true embargoed: type: boolean description: The embargoed boolean attribute is technically read-only as @@ -5163,11 +5910,91 @@ components: - meta - meta_attr - package_versions + - references - resolution - state - title - trackers - uuid + FlawReference: + type: object + description: FlawReference serializer + properties: + description: + type: string + flaw: + type: string + format: uuid + type: + $ref: '#/components/schemas/FlawReferenceType' + url: + type: string + format: uri + maxLength: 2048 + uuid: + type: string + format: uuid + readOnly: true + embargoed: + type: boolean + description: 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: + type: string + format: date-time + readOnly: true + updated_dt: + type: string + format: date-time + description: The updated_dt timestamp attribute is mandatory on update as + it is used to detect mit-air collisions. + required: + - created_dt + - embargoed + - flaw + - updated_dt + - url + - uuid + FlawReferencePost: + type: object + description: FlawReference serializer + properties: + description: + type: string + flaw: + type: string + format: uuid + type: + $ref: '#/components/schemas/FlawReferenceType' + url: + type: string + format: uri + maxLength: 2048 + uuid: + type: string + format: uuid + readOnly: true + embargoed: + type: boolean + description: 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: + type: string + format: date-time + readOnly: true + required: + - created_dt + - embargoed + - flaw + - url + - uuid + FlawReferenceType: + enum: + - ARTICLE + - EXTERNAL + type: string FlawReportData: type: object properties: @@ -5188,6 +6015,11 @@ components: required: - resolution - state + FlawType: + enum: + - VULNERABILITY + - WEAKNESS + type: string ImpactEnum: enum: - LOW @@ -5243,14 +6075,20 @@ components: type: string assignee: $ref: '#/components/schemas/JiraUser' + reporter: + $ref: '#/components/schemas/JiraUser' + creator: + $ref: '#/components/schemas/JiraUser' customfield_12311140: type: string description: Task group key required: - assignee + - creator - customfield_12311140 - description - issuetype + - reporter - summary JiraIssueQueryResult: type: object @@ -5307,7 +6145,7 @@ components: format: uuid readOnly: true type: - $ref: '#/components/schemas/MetaTypeEnum' + $ref: '#/components/schemas/FlawMetaType' meta_attr: type: object additionalProperties: @@ -5333,20 +6171,6 @@ components: - type - updated_dt - uuid - MetaTypeEnum: - enum: - - ERRATA - - REFERENCE - - ACKNOWLEDGMENT - - EXPLOIT - - MAJOR_INCIDENT - - MAJOR_INCIDENT_LITE - - REQUIRES_SUMMARY - - NIST_CVSS_VALIDATION - - NEED_INFO - - CHECKLIST - - NVD_CVSS - type: string PaginatedAffectList: type: object properties: @@ -5407,6 +6231,26 @@ components: type: array items: $ref: '#/components/schemas/ExploitOnlyReportData' + PaginatedFlawCommentList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/FlawComment' PaginatedFlawList: type: object properties: @@ -5427,6 +6271,26 @@ components: type: array items: $ref: '#/components/schemas/Flaw' + PaginatedFlawReferenceList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/FlawReference' PaginatedFlawReportDataList: type: object properties: @@ -5648,7 +6512,7 @@ components: format: uuid readOnly: true type: - $ref: '#/components/schemas/Type0d0Enum' + $ref: '#/components/schemas/TrackerType' external_system_id: type: string maxLength: 100 @@ -5710,7 +6574,7 @@ components: type: object properties: type: - $ref: '#/components/schemas/Type0d0Enum' + $ref: '#/components/schemas/TrackerType' external_system_id: type: string maxLength: 100 @@ -5724,20 +6588,11 @@ components: - external_system_id - status - type - Type0d0Enum: + TrackerType: enum: - JIRA - BUGZILLA type: string - Type5b2Enum: - enum: - - DEFAULT - type: string - Type824Enum: - enum: - - VULNERABILITY - - WEAKNESS - type: string securitySchemes: KerberosAuthentication: type: http diff --git a/osidb_bindings/session.py b/osidb_bindings/session.py index 279fbd0..ea4a608 100644 --- a/osidb_bindings/session.py +++ b/osidb_bindings/session.py @@ -20,7 +20,6 @@ OSIDB_API_VERSION, OSIDB_BINDINGS_API_PATH, OSIDB_BINDINGS_USERAGENT, - RESOURCE_TO_MODEL_MAPPING, ) osidb_status_retrieve = importlib.import_module( @@ -33,6 +32,13 @@ class OperationUnsupported(Exception): """Session operation is unsupported exception""" +class UndefinedRequestBody(Exception): + """ + Request body is not defined for the particular + resource and operation combination + """ + + def get_sync_function(api_module: ModuleType) -> Callable: """ Get 'sync' function from API module if available (response example is defined in schema) @@ -88,6 +94,18 @@ def __init__(self, base_url, auth=None, verify_ssl=True): "create", "search", ), + subresources={ + "comments": {"allowed_operations": ["retrieve", "list", "create"]}, + "references": { + "allowed_operations": [ + "retrieve", + "update", + "list", + "create", + "destroy", + ] + }, + }, ) self.affects = SessionOperationsGroup( self.__get_client_with_new_access_token, @@ -178,25 +196,27 @@ def __init__( client: Callable, resource_name: str, allowed_operations: List[str] = ALL_SESSION_OPERATIONS, + subresources: Dict[str, dict] = None, ): self.client = client self.resource_name = resource_name self.allowed_operations = allowed_operations - @property - def model_name(self) -> str: - if self.resource_name in RESOURCE_TO_MODEL_MAPPING: - # from mapping - return RESOURCE_TO_MODEL_MAPPING[self.resource_name] - else: - # parse it from the resource name - name_components = self.resource_name.split("_") - name_components[-1] = name_components[-1][:-1] - return "".join(name_component.title() for name_component in name_components) - - @property - def model(self): - return getattr(models, self.model_name) + if subresources is None: + subresources = {} + + # Create a session operation group for each subresource with respective + # allowed session operations + for subresource_name, subresource_metadata in subresources.items(): + setattr( + self, + subresource_name, + SessionOperationsGroup( + client, + resource_name=f"{resource_name}_{subresource_name}", + **subresource_metadata, + ), + ) def __get_method_module(self, resource_name: str, method: str) -> ModuleType: # import endpoint module based on a method @@ -205,7 +225,7 @@ def __get_method_module(self, resource_name: str, method: str) -> ModuleType: package="osidb_bindings", ) - def __make_iterable(self, response, **kwargs): + def __make_iterable(self, response, *args, **kwargs): """ Populate next, prev and iterator helper methods for paginated responses """ @@ -228,33 +248,35 @@ def __make_iterable(self, response, **kwargs): if offset is not None: kwargs["offset"] = offset.group(1) - setattr(response, func_name, partial(self.retrieve_list, **kwargs)) + setattr( + response, func_name, partial(self.retrieve_list, *args, **kwargs) + ) return response # CRUD operations - def retrieve(self, id, **kwargs): + def retrieve(self, id, *args, **kwargs): if "retrieve" in self.allowed_operations: method_module = self.__get_method_module( resource_name=self.resource_name, method="retrieve" ) sync_fn = get_sync_function(method_module) - return sync_fn(id, client=self.client(), **kwargs) + return sync_fn(id, *args, client=self.client(), **kwargs) else: raise OperationUnsupported( 'Operation "update" is not supported for the ' f'"{self.resource_name}" resource.' ) - def retrieve_list(self, **kwargs): + def retrieve_list(self, *args, **kwargs): if "list" in self.allowed_operations: method_module = self.__get_method_module( resource_name=self.resource_name, method="list" ) sync_fn = get_sync_function(method_module) return self.__make_iterable( - sync_fn(client=self.client(), **kwargs), **kwargs + sync_fn(*args, client=self.client(), **kwargs), *args, **kwargs ) else: raise OperationUnsupported( @@ -262,20 +284,28 @@ def retrieve_list(self, **kwargs): f'"{self.resource_name}" resource.' ) - def create(self, form_data: Dict[str, Any]): + def create(self, form_data: Dict[str, Any], *args, **kwargs): if "create" in self.allowed_operations: - model = getattr(models, self.model_name) - transformed_data = model.from_dict(form_data) - method_module = self.__get_method_module( resource_name=self.resource_name, method="create" ) + model = getattr(method_module, "REQUEST_BODY_TYPE", None) + if model is None: + raise UndefinedRequestBody( + "There is no defined request body " + f'for the resource "{self.resource_name}" ' + 'and "create" operation.' + ) + + transformed_data = model.from_dict(form_data) sync_fn = get_sync_function(method_module) return sync_fn( + *args, client=self.client(), form_data=transformed_data, multipart_data=UNSET, json_body=UNSET, + **kwargs, ) else: raise OperationUnsupported( @@ -283,20 +313,29 @@ def create(self, form_data: Dict[str, Any]): f'"{self.resource_name}" resource.' ) - def update(self, id, form_data: Dict[str, Any]): + def update(self, id, form_data: Dict[str, Any], *args, **kwargs): if "update" in self.allowed_operations: - transformed_data = self.model.from_dict(form_data) - method_module = self.__get_method_module( resource_name=self.resource_name, method="update" ) + model = getattr(method_module, "REQUEST_BODY_TYPE", None) + if model is None: + raise UndefinedRequestBody( + "There is no defined request body " + f'for the resource "{self.resource_name}" ' + 'and "update" operation.' + ) + + transformed_data = model.from_dict(form_data) sync_fn = get_sync_function(method_module) return sync_fn( id, + *args, client=self.client(), form_data=transformed_data, multipart_data=UNSET, json_body=UNSET, + **kwargs, ) else: raise OperationUnsupported( @@ -304,7 +343,7 @@ def update(self, id, form_data: Dict[str, Any]): f'"{self.resource_name}" resource.' ) - def delete(self, id): + def delete(self, id, *args, **kwargs): if "destroy" in self.allowed_operations: method_module = self.__get_method_module( resource_name=self.resource_name, method="destroy" @@ -312,7 +351,9 @@ def delete(self, id): sync_fn = get_sync_function(method_module) return sync_fn( id, + *args, client=self.client(), + **kwargs, ) else: raise OperationUnsupported( diff --git a/scripts/helpers.sh b/scripts/helpers.sh index 894a3ee..21df3e3 100644 --- a/scripts/helpers.sh +++ b/scripts/helpers.sh @@ -50,8 +50,8 @@ update_version() { echo "Replacing version in pyproject.toml of low level bindings to ${version}" sed -i 's/version = "[0-9]*\.[0-9]*\.[0-9]*"/version = "'${version}'"/g' osidb_bindings/bindings/pyproject.toml - echo "Replacing user agent version in constants.py to ${version}" - sed -i 's/"osidb-bindings-[0-9]*\.[0-9]*\.[0-9]*"/"osidb-bindings-'${version}'"/g' osidb_bindings/constants.py + echo "Replacing version in constants.py to ${version}" + sed -i 's/OSIDB_BINDINGS_VERSION: str = "[0-9]*\.[0-9]*\.[0-9]*"/OSIDB_BINDINGS_VERSION: str = "'${version}'"/g' osidb_bindings/constants.py echo "Updating the CHANGELOG.md to ${version}" sed -i 's/^## Unreleased.*/## Unreleased\n\n## ['"${version}"'] - '$(date '+%Y-%m-%d')'/' CHANGELOG.md