miro_api.models.update_sticky_note_style

Miro Developer Platform

### Miro Developer Platform concepts - New to the Miro Developer Platform? Interested in learning more about platform concepts?? Read our introduction page and familiarize yourself with the Miro Developer Platform capabilities in a few minutes. ### Getting started with the Miro REST API - Quickstart (video): try the REST API in less than 3 minutes. - Quickstart (article): get started and try the REST API in less than 3 minutes. ### Miro REST API tutorials Check out our how-to articles with step-by-step instructions and code examples so you can: - Get started with OAuth 2.0 and Miro ### Miro App Examples Clone our Miro App Examples repository to get inspiration, customize, and explore apps built on top of Miro's Developer Platform 2.0.

The version of the OpenAPI document: v2.0 Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.

  1# coding: utf-8
  2
  3"""
  4Miro Developer Platform
  5
  6<img src=\"https://content.pstmn.io/47449ea6-0ef7-4af2-bac1-e58a70e61c58/aW1hZ2UucG5n\" width=\"1685\" height=\"593\">  ### Miro Developer Platform concepts  - New to the Miro Developer Platform? Interested in learning more about platform concepts?? [Read our introduction page](https://beta.developers.miro.com/docs/introduction) and familiarize yourself with the Miro Developer Platform capabilities in a few minutes.   ### Getting started with the Miro REST API  - [Quickstart (video):](https://beta.developers.miro.com/docs/try-out-the-rest-api-in-less-than-3-minutes) try the REST API in less than 3 minutes. - [Quickstart (article):](https://beta.developers.miro.com/docs/build-your-first-hello-world-app-1) get started and try the REST API in less than 3 minutes.   ### Miro REST API tutorials  Check out our how-to articles with step-by-step instructions and code examples so you can:  - [Get started with OAuth 2.0 and Miro](https://beta.developers.miro.com/docs/getting-started-with-oauth)   ### Miro App Examples  Clone our [Miro App Examples repository](https://github.com/miroapp/app-examples) to get inspiration, customize, and explore apps built on top of Miro's Developer Platform 2.0.
  7
  8The version of the OpenAPI document: v2.0
  9Generated by OpenAPI Generator (https://openapi-generator.tech)
 10
 11Do not edit the class manually.
 12"""  # noqa: E501
 13
 14
 15from __future__ import annotations
 16import pprint
 17import re  # noqa: F401
 18import json
 19
 20from pydantic import BaseModel, Field, StrictStr, field_validator
 21from typing import Any, ClassVar, Dict, List, Optional
 22from typing import Optional, Set
 23from typing_extensions import Self
 24
 25
 26class UpdateStickyNoteStyle(BaseModel):
 27    """
 28    Contains information about the style of a sticky note item, such as the fill color or text alignment.
 29    """  # noqa: E501
 30
 31    fill_color: Optional[StrictStr] = Field(
 32        default=None, description="Fill color for the sticky note.", alias="fillColor"
 33    )
 34    text_align: Optional[StrictStr] = Field(
 35        default=None, description="Defines how the sticky note text is horizontally aligned.", alias="textAlign"
 36    )
 37    text_align_vertical: Optional[StrictStr] = Field(
 38        default=None, description="Defines how the sticky note text is vertically aligned.", alias="textAlignVertical"
 39    )
 40    additional_properties: Dict[str, Any] = {}
 41    __properties: ClassVar[List[str]] = ["fillColor", "textAlign", "textAlignVertical"]
 42
 43    @field_validator("fill_color")
 44    def fill_color_validate_enum(cls, value):
 45        """Validates the enum"""
 46        if value is None:
 47            return value
 48
 49        if value not in set(
 50            [
 51                "gray",
 52                "light_yellow",
 53                "yellow",
 54                "orange",
 55                "light_green",
 56                "green",
 57                "dark_green",
 58                "cyan",
 59                "light_pink",
 60                "pink",
 61                "violet",
 62                "red",
 63                "light_blue",
 64                "blue",
 65                "dark_blue",
 66                "black",
 67            ]
 68        ):
 69            raise ValueError(
 70                "must be one of enum values ('gray', 'light_yellow', 'yellow', 'orange', 'light_green', 'green', 'dark_green', 'cyan', 'light_pink', 'pink', 'violet', 'red', 'light_blue', 'blue', 'dark_blue', 'black')"
 71            )
 72        return value
 73
 74    @field_validator("text_align")
 75    def text_align_validate_enum(cls, value):
 76        """Validates the enum"""
 77        if value is None:
 78            return value
 79
 80        if value not in set(["left", "right", "center"]):
 81            raise ValueError("must be one of enum values ('left', 'right', 'center')")
 82        return value
 83
 84    @field_validator("text_align_vertical")
 85    def text_align_vertical_validate_enum(cls, value):
 86        """Validates the enum"""
 87        if value is None:
 88            return value
 89
 90        if value not in set(["top", "middle", "bottom"]):
 91            raise ValueError("must be one of enum values ('top', 'middle', 'bottom')")
 92        return value
 93
 94    model_config = {
 95        "populate_by_name": True,
 96        "validate_assignment": True,
 97        "protected_namespaces": (),
 98    }
 99
