miro_api.models.team_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
 20from typing import Any, ClassVar, Dict, List, Optional
 21from miro_api.models.team_account_discovery_settings import TeamAccountDiscoverySettings
 22from miro_api.models.team_collaboration_settings import TeamCollaborationSettings
 23from miro_api.models.team_copy_access_level_settings import TeamCopyAccessLevelSettings
 24from miro_api.models.team_invitation_settings import TeamInvitationSettings
 25from miro_api.models.team_sharing_policy_settings import TeamSharingPolicySettings
 26from typing import Optional, Set
 27from typing_extensions import Self
 28
 29
 30class TeamSettings(BaseModel):
 31    """
 32    TeamSettings
 33    """  # noqa: E501
 34
 35    organization_id: Optional[StrictStr] = Field(default=None, description="Organization id", alias="organizationId")
 36    team_account_discovery_settings: Optional[TeamAccountDiscoverySettings] = Field(
 37        default=None, alias="teamAccountDiscoverySettings"
 38    )
 39    team_collaboration_settings: Optional[TeamCollaborationSettings] = Field(
 40        default=None, alias="teamCollaborationSettings"
 41    )
 42    team_copy_access_level_settings: Optional[TeamCopyAccessLevelSettings] = Field(
 43        default=None, alias="teamCopyAccessLevelSettings"
 44    )
 45    team_id: Optional[StrictStr] = Field(default=None, description="Team id", alias="teamId")
 46    team_invitation_settings: Optional[TeamInvitationSettings] = Field(default=None, alias="teamInvitationSettings")
 47    team_sharing_policy_settings: Optional[TeamSharingPolicySettings] = Field(
 48        default=None, alias="teamSharingPolicySettings"
 49    )
 50    type: Optional[StrictStr] = Field(default="team-settings", description="Type of the object returned.")
 51    additional_properties: Dict[str, Any] = {}
 52    __properties: ClassVar[List[str]] = [
 53        "organizationId",
 54        "teamAccountDiscoverySettings",
 55        "teamCollaborationSettings",
 56        "teamCopyAccessLevelSettings",
 57        "teamId",
 58        "teamInvitationSettings",
 59        "teamSharingPolicySettings",
 60        "type",
 61    ]
 62
 63    model_config = {
 64        "populate_by_name": True,
 65        "validate_assignment": True,
 66        "protected_namespaces": (),
 67    }
 68
 69    def to_str(self) -> str:
 70        """Returns the string representation of the model using alias"""
 71        return pprint.pformat(self.model_dump(by_alias=True))
 72
 73    def to_json(self) -> str:
 74        """Returns the JSON representation of the model using alias"""
 75        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 76        return json.dumps(self.to_dict())
 77
 78    @classmethod
 79    def from_json(cls, json_str: str) -> Optional[Self]:
 80        """Create an instance of TeamSettings from a JSON string"""
 81        return cls.from_dict(json.loads(json_str))
 82
 83    def to_dict(self) -> Dict[str, Any]:
 84        """Return the dictionary representation of the model using alias.
 85
 86        This has the following differences from calling pydantic's
 87        `self.model_dump(by_alias=True)`:
 88
 89        * `None` is only added to the output dict for nullable fields that
 90          were set at model initialization. Other fields with value `None`
 91          are ignored.
 92        * Fields in `self.additional_properties` are added to the output dict.
 93        """
 94        excluded_fields: Set[str] = set(
 95            [
 96                "additional_properties",
 97            ]
 98        )
 99
