diff --git a/cirro_api_client/v1/models/tag.py b/cirro_api_client/v1/models/tag.py index 9fad243..c5ccf01 100644 --- a/cirro_api_client/v1/models/tag.py +++ b/cirro_api_client/v1/models/tag.py @@ -1,8 +1,10 @@ -from typing import Any, Dict, List, Type, TypeVar +from typing import Any, Dict, List, Type, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..types import UNSET, Unset + T = TypeVar("T", bound="Tag") @@ -10,48 +12,61 @@ 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 diff --git a/pyproject.toml b/pyproject.toml index 9461b0c..66f81db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "MIT"