miro_api.models.board_sharing_policy_change
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 BoardSharingPolicyChange(BaseModel): 26 """ 27 Defines the public-level, organization-level, and team-level access for the board. The access level that a user gets depends on the highest level of access that results from considering the public-level, team-level, organization-level, and direct sharing access. 28 """ # noqa: E501 29 30 access: Optional[StrictStr] = Field(default="private", description="Defines the public-level access to the board.") 31 invite_to_account_and_board_link_access: Optional[StrictStr] = Field( 32 default="no_access", 33 description="Defines the user role when inviting a user via the invite to team and board link. For Enterprise users, the `inviteToAccountAndBoardLinkAccess` parameter is always set to `no_access` regardless of the value that you assign for this parameter.", 34 alias="inviteToAccountAndBoardLinkAccess", 35 ) 36 organization_access: Optional[StrictStr] = Field( 37 default="private", 38 description="Defines the organization-level access to the board. If the board is created for a team that does not belong to an organization, the `organizationAccess` parameter is always set to the default value.", 39 alias="organizationAccess", 40 ) 41 team_access: Optional[StrictStr] = Field( 42 default=None, 43 description="Defines the team-level access to the board. By default, **edit** for the free plan and **private** for other plans.", 44 alias="teamAccess", 45 ) 46 additional_properties: Dict[str, Any] = {} 47 __properties: ClassVar[List[str]] = [ 48 "access", 49 "inviteToAccountAndBoardLinkAccess", 50 "organizationAccess", 51 "teamAccess", 52 ] 53 54 @field_validator("access") 55 def access_validate_enum(cls, value): 56 """Validates the enum""" 57 if value is None: 58 return value 59 60 if value not in set(["private", "view", "edit", "comment"]): 61 raise ValueError("must be one of enum values ('private', 'view', 'edit', 'comment')") 62 return value 63 64 @field_validator("invite_to_account_and_board_link_access") 65 def invite_to_account_and_board_link_access_validate_enum(cls, value): 66 """Validates the enum""" 67 if value is None: 68 return value 69 70 if value not in set(["viewer", "commenter", "editor", "no_access"]): 71 raise ValueError("must be one of enum values ('viewer', 'commenter', 'editor', 'no_access')") 72 return value 73 74 @field_validator("organization_access") 75 def organization_access_validate_enum(cls, value): 76 """Validates the enum""" 77 if value is None: 78 return value 79 80 if value not in set(["private", "view", "comment", "edit"]): 81 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 82 return value 83 84 @field_validator("team_access") 85 def team_access_validate_enum(cls, value): 86 """Validates the enum""" 87 if value is None: 88 return value 89 90 if value not in set(["private", "view", "comment", "edit"]): 91 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 92 return value 93 94 model_config = { 95 "populate_by_name": True, 96 "validate_assignment": True, 97 "protected_namespaces": (), 98 } 99 100 def to_str(self) -> str: 101 """Returns the string representation of the model using alias""" 102 return pprint.pformat(self.model_dump(by_alias=True)) 103 104 def to_json(self) -> str: 105 """Returns the JSON representation of the model using alias""" 106 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 107 return json.dumps(self.to_dict()) 108 109 @classmethod 110 def from_json(cls, json_str: str) -> Optional[Self]: 111 """Create an instance of BoardSharingPolicyChange from a JSON string""" 112 return cls.from_dict(json.loads(json_str)) 113 114 def to_dict(self) -> Dict[str, Any]: 115 """Return the dictionary representation of the model using alias. 116 117 This has the following differences from calling pydantic's 118 `self.model_dump(by_alias=True)`: 119 120 * `None` is only added to the output dict for nullable fields that 121 were set at model initialization. Other fields with value `None` 122 are ignored. 123 * Fields in `self.additional_properties` are added to the output dict. 124 """ 125 excluded_fields: Set[str] = set( 126 [ 127 "additional_properties", 128 ] 129 ) 130 131 _dict = self.model_dump( 132 by_alias=True, 133 exclude=excluded_fields, 134 exclude_none=True, 135 ) 136 # puts key-value pairs in additional_properties in the top level 137 if self.additional_properties is not None: 138 for _key, _value in self.additional_properties.items(): 139 _dict[_key] = _value 140 141 return _dict 142 143 @classmethod 144 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 145 """Create an instance of BoardSharingPolicyChange from a dict""" 146 if obj is None: 147 return None 148 149 if not isinstance(obj, dict): 150 return cls.model_validate(obj) 151 152 _obj = cls.model_validate( 153 { 154 "access": obj.get("access") if obj.get("access") is not None else "private", 155 "inviteToAccountAndBoardLinkAccess": ( 156 obj.get("inviteToAccountAndBoardLinkAccess") 157 if obj.get("inviteToAccountAndBoardLinkAccess") is not None 158 else "no_access" 159 ), 160 "organizationAccess": ( 161 obj.get("organizationAccess") if obj.get("organizationAccess") is not None else "private" 162 ), 163 "teamAccess": obj.get("teamAccess"), 164 } 165 ) 166 # store additional fields in additional_properties 167 for _key in obj.keys(): 168 if _key not in cls.__properties: 169 _obj.additional_properties[_key] = obj.get(_key) 170 171 return _obj
26class BoardSharingPolicyChange(BaseModel): 27 """ 28 Defines the public-level, organization-level, and team-level access for the board. The access level that a user gets depends on the highest level of access that results from considering the public-level, team-level, organization-level, and direct sharing access. 29 """ # noqa: E501 30 31 access: Optional[StrictStr] = Field(default="private", description="Defines the public-level access to the board.") 32 invite_to_account_and_board_link_access: Optional[StrictStr] = Field( 33 default="no_access", 34 description="Defines the user role when inviting a user via the invite to team and board link. For Enterprise users, the `inviteToAccountAndBoardLinkAccess` parameter is always set to `no_access` regardless of the value that you assign for this parameter.", 35 alias="inviteToAccountAndBoardLinkAccess", 36 ) 37 organization_access: Optional[StrictStr] = Field( 38 default="private", 39 description="Defines the organization-level access to the board. If the board is created for a team that does not belong to an organization, the `organizationAccess` parameter is always set to the default value.", 40 alias="organizationAccess", 41 ) 42 team_access: Optional[StrictStr] = Field( 43 default=None, 44 description="Defines the team-level access to the board. By default, **edit** for the free plan and **private** for other plans.", 45 alias="teamAccess", 46 ) 47 additional_properties: Dict[str, Any] = {} 48 __properties: ClassVar[List[str]] = [ 49 "access", 50 "inviteToAccountAndBoardLinkAccess", 51 "organizationAccess", 52 "teamAccess", 53 ] 54 55 @field_validator("access") 56 def access_validate_enum(cls, value): 57 """Validates the enum""" 58 if value is None: 59 return value 60 61 if value not in set(["private", "view", "edit", "comment"]): 62 raise ValueError("must be one of enum values ('private', 'view', 'edit', 'comment')") 63 return value 64 65 @field_validator("invite_to_account_and_board_link_access") 66 def invite_to_account_and_board_link_access_validate_enum(cls, value): 67 """Validates the enum""" 68 if value is None: 69 return value 70 71 if value not in set(["viewer", "commenter", "editor", "no_access"]): 72 raise ValueError("must be one of enum values ('viewer', 'commenter', 'editor', 'no_access')") 73 return value 74 75 @field_validator("organization_access") 76 def organization_access_validate_enum(cls, value): 77 """Validates the enum""" 78 if value is None: 79 return value 80 81 if value not in set(["private", "view", "comment", "edit"]): 82 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 83 return value 84 85 @field_validator("team_access") 86 def team_access_validate_enum(cls, value): 87 """Validates the enum""" 88 if value is None: 89 return value 90 91 if value not in set(["private", "view", "comment", "edit"]): 92 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 93 return value 94 95 model_config = { 96 "populate_by_name": True, 97 "validate_assignment": True, 98 "protected_namespaces": (), 99 } 100 101 def to_str(self) -> str: 102 """Returns the string representation of the model using alias""" 103 return pprint.pformat(self.model_dump(by_alias=True)) 104 105 def to_json(self) -> str: 106 """Returns the JSON representation of the model using alias""" 107 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 108 return json.dumps(self.to_dict()) 109 110 @classmethod 111 def from_json(cls, json_str: str) -> Optional[Self]: 112 """Create an instance of BoardSharingPolicyChange from a JSON string""" 113 return cls.from_dict(json.loads(json_str)) 114 115 def to_dict(self) -> Dict[str, Any]: 116 """Return the dictionary representation of the model using alias. 117 118 This has the following differences from calling pydantic's 119 `self.model_dump(by_alias=True)`: 120 121 * `None` is only added to the output dict for nullable fields that 122 were set at model initialization. Other fields with value `None` 123 are ignored. 124 * Fields in `self.additional_properties` are added to the output dict. 125 """ 126 excluded_fields: Set[str] = set( 127 [ 128 "additional_properties", 129 ] 130 ) 131 132 _dict = self.model_dump( 133 by_alias=True, 134 exclude=excluded_fields, 135 exclude_none=True, 136 ) 137 # puts key-value pairs in additional_properties in the top level 138 if self.additional_properties is not None: 139 for _key, _value in self.additional_properties.items(): 140 _dict[_key] = _value 141 142 return _dict 143 144 @classmethod 145 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 146 """Create an instance of BoardSharingPolicyChange from a dict""" 147 if obj is None: 148 return None 149 150 if not isinstance(obj, dict): 151 return cls.model_validate(obj) 152 153 _obj = cls.model_validate( 154 { 155 "access": obj.get("access") if obj.get("access") is not None else "private", 156 "inviteToAccountAndBoardLinkAccess": ( 157 obj.get("inviteToAccountAndBoardLinkAccess") 158 if obj.get("inviteToAccountAndBoardLinkAccess") is not None 159 else "no_access" 160 ), 161 "organizationAccess": ( 162 obj.get("organizationAccess") if obj.get("organizationAccess") is not None else "private" 163 ), 164 "teamAccess": obj.get("teamAccess"), 165 } 166 ) 167 # store additional fields in additional_properties 168 for _key in obj.keys(): 169 if _key not in cls.__properties: 170 _obj.additional_properties[_key] = obj.get(_key) 171 172 return _obj
Defines the public-level, organization-level, and team-level access for the board. The access level that a user gets depends on the highest level of access that results from considering the public-level, team-level, organization-level, and direct sharing access.
55 @field_validator("access") 56 def access_validate_enum(cls, value): 57 """Validates the enum""" 58 if value is None: 59 return value 60 61 if value not in set(["private", "view", "edit", "comment"]): 62 raise ValueError("must be one of enum values ('private', 'view', 'edit', 'comment')") 63 return value
Validates the enum
65 @field_validator("invite_to_account_and_board_link_access") 66 def invite_to_account_and_board_link_access_validate_enum(cls, value): 67 """Validates the enum""" 68 if value is None: 69 return value 70 71 if value not in set(["viewer", "commenter", "editor", "no_access"]): 72 raise ValueError("must be one of enum values ('viewer', 'commenter', 'editor', 'no_access')") 73 return value
Validates the enum
75 @field_validator("organization_access") 76 def organization_access_validate_enum(cls, value): 77 """Validates the enum""" 78 if value is None: 79 return value 80 81 if value not in set(["private", "view", "comment", "edit"]): 82 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 83 return value
Validates the enum
85 @field_validator("team_access") 86 def team_access_validate_enum(cls, value): 87 """Validates the enum""" 88 if value is None: 89 return value 90 91 if value not in set(["private", "view", "comment", "edit"]): 92 raise ValueError("must be one of enum values ('private', 'view', 'comment', 'edit')") 93 return value
Validates the enum
101 def to_str(self) -> str: 102 """Returns the string representation of the model using alias""" 103 return pprint.pformat(self.model_dump(by_alias=True))
Returns the string representation of the model using alias
105 def to_json(self) -> str: 106 """Returns the JSON representation of the model using alias""" 107 # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead 108 return json.dumps(self.to_dict())
Returns the JSON representation of the model using alias
110 @classmethod 111 def from_json(cls, json_str: str) -> Optional[Self]: 112 """Create an instance of BoardSharingPolicyChange from a JSON string""" 113 return cls.from_dict(json.loads(json_str))
Create an instance of BoardSharingPolicyChange from a JSON string
115 def to_dict(self) -> Dict[str, Any]: 116 """Return the dictionary representation of the model using alias. 117 118 This has the following differences from calling pydantic's 119 `self.model_dump(by_alias=True)`: 120 121 * `None` is only added to the output dict for nullable fields that 122 were set at model initialization. Other fields with value `None` 123 are ignored. 124 * Fields in `self.additional_properties` are added to the output dict. 125 """ 126 excluded_fields: Set[str] = set( 127 [ 128 "additional_properties", 129 ] 130 ) 131 132 _dict = self.model_dump( 133 by_alias=True, 134 exclude=excluded_fields, 135 exclude_none=True, 136 ) 137 # puts key-value pairs in additional_properties in the top level 138 if self.additional_properties is not None: 139 for _key, _value in self.additional_properties.items(): 140 _dict[_key] = _value 141 142 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.
144 @classmethod 145 def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: 146 """Create an instance of BoardSharingPolicyChange from a dict""" 147 if obj is None: 148 return None 149 150 if not isinstance(obj, dict): 151 return cls.model_validate(obj) 152 153 _obj = cls.model_validate( 154 { 155 "access": obj.get("access") if obj.get("access") is not None else "private", 156 "inviteToAccountAndBoardLinkAccess": ( 157 obj.get("inviteToAccountAndBoardLinkAccess") 158 if obj.get("inviteToAccountAndBoardLinkAccess") is not None 159 else "no_access" 160 ), 161 "organizationAccess": ( 162 obj.get("organizationAccess") if obj.get("organizationAccess") is not None else "private" 163 ), 164 "teamAccess": obj.get("teamAccess"), 165 } 166 ) 167 # store additional fields in additional_properties 168 for _key in obj.keys(): 169 if _key not in cls.__properties: 170 _obj.additional_properties[_key] = obj.get(_key) 171 172 return _obj
Create an instance of BoardSharingPolicyChange 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