miro_api.models.frame_data_platform
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 FrameDataPlatform(BaseModel): 27 """ 28 Contains frame item data, such as the title, frame type, or frame format. 29 """ # noqa: E501 30 31 format: Optional[StrictStr] = Field(default="custom", description="Only custom frames are supported at the moment.") 32 title: Optional[StrictStr] = Field( 33 default=None, 34 description="Title of the frame. This title appears at the top of the frame.", 35 ) 36 type: Optional[StrictStr] = Field( 37 default="freeform", 38 description="Only free form frames are supported at the moment.", 39 ) 40 additional_properties: Dict[str, Any] = {} 41 __properties: ClassVar[List[str]] = ["format", "title", "type"] 42 43 @field_validator("format") 44 def format_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 "custom", 52 "desktop", 53 "phone", 54 "tablet", 55 "a4", 56 "letter", 57 "ratio_1x1", 58 "ratio_4x3", 59 "ratio_16x9", 60 ] 61 ): 62 raise ValueError( 63 "must be one of enum values ('custom', 'desktop', 'phone', 'tablet', 'a4', 'letter', 'ratio_1x1', 'ratio_4x3', 'ratio_16x9')" 64 ) 65 return value 66 67 @field_validator("type") 68 def type_validate_enum(cls, value): 69 """Validates the enum""" 70 if value is None: 71 return value 72 73 if value not in set(["freeform", "heap", "grid", "rows", "columns"]): 74 raise ValueError("must be one of enum values ('freeform', 'heap', 'grid', 'rows', 'columns')") 75 return value 76 77 model_config = { 78 "populate_by_name": True, 79 "validate_assignment": True, 80 "protected_namespaces": (), 81 } 82 83 def to_str(self) -> str: 84 """Returns the string representation of the model using alias""" 85 return pprint.pformat(self.model_dump(by_alias=True)) 86 87 def to_json(self) -> str: 88 """Returns the JSON representation of the model using alias""" 89 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 90 return json.dumps(self.to_dict()) 91 92 @classmethod 93 def from_json(cls, json_str: str) -> Optional[Self]: 94 """Create an instance of FrameDataPlatform from a JSON string""" 95 return cls.from_dict(json.loads(json_str)) 96 97 def to_dict(self) -> Dict[str, Any]: 98 """Return the dictionary representation of the model using alias. 99 100 This has the following differences from calling pydantic's 101 `self.model_dump(by_alias=True)`: 102 103 * `None` is only added to the output dict for nullable fields that 104 were set at model initialization. Other fields with value `None` 105 are ignored. 106 * Fields in `self.additional_properties` are added to the output dict. 107 """ 108 excluded_fields: Set[str] = set( 109 [ 110 "additional_properties", 111 ] 112 ) 113 114 _dict = self.model_dump( 115 by_alias=True, 116 exclude=excluded_fields, 117 exclude_none=True, 118 ) 119 # puts key-value pairs in additional_properties in the top level 120 if self.additional_properties is not None: 121 for _key, _value in self.additional_properties.items(): 122 _dict[_key] = _value 123 124 return _dict 125 126 @classmethod 127 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 128 """Create an instance of FrameDataPlatform from a dict""" 129 if obj is None: 130 return None 131 132 if not isinstance(obj, dict): 133 return cls.model_validate(obj) 134 135 _obj = cls.model_validate( 136 { 137 "format": (obj.get("format") if obj.get("format") is not None else "custom"), 138 "title": obj.get("title"), 139 "type": obj.get("type") if obj.get("type") is not None else "freeform", 140 } 141 ) 142 # store additional fields in additional_properties 143 for _key in obj.keys(): 144 if _key not in cls.__properties: 145 _obj.additional_properties[_key] = obj.get(_key) 146 147 return _obj
27class FrameDataPlatform(BaseModel): 28 """ 29 Contains frame item data, such as the title, frame type, or frame format. 30 """ # noqa: E501 31 32 format: Optional[StrictStr] = Field(default="custom", description="Only custom frames are supported at the moment.") 33 title: Optional[StrictStr] = Field( 34 default=None, 35 description="Title of the frame. This title appears at the top of the frame.", 36 ) 37 type: Optional[StrictStr] = Field( 38 default="freeform", 39 description="Only free form frames are supported at the moment.", 40 ) 41 additional_properties: Dict[str, Any] = {} 42 __properties: ClassVar[List[str]] = ["format", "title", "type"] 43 44 @field_validator("format") 45 def format_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 "custom", 53 "desktop", 54 "phone", 55 "tablet", 56 "a4", 57 "letter", 58 "ratio_1x1", 59 "ratio_4x3", 60 "ratio_16x9", 61 ] 62 ): 63 raise ValueError( 64 "must be one of enum values ('custom', 'desktop', 'phone', 'tablet', 'a4', 'letter', 'ratio_1x1', 'ratio_4x3', 'ratio_16x9')" 65 ) 66 return value 67 68 @field_validator("type") 69 def type_validate_enum(cls, value): 70 """Validates the enum""" 71 if value is None: 72 return value 73 74 if value not in set(["freeform", "heap", "grid", "rows", "columns"]): 75 raise ValueError("must be one of enum values ('freeform', 'heap', 'grid', 'rows', 'columns')") 76 return value 77 78 model_config = { 79 "populate_by_name": True, 80 "validate_assignment": True, 81 "protected_namespaces": (), 82 } 83 84 def to_str(self) -> str: 85 """Returns the string representation of the model using alias""" 86 return pprint.pformat(self.model_dump(by_alias=True)) 87 88 def to_json(self) -> str: 89 """Returns the JSON representation of the model using alias""" 90 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 91 return json.dumps(self.to_dict()) 92 93 @classmethod 94 def from_json(cls, json_str: str) -> Optional[Self]: 95 """Create an instance of FrameDataPlatform from a JSON string""" 96 return cls.from_dict(json.loads(json_str)) 97 98 def to_dict(self) -> Dict[str, Any]: 99 """Return the dictionary representation of the model using alias. 100 101 This has the following differences from calling pydantic's 102 `self.model_dump(by_alias=True)`: 103 104 * `None` is only added to the output dict for nullable fields that 105 were set at model initialization. Other fields with value `None` 106 are ignored. 107 * Fields in `self.additional_properties` are added to the output dict. 108 """ 109 excluded_fields: Set[str] = set( 110 [ 111 "additional_properties", 112 ] 113 ) 114 115 _dict = self.model_dump( 116 by_alias=True, 117 exclude=excluded_fields, 118 exclude_none=True, 119 ) 120 # puts key-value pairs in additional_properties in the top level 121 if self.additional_properties is not None: 122 for _key, _value in self.additional_properties.items(): 123 _dict[_key] = _value 124 125 return _dict 126 127 @classmethod 128 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 129 """Create an instance of FrameDataPlatform from a dict""" 130 if obj is None: 131 return None 132 133 if not isinstance(obj, dict): 134 return cls.model_validate(obj) 135 136 _obj = cls.model_validate( 137 { 138 "format": (obj.get("format") if obj.get("format") is not None else "custom"), 139 "title": obj.get("title"), 140 "type": obj.get("type") if obj.get("type") is not None else "freeform", 141 } 142 ) 143 # store additional fields in additional_properties 144 for _key in obj.keys(): 145 if _key not in cls.__properties: 146 _obj.additional_properties[_key] = obj.get(_key) 147 148 return _obj
Contains frame item data, such as the title, frame type, or frame format.
44 @field_validator("format") 45 def format_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 "custom", 53 "desktop", 54 "phone", 55 "tablet", 56 "a4", 57 "letter", 58 "ratio_1x1", 59 "ratio_4x3", 60 "ratio_16x9", 61 ] 62 ): 63 raise ValueError( 64 "must be one of enum values ('custom', 'desktop', 'phone', 'tablet', 'a4', 'letter', 'ratio_1x1', 'ratio_4x3', 'ratio_16x9')" 65 ) 66 return value
Validates the enum
68 @field_validator("type") 69 def type_validate_enum(cls, value): 70 """Validates the enum""" 71 if value is None: 72 return value 73 74 if value not in set(["freeform", "heap", "grid", "rows", "columns"]): 75 raise ValueError("must be one of enum values ('freeform', 'heap', 'grid', 'rows', 'columns')") 76 return value
Validates the enum
84 def to_str(self) -> str: 85 """Returns the string representation of the model using alias""" 86 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
88 def to_json(self) -> str: 89 """Returns the JSON representation of the model using alias""" 90 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 91 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
93 @classmethod 94 def from_json(cls, json_str: str) -> Optional[Self]: 95 """Create an instance of FrameDataPlatform from a JSON string""" 96 return cls.from_dict(json.loads(json_str))
Create an instance of FrameDataPlatform from a JSON string
98 def to_dict(self) -> Dict[str, Any]: 99 """Return the dictionary representation of the model using alias. 100 101 This has the following differences from calling pydantic's 102 `self.model_dump(by_alias=True)`: 103 104 * `None` is only added to the output dict for nullable fields that 105 were set at model initialization. Other fields with value `None` 106 are ignored. 107 * Fields in `self.additional_properties` are added to the output dict. 108 """ 109 excluded_fields: Set[str] = set( 110 [ 111 "additional_properties", 112 ] 113 ) 114 115 _dict = self.model_dump( 116 by_alias=True, 117 exclude=excluded_fields, 118 exclude_none=True, 119 ) 120 # puts key-value pairs in additional_properties in the top level 121 if self.additional_properties is not None: 122 for _key, _value in self.additional_properties.items(): 123 _dict[_key] = _value 124 125 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.
127 @classmethod 128 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 129 """Create an instance of FrameDataPlatform from a dict""" 130 if obj is None: 131 return None 132 133 if not isinstance(obj, dict): 134 return cls.model_validate(obj) 135 136 _obj = cls.model_validate( 137 { 138 "format": (obj.get("format") if obj.get("format") is not None else "custom"), 139 "title": obj.get("title"), 140 "type": obj.get("type") if obj.get("type") is not None else "freeform", 141 } 142 ) 143 # store additional fields in additional_properties 144 for _key in obj.keys(): 145 if _key not in cls.__properties: 146 _obj.additional_properties[_key] = obj.get(_key) 147 148 return _obj
Create an instance of FrameDataPlatform 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