miro_api.models.embed_data_response_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 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 EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice(BaseModel): 26 """ 27 EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice 28 """ # noqa: E501 29 30 content_type: Optional[StrictStr] = Field( 31 default=None, description="Type of the embedded item's content.", alias="contentType" 32 ) 33 description: Optional[StrictStr] = Field(default=None, description="Short description of the embedded item.") 34 html: Optional[StrictStr] = Field(default=None, description="HTML code of the embedded item.") 35 mode: Optional[StrictStr] = Field( 36 default=None, 37 description="Defines how the content in the embed item is displayed on the board. `inline`: The embedded content is displayed directly on the board. `modal`: The embedded content is displayed inside a modal overlay on the board.", 38 ) 39 preview_url: Optional[StrictStr] = Field( 40 default=None, 41 description="The URL to download the resource. You must use your access token to access the URL. The URL contains the `redirect` parameter and the `format` parameter to control the request execution as described in the following parameters: `format` parameter: By default, the image format is set to the preview image. If you want to download the original image, set the `format` parameter in the URL to `original`. `redirect`: By default, the `redirect` parameter is set to `false` and the resource object containing the URL and the resource type is returned with a 200 OK HTTP code. This URL is valid for 60 seconds. You can use this URL to retrieve the resource file. If the `redirect` parameter is set to `true`, a 307 TEMPORARY_REDIRECT HTTP response is returned. If you follow HTTP 3xx responses as redirects, you will automatically be redirected to the resource file and the content type returned can be `image/png`, 'image/svg', or 'image/jpg', depending on the original image type.", 42 alias="previewUrl", 43 ) 44 provider_name: Optional[StrictStr] = Field( 45 default=None, description="Name of the content's provider.", alias="providerName" 46 ) 47 provider_url: Optional[StrictStr] = Field( 48 default=None, description="Url of the content's provider.", alias="providerUrl" 49 ) 50 title: Optional[StrictStr] = Field(default=None, description="Title of the embedded item.") 51 url: Optional[StrictStr] = Field( 52 default=None, 53 description="A [valid URL](https://developers.miro.com/reference/data#embeddata) pointing to the content resource that you want to embed in the board. Possible transport protocols: HTTP, HTTPS.", 54 ) 55 additional_properties: Dict[str, Any] = {} 56 __properties: ClassVar[List[str]] = [ 57 "contentType", 58 "description", 59 "html", 60 "mode", 61 "previewUrl", 62 "providerName", 63 "providerUrl", 64 "title", 65 "url", 66 ] 67 68 @field_validator("mode") 69 def mode_validate_enum(cls, value): 70 """Validates the enum""" 71 if value is None: 72 return value 73 74 if value not in set(["inline", "modal"]): 75 raise ValueError("must be one of enum values ('inline', 'modal')") 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 EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice 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 EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice 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 "contentType": obj.get("contentType"), 139 "description": obj.get("description"), 140 "html": obj.get("html"), 141 "mode": obj.get("mode"), 142 "previewUrl": obj.get("previewUrl"), 143 "providerName": obj.get("providerName"), 144 "providerUrl": obj.get("providerUrl"), 145 "title": obj.get("title"), 146 "url": obj.get("url"), 147 } 148 ) 149 # store additional fields in additional_properties 150 for _key in obj.keys(): 151 if _key not in cls.__properties: 152 _obj.additional_properties[_key] = obj.get(_key) 153 154 return _obj
26class EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice(BaseModel): 27 """ 28 EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice 29 """ # noqa: E501 30 31 content_type: Optional[StrictStr] = Field( 32 default=None, description="Type of the embedded item's content.", alias="contentType" 33 ) 34 description: Optional[StrictStr] = Field(default=None, description="Short description of the embedded item.") 35 html: Optional[StrictStr] = Field(default=None, description="HTML code of the embedded item.") 36 mode: Optional[StrictStr] = Field( 37 default=None, 38 description="Defines how the content in the embed item is displayed on the board. `inline`: The embedded content is displayed directly on the board. `modal`: The embedded content is displayed inside a modal overlay on the board.", 39 ) 40 preview_url: Optional[StrictStr] = Field( 41 default=None, 42 description="The URL to download the resource. You must use your access token to access the URL. The URL contains the `redirect` parameter and the `format` parameter to control the request execution as described in the following parameters: `format` parameter: By default, the image format is set to the preview image. If you want to download the original image, set the `format` parameter in the URL to `original`. `redirect`: By default, the `redirect` parameter is set to `false` and the resource object containing the URL and the resource type is returned with a 200 OK HTTP code. This URL is valid for 60 seconds. You can use this URL to retrieve the resource file. If the `redirect` parameter is set to `true`, a 307 TEMPORARY_REDIRECT HTTP response is returned. If you follow HTTP 3xx responses as redirects, you will automatically be redirected to the resource file and the content type returned can be `image/png`, 'image/svg', or 'image/jpg', depending on the original image type.", 43 alias="previewUrl", 44 ) 45 provider_name: Optional[StrictStr] = Field( 46 default=None, description="Name of the content's provider.", alias="providerName" 47 ) 48 provider_url: Optional[StrictStr] = Field( 49 default=None, description="Url of the content's provider.", alias="providerUrl" 50 ) 51 title: Optional[StrictStr] = Field(default=None, description="Title of the embedded item.") 52 url: Optional[StrictStr] = Field( 53 default=None, 54 description="A [valid URL](https://developers.miro.com/reference/data#embeddata) pointing to the content resource that you want to embed in the board. Possible transport protocols: HTTP, HTTPS.", 55 ) 56 additional_properties: Dict[str, Any] = {} 57 __properties: ClassVar[List[str]] = [ 58 "contentType", 59 "description", 60 "html", 61 "mode", 62 "previewUrl", 63 "providerName", 64 "providerUrl", 65 "title", 66 "url", 67 ] 68 69 @field_validator("mode") 70 def mode_validate_enum(cls, value): 71 """Validates the enum""" 72 if value is None: 73 return value 74 75 if value not in set(["inline", "modal"]): 76 raise ValueError("must be one of enum values ('inline', 'modal')") 77 return value 78 79 model_config = { 80 "populate_by_name": True, 81 "validate_assignment": True, 82 "protected_namespaces": (), 83 } 84 85 def to_str(self) -> str: 86 """Returns the string representation of the model using alias""" 87 return pprint.pformat(self.model_dump(by_alias=True)) 88 89 def to_json(self) -> str: 90 """Returns the JSON representation of the model using alias""" 91 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 92 return json.dumps(self.to_dict()) 93 94 @classmethod 95 def from_json(cls, json_str: str) -> Optional[Self]: 96 """Create an instance of EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice from a JSON string""" 97 return cls.from_dict(json.loads(json_str)) 98 99 def to_dict(self) -> Dict[str, Any]: 100 """Return the dictionary representation of the model using alias. 101 102 This has the following differences from calling pydantic's 103 `self.model_dump(by_alias=True)`: 104 105 * `None` is only added to the output dict for nullable fields that 106 were set at model initialization. Other fields with value `None` 107 are ignored. 108 * Fields in `self.additional_properties` are added to the output dict. 109 """ 110 excluded_fields: Set[str] = set( 111 [ 112 "additional_properties", 113 ] 114 ) 115 116 _dict = self.model_dump( 117 by_alias=True, 118 exclude=excluded_fields, 119 exclude_none=True, 120 ) 121 # puts key-value pairs in additional_properties in the top level 122 if self.additional_properties is not None: 123 for _key, _value in self.additional_properties.items(): 124 _dict[_key] = _value 125 126 return _dict 127 128 @classmethod 129 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 130 """Create an instance of EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice from a dict""" 131 if obj is None: 132 return None 133 134 if not isinstance(obj, dict): 135 return cls.model_validate(obj) 136 137 _obj = cls.model_validate( 138 { 139 "contentType": obj.get("contentType"), 140 "description": obj.get("description"), 141 "html": obj.get("html"), 142 "mode": obj.get("mode"), 143 "previewUrl": obj.get("previewUrl"), 144 "providerName": obj.get("providerName"), 145 "providerUrl": obj.get("providerUrl"), 146 "title": obj.get("title"), 147 "url": obj.get("url"), 148 } 149 ) 150 # store additional fields in additional_properties 151 for _key in obj.keys(): 152 if _key not in cls.__properties: 153 _obj.additional_properties[_key] = obj.get(_key) 154 155 return _obj
EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice
69 @field_validator("mode") 70 def mode_validate_enum(cls, value): 71 """Validates the enum""" 72 if value is None: 73 return value 74 75 if value not in set(["inline", "modal"]): 76 raise ValueError("must be one of enum values ('inline', 'modal')") 77 return value
Validates the enum
85 def to_str(self) -> str: 86 """Returns the string representation of the model using alias""" 87 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
89 def to_json(self) -> str: 90 """Returns the JSON representation of the model using alias""" 91 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 92 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
94 @classmethod 95 def from_json(cls, json_str: str) -> Optional[Self]: 96 """Create an instance of EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice from a JSON string""" 97 return cls.from_dict(json.loads(json_str))
Create an instance of EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice from a JSON string
99 def to_dict(self) -> Dict[str, Any]: 100 """Return the dictionary representation of the model using alias. 101 102 This has the following differences from calling pydantic's 103 `self.model_dump(by_alias=True)`: 104 105 * `None` is only added to the output dict for nullable fields that 106 were set at model initialization. Other fields with value `None` 107 are ignored. 108 * Fields in `self.additional_properties` are added to the output dict. 109 """ 110 excluded_fields: Set[str] = set( 111 [ 112 "additional_properties", 113 ] 114 ) 115 116 _dict = self.model_dump( 117 by_alias=True, 118 exclude=excluded_fields, 119 exclude_none=True, 120 ) 121 # puts key-value pairs in additional_properties in the top level 122 if self.additional_properties is not None: 123 for _key, _value in self.additional_properties.items(): 124 _dict[_key] = _value 125 126 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.
128 @classmethod 129 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 130 """Create an instance of EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice from a dict""" 131 if obj is None: 132 return None 133 134 if not isinstance(obj, dict): 135 return cls.model_validate(obj) 136 137 _obj = cls.model_validate( 138 { 139 "contentType": obj.get("contentType"), 140 "description": obj.get("description"), 141 "html": obj.get("html"), 142 "mode": obj.get("mode"), 143 "previewUrl": obj.get("previewUrl"), 144 "providerName": obj.get("providerName"), 145 "providerUrl": obj.get("providerUrl"), 146 "title": obj.get("title"), 147 "url": obj.get("url"), 148 } 149 ) 150 # store additional fields in additional_properties 151 for _key in obj.keys(): 152 if _key not in cls.__properties: 153 _obj.additional_properties[_key] = obj.get(_key) 154 155 return _obj
Create an instance of EmbedDataResponsePlatformcreateitemsinbulkusingfilefromdevice 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