100        _dict = self.model_dump(
101            by_alias=True,
102            exclude=excluded_fields,
103            exclude_none=True,
104        )
105        # override the default output from pydantic by calling `to_dict()` of team_account_discovery_settings
106        if self.team_account_discovery_settings:
107            _dict["teamAccountDiscoverySettings"] = self.team_account_discovery_settings.to_dict()
108        # override the default output from pydantic by calling `to_dict()` of team_collaboration_settings
109        if self.team_collaboration_settings:
110            _dict["teamCollaborationSettings"] = self.team_collaboration_settings.to_dict()
111        # override the default output from pydantic by calling `to_dict()` of team_copy_access_level_settings
112        if self.team_copy_access_level_settings:
113            _dict["teamCopyAccessLevelSettings"] = self.team_copy_access_level_settings.to_dict()
114        # override the default output from pydantic by calling `to_dict()` of team_invitation_settings
115        if self.team_invitation_settings:
116            _dict["teamInvitationSettings"] = self.team_invitation_settings.to_dict()
117        # override the default output from pydantic by calling `to_dict()` of team_sharing_policy_settings
118        if self.team_sharing_policy_settings:
119            _dict["teamSharingPolicySettings"] = self.team_sharing_policy_settings.to_dict()
120        # puts key-value pairs in additional_properties in the top level
121        if self.additional_properties is not None:
122            for _key, _value in self.additional_properties.items():
123                _dict[_key] = _value
124
125        return _dict
126
127    @classmethod
128    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
129        """Create an instance of TeamSettings from a dict"""
130        if obj is None:
131            return None
132
133        if not isinstance(obj, dict):
134            return cls.model_validate(obj)
135
136        _obj = cls.model_validate(
137            {
138                "organizationId": obj.get("organizationId"),
139                "teamAccountDiscoverySettings": (
140                    TeamAccountDiscoverySettings.from_dict(obj["teamAccountDiscoverySettings"])
141                    if obj.get("teamAccountDiscoverySettings") is not None
142                    else None
143                ),
144                "teamCollaborationSettings": (
145                    TeamCollaborationSettings.from_dict(obj["teamCollaborationSettings"])
146                    if obj.get("teamCollaborationSettings") is not None
147                    else None
148                ),
149                "teamCopyAccessLevelSettings": (
150                    TeamCopyAccessLevelSettings.from_dict(obj["teamCopyAccessLevelSettings"])
151                    if obj.get("teamCopyAccessLevelSettings") is not None
152                    else None
153                ),
154                "teamId": obj.get("teamId"),
155                "teamInvitationSettings": (
156                    TeamInvitationSettings.from_dict(obj["teamInvitationSettings"])
157                    if obj.get("teamInvitationSettings") is not None
158                    else None
159                ),
160                "teamSharingPolicySettings": (
161                    TeamSharingPolicySettings.from_dict(obj["teamSharingPolicySettings"])
162                    if obj.get("teamSharingPolicySettings") is not None
163                    else None
164                ),
165                "type": obj.get("type") if obj.get("type") is not None else "team-settings",
166            }
167        )
168        # store additional fields in additional_properties
169        for _key in obj.keys():
170            if _key not in cls.__properties:
171                _obj.additional_properties[_key] = obj.get(_key)
172
173        return _obj
class TeamSettings(pydantic.main.BaseModel):
 31class TeamSettings(BaseModel):
 32    """
 33    TeamSettings
 34    """  # noqa: E501
 35
 36    organization_id: Optional[StrictStr] = Field(default=None, description="Organization id", alias="organizationId")
 37    team_account_discovery_settings: Optional[TeamAccountDiscoverySettings] = Field(
 38        default=None, alias="teamAccountDiscoverySettings"
 39    )
 40    team_collaboration_settings: Optional[TeamCollaborationSettings] = Field(
 41        default=None, alias="teamCollaborationSettings"
 42    )
 43    team_copy_access_level_settings: Optional[TeamCopyAccessLevelSettings] = Field(
 44        default=None, alias="teamCopyAccessLevelSettings"
 45    )
 46    team_id: Optional[StrictStr] = Field(default=None, description="Team id", alias="teamId")
 47    team_invitation_settings: Optional[TeamInvitationSettings] = Field(default=None, alias="teamInvitationSettings")
 48    team_sharing_policy_settings: Optional[TeamSharingPolicySettings] = Field(
 49        default=None, alias="teamSharingPolicySettings"
 50    )
 51    type: Optional[StrictStr] = Field(default="team-settings", description="Type of the object returned.")
 52    additional_properties: Dict[str, Any] = {}
 53    __properties: ClassVar[List[str]] = [
 54        "organizationId",
 55        "teamAccountDiscoverySettings",
 56        "teamCollaborationSettings",
 57        "teamCopyAccessLevelSettings",
 58        "teamId",
 59        "teamInvitationSettings",
 60        "teamSharingPolicySettings",
 61        "type",
 62    ]
 63
 64    model_config = {
 65        "populate_by_name": True,
 66        "validate_assignment": True,
 67        "protected_namespaces": (),
 68    }
 69
 70    def to_str(self) -> str:
 71        """Returns the string representation of the model using alias"""
 72        return pprint.pformat(self.model_dump(by_alias=True))
 73
 74    def to_json(self) -> str:
 75        """Returns the JSON representation of the model using alias"""
 76        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 77        return json.dumps(self.to_dict())
 78
 79    @classmethod
 80    def from_json(cls, json_str: str) -> Optional[Self]:
 81        """Create an instance of TeamSettings from a JSON string"""
 82        return cls.from_dict(json.loads(json_str))
 83
 84    def to_dict(self) -> Dict[str, Any]:
 85        """Return the dictionary representation of the model using alias.
 86
 87        This has the following differences from calling pydantic's
 88        `self.model_dump(by_alias=True)`:
 89
 90        * `None` is only added to the output dict for nullable fields that
 91          were set at model initialization. Other fields with value `None`
 92          are ignored.
 93        * Fields in `self.additional_properties` are added to the output dict.
 94        """
 95        excluded_fields: Set[str] = set(
 96            [
 97                "additional_properties",
 98            ]
 99        )