100    def to_str(self) -> str:
101        """Returns the string representation of the model using alias"""
102        return pprint.pformat(self.model_dump(by_alias=True))
103
104    def to_json(self) -> str:
105        """Returns the JSON representation of the model using alias"""
106        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
107        return json.dumps(self.to_dict())
108
109    @classmethod
110    def from_json(cls, json_str: str) -> Optional[Self]:
111        """Create an instance of UpdateStickyNoteStyle from a JSON string"""
112        return cls.from_dict(json.loads(json_str))
113
114    def to_dict(self) -> Dict[str, Any]:
115        """Return the dictionary representation of the model using alias.
116
117        This has the following differences from calling pydantic's
118        `self.model_dump(by_alias=True)`:
119
120        * `None` is only added to the output dict for nullable fields that
121          were set at model initialization. Other fields with value `None`
122          are ignored.
123        * Fields in `self.additional_properties` are added to the output dict.
124        """
125        excluded_fields: Set[str] = set(
126            [
127                "additional_properties",
128            ]
129        )
130
131        _dict = self.model_dump(
132            by_alias=True,
133            exclude=excluded_fields,
134            exclude_none=True,
135        )
136        # puts key-value pairs in additional_properties in the top level
137        if self.additional_properties is not None:
138            for _key, _value in self.additional_properties.items():
139                _dict[_key] = _value
140
141        return _dict
142
143    @classmethod
144    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
145        """Create an instance of UpdateStickyNoteStyle from a dict"""
146        if obj is None:
147            return None
148
149        if not isinstance(obj, dict):
150            return cls.model_validate(obj)
151
152        _obj = cls.model_validate(
153            {
154                "fillColor": obj.get("fillColor"),
155                "textAlign": obj.get("textAlign"),
156                "textAlignVertical": obj.get("textAlignVertical"),
157            }
158        )
159        # store additional fields in additional_properties
160        for _key in obj.keys():
161            if _key not in cls.__properties:
162                _obj.additional_properties[_key] = obj.get(_key)
163
164        return _obj
class UpdateStickyNoteStyle(pydantic.main.BaseModel):
 27class UpdateStickyNoteStyle(BaseModel):
 28    """
 29    Contains information about the style of a sticky note item, such as the fill color or text alignment.
 30    """  # noqa: E501
 31
 32    fill_color: Optional[StrictStr] = Field(
 33        default=None, description="Fill color for the sticky note.", alias="fillColor"
 34    )
 35    text_align: Optional[StrictStr] = Field(
 36        default=None, description="Defines how the sticky note text is horizontally aligned.", alias="textAlign"
 37    )
 38    text_align_vertical: Optional[StrictStr] = Field(
 39        default=None, description="Defines how the sticky note text is vertically aligned.", alias="textAlignVertical"
 40    )
 41    additional_properties: Dict[str, Any] = {}
 42    __properties: ClassVar[List[str]] = ["fillColor", "textAlign", "textAlignVertical"]
 43
 44    @field_validator("fill_color")
 45    def fill_color_validate_enum(cls, value):
 46        """Validates the enum"""
 47        if value is None:
 48            return value
 49
 50        if value not in set(
 51            [
 52                "gray",
 53                "light_yellow",
 54                "yellow",
 55                "orange",
 56                "light_green",
 57                "green",
 58                "dark_green",
 59                "cyan",
 60                "light_pink",
 61                "pink",
 62                "violet",
 63                "red",
 64                "light_blue",
 65                "blue",
 66                "dark_blue",
 67                "black",
 68            ]
 69        ):
 70            raise ValueError(
 71                "must be one of enum values ('gray', 'light_yellow', 'yellow', 'orange', 'light_green', 'green', 'dark_green', 'cyan', 'light_pink', 'pink', 'violet', 'red', 'light_blue', 'blue', 'dark_blue', 'black')"
 72            )
 73        return value
 74
 75    @field_validator("text_align")
 76    def text_align_validate_enum(cls, value):
 77        """Validates the enum"""
 78        if value is None:
 79            return value
 80
 81        if value not in set(["left", "right", "center"]):
 82            raise ValueError("must be one of enum values ('left', 'right', 'center')")
 83        return value
 84
 85    @field_validator("text_align_vertical")
 86    def text_align_vertical_validate_enum(cls, value):
 87        """Validates the enum"""
 88        if value is None:
 89            return value
 90
 91        if value not in set(["top", "middle", "bottom"]):
 92            raise ValueError("must be one of enum values ('top', 'middle', 'bottom')")
 93        return value
 94
 95    model_config = {
 96        "populate_by_name": True,
 97        "validate_assignment": True,
 98        "protected_namespaces": (),
 99    }
