miro_api.models.board_permissions_policy

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 BoardPermissionsPolicy(BaseModel):
 27    """
 28    Defines the permissions policies for the board.
 29    """  # noqa: E501
 30
 31    collaboration_tools_start_access: Optional[StrictStr] = Field(
 32        default="all_editors",
 33        description="Defines who can start or stop timer, voting, video chat, screen sharing, attention management. Others will only be able to join. To change the value for the `collaborationToolsStartAccess` parameter, contact Miro Customer Support.",
 34        alias="collaborationToolsStartAccess",
 35    )
 36    copy_access: Optional[StrictStr] = Field(
 37        default="anyone",
 38        description="Defines who can copy the board, copy objects, download images, and save the board as a template or PDF.",
 39        alias="copyAccess",
 40    )
 41    sharing_access: Optional[StrictStr] = Field(
 42        default="team_members_with_editing_rights",
 43        description="Defines who can change access and invite users to this board. To change the value for the `sharingAccess` parameter, contact Miro Customer Support.",
 44        alias="sharingAccess",
 45    )
 46    additional_properties: Dict[str, Any] = {}
 47    __properties: ClassVar[List[str]] = ["collaborationToolsStartAccess", "copyAccess", "sharingAccess"]
 48
 49    @field_validator("collaboration_tools_start_access")
 50    def collaboration_tools_start_access_validate_enum(cls, value):
 51        """Validates the enum"""
 52        if value is None:
 53            return value
 54
 55        if value not in set(["all_editors", "board_owners_and_coowners"]):
 56            raise ValueError("must be one of enum values ('all_editors', 'board_owners_and_coowners')")
 57        return value
 58
 59    @field_validator("copy_access")
 60    def copy_access_validate_enum(cls, value):
 61        """Validates the enum"""
 62        if value is None:
 63            return value
 64
 65        if value not in set(["anyone", "team_members", "team_editors", "board_owner"]):
 66            raise ValueError("must be one of enum values ('anyone', 'team_members', 'team_editors', 'board_owner')")
 67        return value
 68
 69    @field_validator("sharing_access")
 70    def sharing_access_validate_enum(cls, value):
 71        """Validates the enum"""
 72        if value is None:
 73            return value
 74
 75        if value not in set(["team_members_with_editing_rights", "owner_and_coowners"]):
 76            raise ValueError("must be one of enum values ('team_members_with_editing_rights', 'owner_and_coowners')")
 77        return value
 78
 79    model_config = {
 80        "populate_by_name": True,
 81        "validate_assignment": True,
 82        "protected_namespaces": (),
 83    }
 84
 85    def to_str(self) -> str:
 86        """Returns the string representation of the model using alias"""
 87        return pprint.pformat(self.model_dump(by_alias=True))
 88
 89    def to_json(self) -> str:
 90        """Returns the JSON representation of the model using alias"""
 91        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 92        return json.dumps(self.to_dict())
 93
 94    @classmethod
 95    def from_json(cls, json_str: str) -> Optional[Self]:
 96        """Create an instance of BoardPermissionsPolicy from a JSON string"""
 97        return cls.from_dict(json.loads(json_str))
 98
 99    def to_dict(self) -> Dict[str, Any]:
