miro_api.models.create_user_resource
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 pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator 20from typing import Any, ClassVar, Dict, List, Optional 21from miro_api.models.create_user_resource_name import CreateUserResourceName 22from miro_api.models.create_user_resource_photos_inner import CreateUserResourcePhotosInner 23from miro_api.models.create_user_resource_roles_inner import CreateUserResourceRolesInner 24from miro_api.models.create_user_resource_urn_ietf_params_scim_schemas_extension_enterprise20_user import ( 25 CreateUserResourceUrnIetfParamsScimSchemasExtensionEnterprise20User, 26) 27from typing import Optional, Set 28from typing_extensions import Self 29 30 31class CreateUserResource(BaseModel): 32 """ 33 CreateUserResource 34 """ # noqa: E501 35 36 schemas: Optional[List[StrictStr]] = Field( 37 default=None, 38 description="Identifies which schema(s) this resource uses. In this case it is the SCIM core User schema.", 39 ) 40 user_name: StrictStr = Field( 41 description="The unique username/login identifier. An email address in this case. <br><br> Note: Payload must include the userName attribute populated with an email address<br><br> User is created with this email address in the organization. This attribute will be used as full name of the created user if the displayName or name attribute is not provided.", 42 alias="userName", 43 ) 44 name: Optional[CreateUserResourceName] = None 45 display_name: Optional[StrictStr] = Field( 46 default=None, 47 description="A human-readable name for the user, typically the full name. This attribute is used if the value is not empty. <br><br> Maximum length: 60 characters", 48 alias="displayName", 49 ) 50 user_type: Optional[StrictStr] = Field( 51 default=None, 52 description="Free-form string to indicate the user license type in the organization. <br><br> Only supported values for licenses are allowed. Supported licences for organizations can vary. They can potentially have the following values: Full, Free, Free Restricted, Full (Trial), Basic. <br><br> Note: When `userType` is specified, the `userType` license is set per the value provided. When `userType` is not specified, the user license is set according to internal Miro logic, which depends on the organization plan.", 53 alias="userType", 54 ) 55 active: Optional[StrictBool] = Field( 56 default=None, description="Indicates whether the user is active or deactivated in the organization." 57 ) 58 photos: Optional[List[CreateUserResourcePhotosInner]] = Field( 59 default=None, 60 description='An array of display picture for the user in the organization. Contains photo value and type. <br><br> Notes: Must be a text URL to the image. Supported file types: jpg, jpeg, bmp, png, gif. <br><br> To define file type, you should have defined file extension in url (e.g. https://host.com/avatar_user1.jpg) or request to url should return together with a file content a header Content-Type (e.g. Content-Type = image/jpeg) <br><br> Maximum file size to download is: 31457280 bytes. <br><br> Example (Okta): photos.^[type==photo].value <br> Example (Azure): photos[type eq "photo"].value', 61 ) 62 roles: Optional[List[CreateUserResourceRolesInner]] = Field( 63 default=None, 64 description='An array of roles assigned to the user in the organization. Contains role value, display, type, and primary flag. <br><br> organization_user_role supported values include: ORGANIZATION_INTERNAL_ADMIN and ORGANIZATION_INTERNAL_USER. organization_admin_role supported values include: Content Admin, User Admin, Security Admin, or names of custom admin roles. <br><br> Example (Okta) for organization_user_role: roles.^[primary==true].value <br> Example (Azure) for organization_user_role: roles[primary eq "True"].value <br> Example (Okta) for organization_admin_role: roles.^[primary==false].value <br> Example (Azure) for organization_admin_role: roles[primary eq "False"].value <br>', 65 ) 66 preferred_language: Optional[StrictStr] = Field( 67 default=None, 68 description="Specifies the user's preferred language. <br><br> Example: en_US for English.", 69 alias="preferredLanguage", 70 ) 71 urnietfparamsscimschemasextensionenterprise2_0_user: Optional[ 72 CreateUserResourceUrnIetfParamsScimSchemasExtensionEnterprise20User 73 ] = Field(default=None, alias="urn:ietf:params:scim:schemas:extension:enterprise:2.0:User") 74 additional_properties: Dict[str, Any] = {} 75 __properties: ClassVar[List[str]] = [ 76 "schemas", 77 "userName", 78 "name", 79 "displayName", 80 "userType", 81 "active", 82 "photos", 83 "roles", 84 "preferredLanguage", 85 "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", 86 ] 87 88 @field_validator("schemas") 89 def schemas_validate_enum(cls, value): 90 """Validates the enum""" 91 if value is None: 92 return value 93 94 for i in value: 95 if i not in set(["urn:ietf:params:scim:schemas:core:2.0:User"]): 96 raise ValueError("each list item must be one of ('urn:ietf:params:scim:schemas:core:2.0:User')") 97 return value 98 99 model_config = { 100 "populate_by_name": True, 101 "validate_assignment": True, 102 "protected_namespaces": (), 103 } 104 105 def to_str(self) -> str: 106 """Returns the string representation of the model using alias""" 107 return pprint.pformat(self.model_dump(by_alias=True)) 108 109 def to_json(self) -> str: 110 """Returns the JSON representation of the model using alias""" 111 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 112 return json.dumps(self.to_dict()) 113 114 @classmethod 115 def from_json(cls, json_str: str) -> Optional[Self]: 116 """Create an instance of CreateUserResource from a JSON string""" 117 return cls.from_dict(json.loads(json_str)) 118 119 def to_dict(self) -> Dict[str, Any]: 120 """Return the dictionary representation of the model using alias. 121 122 This has the following differences from calling pydantic's 123 `self.model_dump(by_alias=True)`: 124 125 * `None` is only added to the output dict for nullable fields that 126 were set at model initialization. Other fields with value `None` 127 are ignored. 128 * Fields in `self.additional_properties` are added to the output dict. 129 """ 130 excluded_fields: Set[str] = set( 131 [ 132 "additional_properties", 133 ] 134 ) 135 136 _dict = self.model_dump( 137 by_alias=True, 138 exclude=excluded_fields, 139 exclude_none=True, 140 ) 141 # override the default output from pydantic by calling `to_dict()` of name 142 if self.name: 143 _dict["name"] = self.name.to_dict() 144 # override the default output from pydantic by calling `to_dict()` of each item in photos (list) 145 _items = [] 146 if self.photos: 147 for _item in self.photos: 148 if _item: 149 _items.append(_item.to_dict()) 150 _dict["photos"] = _items 151 # override the default output from pydantic by calling `to_dict()` of each item in roles (list) 152 _items = [] 153 if self.roles: 154 for _item in self.roles: 155 if _item: 156 _items.append(_item.to_dict()) 157 _dict["roles"] = _items 158 # override the default output from pydantic by calling `to_dict()` of urnietfparamsscimschemasextensionenterprise2_0_user 159 if self.urnietfparamsscimschemasextensionenterprise2_0_user: 160 _dict["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"] = ( 161 self.urnietfparamsscimschemasextensionenterprise2_0_user.to_dict() 162 ) 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 CreateUserResource 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 "schemas": obj.get("schemas"), 182 "userName": obj.get("userName"), 183 "name": CreateUserResourceName.from_dict(obj["name"]) if obj.get("name") is not None else None, 184 "displayName": obj.get("displayName"), 185 "userType": obj.get("userType"), 186 "active": obj.get("active"), 187 "photos": ( 188 [CreateUserResourcePhotosInner.from_dict(_item) for _item in obj["photos"]] 189 if obj.get("photos") is not None 190 else None 191 ), 192 "roles": ( 193 [CreateUserResourceRolesInner.from_dict(_item) for _item in obj["roles"]] 194 if obj.get("roles") is not None 195 else None 196 ), 197 "preferredLanguage": obj.get("preferredLanguage"), 198 "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": ( 199 CreateUserResourceUrnIetfParamsScimSchemasExtensionEnterprise20User.from_dict( 200 obj["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"] 201 ) 202 if obj.get("urn:ietf:params:scim:schemas:extension:enterprise:2.0:User") is not None 203 else None 204 ), 205 } 206 ) 207 # store additional fields in additional_properties 208 for _key in obj.keys(): 209 if _key not in cls.__properties: 210 _obj.additional_properties[_key] = obj.get(_key) 211 212 return _obj
32class CreateUserResource(BaseModel): 33 """ 34 CreateUserResource 35 """ # noqa: E501 36 37 schemas: Optional[List[StrictStr]] = Field( 38 default=None, 39 description="Identifies which schema(s) this resource uses. In this case it is the SCIM core User schema.", 40 ) 41 user_name: StrictStr = Field( 42 description="The unique username/login identifier. An email address in this case. <br><br> Note: Payload must include the userName attribute populated with an email address<br><br> User is created with this email address in the organization. This attribute will be used as full name of the created user if the displayName or name attribute is not provided.", 43 alias="userName", 44 ) 45 name: Optional[CreateUserResourceName] = None 46 display_name: Optional[StrictStr] = Field( 47 default=None, 48 description="A human-readable name for the user, typically the full name. This attribute is used if the value is not empty. <br><br> Maximum length: 60 characters", 49 alias="displayName", 50 ) 51 user_type: Optional[StrictStr] = Field( 52 default=None, 53 description="Free-form string to indicate the user license type in the organization. <br><br> Only supported values for licenses are allowed. Supported licences for organizations can vary. They can potentially have the following values: Full, Free, Free Restricted, Full (Trial), Basic. <br><br> Note: When `userType` is specified, the `userType` license is set per the value provided. When `userType` is not specified, the user license is set according to internal Miro logic, which depends on the organization plan.", 54 alias="userType", 55 ) 56 active: Optional[StrictBool] = Field( 57 default=None, description="Indicates whether the user is active or deactivated in the organization." 58 ) 59 photos: Optional[List[CreateUserResourcePhotosInner]] = Field( 60 default=None, 61 description='An array of display picture for the user in the organization. Contains photo value and type. <br><br> Notes: Must be a text URL to the image. Supported file types: jpg, jpeg, bmp, png, gif. <br><br> To define file type, you should have defined file extension in url (e.g. https://host.com/avatar_user1.jpg) or request to url should return together with a file content a header Content-Type (e.g. Content-Type = image/jpeg) <br><br> Maximum file size to download is: 31457280 bytes. <br><br> Example (Okta): photos.^[type==photo].value <br> Example (Azure): photos[type eq "photo"].value', 62 ) 63 roles: Optional[List[CreateUserResourceRolesInner]] = Field( 64 default=None, 65 description='An array of roles assigned to the user in the organization. Contains role value, display, type, and primary flag. <br><br> organization_user_role supported values include: ORGANIZATION_INTERNAL_ADMIN and ORGANIZATION_INTERNAL_USER. organization_admin_role supported values include: Content Admin, User Admin, Security Admin, or names of custom admin roles. <br><br> Example (Okta) for organization_user_role: roles.^[primary==true].value <br> Example (Azure) for organization_user_role: roles[primary eq "True"].value <br> Example (Okta) for organization_admin_role: roles.^[primary==false].value <br> Example (Azure) for organization_admin_role: roles[primary eq "False"].value <br>', 66 ) 67 preferred_language: Optional[StrictStr] = Field( 68 default=None, 69 description="Specifies the user's preferred language. <br><br> Example: en_US for English.", 70 alias="preferredLanguage", 71 ) 72 urnietfparamsscimschemasextensionenterprise2_0_user: Optional[ 73 CreateUserResourceUrnIetfParamsScimSchemasExtensionEnterprise20User 74 ] = Field(default=None, alias="urn:ietf:params:scim:schemas:extension:enterprise:2.0:User") 75 additional_properties: Dict[str, Any] = {} 76 __properties: ClassVar[List[str]] = [ 77 "schemas", 78 "userName", 79 "name", 80 "displayName", 81 "userType", 82 "active", 83 "photos", 84 "roles", 85 "preferredLanguage", 86 "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", 87 ] 88 89 @field_validator("schemas") 90 def schemas_validate_enum(cls, value): 91 """Validates the enum""" 92 if value is None: 93 return value 94 95 for i in value: 96 if i not in set(["urn:ietf:params:scim:schemas:core:2.0:User"]): 97 raise ValueError("each list item must be one of ('urn:ietf:params:scim:schemas:core:2.0:User')") 98 return value 99 100 model_config = { 101 "populate_by_name": True, 102 "validate_assignment": True, 103 "protected_namespaces": (), 104 } 105 106 def to_str(self) -> str: 107 """Returns the string representation of the model using alias""" 108 return pprint.pformat(self.model_dump(by_alias=True)) 109 110 def to_json(self) -> str: 111 """Returns the JSON representation of the model using alias""" 112 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 113 return json.dumps(self.to_dict()) 114 115 @classmethod 116 def from_json(cls, json_str: str) -> Optional[Self]: 117 """Create an instance of CreateUserResource from a JSON string""" 118 return cls.from_dict(json.loads(json_str)) 119 120 def to_dict(self) -> Dict[str, Any]: 121 """Return the dictionary representation of the model using alias. 122 123 This has the following differences from calling pydantic's 124 `self.model_dump(by_alias=True)`: 125 126 * `None` is only added to the output dict for nullable fields that 127 were set at model initialization. Other fields with value `None` 128 are ignored. 129 * Fields in `self.additional_properties` are added to the output dict. 130 """ 131 excluded_fields: Set[str] = set( 132 [ 133 "additional_properties", 134 ] 135 ) 136 137 _dict = self.model_dump( 138 by_alias=True, 139 exclude=excluded_fields, 140 exclude_none=True, 141 ) 142 # override the default output from pydantic by calling `to_dict()` of name 143 if self.name: 144 _dict["name"] = self.name.to_dict() 145 # override the default output from pydantic by calling `to_dict()` of each item in photos (list) 146 _items = [] 147 if self.photos: 148 for _item in self.photos: 149 if _item: 150 _items.append(_item.to_dict()) 151 _dict["photos"] = _items 152 # override the default output from pydantic by calling `to_dict()` of each item in roles (list) 153 _items = [] 154 if self.roles: 155 for _item in self.roles: 156 if _item: 157 _items.append(_item.to_dict()) 158 _dict["roles"] = _items 159 # override the default output from pydantic by calling `to_dict()` of urnietfparamsscimschemasextensionenterprise2_0_user 160 if self.urnietfparamsscimschemasextensionenterprise2_0_user: 161 _dict["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"] = ( 162 self.urnietfparamsscimschemasextensionenterprise2_0_user.to_dict() 163 ) 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 CreateUserResource 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 "schemas": obj.get("schemas"), 183 "userName": obj.get("userName"), 184 "name": CreateUserResourceName.from_dict(obj["name"]) if obj.get("name") is not None else None, 185 "displayName": obj.get("displayName"), 186 "userType": obj.get("userType"), 187 "active": obj.get("active"), 188 "photos": ( 189 [CreateUserResourcePhotosInner.from_dict(_item) for _item in obj["photos"]] 190 if obj.get("photos") is not None 191 else None 192 ), 193 "roles": ( 194 [CreateUserResourceRolesInner.from_dict(_item) for _item in obj["roles"]] 195 if obj.get("roles") is not None 196 else None 197 ), 198 "preferredLanguage": obj.get("preferredLanguage"), 199 "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": ( 200 CreateUserResourceUrnIetfParamsScimSchemasExtensionEnterprise20User.from_dict( 201 obj["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"] 202 ) 203 if obj.get("urn:ietf:params:scim:schemas:extension:enterprise:2.0:User") is not None 204 else None 205 ), 206 } 207 ) 208 # store additional fields in additional_properties 209 for _key in obj.keys(): 210 if _key not in cls.__properties: 211 _obj.additional_properties[_key] = obj.get(_key) 212 213 return _obj
CreateUserResource
89 @field_validator("schemas") 90 def schemas_validate_enum(cls, value): 91 """Validates the enum""" 92 if value is None: 93 return value 94 95 for i in value: 96 if i not in set(["urn:ietf:params:scim:schemas:core:2.0:User"]): 97 raise ValueError("each list item must be one of ('urn:ietf:params:scim:schemas:core:2.0:User')") 98 return value
Validates the enum
106 def to_str(self) -> str: 107 """Returns the string representation of the model using alias""" 108 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
110 def to_json(self) -> str: 111 """Returns the JSON representation of the model using alias""" 112 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 113 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
115 @classmethod 116 def from_json(cls, json_str: str) -> Optional[Self]: 117 """Create an instance of CreateUserResource from a JSON string""" 118 return cls.from_dict(json.loads(json_str))
Create an instance of CreateUserResource from a JSON string
120 def to_dict(self) -> Dict[str, Any]: 121 """Return the dictionary representation of the model using alias. 122 123 This has the following differences from calling pydantic's 124 `self.model_dump(by_alias=True)`: 125 126 * `None` is only added to the output dict for nullable fields that 127 were set at model initialization. Other fields with value `None` 128 are ignored. 129 * Fields in `self.additional_properties` are added to the output dict. 130 """ 131 excluded_fields: Set[str] = set( 132 [ 133 "additional_properties", 134 ] 135 ) 136 137 _dict = self.model_dump( 138 by_alias=True, 139 exclude=excluded_fields, 140 exclude_none=True, 141 ) 142 # override the default output from pydantic by calling `to_dict()` of name 143 if self.name: 144 _dict["name"] = self.name.to_dict() 145 # override the default output from pydantic by calling `to_dict()` of each item in photos (list) 146 _items = [] 147 if self.photos: 148 for _item in self.photos: 149 if _item: 150 _items.append(_item.to_dict()) 151 _dict["photos"] = _items 152 # override the default output from pydantic by calling `to_dict()` of each item in roles (list) 153 _items = [] 154 if self.roles: 155 for _item in self.roles: 156 if _item: 157 _items.append(_item.to_dict()) 158 _dict["roles"] = _items 159 # override the default output from pydantic by calling `to_dict()` of urnietfparamsscimschemasextensionenterprise2_0_user 160 if self.urnietfparamsscimschemasextensionenterprise2_0_user: 161 _dict["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"] = ( 162 self.urnietfparamsscimschemasextensionenterprise2_0_user.to_dict() 163 ) 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 CreateUserResource 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 "schemas": obj.get("schemas"), 183 "userName": obj.get("userName"), 184 "name": CreateUserResourceName.from_dict(obj["name"]) if obj.get("name") is not None else None, 185 "displayName": obj.get("displayName"), 186 "userType": obj.get("userType"), 187 "active": obj.get("active"), 188 "photos": ( 189 [CreateUserResourcePhotosInner.from_dict(_item) for _item in obj["photos"]] 190 if obj.get("photos") is not None 191 else None 192 ), 193 "roles": ( 194 [CreateUserResourceRolesInner.from_dict(_item) for _item in obj["roles"]] 195 if obj.get("roles") is not None 196 else None 197 ), 198 "preferredLanguage": obj.get("preferredLanguage"), 199 "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": ( 200 CreateUserResourceUrnIetfParamsScimSchemasExtensionEnterprise20User.from_dict( 201 obj["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"] 202 ) 203 if obj.get("urn:ietf:params:scim:schemas:extension:enterprise:2.0:User") is not None 204 else None 205 ), 206 } 207 ) 208 # store additional fields in additional_properties 209 for _key in obj.keys(): 210 if _key not in cls.__properties: 211 _obj.additional_properties[_key] = obj.get(_key) 212 213 return _obj
Create an instance of CreateUserResource 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