100
101        _dict = self.model_dump(
102            by_alias=True,
103            exclude=excluded_fields,
104            exclude_none=True,
105        )
106        # override the default output from pydantic by calling `to_dict()` of team_account_discovery_settings
107        if self.team_account_discovery_settings:
108            _dict["teamAccountDiscoverySettings"] = self.team_account_discovery_settings.to_dict()
109        # override the default output from pydantic by calling `to_dict()` of team_collaboration_settings
110        if self.team_collaboration_settings:
111            _dict["teamCollaborationSettings"] = self.team_collaboration_settings.to_dict()
112        # override the default output from pydantic by calling `to_dict()` of team_copy_access_level_settings
113        if self.team_copy_access_level_settings:
114            _dict["teamCopyAccessLevelSettings"] = self.team_copy_access_level_settings.to_dict()
115        # override the default output from pydantic by calling `to_dict()` of team_invitation_settings
116        if self.team_invitation_settings:
117            _dict["teamInvitationSettings"] = self.team_invitation_settings.to_dict()
118        # override the default output from pydantic by calling `to_dict()` of team_sharing_policy_settings
119        if self.team_sharing_policy_settings:
120            _dict["teamSharingPolicySettings"] = self.team_sharing_policy_settings.to_dict()
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 TeamSettings 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                "organizationId": obj.get("organizationId"),
140                "teamAccountDiscoverySettings": (
141                    TeamAccountDiscoverySettings.from_dict(obj["teamAccountDiscoverySettings"])
142                    if obj.get("teamAccountDiscoverySettings") is not None
143                    else None
144                ),
145                "teamCollaborationSettings": (
146                    TeamCollaborationSettings.from_dict(obj["teamCollaborationSettings"])
147                    if obj.get("teamCollaborationSettings") is not None
148                    else None
149                ),
150                "teamCopyAccessLevelSettings": (
151                    TeamCopyAccessLevelSettings.from_dict(obj["teamCopyAccessLevelSettings"])
152                    if obj.get("teamCopyAccessLevelSettings") is not None
153                    else None
154                ),
155                "teamId": obj.get("teamId"),
156                "teamInvitationSettings": (
157                    TeamInvitationSettings.from_dict(obj["teamInvitationSettings"])
158                    if obj.get("teamInvitationSettings") is not None
159                    else None
160                ),
161                "teamSharingPolicySettings": (
162                    TeamSharingPolicySettings.from_dict(obj["teamSharingPolicySettings"])
163                    if obj.get("teamSharingPolicySettings") is not None
164                    else None
165                ),
166                "type": obj.get("type") if obj.get("type") is not None else "team-settings",
167            }
168        )
169        # store additional fields in additional_properties
170        for _key in obj.keys():
171            if _key not in cls.__properties:
172                _obj.additional_properties[_key] = obj.get(_key)
173
174        return _obj

TeamSettings

organization_id: Optional[Annotated[str, Strict(strict=True)]]
team_id: Optional[Annotated[str, Strict(strict=True)]]
type: Optional[Annotated[str, Strict(strict=True)]]
additional_properties: Dict[str, Any]
model_config = {'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}
def to_str(self) -> str:
70    def to_str(self) -> str:
71        """Returns the string representation of the model using alias"""
72        return pprint.pformat(self.model_dump(by_alias=True))

Returns the string representation of the model using alias

def to_json(self) -> str:
74    def to_json(self) -> str:
75        """Returns the JSON representation of the model using alias"""
76        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
77        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]:
79    @classmethod
80    def from_json(cls, json_str: str) -> Optional[Self]:
81        """Create an instance of TeamSettings from a JSON string"""
82        return cls.from_dict(json.loads(json_str))

Create an instance of TeamSettings from a JSON string