100        """Return the dictionary representation of the model using alias.
101
102        This has the following differences from calling pydantic's
103        `self.model_dump(by_alias=True)`:
104
105        * `None` is only added to the output dict for nullable fields that
106          were set at model initialization. Other fields with value `None`
107          are ignored.
108        * Fields in `self.additional_properties` are added to the output dict.
109        """
110        excluded_fields: Set[str] = set(
111            [
112                "additional_properties",
113            ]
114        )
115
116        _dict = self.model_dump(
117            by_alias=True,
118            exclude=excluded_fields,
119            exclude_none=True,
120        )
121        # puts key-value pairs in additional_properties in the top level
122        if self.additional_properties is not None:
123            for _key, _value in self.additional_properties.items():
124                _dict[_key] = _value
125
126        return _dict
127
128    @classmethod
129    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
130        """Create an instance of BoardPermissionsPolicy from a dict"""
131        if obj is None:
132            return None
133
134        if not isinstance(obj, dict):
135            return cls.model_validate(obj)
136
137        _obj = cls.model_validate(
138            {
139                "collaborationToolsStartAccess": (
140                    obj.get("collaborationToolsStartAccess")
141                    if obj.get("collaborationToolsStartAccess") is not None
142                    else "all_editors"
143                ),
144                "copyAccess": obj.get("copyAccess") if obj.get("copyAccess") is not None else "anyone",
145                "sharingAccess": (
146                    obj.get("sharingAccess")
147                    if obj.get("sharingAccess") is not None
148                    else "team_members_with_editing_rights"
149                ),
150            }
151        )
152        # store additional fields in additional_properties
153        for _key in obj.keys():
154            if _key not in cls.__properties:
155                _obj.additional_properties[_key] = obj.get(_key)
156
157        return _obj
class BoardPermissionsPolicy(pydantic.main.BaseModel):
 27class BoardPermissionsPolicy(BaseModel):
 28    """
 29    Defines the permissions policies for the board.
 30    """  # noqa: E501
 31
 32    collaboration_tools_start_access: Optional[StrictStr] = Field(
 33        default="all_editors",
 34        description="Defines who can start or stop timer, voting, video chat, screen sharing, attention management. Others will only be able to join. To change the value for the `collaborationToolsStartAccess` parameter, contact Miro Customer Support.",
 35        alias="collaborationToolsStartAccess",
 36    )
 37    copy_access: Optional[StrictStr] = Field(
 38        default="anyone",
 39        description="Defines who can copy the board, copy objects, download images, and save the board as a template or PDF.",
 40        alias="copyAccess",
 41    )
 42    sharing_access: Optional[StrictStr] = Field(
 43        default="team_members_with_editing_rights",
 44        description="Defines who can change access and invite users to this board. To change the value for the `sharingAccess` parameter, contact Miro Customer Support.",
 45        alias="sharingAccess",
 46    )
 47    additional_properties: Dict[str, Any] = {}
 48    __properties: ClassVar[List[str]] = ["collaborationToolsStartAccess", "copyAccess", "sharingAccess"]
 49
 50    @field_validator("collaboration_tools_start_access")
 51    def collaboration_tools_start_access_validate_enum(cls, value):
 52        """Validates the enum"""
 53        if value is None:
 54            return value
 55
 56        if value not in set(["all_editors", "board_owners_and_coowners"]):
 57            raise ValueError("must be one of enum values ('all_editors', 'board_owners_and_coowners')")
 58        return value
 59
 60    @field_validator("copy_access")
 61    def copy_access_validate_enum(cls, value):
 62        """Validates the enum"""
 63        if value is None:
 64            return value
 65
 66        if value not in set(["anyone", "team_members", "team_editors", "board_owner"]):
 67            raise ValueError("must be one of enum values ('anyone', 'team_members', 'team_editors', 'board_owner')")
 68        return value
 69
 70    @field_validator("sharing_access")
 71    def sharing_access_validate_enum(cls, value):
 72        """Validates the enum"""
 73        if value is None:
 74            return value
 75
 76        if value not in set(["team_members_with_editing_rights", "owner_and_coowners"]):
 77            raise ValueError("must be one of enum values ('team_members_with_editing_rights', 'owner_and_coowners')")
 78        return value
 79
 80    model_config = {
 81        "populate_by_name": True,
 82        "validate_assignment": True,
 83        "protected_namespaces": (),
 84    }
 85
 86    def to_str(self) -> str:
 87        """Returns the string representation of the model using alias"""
 88        return pprint.pformat(self.model_dump(by_alias=True))
 89
 90    def to_json(self) -> str:
 91        """Returns the JSON representation of the model using alias"""
 92        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 93        return json.dumps(self.to_dict())
 94
 95    @classmethod
 96    def from_json(cls, json_str: str) -> Optional[Self]:
 97        """Create an instance of BoardPermissionsPolicy from a JSON string"""
 98        return cls.from_dict(json.loads(json_str))
 99
100    def to_dict(self) -> Dict[str, Any]:
101        """Return the dictionary representation of the model using alias.
102
103        This has the following differences from calling pydantic's
104        `self.model_dump(by_alias=True)`:
105
106        * `None` is only added to the output dict for nullable fields that
107          were set at model initialization. Other fields with value `None`
108          are ignored.
109        * Fields in `self.additional_properties` are added to the output dict.
110        """
111        excluded_fields: Set[str] = set(
112            [
113                "additional_properties",
114            ]
115        )
116
117        _dict = self.model_dump(
118            by_alias=True,
119            exclude=excluded_fields,
120            exclude_none=True,
121        )
122        # puts key-value pairs in additional_properties in the top level
123        if self.additional_properties is not None:
124            for _key, _value in self.additional_properties.items():
125                _dict[_key] = _value
126
127        return _dict
128
129    @classmethod
130    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
131        """Create an instance of BoardPermissionsPolicy from a dict"""
132        if obj is None:
133            return None
134
135        if not isinstance(obj, dict):
136            return cls.model_validate(obj)
137
138        _obj = cls.model_validate(
139            {
140                "collaborationToolsStartAccess": (
141                    obj.get("collaborationToolsStartAccess")
142                    if obj.get("collaborationToolsStartAccess") is not None
143                    else "all_editors"
144                ),
145                "copyAccess": obj.get("copyAccess") if obj.get("copyAccess") is not None else "anyone",
146                "sharingAccess": (
147                    obj.get("sharingAccess")
148                    if obj.get("sharingAccess") is not None
149                    else "team_members_with_editing_rights"
150                ),
151            }
152        )
153        # store additional fields in additional_properties
154        for _key in obj.keys():
155            if _key not in cls.__properties:
156                _obj.additional_properties[_key] = obj.get(_key)
157
158        return _obj

Defines the permissions policies for the board.

