miro_api.models.item_platformcreateitemsinbulkusingfilefromdevice
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 datetime import datetime 20from pydantic import BaseModel, Field, StrictBool, StrictStr 21from typing import Any, ClassVar, Dict, List, Optional 22from miro_api.models.created_by import CreatedBy 23from miro_api.models.geometry import Geometry 24from miro_api.models.item_data import ItemData 25from miro_api.models.item_style import ItemStyle 26from miro_api.models.modified_by import ModifiedBy 27from miro_api.models.parent_with_links import ParentWithLinks 28from miro_api.models.position import Position 29from miro_api.models.self_link import SelfLink 30from typing import Optional, Set 31from typing_extensions import Self 32 33 34class ItemPlatformcreateitemsinbulkusingfilefromdevice(BaseModel): 35 """ 36 Contains information about an item. 37 """ # noqa: E501 38 39 id: StrictStr = Field(description="Unique identifier (ID) of an item.") 40 data: Optional[ItemData] = None 41 style: Optional[ItemStyle] = None 42 position: Optional[Position] = None 43 geometry: Optional[Geometry] = None 44 parent: Optional[ParentWithLinks] = None 45 is_supported: Optional[StrictBool] = Field(default=None, alias="isSupported") 46 created_by: Optional[CreatedBy] = Field(default=None, alias="createdBy") 47 created_at: Optional[datetime] = Field( 48 default=None, 49 description="Date and time when the item was created. <br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)).", 50 alias="createdAt", 51 ) 52 modified_by: Optional[ModifiedBy] = Field(default=None, alias="modifiedBy") 53 modified_at: Optional[datetime] = Field( 54 default=None, 55 description="Date and time when the item was last modified. <br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)).", 56 alias="modifiedAt", 57 ) 58 links: SelfLink 59 additional_properties: Dict[str, Any] = {} 60 __properties: ClassVar[List[str]] = [ 61 "id", 62 "data", 63 "style", 64 "position", 65 "geometry", 66 "parent", 67 "isSupported", 68 "createdBy", 69 "createdAt", 70 "modifiedBy", 71 "modifiedAt", 72 "links", 73 ] 74 75 model_config = { 76 "populate_by_name": True, 77 "validate_assignment": True, 78 "protected_namespaces": (), 79 } 80 81 def to_str(self) -> str: 82 """Returns the string representation of the model using alias""" 83 return pprint.pformat(self.model_dump(by_alias=True)) 84 85 def to_json(self) -> str: 86 """Returns the JSON representation of the model using alias""" 87 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 88 return json.dumps(self.to_dict()) 89 90 @classmethod 91 def from_json(cls, json_str: str) -> Optional[Self]: 92 """Create an instance of ItemPlatformcreateitemsinbulkusingfilefromdevice from a JSON string""" 93 return cls.from_dict(json.loads(json_str)) 94 95 def to_dict(self) -> Dict[str, Any]: 96 """Return the dictionary representation of the model using alias. 97 98 This has the following differences from calling pydantic's 99 `self.model_dump(by_alias=True)`: 100 101 * `None` is only added to the output dict for nullable fields that 102 were set at model initialization. Other fields with value `None` 103 are ignored. 104 * Fields in `self.additional_properties` are added to the output dict. 105 """ 106 excluded_fields: Set[str] = set( 107 [ 108 "additional_properties", 109 ] 110 ) 111 112 _dict = self.model_dump( 113 by_alias=True, 114 exclude=excluded_fields, 115 exclude_none=True, 116 ) 117 # override the default output from pydantic by calling `to_dict()` of data 118 if self.data: 119 _dict["data"] = self.data.to_dict() 120 # override the default output from pydantic by calling `to_dict()` of style 121 if self.style: 122 _dict["style"] = self.style.to_dict() 123 # override the default output from pydantic by calling `to_dict()` of position 124 if self.position: 125 _dict["position"] = self.position.to_dict() 126 # override the default output from pydantic by calling `to_dict()` of geometry 127 if self.geometry: 128 _dict["geometry"] = self.geometry.to_dict() 129 # override the default output from pydantic by calling `to_dict()` of parent 130 if self.parent: 131 _dict["parent"] = self.parent.to_dict() 132 # override the default output from pydantic by calling `to_dict()` of created_by 133 if self.created_by: 134 _dict["createdBy"] = self.created_by.to_dict() 135 # override the default output from pydantic by calling `to_dict()` of modified_by 136 if self.modified_by: 137 _dict["modifiedBy"] = self.modified_by.to_dict() 138 # override the default output from pydantic by calling `to_dict()` of links 139 if self.links: 140 _dict["links"] = self.links.to_dict() 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 ItemPlatformcreateitemsinbulkusingfilefromdevice 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 "id": obj.get("id"), 160 "data": ItemData.from_dict(obj["data"]) if obj.get("data") is not None else None, 161 "style": ItemStyle.from_dict(obj["style"]) if obj.get("style") is not None else None, 162 "position": Position.from_dict(obj["position"]) if obj.get("position") is not None else None, 163 "geometry": Geometry.from_dict(obj["geometry"]) if obj.get("geometry") is not None else None, 164 "parent": ParentWithLinks.from_dict(obj["parent"]) if obj.get("parent") is not None else None, 165 "isSupported": obj.get("isSupported"), 166 "createdBy": CreatedBy.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 167 "createdAt": obj.get("createdAt"), 168 "modifiedBy": ModifiedBy.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 169 "modifiedAt": obj.get("modifiedAt"), 170 "links": SelfLink.from_dict(obj["links"]) if obj.get("links") is not None else None, 171 } 172 ) 173 # store additional fields in additional_properties 174 for _key in obj.keys(): 175 if _key not in cls.__properties: 176 _obj.additional_properties[_key] = obj.get(_key) 177 178 return _obj
35class ItemPlatformcreateitemsinbulkusingfilefromdevice(BaseModel): 36 """ 37 Contains information about an item. 38 """ # noqa: E501 39 40 id: StrictStr = Field(description="Unique identifier (ID) of an item.") 41 data: Optional[ItemData] = None 42 style: Optional[ItemStyle] = None 43 position: Optional[Position] = None 44 geometry: Optional[Geometry] = None 45 parent: Optional[ParentWithLinks] = None 46 is_supported: Optional[StrictBool] = Field(default=None, alias="isSupported") 47 created_by: Optional[CreatedBy] = Field(default=None, alias="createdBy") 48 created_at: Optional[datetime] = Field( 49 default=None, 50 description="Date and time when the item was created. <br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)).", 51 alias="createdAt", 52 ) 53 modified_by: Optional[ModifiedBy] = Field(default=None, alias="modifiedBy") 54 modified_at: Optional[datetime] = Field( 55 default=None, 56 description="Date and time when the item was last modified. <br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)).", 57 alias="modifiedAt", 58 ) 59 links: SelfLink 60 additional_properties: Dict[str, Any] = {} 61 __properties: ClassVar[List[str]] = [ 62 "id", 63 "data", 64 "style", 65 "position", 66 "geometry", 67 "parent", 68 "isSupported", 69 "createdBy", 70 "createdAt", 71 "modifiedBy", 72 "modifiedAt", 73 "links", 74 ] 75 76 model_config = { 77 "populate_by_name": True, 78 "validate_assignment": True, 79 "protected_namespaces": (), 80 } 81 82 def to_str(self) -> str: 83 """Returns the string representation of the model using alias""" 84 return pprint.pformat(self.model_dump(by_alias=True)) 85 86 def to_json(self) -> str: 87 """Returns the JSON representation of the model using alias""" 88 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 89 return json.dumps(self.to_dict()) 90 91 @classmethod 92 def from_json(cls, json_str: str) -> Optional[Self]: 93 """Create an instance of ItemPlatformcreateitemsinbulkusingfilefromdevice from a JSON string""" 94 return cls.from_dict(json.loads(json_str)) 95 96 def to_dict(self) -> Dict[str, Any]: 97 """Return the dictionary representation of the model using alias. 98 99 This has the following differences from calling pydantic's 100 `self.model_dump(by_alias=True)`: 101 102 * `None` is only added to the output dict for nullable fields that 103 were set at model initialization. Other fields with value `None` 104 are ignored. 105 * Fields in `self.additional_properties` are added to the output dict. 106 """ 107 excluded_fields: Set[str] = set( 108 [ 109 "additional_properties", 110 ] 111 ) 112 113 _dict = self.model_dump( 114 by_alias=True, 115 exclude=excluded_fields, 116 exclude_none=True, 117 ) 118 # override the default output from pydantic by calling `to_dict()` of data 119 if self.data: 120 _dict["data"] = self.data.to_dict() 121 # override the default output from pydantic by calling `to_dict()` of style 122 if self.style: 123 _dict["style"] = self.style.to_dict() 124 # override the default output from pydantic by calling `to_dict()` of position 125 if self.position: 126 _dict["position"] = self.position.to_dict() 127 # override the default output from pydantic by calling `to_dict()` of geometry 128 if self.geometry: 129 _dict["geometry"] = self.geometry.to_dict() 130 # override the default output from pydantic by calling `to_dict()` of parent 131 if self.parent: 132 _dict["parent"] = self.parent.to_dict() 133 # override the default output from pydantic by calling `to_dict()` of created_by 134 if self.created_by: 135 _dict["createdBy"] = self.created_by.to_dict() 136 # override the default output from pydantic by calling `to_dict()` of modified_by 137 if self.modified_by: 138 _dict["modifiedBy"] = self.modified_by.to_dict() 139 # override the default output from pydantic by calling `to_dict()` of links 140 if self.links: 141 _dict["links"] = self.links.to_dict() 142 # puts key-value pairs in additional_properties in the top level 143 if self.additional_properties is not None: 144 for _key, _value in self.additional_properties.items(): 145 _dict[_key] = _value 146 147 return _dict 148 149 @classmethod 150 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 151 """Create an instance of ItemPlatformcreateitemsinbulkusingfilefromdevice from a dict""" 152 if obj is None: 153 return None 154 155 if not isinstance(obj, dict): 156 return cls.model_validate(obj) 157 158 _obj = cls.model_validate( 159 { 160 "id": obj.get("id"), 161 "data": ItemData.from_dict(obj["data"]) if obj.get("data") is not None else None, 162 "style": ItemStyle.from_dict(obj["style"]) if obj.get("style") is not None else None, 163 "position": Position.from_dict(obj["position"]) if obj.get("position") is not None else None, 164 "geometry": Geometry.from_dict(obj["geometry"]) if obj.get("geometry") is not None else None, 165 "parent": ParentWithLinks.from_dict(obj["parent"]) if obj.get("parent") is not None else None, 166 "isSupported": obj.get("isSupported"), 167 "createdBy": CreatedBy.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 168 "createdAt": obj.get("createdAt"), 169 "modifiedBy": ModifiedBy.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 170 "modifiedAt": obj.get("modifiedAt"), 171 "links": SelfLink.from_dict(obj["links"]) if obj.get("links") is not None else None, 172 } 173 ) 174 # store additional fields in additional_properties 175 for _key in obj.keys(): 176 if _key not in cls.__properties: 177 _obj.additional_properties[_key] = obj.get(_key) 178 179 return _obj
Contains information about an item.
82 def to_str(self) -> str: 83 """Returns the string representation of the model using alias""" 84 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
86 def to_json(self) -> str: 87 """Returns the JSON representation of the model using alias""" 88 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 89 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
91 @classmethod 92 def from_json(cls, json_str: str) -> Optional[Self]: 93 """Create an instance of ItemPlatformcreateitemsinbulkusingfilefromdevice from a JSON string""" 94 return cls.from_dict(json.loads(json_str))
Create an instance of ItemPlatformcreateitemsinbulkusingfilefromdevice from a JSON string
96 def to_dict(self) -> Dict[str, Any]: 97 """Return the dictionary representation of the model using alias. 98 99 This has the following differences from calling pydantic's 100 `self.model_dump(by_alias=True)`: 101 102 * `None` is only added to the output dict for nullable fields that 103 were set at model initialization. Other fields with value `None` 104 are ignored. 105 * Fields in `self.additional_properties` are added to the output dict. 106 """ 107 excluded_fields: Set[str] = set( 108 [ 109 "additional_properties", 110 ] 111 ) 112 113 _dict = self.model_dump( 114 by_alias=True, 115 exclude=excluded_fields, 116 exclude_none=True, 117 ) 118 # override the default output from pydantic by calling `to_dict()` of data 119 if self.data: 120 _dict["data"] = self.data.to_dict() 121 # override the default output from pydantic by calling `to_dict()` of style 122 if self.style: 123 _dict["style"] = self.style.to_dict() 124 # override the default output from pydantic by calling `to_dict()` of position 125 if self.position: 126 _dict["position"] = self.position.to_dict() 127 # override the default output from pydantic by calling `to_dict()` of geometry 128 if self.geometry: 129 _dict["geometry"] = self.geometry.to_dict() 130 # override the default output from pydantic by calling `to_dict()` of parent 131 if self.parent: 132 _dict["parent"] = self.parent.to_dict() 133 # override the default output from pydantic by calling `to_dict()` of created_by 134 if self.created_by: 135 _dict["createdBy"] = self.created_by.to_dict() 136 # override the default output from pydantic by calling `to_dict()` of modified_by 137 if self.modified_by: 138 _dict["modifiedBy"] = self.modified_by.to_dict() 139 # override the default output from pydantic by calling `to_dict()` of links 140 if self.links: 141 _dict["links"] = self.links.to_dict() 142 # puts key-value pairs in additional_properties in the top level 143 if self.additional_properties is not None: 144 for _key, _value in self.additional_properties.items(): 145 _dict[_key] = _value 146 147 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):
Noneis only added to the output dict for nullable fields that were set at model initialization. Other fields with valueNoneare ignored.- Fields in
self.additional_propertiesare added to the output dict.
149 @classmethod 150 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 151 """Create an instance of ItemPlatformcreateitemsinbulkusingfilefromdevice from a dict""" 152 if obj is None: 153 return None 154 155 if not isinstance(obj, dict): 156 return cls.model_validate(obj) 157 158 _obj = cls.model_validate( 159 { 160 "id": obj.get("id"), 161 "data": ItemData.from_dict(obj["data"]) if obj.get("data") is not None else None, 162 "style": ItemStyle.from_dict(obj["style"]) if obj.get("style") is not None else None, 163 "position": Position.from_dict(obj["position"]) if obj.get("position") is not None else None, 164 "geometry": Geometry.from_dict(obj["geometry"]) if obj.get("geometry") is not None else None, 165 "parent": ParentWithLinks.from_dict(obj["parent"]) if obj.get("parent") is not None else None, 166 "isSupported": obj.get("isSupported"), 167 "createdBy": CreatedBy.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 168 "createdAt": obj.get("createdAt"), 169 "modifiedBy": ModifiedBy.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 170 "modifiedAt": obj.get("modifiedAt"), 171 "links": SelfLink.from_dict(obj["links"]) if obj.get("links") is not None else None, 172 } 173 ) 174 # store additional fields in additional_properties 175 for _key in obj.keys(): 176 if _key not in cls.__properties: 177 _obj.additional_properties[_key] = obj.get(_key) 178 179 return _obj
Create an instance of ItemPlatformcreateitemsinbulkusingfilefromdevice 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