Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cirro_api_client/v1/models/dataset_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class DatasetDetail:
project_id (str):
source_dataset_ids (List[str]):
source_datasets (List['NamedItem']):
source_sample_ids (List[str]):
status (Status):
status_message (str):
tags (List['Tag']):
Expand All @@ -50,6 +51,7 @@ class DatasetDetail:
project_id: str
source_dataset_ids: List[str]
source_datasets: List["NamedItem"]
source_sample_ids: List[str]
status: Status
status_message: str
tags: List["Tag"]
Expand Down Expand Up @@ -84,6 +86,8 @@ def to_dict(self) -> Dict[str, Any]:
source_datasets_item = source_datasets_item_data.to_dict()
source_datasets.append(source_datasets_item)

source_sample_ids = self.source_sample_ids

status = self.status.value

status_message = self.status_message
Expand Down Expand Up @@ -125,6 +129,7 @@ def to_dict(self) -> Dict[str, Any]:
"projectId": project_id,
"sourceDatasetIds": source_dataset_ids,
"sourceDatasets": source_datasets,
"sourceSampleIds": source_sample_ids,
"status": status,
"statusMessage": status_message,
"tags": tags,
Expand Down Expand Up @@ -170,6 +175,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:

source_datasets.append(source_datasets_item)

source_sample_ids = cast(List[str], d.pop("sourceSampleIds"))

status = Status(d.pop("status"))

status_message = d.pop("statusMessage")
Expand Down Expand Up @@ -219,6 +226,7 @@ def _parse_share(data: object) -> Union["NamedItem", None, Unset]:
project_id=project_id,
source_dataset_ids=source_dataset_ids,
source_datasets=source_datasets,
source_sample_ids=source_sample_ids,
status=status,
status_message=status_message,
tags=tags,
Expand Down
47 changes: 46 additions & 1 deletion cirro_api_client/v1/models/import_data_request.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from typing import Any, Dict, List, Type, TypeVar, Union, cast
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 ..types import UNSET, Unset

if TYPE_CHECKING:
from ..models.tag import Tag


T = TypeVar("T", bound="ImportDataRequest")


Expand All @@ -15,11 +19,13 @@ class ImportDataRequest:
name (str): Name of the dataset
public_ids (List[str]):
description (Union[Unset, str]): Description of the dataset
tags (Union[List['Tag'], None, Unset]): List of tags to apply to the dataset
"""

name: str
public_ids: List[str]
description: Union[Unset, str] = UNSET
tags: Union[List["Tag"], None, Unset] = UNSET
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
Expand All @@ -29,6 +35,18 @@ def to_dict(self) -> Dict[str, Any]:

description = self.description

tags: Union[List[Dict[str, Any]], None, Unset]
if isinstance(self.tags, Unset):
tags = UNSET
elif isinstance(self.tags, list):
tags = []
for tags_type_0_item_data in self.tags:
tags_type_0_item = tags_type_0_item_data.to_dict()
tags.append(tags_type_0_item)

else:
tags = self.tags

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -39,22 +57,49 @@ def to_dict(self) -> Dict[str, Any]:
)
if description is not UNSET:
field_dict["description"] = description
if tags is not UNSET:
field_dict["tags"] = tags

return field_dict

@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
from ..models.tag import Tag

d = src_dict.copy()
name = d.pop("name")

public_ids = cast(List[str], d.pop("publicIds"))

description = d.pop("description", UNSET)

def _parse_tags(data: object) -> Union[List["Tag"], None, Unset]:
if data is None:
return data
if isinstance(data, Unset):
return data
try:
if not isinstance(data, list):
raise TypeError()
tags_type_0 = []
_tags_type_0 = data
for tags_type_0_item_data in _tags_type_0:
tags_type_0_item = Tag.from_dict(tags_type_0_item_data)

tags_type_0.append(tags_type_0_item)

return tags_type_0
except: # noqa: E722
pass
return cast(Union[List["Tag"], None, Unset], data)

tags = _parse_tags(d.pop("tags", UNSET))

import_data_request = cls(
name=name,
public_ids=public_ids,
description=description,
tags=tags,
)

import_data_request.additional_properties = d
Expand Down
47 changes: 46 additions & 1 deletion cirro_api_client/v1/models/upload_dataset_request.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from typing import Any, Dict, List, Type, TypeVar, Union, cast
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 ..types import UNSET, Unset

if TYPE_CHECKING:
from ..models.tag import Tag


T = TypeVar("T", bound="UploadDatasetRequest")


Expand All @@ -16,12 +20,14 @@ class UploadDatasetRequest:
process_id (str): ID of the ingest process Example: paired_dnaseq.
expected_files (List[str]):
description (Union[Unset, str]): Description of the dataset
tags (Union[List['Tag'], None, Unset]): List of tags to apply to the dataset
"""

name: str
process_id: str
expected_files: List[str]
description: Union[Unset, str] = UNSET
tags: Union[List["Tag"], None, Unset] = UNSET
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
Expand All @@ -33,6 +39,18 @@ def to_dict(self) -> Dict[str, Any]:

description = self.description

tags: Union[List[Dict[str, Any]], None, Unset]
if isinstance(self.tags, Unset):
tags = UNSET
elif isinstance(self.tags, list):
tags = []
for tags_type_0_item_data in self.tags:
tags_type_0_item = tags_type_0_item_data.to_dict()
tags.append(tags_type_0_item)

else:
tags = self.tags

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -44,11 +62,15 @@ def to_dict(self) -> Dict[str, Any]:
)
if description is not UNSET:
field_dict["description"] = description
if tags is not UNSET:
field_dict["tags"] = tags

return field_dict

@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
from ..models.tag import Tag

d = src_dict.copy()
name = d.pop("name")

Expand All @@ -58,11 +80,34 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:

description = d.pop("description", UNSET)

def _parse_tags(data: object) -> Union[List["Tag"], None, Unset]:
if data is None:
return data
if isinstance(data, Unset):
return data
try:
if not isinstance(data, list):
raise TypeError()
tags_type_0 = []
_tags_type_0 = data
for tags_type_0_item_data in _tags_type_0:
tags_type_0_item = Tag.from_dict(tags_type_0_item_data)

tags_type_0.append(tags_type_0_item)

return tags_type_0
except: # noqa: E722
pass
return cast(Union[List["Tag"], None, Unset], data)

tags = _parse_tags(d.pop("tags", UNSET))

upload_dataset_request = cls(
name=name,
process_id=process_id,
expected_files=expected_files,
description=description,
tags=tags,
)

upload_dataset_request.additional_properties = d
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cirro_api_client"
version = "1.0.1"
version = "1.0.2"
description = "A client library for accessing Cirro"
authors = ["Cirro <support@cirro.bio>"]
license = "MIT"
Expand Down