miro_api.models.team_sharing_policy_settings

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

Team sharing policy settings

allow_listed_domains: Optional[List[Annotated[str, Strict(strict=True)]]]
create_asset_access_level: Optional[Annotated[str, Strict(strict=True)]]
default_board_access: Optional[Annotated[str, Strict(strict=True)]]
default_board_sharing_access: Optional[Annotated[str, Strict(strict=True)]]
default_organization_access: Optional[Annotated[str, Strict(strict=True)]]
default_project_access: Optional[Annotated[str, Strict(strict=True)]]
move_board_to_account: Optional[Annotated[str, Strict(strict=True)]]
restrict_allowed_domains: Optional[Annotated[str, Strict(strict=True)]]
sharing_on_account: Optional[Annotated[str, Strict(strict=True)]]
sharing_on_organization: Optional[Annotated[str, Strict(strict=True)]]
additional_properties: Dict[str, Any]
@field_validator('create_asset_access_level')
def create_asset_access_level_validate_enum(cls, value):
 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

Validates the enum

@field_validator('default_board_access')
def default_board_access_validate_enum(cls, value):
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

Validates the enum

@field_validator('default_board_sharing_access')
def default_board_sharing_access_validate_enum(cls, value):
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

Validates the enum

@field_validator('default_organization_access')
def default_organization_access_validate_enum(cls, value):
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

Validates the enum

@field_validator('default_project_access')
def default_project_access_validate_enum(cls, value):
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

Validates the enum

@field_validator('move_board_to_account')
def move_board_to_account_validate_enum(cls, value):
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

Validates the enum

@field_validator('restrict_allowed_domains')
def restrict_allowed_domains_validate_enum(cls, value):
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

Validates the enum

@field_validator('sharing_on_account')
def sharing_on_account_validate_enum(cls, value):
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

Validates the enum

@field_validator('sharing_on_organization')
def sharing_on_organization_validate_enum(cls, value):
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

Validates the enum

model_config = {'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}
def to_str(self) -> str:
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))

Returns the string representation of the model using alias

def to_json(self) -> str:
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())

Returns the JSON representation of the model using alias

@classmethod
def from_json(cls, json_str: str) -> Optional[typing_extensions.Self]:
214    @classmethod
215    def from_json(cls, json_str: str) -> Optional[Self]:
216        """Create an instance of TeamSharingPolicySettings from a JSON string"""
217        return cls.from_dict(json.loads(json_str))

Create an instance of TeamSharingPolicySettings from a JSON string

def to_dict(self) -> Dict[str, Any]:
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

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 value None are ignored.
  • Fields in self.additional_properties are added to the output dict.
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[typing_extensions.Self]:
248    @classmethod
249    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
250        """Create an instance of TeamSharingPolicySettings 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": obj.get("defaultBoardSharingAccess"),
263                "defaultOrganizationAccess": obj.get("defaultOrganizationAccess"),
264                "defaultProjectAccess": obj.get("defaultProjectAccess"),
265                "moveBoardToAccount": obj.get("moveBoardToAccount"),
266                "restrictAllowedDomains": obj.get("restrictAllowedDomains"),
267                "sharingOnAccount": obj.get("sharingOnAccount"),
268                "sharingOnOrganization": obj.get("sharingOnOrganization"),
269                "sharingViaPublicLink": obj.get("sharingViaPublicLink"),
270            }
271        )
272        # store additional fields in additional_properties
273        for _key in obj.keys():
274            if _key not in cls.__properties:
275                _obj.additional_properties[_key] = obj.get(_key)
276
277        return _obj

Create an instance of TeamSharingPolicySettings from a dict

def model_post_init(self: pydantic.main.BaseModel, __context: Any) -> None:
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.

model_fields = {'allow_listed_domains': FieldInfo(annotation=Union[List[Annotated[str, Strict(strict=True)]], NoneType], required=False, alias='allowListedDomains', alias_priority=2, description='Allow listed domains'), 'create_asset_access_level': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='createAssetAccessLevel', alias_priority=2, 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 '), 'default_board_access': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='defaultBoardAccess', alias_priority=2, 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 '), 'default_board_sharing_access': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='defaultBoardSharingAccess', alias_priority=2, 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. '), 'default_organization_access': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='defaultOrganizationAccess', alias_priority=2, 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 '), 'default_project_access': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='defaultProjectAccess', alias_priority=2, description=' Default project access * "private": Only board owners can access * "view": Anyone in the team can view '), 'move_board_to_account': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='moveBoardToAccount', alias_priority=2, description=' * "allowed": Allow move board to team * "not_allowed": Not allow move board to team '), 'restrict_allowed_domains': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='restrictAllowedDomains', alias_priority=2, description=' * "enabled": Enabled. Restrict to listed domain. * "disabled": Disabled. No domain restriction. * "enabled_with_external_user_access": Enabled. Restrict to listed domain but allows external users to access. '), 'sharing_on_account': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='sharingOnAccount', alias_priority=2, description=' * "allowed": Allow sharing on team * "not_allowed": Not allow sharing on team '), 'sharing_on_organization': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='sharingOnOrganization', alias_priority=2, description=' * "allowed": Allow sharing on organization * "allowed_with_editing": Allow sharing with editing on organization * "not_allowed": Not allow sharing on organization '), 'sharing_via_public_link': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='sharingViaPublicLink', alias_priority=2, 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 '), 'additional_properties': FieldInfo(annotation=Dict[str, Any], required=False, default={})}
model_computed_fields = {}
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