miro_api.models.team_sharing_policy_settings_changes
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 pydantic import BaseModel, Field, StrictStr, field_validator 21from typing import Any, ClassVar, Dict, List, Optional 22from typing import Optional, Set 23from typing_extensions import Self 24 25 26class TeamSharingPolicySettingsChanges(BaseModel): 27 """ 28 Team sharing policy settings 29 """ # noqa: E501 30 31 allow_listed_domains: Optional[List[StrictStr]] = Field( 32 default=None, description="Allow listed domains", alias="allowListedDomains" 33 ) 34 create_asset_access_level: Optional[StrictStr] = Field( 35 default=None, 36 description=' * "company_admins": Only company admins can create assets in a team * "admins": Both team and company admins can create assets in a team. * "all_members": all_members ', 37 alias="createAssetAccessLevel", 38 ) 39 default_board_access: Optional[StrictStr] = Field( 40 default=None, 41 description=' Default board access * "private": Only board owners can access * "view": Anyone in the team can view * "comment": Anyone in the team can comment * "edit": Anyone in the team can edit ', 42 alias="defaultBoardAccess", 43 ) 44 default_board_sharing_access: Optional[StrictStr] = Field( 45 default="team_members_with_editing_rights", 46 description=' Indicates who can change board access and invite users to boards in this team, by default. * "team_members_with_editing_rights": Any team member with editing rights on the board. * "owner_and_coowners": Only the owner and co-owners of the board. ', 47 alias="defaultBoardSharingAccess", 48 ) 49 default_organization_access: Optional[StrictStr] = Field( 50 default=None, 51 description=' Default organization access * "private": Only board owners can access * "view": Anyone in the team can view * "comment": Anyone in the team can comment * "edit": Anyone in the team can edit ', 52 alias="defaultOrganizationAccess", 53 ) 54 default_project_access: Optional[StrictStr] = Field( 55 default=None, 56 description=' Default project access * "private": Only board owners can access * "view": Anyone in the team can view ', 57 alias="defaultProjectAccess", 58 ) 59 move_board_to_account: Optional[StrictStr] = Field( 60 default=None, 61 description=' * "allowed": Allow move board to team * "not_allowed": Not allow move board to team ', 62 alias="moveBoardToAccount", 63 ) 64 restrict_allowed_domains: Optional[StrictStr] = Field( 65 default=None, 66 description=' * "enabled": Enabled. Restrict to listed domain. * "disabled": Disabled. No domain restriction. * "enabled_with_external_users_access": Enabled. Restrict to listed domain but allows external users to access. ', 67 alias="restrictAllowedDomains", 68 ) 69 sharing_on_account: Optional[StrictStr] = Field( 70 default=None, 71 description=' * "allowed": Allow sharing on team * "not_allowed": Not allow sharing on team ', 72 alias="sharingOnAccount", 73 ) 74 sharing_on_organization: Optional[StrictStr] = Field( 75 default=None, 76 description=' * "allowed": Allow sharing on organization * "allowed_with_editing": Allow sharing with editing on organization * "not_allowed": Not allow sharing on organization ', 77 alias="sharingOnOrganization", 78 ) 79 sharing_via_public_link: Optional[StrictStr] = Field( 80 default=None, 81 description=' * "allowed": Allow sharing via public link * "allowed_with_editing": Allow sharing with editing via public link * "not_allowed": Not allow sharing via public link ', 82 alias="sharingViaPublicLink", 83 ) 84 additional_properties: Dict[str, Any] = {} 85 __properties: ClassVar[List[str]] = [ 86 "allowListedDomains", 87 "createAssetAccessLevel", 88 "defaultBoardAccess", 89 "defaultBoardSharingAccess", 90 "defaultOrganizationAccess", 91 "defaultProjectAccess", 92 "moveBoardToAccount", 93 "restrictAllowedDomains", 94 "sharingOnAccount", 95 "sharingOnOrganization", 96 "sharingViaPublicLink", 97 ] 98 99 @field_validator("create_asset_access_level") 100 def create_asset_access_level_validate_enum(cls, value): 101 """Validates the enum""" 102 if value is None: 103 return value 104 105 if value not in set(["company_admins", "admins", "all_members"]): 106 raise ValueError("must be one of enum values ('company_admins', 'admins', 'all_members')") 107 return value 108 109 @field_validator("default_board_access") 110 def default_board_access_validate_enum(cls, value): 111 """Validates the enum""" 112 if value is None: 113 return value 114 115 if value not in set(["private", "view", "comment", "edit"]): 116 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 117 return value 118 119 @field_validator("default_board_sharing_access") 120 def default_board_sharing_access_validate_enum(cls, value): 121 """Validates the enum""" 122 if value is None: 123 return value 124 125 if value not in set(["team_members_with_editing_rights", "owner_and_coowners"]): 126 raise ValueError("must be one of enum values ('team_members_with_editing_rights', 'owner_and_coowners')") 127 return value 128 129 @field_validator("default_organization_access") 130 def default_organization_access_validate_enum(cls, value): 131 """Validates the enum""" 132 if value is None: 133 return value 134 135 if value not in set(["private", "view", "comment", "edit"]): 136 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 137 return value 138 139 @field_validator("default_project_access") 140 def default_project_access_validate_enum(cls, value): 141 """Validates the enum""" 142 if value is None: 143 return value 144 145 if value not in set(["private", "view"]): 146 raise ValueError("must be one of enum values ('private', 'view')") 147 return value 148 149 @field_validator("move_board_to_account") 150 def move_board_to_account_validate_enum(cls, value): 151 """Validates the enum""" 152 if value is None: 153 return value 154 155 if value not in set(["allowed", "not_allowed"]): 156 raise ValueError("must be one of enum values ('allowed', 'not_allowed')") 157 return value 158 159 @field_validator("restrict_allowed_domains") 160 def restrict_allowed_domains_validate_enum(cls, value): 161 """Validates the enum""" 162 if value is None: 163 return value 164 165 if value not in set(["enabled", "enabled_with_external_user_access", "disabled"]): 166 raise ValueError("must be one of enum values ('enabled', 'enabled_with_external_user_access', 'disabled')") 167 return value 168 169 @field_validator("sharing_on_account") 170 def sharing_on_account_validate_enum(cls, value): 171 """Validates the enum""" 172 if value is None: 173 return value 174 175 if value not in set(["allowed", "not_allowed"]): 176 raise ValueError("must be one of enum values ('allowed', 'not_allowed')") 177 return value 178 179 @field_validator("sharing_on_organization") 180 def sharing_on_organization_validate_enum(cls, value): 181 """Validates the enum""" 182 if value is None: 183 return value 184 185 if value not in set(["allowed", "allowed_with_editing", "not_allowed"]): 186 raise ValueError("must be one of enum values ('allowed', 'allowed_with_editing', 'not_allowed')") 187 return value 188 189 @field_validator("sharing_via_public_link") 190 def sharing_via_public_link_validate_enum(cls, value): 191 """Validates the enum""" 192 if value is None: 193 return value 194 195 if value not in set(["allowed", "allowed_with_editing", "not_allowed"]): 196 raise ValueError("must be one of enum values ('allowed', 'allowed_with_editing', 'not_allowed')") 197 return value 198 199 model_config = { 200 "populate_by_name": True, 201 "validate_assignment": True, 202 "protected_namespaces": (), 203 } 204 205 def to_str(self) -> str: 206 """Returns the string representation of the model using alias""" 207 return pprint.pformat(self.model_dump(by_alias=True)) 208 209 def to_json(self) -> str: 210 """Returns the JSON representation of the model using alias""" 211 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 212 return json.dumps(self.to_dict()) 213 214 @classmethod 215 def from_json(cls, json_str: str) -> Optional[Self]: 216 """Create an instance of TeamSharingPolicySettingsChanges from a JSON string""" 217 return cls.from_dict(json.loads(json_str)) 218 219 def to_dict(self) -> Dict[str, Any]: 220 """Return the dictionary representation of the model using alias. 221 222 This has the following differences from calling pydantic's 223 `self.model_dump(by_alias=True)`: 224 225 * `None` is only added to the output dict for nullable fields that 226 were set at model initialization. Other fields with value `None` 227 are ignored. 228 * Fields in `self.additional_properties` are added to the output dict. 229 """ 230 excluded_fields: Set[str] = set( 231 [ 232 "additional_properties", 233 ] 234 ) 235 236 _dict = self.model_dump( 237 by_alias=True, 238 exclude=excluded_fields, 239 exclude_none=True, 240 ) 241 # puts key-value pairs in additional_properties in the top level 242 if self.additional_properties is not None: 243 for _key, _value in self.additional_properties.items(): 244 _dict[_key] = _value 245 246 return _dict 247 248 @classmethod 249 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 250 """Create an instance of TeamSharingPolicySettingsChanges from a dict""" 251 if obj is None: 252 return None 253 254 if not isinstance(obj, dict): 255 return cls.model_validate(obj) 256 257 _obj = cls.model_validate( 258 { 259 "allowListedDomains": obj.get("allowListedDomains"), 260 "createAssetAccessLevel": obj.get("createAssetAccessLevel"), 261 "defaultBoardAccess": obj.get("defaultBoardAccess"), 262 "defaultBoardSharingAccess": ( 263 obj.get("defaultBoardSharingAccess") 264 if obj.get("defaultBoardSharingAccess") is not None 265 else "team_members_with_editing_rights" 266 ), 267 "defaultOrganizationAccess": obj.get("defaultOrganizationAccess"), 268 "defaultProjectAccess": obj.get("defaultProjectAccess"), 269 "moveBoardToAccount": obj.get("moveBoardToAccount"), 270 "restrictAllowedDomains": obj.get("restrictAllowedDomains"), 271 "sharingOnAccount": obj.get("sharingOnAccount"), 272 "sharingOnOrganization": obj.get("sharingOnOrganization"), 273 "sharingViaPublicLink": obj.get("sharingViaPublicLink"), 274 } 275 ) 276 # store additional fields in additional_properties 277 for _key in obj.keys(): 278 if _key not in cls.__properties: 279 _obj.additional_properties[_key] = obj.get(_key) 280 281 return _obj
27class TeamSharingPolicySettingsChanges(BaseModel): 28 """ 29 Team sharing policy settings 30 """ # noqa: E501 31 32 allow_listed_domains: Optional[List[StrictStr]] = Field( 33 default=None, description="Allow listed domains", alias="allowListedDomains" 34 ) 35 create_asset_access_level: Optional[StrictStr] = Field( 36 default=None, 37 description=' * "company_admins": Only company admins can create assets in a team * "admins": Both team and company admins can create assets in a team. * "all_members": all_members ', 38 alias="createAssetAccessLevel", 39 ) 40 default_board_access: Optional[StrictStr] = Field( 41 default=None, 42 description=' Default board access * "private": Only board owners can access * "view": Anyone in the team can view * "comment": Anyone in the team can comment * "edit": Anyone in the team can edit ', 43 alias="defaultBoardAccess", 44 ) 45 default_board_sharing_access: Optional[StrictStr] = Field( 46 default="team_members_with_editing_rights", 47 description=' Indicates who can change board access and invite users to boards in this team, by default. * "team_members_with_editing_rights": Any team member with editing rights on the board. * "owner_and_coowners": Only the owner and co-owners of the board. ', 48 alias="defaultBoardSharingAccess", 49 ) 50 default_organization_access: Optional[StrictStr] = Field( 51 default=None, 52 description=' Default organization access * "private": Only board owners can access * "view": Anyone in the team can view * "comment": Anyone in the team can comment * "edit": Anyone in the team can edit ', 53 alias="defaultOrganizationAccess", 54 ) 55 default_project_access: Optional[StrictStr] = Field( 56 default=None, 57 description=' Default project access * "private": Only board owners can access * "view": Anyone in the team can view ', 58 alias="defaultProjectAccess", 59 ) 60 move_board_to_account: Optional[StrictStr] = Field( 61 default=None, 62 description=' * "allowed": Allow move board to team * "not_allowed": Not allow move board to team ', 63 alias="moveBoardToAccount", 64 ) 65 restrict_allowed_domains: Optional[StrictStr] = Field( 66 default=None, 67 description=' * "enabled": Enabled. Restrict to listed domain. * "disabled": Disabled. No domain restriction. * "enabled_with_external_users_access": Enabled. Restrict to listed domain but allows external users to access. ', 68 alias="restrictAllowedDomains", 69 ) 70 sharing_on_account: Optional[StrictStr] = Field( 71 default=None, 72 description=' * "allowed": Allow sharing on team * "not_allowed": Not allow sharing on team ', 73 alias="sharingOnAccount", 74 ) 75 sharing_on_organization: Optional[StrictStr] = Field( 76 default=None, 77 description=' * "allowed": Allow sharing on organization * "allowed_with_editing": Allow sharing with editing on organization * "not_allowed": Not allow sharing on organization ', 78 alias="sharingOnOrganization", 79 ) 80 sharing_via_public_link: Optional[StrictStr] = Field( 81 default=None, 82 description=' * "allowed": Allow sharing via public link * "allowed_with_editing": Allow sharing with editing via public link * "not_allowed": Not allow sharing via public link ', 83 alias="sharingViaPublicLink", 84 ) 85 additional_properties: Dict[str, Any] = {} 86 __properties: ClassVar[List[str]] = [ 87 "allowListedDomains", 88 "createAssetAccessLevel", 89 "defaultBoardAccess", 90 "defaultBoardSharingAccess", 91 "defaultOrganizationAccess", 92 "defaultProjectAccess", 93 "moveBoardToAccount", 94 "restrictAllowedDomains", 95 "sharingOnAccount", 96 "sharingOnOrganization", 97 "sharingViaPublicLink", 98 ] 99 100 @field_validator("create_asset_access_level") 101 def create_asset_access_level_validate_enum(cls, value): 102 """Validates the enum""" 103 if value is None: 104 return value 105 106 if value not in set(["company_admins", "admins", "all_members"]): 107 raise ValueError("must be one of enum values ('company_admins', 'admins', 'all_members')") 108 return value 109 110 @field_validator("default_board_access") 111 def default_board_access_validate_enum(cls, value): 112 """Validates the enum""" 113 if value is None: 114 return value 115 116 if value not in set(["private", "view", "comment", "edit"]): 117 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 118 return value 119 120 @field_validator("default_board_sharing_access") 121 def default_board_sharing_access_validate_enum(cls, value): 122 """Validates the enum""" 123 if value is None: 124 return value 125 126 if value not in set(["team_members_with_editing_rights", "owner_and_coowners"]): 127 raise ValueError("must be one of enum values ('team_members_with_editing_rights', 'owner_and_coowners')") 128 return value 129 130 @field_validator("default_organization_access") 131 def default_organization_access_validate_enum(cls, value): 132 """Validates the enum""" 133 if value is None: 134 return value 135 136 if value not in set(["private", "view", "comment", "edit"]): 137 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 138 return value 139 140 @field_validator("default_project_access") 141 def default_project_access_validate_enum(cls, value): 142 """Validates the enum""" 143 if value is None: 144 return value 145 146 if value not in set(["private", "view"]): 147 raise ValueError("must be one of enum values ('private', 'view')") 148 return value 149 150 @field_validator("move_board_to_account") 151 def move_board_to_account_validate_enum(cls, value): 152 """Validates the enum""" 153 if value is None: 154 return value 155 156 if value not in set(["allowed", "not_allowed"]): 157 raise ValueError("must be one of enum values ('allowed', 'not_allowed')") 158 return value 159 160 @field_validator("restrict_allowed_domains") 161 def restrict_allowed_domains_validate_enum(cls, value): 162 """Validates the enum""" 163 if value is None: 164 return value 165 166 if value not in set(["enabled", "enabled_with_external_user_access", "disabled"]): 167 raise ValueError("must be one of enum values ('enabled', 'enabled_with_external_user_access', 'disabled')") 168 return value 169 170 @field_validator("sharing_on_account") 171 def sharing_on_account_validate_enum(cls, value): 172 """Validates the enum""" 173 if value is None: 174 return value 175 176 if value not in set(["allowed", "not_allowed"]): 177 raise ValueError("must be one of enum values ('allowed', 'not_allowed')") 178 return value 179 180 @field_validator("sharing_on_organization") 181 def sharing_on_organization_validate_enum(cls, value): 182 """Validates the enum""" 183 if value is None: 184 return value 185 186 if value not in set(["allowed", "allowed_with_editing", "not_allowed"]): 187 raise ValueError("must be one of enum values ('allowed', 'allowed_with_editing', 'not_allowed')") 188 return value 189 190 @field_validator("sharing_via_public_link") 191 def sharing_via_public_link_validate_enum(cls, value): 192 """Validates the enum""" 193 if value is None: 194 return value 195 196 if value not in set(["allowed", "allowed_with_editing", "not_allowed"]): 197 raise ValueError("must be one of enum values ('allowed', 'allowed_with_editing', 'not_allowed')") 198 return value 199 200 model_config = { 201 "populate_by_name": True, 202 "validate_assignment": True, 203 "protected_namespaces": (), 204 } 205 206 def to_str(self) -> str: 207 """Returns the string representation of the model using alias""" 208 return pprint.pformat(self.model_dump(by_alias=True)) 209 210 def to_json(self) -> str: 211 """Returns the JSON representation of the model using alias""" 212 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 213 return json.dumps(self.to_dict()) 214 215 @classmethod 216 def from_json(cls, json_str: str) -> Optional[Self]: 217 """Create an instance of TeamSharingPolicySettingsChanges from a JSON string""" 218 return cls.from_dict(json.loads(json_str)) 219 220 def to_dict(self) -> Dict[str, Any]: 221 """Return the dictionary representation of the model using alias. 222 223 This has the following differences from calling pydantic's 224 `self.model_dump(by_alias=True)`: 225 226 * `None` is only added to the output dict for nullable fields that 227 were set at model initialization. Other fields with value `None` 228 are ignored. 229 * Fields in `self.additional_properties` are added to the output dict. 230 """ 231 excluded_fields: Set[str] = set( 232 [ 233 "additional_properties", 234 ] 235 ) 236 237 _dict = self.model_dump( 238 by_alias=True, 239 exclude=excluded_fields, 240 exclude_none=True, 241 ) 242 # puts key-value pairs in additional_properties in the top level 243 if self.additional_properties is not None: 244 for _key, _value in self.additional_properties.items(): 245 _dict[_key] = _value 246 247 return _dict 248 249 @classmethod 250 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 251 """Create an instance of TeamSharingPolicySettingsChanges from a dict""" 252 if obj is None: 253 return None 254 255 if not isinstance(obj, dict): 256 return cls.model_validate(obj) 257 258 _obj = cls.model_validate( 259 { 260 "allowListedDomains": obj.get("allowListedDomains"), 261 "createAssetAccessLevel": obj.get("createAssetAccessLevel"), 262 "defaultBoardAccess": obj.get("defaultBoardAccess"), 263 "defaultBoardSharingAccess": ( 264 obj.get("defaultBoardSharingAccess") 265 if obj.get("defaultBoardSharingAccess") is not None 266 else "team_members_with_editing_rights" 267 ), 268 "defaultOrganizationAccess": obj.get("defaultOrganizationAccess"), 269 "defaultProjectAccess": obj.get("defaultProjectAccess"), 270 "moveBoardToAccount": obj.get("moveBoardToAccount"), 271 "restrictAllowedDomains": obj.get("restrictAllowedDomains"), 272 "sharingOnAccount": obj.get("sharingOnAccount"), 273 "sharingOnOrganization": obj.get("sharingOnOrganization"), 274 "sharingViaPublicLink": obj.get("sharingViaPublicLink"), 275 } 276 ) 277 # store additional fields in additional_properties 278 for _key in obj.keys(): 279 if _key not in cls.__properties: 280 _obj.additional_properties[_key] = obj.get(_key) 281 282 return _obj
Team sharing policy settings
100 @field_validator("create_asset_access_level") 101 def create_asset_access_level_validate_enum(cls, value): 102 """Validates the enum""" 103 if value is None: 104 return value 105 106 if value not in set(["company_admins", "admins", "all_members"]): 107 raise ValueError("must be one of enum values ('company_admins', 'admins', 'all_members')") 108 return value
Validates the enum
110 @field_validator("default_board_access") 111 def default_board_access_validate_enum(cls, value): 112 """Validates the enum""" 113 if value is None: 114 return value 115 116 if value not in set(["private", "view", "comment", "edit"]): 117 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 118 return value
Validates the enum
120 @field_validator("default_board_sharing_access") 121 def default_board_sharing_access_validate_enum(cls, value): 122 """Validates the enum""" 123 if value is None: 124 return value 125 126 if value not in set(["team_members_with_editing_rights", "owner_and_coowners"]): 127 raise ValueError("must be one of enum values ('team_members_with_editing_rights', 'owner_and_coowners')") 128 return value
Validates the enum
130 @field_validator("default_organization_access") 131 def default_organization_access_validate_enum(cls, value): 132 """Validates the enum""" 133 if value is None: 134 return value 135 136 if value not in set(["private", "view", "comment", "edit"]): 137 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 138 return value
Validates the enum
140 @field_validator("default_project_access") 141 def default_project_access_validate_enum(cls, value): 142 """Validates the enum""" 143 if value is None: 144 return value 145 146 if value not in set(["private", "view"]): 147 raise ValueError("must be one of enum values ('private', 'view')") 148 return value
Validates the enum
150 @field_validator("move_board_to_account") 151 def move_board_to_account_validate_enum(cls, value): 152 """Validates the enum""" 153 if value is None: 154 return value 155 156 if value not in set(["allowed", "not_allowed"]): 157 raise ValueError("must be one of enum values ('allowed', 'not_allowed')") 158 return value
Validates the enum
160 @field_validator("restrict_allowed_domains") 161 def restrict_allowed_domains_validate_enum(cls, value): 162 """Validates the enum""" 163 if value is None: 164 return value 165 166 if value not in set(["enabled", "enabled_with_external_user_access", "disabled"]): 167 raise ValueError("must be one of enum values ('enabled', 'enabled_with_external_user_access', 'disabled')") 168 return value
Validates the enum
170 @field_validator("sharing_on_account") 171 def sharing_on_account_validate_enum(cls, value): 172 """Validates the enum""" 173 if value is None: 174 return value 175 176 if value not in set(["allowed", "not_allowed"]): 177 raise ValueError("must be one of enum values ('allowed', 'not_allowed')") 178 return value
Validates the enum
180 @field_validator("sharing_on_organization") 181 def sharing_on_organization_validate_enum(cls, value): 182 """Validates the enum""" 183 if value is None: 184 return value 185 186 if value not in set(["allowed", "allowed_with_editing", "not_allowed"]): 187 raise ValueError("must be one of enum values ('allowed', 'allowed_with_editing', 'not_allowed')") 188 return value
Validates the enum
190 @field_validator("sharing_via_public_link") 191 def sharing_via_public_link_validate_enum(cls, value): 192 """Validates the enum""" 193 if value is None: 194 return value 195 196 if value not in set(["allowed", "allowed_with_editing", "not_allowed"]): 197 raise ValueError("must be one of enum values ('allowed', 'allowed_with_editing', 'not_allowed')") 198 return value
Validates the enum
206 def to_str(self) -> str: 207 """Returns the string representation of the model using alias""" 208 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
210 def to_json(self) -> str: 211 """Returns the JSON representation of the model using alias""" 212 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 213 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
215 @classmethod 216 def from_json(cls, json_str: str) -> Optional[Self]: 217 """Create an instance of TeamSharingPolicySettingsChanges from a JSON string""" 218 return cls.from_dict(json.loads(json_str))
Create an instance of TeamSharingPolicySettingsChanges from a JSON string
220 def to_dict(self) -> Dict[str, Any]: 221 """Return the dictionary representation of the model using alias. 222 223 This has the following differences from calling pydantic's 224 `self.model_dump(by_alias=True)`: 225 226 * `None` is only added to the output dict for nullable fields that 227 were set at model initialization. Other fields with value `None` 228 are ignored. 229 * Fields in `self.additional_properties` are added to the output dict. 230 """ 231 excluded_fields: Set[str] = set( 232 [ 233 "additional_properties", 234 ] 235 ) 236 237 _dict = self.model_dump( 238 by_alias=True, 239 exclude=excluded_fields, 240 exclude_none=True, 241 ) 242 # puts key-value pairs in additional_properties in the top level 243 if self.additional_properties is not None: 244 for _key, _value in self.additional_properties.items(): 245 _dict[_key] = _value 246 247 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.
249 @classmethod 250 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 251 """Create an instance of TeamSharingPolicySettingsChanges from a dict""" 252 if obj is None: 253 return None 254 255 if not isinstance(obj, dict): 256 return cls.model_validate(obj) 257 258 _obj = cls.model_validate( 259 { 260 "allowListedDomains": obj.get("allowListedDomains"), 261 "createAssetAccessLevel": obj.get("createAssetAccessLevel"), 262 "defaultBoardAccess": obj.get("defaultBoardAccess"), 263 "defaultBoardSharingAccess": ( 264 obj.get("defaultBoardSharingAccess") 265 if obj.get("defaultBoardSharingAccess") is not None 266 else "team_members_with_editing_rights" 267 ), 268 "defaultOrganizationAccess": obj.get("defaultOrganizationAccess"), 269 "defaultProjectAccess": obj.get("defaultProjectAccess"), 270 "moveBoardToAccount": obj.get("moveBoardToAccount"), 271 "restrictAllowedDomains": obj.get("restrictAllowedDomains"), 272 "sharingOnAccount": obj.get("sharingOnAccount"), 273 "sharingOnOrganization": obj.get("sharingOnOrganization"), 274 "sharingViaPublicLink": obj.get("sharingViaPublicLink"), 275 } 276 ) 277 # store additional fields in additional_properties 278 for _key in obj.keys(): 279 if _key not in cls.__properties: 280 _obj.additional_properties[_key] = obj.get(_key) 281 282 return _obj
Create an instance of TeamSharingPolicySettingsChanges 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