collaboration_tools_start_access: Optional[Annotated[str, Strict(strict=True)]]
copy_access: Optional[Annotated[str, Strict(strict=True)]]
sharing_access: Optional[Annotated[str, Strict(strict=True)]]
additional_properties: Dict[str, Any]
@field_validator('collaboration_tools_start_access')
def collaboration_tools_start_access_validate_enum(cls, value):
50    @field_validator("collaboration_tools_start_access")
51    def collaboration_tools_start_access_validate_enum(cls, value):
52        """Validates the enum"""
53        if value is None:
54            return value
55
56        if value not in set(["all_editors", "board_owners_and_coowners"]):
57            raise ValueError("must be one of enum values ('all_editors', 'board_owners_and_coowners')")
58        return value

Validates the enum

@field_validator('copy_access')
def copy_access_validate_enum(cls, value):
60    @field_validator("copy_access")
61    def copy_access_validate_enum(cls, value):
62        """Validates the enum"""
63        if value is None:
64            return value
65
66        if value not in set(["anyone", "team_members", "team_editors", "board_owner"]):
67            raise ValueError("must be one of enum values ('anyone', 'team_members', 'team_editors', 'board_owner')")
68        return value

Validates the enum

@field_validator('sharing_access')
def sharing_access_validate_enum(cls, value):
70    @field_validator("sharing_access")
71    def sharing_access_validate_enum(cls, value):
72        """Validates the enum"""
73        if value is None:
74            return value
75
76        if value not in set(["team_members_with_editing_rights", "owner_and_coowners"]):
77            raise ValueError("must be one of enum values ('team_members_with_editing_rights', 'owner_and_coowners')")
78        return value

Validates the enum

model_config = {'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}
def to_str(self) -> str:
86    def to_str(self) -> str:
87        """Returns the string representation of the model using alias"""
88        return pprint.pformat(self.model_dump(by_alias=True))

Returns the string representation of the model using alias

def to_json(self) -> str:
90    def to_json(self) -> str:
91        """Returns the JSON representation of the model using alias"""
92        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
93        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]:
95    @classmethod
96    def from_json(cls, json_str: str) -> Optional[Self]:
97        """Create an instance of BoardPermissionsPolicy from a JSON string"""
98        return cls.from_dict(json.loads(json_str))

Create an instance of BoardPermissionsPolicy from a JSON string

def to_dict(self) -> Dict[str, Any]:
100    def to_dict(self) -> Dict[str, Any]:
101        """Return the dictionary representation of the model using alias.
102
103        This has the following differences from calling pydantic's
104        `self.model_dump(by_alias=True)`:
105
106        * `None` is only added to the output dict for nullable fields that
107          were set at model initialization. Other fields with value `None`
108          are ignored.
109        * Fields in `self.additional_properties` are added to the output dict.
110        """
111        excluded_fields: Set[str] = set(
112            [
113                "additional_properties",
114            ]
115        )
116
117        _dict = self.model_dump(
118            by_alias=True,
119            exclude=excluded_fields,
120            exclude_none=True,
121        )
122        # puts key-value pairs in additional_properties in the top level
123        if self.additional_properties is not None:
124            for _key, _value in self.additional_properties.items():
125                _dict[_key] = _value
126
127        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]:
129    @classmethod
130    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
131        """Create an instance of BoardPermissionsPolicy from a dict"""
132        if obj is None:
133            return None
134
135        if not isinstance(obj, dict):
136            return cls.model_validate(obj)
137
138        _obj = cls.model_validate(
139            {
140                "collaborationToolsStartAccess": (
141                    obj.get("collaborationToolsStartAccess")
142                    if obj.get("collaborationToolsStartAccess") is not None
143                    else "all_editors"
144                ),
145                "copyAccess": obj.get("copyAccess") if obj.get("copyAccess") is not None else "anyone",
146                "sharingAccess": (
147                    obj.get("sharingAccess")
148                    if obj.get("sharingAccess") is not None
149                    else "team_members_with_editing_rights"
150                ),
151            }
152        )
153        # store additional fields in additional_properties
154        for _key in obj.keys():
155            if _key not in cls.__properties:
156                _obj.additional_properties[_key] = obj.get(_key)
157
158        return _obj

Create an instance of BoardPermissionsPolicy 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 = {'collaboration_tools_start_access': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, default='all_editors', alias='collaborationToolsStartAccess', alias_priority=2, description='Defines who can start or stop timer, voting, video chat, screen sharing, attention management. Others will only be able to join. To change the value for the `collaborationToolsStartAccess` parameter, contact Miro Customer Support.'), 'copy_access': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, default='anyone', alias='copyAccess', alias_priority=2, description='Defines who can copy the board, copy objects, download images, and save the board as a template or PDF.'), 'sharing_access': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, default='team_members_with_editing_rights', alias='sharingAccess', alias_priority=2, description='Defines who can change access and invite users to this board. To change the value for the `sharingAccess` parameter, contact Miro Customer Support.'), '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