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 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.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 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
34class BoardWithLinksAndWithoutProject(BaseModel): 35 """ 36 BoardWithLinksAndWithoutProject 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 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 "picture", 69 "policy", 70 "viewLink", 71 "owner", 72 "currentUserMembership", 73 "createdAt", 74 "createdBy", 75 "modifiedAt", 76 "modifiedBy", 77 "links", 78 "type", 79 ] 80 81 model_config = { 82 "populate_by_name": True, 83 "validate_assignment": True, 84 "protected_namespaces": (), 85 } 86 87 def to_str(self) -> str: 88 """Returns the string representation of the model using alias""" 89 return pprint.pformat(self.model_dump(by_alias=True)) 90 91 def to_json(self) -> str: 92 """Returns the JSON representation of the model using alias""" 93 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 94 return json.dumps(self.to_dict()) 95 96 @classmethod 97 def from_json(cls, json_str: str) -> Optional[Self]: 98 """Create an instance of BoardWithLinksAndWithoutProject from a JSON string""" 99 return cls.from_dict(json.loads(json_str)) 100 101 def to_dict(self) -> Dict[str, Any]: 102 """Return the dictionary representation of the model using alias. 103 104 This has the following differences from calling pydantic's 105 `self.model_dump(by_alias=True)`: 106 107 * `None` is only added to the output dict for nullable fields that 108 were set at model initialization. Other fields with value `None` 109 are ignored. 110 * Fields in `self.additional_properties` are added to the output dict. 111 """ 112 excluded_fields: Set[str] = set( 113 [ 114 "additional_properties", 115 ] 116 ) 117 118 _dict = self.model_dump( 119 by_alias=True, 120 exclude=excluded_fields, 121 exclude_none=True, 122 ) 123 # override the default output from pydantic by calling `to_dict()` of team 124 if self.team: 125 _dict["team"] = self.team.to_dict() 126 # override the default output from pydantic by calling `to_dict()` of picture 127 if self.picture: 128 _dict["picture"] = self.picture.to_dict() 129 # override the default output from pydantic by calling `to_dict()` of policy 130 if self.policy: 131 _dict["policy"] = self.policy.to_dict() 132 # override the default output from pydantic by calling `to_dict()` of owner 133 if self.owner: 134 _dict["owner"] = self.owner.to_dict() 135 # override the default output from pydantic by calling `to_dict()` of current_user_membership 136 if self.current_user_membership: 137 _dict["currentUserMembership"] = self.current_user_membership.to_dict() 138 # override the default output from pydantic by calling `to_dict()` of created_by 139 if self.created_by: 140 _dict["createdBy"] = self.created_by.to_dict() 141 # override the default output from pydantic by calling `to_dict()` of modified_by 142 if self.modified_by: 143 _dict["modifiedBy"] = self.modified_by.to_dict() 144 # override the default output from pydantic by calling `to_dict()` of links 145 if self.links: 146 _dict["links"] = self.links.to_dict() 147 # puts key-value pairs in additional_properties in the top level 148 if self.additional_properties is not None: 149 for _key, _value in self.additional_properties.items(): 150 _dict[_key] = _value 151 152 return _dict 153 154 @classmethod 155 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 156 """Create an instance of BoardWithLinksAndWithoutProject from a dict""" 157 if obj is None: 158 return None 159 160 if not isinstance(obj, dict): 161 return cls.model_validate(obj) 162 163 _obj = cls.model_validate( 164 { 165 "id": obj.get("id"), 166 "name": obj.get("name"), 167 "description": obj.get("description"), 168 "team": Team.from_dict(obj["team"]) if obj.get("team") is not None else None, 169 "picture": Picture.from_dict(obj["picture"]) if obj.get("picture") is not None else None, 170 "policy": BoardPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, 171 "viewLink": obj.get("viewLink"), 172 "owner": UserInfoShort.from_dict(obj["owner"]) if obj.get("owner") is not None else None, 173 "currentUserMembership": ( 174 BoardMember.from_dict(obj["currentUserMembership"]) 175 if obj.get("currentUserMembership") is not None 176 else None 177 ), 178 "createdAt": obj.get("createdAt"), 179 "createdBy": UserInfoShort.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 180 "modifiedAt": obj.get("modifiedAt"), 181 "modifiedBy": UserInfoShort.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 182 "links": BoardLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, 183 "type": obj.get("type"), 184 } 185 ) 186 # store additional fields in additional_properties 187 for _key in obj.keys(): 188 if _key not in cls.__properties: 189 _obj.additional_properties[_key] = obj.get(_key) 190 191 return _obj
BoardWithLinksAndWithoutProject
87 def to_str(self) -> str: 88 """Returns the string representation of the model using alias""" 89 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
91 def to_json(self) -> str: 92 """Returns the JSON representation of the model using alias""" 93 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 94 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
96 @classmethod 97 def from_json(cls, json_str: str) -> Optional[Self]: 98 """Create an instance of BoardWithLinksAndWithoutProject from a JSON string""" 99 return cls.from_dict(json.loads(json_str))
Create an instance of BoardWithLinksAndWithoutProject from a JSON string
101 def to_dict(self) -> Dict[str, Any]: 102 """Return the dictionary representation of the model using alias. 103 104 This has the following differences from calling pydantic's 105 `self.model_dump(by_alias=True)`: 106 107 * `None` is only added to the output dict for nullable fields that 108 were set at model initialization. Other fields with value `None` 109 are ignored. 110 * Fields in `self.additional_properties` are added to the output dict. 111 """ 112 excluded_fields: Set[str] = set( 113 [ 114 "additional_properties", 115 ] 116 ) 117 118 _dict = self.model_dump( 119 by_alias=True, 120 exclude=excluded_fields, 121 exclude_none=True, 122 ) 123 # override the default output from pydantic by calling `to_dict()` of team 124 if self.team: 125 _dict["team"] = self.team.to_dict() 126 # override the default output from pydantic by calling `to_dict()` of picture 127 if self.picture: 128 _dict["picture"] = self.picture.to_dict() 129 # override the default output from pydantic by calling `to_dict()` of policy 130 if self.policy: 131 _dict["policy"] = self.policy.to_dict() 132 # override the default output from pydantic by calling `to_dict()` of owner 133 if self.owner: 134 _dict["owner"] = self.owner.to_dict() 135 # override the default output from pydantic by calling `to_dict()` of current_user_membership 136 if self.current_user_membership: 137 _dict["currentUserMembership"] = self.current_user_membership.to_dict() 138 # override the default output from pydantic by calling `to_dict()` of created_by 139 if self.created_by: 140 _dict["createdBy"] = self.created_by.to_dict() 141 # override the default output from pydantic by calling `to_dict()` of modified_by 142 if self.modified_by: 143 _dict["modifiedBy"] = self.modified_by.to_dict() 144 # override the default output from pydantic by calling `to_dict()` of links 145 if self.links: 146 _dict["links"] = self.links.to_dict() 147 # puts key-value pairs in additional_properties in the top level 148 if self.additional_properties is not None: 149 for _key, _value in self.additional_properties.items(): 150 _dict[_key] = _value 151 152 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.
154 @classmethod 155 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 156 """Create an instance of BoardWithLinksAndWithoutProject from a dict""" 157 if obj is None: 158 return None 159 160 if not isinstance(obj, dict): 161 return cls.model_validate(obj) 162 163 _obj = cls.model_validate( 164 { 165 "id": obj.get("id"), 166 "name": obj.get("name"), 167 "description": obj.get("description"), 168 "team": Team.from_dict(obj["team"]) if obj.get("team") is not None else None, 169 "picture": Picture.from_dict(obj["picture"]) if obj.get("picture") is not None else None, 170 "policy": BoardPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, 171 "viewLink": obj.get("viewLink"), 172 "owner": UserInfoShort.from_dict(obj["owner"]) if obj.get("owner") is not None else None, 173 "currentUserMembership": ( 174 BoardMember.from_dict(obj["currentUserMembership"]) 175 if obj.get("currentUserMembership") is not None 176 else None 177 ), 178 "createdAt": obj.get("createdAt"), 179 "createdBy": UserInfoShort.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 180 "modifiedAt": obj.get("modifiedAt"), 181 "modifiedBy": UserInfoShort.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 182 "links": BoardLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, 183 "type": obj.get("type"), 184 } 185 ) 186 # store additional fields in additional_properties 187 for _key in obj.keys(): 188 if _key not in cls.__properties: 189 _obj.additional_properties[_key] = obj.get(_key) 190 191 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