def to_dict(self) -> Dict[str, Any]:
 84    def to_dict(self) -> Dict[str, Any]:
 85        """Return the dictionary representation of the model using alias.
 86
 87        This has the following differences from calling pydantic's
 88        `self.model_dump(by_alias=True)`:
 89
 90        * `None` is only added to the output dict for nullable fields that
 91          were set at model initialization. Other fields with value `None`
 92          are ignored.
 93        * Fields in `self.additional_properties` are added to the output dict.
 94        """
 95        excluded_fields: Set[str] = set(
 96            [
 97                "additional_properties",
 98            ]
 99        )
100
101        _dict = self.model_dump(
102            by_alias=True,
103            exclude=excluded_fields,
104            exclude_none=True,
105        )
106        # override the default output from pydantic by calling `to_dict()` of team_account_discovery_settings
107        if self.team_account_discovery_settings:
108            _dict["teamAccountDiscoverySettings"] = self.team_account_discovery_settings.to_dict()
109        # override the default output from pydantic by calling `to_dict()` of team_collaboration_settings
110        if self.team_collaboration_settings:
111            _dict["teamCollaborationSettings"] = self.team_collaboration_settings.to_dict()
112        # override the default output from pydantic by calling `to_dict()` of team_copy_access_level_settings
113        if self.team_copy_access_level_settings:
114            _dict["teamCopyAccessLevelSettings"] = self.team_copy_access_level_settings.to_dict()
115        # override the default output from pydantic by calling `to_dict()` of team_invitation_settings
116        if self.team_invitation_settings:
117            _dict["teamInvitationSettings"] = self.team_invitation_settings.to_dict()
118        # override the default output from pydantic by calling `to_dict()` of team_sharing_policy_settings
119        if self.team_sharing_policy_settings:
120            _dict["teamSharingPolicySettings"] = self.team_sharing_policy_settings.to_dict()
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

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]:
128    @classmethod
129    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
130        """Create an instance of TeamSettings 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                "organizationId": obj.get("organizationId"),
140                "teamAccountDiscoverySettings": (
141                    TeamAccountDiscoverySettings.from_dict(obj["teamAccountDiscoverySettings"])
142                    if obj.get("teamAccountDiscoverySettings") is not None
143                    else None
144                ),
145                "teamCollaborationSettings": (
146                    TeamCollaborationSettings.from_dict(obj["teamCollaborationSettings"])
147                    if obj.get("teamCollaborationSettings") is not None
148                    else None
149                ),
150                "teamCopyAccessLevelSettings": (
151                    TeamCopyAccessLevelSettings.from_dict(obj["teamCopyAccessLevelSettings"])
152                    if obj.get("teamCopyAccessLevelSettings") is not None
153                    else None
154                ),
155                "teamId": obj.get("teamId"),
156                "teamInvitationSettings": (
157                    TeamInvitationSettings.from_dict(obj["teamInvitationSettings"])
158                    if obj.get("teamInvitationSettings") is not None
159                    else None
160                ),
161                "teamSharingPolicySettings": (
162                    TeamSharingPolicySettings.from_dict(obj["teamSharingPolicySettings"])
163                    if obj.get("teamSharingPolicySettings") is not None
164                    else None
165                ),
166                "type": obj.get("type") if obj.get("type") is not None else "team-settings",
167            }
168        )
169        # store additional fields in additional_properties
170        for _key in obj.keys():
171            if _key not in cls.__properties:
172                _obj.additional_properties[_key] = obj.get(_key)
173
174        return _obj

Create an instance of TeamSettings 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 = {'organization_id': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='organizationId', alias_priority=2, description='Organization id'), 'team_account_discovery_settings': FieldInfo(annotation=Union[TeamAccountDiscoverySettings, NoneType], required=False, alias='teamAccountDiscoverySettings', alias_priority=2), 'team_collaboration_settings': FieldInfo(annotation=Union[TeamCollaborationSettings, NoneType], required=False, alias='teamCollaborationSettings', alias_priority=2), 'team_copy_access_level_settings': FieldInfo(annotation=Union[TeamCopyAccessLevelSettings, NoneType], required=False, alias='teamCopyAccessLevelSettings', alias_priority=2), 'team_id': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='teamId', alias_priority=2, description='Team id'), 'team_invitation_settings': FieldInfo(annotation=Union[TeamInvitationSettings, NoneType], required=False, alias='teamInvitationSettings', alias_priority=2), 'team_sharing_policy_settings': FieldInfo(annotation=Union[TeamSharingPolicySettings, NoneType], required=False, alias='teamSharingPolicySettings', alias_priority=2), 'type': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, default='team-settings', description='Type of the object returned.'), '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