From a67d5c32eba4e4057654f20fc2f0ccb1cee248df Mon Sep 17 00:00:00 2001 From: Nathan Thorpe Date: Thu, 31 Jul 2025 10:07:29 -0700 Subject: [PATCH 1/3] update api models --- .../v1/api/datasets/get_sample_sheets.py | 176 +++++++++++++ cirro_api_client/v1/api/feed/__init__.py | 0 .../v1/api/feed/create_discussion.py | 173 ++++++++++++ .../v1/api/feed/delete_discussion.py | 98 +++++++ .../v1/api/feed/delete_message.py | 105 ++++++++ .../v1/api/feed/get_discussion.py | 163 ++++++++++++ .../v1/api/feed/get_discussions_for_entity.py | 246 +++++++++++++++++ .../api/feed/get_messages_for_discussion.py | 247 ++++++++++++++++++ cirro_api_client/v1/api/feed/post_message.py | 115 ++++++++ .../v1/api/feed/update_discussion.py | 115 ++++++++ .../v1/api/feed/update_message.py | 122 +++++++++ .../governance/get_requirements_by_project.py | 25 +- .../update_requirement_file_for_project.py | 122 +++++++++ .../v1/api/metadata/get_sample_by_id.py | 176 +++++++++++++ cirro_api_client/v1/models/__init__.py | 32 +++ cirro_api_client/v1/models/auth_info.py | 8 + cirro_api_client/v1/models/dataset_detail.py | 21 ++ .../dataset_detail_source_sample_files_map.py | 40 +++ cirro_api_client/v1/models/dataset_viz.py | 9 + cirro_api_client/v1/models/discussion.py | 128 +++++++++ .../v1/models/discussion_input.py | 86 ++++++ cirro_api_client/v1/models/discussion_type.py | 15 ++ cirro_api_client/v1/models/entity.py | 56 ++++ cirro_api_client/v1/models/entity_type.py | 22 ++ .../v1/models/file_name_pattern.py | 32 ++- .../v1/models/governance_file_input.py | 72 +++++ .../v1/models/governance_requirement.py | 34 +++ ...governance_requirement_project_file_map.py | 45 ++++ cirro_api_client/v1/models/message.py | 141 ++++++++++ cirro_api_client/v1/models/message_input.py | 68 +++++ cirro_api_client/v1/models/message_type.py | 15 ++ .../models/paginated_response_discussion.py | 68 +++++ .../v1/models/paginated_response_message.py | 68 +++++ cirro_api_client/v1/models/project_detail.py | 43 +-- .../v1/models/project_requirement.py | 27 +- .../v1/models/run_analysis_request.py | 38 +++ ...nalysis_request_source_sample_files_map.py | 43 +++ cirro_api_client/v1/models/sample_sheets.py | 55 ++++ cirro_api_client/v1/models/sort_order.py | 15 ++ cirro_api_client/v1/models/user_detail.py | 30 +++ config.yml | 4 + 41 files changed, 3052 insertions(+), 46 deletions(-) create mode 100644 cirro_api_client/v1/api/datasets/get_sample_sheets.py create mode 100644 cirro_api_client/v1/api/feed/__init__.py create mode 100644 cirro_api_client/v1/api/feed/create_discussion.py create mode 100644 cirro_api_client/v1/api/feed/delete_discussion.py create mode 100644 cirro_api_client/v1/api/feed/delete_message.py create mode 100644 cirro_api_client/v1/api/feed/get_discussion.py create mode 100644 cirro_api_client/v1/api/feed/get_discussions_for_entity.py create mode 100644 cirro_api_client/v1/api/feed/get_messages_for_discussion.py create mode 100644 cirro_api_client/v1/api/feed/post_message.py create mode 100644 cirro_api_client/v1/api/feed/update_discussion.py create mode 100644 cirro_api_client/v1/api/feed/update_message.py create mode 100644 cirro_api_client/v1/api/governance/update_requirement_file_for_project.py create mode 100644 cirro_api_client/v1/api/metadata/get_sample_by_id.py create mode 100644 cirro_api_client/v1/models/dataset_detail_source_sample_files_map.py create mode 100644 cirro_api_client/v1/models/discussion.py create mode 100644 cirro_api_client/v1/models/discussion_input.py create mode 100644 cirro_api_client/v1/models/discussion_type.py create mode 100644 cirro_api_client/v1/models/entity.py create mode 100644 cirro_api_client/v1/models/entity_type.py create mode 100644 cirro_api_client/v1/models/governance_file_input.py create mode 100644 cirro_api_client/v1/models/governance_requirement_project_file_map.py create mode 100644 cirro_api_client/v1/models/message.py create mode 100644 cirro_api_client/v1/models/message_input.py create mode 100644 cirro_api_client/v1/models/message_type.py create mode 100644 cirro_api_client/v1/models/paginated_response_discussion.py create mode 100644 cirro_api_client/v1/models/paginated_response_message.py create mode 100644 cirro_api_client/v1/models/run_analysis_request_source_sample_files_map.py create mode 100644 cirro_api_client/v1/models/sample_sheets.py create mode 100644 cirro_api_client/v1/models/sort_order.py diff --git a/cirro_api_client/v1/api/datasets/get_sample_sheets.py b/cirro_api_client/v1/api/datasets/get_sample_sheets.py new file mode 100644 index 0000000..db26635 --- /dev/null +++ b/cirro_api_client/v1/api/datasets/get_sample_sheets.py @@ -0,0 +1,176 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.sample_sheets import SampleSheets +from ...types import Response + + +def _get_kwargs( + project_id: str, + dataset_id: str, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/projects/{project_id}/datasets/{dataset_id}/samplesheet", + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[SampleSheets]: + if response.status_code == HTTPStatus.OK: + response_200 = SampleSheets.from_dict(response.json()) + + return response_200 + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[SampleSheets]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + dataset_id: str, + *, + client: Client, +) -> Response[SampleSheets]: + """Generate sample sheets + + Generates the sample sheet output for this dataset, useful for debugging the preprocess script. + + Args: + project_id (str): + dataset_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SampleSheets] + """ + + kwargs = _get_kwargs( + project_id=project_id, + dataset_id=dataset_id, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + dataset_id: str, + *, + client: Client, +) -> Optional[SampleSheets]: + """Generate sample sheets + + Generates the sample sheet output for this dataset, useful for debugging the preprocess script. + + Args: + project_id (str): + dataset_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SampleSheets + """ + + try: + return sync_detailed( + project_id=project_id, + dataset_id=dataset_id, + client=client, + ).parsed + except errors.NotFoundException: + return None + + +async def asyncio_detailed( + project_id: str, + dataset_id: str, + *, + client: Client, +) -> Response[SampleSheets]: + """Generate sample sheets + + Generates the sample sheet output for this dataset, useful for debugging the preprocess script. + + Args: + project_id (str): + dataset_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[SampleSheets] + """ + + kwargs = _get_kwargs( + project_id=project_id, + dataset_id=dataset_id, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + dataset_id: str, + *, + client: Client, +) -> Optional[SampleSheets]: + """Generate sample sheets + + Generates the sample sheet output for this dataset, useful for debugging the preprocess script. + + Args: + project_id (str): + dataset_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + SampleSheets + """ + + try: + return ( + await asyncio_detailed( + project_id=project_id, + dataset_id=dataset_id, + client=client, + ) + ).parsed + except errors.NotFoundException: + return None diff --git a/cirro_api_client/v1/api/feed/__init__.py b/cirro_api_client/v1/api/feed/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cirro_api_client/v1/api/feed/create_discussion.py b/cirro_api_client/v1/api/feed/create_discussion.py new file mode 100644 index 0000000..bfd2df6 --- /dev/null +++ b/cirro_api_client/v1/api/feed/create_discussion.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.discussion import Discussion +from ...models.discussion_input import DiscussionInput +from ...types import Response + + +def _get_kwargs( + *, + body: DiscussionInput, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": "/discussions", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Discussion]: + if response.status_code == HTTPStatus.OK: + response_200 = Discussion.from_dict(response.json()) + + return response_200 + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Discussion]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Client, + body: DiscussionInput, +) -> Response[Discussion]: + """Create a discussion + + Creates a new discussion for an entity + + Args: + body (DiscussionInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Discussion] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Client, + body: DiscussionInput, +) -> Optional[Discussion]: + """Create a discussion + + Creates a new discussion for an entity + + Args: + body (DiscussionInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Discussion + """ + + try: + return sync_detailed( + client=client, + body=body, + ).parsed + except errors.NotFoundException: + return None + + +async def asyncio_detailed( + *, + client: Client, + body: DiscussionInput, +) -> Response[Discussion]: + """Create a discussion + + Creates a new discussion for an entity + + Args: + body (DiscussionInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Discussion] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Client, + body: DiscussionInput, +) -> Optional[Discussion]: + """Create a discussion + + Creates a new discussion for an entity + + Args: + body (DiscussionInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Discussion + """ + + try: + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed + except errors.NotFoundException: + return None diff --git a/cirro_api_client/v1/api/feed/delete_discussion.py b/cirro_api_client/v1/api/feed/delete_discussion.py new file mode 100644 index 0000000..3d05435 --- /dev/null +++ b/cirro_api_client/v1/api/feed/delete_discussion.py @@ -0,0 +1,98 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...types import Response + + +def _get_kwargs( + discussion_id: str, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/discussions/{discussion_id}", + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]: + if response.status_code == HTTPStatus.OK: + return None + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + discussion_id: str, + *, + client: Client, +) -> Response[Any]: + """Delete a discussion + + Deletes an existing discussion and all associated messages + + Args: + discussion_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + discussion_id: str, + *, + client: Client, +) -> Response[Any]: + """Delete a discussion + + Deletes an existing discussion and all associated messages + + Args: + discussion_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) diff --git a/cirro_api_client/v1/api/feed/delete_message.py b/cirro_api_client/v1/api/feed/delete_message.py new file mode 100644 index 0000000..43b9111 --- /dev/null +++ b/cirro_api_client/v1/api/feed/delete_message.py @@ -0,0 +1,105 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...types import Response + + +def _get_kwargs( + discussion_id: str, + message_id: str, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "delete", + "url": f"/discussions/{discussion_id}/messages/{message_id}", + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]: + if response.status_code == HTTPStatus.OK: + return None + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + discussion_id: str, + message_id: str, + *, + client: Client, +) -> Response[Any]: + """Delete a message + + Deletes a message from a discussion + + Args: + discussion_id (str): + message_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + message_id=message_id, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + discussion_id: str, + message_id: str, + *, + client: Client, +) -> Response[Any]: + """Delete a message + + Deletes a message from a discussion + + Args: + discussion_id (str): + message_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + message_id=message_id, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) diff --git a/cirro_api_client/v1/api/feed/get_discussion.py b/cirro_api_client/v1/api/feed/get_discussion.py new file mode 100644 index 0000000..b88f956 --- /dev/null +++ b/cirro_api_client/v1/api/feed/get_discussion.py @@ -0,0 +1,163 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.discussion import Discussion +from ...types import Response + + +def _get_kwargs( + discussion_id: str, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/discussions/{discussion_id}", + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Discussion]: + if response.status_code == HTTPStatus.OK: + response_200 = Discussion.from_dict(response.json()) + + return response_200 + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Discussion]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + discussion_id: str, + *, + client: Client, +) -> Response[Discussion]: + """Get a discussion + + Retrieves a discussion by its ID + + Args: + discussion_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Discussion] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + discussion_id: str, + *, + client: Client, +) -> Optional[Discussion]: + """Get a discussion + + Retrieves a discussion by its ID + + Args: + discussion_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Discussion + """ + + try: + return sync_detailed( + discussion_id=discussion_id, + client=client, + ).parsed + except errors.NotFoundException: + return None + + +async def asyncio_detailed( + discussion_id: str, + *, + client: Client, +) -> Response[Discussion]: + """Get a discussion + + Retrieves a discussion by its ID + + Args: + discussion_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Discussion] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + discussion_id: str, + *, + client: Client, +) -> Optional[Discussion]: + """Get a discussion + + Retrieves a discussion by its ID + + Args: + discussion_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Discussion + """ + + try: + return ( + await asyncio_detailed( + discussion_id=discussion_id, + client=client, + ) + ).parsed + except errors.NotFoundException: + return None diff --git a/cirro_api_client/v1/api/feed/get_discussions_for_entity.py b/cirro_api_client/v1/api/feed/get_discussions_for_entity.py new file mode 100644 index 0000000..f38afa5 --- /dev/null +++ b/cirro_api_client/v1/api/feed/get_discussions_for_entity.py @@ -0,0 +1,246 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import Client +from ...models.entity_type import EntityType +from ...models.paginated_response_discussion import PaginatedResponseDiscussion +from ...models.sort_order import SortOrder +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + entity_type: EntityType, + entity_id: str, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_entity_type = entity_type.value + params["entityType"] = json_entity_type + + params["entityId"] = entity_id + + json_next_token: Union[None, Unset, str] + if isinstance(next_token, Unset): + json_next_token = UNSET + else: + json_next_token = next_token + params["nextToken"] = json_next_token + + params["limit"] = limit + + json_order: Union[None, Unset, str] + if isinstance(order, Unset): + json_order = UNSET + elif isinstance(order, SortOrder): + json_order = order.value + else: + json_order = order + params["order"] = json_order + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": "/discussions", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[PaginatedResponseDiscussion]: + if response.status_code == HTTPStatus.OK: + response_200 = PaginatedResponseDiscussion.from_dict(response.json()) + + return response_200 + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[PaginatedResponseDiscussion]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Client, + entity_type: EntityType, + entity_id: str, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Response[PaginatedResponseDiscussion]: + """Get discussions for an entity + + Retrieves a paginated list of discussions for a specific entity type and ID + + Args: + entity_type (EntityType): + entity_id (str): + next_token (Union[None, Unset, str]): + limit (Union[Unset, int]): Default: 5000. + order (Union[None, SortOrder, Unset]): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedResponseDiscussion] + """ + + kwargs = _get_kwargs( + entity_type=entity_type, + entity_id=entity_id, + next_token=next_token, + limit=limit, + order=order, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Client, + entity_type: EntityType, + entity_id: str, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Optional[PaginatedResponseDiscussion]: + """Get discussions for an entity + + Retrieves a paginated list of discussions for a specific entity type and ID + + Args: + entity_type (EntityType): + entity_id (str): + next_token (Union[None, Unset, str]): + limit (Union[Unset, int]): Default: 5000. + order (Union[None, SortOrder, Unset]): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedResponseDiscussion + """ + + try: + return sync_detailed( + client=client, + entity_type=entity_type, + entity_id=entity_id, + next_token=next_token, + limit=limit, + order=order, + ).parsed + except errors.NotFoundException: + return None + + +async def asyncio_detailed( + *, + client: Client, + entity_type: EntityType, + entity_id: str, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Response[PaginatedResponseDiscussion]: + """Get discussions for an entity + + Retrieves a paginated list of discussions for a specific entity type and ID + + Args: + entity_type (EntityType): + entity_id (str): + next_token (Union[None, Unset, str]): + limit (Union[Unset, int]): Default: 5000. + order (Union[None, SortOrder, Unset]): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedResponseDiscussion] + """ + + kwargs = _get_kwargs( + entity_type=entity_type, + entity_id=entity_id, + next_token=next_token, + limit=limit, + order=order, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Client, + entity_type: EntityType, + entity_id: str, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Optional[PaginatedResponseDiscussion]: + """Get discussions for an entity + + Retrieves a paginated list of discussions for a specific entity type and ID + + Args: + entity_type (EntityType): + entity_id (str): + next_token (Union[None, Unset, str]): + limit (Union[Unset, int]): Default: 5000. + order (Union[None, SortOrder, Unset]): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedResponseDiscussion + """ + + try: + return ( + await asyncio_detailed( + client=client, + entity_type=entity_type, + entity_id=entity_id, + next_token=next_token, + limit=limit, + order=order, + ) + ).parsed + except errors.NotFoundException: + return None diff --git a/cirro_api_client/v1/api/feed/get_messages_for_discussion.py b/cirro_api_client/v1/api/feed/get_messages_for_discussion.py new file mode 100644 index 0000000..19be2ed --- /dev/null +++ b/cirro_api_client/v1/api/feed/get_messages_for_discussion.py @@ -0,0 +1,247 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union + +import httpx + +from ... import errors +from ...client import Client +from ...models.paginated_response_message import PaginatedResponseMessage +from ...models.sort_order import SortOrder +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + discussion_id: str, + *, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + thread_id: Union[None, Unset, str] = UNSET, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + json_next_token: Union[None, Unset, str] + if isinstance(next_token, Unset): + json_next_token = UNSET + else: + json_next_token = next_token + params["nextToken"] = json_next_token + + params["limit"] = limit + + json_thread_id: Union[None, Unset, str] + if isinstance(thread_id, Unset): + json_thread_id = UNSET + else: + json_thread_id = thread_id + params["threadId"] = json_thread_id + + json_order: Union[None, Unset, str] + if isinstance(order, Unset): + json_order = UNSET + elif isinstance(order, SortOrder): + json_order = order.value + else: + json_order = order + params["order"] = json_order + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/discussions/{discussion_id}/messages", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[PaginatedResponseMessage]: + if response.status_code == HTTPStatus.OK: + response_200 = PaginatedResponseMessage.from_dict(response.json()) + + return response_200 + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[PaginatedResponseMessage]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + discussion_id: str, + *, + client: Client, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + thread_id: Union[None, Unset, str] = UNSET, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Response[PaginatedResponseMessage]: + """Get messages for a discussion + + Retrieves all messages associated with a specific discussion + + Args: + discussion_id (str): + next_token (Union[None, Unset, str]): + limit (Union[Unset, int]): Default: 5000. + thread_id (Union[None, Unset, str]): + order (Union[None, SortOrder, Unset]): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedResponseMessage] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + next_token=next_token, + limit=limit, + thread_id=thread_id, + order=order, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + discussion_id: str, + *, + client: Client, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + thread_id: Union[None, Unset, str] = UNSET, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Optional[PaginatedResponseMessage]: + """Get messages for a discussion + + Retrieves all messages associated with a specific discussion + + Args: + discussion_id (str): + next_token (Union[None, Unset, str]): + limit (Union[Unset, int]): Default: 5000. + thread_id (Union[None, Unset, str]): + order (Union[None, SortOrder, Unset]): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedResponseMessage + """ + + try: + return sync_detailed( + discussion_id=discussion_id, + client=client, + next_token=next_token, + limit=limit, + thread_id=thread_id, + order=order, + ).parsed + except errors.NotFoundException: + return None + + +async def asyncio_detailed( + discussion_id: str, + *, + client: Client, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + thread_id: Union[None, Unset, str] = UNSET, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Response[PaginatedResponseMessage]: + """Get messages for a discussion + + Retrieves all messages associated with a specific discussion + + Args: + discussion_id (str): + next_token (Union[None, Unset, str]): + limit (Union[Unset, int]): Default: 5000. + thread_id (Union[None, Unset, str]): + order (Union[None, SortOrder, Unset]): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedResponseMessage] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + next_token=next_token, + limit=limit, + thread_id=thread_id, + order=order, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + discussion_id: str, + *, + client: Client, + next_token: Union[None, Unset, str] = UNSET, + limit: Union[Unset, int] = 5000, + thread_id: Union[None, Unset, str] = UNSET, + order: Union[None, SortOrder, Unset] = UNSET, +) -> Optional[PaginatedResponseMessage]: + """Get messages for a discussion + + Retrieves all messages associated with a specific discussion + + Args: + discussion_id (str): + next_token (Union[None, Unset, str]): + limit (Union[Unset, int]): Default: 5000. + thread_id (Union[None, Unset, str]): + order (Union[None, SortOrder, Unset]): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedResponseMessage + """ + + try: + return ( + await asyncio_detailed( + discussion_id=discussion_id, + client=client, + next_token=next_token, + limit=limit, + thread_id=thread_id, + order=order, + ) + ).parsed + except errors.NotFoundException: + return None diff --git a/cirro_api_client/v1/api/feed/post_message.py b/cirro_api_client/v1/api/feed/post_message.py new file mode 100644 index 0000000..a876441 --- /dev/null +++ b/cirro_api_client/v1/api/feed/post_message.py @@ -0,0 +1,115 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.message_input import MessageInput +from ...types import Response + + +def _get_kwargs( + discussion_id: str, + *, + body: MessageInput, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": f"/discussions/{discussion_id}/messages", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]: + if response.status_code == HTTPStatus.OK: + return None + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + discussion_id: str, + *, + client: Client, + body: MessageInput, +) -> Response[Any]: + """Post a message + + Posts a new message to a discussion + + Args: + discussion_id (str): + body (MessageInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + body=body, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + discussion_id: str, + *, + client: Client, + body: MessageInput, +) -> Response[Any]: + """Post a message + + Posts a new message to a discussion + + Args: + discussion_id (str): + body (MessageInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) diff --git a/cirro_api_client/v1/api/feed/update_discussion.py b/cirro_api_client/v1/api/feed/update_discussion.py new file mode 100644 index 0000000..b45f636 --- /dev/null +++ b/cirro_api_client/v1/api/feed/update_discussion.py @@ -0,0 +1,115 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.discussion_input import DiscussionInput +from ...types import Response + + +def _get_kwargs( + discussion_id: str, + *, + body: DiscussionInput, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/discussions/{discussion_id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]: + if response.status_code == HTTPStatus.OK: + return None + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + discussion_id: str, + *, + client: Client, + body: DiscussionInput, +) -> Response[Any]: + """Update a discussion + + Updates an existing discussion with new details + + Args: + discussion_id (str): + body (DiscussionInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + body=body, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + discussion_id: str, + *, + client: Client, + body: DiscussionInput, +) -> Response[Any]: + """Update a discussion + + Updates an existing discussion with new details + + Args: + discussion_id (str): + body (DiscussionInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) diff --git a/cirro_api_client/v1/api/feed/update_message.py b/cirro_api_client/v1/api/feed/update_message.py new file mode 100644 index 0000000..1553b47 --- /dev/null +++ b/cirro_api_client/v1/api/feed/update_message.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.message_input import MessageInput +from ...types import Response + + +def _get_kwargs( + discussion_id: str, + message_id: str, + *, + body: MessageInput, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/discussions/{discussion_id}/messages/{message_id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]: + if response.status_code == HTTPStatus.OK: + return None + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + discussion_id: str, + message_id: str, + *, + client: Client, + body: MessageInput, +) -> Response[Any]: + """Update a message + + Updates an existing message in a discussion + + Args: + discussion_id (str): + message_id (str): + body (MessageInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + message_id=message_id, + body=body, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + discussion_id: str, + message_id: str, + *, + client: Client, + body: MessageInput, +) -> Response[Any]: + """Update a message + + Updates an existing message in a discussion + + Args: + discussion_id (str): + message_id (str): + body (MessageInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + discussion_id=discussion_id, + message_id=message_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) diff --git a/cirro_api_client/v1/api/governance/get_requirements_by_project.py b/cirro_api_client/v1/api/governance/get_requirements_by_project.py index 94090a0..3a9f0e4 100644 --- a/cirro_api_client/v1/api/governance/get_requirements_by_project.py +++ b/cirro_api_client/v1/api/governance/get_requirements_by_project.py @@ -1,20 +1,29 @@ from http import HTTPStatus -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, Union import httpx from ... import errors from ...client import Client from ...models.project_requirement import ProjectRequirement -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( project_id: str, + *, + username: Union[Unset, str] = UNSET, ) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["username"] = username + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + _kwargs: Dict[str, Any] = { "method": "get", "url": f"/governance/projects/{project_id}/requirements", + "params": params, } return _kwargs @@ -47,6 +56,7 @@ def sync_detailed( project_id: str, *, client: Client, + username: Union[Unset, str] = UNSET, ) -> Response[List["ProjectRequirement"]]: """Get project requirements @@ -54,6 +64,7 @@ def sync_detailed( Args: project_id (str): + username (Union[Unset, str]): client (Client): instance of the API client Raises: @@ -66,6 +77,7 @@ def sync_detailed( kwargs = _get_kwargs( project_id=project_id, + username=username, ) response = client.get_httpx_client().request( @@ -80,6 +92,7 @@ def sync( project_id: str, *, client: Client, + username: Union[Unset, str] = UNSET, ) -> Optional[List["ProjectRequirement"]]: """Get project requirements @@ -87,6 +100,7 @@ def sync( Args: project_id (str): + username (Union[Unset, str]): client (Client): instance of the API client Raises: @@ -101,6 +115,7 @@ def sync( return sync_detailed( project_id=project_id, client=client, + username=username, ).parsed except errors.NotFoundException: return None @@ -110,6 +125,7 @@ async def asyncio_detailed( project_id: str, *, client: Client, + username: Union[Unset, str] = UNSET, ) -> Response[List["ProjectRequirement"]]: """Get project requirements @@ -117,6 +133,7 @@ async def asyncio_detailed( Args: project_id (str): + username (Union[Unset, str]): client (Client): instance of the API client Raises: @@ -129,6 +146,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( project_id=project_id, + username=username, ) response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) @@ -140,6 +158,7 @@ async def asyncio( project_id: str, *, client: Client, + username: Union[Unset, str] = UNSET, ) -> Optional[List["ProjectRequirement"]]: """Get project requirements @@ -147,6 +166,7 @@ async def asyncio( Args: project_id (str): + username (Union[Unset, str]): client (Client): instance of the API client Raises: @@ -162,6 +182,7 @@ async def asyncio( await asyncio_detailed( project_id=project_id, client=client, + username=username, ) ).parsed except errors.NotFoundException: diff --git a/cirro_api_client/v1/api/governance/update_requirement_file_for_project.py b/cirro_api_client/v1/api/governance/update_requirement_file_for_project.py new file mode 100644 index 0000000..6022409 --- /dev/null +++ b/cirro_api_client/v1/api/governance/update_requirement_file_for_project.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.governance_file_input import GovernanceFileInput +from ...types import Response + + +def _get_kwargs( + requirement_id: str, + project_id: str, + *, + body: GovernanceFileInput, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "put", + "url": f"/governance/requirements/{requirement_id}/projects/{project_id}", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]: + if response.status_code == HTTPStatus.OK: + return None + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + requirement_id: str, + project_id: str, + *, + client: Client, + body: GovernanceFileInput, +) -> Response[Any]: + """Update the project file for a requirement + + Updates the project-specific file for a requirement + + Args: + requirement_id (str): + project_id (str): + body (GovernanceFileInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + requirement_id=requirement_id, + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + requirement_id: str, + project_id: str, + *, + client: Client, + body: GovernanceFileInput, +) -> Response[Any]: + """Update the project file for a requirement + + Updates the project-specific file for a requirement + + Args: + requirement_id (str): + project_id (str): + body (GovernanceFileInput): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs( + requirement_id=requirement_id, + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) diff --git a/cirro_api_client/v1/api/metadata/get_sample_by_id.py b/cirro_api_client/v1/api/metadata/get_sample_by_id.py new file mode 100644 index 0000000..fc26e9f --- /dev/null +++ b/cirro_api_client/v1/api/metadata/get_sample_by_id.py @@ -0,0 +1,176 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.sample import Sample +from ...types import Response + + +def _get_kwargs( + project_id: str, + sample_id: str, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/projects/{project_id}/samples/{sample_id}", + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Sample]: + if response.status_code == HTTPStatus.OK: + response_200 = Sample.from_dict(response.json()) + + return response_200 + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[Sample]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + sample_id: str, + *, + client: Client, +) -> Response[Sample]: + """Get sample by ID + + Retrieves a sample by its ID along with its metadata + + Args: + project_id (str): + sample_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Sample] + """ + + kwargs = _get_kwargs( + project_id=project_id, + sample_id=sample_id, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + sample_id: str, + *, + client: Client, +) -> Optional[Sample]: + """Get sample by ID + + Retrieves a sample by its ID along with its metadata + + Args: + project_id (str): + sample_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Sample + """ + + try: + return sync_detailed( + project_id=project_id, + sample_id=sample_id, + client=client, + ).parsed + except errors.NotFoundException: + return None + + +async def asyncio_detailed( + project_id: str, + sample_id: str, + *, + client: Client, +) -> Response[Sample]: + """Get sample by ID + + Retrieves a sample by its ID along with its metadata + + Args: + project_id (str): + sample_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Sample] + """ + + kwargs = _get_kwargs( + project_id=project_id, + sample_id=sample_id, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + sample_id: str, + *, + client: Client, +) -> Optional[Sample]: + """Get sample by ID + + Retrieves a sample by its ID along with its metadata + + Args: + project_id (str): + sample_id (str): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Sample + """ + + try: + return ( + await asyncio_detailed( + project_id=project_id, + sample_id=sample_id, + client=client, + ) + ).parsed + except errors.NotFoundException: + return None diff --git a/cirro_api_client/v1/models/__init__.py b/cirro_api_client/v1/models/__init__.py index cfd405a..a180ab2 100644 --- a/cirro_api_client/v1/models/__init__.py +++ b/cirro_api_client/v1/models/__init__.py @@ -57,7 +57,13 @@ from .dataset_detail import DatasetDetail from .dataset_detail_info import DatasetDetailInfo from .dataset_detail_params import DatasetDetailParams +from .dataset_detail_source_sample_files_map import DatasetDetailSourceSampleFilesMap from .dataset_viz import DatasetViz +from .discussion import Discussion +from .discussion_input import DiscussionInput +from .discussion_type import DiscussionType +from .entity import Entity +from .entity_type import EntityType from .environment_type import EnvironmentType from .error_message import ErrorMessage from .executor import Executor @@ -81,8 +87,10 @@ from .governance_expiry_type import GovernanceExpiryType from .governance_file import GovernanceFile from .governance_file_access_request import GovernanceFileAccessRequest +from .governance_file_input import GovernanceFileInput from .governance_file_type import GovernanceFileType from .governance_requirement import GovernanceRequirement +from .governance_requirement_project_file_map import GovernanceRequirementProjectFileMap from .governance_scope import GovernanceScope from .governance_training_verification import GovernanceTrainingVerification from .governance_type import GovernanceType @@ -92,6 +100,9 @@ from .list_events_entity_type import ListEventsEntityType from .log_entry import LogEntry from .login_provider import LoginProvider +from .message import Message +from .message_input import MessageInput +from .message_type import MessageType from .metric_record import MetricRecord from .metric_record_services import MetricRecordServices from .move_dataset_input import MoveDatasetInput @@ -101,6 +112,8 @@ from .notebook_instance_status_response import NotebookInstanceStatusResponse from .open_notebook_instance_response import OpenNotebookInstanceResponse from .paginated_response_dataset_list_dto import PaginatedResponseDatasetListDto +from .paginated_response_discussion import PaginatedResponseDiscussion +from .paginated_response_message import PaginatedResponseMessage from .paginated_response_sample_dto import PaginatedResponseSampleDto from .paginated_response_user_dto import PaginatedResponseUserDto from .pipeline_code import PipelineCode @@ -131,10 +144,12 @@ from .resources_info import ResourcesInfo from .run_analysis_request import RunAnalysisRequest from .run_analysis_request_params import RunAnalysisRequestParams +from .run_analysis_request_source_sample_files_map import RunAnalysisRequestSourceSampleFilesMap from .sample import Sample from .sample_metadata import SampleMetadata from .sample_request import SampleRequest from .sample_request_metadata import SampleRequestMetadata +from .sample_sheets import SampleSheets from .service_connection import ServiceConnection from .set_user_project_role_request import SetUserProjectRoleRequest from .sftp_credentials import SftpCredentials @@ -142,6 +157,7 @@ from .share_detail import ShareDetail from .share_input import ShareInput from .share_type import ShareType +from .sort_order import SortOrder from .status import Status from .stop_execution_response import StopExecutionResponse from .sync_status import SyncStatus @@ -218,7 +234,13 @@ "DatasetDetail", "DatasetDetailInfo", "DatasetDetailParams", + "DatasetDetailSourceSampleFilesMap", "DatasetViz", + "Discussion", + "DiscussionInput", + "DiscussionType", + "Entity", + "EntityType", "EnvironmentType", "ErrorMessage", "Executor", @@ -242,8 +264,10 @@ "GovernanceExpiryType", "GovernanceFile", "GovernanceFileAccessRequest", + "GovernanceFileInput", "GovernanceFileType", "GovernanceRequirement", + "GovernanceRequirementProjectFileMap", "GovernanceScope", "GovernanceTrainingVerification", "GovernanceType", @@ -253,6 +277,9 @@ "ListEventsEntityType", "LogEntry", "LoginProvider", + "Message", + "MessageInput", + "MessageType", "MetricRecord", "MetricRecordServices", "MoveDatasetInput", @@ -262,6 +289,8 @@ "NotebookInstanceStatusResponse", "OpenNotebookInstanceResponse", "PaginatedResponseDatasetListDto", + "PaginatedResponseDiscussion", + "PaginatedResponseMessage", "PaginatedResponseSampleDto", "PaginatedResponseUserDto", "PipelineCode", @@ -292,10 +321,12 @@ "ResourcesInfo", "RunAnalysisRequest", "RunAnalysisRequestParams", + "RunAnalysisRequestSourceSampleFilesMap", "Sample", "SampleMetadata", "SampleRequest", "SampleRequestMetadata", + "SampleSheets", "ServiceConnection", "SetUserProjectRoleRequest", "SftpCredentials", @@ -303,6 +334,7 @@ "ShareDetail", "ShareInput", "ShareType", + "SortOrder", "Status", "StopExecutionResponse", "SyncStatus", diff --git a/cirro_api_client/v1/models/auth_info.py b/cirro_api_client/v1/models/auth_info.py index 0225388..50cbf3a 100644 --- a/cirro_api_client/v1/models/auth_info.py +++ b/cirro_api_client/v1/models/auth_info.py @@ -13,12 +13,14 @@ class AuthInfo: user_pool_id (str): sdk_app_id (str): ui_app_id (str): + drive_app_id (str): endpoint (str): """ user_pool_id: str sdk_app_id: str ui_app_id: str + drive_app_id: str endpoint: str additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -29,6 +31,8 @@ def to_dict(self) -> Dict[str, Any]: ui_app_id = self.ui_app_id + drive_app_id = self.drive_app_id + endpoint = self.endpoint field_dict: Dict[str, Any] = {} @@ -38,6 +42,7 @@ def to_dict(self) -> Dict[str, Any]: "userPoolId": user_pool_id, "sdkAppId": sdk_app_id, "uiAppId": ui_app_id, + "driveAppId": drive_app_id, "endpoint": endpoint, } ) @@ -53,12 +58,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: ui_app_id = d.pop("uiAppId") + drive_app_id = d.pop("driveAppId") + endpoint = d.pop("endpoint") auth_info = cls( user_pool_id=user_pool_id, sdk_app_id=sdk_app_id, ui_app_id=ui_app_id, + drive_app_id=drive_app_id, endpoint=endpoint, ) diff --git a/cirro_api_client/v1/models/dataset_detail.py b/cirro_api_client/v1/models/dataset_detail.py index b99d906..c706b1e 100644 --- a/cirro_api_client/v1/models/dataset_detail.py +++ b/cirro_api_client/v1/models/dataset_detail.py @@ -11,6 +11,7 @@ if TYPE_CHECKING: from ..models.dataset_detail_info import DatasetDetailInfo from ..models.dataset_detail_params import DatasetDetailParams + from ..models.dataset_detail_source_sample_files_map import DatasetDetailSourceSampleFilesMap from ..models.named_item import NamedItem from ..models.tag import Tag @@ -31,6 +32,8 @@ class DatasetDetail: source_dataset_ids (List[str]): source_datasets (List['NamedItem']): source_sample_ids (List[str]): + source_sample_files_map (DatasetDetailSourceSampleFilesMap): Keys are sampleIds, and the lists are file paths to + include. status (Status): status_message (str): tags (List['Tag']): @@ -40,6 +43,8 @@ class DatasetDetail: created_by (str): created_at (datetime.datetime): updated_at (datetime.datetime): + originating_project_id (Union[Unset, str]): The originating project ID might be different if the dataset was + shared from another project. share (Union['NamedItem', None, Unset]): """ @@ -52,6 +57,7 @@ class DatasetDetail: source_dataset_ids: List[str] source_datasets: List["NamedItem"] source_sample_ids: List[str] + source_sample_files_map: "DatasetDetailSourceSampleFilesMap" status: Status status_message: str tags: List["Tag"] @@ -61,6 +67,7 @@ class DatasetDetail: created_by: str created_at: datetime.datetime updated_at: datetime.datetime + originating_project_id: Union[Unset, str] = UNSET share: Union["NamedItem", None, Unset] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -88,6 +95,8 @@ def to_dict(self) -> Dict[str, Any]: source_sample_ids = self.source_sample_ids + source_sample_files_map = self.source_sample_files_map.to_dict() + status = self.status.value status_message = self.status_message @@ -109,6 +118,8 @@ def to_dict(self) -> Dict[str, Any]: updated_at = self.updated_at.isoformat() + originating_project_id = self.originating_project_id + share: Union[Dict[str, Any], None, Unset] if isinstance(self.share, Unset): share = UNSET @@ -130,6 +141,7 @@ def to_dict(self) -> Dict[str, Any]: "sourceDatasetIds": source_dataset_ids, "sourceDatasets": source_datasets, "sourceSampleIds": source_sample_ids, + "sourceSampleFilesMap": source_sample_files_map, "status": status, "statusMessage": status_message, "tags": tags, @@ -141,6 +153,8 @@ def to_dict(self) -> Dict[str, Any]: "updatedAt": updated_at, } ) + if originating_project_id is not UNSET: + field_dict["originatingProjectId"] = originating_project_id if share is not UNSET: field_dict["share"] = share @@ -150,6 +164,7 @@ def to_dict(self) -> Dict[str, Any]: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.dataset_detail_info import DatasetDetailInfo from ..models.dataset_detail_params import DatasetDetailParams + from ..models.dataset_detail_source_sample_files_map import DatasetDetailSourceSampleFilesMap from ..models.named_item import NamedItem from ..models.tag import Tag @@ -177,6 +192,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: source_sample_ids = cast(List[str], d.pop("sourceSampleIds")) + source_sample_files_map = DatasetDetailSourceSampleFilesMap.from_dict(d.pop("sourceSampleFilesMap")) + status = Status(d.pop("status")) status_message = d.pop("statusMessage") @@ -200,6 +217,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: updated_at = isoparse(d.pop("updatedAt")) + originating_project_id = d.pop("originatingProjectId", UNSET) + def _parse_share(data: object) -> Union["NamedItem", None, Unset]: if data is None: return data @@ -227,6 +246,7 @@ def _parse_share(data: object) -> Union["NamedItem", None, Unset]: source_dataset_ids=source_dataset_ids, source_datasets=source_datasets, source_sample_ids=source_sample_ids, + source_sample_files_map=source_sample_files_map, status=status, status_message=status_message, tags=tags, @@ -236,6 +256,7 @@ def _parse_share(data: object) -> Union["NamedItem", None, Unset]: created_by=created_by, created_at=created_at, updated_at=updated_at, + originating_project_id=originating_project_id, share=share, ) diff --git a/cirro_api_client/v1/models/dataset_detail_source_sample_files_map.py b/cirro_api_client/v1/models/dataset_detail_source_sample_files_map.py new file mode 100644 index 0000000..9dc26ef --- /dev/null +++ b/cirro_api_client/v1/models/dataset_detail_source_sample_files_map.py @@ -0,0 +1,40 @@ +from typing import Any, Dict, List, Type, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DatasetDetailSourceSampleFilesMap") + + +@_attrs_define +class DatasetDetailSourceSampleFilesMap: + """Keys are sampleIds, and the lists are file paths to include.""" + + additional_properties: Dict[str, List[str]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + dataset_detail_source_sample_files_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = cast(List[str], prop_dict) + + additional_properties[prop_name] = additional_property + + dataset_detail_source_sample_files_map.additional_properties = additional_properties + return dataset_detail_source_sample_files_map + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/dataset_viz.py b/cirro_api_client/v1/models/dataset_viz.py index f55f3e2..278e989 100644 --- a/cirro_api_client/v1/models/dataset_viz.py +++ b/cirro_api_client/v1/models/dataset_viz.py @@ -12,12 +12,14 @@ class DatasetViz: """ Attributes: + path (Union[Unset, str]): Path to viz configuration, if applicable name (Union[Unset, str]): Name of viz desc (Union[Unset, str]): Description of viz type (Union[Unset, str]): Type of viz Example: vitescce. config (Union[Unset, Any]): Config or path to config used to render viz """ + path: Union[Unset, str] = UNSET name: Union[Unset, str] = UNSET desc: Union[Unset, str] = UNSET type: Union[Unset, str] = UNSET @@ -25,6 +27,8 @@ class DatasetViz: additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + path = self.path + name = self.name desc = self.desc @@ -36,6 +40,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if path is not UNSET: + field_dict["path"] = path if name is not UNSET: field_dict["name"] = name if desc is not UNSET: @@ -50,6 +56,8 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() + path = d.pop("path", UNSET) + name = d.pop("name", UNSET) desc = d.pop("desc", UNSET) @@ -59,6 +67,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: config = d.pop("config", UNSET) dataset_viz = cls( + path=path, name=name, desc=desc, type=type, diff --git a/cirro_api_client/v1/models/discussion.py b/cirro_api_client/v1/models/discussion.py new file mode 100644 index 0000000..51e0f57 --- /dev/null +++ b/cirro_api_client/v1/models/discussion.py @@ -0,0 +1,128 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.discussion_type import DiscussionType + +if TYPE_CHECKING: + from ..models.entity import Entity + + +T = TypeVar("T", bound="Discussion") + + +@_attrs_define +class Discussion: + """ + Attributes: + id (str): + name (str): + description (str): + entity (Entity): + type (DiscussionType): + project_id (str): + created_by (str): + last_message_time (datetime.datetime): + created_at (datetime.datetime): + updated_at (datetime.datetime): + """ + + id: str + name: str + description: str + entity: "Entity" + type: DiscussionType + project_id: str + created_by: str + last_message_time: datetime.datetime + created_at: datetime.datetime + updated_at: datetime.datetime + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + id = self.id + + name = self.name + + description = self.description + + entity = self.entity.to_dict() + + type = self.type.value + + project_id = self.project_id + + created_by = self.created_by + + last_message_time = self.last_message_time.isoformat() + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "description": description, + "entity": entity, + "type": type, + "projectId": project_id, + "createdBy": created_by, + "lastMessageTime": last_message_time, + "createdAt": created_at, + "updatedAt": updated_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.entity import Entity + + d = src_dict.copy() + id = d.pop("id") + + name = d.pop("name") + + description = d.pop("description") + + entity = Entity.from_dict(d.pop("entity")) + + type = DiscussionType(d.pop("type")) + + project_id = d.pop("projectId") + + created_by = d.pop("createdBy") + + last_message_time = isoparse(d.pop("lastMessageTime")) + + created_at = isoparse(d.pop("createdAt")) + + updated_at = isoparse(d.pop("updatedAt")) + + discussion = cls( + id=id, + name=name, + description=description, + entity=entity, + type=type, + project_id=project_id, + created_by=created_by, + last_message_time=last_message_time, + created_at=created_at, + updated_at=updated_at, + ) + + discussion.additional_properties = d + return discussion + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/discussion_input.py b/cirro_api_client/v1/models/discussion_input.py new file mode 100644 index 0000000..a158b86 --- /dev/null +++ b/cirro_api_client/v1/models/discussion_input.py @@ -0,0 +1,86 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.discussion_type import DiscussionType + +if TYPE_CHECKING: + from ..models.entity import Entity + + +T = TypeVar("T", bound="DiscussionInput") + + +@_attrs_define +class DiscussionInput: + """ + Attributes: + name (str): + description (str): + entity (Entity): + type (DiscussionType): + project_id (str): + """ + + name: str + description: str + entity: "Entity" + type: DiscussionType + project_id: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + name = self.name + + description = self.description + + entity = self.entity.to_dict() + + type = self.type.value + + project_id = self.project_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "description": description, + "entity": entity, + "type": type, + "projectId": project_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.entity import Entity + + d = src_dict.copy() + name = d.pop("name") + + description = d.pop("description") + + entity = Entity.from_dict(d.pop("entity")) + + type = DiscussionType(d.pop("type")) + + project_id = d.pop("projectId") + + discussion_input = cls( + name=name, + description=description, + entity=entity, + type=type, + project_id=project_id, + ) + + discussion_input.additional_properties = d + return discussion_input + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/discussion_type.py b/cirro_api_client/v1/models/discussion_type.py new file mode 100644 index 0000000..4ac5667 --- /dev/null +++ b/cirro_api_client/v1/models/discussion_type.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class DiscussionType(str, Enum): + DISCUSSION = "DISCUSSION" + NOTES = "NOTES" + UNKNOWN = "UNKNOWN" + """ This is a fallback value for when the value is not known, do not use this value when making requests """ + + def __str__(self) -> str: + return str(self.value) + + @classmethod + def _missing_(cls, number): + return cls(cls.UNKNOWN) diff --git a/cirro_api_client/v1/models/entity.py b/cirro_api_client/v1/models/entity.py new file mode 100644 index 0000000..3dfcd49 --- /dev/null +++ b/cirro_api_client/v1/models/entity.py @@ -0,0 +1,56 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.entity_type import EntityType + +T = TypeVar("T", bound="Entity") + + +@_attrs_define +class Entity: + """ + Attributes: + type (EntityType): + id (str): + """ + + type: EntityType + id: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + type = self.type.value + + id = self.id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type, + "id": id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + type = EntityType(d.pop("type")) + + id = d.pop("id") + + entity = cls( + type=type, + id=id, + ) + + entity.additional_properties = d + return entity + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/entity_type.py b/cirro_api_client/v1/models/entity_type.py new file mode 100644 index 0000000..84a0500 --- /dev/null +++ b/cirro_api_client/v1/models/entity_type.py @@ -0,0 +1,22 @@ +from enum import Enum + + +class EntityType(str, Enum): + DATASET = "DATASET" + DISCUSSION = "DISCUSSION" + NOTEBOOK = "NOTEBOOK" + PROCESS = "PROCESS" + PROJECT = "PROJECT" + REFERENCE = "REFERENCE" + SAMPLE = "SAMPLE" + SHARE = "SHARE" + TAG = "TAG" + UNKNOWN = "UNKNOWN" + USER = "USER" + + def __str__(self) -> str: + return str(self.value) + + @classmethod + def _missing_(cls, number): + return cls(cls.UNKNOWN) diff --git a/cirro_api_client/v1/models/file_name_pattern.py b/cirro_api_client/v1/models/file_name_pattern.py index 22a1281..1dbc48f 100644 --- a/cirro_api_client/v1/models/file_name_pattern.py +++ b/cirro_api_client/v1/models/file_name_pattern.py @@ -1,8 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + T = TypeVar("T", bound="FileNamePattern") @@ -11,32 +13,37 @@ class FileNamePattern: """ Attributes: example_name (str): User-readable name for the file type used for display. - description (str): File description. sample_matching_pattern (str): File name pattern, formatted as a valid regex, to extract sample name and other metadata. + description (Union[None, Unset, str]): File description. """ example_name: str - description: str sample_matching_pattern: str + description: Union[None, Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: example_name = self.example_name - description = self.description - sample_matching_pattern = self.sample_matching_pattern + description: Union[None, Unset, str] + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "exampleName": example_name, - "description": description, "sampleMatchingPattern": sample_matching_pattern, } ) + if description is not UNSET: + field_dict["description"] = description return field_dict @@ -45,14 +52,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() example_name = d.pop("exampleName") - description = d.pop("description") - sample_matching_pattern = d.pop("sampleMatchingPattern") + def _parse_description(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + description = _parse_description(d.pop("description", UNSET)) + file_name_pattern = cls( example_name=example_name, - description=description, sample_matching_pattern=sample_matching_pattern, + description=description, ) file_name_pattern.additional_properties = d diff --git a/cirro_api_client/v1/models/governance_file_input.py b/cirro_api_client/v1/models/governance_file_input.py new file mode 100644 index 0000000..f37a99a --- /dev/null +++ b/cirro_api_client/v1/models/governance_file_input.py @@ -0,0 +1,72 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.governance_file_type import GovernanceFileType + +T = TypeVar("T", bound="GovernanceFileInput") + + +@_attrs_define +class GovernanceFileInput: + """ + Attributes: + name (str): + description (str): + src (str): + type (GovernanceFileType): The options for supplementals for governance requirements + """ + + name: str + description: str + src: str + type: GovernanceFileType + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + name = self.name + + description = self.description + + src = self.src + + type = self.type.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "description": description, + "src": src, + "type": type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name") + + description = d.pop("description") + + src = d.pop("src") + + type = GovernanceFileType(d.pop("type")) + + governance_file_input = cls( + name=name, + description=description, + src=src, + type=type, + ) + + governance_file_input.additional_properties = d + return governance_file_input + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/governance_requirement.py b/cirro_api_client/v1/models/governance_requirement.py index e884ad6..bfe8c7f 100644 --- a/cirro_api_client/v1/models/governance_requirement.py +++ b/cirro_api_client/v1/models/governance_requirement.py @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ..models.governance_expiry import GovernanceExpiry from ..models.governance_file import GovernanceFile + from ..models.governance_requirement_project_file_map import GovernanceRequirementProjectFileMap T = TypeVar("T", bound="GovernanceRequirement") @@ -40,6 +41,8 @@ class GovernanceRequirement: templates for documents, links, etc file (Union['GovernanceFile', None, Unset]): authorship (Union[GovernanceScope, None, Unset]): Who needs to supply the agreement document + project_file_map (Union['GovernanceRequirementProjectFileMap', None, Unset]): Files supplied by each project + when authorship is project verification_method (Union[GovernanceTrainingVerification, None, Unset]): The value indicating how the completion of the training is verified. """ @@ -61,11 +64,13 @@ class GovernanceRequirement: supplemental_docs: Union[List["GovernanceFile"], None, Unset] = UNSET file: Union["GovernanceFile", None, Unset] = UNSET authorship: Union[GovernanceScope, None, Unset] = UNSET + project_file_map: Union["GovernanceRequirementProjectFileMap", None, Unset] = UNSET verification_method: Union[GovernanceTrainingVerification, None, Unset] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: from ..models.governance_file import GovernanceFile + from ..models.governance_requirement_project_file_map import GovernanceRequirementProjectFileMap id = self.id @@ -135,6 +140,14 @@ def to_dict(self) -> Dict[str, Any]: else: authorship = self.authorship + project_file_map: Union[Dict[str, Any], None, Unset] + if isinstance(self.project_file_map, Unset): + project_file_map = UNSET + elif isinstance(self.project_file_map, GovernanceRequirementProjectFileMap): + project_file_map = self.project_file_map.to_dict() + else: + project_file_map = self.project_file_map + verification_method: Union[None, Unset, str] if isinstance(self.verification_method, Unset): verification_method = UNSET @@ -172,6 +185,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["file"] = file if authorship is not UNSET: field_dict["authorship"] = authorship + if project_file_map is not UNSET: + field_dict["projectFileMap"] = project_file_map if verification_method is not UNSET: field_dict["verificationMethod"] = verification_method @@ -181,6 +196,7 @@ def to_dict(self) -> Dict[str, Any]: def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.governance_expiry import GovernanceExpiry from ..models.governance_file import GovernanceFile + from ..models.governance_requirement_project_file_map import GovernanceRequirementProjectFileMap d = src_dict.copy() id = d.pop("id") @@ -297,6 +313,23 @@ def _parse_authorship(data: object) -> Union[GovernanceScope, None, Unset]: authorship = _parse_authorship(d.pop("authorship", UNSET)) + def _parse_project_file_map(data: object) -> Union["GovernanceRequirementProjectFileMap", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + project_file_map_type_0 = GovernanceRequirementProjectFileMap.from_dict(data) + + return project_file_map_type_0 + except: # noqa: E722 + pass + return cast(Union["GovernanceRequirementProjectFileMap", None, Unset], data) + + project_file_map = _parse_project_file_map(d.pop("projectFileMap", UNSET)) + def _parse_verification_method(data: object) -> Union[GovernanceTrainingVerification, None, Unset]: if data is None: return data @@ -332,6 +365,7 @@ def _parse_verification_method(data: object) -> Union[GovernanceTrainingVerifica supplemental_docs=supplemental_docs, file=file, authorship=authorship, + project_file_map=project_file_map, verification_method=verification_method, ) diff --git a/cirro_api_client/v1/models/governance_requirement_project_file_map.py b/cirro_api_client/v1/models/governance_requirement_project_file_map.py new file mode 100644 index 0000000..274aabf --- /dev/null +++ b/cirro_api_client/v1/models/governance_requirement_project_file_map.py @@ -0,0 +1,45 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.governance_file import GovernanceFile + + +T = TypeVar("T", bound="GovernanceRequirementProjectFileMap") + + +@_attrs_define +class GovernanceRequirementProjectFileMap: + """Files supplied by each project when authorship is project""" + + additional_properties: Dict[str, "GovernanceFile"] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.governance_file import GovernanceFile + + d = src_dict.copy() + governance_requirement_project_file_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = GovernanceFile.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + governance_requirement_project_file_map.additional_properties = additional_properties + return governance_requirement_project_file_map + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/message.py b/cirro_api_client/v1/models/message.py new file mode 100644 index 0000000..32b120d --- /dev/null +++ b/cirro_api_client/v1/models/message.py @@ -0,0 +1,141 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..models.message_type import MessageType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.entity import Entity + + +T = TypeVar("T", bound="Message") + + +@_attrs_define +class Message: + """ + Attributes: + message_type (MessageType): + id (str): + message (str): + links (List['Entity']): + has_replies (bool): + created_by (str): + created_at (datetime.datetime): + updated_at (datetime.datetime): + parent_message_id (Union[None, Unset, str]): + """ + + message_type: MessageType + id: str + message: str + links: List["Entity"] + has_replies: bool + created_by: str + created_at: datetime.datetime + updated_at: datetime.datetime + parent_message_id: Union[None, Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + message_type = self.message_type.value + + id = self.id + + message = self.message + + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + links.append(links_item) + + has_replies = self.has_replies + + created_by = self.created_by + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + parent_message_id: Union[None, Unset, str] + if isinstance(self.parent_message_id, Unset): + parent_message_id = UNSET + else: + parent_message_id = self.parent_message_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "messageType": message_type, + "id": id, + "message": message, + "links": links, + "hasReplies": has_replies, + "createdBy": created_by, + "createdAt": created_at, + "updatedAt": updated_at, + } + ) + if parent_message_id is not UNSET: + field_dict["parentMessageId"] = parent_message_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.entity import Entity + + d = src_dict.copy() + message_type = MessageType(d.pop("messageType")) + + id = d.pop("id") + + message = d.pop("message") + + links = [] + _links = d.pop("links") + for links_item_data in _links: + links_item = Entity.from_dict(links_item_data) + + links.append(links_item) + + has_replies = d.pop("hasReplies") + + created_by = d.pop("createdBy") + + created_at = isoparse(d.pop("createdAt")) + + updated_at = isoparse(d.pop("updatedAt")) + + def _parse_parent_message_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + parent_message_id = _parse_parent_message_id(d.pop("parentMessageId", UNSET)) + + message = cls( + message_type=message_type, + id=id, + message=message, + links=links, + has_replies=has_replies, + created_by=created_by, + created_at=created_at, + updated_at=updated_at, + parent_message_id=parent_message_id, + ) + + message.additional_properties = d + return message + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/message_input.py b/cirro_api_client/v1/models/message_input.py new file mode 100644 index 0000000..613adea --- /dev/null +++ b/cirro_api_client/v1/models/message_input.py @@ -0,0 +1,68 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MessageInput") + + +@_attrs_define +class MessageInput: + """ + Attributes: + message (str): + parent_message_id (Union[None, Unset, str]): + """ + + message: str + parent_message_id: Union[None, Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + message = self.message + + parent_message_id: Union[None, Unset, str] + if isinstance(self.parent_message_id, Unset): + parent_message_id = UNSET + else: + parent_message_id = self.parent_message_id + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "message": message, + } + ) + if parent_message_id is not UNSET: + field_dict["parentMessageId"] = parent_message_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + message = d.pop("message") + + def _parse_parent_message_id(data: object) -> Union[None, Unset, str]: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(Union[None, Unset, str], data) + + parent_message_id = _parse_parent_message_id(d.pop("parentMessageId", UNSET)) + + message_input = cls( + message=message, + parent_message_id=parent_message_id, + ) + + message_input.additional_properties = d + return message_input + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/message_type.py b/cirro_api_client/v1/models/message_type.py new file mode 100644 index 0000000..68a8443 --- /dev/null +++ b/cirro_api_client/v1/models/message_type.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class MessageType(str, Enum): + SYSTEM = "SYSTEM" + USER = "USER" + UNKNOWN = "UNKNOWN" + """ This is a fallback value for when the value is not known, do not use this value when making requests """ + + def __str__(self) -> str: + return str(self.value) + + @classmethod + def _missing_(cls, number): + return cls(cls.UNKNOWN) diff --git a/cirro_api_client/v1/models/paginated_response_discussion.py b/cirro_api_client/v1/models/paginated_response_discussion.py new file mode 100644 index 0000000..c0ed35f --- /dev/null +++ b/cirro_api_client/v1/models/paginated_response_discussion.py @@ -0,0 +1,68 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.discussion import Discussion + + +T = TypeVar("T", bound="PaginatedResponseDiscussion") + + +@_attrs_define +class PaginatedResponseDiscussion: + """ + Attributes: + data (List['Discussion']): + next_token (str): + """ + + data: List["Discussion"] + next_token: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + next_token = self.next_token + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "nextToken": next_token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.discussion import Discussion + + d = src_dict.copy() + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Discussion.from_dict(data_item_data) + + data.append(data_item) + + next_token = d.pop("nextToken") + + paginated_response_discussion = cls( + data=data, + next_token=next_token, + ) + + paginated_response_discussion.additional_properties = d + return paginated_response_discussion + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/paginated_response_message.py b/cirro_api_client/v1/models/paginated_response_message.py new file mode 100644 index 0000000..17022c9 --- /dev/null +++ b/cirro_api_client/v1/models/paginated_response_message.py @@ -0,0 +1,68 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.message import Message + + +T = TypeVar("T", bound="PaginatedResponseMessage") + + +@_attrs_define +class PaginatedResponseMessage: + """ + Attributes: + data (List['Message']): + next_token (str): + """ + + data: List["Message"] + next_token: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + next_token = self.next_token + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "nextToken": next_token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.message import Message + + d = src_dict.copy() + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = Message.from_dict(data_item_data) + + data.append(data_item) + + next_token = d.pop("nextToken") + + paginated_response_message = cls( + data=data, + next_token=next_token, + ) + + paginated_response_message.additional_properties = d + return paginated_response_message + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/project_detail.py b/cirro_api_client/v1/models/project_detail.py index 0df8f94..fe1d17c 100644 --- a/cirro_api_client/v1/models/project_detail.py +++ b/cirro_api_client/v1/models/project_detail.py @@ -1,12 +1,11 @@ import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from dateutil.parser import isoparse from ..models.status import Status -from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.cloud_account import CloudAccount @@ -30,13 +29,13 @@ class ProjectDetail: organization (str): status (Status): settings (ProjectSettings): + account (CloudAccount): status_message (str): tags (List['Tag']): classification_ids (List[str]): created_by (str): created_at (datetime.datetime): updated_at (datetime.datetime): - account (Union['CloudAccount', None, Unset]): """ id: str @@ -47,18 +46,16 @@ class ProjectDetail: organization: str status: Status settings: "ProjectSettings" + account: "CloudAccount" status_message: str tags: List["Tag"] classification_ids: List[str] created_by: str created_at: datetime.datetime updated_at: datetime.datetime - account: Union["CloudAccount", None, Unset] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - from ..models.cloud_account import CloudAccount - id = self.id name = self.name @@ -78,6 +75,8 @@ def to_dict(self) -> Dict[str, Any]: settings = self.settings.to_dict() + account = self.account.to_dict() + status_message = self.status_message tags = [] @@ -93,14 +92,6 @@ def to_dict(self) -> Dict[str, Any]: updated_at = self.updated_at.isoformat() - account: Union[Dict[str, Any], None, Unset] - if isinstance(self.account, Unset): - account = UNSET - elif isinstance(self.account, CloudAccount): - account = self.account.to_dict() - else: - account = self.account - field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -113,6 +104,7 @@ def to_dict(self) -> Dict[str, Any]: "organization": organization, "status": status, "settings": settings, + "account": account, "statusMessage": status_message, "tags": tags, "classificationIds": classification_ids, @@ -121,8 +113,6 @@ def to_dict(self) -> Dict[str, Any]: "updatedAt": updated_at, } ) - if account is not UNSET: - field_dict["account"] = account return field_dict @@ -155,6 +145,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: settings = ProjectSettings.from_dict(d.pop("settings")) + account = CloudAccount.from_dict(d.pop("account")) + status_message = d.pop("statusMessage") tags = [] @@ -172,23 +164,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: updated_at = isoparse(d.pop("updatedAt")) - def _parse_account(data: object) -> Union["CloudAccount", None, Unset]: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - account_type_1 = CloudAccount.from_dict(data) - - return account_type_1 - except: # noqa: E722 - pass - return cast(Union["CloudAccount", None, Unset], data) - - account = _parse_account(d.pop("account", UNSET)) - project_detail = cls( id=id, name=name, @@ -198,13 +173,13 @@ def _parse_account(data: object) -> Union["CloudAccount", None, Unset]: organization=organization, status=status, settings=settings, + account=account, status_message=status_message, tags=tags, classification_ids=classification_ids, created_by=created_by, created_at=created_at, updated_at=updated_at, - account=account, ) project_detail.additional_properties = d diff --git a/cirro_api_client/v1/models/project_requirement.py b/cirro_api_client/v1/models/project_requirement.py index 4d996fe..d73099b 100644 --- a/cirro_api_client/v1/models/project_requirement.py +++ b/cirro_api_client/v1/models/project_requirement.py @@ -27,9 +27,13 @@ class ProjectRequirement: name (str): The name of the requirement description (str): A brief description of the requirement type (GovernanceType): The types of governance requirements that can be enforced - path (str): S3 prefix where files for the requirement are saved + path (str): S3 prefix where the main file for the requirement is saved + supplemental_path (str): S3 prefix where supplemental files for the requirement are saved scope (GovernanceScope): The levels at which governance requirements can be enforced contacts (List['GovernanceContact']): The governance contacts assigned to the requirement. + is_enacted (bool): Whether the requirement is past the enactment date + is_project_configured (bool): A requirement is project configured if it was created by the tenant but needs a + file uploaded by the project is_fulfilled (bool): Whether the current user has fulfilled the requirement for this project acceptance (Union[GovernanceScope, None, Unset]): Specifies the level at which it is satisfied enactment_date (Union[None, Unset, datetime.datetime]): The date of enactment for the requirement @@ -55,8 +59,11 @@ class ProjectRequirement: description: str type: GovernanceType path: str + supplemental_path: str scope: GovernanceScope contacts: List["GovernanceContact"] + is_enacted: bool + is_project_configured: bool is_fulfilled: bool acceptance: Union[GovernanceScope, None, Unset] = UNSET enactment_date: Union[None, Unset, datetime.datetime] = UNSET @@ -86,6 +93,8 @@ def to_dict(self) -> Dict[str, Any]: path = self.path + supplemental_path = self.supplemental_path + scope = self.scope.value contacts = [] @@ -93,6 +102,10 @@ def to_dict(self) -> Dict[str, Any]: contacts_item = contacts_item_data.to_dict() contacts.append(contacts_item) + is_enacted = self.is_enacted + + is_project_configured = self.is_project_configured + is_fulfilled = self.is_fulfilled acceptance: Union[None, Unset, str] @@ -200,8 +213,11 @@ def to_dict(self) -> Dict[str, Any]: "description": description, "type": type, "path": path, + "supplementalPath": supplemental_path, "scope": scope, "contacts": contacts, + "isEnacted": is_enacted, + "isProjectConfigured": is_project_configured, "isFulfilled": is_fulfilled, } ) @@ -250,6 +266,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: path = d.pop("path") + supplemental_path = d.pop("supplementalPath") + scope = GovernanceScope(d.pop("scope")) contacts = [] @@ -259,6 +277,10 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: contacts.append(contacts_item) + is_enacted = d.pop("isEnacted") + + is_project_configured = d.pop("isProjectConfigured") + is_fulfilled = d.pop("isFulfilled") def _parse_acceptance(data: object) -> Union[GovernanceScope, None, Unset]: @@ -453,8 +475,11 @@ def _parse_fulfillment_path(data: object) -> Union[None, Unset, str]: description=description, type=type, path=path, + supplemental_path=supplemental_path, scope=scope, contacts=contacts, + is_enacted=is_enacted, + is_project_configured=is_project_configured, is_fulfilled=is_fulfilled, acceptance=acceptance, enactment_date=enactment_date, diff --git a/cirro_api_client/v1/models/run_analysis_request.py b/cirro_api_client/v1/models/run_analysis_request.py index 3025a3b..3aec141 100644 --- a/cirro_api_client/v1/models/run_analysis_request.py +++ b/cirro_api_client/v1/models/run_analysis_request.py @@ -7,6 +7,7 @@ if TYPE_CHECKING: from ..models.run_analysis_request_params import RunAnalysisRequestParams + from ..models.run_analysis_request_source_sample_files_map import RunAnalysisRequestSourceSampleFilesMap T = TypeVar("T", bound="RunAnalysisRequest") @@ -24,6 +25,9 @@ class RunAnalysisRequest: description (Union[None, Unset, str]): Description of the dataset (optional) source_sample_ids (Union[List[str], None, Unset]): Samples within the source datasets that will be used as inputs to this workflow. If not specified, all samples will be used. + source_sample_files_map (Union['RunAnalysisRequestSourceSampleFilesMap', None, Unset]): Files containing samples + used to define source data input to this workflow. If not specified, all files will be used. Keys are sampleIds, + and the lists are file paths to include. resume_dataset_id (Union[None, Unset, str]): Used for caching task execution. If the parameters are the same as the dataset specified here, it will re-use the output to minimize duplicate work compute_environment_id (Union[None, Unset, str]): The compute environment where to run the workflow, if not @@ -37,11 +41,14 @@ class RunAnalysisRequest: notification_emails: List[str] description: Union[None, Unset, str] = UNSET source_sample_ids: Union[List[str], None, Unset] = UNSET + source_sample_files_map: Union["RunAnalysisRequestSourceSampleFilesMap", None, Unset] = UNSET resume_dataset_id: Union[None, Unset, str] = UNSET compute_environment_id: Union[None, Unset, str] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + from ..models.run_analysis_request_source_sample_files_map import RunAnalysisRequestSourceSampleFilesMap + name = self.name process_id = self.process_id @@ -67,6 +74,14 @@ def to_dict(self) -> Dict[str, Any]: else: source_sample_ids = self.source_sample_ids + source_sample_files_map: Union[Dict[str, Any], None, Unset] + if isinstance(self.source_sample_files_map, Unset): + source_sample_files_map = UNSET + elif isinstance(self.source_sample_files_map, RunAnalysisRequestSourceSampleFilesMap): + source_sample_files_map = self.source_sample_files_map.to_dict() + else: + source_sample_files_map = self.source_sample_files_map + resume_dataset_id: Union[None, Unset, str] if isinstance(self.resume_dataset_id, Unset): resume_dataset_id = UNSET @@ -94,6 +109,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["description"] = description if source_sample_ids is not UNSET: field_dict["sourceSampleIds"] = source_sample_ids + if source_sample_files_map is not UNSET: + field_dict["sourceSampleFilesMap"] = source_sample_files_map if resume_dataset_id is not UNSET: field_dict["resumeDatasetId"] = resume_dataset_id if compute_environment_id is not UNSET: @@ -104,6 +121,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.run_analysis_request_params import RunAnalysisRequestParams + from ..models.run_analysis_request_source_sample_files_map import RunAnalysisRequestSourceSampleFilesMap d = src_dict.copy() name = d.pop("name") @@ -142,6 +160,25 @@ def _parse_source_sample_ids(data: object) -> Union[List[str], None, Unset]: source_sample_ids = _parse_source_sample_ids(d.pop("sourceSampleIds", UNSET)) + def _parse_source_sample_files_map( + data: object, + ) -> Union["RunAnalysisRequestSourceSampleFilesMap", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + source_sample_files_map_type_0 = RunAnalysisRequestSourceSampleFilesMap.from_dict(data) + + return source_sample_files_map_type_0 + except: # noqa: E722 + pass + return cast(Union["RunAnalysisRequestSourceSampleFilesMap", None, Unset], data) + + source_sample_files_map = _parse_source_sample_files_map(d.pop("sourceSampleFilesMap", UNSET)) + def _parse_resume_dataset_id(data: object) -> Union[None, Unset, str]: if data is None: return data @@ -168,6 +205,7 @@ def _parse_compute_environment_id(data: object) -> Union[None, Unset, str]: notification_emails=notification_emails, description=description, source_sample_ids=source_sample_ids, + source_sample_files_map=source_sample_files_map, resume_dataset_id=resume_dataset_id, compute_environment_id=compute_environment_id, ) diff --git a/cirro_api_client/v1/models/run_analysis_request_source_sample_files_map.py b/cirro_api_client/v1/models/run_analysis_request_source_sample_files_map.py new file mode 100644 index 0000000..544a69a --- /dev/null +++ b/cirro_api_client/v1/models/run_analysis_request_source_sample_files_map.py @@ -0,0 +1,43 @@ +from typing import Any, Dict, List, Type, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RunAnalysisRequestSourceSampleFilesMap") + + +@_attrs_define +class RunAnalysisRequestSourceSampleFilesMap: + """Files containing samples used to define source data input to this workflow. If not specified, all files will be + used. Keys are sampleIds, and the lists are file paths to include. + + """ + + additional_properties: Dict[str, List[str]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + run_analysis_request_source_sample_files_map = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = cast(List[str], prop_dict) + + additional_properties[prop_name] = additional_property + + run_analysis_request_source_sample_files_map.additional_properties = additional_properties + return run_analysis_request_source_sample_files_map + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/sample_sheets.py b/cirro_api_client/v1/models/sample_sheets.py new file mode 100644 index 0000000..91dab4b --- /dev/null +++ b/cirro_api_client/v1/models/sample_sheets.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SampleSheets") + + +@_attrs_define +class SampleSheets: + """ + Attributes: + samples (Union[Unset, str]): Written to samplesheet.csv, available as ds.samplesheet in preprocess + files (Union[Unset, str]): Written to files.csv, available as ds.files in preprocess + """ + + samples: Union[Unset, str] = UNSET + files: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + samples = self.samples + + files = self.files + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if samples is not UNSET: + field_dict["samples"] = samples + if files is not UNSET: + field_dict["files"] = files + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + samples = d.pop("samples", UNSET) + + files = d.pop("files", UNSET) + + sample_sheets = cls( + samples=samples, + files=files, + ) + + sample_sheets.additional_properties = d + return sample_sheets + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/sort_order.py b/cirro_api_client/v1/models/sort_order.py new file mode 100644 index 0000000..b383e39 --- /dev/null +++ b/cirro_api_client/v1/models/sort_order.py @@ -0,0 +1,15 @@ +from enum import Enum + + +class SortOrder(str, Enum): + ASCENDING = "ASCENDING" + DESCENDING = "DESCENDING" + UNKNOWN = "UNKNOWN" + """ This is a fallback value for when the value is not known, do not use this value when making requests """ + + def __str__(self) -> str: + return str(self.value) + + @classmethod + def _missing_(cls, number): + return cls(cls.UNKNOWN) diff --git a/cirro_api_client/v1/models/user_detail.py b/cirro_api_client/v1/models/user_detail.py index 88ed2a2..b78e335 100644 --- a/cirro_api_client/v1/models/user_detail.py +++ b/cirro_api_client/v1/models/user_detail.py @@ -31,6 +31,7 @@ class UserDetail: groups (List[str]): settings (UserSettings): Additional settings for the user sign_up_time (Union[None, Unset, datetime.datetime]): + last_signed_in (Union[None, Unset, datetime.datetime]): """ username: str @@ -45,6 +46,7 @@ class UserDetail: groups: List[str] settings: "UserSettings" sign_up_time: Union[None, Unset, datetime.datetime] = UNSET + last_signed_in: Union[None, Unset, datetime.datetime] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: @@ -81,6 +83,14 @@ def to_dict(self) -> Dict[str, Any]: else: sign_up_time = self.sign_up_time + last_signed_in: Union[None, Unset, str] + if isinstance(self.last_signed_in, Unset): + last_signed_in = UNSET + elif isinstance(self.last_signed_in, datetime.datetime): + last_signed_in = self.last_signed_in.isoformat() + else: + last_signed_in = self.last_signed_in + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -100,6 +110,8 @@ def to_dict(self) -> Dict[str, Any]: ) if sign_up_time is not UNSET: field_dict["signUpTime"] = sign_up_time + if last_signed_in is not UNSET: + field_dict["lastSignedIn"] = last_signed_in return field_dict @@ -153,6 +165,23 @@ def _parse_sign_up_time(data: object) -> Union[None, Unset, datetime.datetime]: sign_up_time = _parse_sign_up_time(d.pop("signUpTime", UNSET)) + def _parse_last_signed_in(data: object) -> Union[None, Unset, datetime.datetime]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + last_signed_in_type_0 = isoparse(data) + + return last_signed_in_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + last_signed_in = _parse_last_signed_in(d.pop("lastSignedIn", UNSET)) + user_detail = cls( username=username, name=name, @@ -166,6 +195,7 @@ def _parse_sign_up_time(data: object) -> Union[None, Unset, datetime.datetime]: groups=groups, settings=settings, sign_up_time=sign_up_time, + last_signed_in=last_signed_in, ) user_detail.additional_properties = d diff --git a/config.yml b/config.yml index e7323a2..36827d2 100644 --- a/config.yml +++ b/config.yml @@ -23,3 +23,7 @@ class_overrides: class_name: AuditEventEventDetail ComputeEnvironmentConfigurationInputPropertiesType0: class_name: ComputeEnvironmentConfigurationInputProperties + GovernanceRequirementProjectFileMapType0: + class_name: GovernanceRequirementProjectFileMap + RunAnalysisRequestSourceSampleFilesMapType0: + class_name: RunAnalysisRequestSourceSampleFilesMap From e956d1bef095d2b8f6c139cc7236c2ab63a772a1 Mon Sep 17 00:00:00 2001 From: Nathan Thorpe Date: Thu, 31 Jul 2025 10:13:27 -0700 Subject: [PATCH 2/3] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 66f81db..f90db31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cirro_api_client" -version = "1.0.3" +version = "1.1.0" description = "A client library for accessing Cirro" authors = ["Cirro "] license = "MIT" From 8b6152b4aa017b8df42a8bd143d7a883e01d9367 Mon Sep 17 00:00:00 2001 From: Nathan Thorpe Date: Thu, 31 Jul 2025 13:35:53 -0700 Subject: [PATCH 3/3] add validate file name patterns endpoint --- .../processes/validate_file_name_patterns.py | 191 ++++++++++++++++++ cirro_api_client/v1/models/__init__.py | 4 + cirro_api_client/v1/models/file_name_match.py | 62 ++++++ .../validate_file_name_patterns_request.py | 54 +++++ 4 files changed, 311 insertions(+) create mode 100644 cirro_api_client/v1/api/processes/validate_file_name_patterns.py create mode 100644 cirro_api_client/v1/models/file_name_match.py create mode 100644 cirro_api_client/v1/models/validate_file_name_patterns_request.py diff --git a/cirro_api_client/v1/api/processes/validate_file_name_patterns.py b/cirro_api_client/v1/api/processes/validate_file_name_patterns.py new file mode 100644 index 0000000..e7b213d --- /dev/null +++ b/cirro_api_client/v1/api/processes/validate_file_name_patterns.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional + +import httpx + +from ... import errors +from ...client import Client +from ...models.file_name_match import FileNameMatch +from ...models.validate_file_name_patterns_request import ValidateFileNamePatternsRequest +from ...types import Response + + +def _get_kwargs( + process_id: str, + *, + body: ValidateFileNamePatternsRequest, +) -> Dict[str, Any]: + headers: Dict[str, Any] = {} + + _kwargs: Dict[str, Any] = { + "method": "post", + "url": f"/processes/{process_id}/validate-files:test", + } + + _body = body.to_dict() + + _kwargs["json"] = _body + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[List["FileNameMatch"]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = FileNameMatch.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + errors.handle_error_response(response, client.raise_on_unexpected_status) + + +def _build_response(*, client: Client, response: httpx.Response) -> Response[List["FileNameMatch"]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + process_id: str, + *, + client: Client, + body: ValidateFileNamePatternsRequest, +) -> Response[List["FileNameMatch"]]: + """Validate file name patterns + + Checks the input file names with the patterns for testing regex matching + + Args: + process_id (str): + body (ValidateFileNamePatternsRequest): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['FileNameMatch']] + """ + + kwargs = _get_kwargs( + process_id=process_id, + body=body, + ) + + response = client.get_httpx_client().request( + auth=client.get_auth(), + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + process_id: str, + *, + client: Client, + body: ValidateFileNamePatternsRequest, +) -> Optional[List["FileNameMatch"]]: + """Validate file name patterns + + Checks the input file names with the patterns for testing regex matching + + Args: + process_id (str): + body (ValidateFileNamePatternsRequest): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['FileNameMatch'] + """ + + try: + return sync_detailed( + process_id=process_id, + client=client, + body=body, + ).parsed + except errors.NotFoundException: + return None + + +async def asyncio_detailed( + process_id: str, + *, + client: Client, + body: ValidateFileNamePatternsRequest, +) -> Response[List["FileNameMatch"]]: + """Validate file name patterns + + Checks the input file names with the patterns for testing regex matching + + Args: + process_id (str): + body (ValidateFileNamePatternsRequest): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[List['FileNameMatch']] + """ + + kwargs = _get_kwargs( + process_id=process_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + process_id: str, + *, + client: Client, + body: ValidateFileNamePatternsRequest, +) -> Optional[List["FileNameMatch"]]: + """Validate file name patterns + + Checks the input file names with the patterns for testing regex matching + + Args: + process_id (str): + body (ValidateFileNamePatternsRequest): + client (Client): instance of the API client + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + List['FileNameMatch'] + """ + + try: + return ( + await asyncio_detailed( + process_id=process_id, + client=client, + body=body, + ) + ).parsed + except errors.NotFoundException: + return None diff --git a/cirro_api_client/v1/models/__init__.py b/cirro_api_client/v1/models/__init__.py index a180ab2..17617b0 100644 --- a/cirro_api_client/v1/models/__init__.py +++ b/cirro_api_client/v1/models/__init__.py @@ -71,6 +71,7 @@ from .file_entry import FileEntry from .file_entry_metadata import FileEntryMetadata from .file_mapping_rule import FileMappingRule +from .file_name_match import FileNameMatch from .file_name_pattern import FileNamePattern from .file_requirements import FileRequirements from .form_schema import FormSchema @@ -174,6 +175,7 @@ from .user_detail import UserDetail from .user_project_assignment import UserProjectAssignment from .user_settings import UserSettings +from .validate_file_name_patterns_request import ValidateFileNamePatternsRequest from .validate_file_requirements_request import ValidateFileRequirementsRequest __all__ = ( @@ -248,6 +250,7 @@ "FileEntry", "FileEntryMetadata", "FileMappingRule", + "FileNameMatch", "FileNamePattern", "FileRequirements", "FormSchema", @@ -351,5 +354,6 @@ "UserDetail", "UserProjectAssignment", "UserSettings", + "ValidateFileNamePatternsRequest", "ValidateFileRequirementsRequest", ) diff --git a/cirro_api_client/v1/models/file_name_match.py b/cirro_api_client/v1/models/file_name_match.py new file mode 100644 index 0000000..dc89802 --- /dev/null +++ b/cirro_api_client/v1/models/file_name_match.py @@ -0,0 +1,62 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="FileNameMatch") + + +@_attrs_define +class FileNameMatch: + """ + Attributes: + file_name (str): + sample_name (str): + regex_pattern_match (str): + """ + + file_name: str + sample_name: str + regex_pattern_match: str + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + file_name = self.file_name + + sample_name = self.sample_name + + regex_pattern_match = self.regex_pattern_match + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "fileName": file_name, + "sampleName": sample_name, + "regexPatternMatch": regex_pattern_match, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + file_name = d.pop("fileName") + + sample_name = d.pop("sampleName") + + regex_pattern_match = d.pop("regexPatternMatch") + + file_name_match = cls( + file_name=file_name, + sample_name=sample_name, + regex_pattern_match=regex_pattern_match, + ) + + file_name_match.additional_properties = d + return file_name_match + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/validate_file_name_patterns_request.py b/cirro_api_client/v1/models/validate_file_name_patterns_request.py new file mode 100644 index 0000000..32dfb97 --- /dev/null +++ b/cirro_api_client/v1/models/validate_file_name_patterns_request.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, List, Type, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ValidateFileNamePatternsRequest") + + +@_attrs_define +class ValidateFileNamePatternsRequest: + """ + Attributes: + file_names (List[str]): + file_name_patterns (List[str]): + """ + + file_names: List[str] + file_name_patterns: List[str] + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + file_names = self.file_names + + file_name_patterns = self.file_name_patterns + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "fileNames": file_names, + "fileNamePatterns": file_name_patterns, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + file_names = cast(List[str], d.pop("fileNames")) + + file_name_patterns = cast(List[str], d.pop("fileNamePatterns")) + + validate_file_name_patterns_request = cls( + file_names=file_names, + file_name_patterns=file_name_patterns, + ) + + validate_file_name_patterns_request.additional_properties = d + return validate_file_name_patterns_request + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys())