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
 14from __future__ import annotations
 15import pprint
 16import re  # noqa: F401
 17import json
 18
 19from pydantic import BaseModel, Field, StrictStr, field_validator
 20from typing import Any, ClassVar, Dict, List, Optional
 21from typing import Optional, Set
 22from typing_extensions import Self
 23
 24
 25class UpdateStickyNoteStyle(BaseModel):
 26    """
 27    Contains information about the style of a sticky note item, such as the fill color or text alignment.
 28    """  # noqa: E501
 29
 30    fill_color: Optional[StrictStr] = Field(
 31        default=None, description="Fill color for the sticky note.", alias="fillColor"
 32    )
 33    text_align: Optional[StrictStr] = Field(
 34        default=None, description="Defines how the sticky note text is horizontally aligned.", alias="textAlign"
 35    )
 36    text_align_vertical: Optional[StrictStr] = Field(
 37        default=None, description="Defines how the sticky note text is vertically aligned.", alias="textAlignVertical"
 38    )
 39    additional_properties: Dict[str, Any] = {}
 40    __properties: ClassVar[List[str]] = ["fillColor", "textAlign", "textAlignVertical"]
 41
 42    @field_validator("fill_color")
 43    def fill_color_validate_enum(cls, value):
 44        """Validates the enum"""
 45        if value is None:
 46            return value
 47
 48        if value not in set(
 49            [
 50                "gray",
 51                "light_yellow",
 52                "yellow",
 53                "orange",
 54                "light_green",
 55                "green",
 56                "dark_green",
 57                "cyan",
 58                "light_pink",
 59                "pink",
 60                "violet",
 61                "red",
 62                "light_blue",
 63                "blue",
 64                "dark_blue",
 65                "black",
 66            ]
 67        ):
 68            raise ValueError(
 69                "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')"
 70            )
 71        return value
 72
 73    @field_validator("text_align")
 74    def text_align_validate_enum(cls, value):
 75        """Validates the enum"""
 76        if value is None:
 77            return value
 78
 79        if value not in set(["left", "right", "center"]):
 80            raise ValueError("must be one of enum values ('left', 'right', 'center')")
 81        return value
 82
 83    @field_validator("text_align_vertical")
 84    def text_align_vertical_validate_enum(cls, value):
 85        """Validates the enum"""
 86        if value is None:
 87            return value
 88
 89        if value not in set(["top", "middle", "bottom"]):
 90            raise ValueError("must be one of enum values ('top', 'middle', 'bottom')")
 91        return value
 92
 93    model_config = {
 94        "populate_by_name": True,
 95        "validate_assignment": True,
 96        "protected_namespaces": (),
 97    }
 98
 99    def to_str(self) -> str:
100        """Returns the string representation of the model using alias"""
101        return pprint.pformat(self.model_dump(by_alias=True))
102
103    def to_json(self) -> str:
104        """Returns the JSON representation of the model using alias"""
105        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
106        return json.dumps(self.to_dict())
107
108    @classmethod
109    def from_json(cls, json_str: str) -> Optional[Self]:
110        """Create an instance of UpdateStickyNoteStyle from a JSON string"""
111        return cls.from_dict(json.loads(json_str))
112
113    def to_dict(self) -> Dict[str, Any]:
114        """Return the dictionary representation of the model using alias.
115
116        This has the following differences from calling pydantic's
117        `self.model_dump(by_alias=True)`:
118
119        * `None` is only added to the output dict for nullable fields that
120          were set at model initialization. Other fields with value `None`
121          are ignored.
122        * Fields in `self.additional_properties` are added to the output dict.
123        """
124        excluded_fields: Set[str] = set(
125            [
126                "additional_properties",
127            ]
128        )
129
130        _dict = self.model_dump(
131            by_alias=True,
132            exclude=excluded_fields,
133            exclude_none=True,
134        )
135        # puts key-value pairs in additional_properties in the top level
136        if self.additional_properties is not None:
137            for _key, _value in self.additional_properties.items():
138                _dict[_key] = _value
139
140        return _dict
141
142    @classmethod
143    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
144        """Create an instance of UpdateStickyNoteStyle from a dict"""
145        if obj is None:
146            return None
147
148        if not isinstance(obj, dict):
149            return cls.model_validate(obj)
150
151        _obj = cls.model_validate(
152            {
153                "fillColor": obj.get("fillColor"),
154                "textAlign": obj.get("textAlign"),
155                "textAlignVertical": obj.get("textAlignVertical"),
156            }
157        )
158        # store additional fields in additional_properties
159        for _key in obj.keys():
160            if _key not in cls.__properties:
161                _obj.additional_properties[_key] = obj.get(_key)
162
163        return _obj
class UpdateStickyNoteStyle(pydantic.main.BaseModel):
 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

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):
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

Validates the enum

@field_validator('text_align')
def text_align_validate_enum(cls, value):
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

Validates the enum

@field_validator('text_align_vertical')
def text_align_vertical_validate_enum(cls, value):
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

Validates the enum

model_config = {'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}
def to_str(self) -> str:
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))

Returns the string representation of the model using alias

def to_json(self) -> str:
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())

Returns the JSON representation of the model using alias

@classmethod
def from_json(cls, json_str: str) -> Optional[typing_extensions.Self]:
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))

Create an instance of UpdateStickyNoteStyle from a JSON string

def to_dict(self) -> Dict[str, Any]:
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

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]:
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

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