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
43 changes: 29 additions & 14 deletions cirro_api_client/v1/models/tag.py
Original file line number Diff line number Diff line change
@@ -1,57 +1,72 @@
from typing import Any, Dict, List, Type, TypeVar
from typing import Any, Dict, List, Type, TypeVar, Union, cast

from attrs import define as _attrs_define
from attrs import field as _attrs_field

from ..types import UNSET, Unset

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


@_attrs_define
class Tag:
"""
Attributes:
key (str):
value (str):
editable (bool):
value (str): The value of the tag
editable (Union[Unset, bool]): Whether the tag value is editable Default: True.
key (Union[None, Unset, str]):
"""

key: str
value: str
editable: bool
editable: Union[Unset, bool] = True
key: Union[None, Unset, str] = UNSET
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> Dict[str, Any]:
key = self.key

value = self.value

editable = self.editable

key: Union[None, Unset, str]
if isinstance(self.key, Unset):
key = UNSET
else:
key = self.key

field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"key": key,
"value": value,
"editable": editable,
}
)
if editable is not UNSET:
field_dict["editable"] = editable
if key is not UNSET:
field_dict["key"] = key

return field_dict

@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
key = d.pop("key")

value = d.pop("value")

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

def _parse_key(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)

key = _parse_key(d.pop("key", UNSET))

tag = cls(
key=key,
value=value,
editable=editable,
key=key,
)

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