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