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
38 changes: 30 additions & 8 deletions cirro_api_client/v1/models/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class Workspace:
sharing_type (SharingType):
created_by (str):
created_at (datetime.datetime):
started_at (datetime.datetime):
updated_at (datetime.datetime):
sessions (Union[List['WorkspaceSession'], None, Unset]):
started_at (Union[None, Unset, datetime.datetime]):
"""

id: str
Expand All @@ -50,9 +50,9 @@ class Workspace:
sharing_type: SharingType
created_by: str
created_at: datetime.datetime
started_at: datetime.datetime
updated_at: datetime.datetime
sessions: Union[List["WorkspaceSession"], None, Unset] = UNSET
started_at: Union[None, Unset, datetime.datetime] = UNSET
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
Expand Down Expand Up @@ -81,8 +81,6 @@ def to_dict(self) -> Dict[str, Any]:

created_at = self.created_at.isoformat()

started_at = self.started_at.isoformat()

updated_at = self.updated_at.isoformat()

sessions: Union[List[Dict[str, Any]], None, Unset]
Expand All @@ -97,6 +95,14 @@ def to_dict(self) -> Dict[str, Any]:
else:
sessions = self.sessions

started_at: Union[None, Unset, str]
if isinstance(self.started_at, Unset):
started_at = UNSET
elif isinstance(self.started_at, datetime.datetime):
started_at = self.started_at.isoformat()
else:
started_at = self.started_at

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -112,12 +118,13 @@ def to_dict(self) -> Dict[str, Any]:
"sharingType": sharing_type,
"createdBy": created_by,
"createdAt": created_at,
"startedAt": started_at,
"updatedAt": updated_at,
}
)
if sessions is not UNSET:
field_dict["sessions"] = sessions
if started_at is not UNSET:
field_dict["startedAt"] = started_at

return field_dict

Expand Down Expand Up @@ -155,8 +162,6 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:

created_at = isoparse(d.pop("createdAt"))

started_at = isoparse(d.pop("startedAt"))

updated_at = isoparse(d.pop("updatedAt"))

def _parse_sessions(data: object) -> Union[List["WorkspaceSession"], None, Unset]:
Expand All @@ -181,6 +186,23 @@ def _parse_sessions(data: object) -> Union[List["WorkspaceSession"], None, Unset

sessions = _parse_sessions(d.pop("sessions", UNSET))

def _parse_started_at(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()
started_at_type_0 = isoparse(data)

return started_at_type_0
except: # noqa: E722
pass
return cast(Union[None, Unset, datetime.datetime], data)

started_at = _parse_started_at(d.pop("startedAt", UNSET))

workspace = cls(
id=id,
name=name,
Expand All @@ -193,9 +215,9 @@ def _parse_sessions(data: object) -> Union[List["WorkspaceSession"], None, Unset
sharing_type=sharing_type,
created_by=created_by,
created_at=created_at,
started_at=started_at,
updated_at=updated_at,
sessions=sessions,
started_at=started_at,
)

workspace.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.2.1"
version = "1.2.2"
description = "A client library for accessing Cirro"
authors = ["Cirro <support@cirro.bio>"]
license = "MIT"
Expand Down