100
101    def to_str(self) -> str:
102        """Returns the string representation of the model using alias"""
103        return pprint.pformat(self.model_dump(by_alias=True))
104
105    def to_json(self) -> str:
106        """Returns the JSON representation of the model using alias"""
107        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
108        return json.dumps(self.to_dict())
109
110    @classmethod
111    def from_json(cls, json_str: str) -> Optional[Self]:
112        """Create an instance of UpdateStickyNoteStyle from a JSON string"""
113        return cls.from_dict(json.loads(json_str))
114
115    def to_dict(self) -> Dict[str, Any]:
116        """Return the dictionary representation of the model using alias.
117
118        This has the following differences from calling pydantic's
119        `self.model_dump(by_alias=True)`:
120
121        * `None` is only added to the output dict for nullable fields that
122          were set at model initialization. Other fields with value `None`
123          are ignored.
124        * Fields in `self.additional_properties` are added to the output dict.
125        """
126        excluded_fields: Set[str] = set(
127            [
128                "additional_properties",
129            ]
130        )
131
132        _dict = self.model_dump(
133            by_alias=True,
134            exclude=excluded_fields,
135            exclude_none=True,
136        )
137        # puts key-value pairs in additional_properties in the top level
138        if self.additional_properties is not None:
139            for _key, _value in self.additional_properties.items():
140                _dict[_key] = _value
141
142        return _dict
143
144    @classmethod
145    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
146        """Create an instance of UpdateStickyNoteStyle from a dict"""
147        if obj is None:
148            return None
149
150        if not isinstance(obj, dict):
151            return cls.model_validate(obj)
152
153        _obj = cls.model_validate(
154            {
155                "fillColor": obj.get("fillColor"),
156                "textAlign": obj.get("textAlign"),
157                "textAlignVertical": obj.get("textAlignVertical"),
158            }
159        )
160        # store additional fields in additional_properties
161        for _key in obj.keys():
162            if _key not in cls.__properties:
163                _obj.additional_properties[_key] = obj.get(_key)
164
165        return _obj

Contains information about the style of a sticky note item, such as the fill color or text alignment.

fill_color: Optional[Annotated[str, Strict(strict=True)]]
text_align: Optional[Annotated[str, Strict(strict=True)]]
text_align_vertical: Optional[Annotated[str, Strict(strict=True)]]
additional_properties: Dict[str, Any]
@field_validator('fill_color')
def fill_color_validate_enum(cls, value):
44    @field_validator("fill_color")
45    def fill_color_validate_enum(cls, value):
46        """Validates the enum"""
47        if value is None:
48            return value
49
50        if value not in set(
51            [
52                "gray",
53                "light_yellow",
54                "yellow",
55                "orange",
56                "light_green",
57                "green",
58                "dark_green",
59                "cyan",
60                "light_pink",
61                "pink",
62                "violet",
63                "red",
64                "light_blue",
65                "blue",
66                "dark_blue",
67                "black",
68            ]
69        ):
70            raise ValueError(
71                "must be one of enum values ('gray', 'light_yellow', 'yellow', 'orange', 'light_green', 'green', 'dark_green', 'cyan', 'light_pink', 'pink', 'violet', 'red', 'light_blue', 'blue', 'dark_blue', 'black')"
72            )
73        return value

Validates the enum

@field_validator('text_align')
def text_align_validate_enum(cls, value):
75    @field_validator("text_align")
76    def text_align_validate_enum(cls, value):
77        """Validates the enum"""
78        if value is None:
79            return value
80
81        if value not in set(["left", "right", "center"]):
82            raise ValueError("must be one of enum values ('left', 'right', 'center')")
83        return value

Validates the enum

