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