miro_api.models.board_with_links_and_last_opened
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.get_board_user_info_last_opened_by import GetBoardUserInfoLastOpenedBy 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 BoardWithLinksAndLastOpened(BaseModel): 35 """ 36 BoardWithLinksAndLastOpened 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 last_opened_at: Optional[datetime] = Field( 56 default=None, 57 description="Date and time when the board was last opened by any user. 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="lastOpenedAt", 59 ) 60 last_opened_by: Optional[GetBoardUserInfoLastOpenedBy] = Field(default=None, alias="lastOpenedBy") 61 modified_at: Optional[datetime] = Field( 62 default=None, 63 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)).", 64 alias="modifiedAt", 65 ) 66 modified_by: Optional[UserInfoShort] = Field(default=None, alias="modifiedBy") 67 links: Optional[BoardLinks] = None 68 type: StrictStr = Field(description="Type of the object that is returned. In this case, type returns `board`.") 69 additional_properties: Dict[str, Any] = {} 70 __properties: ClassVar[List[str]] = [ 71 "id", 72 "name", 73 "description", 74 "team", 75 "project", 76 "picture", 77 "policy", 78 "viewLink", 79 "owner", 80 "currentUserMembership", 81 "createdAt", 82 "createdBy", 83 "lastOpenedAt", 84 "lastOpenedBy", 85 "modifiedAt", 86 "modifiedBy", 87 "links", 88 "type", 89 ] 90 91 model_config = { 92 "populate_by_name": True, 93 "validate_assignment": True, 94 "protected_namespaces": (), 95 } 96 97 def to_str(self) -> str: 98 """Returns the string representation of the model using alias""" 99 return pprint.pformat(self.model_dump(by_alias=True)) 100 101 def to_json(self) -> str: 102 """Returns the JSON representation of the model using alias""" 103 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 104 return json.dumps(self.to_dict()) 105 106 @classmethod 107 def from_json(cls, json_str: str) -> Optional[Self]: 108 """Create an instance of BoardWithLinksAndLastOpened from a JSON string""" 109 return cls.from_dict(json.loads(json_str)) 110 111 def to_dict(self) -> Dict[str, Any]: 112 """Return the dictionary representation of the model using alias. 113 114 This has the following differences from calling pydantic's 115 `self.model_dump(by_alias=True)`: 116 117 * `None` is only added to the output dict for nullable fields that 118 were set at model initialization. Other fields with value `None` 119 are ignored. 120 * Fields in `self.additional_properties` are added to the output dict. 121 """ 122 excluded_fields: Set[str] = set( 123 [ 124 "additional_properties", 125 ] 126 ) 127 128 _dict = self.model_dump( 129 by_alias=True, 130 exclude=excluded_fields, 131 exclude_none=True, 132 ) 133 # override the default output from pydantic by calling `to_dict()` of team 134 if self.team: 135 _dict["team"] = self.team.to_dict() 136 # override the default output from pydantic by calling `to_dict()` of project 137 if self.project: 138 _dict["project"] = self.project.to_dict() 139 # override the default output from pydantic by calling `to_dict()` of picture 140 if self.picture: 141 _dict["picture"] = self.picture.to_dict() 142 # override the default output from pydantic by calling `to_dict()` of policy 143 if self.policy: 144 _dict["policy"] = self.policy.to_dict() 145 # override the default output from pydantic by calling `to_dict()` of owner 146 if self.owner: 147 _dict["owner"] = self.owner.to_dict() 148 # override the default output from pydantic by calling `to_dict()` of current_user_membership 149 if self.current_user_membership: 150 _dict["currentUserMembership"] = self.current_user_membership.to_dict() 151 # override the default output from pydantic by calling `to_dict()` of created_by 152 if self.created_by: 153 _dict["createdBy"] = self.created_by.to_dict() 154 # override the default output from pydantic by calling `to_dict()` of last_opened_by 155 if self.last_opened_by: 156 _dict["lastOpenedBy"] = self.last_opened_by.to_dict() 157 # override the default output from pydantic by calling `to_dict()` of modified_by 158 if self.modified_by: 159 _dict["modifiedBy"] = self.modified_by.to_dict() 160 # override the default output from pydantic by calling `to_dict()` of links 161 if self.links: 162 _dict["links"] = self.links.to_dict() 163 # puts key-value pairs in additional_properties in the top level 164 if self.additional_properties is not None: 165 for _key, _value in self.additional_properties.items(): 166 _dict[_key] = _value 167 168 return _dict 169 170 @classmethod 171 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 172 """Create an instance of BoardWithLinksAndLastOpened from a dict""" 173 if obj is None: 174 return None 175 176 if not isinstance(obj, dict): 177 return cls.model_validate(obj) 178 179 _obj = cls.model_validate( 180 { 181 "id": obj.get("id"), 182 "name": obj.get("name"), 183 "description": obj.get("description"), 184 "team": Team.from_dict(obj["team"]) if obj.get("team") is not None else None, 185 "project": BoardProject.from_dict(obj["project"]) if obj.get("project") is not None else None, 186 "picture": Picture.from_dict(obj["picture"]) if obj.get("picture") is not None else None, 187 "policy": BoardPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, 188 "viewLink": obj.get("viewLink"), 189 "owner": UserInfoShort.from_dict(obj["owner"]) if obj.get("owner") is not None else None, 190 "currentUserMembership": ( 191 BoardMember.from_dict(obj["currentUserMembership"]) 192 if obj.get("currentUserMembership") is not None 193 else None 194 ), 195 "createdAt": obj.get("createdAt"), 196 "createdBy": UserInfoShort.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 197 "lastOpenedAt": obj.get("lastOpenedAt"), 198 "lastOpenedBy": ( 199 GetBoardUserInfoLastOpenedBy.from_dict(obj["lastOpenedBy"]) 200 if obj.get("lastOpenedBy") is not None 201 else None 202 ), 203 "modifiedAt": obj.get("modifiedAt"), 204 "modifiedBy": UserInfoShort.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 205 "links": BoardLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, 206 "type": obj.get("type"), 207 } 208 ) 209 # store additional fields in additional_properties 210 for _key in obj.keys(): 211 if _key not in cls.__properties: 212 _obj.additional_properties[_key] = obj.get(_key) 213 214 return _obj
35class BoardWithLinksAndLastOpened(BaseModel): 36 """ 37 BoardWithLinksAndLastOpened 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 last_opened_at: Optional[datetime] = Field( 57 default=None, 58 description="Date and time when the board was last opened by any user. 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="lastOpenedAt", 60 ) 61 last_opened_by: Optional[GetBoardUserInfoLastOpenedBy] = Field(default=None, alias="lastOpenedBy") 62 modified_at: Optional[datetime] = Field( 63 default=None, 64 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)).", 65 alias="modifiedAt", 66 ) 67 modified_by: Optional[UserInfoShort] = Field(default=None, alias="modifiedBy") 68 links: Optional[BoardLinks] = None 69 type: StrictStr = Field(description="Type of the object that is returned. In this case, type returns `board`.") 70 additional_properties: Dict[str, Any] = {} 71 __properties: ClassVar[List[str]] = [ 72 "id", 73 "name", 74 "description", 75 "team", 76 "project", 77 "picture", 78 "policy", 79 "viewLink", 80 "owner", 81 "currentUserMembership", 82 "createdAt", 83 "createdBy", 84 "lastOpenedAt", 85 "lastOpenedBy", 86 "modifiedAt", 87 "modifiedBy", 88 "links", 89 "type", 90 ] 91 92 model_config = { 93 "populate_by_name": True, 94 "validate_assignment": True, 95 "protected_namespaces": (), 96 } 97 98 def to_str(self) -> str: 99 """Returns the string representation of the model using alias""" 100 return pprint.pformat(self.model_dump(by_alias=True)) 101 102 def to_json(self) -> str: 103 """Returns the JSON representation of the model using alias""" 104 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 105 return json.dumps(self.to_dict()) 106 107 @classmethod 108 def from_json(cls, json_str: str) -> Optional[Self]: 109 """Create an instance of BoardWithLinksAndLastOpened from a JSON string""" 110 return cls.from_dict(json.loads(json_str)) 111 112 def to_dict(self) -> Dict[str, Any]: 113 """Return the dictionary representation of the model using alias. 114 115 This has the following differences from calling pydantic's 116 `self.model_dump(by_alias=True)`: 117 118 * `None` is only added to the output dict for nullable fields that 119 were set at model initialization. Other fields with value `None` 120 are ignored. 121 * Fields in `self.additional_properties` are added to the output dict. 122 """ 123 excluded_fields: Set[str] = set( 124 [ 125 "additional_properties", 126 ] 127 ) 128 129 _dict = self.model_dump( 130 by_alias=True, 131 exclude=excluded_fields, 132 exclude_none=True, 133 ) 134 # override the default output from pydantic by calling `to_dict()` of team 135 if self.team: 136 _dict["team"] = self.team.to_dict() 137 # override the default output from pydantic by calling `to_dict()` of project 138 if self.project: 139 _dict["project"] = self.project.to_dict() 140 # override the default output from pydantic by calling `to_dict()` of picture 141 if self.picture: 142 _dict["picture"] = self.picture.to_dict() 143 # override the default output from pydantic by calling `to_dict()` of policy 144 if self.policy: 145 _dict["policy"] = self.policy.to_dict() 146 # override the default output from pydantic by calling `to_dict()` of owner 147 if self.owner: 148 _dict["owner"] = self.owner.to_dict() 149 # override the default output from pydantic by calling `to_dict()` of current_user_membership 150 if self.current_user_membership: 151 _dict["currentUserMembership"] = self.current_user_membership.to_dict() 152 # override the default output from pydantic by calling `to_dict()` of created_by 153 if self.created_by: 154 _dict["createdBy"] = self.created_by.to_dict() 155 # override the default output from pydantic by calling `to_dict()` of last_opened_by 156 if self.last_opened_by: 157 _dict["lastOpenedBy"] = self.last_opened_by.to_dict() 158 # override the default output from pydantic by calling `to_dict()` of modified_by 159 if self.modified_by: 160 _dict["modifiedBy"] = self.modified_by.to_dict() 161 # override the default output from pydantic by calling `to_dict()` of links 162 if self.links: 163 _dict["links"] = self.links.to_dict() 164 # puts key-value pairs in additional_properties in the top level 165 if self.additional_properties is not None: 166 for _key, _value in self.additional_properties.items(): 167 _dict[_key] = _value 168 169 return _dict 170 171 @classmethod 172 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 173 """Create an instance of BoardWithLinksAndLastOpened from a dict""" 174 if obj is None: 175 return None 176 177 if not isinstance(obj, dict): 178 return cls.model_validate(obj) 179 180 _obj = cls.model_validate( 181 { 182 "id": obj.get("id"), 183 "name": obj.get("name"), 184 "description": obj.get("description"), 185 "team": Team.from_dict(obj["team"]) if obj.get("team") is not None else None, 186 "project": BoardProject.from_dict(obj["project"]) if obj.get("project") is not None else None, 187 "picture": Picture.from_dict(obj["picture"]) if obj.get("picture") is not None else None, 188 "policy": BoardPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, 189 "viewLink": obj.get("viewLink"), 190 "owner": UserInfoShort.from_dict(obj["owner"]) if obj.get("owner") is not None else None, 191 "currentUserMembership": ( 192 BoardMember.from_dict(obj["currentUserMembership"]) 193 if obj.get("currentUserMembership") is not None 194 else None 195 ), 196 "createdAt": obj.get("createdAt"), 197 "createdBy": UserInfoShort.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 198 "lastOpenedAt": obj.get("lastOpenedAt"), 199 "lastOpenedBy": ( 200 GetBoardUserInfoLastOpenedBy.from_dict(obj["lastOpenedBy"]) 201 if obj.get("lastOpenedBy") is not None 202 else None 203 ), 204 "modifiedAt": obj.get("modifiedAt"), 205 "modifiedBy": UserInfoShort.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 206 "links": BoardLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, 207 "type": obj.get("type"), 208 } 209 ) 210 # store additional fields in additional_properties 211 for _key in obj.keys(): 212 if _key not in cls.__properties: 213 _obj.additional_properties[_key] = obj.get(_key) 214 215 return _obj
BoardWithLinksAndLastOpened
98 def to_str(self) -> str: 99 """Returns the string representation of the model using alias""" 100 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
102 def to_json(self) -> str: 103 """Returns the JSON representation of the model using alias""" 104 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 105 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
107 @classmethod 108 def from_json(cls, json_str: str) -> Optional[Self]: 109 """Create an instance of BoardWithLinksAndLastOpened from a JSON string""" 110 return cls.from_dict(json.loads(json_str))
Create an instance of BoardWithLinksAndLastOpened from a JSON string
112 def to_dict(self) -> Dict[str, Any]: 113 """Return the dictionary representation of the model using alias. 114 115 This has the following differences from calling pydantic's 116 `self.model_dump(by_alias=True)`: 117 118 * `None` is only added to the output dict for nullable fields that 119 were set at model initialization. Other fields with value `None` 120 are ignored. 121 * Fields in `self.additional_properties` are added to the output dict. 122 """ 123 excluded_fields: Set[str] = set( 124 [ 125 "additional_properties", 126 ] 127 ) 128 129 _dict = self.model_dump( 130 by_alias=True, 131 exclude=excluded_fields, 132 exclude_none=True, 133 ) 134 # override the default output from pydantic by calling `to_dict()` of team 135 if self.team: 136 _dict["team"] = self.team.to_dict() 137 # override the default output from pydantic by calling `to_dict()` of project 138 if self.project: 139 _dict["project"] = self.project.to_dict() 140 # override the default output from pydantic by calling `to_dict()` of picture 141 if self.picture: 142 _dict["picture"] = self.picture.to_dict() 143 # override the default output from pydantic by calling `to_dict()` of policy 144 if self.policy: 145 _dict["policy"] = self.policy.to_dict() 146 # override the default output from pydantic by calling `to_dict()` of owner 147 if self.owner: 148 _dict["owner"] = self.owner.to_dict() 149 # override the default output from pydantic by calling `to_dict()` of current_user_membership 150 if self.current_user_membership: 151 _dict["currentUserMembership"] = self.current_user_membership.to_dict() 152 # override the default output from pydantic by calling `to_dict()` of created_by 153 if self.created_by: 154 _dict["createdBy"] = self.created_by.to_dict() 155 # override the default output from pydantic by calling `to_dict()` of last_opened_by 156 if self.last_opened_by: 157 _dict["lastOpenedBy"] = self.last_opened_by.to_dict() 158 # override the default output from pydantic by calling `to_dict()` of modified_by 159 if self.modified_by: 160 _dict["modifiedBy"] = self.modified_by.to_dict() 161 # override the default output from pydantic by calling `to_dict()` of links 162 if self.links: 163 _dict["links"] = self.links.to_dict() 164 # puts key-value pairs in additional_properties in the top level 165 if self.additional_properties is not None: 166 for _key, _value in self.additional_properties.items(): 167 _dict[_key] = _value 168 169 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.
171 @classmethod 172 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 173 """Create an instance of BoardWithLinksAndLastOpened from a dict""" 174 if obj is None: 175 return None 176 177 if not isinstance(obj, dict): 178 return cls.model_validate(obj) 179 180 _obj = cls.model_validate( 181 { 182 "id": obj.get("id"), 183 "name": obj.get("name"), 184 "description": obj.get("description"), 185 "team": Team.from_dict(obj["team"]) if obj.get("team") is not None else None, 186 "project": BoardProject.from_dict(obj["project"]) if obj.get("project") is not None else None, 187 "picture": Picture.from_dict(obj["picture"]) if obj.get("picture") is not None else None, 188 "policy": BoardPolicy.from_dict(obj["policy"]) if obj.get("policy") is not None else None, 189 "viewLink": obj.get("viewLink"), 190 "owner": UserInfoShort.from_dict(obj["owner"]) if obj.get("owner") is not None else None, 191 "currentUserMembership": ( 192 BoardMember.from_dict(obj["currentUserMembership"]) 193 if obj.get("currentUserMembership") is not None 194 else None 195 ), 196 "createdAt": obj.get("createdAt"), 197 "createdBy": UserInfoShort.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None, 198 "lastOpenedAt": obj.get("lastOpenedAt"), 199 "lastOpenedBy": ( 200 GetBoardUserInfoLastOpenedBy.from_dict(obj["lastOpenedBy"]) 201 if obj.get("lastOpenedBy") is not None 202 else None 203 ), 204 "modifiedAt": obj.get("modifiedAt"), 205 "modifiedBy": UserInfoShort.from_dict(obj["modifiedBy"]) if obj.get("modifiedBy") is not None else None, 206 "links": BoardLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, 207 "type": obj.get("type"), 208 } 209 ) 210 # store additional fields in additional_properties 211 for _key in obj.keys(): 212 if _key not in cls.__properties: 213 _obj.additional_properties[_key] = obj.get(_key) 214 215 return _obj
Create an instance of BoardWithLinksAndLastOpened 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