@field_validator('text_align_vertical')
def text_align_vertical_validate_enum(cls, value):
85    @field_validator("text_align_vertical")
86    def text_align_vertical_validate_enum(cls, value):
87        """Validates the enum"""
88        if value is None:
89            return value
90
91        if value not in set(["top", "middle", "bottom"]):
92            raise ValueError("must be one of enum values ('top', 'middle', 'bottom')")
93        return value

Validates the enum

model_config = {'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}
def to_str(self) -> str:
101    def to_str(self) -> str:
102        """Returns the string representation of the model using alias"""
103        return pprint.pformat(self.model_dump(by_alias=True))

Returns the string representation of the model using alias

def to_json(self) -> str:
105    def to_json(self) -> str:
106        """Returns the JSON representation of the model using alias"""
107        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
108        return json.dumps(self.to_dict())

Returns the JSON representation of the model using alias

@classmethod
def from_json(cls, json_str: str) -> Optional[typing_extensions.Self]:
110    @classmethod
111    def from_json(cls, json_str: str) -> Optional[Self]:
112        """Create an instance of UpdateStickyNoteStyle from a JSON string"""
113        return cls.from_dict(json.loads(json_str))

Create an instance of UpdateStickyNoteStyle from a JSON string

def to_dict(self) -> Dict[str, Any]:
115    def to_dict(self) -> Dict[str, Any]:
116        """Return the dictionary representation of the model using alias.
117
118        This has the following differences from calling pydantic's
119        `self.model_dump(by_alias=True)`:
120
121        * `None` is only added to the output dict for nullable fields that
122          were set at model initialization. Other fields with value `None`
123          are ignored.
124        * Fields in `self.additional_properties` are added to the output dict.
125        """
126        excluded_fields: Set[str] = set(
127            [
128                "additional_properties",
129            ]
130        )
131
132        _dict = self.model_dump(
133            by_alias=True,
134            exclude=excluded_fields,
135            exclude_none=True,
136        )
137        # puts key-value pairs in additional_properties in the top level
138        if self.additional_properties is not None:
139            for _key, _value in self.additional_properties.items():
140                _dict[_key] = _value
141
142        return _dict

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
  • Fields in self.additional_properties are added to the output dict.
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[typing_extensions.Self]:
144    @classmethod
145    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
146        """Create an instance of UpdateStickyNoteStyle from a dict"""
147        if obj is None:
148            return None
149
150        if not isinstance(obj, dict):
151            return cls.model_validate(obj)
152
153        _obj = cls.model_validate(
154            {
155                "fillColor": obj.get("fillColor"),
156                "textAlign": obj.get("textAlign"),
157                "textAlignVertical": obj.get("textAlignVertical"),
158            }
159        )
160        # store additional fields in additional_properties
161        for _key in obj.keys():
162            if _key not in cls.__properties:
163                _obj.additional_properties[_key] = obj.get(_key)
164
165        return _obj

Create an instance of UpdateStickyNoteStyle from a dict

def model_post_init(self: pydantic.main.BaseModel, __context: Any) -> None:
265def init_private_attributes(self: BaseModel, __context: Any) -> None:
266    """This function is meant to behave like a BaseModel method to initialise private attributes.
267
268    It takes context as an argument since that's what pydantic-core passes when calling it.
269
270    Args:
271        self: The BaseModel instance.
272        __context: The context.
273    """
274    if getattr(self, '__pydantic_private__', None) is None:
275        pydantic_private = {}
276        for name, private_attr in self.__private_attributes__.items():
277            default = private_attr.get_default()
278            if default is not PydanticUndefined:
279                pydantic_private[name] = default
280        object_setattr(self, '__pydantic_private__', pydantic_private)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that's what pydantic-core passes when calling it.

Args: self: The BaseModel instance. __context: The context.

model_fields = {'fill_color': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='fillColor', alias_priority=2, description='Fill color for the sticky note.'), 'text_align': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='textAlign', alias_priority=2, description='Defines how the sticky note text is horizontally aligned.'), 'text_align_vertical': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='textAlignVertical', alias_priority=2, description='Defines how the sticky note text is vertically aligned.'), 'additional_properties': FieldInfo(annotation=Dict[str, Any], required=False, default={})}
model_computed_fields = {}
Inherited Members
pydantic.main.BaseModel
BaseModel
model_extra
model_fields_set
model_construct
model_copy
model_dump
model_dump_json
model_json_schema
model_parametrized_name
model_rebuild
model_validate
model_validate_json
model_validate_strings
dict
json
parse_obj
parse_raw
parse_file
from_orm
construct
copy
schema
schema_json
validate
update_forward_refs