miro_api.models.sticky_note_style_platformbulkcreateoperation

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

Validates the enum

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

Validates the enum

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

Validates the enum

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

Returns the string representation of the model using alias

def to_json(self) -> str:
108    def to_json(self) -> str:
109        """Returns the JSON representation of the model using alias"""
110        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
111        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]:
113    @classmethod
114    def from_json(cls, json_str: str) -> Optional[Self]:
115        """Create an instance of StickyNoteStylePlatformbulkcreateoperation from a JSON string"""
116        return cls.from_dict(json.loads(json_str))

Create an instance of StickyNoteStylePlatformbulkcreateoperation from a JSON string

def to_dict(self) -> Dict[str, Any]:
118    def to_dict(self) -> Dict[str, Any]:
119        """Return the dictionary representation of the model using alias.
120
121        This has the following differences from calling pydantic's
122        `self.model_dump(by_alias=True)`:
123
124        * `None` is only added to the output dict for nullable fields that
125          were set at model initialization. Other fields with value `None`
126          are ignored.
127        * Fields in `self.additional_properties` are added to the output dict.
128        """
129        excluded_fields: Set[str] = set(
130            [
131                "additional_properties",
132            ]
133        )
134
135        _dict = self.model_dump(
136            by_alias=True,
137            exclude=excluded_fields,
138            exclude_none=True,
139        )
140        # puts key-value pairs in additional_properties in the top level
141        if self.additional_properties is not None:
142            for _key, _value in self.additional_properties.items():
143                _dict[_key] = _value
144
145        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]:
147    @classmethod
148    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
149        """Create an instance of StickyNoteStylePlatformbulkcreateoperation from a dict"""
150        if obj is None:
151            return None
152
153        if not isinstance(obj, dict):
154            return cls.model_validate(obj)
155
156        _obj = cls.model_validate(
157            {
158                "fillColor": obj.get("fillColor"),
159                "textAlign": obj.get("textAlign"),
160                "textAlignVertical": obj.get("textAlignVertical"),
161            }
162        )
163        # store additional fields in additional_properties
164        for _key in obj.keys():
165            if _key not in cls.__properties:
166                _obj.additional_properties[_key] = obj.get(_key)
167
168        return _obj

Create an instance of StickyNoteStylePlatformbulkcreateoperation 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. Default: `light_yellow`.'), '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. Default: `center`.'), '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. Default: `top`.'), '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