diff --git a/cirro_api_client/cirro_client.py b/cirro_api_client/cirro_client.py index 5b9e8d8..da88574 100644 --- a/cirro_api_client/cirro_client.py +++ b/cirro_api_client/cirro_client.py @@ -49,6 +49,8 @@ class CirroApiClient(Client): raise_on_unexpected_status: bool = field(default=True, kw_only=True) client_name: str = field(kw_only=True, default="Cirro API Client") package_name: str = field(kw_only=True, default="cirro-api-client") + user_agent: str = field(init=False, default=None) def __attrs_post_init__(self): - self._headers["User-Agent"] = _get_user_agent(self.package_name, self.client_name) + self.user_agent = _get_user_agent(self.package_name, self.client_name) + self._headers["User-Agent"] = self.user_agent diff --git a/cirro_api_client/v1/api/billing/generate_billing_report.py b/cirro_api_client/v1/api/billing/generate_billing_report.py deleted file mode 100644 index 38003ad..0000000 --- a/cirro_api_client/v1/api/billing/generate_billing_report.py +++ /dev/null @@ -1,79 +0,0 @@ -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() -> Dict[str, Any]: - _kwargs: Dict[str, Any] = { - "method": "get", - "url": "/billing-report", - } - - return _kwargs - - -def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Any]: - 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( - *, - client: Client, -) -> Response[Any]: - """Generate billing report - - Generates a billing report xlsx with cost information - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - auth=client.get_auth(), - **kwargs, - ) - - return _build_response(client=client, response=response) - - -async def asyncio_detailed( - *, - client: Client, -) -> Response[Any]: - """Generate billing report - - Generates a billing report xlsx with cost information - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Any] - """ - - kwargs = _get_kwargs() - - 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.py b/cirro_api_client/v1/api/governance/get_requirements.py index 5fc2785..162e6cf 100644 --- a/cirro_api_client/v1/api/governance/get_requirements.py +++ b/cirro_api_client/v1/api/governance/get_requirements.py @@ -1,18 +1,28 @@ 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.governance_requirement import GovernanceRequirement -from ...types import Response +from ...types import UNSET, Response, Unset -def _get_kwargs() -> Dict[str, Any]: +def _get_kwargs( + *, + project_id: Union[Unset, str] = UNSET, +) -> Dict[str, Any]: + params: Dict[str, Any] = {} + + params["projectId"] = project_id + + 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": "/governance/requirements", + "params": params, } return _kwargs @@ -44,11 +54,16 @@ def _build_response(*, client: Client, response: httpx.Response) -> Response[Lis def sync_detailed( *, client: Client, + project_id: Union[Unset, str] = UNSET, ) -> Response[List["GovernanceRequirement"]]: """Get requirements Retrieve a list of governance requirements + Args: + project_id (Union[Unset, 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. @@ -57,7 +72,9 @@ def sync_detailed( Response[List['GovernanceRequirement']] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + project_id=project_id, + ) response = client.get_httpx_client().request( auth=client.get_auth(), @@ -70,11 +87,16 @@ def sync_detailed( def sync( *, client: Client, + project_id: Union[Unset, str] = UNSET, ) -> Optional[List["GovernanceRequirement"]]: """Get requirements Retrieve a list of governance requirements + Args: + project_id (Union[Unset, 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. @@ -86,6 +108,7 @@ def sync( try: return sync_detailed( client=client, + project_id=project_id, ).parsed except errors.NotFoundException: return None @@ -94,11 +117,16 @@ def sync( async def asyncio_detailed( *, client: Client, + project_id: Union[Unset, str] = UNSET, ) -> Response[List["GovernanceRequirement"]]: """Get requirements Retrieve a list of governance requirements + Args: + project_id (Union[Unset, 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. @@ -107,7 +135,9 @@ async def asyncio_detailed( Response[List['GovernanceRequirement']] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + project_id=project_id, + ) response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs) @@ -117,11 +147,16 @@ async def asyncio_detailed( async def asyncio( *, client: Client, + project_id: Union[Unset, str] = UNSET, ) -> Optional[List["GovernanceRequirement"]]: """Get requirements Retrieve a list of governance requirements + Args: + project_id (Union[Unset, 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. @@ -134,6 +169,7 @@ async def asyncio( return ( await asyncio_detailed( client=client, + project_id=project_id, ) ).parsed except errors.NotFoundException: diff --git a/cirro_api_client/v1/api/metadata/get_dataset_samples.py b/cirro_api_client/v1/api/metadata/get_dataset_samples.py new file mode 100644 index 0000000..bd4d0bb --- /dev/null +++ b/cirro_api_client/v1/api/metadata/get_dataset_samples.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any, Dict, List, 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, + dataset_id: str, +) -> Dict[str, Any]: + _kwargs: Dict[str, Any] = { + "method": "get", + "url": f"/projects/{project_id}/datasets/{dataset_id}/samples", + } + + return _kwargs + + +def _parse_response(*, client: Client, response: httpx.Response) -> Optional[List["Sample"]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = Sample.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["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, + dataset_id: str, + *, + client: Client, +) -> Response[List["Sample"]]: + """Get dataset samples + + Retrieves a list of samples associated with a dataset along with their metadata + + 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[List['Sample']] + """ + + 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[List["Sample"]]: + """Get dataset samples + + Retrieves a list of samples associated with a dataset along with their metadata + + 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: + List['Sample'] + """ + + 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[List["Sample"]]: + """Get dataset samples + + Retrieves a list of samples associated with a dataset along with their metadata + + 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[List['Sample']] + """ + + 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[List["Sample"]]: + """Get dataset samples + + Retrieves a list of samples associated with a dataset along with their metadata + + 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: + List['Sample'] + """ + + 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/processes/create_custom_process.py b/cirro_api_client/v1/api/processes/create_custom_process.py index f2a2376..f0e4ad2 100644 --- a/cirro_api_client/v1/api/processes/create_custom_process.py +++ b/cirro_api_client/v1/api/processes/create_custom_process.py @@ -6,15 +6,15 @@ from ... import errors from ...client import Client from ...models.create_response import CreateResponse +from ...models.custom_process_input import CustomProcessInput from ...models.error_message import ErrorMessage from ...models.portal_error_response import PortalErrorResponse -from ...models.process_detail import ProcessDetail from ...types import Response def _get_kwargs( *, - body: ProcessDetail, + body: CustomProcessInput, ) -> Dict[str, Any]: headers: Dict[str, Any] = {} @@ -65,14 +65,14 @@ def _build_response( def sync_detailed( *, client: Client, - body: ProcessDetail, + body: CustomProcessInput, ) -> Response[Union[CreateResponse, ErrorMessage, PortalErrorResponse]]: """Create custom process Creates a custom data type or pipeline which you can use in the listed projects. Args: - body (ProcessDetail): + body (CustomProcessInput): client (Client): instance of the API client Raises: @@ -98,14 +98,14 @@ def sync_detailed( def sync( *, client: Client, - body: ProcessDetail, + body: CustomProcessInput, ) -> Optional[Union[CreateResponse, ErrorMessage, PortalErrorResponse]]: """Create custom process Creates a custom data type or pipeline which you can use in the listed projects. Args: - body (ProcessDetail): + body (CustomProcessInput): client (Client): instance of the API client Raises: @@ -128,14 +128,14 @@ def sync( async def asyncio_detailed( *, client: Client, - body: ProcessDetail, + body: CustomProcessInput, ) -> Response[Union[CreateResponse, ErrorMessage, PortalErrorResponse]]: """Create custom process Creates a custom data type or pipeline which you can use in the listed projects. Args: - body (ProcessDetail): + body (CustomProcessInput): client (Client): instance of the API client Raises: @@ -158,14 +158,14 @@ async def asyncio_detailed( async def asyncio( *, client: Client, - body: ProcessDetail, + body: CustomProcessInput, ) -> Optional[Union[CreateResponse, ErrorMessage, PortalErrorResponse]]: """Create custom process Creates a custom data type or pipeline which you can use in the listed projects. Args: - body (ProcessDetail): + body (CustomProcessInput): client (Client): instance of the API client Raises: diff --git a/cirro_api_client/v1/api/processes/update_custom_process.py b/cirro_api_client/v1/api/processes/update_custom_process.py index 8bdd110..8de47b3 100644 --- a/cirro_api_client/v1/api/processes/update_custom_process.py +++ b/cirro_api_client/v1/api/processes/update_custom_process.py @@ -5,14 +5,14 @@ from ... import errors from ...client import Client -from ...models.process_detail import ProcessDetail +from ...models.custom_process_input import CustomProcessInput from ...types import Response def _get_kwargs( process_id: str, *, - body: ProcessDetail, + body: CustomProcessInput, ) -> Dict[str, Any]: headers: Dict[str, Any] = {} @@ -50,7 +50,7 @@ def sync_detailed( process_id: str, *, client: Client, - body: ProcessDetail, + body: CustomProcessInput, ) -> Response[Any]: """Update custom process @@ -58,7 +58,7 @@ def sync_detailed( Args: process_id (str): - body (ProcessDetail): + body (CustomProcessInput): client (Client): instance of the API client Raises: @@ -86,7 +86,7 @@ async def asyncio_detailed( process_id: str, *, client: Client, - body: ProcessDetail, + body: CustomProcessInput, ) -> Response[Any]: """Update custom process @@ -94,7 +94,7 @@ async def asyncio_detailed( Args: process_id (str): - body (ProcessDetail): + body (CustomProcessInput): client (Client): instance of the API client Raises: diff --git a/cirro_api_client/v1/models/__init__.py b/cirro_api_client/v1/models/__init__.py index dd7bd04..cfd405a 100644 --- a/cirro_api_client/v1/models/__init__.py +++ b/cirro_api_client/v1/models/__init__.py @@ -40,6 +40,7 @@ from .create_reference_request import CreateReferenceRequest from .create_response import CreateResponse from .custom_pipeline_settings import CustomPipelineSettings +from .custom_process_input import CustomProcessInput from .customer_type import CustomerType from .dashboard import Dashboard from .dashboard_dashboard_data import DashboardDashboardData @@ -47,6 +48,8 @@ from .dashboard_request import DashboardRequest from .dashboard_request_dashboard_data import DashboardRequestDashboardData from .dashboard_request_info import DashboardRequestInfo +from .data_file import DataFile +from .data_file_metadata import DataFileMetadata from .dataset import Dataset from .dataset_assets_manifest import DatasetAssetsManifest from .dataset_condition import DatasetCondition @@ -149,12 +152,12 @@ from .tenant_info import TenantInfo from .update_dataset_request import UpdateDatasetRequest from .update_user_request import UpdateUserRequest -from .update_user_request_settings import UpdateUserRequestSettings from .upload_dataset_create_response import UploadDatasetCreateResponse from .upload_dataset_request import UploadDatasetRequest from .user import User from .user_detail import UserDetail from .user_project_assignment import UserProjectAssignment +from .user_settings import UserSettings from .validate_file_requirements_request import ValidateFileRequirementsRequest __all__ = ( @@ -199,12 +202,15 @@ "CreateResponse", "CustomerType", "CustomPipelineSettings", + "CustomProcessInput", "Dashboard", "DashboardDashboardData", "DashboardInfo", "DashboardRequest", "DashboardRequestDashboardData", "DashboardRequestInfo", + "DataFile", + "DataFileMetadata", "Dataset", "DatasetAssetsManifest", "DatasetCondition", @@ -307,11 +313,11 @@ "TenantInfo", "UpdateDatasetRequest", "UpdateUserRequest", - "UpdateUserRequestSettings", "UploadDatasetCreateResponse", "UploadDatasetRequest", "User", "UserDetail", "UserProjectAssignment", + "UserSettings", "ValidateFileRequirementsRequest", ) diff --git a/cirro_api_client/v1/models/custom_process_input.py b/cirro_api_client/v1/models/custom_process_input.py new file mode 100644 index 0000000..2bb8758 --- /dev/null +++ b/cirro_api_client/v1/models/custom_process_input.py @@ -0,0 +1,326 @@ +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 ..models.executor import Executor +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.custom_pipeline_settings import CustomPipelineSettings + from ..models.file_mapping_rule import FileMappingRule + from ..models.pipeline_code import PipelineCode + + +T = TypeVar("T", bound="CustomProcessInput") + + +@_attrs_define +class CustomProcessInput: + """ + Attributes: + id (str): Unique ID of the Process Example: process-hutch-magic_flute-1_0. + name (str): Friendly name for the process Example: MAGeCK Flute. + description (str): Description of the process Example: MAGeCK Flute enables accurate identification of essential + genes with their related biological functions. + executor (Executor): How the workflow is executed + child_process_ids (List[str]): IDs of pipelines that can be run downstream + parent_process_ids (List[str]): IDs of processes that can run this pipeline + linked_project_ids (List[str]): Projects that can run this process + data_type (Union[None, Unset, str]): Name of the data type this pipeline produces (if it is not defined, use the + name) + category (Union[Unset, str]): Category of the process Example: Microbial Analysis. + pipeline_type (Union[Unset, str]): Type of pipeline Example: nf-core. + documentation_url (Union[None, Unset, str]): Link to process documentation Example: + https://docs.cirro.bio/pipelines/catalog_targeted_sequencing/#crispr-screen-analysis. + file_requirements_message (Union[None, Unset, str]): Description of the files to be uploaded (optional) + pipeline_code (Union['PipelineCode', None, Unset]): + is_tenant_wide (Union[Unset, bool]): Whether the process is shared with the tenant + allow_multiple_sources (Union[Unset, bool]): Whether the pipeline is allowed to have multiple dataset sources + uses_sample_sheet (Union[Unset, bool]): Whether the pipeline uses the Cirro-provided sample sheet + custom_settings (Union['CustomPipelineSettings', None, Unset]): + is_archived (Union[Unset, bool]): Whether the process is marked as archived + file_mapping_rules (Union[List['FileMappingRule'], None, Unset]): + """ + + id: str + name: str + description: str + executor: Executor + child_process_ids: List[str] + parent_process_ids: List[str] + linked_project_ids: List[str] + data_type: Union[None, Unset, str] = UNSET + category: Union[Unset, str] = UNSET + pipeline_type: Union[Unset, str] = UNSET + documentation_url: Union[None, Unset, str] = UNSET + file_requirements_message: Union[None, Unset, str] = UNSET + pipeline_code: Union["PipelineCode", None, Unset] = UNSET + is_tenant_wide: Union[Unset, bool] = UNSET + allow_multiple_sources: Union[Unset, bool] = UNSET + uses_sample_sheet: Union[Unset, bool] = UNSET + custom_settings: Union["CustomPipelineSettings", None, Unset] = UNSET + is_archived: Union[Unset, bool] = UNSET + file_mapping_rules: Union[List["FileMappingRule"], None, Unset] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + from ..models.custom_pipeline_settings import CustomPipelineSettings + from ..models.pipeline_code import PipelineCode + + id = self.id + + name = self.name + + description = self.description + + executor = self.executor.value + + child_process_ids = self.child_process_ids + + parent_process_ids = self.parent_process_ids + + linked_project_ids = self.linked_project_ids + + data_type: Union[None, Unset, str] + if isinstance(self.data_type, Unset): + data_type = UNSET + else: + data_type = self.data_type + + category = self.category + + pipeline_type = self.pipeline_type + + documentation_url: Union[None, Unset, str] + if isinstance(self.documentation_url, Unset): + documentation_url = UNSET + else: + documentation_url = self.documentation_url + + file_requirements_message: Union[None, Unset, str] + if isinstance(self.file_requirements_message, Unset): + file_requirements_message = UNSET + else: + file_requirements_message = self.file_requirements_message + + pipeline_code: Union[Dict[str, Any], None, Unset] + if isinstance(self.pipeline_code, Unset): + pipeline_code = UNSET + elif isinstance(self.pipeline_code, PipelineCode): + pipeline_code = self.pipeline_code.to_dict() + else: + pipeline_code = self.pipeline_code + + is_tenant_wide = self.is_tenant_wide + + allow_multiple_sources = self.allow_multiple_sources + + uses_sample_sheet = self.uses_sample_sheet + + custom_settings: Union[Dict[str, Any], None, Unset] + if isinstance(self.custom_settings, Unset): + custom_settings = UNSET + elif isinstance(self.custom_settings, CustomPipelineSettings): + custom_settings = self.custom_settings.to_dict() + else: + custom_settings = self.custom_settings + + is_archived = self.is_archived + + file_mapping_rules: Union[List[Dict[str, Any]], None, Unset] + if isinstance(self.file_mapping_rules, Unset): + file_mapping_rules = UNSET + elif isinstance(self.file_mapping_rules, list): + file_mapping_rules = [] + for file_mapping_rules_type_0_item_data in self.file_mapping_rules: + file_mapping_rules_type_0_item = file_mapping_rules_type_0_item_data.to_dict() + file_mapping_rules.append(file_mapping_rules_type_0_item) + + else: + file_mapping_rules = self.file_mapping_rules + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "description": description, + "executor": executor, + "childProcessIds": child_process_ids, + "parentProcessIds": parent_process_ids, + "linkedProjectIds": linked_project_ids, + } + ) + if data_type is not UNSET: + field_dict["dataType"] = data_type + if category is not UNSET: + field_dict["category"] = category + if pipeline_type is not UNSET: + field_dict["pipelineType"] = pipeline_type + if documentation_url is not UNSET: + field_dict["documentationUrl"] = documentation_url + if file_requirements_message is not UNSET: + field_dict["fileRequirementsMessage"] = file_requirements_message + if pipeline_code is not UNSET: + field_dict["pipelineCode"] = pipeline_code + if is_tenant_wide is not UNSET: + field_dict["isTenantWide"] = is_tenant_wide + if allow_multiple_sources is not UNSET: + field_dict["allowMultipleSources"] = allow_multiple_sources + if uses_sample_sheet is not UNSET: + field_dict["usesSampleSheet"] = uses_sample_sheet + if custom_settings is not UNSET: + field_dict["customSettings"] = custom_settings + if is_archived is not UNSET: + field_dict["isArchived"] = is_archived + if file_mapping_rules is not UNSET: + field_dict["fileMappingRules"] = file_mapping_rules + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.custom_pipeline_settings import CustomPipelineSettings + from ..models.file_mapping_rule import FileMappingRule + from ..models.pipeline_code import PipelineCode + + d = src_dict.copy() + id = d.pop("id") + + name = d.pop("name") + + description = d.pop("description") + + executor = Executor(d.pop("executor")) + + child_process_ids = cast(List[str], d.pop("childProcessIds")) + + parent_process_ids = cast(List[str], d.pop("parentProcessIds")) + + linked_project_ids = cast(List[str], d.pop("linkedProjectIds")) + + def _parse_data_type(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) + + data_type = _parse_data_type(d.pop("dataType", UNSET)) + + category = d.pop("category", UNSET) + + pipeline_type = d.pop("pipelineType", UNSET) + + def _parse_documentation_url(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) + + documentation_url = _parse_documentation_url(d.pop("documentationUrl", UNSET)) + + def _parse_file_requirements_message(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) + + file_requirements_message = _parse_file_requirements_message(d.pop("fileRequirementsMessage", UNSET)) + + def _parse_pipeline_code(data: object) -> Union["PipelineCode", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pipeline_code_type_1 = PipelineCode.from_dict(data) + + return pipeline_code_type_1 + except: # noqa: E722 + pass + return cast(Union["PipelineCode", None, Unset], data) + + pipeline_code = _parse_pipeline_code(d.pop("pipelineCode", UNSET)) + + is_tenant_wide = d.pop("isTenantWide", UNSET) + + allow_multiple_sources = d.pop("allowMultipleSources", UNSET) + + uses_sample_sheet = d.pop("usesSampleSheet", UNSET) + + def _parse_custom_settings(data: object) -> Union["CustomPipelineSettings", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + custom_settings_type_1 = CustomPipelineSettings.from_dict(data) + + return custom_settings_type_1 + except: # noqa: E722 + pass + return cast(Union["CustomPipelineSettings", None, Unset], data) + + custom_settings = _parse_custom_settings(d.pop("customSettings", UNSET)) + + is_archived = d.pop("isArchived", UNSET) + + def _parse_file_mapping_rules(data: object) -> Union[List["FileMappingRule"], None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + file_mapping_rules_type_0 = [] + _file_mapping_rules_type_0 = data + for file_mapping_rules_type_0_item_data in _file_mapping_rules_type_0: + file_mapping_rules_type_0_item = FileMappingRule.from_dict(file_mapping_rules_type_0_item_data) + + file_mapping_rules_type_0.append(file_mapping_rules_type_0_item) + + return file_mapping_rules_type_0 + except: # noqa: E722 + pass + return cast(Union[List["FileMappingRule"], None, Unset], data) + + file_mapping_rules = _parse_file_mapping_rules(d.pop("fileMappingRules", UNSET)) + + custom_process_input = cls( + id=id, + name=name, + description=description, + executor=executor, + child_process_ids=child_process_ids, + parent_process_ids=parent_process_ids, + linked_project_ids=linked_project_ids, + data_type=data_type, + category=category, + pipeline_type=pipeline_type, + documentation_url=documentation_url, + file_requirements_message=file_requirements_message, + pipeline_code=pipeline_code, + is_tenant_wide=is_tenant_wide, + allow_multiple_sources=allow_multiple_sources, + uses_sample_sheet=uses_sample_sheet, + custom_settings=custom_settings, + is_archived=is_archived, + file_mapping_rules=file_mapping_rules, + ) + + custom_process_input.additional_properties = d + return custom_process_input + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/data_file.py b/cirro_api_client/v1/models/data_file.py new file mode 100644 index 0000000..86a00cc --- /dev/null +++ b/cirro_api_client/v1/models/data_file.py @@ -0,0 +1,60 @@ +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.data_file_metadata import DataFileMetadata + + +T = TypeVar("T", bound="DataFile") + + +@_attrs_define +class DataFile: + """ + Attributes: + path (str): + metadata (DataFileMetadata): + """ + + path: str + metadata: "DataFileMetadata" + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + path = self.path + + metadata = self.metadata.to_dict() + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "path": path, + "metadata": metadata, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.data_file_metadata import DataFileMetadata + + d = src_dict.copy() + path = d.pop("path") + + metadata = DataFileMetadata.from_dict(d.pop("metadata")) + + data_file = cls( + path=path, + metadata=metadata, + ) + + data_file.additional_properties = d + return data_file + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/cirro_api_client/v1/models/update_user_request_settings.py b/cirro_api_client/v1/models/data_file_metadata.py similarity index 69% rename from cirro_api_client/v1/models/update_user_request_settings.py rename to cirro_api_client/v1/models/data_file_metadata.py index 607c360..1080d87 100644 --- a/cirro_api_client/v1/models/update_user_request_settings.py +++ b/cirro_api_client/v1/models/data_file_metadata.py @@ -3,12 +3,12 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="UpdateUserRequestSettings") +T = TypeVar("T", bound="DataFileMetadata") @_attrs_define -class UpdateUserRequestSettings: - """Additional settings for the user""" +class DataFileMetadata: + """ """ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -22,10 +22,10 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - update_user_request_settings = cls() + data_file_metadata = cls() - update_user_request_settings.additional_properties = d - return update_user_request_settings + data_file_metadata.additional_properties = d + return data_file_metadata @property def additional_keys(self) -> List[str]: diff --git a/cirro_api_client/v1/models/governance_requirement.py b/cirro_api_client/v1/models/governance_requirement.py index fd34aa4..e884ad6 100644 --- a/cirro_api_client/v1/models/governance_requirement.py +++ b/cirro_api_client/v1/models/governance_requirement.py @@ -33,6 +33,7 @@ class GovernanceRequirement: created_by (str): created_at (datetime.datetime): updated_at (datetime.datetime): + project_id (Union[Unset, str]): The project ID if the requirement is project scope 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 a requirement supplemental_docs (Union[List['GovernanceFile'], None, Unset]): Optional files with extra information, e.g. @@ -54,6 +55,7 @@ class GovernanceRequirement: created_by: str created_at: datetime.datetime updated_at: datetime.datetime + project_id: Union[Unset, str] = UNSET acceptance: Union[GovernanceScope, None, Unset] = UNSET enactment_date: Union[None, Unset, datetime.datetime] = UNSET supplemental_docs: Union[List["GovernanceFile"], None, Unset] = UNSET @@ -87,6 +89,8 @@ def to_dict(self) -> Dict[str, Any]: updated_at = self.updated_at.isoformat() + project_id = self.project_id + acceptance: Union[None, Unset, str] if isinstance(self.acceptance, Unset): acceptance = UNSET @@ -156,6 +160,8 @@ def to_dict(self) -> Dict[str, Any]: "updatedAt": updated_at, } ) + if project_id is not UNSET: + field_dict["projectId"] = project_id if acceptance is not UNSET: field_dict["acceptance"] = acceptance if enactment_date is not UNSET: @@ -199,6 +205,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: updated_at = isoparse(d.pop("updatedAt")) + project_id = d.pop("projectId", UNSET) + def _parse_acceptance(data: object) -> Union[GovernanceScope, None, Unset]: if data is None: return data @@ -318,6 +326,7 @@ def _parse_verification_method(data: object) -> Union[GovernanceTrainingVerifica created_by=created_by, created_at=created_at, updated_at=updated_at, + project_id=project_id, acceptance=acceptance, enactment_date=enactment_date, supplemental_docs=supplemental_docs, diff --git a/cirro_api_client/v1/models/process.py b/cirro_api_client/v1/models/process.py index 2da9aca..513eb8d 100644 --- a/cirro_api_client/v1/models/process.py +++ b/cirro_api_client/v1/models/process.py @@ -1,7 +1,9 @@ +import datetime 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 dateutil.parser import isoparse from ..models.executor import Executor from ..types import UNSET, Unset @@ -11,43 +13,51 @@ @_attrs_define class Process: - """ + """Identifies a data type or pipeline in Cirro + Attributes: id (str): Unique ID of the Process Example: process-hutch-magic_flute-1_0. name (str): Friendly name for the process Example: MAGeCK Flute. + description (str): Description of the process Example: MAGeCK Flute enables accurate identification of essential + genes with their related biological functions. + data_type (str): Name of the data type this pipeline produces (if it is not defined, use the name) executor (Executor): How the workflow is executed - category (str): Category of the process Example: Microbial Analysis. - pipeline_type (str): Type of pipeline Example: nf-core. - description (Union[Unset, str]): Example: MAGeCK Flute enables accurate identification of essential genes with - their related biological functions. - data_type (Union[None, Unset, str]): Name of the data type this pipeline produces (if it is not defined, use the - name) - documentation_url (Union[Unset, str]): Link to pipeline documentation Example: + child_process_ids (List[str]): IDs of pipelines that can be run downstream + parent_process_ids (List[str]): IDs of processes that can run this pipeline + linked_project_ids (List[str]): Projects that can run this process + is_tenant_wide (bool): Whether the process is shared with the tenant + allow_multiple_sources (bool): Whether the pipeline is allowed to have multiple dataset sources + uses_sample_sheet (bool): Whether the pipeline uses the Cirro-provided sample sheet + is_archived (bool): Whether the process is marked as archived + category (Union[Unset, str]): Category of the process Example: Microbial Analysis. + pipeline_type (Union[Unset, str]): Type of pipeline Example: nf-core. + documentation_url (Union[Unset, str]): Link to process documentation Example: https://docs.cirro.bio/pipelines/catalog_targeted_sequencing/#crispr-screen-analysis. file_requirements_message (Union[Unset, str]): Description of the files to be uploaded (optional) - child_process_ids (Union[Unset, List[str]]): IDs of pipelines that can be run downstream - parent_process_ids (Union[Unset, List[str]]): IDs of pipelines that can run this pipeline - owner (Union[Unset, str]): Username of the pipeline creator (blank if Cirro curated) - linked_project_ids (Union[Unset, List[str]]): Projects that can run this pipeline - allow_multiple_sources (Union[Unset, bool]): Whether the pipeline is allowed to have multiple dataset sources - is_archived (Union[Unset, bool]): Whether the pipeline is marked as archived + owner (Union[None, Unset, str]): Username of the pipeline creator (blank if Cirro curated) + created_at (Union[Unset, datetime.datetime]): When the process was created (does not reflect the pipeline code) + updated_at (Union[Unset, datetime.datetime]): When the process was updated (does not reflect the pipeline code) """ id: str name: str + description: str + data_type: str executor: Executor - category: str - pipeline_type: str - description: Union[Unset, str] = UNSET - data_type: Union[None, Unset, str] = UNSET + child_process_ids: List[str] + parent_process_ids: List[str] + linked_project_ids: List[str] + is_tenant_wide: bool + allow_multiple_sources: bool + uses_sample_sheet: bool + is_archived: bool + category: Union[Unset, str] = UNSET + pipeline_type: Union[Unset, str] = UNSET documentation_url: Union[Unset, str] = UNSET file_requirements_message: Union[Unset, str] = UNSET - child_process_ids: Union[Unset, List[str]] = UNSET - parent_process_ids: Union[Unset, List[str]] = UNSET - owner: Union[Unset, str] = UNSET - linked_project_ids: Union[Unset, List[str]] = UNSET - allow_multiple_sources: Union[Unset, bool] = UNSET - is_archived: Union[Unset, bool] = UNSET + owner: Union[None, Unset, str] = UNSET + created_at: Union[Unset, datetime.datetime] = UNSET + updated_at: Union[Unset, datetime.datetime] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: @@ -55,41 +65,47 @@ def to_dict(self) -> Dict[str, Any]: name = self.name + description = self.description + + data_type = self.data_type + executor = self.executor.value - category = self.category + child_process_ids = self.child_process_ids - pipeline_type = self.pipeline_type + parent_process_ids = self.parent_process_ids - description = self.description + linked_project_ids = self.linked_project_ids - data_type: Union[None, Unset, str] - if isinstance(self.data_type, Unset): - data_type = UNSET - else: - data_type = self.data_type + is_tenant_wide = self.is_tenant_wide - documentation_url = self.documentation_url + allow_multiple_sources = self.allow_multiple_sources - file_requirements_message = self.file_requirements_message + uses_sample_sheet = self.uses_sample_sheet - child_process_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.child_process_ids, Unset): - child_process_ids = self.child_process_ids + is_archived = self.is_archived - parent_process_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.parent_process_ids, Unset): - parent_process_ids = self.parent_process_ids + category = self.category - owner = self.owner + pipeline_type = self.pipeline_type - linked_project_ids: Union[Unset, List[str]] = UNSET - if not isinstance(self.linked_project_ids, Unset): - linked_project_ids = self.linked_project_ids + documentation_url = self.documentation_url - allow_multiple_sources = self.allow_multiple_sources + file_requirements_message = self.file_requirements_message - is_archived = self.is_archived + owner: Union[None, Unset, str] + if isinstance(self.owner, Unset): + owner = UNSET + else: + owner = self.owner + + created_at: Union[Unset, str] = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + + updated_at: Union[Unset, str] = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -97,31 +113,32 @@ def to_dict(self) -> Dict[str, Any]: { "id": id, "name": name, + "description": description, + "dataType": data_type, "executor": executor, - "category": category, - "pipelineType": pipeline_type, + "childProcessIds": child_process_ids, + "parentProcessIds": parent_process_ids, + "linkedProjectIds": linked_project_ids, + "isTenantWide": is_tenant_wide, + "allowMultipleSources": allow_multiple_sources, + "usesSampleSheet": uses_sample_sheet, + "isArchived": is_archived, } ) - if description is not UNSET: - field_dict["description"] = description - if data_type is not UNSET: - field_dict["dataType"] = data_type + if category is not UNSET: + field_dict["category"] = category + if pipeline_type is not UNSET: + field_dict["pipelineType"] = pipeline_type if documentation_url is not UNSET: field_dict["documentationUrl"] = documentation_url if file_requirements_message is not UNSET: field_dict["fileRequirementsMessage"] = file_requirements_message - if child_process_ids is not UNSET: - field_dict["childProcessIds"] = child_process_ids - if parent_process_ids is not UNSET: - field_dict["parentProcessIds"] = parent_process_ids if owner is not UNSET: field_dict["owner"] = owner - if linked_project_ids is not UNSET: - field_dict["linkedProjectIds"] = linked_project_ids - if allow_multiple_sources is not UNSET: - field_dict["allowMultipleSources"] = allow_multiple_sources - if is_archived is not UNSET: - field_dict["isArchived"] = is_archived + if created_at is not UNSET: + field_dict["createdAt"] = created_at + if updated_at is not UNSET: + field_dict["updatedAt"] = updated_at return field_dict @@ -132,55 +149,77 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: name = d.pop("name") + description = d.pop("description") + + data_type = d.pop("dataType") + executor = Executor(d.pop("executor")) - category = d.pop("category") + child_process_ids = cast(List[str], d.pop("childProcessIds")) - pipeline_type = d.pop("pipelineType") + parent_process_ids = cast(List[str], d.pop("parentProcessIds")) - description = d.pop("description", UNSET) + linked_project_ids = cast(List[str], d.pop("linkedProjectIds")) - def _parse_data_type(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) + is_tenant_wide = d.pop("isTenantWide") - data_type = _parse_data_type(d.pop("dataType", UNSET)) + allow_multiple_sources = d.pop("allowMultipleSources") - documentation_url = d.pop("documentationUrl", UNSET) + uses_sample_sheet = d.pop("usesSampleSheet") - file_requirements_message = d.pop("fileRequirementsMessage", UNSET) + is_archived = d.pop("isArchived") - child_process_ids = cast(List[str], d.pop("childProcessIds", UNSET)) + category = d.pop("category", UNSET) - parent_process_ids = cast(List[str], d.pop("parentProcessIds", UNSET)) + pipeline_type = d.pop("pipelineType", UNSET) - owner = d.pop("owner", UNSET) + documentation_url = d.pop("documentationUrl", UNSET) + + file_requirements_message = d.pop("fileRequirementsMessage", UNSET) - linked_project_ids = cast(List[str], d.pop("linkedProjectIds", UNSET)) + def _parse_owner(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) - allow_multiple_sources = d.pop("allowMultipleSources", UNSET) + owner = _parse_owner(d.pop("owner", UNSET)) - is_archived = d.pop("isArchived", UNSET) + _created_at = d.pop("createdAt", UNSET) + created_at: Union[Unset, datetime.datetime] + if isinstance(_created_at, Unset): + created_at = UNSET + else: + created_at = isoparse(_created_at) + + _updated_at = d.pop("updatedAt", UNSET) + updated_at: Union[Unset, datetime.datetime] + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = isoparse(_updated_at) process = cls( id=id, name=name, - executor=executor, - category=category, - pipeline_type=pipeline_type, description=description, data_type=data_type, - documentation_url=documentation_url, - file_requirements_message=file_requirements_message, + executor=executor, child_process_ids=child_process_ids, parent_process_ids=parent_process_ids, - owner=owner, linked_project_ids=linked_project_ids, + is_tenant_wide=is_tenant_wide, allow_multiple_sources=allow_multiple_sources, + uses_sample_sheet=uses_sample_sheet, is_archived=is_archived, + category=category, + pipeline_type=pipeline_type, + documentation_url=documentation_url, + file_requirements_message=file_requirements_message, + owner=owner, + created_at=created_at, + updated_at=updated_at, ) process.additional_properties = d diff --git a/cirro_api_client/v1/models/process_detail.py b/cirro_api_client/v1/models/process_detail.py index 95886ca..d362c70 100644 --- a/cirro_api_client/v1/models/process_detail.py +++ b/cirro_api_client/v1/models/process_detail.py @@ -1,7 +1,9 @@ +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.executor import Executor from ..types import UNSET, Unset @@ -17,52 +19,57 @@ @_attrs_define class ProcessDetail: - """ + """Identifies a data type or pipeline in Cirro + Attributes: id (str): Unique ID of the Process Example: process-hutch-magic_flute-1_0. name (str): Friendly name for the process Example: MAGeCK Flute. - description (str): Example: MAGeCK Flute enables accurate identification of essential genes with their related - biological functions. + description (str): Description of the process Example: MAGeCK Flute enables accurate identification of essential + genes with their related biological functions. + data_type (str): Name of the data type this pipeline produces (if it is not defined, use the name) executor (Executor): How the workflow is executed child_process_ids (List[str]): IDs of pipelines that can be run downstream - parent_process_ids (List[str]): IDs of pipelines that can run this pipeline - linked_project_ids (List[str]): Projects that can run this pipeline - data_type (Union[None, Unset, str]): Name of the data type this pipeline produces (if it is not defined, use the - name) + parent_process_ids (List[str]): IDs of processes that can run this pipeline + linked_project_ids (List[str]): Projects that can run this process + is_tenant_wide (bool): Whether the process is shared with the tenant + allow_multiple_sources (bool): Whether the pipeline is allowed to have multiple dataset sources + uses_sample_sheet (bool): Whether the pipeline uses the Cirro-provided sample sheet + is_archived (bool): Whether the process is marked as archived category (Union[Unset, str]): Category of the process Example: Microbial Analysis. pipeline_type (Union[Unset, str]): Type of pipeline Example: nf-core. - documentation_url (Union[None, Unset, str]): Link to pipeline documentation Example: + documentation_url (Union[Unset, str]): Link to process documentation Example: https://docs.cirro.bio/pipelines/catalog_targeted_sequencing/#crispr-screen-analysis. - file_requirements_message (Union[None, Unset, str]): Description of the files to be uploaded (optional) + file_requirements_message (Union[Unset, str]): Description of the files to be uploaded (optional) pipeline_code (Union['PipelineCode', None, Unset]): owner (Union[None, Unset, str]): Username of the pipeline creator (blank if Cirro curated) - is_tenant_wide (Union[Unset, bool]): Whether the pipeline is available to all projects in the organization - allow_multiple_sources (Union[Unset, bool]): Whether the pipeline is allowed to have multiple dataset sources custom_settings (Union['CustomPipelineSettings', None, Unset]): - is_archived (Union[Unset, bool]): Whether the process is marked for removal - file_mapping_rules (Union[List['FileMappingRule'], None, Unset]): Describes the files that this dataset type - expects. + file_mapping_rules (Union[List['FileMappingRule'], None, Unset]): + created_at (Union[Unset, datetime.datetime]): When the process was created (does not reflect the pipeline code) + updated_at (Union[Unset, datetime.datetime]): When the process was updated (does not reflect the pipeline code) """ id: str name: str description: str + data_type: str executor: Executor child_process_ids: List[str] parent_process_ids: List[str] linked_project_ids: List[str] - data_type: Union[None, Unset, str] = UNSET + is_tenant_wide: bool + allow_multiple_sources: bool + uses_sample_sheet: bool + is_archived: bool category: Union[Unset, str] = UNSET pipeline_type: Union[Unset, str] = UNSET - documentation_url: Union[None, Unset, str] = UNSET - file_requirements_message: Union[None, Unset, str] = UNSET + documentation_url: Union[Unset, str] = UNSET + file_requirements_message: Union[Unset, str] = UNSET pipeline_code: Union["PipelineCode", None, Unset] = UNSET owner: Union[None, Unset, str] = UNSET - is_tenant_wide: Union[Unset, bool] = UNSET - allow_multiple_sources: Union[Unset, bool] = UNSET custom_settings: Union["CustomPipelineSettings", None, Unset] = UNSET - is_archived: Union[Unset, bool] = UNSET file_mapping_rules: Union[List["FileMappingRule"], None, Unset] = UNSET + created_at: Union[Unset, datetime.datetime] = UNSET + updated_at: Union[Unset, datetime.datetime] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: @@ -75,6 +82,8 @@ def to_dict(self) -> Dict[str, Any]: description = self.description + data_type = self.data_type + executor = self.executor.value child_process_ids = self.child_process_ids @@ -83,27 +92,21 @@ def to_dict(self) -> Dict[str, Any]: linked_project_ids = self.linked_project_ids - data_type: Union[None, Unset, str] - if isinstance(self.data_type, Unset): - data_type = UNSET - else: - data_type = self.data_type + is_tenant_wide = self.is_tenant_wide + + allow_multiple_sources = self.allow_multiple_sources + + uses_sample_sheet = self.uses_sample_sheet + + is_archived = self.is_archived category = self.category pipeline_type = self.pipeline_type - documentation_url: Union[None, Unset, str] - if isinstance(self.documentation_url, Unset): - documentation_url = UNSET - else: - documentation_url = self.documentation_url + documentation_url = self.documentation_url - file_requirements_message: Union[None, Unset, str] - if isinstance(self.file_requirements_message, Unset): - file_requirements_message = UNSET - else: - file_requirements_message = self.file_requirements_message + file_requirements_message = self.file_requirements_message pipeline_code: Union[Dict[str, Any], None, Unset] if isinstance(self.pipeline_code, Unset): @@ -119,10 +122,6 @@ def to_dict(self) -> Dict[str, Any]: else: owner = self.owner - is_tenant_wide = self.is_tenant_wide - - allow_multiple_sources = self.allow_multiple_sources - custom_settings: Union[Dict[str, Any], None, Unset] if isinstance(self.custom_settings, Unset): custom_settings = UNSET @@ -131,8 +130,6 @@ def to_dict(self) -> Dict[str, Any]: else: custom_settings = self.custom_settings - is_archived = self.is_archived - file_mapping_rules: Union[List[Dict[str, Any]], None, Unset] if isinstance(self.file_mapping_rules, Unset): file_mapping_rules = UNSET @@ -145,6 +142,14 @@ def to_dict(self) -> Dict[str, Any]: else: file_mapping_rules = self.file_mapping_rules + created_at: Union[Unset, str] = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + + updated_at: Union[Unset, str] = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -152,14 +157,17 @@ def to_dict(self) -> Dict[str, Any]: "id": id, "name": name, "description": description, + "dataType": data_type, "executor": executor, "childProcessIds": child_process_ids, "parentProcessIds": parent_process_ids, "linkedProjectIds": linked_project_ids, + "isTenantWide": is_tenant_wide, + "allowMultipleSources": allow_multiple_sources, + "usesSampleSheet": uses_sample_sheet, + "isArchived": is_archived, } ) - if data_type is not UNSET: - field_dict["dataType"] = data_type if category is not UNSET: field_dict["category"] = category if pipeline_type is not UNSET: @@ -172,16 +180,14 @@ def to_dict(self) -> Dict[str, Any]: field_dict["pipelineCode"] = pipeline_code if owner is not UNSET: field_dict["owner"] = owner - if is_tenant_wide is not UNSET: - field_dict["isTenantWide"] = is_tenant_wide - if allow_multiple_sources is not UNSET: - field_dict["allowMultipleSources"] = allow_multiple_sources if custom_settings is not UNSET: field_dict["customSettings"] = custom_settings - if is_archived is not UNSET: - field_dict["isArchived"] = is_archived if file_mapping_rules is not UNSET: field_dict["fileMappingRules"] = file_mapping_rules + if created_at is not UNSET: + field_dict["createdAt"] = created_at + if updated_at is not UNSET: + field_dict["updatedAt"] = updated_at return field_dict @@ -198,6 +204,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: description = d.pop("description") + data_type = d.pop("dataType") + executor = Executor(d.pop("executor")) child_process_ids = cast(List[str], d.pop("childProcessIds")) @@ -206,36 +214,21 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: linked_project_ids = cast(List[str], d.pop("linkedProjectIds")) - def _parse_data_type(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) + is_tenant_wide = d.pop("isTenantWide") - data_type = _parse_data_type(d.pop("dataType", UNSET)) + allow_multiple_sources = d.pop("allowMultipleSources") - category = d.pop("category", UNSET) + uses_sample_sheet = d.pop("usesSampleSheet") - pipeline_type = d.pop("pipelineType", UNSET) + is_archived = d.pop("isArchived") - def _parse_documentation_url(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) + category = d.pop("category", UNSET) - documentation_url = _parse_documentation_url(d.pop("documentationUrl", UNSET)) + pipeline_type = d.pop("pipelineType", UNSET) - def _parse_file_requirements_message(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) + documentation_url = d.pop("documentationUrl", UNSET) - file_requirements_message = _parse_file_requirements_message(d.pop("fileRequirementsMessage", UNSET)) + file_requirements_message = d.pop("fileRequirementsMessage", UNSET) def _parse_pipeline_code(data: object) -> Union["PipelineCode", None, Unset]: if data is None: @@ -263,10 +256,6 @@ def _parse_owner(data: object) -> Union[None, Unset, str]: owner = _parse_owner(d.pop("owner", UNSET)) - is_tenant_wide = d.pop("isTenantWide", UNSET) - - allow_multiple_sources = d.pop("allowMultipleSources", UNSET) - def _parse_custom_settings(data: object) -> Union["CustomPipelineSettings", None, Unset]: if data is None: return data @@ -284,8 +273,6 @@ def _parse_custom_settings(data: object) -> Union["CustomPipelineSettings", None custom_settings = _parse_custom_settings(d.pop("customSettings", UNSET)) - is_archived = d.pop("isArchived", UNSET) - def _parse_file_mapping_rules(data: object) -> Union[List["FileMappingRule"], None, Unset]: if data is None: return data @@ -308,26 +295,43 @@ def _parse_file_mapping_rules(data: object) -> Union[List["FileMappingRule"], No file_mapping_rules = _parse_file_mapping_rules(d.pop("fileMappingRules", UNSET)) + _created_at = d.pop("createdAt", UNSET) + created_at: Union[Unset, datetime.datetime] + if isinstance(_created_at, Unset): + created_at = UNSET + else: + created_at = isoparse(_created_at) + + _updated_at = d.pop("updatedAt", UNSET) + updated_at: Union[Unset, datetime.datetime] + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = isoparse(_updated_at) + process_detail = cls( id=id, name=name, description=description, + data_type=data_type, executor=executor, child_process_ids=child_process_ids, parent_process_ids=parent_process_ids, linked_project_ids=linked_project_ids, - data_type=data_type, + is_tenant_wide=is_tenant_wide, + allow_multiple_sources=allow_multiple_sources, + uses_sample_sheet=uses_sample_sheet, + is_archived=is_archived, category=category, pipeline_type=pipeline_type, documentation_url=documentation_url, file_requirements_message=file_requirements_message, pipeline_code=pipeline_code, owner=owner, - is_tenant_wide=is_tenant_wide, - allow_multiple_sources=allow_multiple_sources, custom_settings=custom_settings, - is_archived=is_archived, file_mapping_rules=file_mapping_rules, + created_at=created_at, + updated_at=updated_at, ) process_detail.additional_properties = d diff --git a/cirro_api_client/v1/models/requirement_fulfillment_input.py b/cirro_api_client/v1/models/requirement_fulfillment_input.py index e47a7f3..f2fdd8d 100644 --- a/cirro_api_client/v1/models/requirement_fulfillment_input.py +++ b/cirro_api_client/v1/models/requirement_fulfillment_input.py @@ -1,7 +1,9 @@ +import datetime 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 dateutil.parser import isoparse from ..types import UNSET, Unset @@ -13,9 +15,11 @@ class RequirementFulfillmentInput: """ Attributes: file (Union[None, Unset, str]): + completed_on (Union[None, Unset, datetime.datetime]): If not provided, defaults to the current instant """ file: Union[None, Unset, str] = UNSET + completed_on: Union[None, Unset, datetime.datetime] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: @@ -25,11 +29,21 @@ def to_dict(self) -> Dict[str, Any]: else: file = self.file + completed_on: Union[None, Unset, str] + if isinstance(self.completed_on, Unset): + completed_on = UNSET + elif isinstance(self.completed_on, datetime.datetime): + completed_on = self.completed_on.isoformat() + else: + completed_on = self.completed_on + field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) if file is not UNSET: field_dict["file"] = file + if completed_on is not UNSET: + field_dict["completedOn"] = completed_on return field_dict @@ -46,8 +60,26 @@ def _parse_file(data: object) -> Union[None, Unset, str]: file = _parse_file(d.pop("file", UNSET)) + def _parse_completed_on(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() + completed_on_type_0 = isoparse(data) + + return completed_on_type_0 + except: # noqa: E722 + pass + return cast(Union[None, Unset, datetime.datetime], data) + + completed_on = _parse_completed_on(d.pop("completedOn", UNSET)) + requirement_fulfillment_input = cls( file=file, + completed_on=completed_on, ) requirement_fulfillment_input.additional_properties = d diff --git a/cirro_api_client/v1/models/requirement_input.py b/cirro_api_client/v1/models/requirement_input.py index 051c33f..ba13e0f 100644 --- a/cirro_api_client/v1/models/requirement_input.py +++ b/cirro_api_client/v1/models/requirement_input.py @@ -28,6 +28,7 @@ class RequirementInput: scope (GovernanceScope): The levels at which governance requirements can be enforced contact_ids (List[str]): expiration (GovernanceExpiry): + project_id (Union[None, Unset, str]): acceptance (Union[GovernanceScope, None, Unset]): enactment_date (Union[None, Unset, datetime.datetime]): supplemental_docs (Union[List['GovernanceFile'], None, Unset]): @@ -42,6 +43,7 @@ class RequirementInput: scope: GovernanceScope contact_ids: List[str] expiration: "GovernanceExpiry" + project_id: Union[None, Unset, str] = UNSET acceptance: Union[GovernanceScope, None, Unset] = UNSET enactment_date: Union[None, Unset, datetime.datetime] = UNSET supplemental_docs: Union[List["GovernanceFile"], None, Unset] = UNSET @@ -65,6 +67,12 @@ def to_dict(self) -> Dict[str, Any]: expiration = self.expiration.to_dict() + project_id: Union[None, Unset, str] + if isinstance(self.project_id, Unset): + project_id = UNSET + else: + project_id = self.project_id + acceptance: Union[None, Unset, str] if isinstance(self.acceptance, Unset): acceptance = UNSET @@ -129,6 +137,8 @@ def to_dict(self) -> Dict[str, Any]: "expiration": expiration, } ) + if project_id is not UNSET: + field_dict["projectId"] = project_id if acceptance is not UNSET: field_dict["acceptance"] = acceptance if enactment_date is not UNSET: @@ -162,6 +172,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: expiration = GovernanceExpiry.from_dict(d.pop("expiration")) + def _parse_project_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) + + project_id = _parse_project_id(d.pop("projectId", UNSET)) + def _parse_acceptance(data: object) -> Union[GovernanceScope, None, Unset]: if data is None: return data @@ -276,6 +295,7 @@ def _parse_verification_method(data: object) -> Union[GovernanceTrainingVerifica scope=scope, contact_ids=contact_ids, expiration=expiration, + project_id=project_id, acceptance=acceptance, enactment_date=enactment_date, supplemental_docs=supplemental_docs, diff --git a/cirro_api_client/v1/models/run_analysis_request.py b/cirro_api_client/v1/models/run_analysis_request.py index 023fa02..3025a3b 100644 --- a/cirro_api_client/v1/models/run_analysis_request.py +++ b/cirro_api_client/v1/models/run_analysis_request.py @@ -22,6 +22,8 @@ class RunAnalysisRequest: params (RunAnalysisRequestParams): Parameters used in workflow (can be empty) notification_emails (List[str]): Emails to notify upon workflow success or failure 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. 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 @@ -34,6 +36,7 @@ class RunAnalysisRequest: params: "RunAnalysisRequestParams" notification_emails: List[str] description: Union[None, Unset, str] = UNSET + source_sample_ids: Union[List[str], 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) @@ -55,6 +58,15 @@ def to_dict(self) -> Dict[str, Any]: else: description = self.description + source_sample_ids: Union[List[str], None, Unset] + if isinstance(self.source_sample_ids, Unset): + source_sample_ids = UNSET + elif isinstance(self.source_sample_ids, list): + source_sample_ids = self.source_sample_ids + + else: + source_sample_ids = self.source_sample_ids + resume_dataset_id: Union[None, Unset, str] if isinstance(self.resume_dataset_id, Unset): resume_dataset_id = UNSET @@ -80,6 +92,8 @@ def to_dict(self) -> Dict[str, Any]: ) if description is not UNSET: field_dict["description"] = description + if source_sample_ids is not UNSET: + field_dict["sourceSampleIds"] = source_sample_ids if resume_dataset_id is not UNSET: field_dict["resumeDatasetId"] = resume_dataset_id if compute_environment_id is not UNSET: @@ -111,6 +125,23 @@ def _parse_description(data: object) -> Union[None, Unset, str]: description = _parse_description(d.pop("description", UNSET)) + def _parse_source_sample_ids(data: object) -> Union[List[str], None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + source_sample_ids_type_0 = cast(List[str], data) + + return source_sample_ids_type_0 + except: # noqa: E722 + pass + return cast(Union[List[str], None, Unset], data) + + source_sample_ids = _parse_source_sample_ids(d.pop("sourceSampleIds", UNSET)) + def _parse_resume_dataset_id(data: object) -> Union[None, Unset, str]: if data is None: return data @@ -136,6 +167,7 @@ def _parse_compute_environment_id(data: object) -> Union[None, Unset, str]: params=params, notification_emails=notification_emails, description=description, + source_sample_ids=source_sample_ids, resume_dataset_id=resume_dataset_id, compute_environment_id=compute_environment_id, ) diff --git a/cirro_api_client/v1/models/sample.py b/cirro_api_client/v1/models/sample.py index c490dc4..572e3e8 100644 --- a/cirro_api_client/v1/models/sample.py +++ b/cirro_api_client/v1/models/sample.py @@ -8,6 +8,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.data_file import DataFile from ..models.sample_metadata import SampleMetadata @@ -21,6 +22,7 @@ class Sample: id (str): name (str): metadata (Union['SampleMetadata', None, Unset]): + files (Union[List['DataFile'], None, Unset]): Files associated with this sample dataset_ids (Union[List[str], None, Unset]): created_at (Union[None, Unset, datetime.datetime]): updated_at (Union[None, Unset, datetime.datetime]): @@ -29,6 +31,7 @@ class Sample: id: str name: str metadata: Union["SampleMetadata", None, Unset] = UNSET + files: Union[List["DataFile"], None, Unset] = UNSET dataset_ids: Union[List[str], None, Unset] = UNSET created_at: Union[None, Unset, datetime.datetime] = UNSET updated_at: Union[None, Unset, datetime.datetime] = UNSET @@ -49,6 +52,18 @@ def to_dict(self) -> Dict[str, Any]: else: metadata = self.metadata + files: Union[List[Dict[str, Any]], None, Unset] + if isinstance(self.files, Unset): + files = UNSET + elif isinstance(self.files, list): + files = [] + for files_type_0_item_data in self.files: + files_type_0_item = files_type_0_item_data.to_dict() + files.append(files_type_0_item) + + else: + files = self.files + dataset_ids: Union[List[str], None, Unset] if isinstance(self.dataset_ids, Unset): dataset_ids = UNSET @@ -84,6 +99,8 @@ def to_dict(self) -> Dict[str, Any]: ) if metadata is not UNSET: field_dict["metadata"] = metadata + if files is not UNSET: + field_dict["files"] = files if dataset_ids is not UNSET: field_dict["datasetIds"] = dataset_ids if created_at is not UNSET: @@ -95,6 +112,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.data_file import DataFile from ..models.sample_metadata import SampleMetadata d = src_dict.copy() @@ -119,6 +137,28 @@ def _parse_metadata(data: object) -> Union["SampleMetadata", None, Unset]: metadata = _parse_metadata(d.pop("metadata", UNSET)) + def _parse_files(data: object) -> Union[List["DataFile"], None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + files_type_0 = [] + _files_type_0 = data + for files_type_0_item_data in _files_type_0: + files_type_0_item = DataFile.from_dict(files_type_0_item_data) + + files_type_0.append(files_type_0_item) + + return files_type_0 + except: # noqa: E722 + pass + return cast(Union[List["DataFile"], None, Unset], data) + + files = _parse_files(d.pop("files", UNSET)) + def _parse_dataset_ids(data: object) -> Union[List[str], None, Unset]: if data is None: return data @@ -174,6 +214,7 @@ def _parse_updated_at(data: object) -> Union[None, Unset, datetime.datetime]: id=id, name=name, metadata=metadata, + files=files, dataset_ids=dataset_ids, created_at=created_at, updated_at=updated_at, diff --git a/cirro_api_client/v1/models/update_user_request.py b/cirro_api_client/v1/models/update_user_request.py index b2d6f10..cbfc203 100644 --- a/cirro_api_client/v1/models/update_user_request.py +++ b/cirro_api_client/v1/models/update_user_request.py @@ -6,7 +6,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.update_user_request_settings import UpdateUserRequestSettings + from ..models.user_settings import UserSettings T = TypeVar("T", bound="UpdateUserRequest") @@ -20,8 +20,9 @@ class UpdateUserRequest: email (str): Email address of the user phone (Union[Unset, str]): Phone number of the user department (Union[Unset, str]): Department or lab the user belongs to + job_title (Union[Unset, str]): Job title or role of the user organization (Union[Unset, str]): The organization the user belongs to, only editable by administrators - settings (Union[Unset, UpdateUserRequestSettings]): Additional settings for the user + settings (Union['UserSettings', None, Unset]): groups (Union[Unset, List[str]]): Groups the user belongs to, only editable by administrators """ @@ -29,12 +30,15 @@ class UpdateUserRequest: email: str phone: Union[Unset, str] = UNSET department: Union[Unset, str] = UNSET + job_title: Union[Unset, str] = UNSET organization: Union[Unset, str] = UNSET - settings: Union[Unset, "UpdateUserRequestSettings"] = UNSET + settings: Union["UserSettings", None, Unset] = UNSET groups: Union[Unset, List[str]] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: + from ..models.user_settings import UserSettings + name = self.name email = self.email @@ -43,11 +47,17 @@ def to_dict(self) -> Dict[str, Any]: department = self.department + job_title = self.job_title + organization = self.organization - settings: Union[Unset, Dict[str, Any]] = UNSET - if not isinstance(self.settings, Unset): + settings: Union[Dict[str, Any], None, Unset] + if isinstance(self.settings, Unset): + settings = UNSET + elif isinstance(self.settings, UserSettings): settings = self.settings.to_dict() + else: + settings = self.settings groups: Union[Unset, List[str]] = UNSET if not isinstance(self.groups, Unset): @@ -65,6 +75,8 @@ def to_dict(self) -> Dict[str, Any]: field_dict["phone"] = phone if department is not UNSET: field_dict["department"] = department + if job_title is not UNSET: + field_dict["jobTitle"] = job_title if organization is not UNSET: field_dict["organization"] = organization if settings is not UNSET: @@ -76,7 +88,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: - from ..models.update_user_request_settings import UpdateUserRequestSettings + from ..models.user_settings import UserSettings d = src_dict.copy() name = d.pop("name") @@ -87,14 +99,26 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: department = d.pop("department", UNSET) + job_title = d.pop("jobTitle", UNSET) + organization = d.pop("organization", UNSET) - _settings = d.pop("settings", UNSET) - settings: Union[Unset, UpdateUserRequestSettings] - if isinstance(_settings, Unset): - settings = UNSET - else: - settings = UpdateUserRequestSettings.from_dict(_settings) + def _parse_settings(data: object) -> Union["UserSettings", None, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + settings_type_1 = UserSettings.from_dict(data) + + return settings_type_1 + except: # noqa: E722 + pass + return cast(Union["UserSettings", None, Unset], data) + + settings = _parse_settings(d.pop("settings", UNSET)) groups = cast(List[str], d.pop("groups", UNSET)) @@ -103,6 +127,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: email=email, phone=phone, department=department, + job_title=job_title, organization=organization, settings=settings, groups=groups, diff --git a/cirro_api_client/v1/models/user_detail.py b/cirro_api_client/v1/models/user_detail.py index 852c370..88ed2a2 100644 --- a/cirro_api_client/v1/models/user_detail.py +++ b/cirro_api_client/v1/models/user_detail.py @@ -9,6 +9,7 @@ if TYPE_CHECKING: from ..models.user_project_assignment import UserProjectAssignment + from ..models.user_settings import UserSettings T = TypeVar("T", bound="UserDetail") @@ -23,10 +24,12 @@ class UserDetail: phone (str): email (str): organization (str): + job_title (str): department (str): invited_by (str): project_assignments (List['UserProjectAssignment']): groups (List[str]): + settings (UserSettings): Additional settings for the user sign_up_time (Union[None, Unset, datetime.datetime]): """ @@ -35,10 +38,12 @@ class UserDetail: phone: str email: str organization: str + job_title: str department: str invited_by: str project_assignments: List["UserProjectAssignment"] groups: List[str] + settings: "UserSettings" sign_up_time: Union[None, Unset, datetime.datetime] = UNSET additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -53,6 +58,8 @@ def to_dict(self) -> Dict[str, Any]: organization = self.organization + job_title = self.job_title + department = self.department invited_by = self.invited_by @@ -64,6 +71,8 @@ def to_dict(self) -> Dict[str, Any]: groups = self.groups + settings = self.settings.to_dict() + sign_up_time: Union[None, Unset, str] if isinstance(self.sign_up_time, Unset): sign_up_time = UNSET @@ -81,10 +90,12 @@ def to_dict(self) -> Dict[str, Any]: "phone": phone, "email": email, "organization": organization, + "jobTitle": job_title, "department": department, "invitedBy": invited_by, "projectAssignments": project_assignments, "groups": groups, + "settings": settings, } ) if sign_up_time is not UNSET: @@ -95,6 +106,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: from ..models.user_project_assignment import UserProjectAssignment + from ..models.user_settings import UserSettings d = src_dict.copy() username = d.pop("username") @@ -107,6 +119,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: organization = d.pop("organization") + job_title = d.pop("jobTitle") + department = d.pop("department") invited_by = d.pop("invitedBy") @@ -120,6 +134,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: groups = cast(List[str], d.pop("groups")) + settings = UserSettings.from_dict(d.pop("settings")) + def _parse_sign_up_time(data: object) -> Union[None, Unset, datetime.datetime]: if data is None: return data @@ -143,10 +159,12 @@ def _parse_sign_up_time(data: object) -> Union[None, Unset, datetime.datetime]: phone=phone, email=email, organization=organization, + job_title=job_title, department=department, invited_by=invited_by, project_assignments=project_assignments, groups=groups, + settings=settings, sign_up_time=sign_up_time, ) diff --git a/cirro_api_client/v1/models/user_settings.py b/cirro_api_client/v1/models/user_settings.py new file mode 100644 index 0000000..13a83aa --- /dev/null +++ b/cirro_api_client/v1/models/user_settings.py @@ -0,0 +1,47 @@ +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="UserSettings") + + +@_attrs_define +class UserSettings: + """Additional settings for the user + + Attributes: + analysis_update_notifications_enabled (bool): + """ + + analysis_update_notifications_enabled: bool + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + analysis_update_notifications_enabled = self.analysis_update_notifications_enabled + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "analysisUpdateNotificationsEnabled": analysis_update_notifications_enabled, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + analysis_update_notifications_enabled = d.pop("analysisUpdateNotificationsEnabled") + + user_settings = cls( + analysis_update_notifications_enabled=analysis_update_notifications_enabled, + ) + + user_settings.additional_properties = d + return user_settings + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) diff --git a/poetry.lock b/poetry.lock index c40d5f3..c7300a7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "annotated-types" @@ -60,14 +60,14 @@ tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" a [[package]] name = "certifi" -version = "2025.1.31" +version = "2025.4.26" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" groups = ["main", "dev"] files = [ - {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, - {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, + {file = "certifi-2025.4.26-py3-none-any.whl", hash = "sha256:30350364dfe371162649852c63336a15c70c6510c2ad5015b21c2345311805f3"}, + {file = "certifi-2025.4.26.tar.gz", hash = "sha256:0a816057ea3cdefcef70270d2c515e4506bbc954f417fa5ade2021213bb8f0c6"}, ] [[package]] @@ -315,14 +315,14 @@ typing-extensions = ">=4.8.0,<5.0.0" [[package]] name = "packaging" -version = "24.2" +version = "25.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" groups = ["dev"] files = [ - {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, - {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, + {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, + {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, ] [[package]] @@ -578,30 +578,30 @@ files = [ [[package]] name = "ruff" -version = "0.11.2" +version = "0.11.8" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "ruff-0.11.2-py3-none-linux_armv6l.whl", hash = "sha256:c69e20ea49e973f3afec2c06376eb56045709f0212615c1adb0eda35e8a4e477"}, - {file = "ruff-0.11.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:2c5424cc1c4eb1d8ecabe6d4f1b70470b4f24a0c0171356290b1953ad8f0e272"}, - {file = "ruff-0.11.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:ecf20854cc73f42171eedb66f006a43d0a21bfb98a2523a809931cda569552d9"}, - {file = "ruff-0.11.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c543bf65d5d27240321604cee0633a70c6c25c9a2f2492efa9f6d4b8e4199bb"}, - {file = "ruff-0.11.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:20967168cc21195db5830b9224be0e964cc9c8ecf3b5a9e3ce19876e8d3a96e3"}, - {file = "ruff-0.11.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:955a9ce63483999d9f0b8f0b4a3ad669e53484232853054cc8b9d51ab4c5de74"}, - {file = "ruff-0.11.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:86b3a27c38b8fce73bcd262b0de32e9a6801b76d52cdb3ae4c914515f0cef608"}, - {file = "ruff-0.11.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3b66a03b248c9fcd9d64d445bafdf1589326bee6fc5c8e92d7562e58883e30f"}, - {file = "ruff-0.11.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0397c2672db015be5aa3d4dac54c69aa012429097ff219392c018e21f5085147"}, - {file = "ruff-0.11.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:869bcf3f9abf6457fbe39b5a37333aa4eecc52a3b99c98827ccc371a8e5b6f1b"}, - {file = "ruff-0.11.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2a2b50ca35457ba785cd8c93ebbe529467594087b527a08d487cf0ee7b3087e9"}, - {file = "ruff-0.11.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7c69c74bf53ddcfbc22e6eb2f31211df7f65054bfc1f72288fc71e5f82db3eab"}, - {file = "ruff-0.11.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6e8fb75e14560f7cf53b15bbc55baf5ecbe373dd5f3aab96ff7aa7777edd7630"}, - {file = "ruff-0.11.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:842a472d7b4d6f5924e9297aa38149e5dcb1e628773b70e6387ae2c97a63c58f"}, - {file = "ruff-0.11.2-py3-none-win32.whl", hash = "sha256:aca01ccd0eb5eb7156b324cfaa088586f06a86d9e5314b0eb330cb48415097cc"}, - {file = "ruff-0.11.2-py3-none-win_amd64.whl", hash = "sha256:3170150172a8f994136c0c66f494edf199a0bbea7a409f649e4bc8f4d7084080"}, - {file = "ruff-0.11.2-py3-none-win_arm64.whl", hash = "sha256:52933095158ff328f4c77af3d74f0379e34fd52f175144cefc1b192e7ccd32b4"}, - {file = "ruff-0.11.2.tar.gz", hash = "sha256:ec47591497d5a1050175bdf4e1a4e6272cddff7da88a2ad595e1e326041d8d94"}, + {file = "ruff-0.11.8-py3-none-linux_armv6l.whl", hash = "sha256:896a37516c594805e34020c4a7546c8f8a234b679a7716a3f08197f38913e1a3"}, + {file = "ruff-0.11.8-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ab86d22d3d721a40dd3ecbb5e86ab03b2e053bc93c700dc68d1c3346b36ce835"}, + {file = "ruff-0.11.8-py3-none-macosx_11_0_arm64.whl", hash = "sha256:258f3585057508d317610e8a412788cf726efeefa2fec4dba4001d9e6f90d46c"}, + {file = "ruff-0.11.8-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:727d01702f7c30baed3fc3a34901a640001a2828c793525043c29f7614994a8c"}, + {file = "ruff-0.11.8-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3dca977cc4fc8f66e89900fa415ffe4dbc2e969da9d7a54bfca81a128c5ac219"}, + {file = "ruff-0.11.8-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c657fa987d60b104d2be8b052d66da0a2a88f9bd1d66b2254333e84ea2720c7f"}, + {file = "ruff-0.11.8-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f2e74b021d0de5eceb8bd32919f6ff8a9b40ee62ed97becd44993ae5b9949474"}, + {file = "ruff-0.11.8-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f9b5ef39820abc0f2c62111f7045009e46b275f5b99d5e59dda113c39b7f4f38"}, + {file = "ruff-0.11.8-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c1dba3135ca503727aa4648152c0fa67c3b1385d3dc81c75cd8a229c4b2a1458"}, + {file = "ruff-0.11.8-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f024d32e62faad0f76b2d6afd141b8c171515e4fb91ce9fd6464335c81244e5"}, + {file = "ruff-0.11.8-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d365618d3ad747432e1ae50d61775b78c055fee5936d77fb4d92c6f559741948"}, + {file = "ruff-0.11.8-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4d9aaa91035bdf612c8ee7266153bcf16005c7c7e2f5878406911c92a31633cb"}, + {file = "ruff-0.11.8-py3-none-musllinux_1_2_i686.whl", hash = "sha256:0eba551324733efc76116d9f3a0d52946bc2751f0cd30661564117d6fd60897c"}, + {file = "ruff-0.11.8-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:161eb4cff5cfefdb6c9b8b3671d09f7def2f960cee33481dd898caf2bcd02304"}, + {file = "ruff-0.11.8-py3-none-win32.whl", hash = "sha256:5b18caa297a786465cc511d7f8be19226acf9c0a1127e06e736cd4e1878c3ea2"}, + {file = "ruff-0.11.8-py3-none-win_amd64.whl", hash = "sha256:6e70d11043bef637c5617297bdedec9632af15d53ac1e1ba29c448da9341b0c4"}, + {file = "ruff-0.11.8-py3-none-win_arm64.whl", hash = "sha256:304432e4c4a792e3da85b7699feb3426a0908ab98bf29df22a31b0cdd098fac2"}, + {file = "ruff-0.11.8.tar.gz", hash = "sha256:6d742d10626f9004b781f4558154bb226620a7242080e11caeffab1a40e99df8"}, ] [[package]] @@ -707,18 +707,18 @@ test = ["black (>=22.3.0,<23.0.0)", "coverage (>=6.2,<7.0)", "isort (>=5.0.6,<6. [[package]] name = "typing-extensions" -version = "4.12.2" +version = "4.13.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" groups = ["main", "dev"] files = [ - {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, - {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, + {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, + {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, ] markers = {main = "python_version < \"3.11\""} [metadata] lock-version = "2.1" python-versions = "^3.8" -content-hash = "7eee732f1417d9b5850fe742f524aad96fcf73c2b4d2c70eecb65aa28a3832af" +content-hash = "c2c0f2fbfd2560e2d9b858f36ce72daa943fdd238ab3072ba7524923ffec3107" diff --git a/pyproject.toml b/pyproject.toml index 261bd52..5dc9096 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cirro_api_client" -version = "0.3.2" +version = "1.0.0" description = "A client library for accessing Cirro" authors = ["Cirro "] license = "MIT" @@ -15,7 +15,7 @@ httpx = ">=0.20.0,<0.27.0" attrs = ">=21.3.0" python-dateutil = "^2.8.0" -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] pytest = ">=7.2.1" ruff = ">=0.1.14" openapi-python-client = "0.17.3" @@ -25,5 +25,5 @@ requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" [tool.ruff] -select = ["F", "I", "UP"] +lint.select = ["F", "I", "UP"] line-length = 120