miro_api.models.board_with_links
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, StrictStr 21from typing import Any, ClassVar, Dict, List, Optional 22from miro_api.models.board_links import BoardLinks 23from miro_api.models.board_member import BoardMember 24from miro_api.models.board_policy import BoardPolicy 25from miro_api.models.board_project import BoardProject 26from miro_api.models.picture import Picture 27from miro_api.models.team import Team 28from miro_api.models.user_info_short import UserInfoShort 29from typing import Optional, Set 30from typing_extensions import Self 31 32 33class BoardWithLinks(BaseModel): 34 """ 35 BoardWithLinks 36 """ # noqa: E501 37 38 id: StrictStr = Field(description="Unique identifier (ID) of the board.") 39 name: StrictStr = Field(description="Name of the board.") 40 description: StrictStr = Field(description="Description of the board.") 41 team: Optional[Team] = None 42 project: Optional[BoardProject] = None 43 picture: Optional[Picture] = None 44 policy: Optional[BoardPolicy] = None 45 view_link: Optional[StrictStr] = Field(default=None, description="URL to view the board.", alias="viewLink") 46 owner: Optional[UserInfoShort] = None 47 current_user_membership: Optional[BoardMember] = Field(default=None, alias="currentUserMembership") 48 created_at: Optional[datetime] = Field( 49 default=None, 50 description="Date and time when the board was created. 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 created_by: Optional[UserInfoShort] = Field(default=None, alias="createdBy") 54 modified_at: Optional[datetime] = Field( 55 default=None, 56 description="Date and time when the board was last modified. 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 modified_by: Optional[UserInfoShort] = Field(default=None, alias="modifiedBy") 60 links: Optional[BoardLinks] = None 61 type: StrictStr = Field(description="Type of the object that is returned. In this case, type returns `board`.") 62 additional_properties: Dict[str, Any] = {} 63 __properties: ClassVar[List[str]] = [ 64 "id", 65 "name", 66 "description", 67 "team", 68 "project", 69 "picture", 70 "policy", 71 "viewLink", 72 "owner", 73 "currentUserMembership", 74 "createdAt", 75 "createdBy", 76 "modifiedAt", 77 "modifiedBy", 78 "links", 79 "type", 80 ] 81 82 model_config = { 83 "populate_by_name": True, 84 "validate_assignment": True, 85 "protected_namespaces": (), 86 } 87 88 def to_str(self) -> str: 89 """Returns the string representation of the model using alias""" 90 return pprint.pformat(self.model_dump(by_alias=True)) 91 92 def to_json(self) -> str: 93 """Returns the JSON representation of the model using alias""" 94 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 95 return json.dumps(self.to_dict()) 96 97 @classmethod 98 def from_json(cls, json_str: str) -> Optional[Self]: 99 """Create an instance of BoardWithLinks from a JSON string""" 100 return cls.from_dict(json.loads(json_str)) 101 102 def to_dict(self) -> Dict[str, Any]: 103 """Return the dictionary representation of the model using alias. 104 105 This has the following differences from calling pydantic's 106 `self.model_dump(by_alias=True)`: 107 108 * `None` is only added to the output dict for nullable fields that 109 were set at model initialization. Other fields with value `None` 110 are ignored. 111 * Fields in `self.additional_properties` are added to the output dict. 112 """ 113 excluded_fields: Set[str] = set( 114 [ 115 "additional_properties", 116 ] 117 ) 118 119 _dict = self.model_dump( 120 by_alias=True, 121 exclude=excluded_fields, 122 exclude_none=True, 123 ) 124 # override the default output from pydantic by calling `to_dict()` of team 125 if self.team: 126 _dict["team"] = self.team.to_dict() 127 # override the default output from pydantic by calling `to_dict()` of project 128 if self.project: 129 _dict["project"] = self.project.to_dict() 130 # override the default output from pydantic by calling `to_dict()` of picture 131 if self.picture: 132 _dict["picture"] = self.picture.to_dict() 133 # override the default output from pydantic by calling `to_dict()` of policy 134 if self.policy: 135 _dict["policy"] = self.policy.to_dict() 136 # override the default output from pydantic by calling `to_dict()` of owner 137 if self.owner: 138 _dict["owner"] = self.owner.to_dict() 139 # override the default output from pydantic by calling `to_dict()` of current_user_membership 140 if self.current_user_membership: 141 _dict["currentUserMembership"] = self.current_user_membership.to_dict() 142 # override the default output from pydantic by calling `to_dict()` of created_by 143 if self.created_by: 144 _dict["createdBy"] = self.created_by.to_dict() 145 # override the default output from pydantic by calling `to_dict()` of modified_by 146 if self.modified_by: 147 _dict["modifiedBy"] = self.modified_by.to_dict() 148 # override the default output from pydantic by calling `to_dict()` of links 149 if self.links: 150 _dict["links"] = self.links.to_dict() 151 # puts key-value pairs in additional_properties in the top level 152 if self.additional_properties is not None: 153 for _key, _value in self.additional_properties.items(): 154 _dict[_key] = _value 155 156 return _dict 157 158 @classmethod 159 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 160 """Create an instance of BoardWithLinks from a dict""" 161 if obj is None: 162 return None 163 164 if not isinstance(obj, dict): 165 return cls.model_validate(obj) 166 167 _obj = cls.model_validate( 168 { 169 "id": obj.get("id"), 170 "name": obj.get("name"), 171 "description": obj.get("description"), 172 "team": Team.from_dict(obj["team"]) if obj.get("team") is not None else None, 173 "project": BoardProject.from_dict(obj["project"]) if obj.get("project") is not None else None, 174 "picture": Picture.from_dict(obj["picture"]) if obj.get("picture") is not None else None, 175 "policy": BoardPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, 176 "viewLink": obj.get("viewLink"), 177 "owner": UserInfoShort.from_dict(obj["owner"]) if obj.get("owner") is not None else None, 178 "currentUserMembership": ( 179 BoardMember.from_dict(obj["currentUserMembership"]) 180 if obj.get("currentUserMembership") is not None 181 else None 182 ), 183 "createdAt": obj.get("createdAt"), 184 "createdBy": UserInfoShort.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 185 "modifiedAt": obj.get("modifiedAt"), 186 "modifiedBy": UserInfoShort.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 187 "links": BoardLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, 188 "type": obj.get("type"), 189 } 190 ) 191 # store additional fields in additional_properties 192 for _key in obj.keys(): 193 if _key not in cls.__properties: 194 _obj.additional_properties[_key] = obj.get(_key) 195 196 return _obj
34class BoardWithLinks(BaseModel): 35 """ 36 BoardWithLinks 37 """ # noqa: E501 38 39 id: StrictStr = Field(description="Unique identifier (ID) of the board.") 40 name: StrictStr = Field(description="Name of the board.") 41 description: StrictStr = Field(description="Description of the board.") 42 team: Optional[Team] = None 43 project: Optional[BoardProject] = None 44 picture: Optional[Picture] = None 45 policy: Optional[BoardPolicy] = None 46 view_link: Optional[StrictStr] = Field(default=None, description="URL to view the board.", alias="viewLink") 47 owner: Optional[UserInfoShort] = None 48 current_user_membership: Optional[BoardMember] = Field(default=None, alias="currentUserMembership") 49 created_at: Optional[datetime] = Field( 50 default=None, 51 description="Date and time when the board was created. 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)).", 52 alias="createdAt", 53 ) 54 created_by: Optional[UserInfoShort] = Field(default=None, alias="createdBy") 55 modified_at: Optional[datetime] = Field( 56 default=None, 57 description="Date and time when the board was last modified. 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)).", 58 alias="modifiedAt", 59 ) 60 modified_by: Optional[UserInfoShort] = Field(default=None, alias="modifiedBy") 61 links: Optional[BoardLinks] = None 62 type: StrictStr = Field(description="Type of the object that is returned. In this case, type returns `board`.") 63 additional_properties: Dict[str, Any] = {} 64 __properties: ClassVar[List[str]] = [ 65 "id", 66 "name", 67 "description", 68 "team", 69 "project", 70 "picture", 71 "policy", 72 "viewLink", 73 "owner", 74 "currentUserMembership", 75 "createdAt", 76 "createdBy", 77 "modifiedAt", 78 "modifiedBy", 79 "links", 80 "type", 81 ] 82 83 model_config = { 84 "populate_by_name": True, 85 "validate_assignment": True, 86 "protected_namespaces": (), 87 } 88 89 def to_str(self) -> str: 90 """Returns the string representation of the model using alias""" 91 return pprint.pformat(self.model_dump(by_alias=True)) 92 93 def to_json(self) -> str: 94 """Returns the JSON representation of the model using alias""" 95 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 96 return json.dumps(self.to_dict()) 97 98 @classmethod 99 def from_json(cls, json_str: str) -> Optional[Self]: 100 """Create an instance of BoardWithLinks from a JSON string""" 101 return cls.from_dict(json.loads(json_str)) 102 103 def to_dict(self) -> Dict[str, Any]: 104 """Return the dictionary representation of the model using alias. 105 106 This has the following differences from calling pydantic's 107 `self.model_dump(by_alias=True)`: 108 109 * `None` is only added to the output dict for nullable fields that 110 were set at model initialization. Other fields with value `None` 111 are ignored. 112 * Fields in `self.additional_properties` are added to the output dict. 113 """ 114 excluded_fields: Set[str] = set( 115 [ 116 "additional_properties", 117 ] 118 ) 119 120 _dict = self.model_dump( 121 by_alias=True, 122 exclude=excluded_fields, 123 exclude_none=True, 124 ) 125 # override the default output from pydantic by calling `to_dict()` of team 126 if self.team: 127 _dict["team"] = self.team.to_dict() 128 # override the default output from pydantic by calling `to_dict()` of project 129 if self.project: 130 _dict["project"] = self.project.to_dict() 131 # override the default output from pydantic by calling `to_dict()` of picture 132 if self.picture: 133 _dict["picture"] = self.picture.to_dict() 134 # override the default output from pydantic by calling `to_dict()` of policy 135 if self.policy: 136 _dict["policy"] = self.policy.to_dict() 137 # override the default output from pydantic by calling `to_dict()` of owner 138 if self.owner: 139 _dict["owner"] = self.owner.to_dict() 140 # override the default output from pydantic by calling `to_dict()` of current_user_membership 141 if self.current_user_membership: 142 _dict["currentUserMembership"] = self.current_user_membership.to_dict() 143 # override the default output from pydantic by calling `to_dict()` of created_by 144 if self.created_by: 145 _dict["createdBy"] = self.created_by.to_dict() 146 # override the default output from pydantic by calling `to_dict()` of modified_by 147 if self.modified_by: 148 _dict["modifiedBy"] = self.modified_by.to_dict() 149 # override the default output from pydantic by calling `to_dict()` of links 150 if self.links: 151 _dict["links"] = self.links.to_dict() 152 # puts key-value pairs in additional_properties in the top level 153 if self.additional_properties is not None: 154 for _key, _value in self.additional_properties.items(): 155 _dict[_key] = _value 156 157 return _dict 158 159 @classmethod 160 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 161 """Create an instance of BoardWithLinks from a dict""" 162 if obj is None: 163 return None 164 165 if not isinstance(obj, dict): 166 return cls.model_validate(obj) 167 168 _obj = cls.model_validate( 169 { 170 "id": obj.get("id"), 171 "name": obj.get("name"), 172 "description": obj.get("description"), 173 "team": Team.from_dict(obj["team"]) if obj.get("team") is not None else None, 174 "project": BoardProject.from_dict(obj["project"]) if obj.get("project") is not None else None, 175 "picture": Picture.from_dict(obj["picture"]) if obj.get("picture") is not None else None, 176 "policy": BoardPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, 177 "viewLink": obj.get("viewLink"), 178 "owner": UserInfoShort.from_dict(obj["owner"]) if obj.get("owner") is not None else None, 179 "currentUserMembership": ( 180 BoardMember.from_dict(obj["currentUserMembership"]) 181 if obj.get("currentUserMembership") is not None 182 else None 183 ), 184 "createdAt": obj.get("createdAt"), 185 "createdBy": UserInfoShort.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 186 "modifiedAt": obj.get("modifiedAt"), 187 "modifiedBy": UserInfoShort.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 188 "links": BoardLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, 189 "type": obj.get("type"), 190 } 191 ) 192 # store additional fields in additional_properties 193 for _key in obj.keys(): 194 if _key not in cls.__properties: 195 _obj.additional_properties[_key] = obj.get(_key) 196 197 return _obj
BoardWithLinks
89 def to_str(self) -> str: 90 """Returns the string representation of the model using alias""" 91 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
93 def to_json(self) -> str: 94 """Returns the JSON representation of the model using alias""" 95 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 96 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
98 @classmethod 99 def from_json(cls, json_str: str) -> Optional[Self]: 100 """Create an instance of BoardWithLinks from a JSON string""" 101 return cls.from_dict(json.loads(json_str))
Create an instance of BoardWithLinks from a JSON string
103 def to_dict(self) -> Dict[str, Any]: 104 """Return the dictionary representation of the model using alias. 105 106 This has the following differences from calling pydantic's 107 `self.model_dump(by_alias=True)`: 108 109 * `None` is only added to the output dict for nullable fields that 110 were set at model initialization. Other fields with value `None` 111 are ignored. 112 * Fields in `self.additional_properties` are added to the output dict. 113 """ 114 excluded_fields: Set[str] = set( 115 [ 116 "additional_properties", 117 ] 118 ) 119 120 _dict = self.model_dump( 121 by_alias=True, 122 exclude=excluded_fields, 123 exclude_none=True, 124 ) 125 # override the default output from pydantic by calling `to_dict()` of team 126 if self.team: 127 _dict["team"] = self.team.to_dict() 128 # override the default output from pydantic by calling `to_dict()` of project 129 if self.project: 130 _dict["project"] = self.project.to_dict() 131 # override the default output from pydantic by calling `to_dict()` of picture 132 if self.picture: 133 _dict["picture"] = self.picture.to_dict() 134 # override the default output from pydantic by calling `to_dict()` of policy 135 if self.policy: 136 _dict["policy"] = self.policy.to_dict() 137 # override the default output from pydantic by calling `to_dict()` of owner 138 if self.owner: 139 _dict["owner"] = self.owner.to_dict() 140 # override the default output from pydantic by calling `to_dict()` of current_user_membership 141 if self.current_user_membership: 142 _dict["currentUserMembership"] = self.current_user_membership.to_dict() 143 # override the default output from pydantic by calling `to_dict()` of created_by 144 if self.created_by: 145 _dict["createdBy"] = self.created_by.to_dict() 146 # override the default output from pydantic by calling `to_dict()` of modified_by 147 if self.modified_by: 148 _dict["modifiedBy"] = self.modified_by.to_dict() 149 # override the default output from pydantic by calling `to_dict()` of links 150 if self.links: 151 _dict["links"] = self.links.to_dict() 152 # puts key-value pairs in additional_properties in the top level 153 if self.additional_properties is not None: 154 for _key, _value in self.additional_properties.items(): 155 _dict[_key] = _value 156 157 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.
159 @classmethod 160 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 161 """Create an instance of BoardWithLinks from a dict""" 162 if obj is None: 163 return None 164 165 if not isinstance(obj, dict): 166 return cls.model_validate(obj) 167 168 _obj = cls.model_validate( 169 { 170 "id": obj.get("id"), 171 "name": obj.get("name"), 172 "description": obj.get("description"), 173 "team": Team.from_dict(obj["team"]) if obj.get("team") is not None else None, 174 "project": BoardProject.from_dict(obj["project"]) if obj.get("project") is not None else None, 175 "picture": Picture.from_dict(obj["picture"]) if obj.get("picture") is not None else None, 176 "policy": BoardPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, 177 "viewLink": obj.get("viewLink"), 178 "owner": UserInfoShort.from_dict(obj["owner"]) if obj.get("owner") is not None else None, 179 "currentUserMembership": ( 180 BoardMember.from_dict(obj["currentUserMembership"]) 181 if obj.get("currentUserMembership") is not None 182 else None 183 ), 184 "createdAt": obj.get("createdAt"), 185 "createdBy": UserInfoShort.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 186 "modifiedAt": obj.get("modifiedAt"), 187 "modifiedBy": UserInfoShort.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 188 "links": BoardLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, 189 "type": obj.get("type"), 190 } 191 ) 192 # store additional fields in additional_properties 193 for _key in obj.keys(): 194 if _key not in cls.__properties: 195 _obj.additional_properties[_key] = obj.get(_key) 196 197 return _obj
Create an instance of BoardWithLinks 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