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