miro_api.models.team_settings_changes

Miro Developer Platform

### Miro Developer Platform concepts - New to the Miro Developer Platform? Interested in learning more about platform concepts?? Read our introduction page and familiarize yourself with the Miro Developer Platform capabilities in a few minutes. ### Getting started with the Miro REST API - Quickstart (video): try the REST API in less than 3 minutes. - Quickstart (article): get started and try the REST API in less than 3 minutes. ### Miro REST API tutorials Check out our how-to articles with step-by-step instructions and code examples so you can: - Get started with OAuth 2.0 and Miro ### Miro App Examples Clone our Miro App Examples repository to get inspiration, customize, and explore apps built on top of Miro's Developer Platform 2.0.

The version of the OpenAPI document: v2.0 Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.

  1# coding: utf-8
  2
  3"""
  4Miro Developer Platform
  5
  6<img src=\"https://content.pstmn.io/47449ea6-0ef7-4af2-bac1-e58a70e61c58/aW1hZ2UucG5n\" width=\"1685\" height=\"593\">  ### Miro Developer Platform concepts  - New to the Miro Developer Platform? Interested in learning more about platform concepts?? [Read our introduction page](https://beta.developers.miro.com/docs/introduction) and familiarize yourself with the Miro Developer Platform capabilities in a few minutes.   ### Getting started with the Miro REST API  - [Quickstart (video):](https://beta.developers.miro.com/docs/try-out-the-rest-api-in-less-than-3-minutes) try the REST API in less than 3 minutes. - [Quickstart (article):](https://beta.developers.miro.com/docs/build-your-first-hello-world-app-1) get started and try the REST API in less than 3 minutes.   ### Miro REST API tutorials  Check out our how-to articles with step-by-step instructions and code examples so you can:  - [Get started with OAuth 2.0 and Miro](https://beta.developers.miro.com/docs/getting-started-with-oauth)   ### Miro App Examples  Clone our [Miro App Examples repository](https://github.com/miroapp/app-examples) to get inspiration, customize, and explore apps built on top of Miro's Developer Platform 2.0.
  7
  8The version of the OpenAPI document: v2.0
  9Generated by OpenAPI Generator (https://openapi-generator.tech)
 10
 11Do not edit the class manually.
 12"""  # noqa: E501
 13
 14
 15from __future__ import annotations
 16import pprint
 17import re  # noqa: F401
 18import json
 19
 20from pydantic import BaseModel, Field
 21from typing import Any, ClassVar, Dict, List, Optional
 22from miro_api.models.team_account_discovery_settings_changes import TeamAccountDiscoverySettingsChanges
 23from miro_api.models.team_collaboration_settings_changes import TeamCollaborationSettingsChanges
 24from miro_api.models.team_copy_access_level_settings_changes import TeamCopyAccessLevelSettingsChanges
 25from miro_api.models.team_invitation_settings_changes import TeamInvitationSettingsChanges
 26from miro_api.models.team_sharing_policy_settings_changes import TeamSharingPolicySettingsChanges
 27from typing import Optional, Set
 28from typing_extensions import Self
 29
 30
 31class TeamSettingsChanges(BaseModel):
 32    """
 33    TeamSettingsChanges
 34    """  # noqa: E501
 35
 36    team_account_discovery_settings: Optional[TeamAccountDiscoverySettingsChanges] = Field(
 37        default=None, alias="teamAccountDiscoverySettings"
 38    )
 39    team_collaboration_settings: Optional[TeamCollaborationSettingsChanges] = Field(
 40        default=None, alias="teamCollaborationSettings"
 41    )
 42    team_copy_access_level_settings: Optional[TeamCopyAccessLevelSettingsChanges] = Field(
 43        default=None, alias="teamCopyAccessLevelSettings"
 44    )
 45    team_invitation_settings: Optional[TeamInvitationSettingsChanges] = Field(
 46        default=None, alias="teamInvitationSettings"
 47    )
 48    team_sharing_policy_settings: Optional[TeamSharingPolicySettingsChanges] = Field(
 49        default=None, alias="teamSharingPolicySettings"
 50    )
 51    additional_properties: Dict[str, Any] = {}
 52    __properties: ClassVar[List[str]] = [
 53        "teamAccountDiscoverySettings",
 54        "teamCollaborationSettings",
 55        "teamCopyAccessLevelSettings",
 56        "teamInvitationSettings",
 57        "teamSharingPolicySettings",
 58    ]
 59
 60    model_config = {
 61        "populate_by_name": True,
 62        "validate_assignment": True,
 63        "protected_namespaces": (),
 64    }
 65
 66    def to_str(self) -> str:
 67        """Returns the string representation of the model using alias"""
 68        return pprint.pformat(self.model_dump(by_alias=True))
 69
 70    def to_json(self) -> str:
 71        """Returns the JSON representation of the model using alias"""
 72        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 73        return json.dumps(self.to_dict())
 74
 75    @classmethod
 76    def from_json(cls, json_str: str) -> Optional[Self]:
 77        """Create an instance of TeamSettingsChanges from a JSON string"""
 78        return cls.from_dict(json.loads(json_str))
 79
 80    def to_dict(self) -> Dict[str, Any]:
 81        """Return the dictionary representation of the model using alias.
 82
 83        This has the following differences from calling pydantic's
 84        `self.model_dump(by_alias=True)`:
 85
 86        * `None` is only added to the output dict for nullable fields that
 87          were set at model initialization. Other fields with value `None`
 88          are ignored.
 89        * Fields in `self.additional_properties` are added to the output dict.
 90        """
 91        excluded_fields: Set[str] = set(
 92            [
 93                "additional_properties",
 94            ]
 95        )
 96
 97        _dict = self.model_dump(
 98            by_alias=True,
 99            exclude=excluded_fields,
100            exclude_none=True,
101        )
102        # override the default output from pydantic by calling `to_dict()` of team_account_discovery_settings
103        if self.team_account_discovery_settings:
104            _dict["teamAccountDiscoverySettings"] = self.team_account_discovery_settings.to_dict()
105        # override the default output from pydantic by calling `to_dict()` of team_collaboration_settings
106        if self.team_collaboration_settings:
107            _dict["teamCollaborationSettings"] = self.team_collaboration_settings.to_dict()
108        # override the default output from pydantic by calling `to_dict()` of team_copy_access_level_settings
109        if self.team_copy_access_level_settings:
110            _dict["teamCopyAccessLevelSettings"] = self.team_copy_access_level_settings.to_dict()
111        # override the default output from pydantic by calling `to_dict()` of team_invitation_settings
112        if self.team_invitation_settings:
113            _dict["teamInvitationSettings"] = self.team_invitation_settings.to_dict()
114        # override the default output from pydantic by calling `to_dict()` of team_sharing_policy_settings
115        if self.team_sharing_policy_settings:
116            _dict["teamSharingPolicySettings"] = self.team_sharing_policy_settings.to_dict()
117        # puts key-value pairs in additional_properties in the top level
118        if self.additional_properties is not None:
119            for _key, _value in self.additional_properties.items():
120                _dict[_key] = _value
121
122        return _dict
123
124    @classmethod
125    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
126        """Create an instance of TeamSettingsChanges from a dict"""
127        if obj is None:
128            return None
129
130        if not isinstance(obj, dict):
131            return cls.model_validate(obj)
132
133        _obj = cls.model_validate(
134            {
135                "teamAccountDiscoverySettings": (
136                    TeamAccountDiscoverySettingsChanges.from_dict(obj["teamAccountDiscoverySettings"])
137                    if obj.get("teamAccountDiscoverySettings") is not None
138                    else None
139                ),
140                "teamCollaborationSettings": (
141                    TeamCollaborationSettingsChanges.from_dict(obj["teamCollaborationSettings"])
142                    if obj.get("teamCollaborationSettings") is not None
143                    else None
144                ),
145                "teamCopyAccessLevelSettings": (
146                    TeamCopyAccessLevelSettingsChanges.from_dict(obj["teamCopyAccessLevelSettings"])
147                    if obj.get("teamCopyAccessLevelSettings") is not None
148                    else None
149                ),
150                "teamInvitationSettings": (
151                    TeamInvitationSettingsChanges.from_dict(obj["teamInvitationSettings"])
152                    if obj.get("teamInvitationSettings") is not None
153                    else None
154                ),
155                "teamSharingPolicySettings": (
156                    TeamSharingPolicySettingsChanges.from_dict(obj["teamSharingPolicySettings"])
157                    if obj.get("teamSharingPolicySettings") is not None
158                    else None
159                ),
160            }
161        )
162        # store additional fields in additional_properties
163        for _key in obj.keys():
164            if _key not in cls.__properties:
165                _obj.additional_properties[_key] = obj.get(_key)
166
167        return _obj
class TeamSettingsChanges(pydantic.main.BaseModel):
 32class TeamSettingsChanges(BaseModel):
 33    """
 34    TeamSettingsChanges
 35    """  # noqa: E501
 36
 37    team_account_discovery_settings: Optional[TeamAccountDiscoverySettingsChanges] = Field(
 38        default=None, alias="teamAccountDiscoverySettings"
 39    )
 40    team_collaboration_settings: Optional[TeamCollaborationSettingsChanges] = Field(
 41        default=None, alias="teamCollaborationSettings"
 42    )
 43    team_copy_access_level_settings: Optional[TeamCopyAccessLevelSettingsChanges] = Field(
 44        default=None, alias="teamCopyAccessLevelSettings"
 45    )
 46    team_invitation_settings: Optional[TeamInvitationSettingsChanges] = Field(
 47        default=None, alias="teamInvitationSettings"
 48    )
 49    team_sharing_policy_settings: Optional[TeamSharingPolicySettingsChanges] = Field(
 50        default=None, alias="teamSharingPolicySettings"
 51    )
 52    additional_properties: Dict[str, Any] = {}
 53    __properties: ClassVar[List[str]] = [
 54        "teamAccountDiscoverySettings",
 55        "teamCollaborationSettings",
 56        "teamCopyAccessLevelSettings",
 57        "teamInvitationSettings",
 58        "teamSharingPolicySettings",
 59    ]
 60
 61    model_config = {
 62        "populate_by_name": True,
 63        "validate_assignment": True,
 64        "protected_namespaces": (),
 65    }
 66
 67    def to_str(self) -> str:
 68        """Returns the string representation of the model using alias"""
 69        return pprint.pformat(self.model_dump(by_alias=True))
 70
 71    def to_json(self) -> str:
 72        """Returns the JSON representation of the model using alias"""
 73        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 74        return json.dumps(self.to_dict())
 75
 76    @classmethod
 77    def from_json(cls, json_str: str) -> Optional[Self]:
 78        """Create an instance of TeamSettingsChanges from a JSON string"""
 79        return cls.from_dict(json.loads(json_str))
 80
 81    def to_dict(self) -> Dict[str, Any]:
 82        """Return the dictionary representation of the model using alias.
 83
 84        This has the following differences from calling pydantic's
 85        `self.model_dump(by_alias=True)`:
 86
 87        * `None` is only added to the output dict for nullable fields that
 88          were set at model initialization. Other fields with value `None`
 89          are ignored.
 90        * Fields in `self.additional_properties` are added to the output dict.
 91        """
 92        excluded_fields: Set[str] = set(
 93            [
 94                "additional_properties",
 95            ]
 96        )
 97
 98        _dict = self.model_dump(
 99            by_alias=True,
100            exclude=excluded_fields,
101            exclude_none=True,
102        )
103        # override the default output from pydantic by calling `to_dict()` of team_account_discovery_settings
104        if self.team_account_discovery_settings:
105            _dict["teamAccountDiscoverySettings"] = self.team_account_discovery_settings.to_dict()
106        # override the default output from pydantic by calling `to_dict()` of team_collaboration_settings
107        if self.team_collaboration_settings:
108            _dict["teamCollaborationSettings"] = self.team_collaboration_settings.to_dict()
109        # override the default output from pydantic by calling `to_dict()` of team_copy_access_level_settings
110        if self.team_copy_access_level_settings:
111            _dict["teamCopyAccessLevelSettings"] = self.team_copy_access_level_settings.to_dict()
112        # override the default output from pydantic by calling `to_dict()` of team_invitation_settings
113        if self.team_invitation_settings:
114            _dict["teamInvitationSettings"] = self.team_invitation_settings.to_dict()
115        # override the default output from pydantic by calling `to_dict()` of team_sharing_policy_settings
116        if self.team_sharing_policy_settings:
117            _dict["teamSharingPolicySettings"] = self.team_sharing_policy_settings.to_dict()
118        # puts key-value pairs in additional_properties in the top level
119        if self.additional_properties is not None:
120            for _key, _value in self.additional_properties.items():
121                _dict[_key] = _value
122
123        return _dict
124
125    @classmethod
126    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
127        """Create an instance of TeamSettingsChanges from a dict"""
128        if obj is None:
129            return None
130
131        if not isinstance(obj, dict):
132            return cls.model_validate(obj)
133
134        _obj = cls.model_validate(
135            {
136                "teamAccountDiscoverySettings": (
137                    TeamAccountDiscoverySettingsChanges.from_dict(obj["teamAccountDiscoverySettings"])
138                    if obj.get("teamAccountDiscoverySettings") is not None
139                    else None
140                ),
141                "teamCollaborationSettings": (
142                    TeamCollaborationSettingsChanges.from_dict(obj["teamCollaborationSettings"])
143                    if obj.get("teamCollaborationSettings") is not None
144                    else None
145                ),
146                "teamCopyAccessLevelSettings": (
147                    TeamCopyAccessLevelSettingsChanges.from_dict(obj["teamCopyAccessLevelSettings"])
148                    if obj.get("teamCopyAccessLevelSettings") is not None
149                    else None
150                ),
151                "teamInvitationSettings": (
152                    TeamInvitationSettingsChanges.from_dict(obj["teamInvitationSettings"])
153                    if obj.get("teamInvitationSettings") is not None
154                    else None
155                ),
156                "teamSharingPolicySettings": (
157                    TeamSharingPolicySettingsChanges.from_dict(obj["teamSharingPolicySettings"])
158                    if obj.get("teamSharingPolicySettings") is not None
159                    else None
160                ),
161            }
162        )
163        # store additional fields in additional_properties
164        for _key in obj.keys():
165            if _key not in cls.__properties:
166                _obj.additional_properties[_key] = obj.get(_key)
167
168        return _obj

TeamSettingsChanges

additional_properties: Dict[str, Any]
model_config = {'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}
def to_str(self) -> str:
67    def to_str(self) -> str:
68        """Returns the string representation of the model using alias"""
69        return pprint.pformat(self.model_dump(by_alias=True))

Returns the string representation of the model using alias

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

Create an instance of TeamSettingsChanges from a JSON string

def to_dict(self) -> Dict[str, Any]:
 81    def to_dict(self) -> Dict[str, Any]:
 82        """Return the dictionary representation of the model using alias.
 83
 84        This has the following differences from calling pydantic's
 85        `self.model_dump(by_alias=True)`:
 86
 87        * `None` is only added to the output dict for nullable fields that
 88          were set at model initialization. Other fields with value `None`
 89          are ignored.
 90        * Fields in `self.additional_properties` are added to the output dict.
 91        """
 92        excluded_fields: Set[str] = set(
 93            [
 94                "additional_properties",
 95            ]
 96        )
 97
 98        _dict = self.model_dump(
 99            by_alias=True,
100            exclude=excluded_fields,
101            exclude_none=True,
102        )
103        # override the default output from pydantic by calling `to_dict()` of team_account_discovery_settings
104        if self.team_account_discovery_settings:
105            _dict["teamAccountDiscoverySettings"] = self.team_account_discovery_settings.to_dict()
106        # override the default output from pydantic by calling `to_dict()` of team_collaboration_settings
107        if self.team_collaboration_settings:
108            _dict["teamCollaborationSettings"] = self.team_collaboration_settings.to_dict()
109        # override the default output from pydantic by calling `to_dict()` of team_copy_access_level_settings
110        if self.team_copy_access_level_settings:
111            _dict["teamCopyAccessLevelSettings"] = self.team_copy_access_level_settings.to_dict()
112        # override the default output from pydantic by calling `to_dict()` of team_invitation_settings
113        if self.team_invitation_settings:
114            _dict["teamInvitationSettings"] = self.team_invitation_settings.to_dict()
115        # override the default output from pydantic by calling `to_dict()` of team_sharing_policy_settings
116        if self.team_sharing_policy_settings:
117            _dict["teamSharingPolicySettings"] = self.team_sharing_policy_settings.to_dict()
118        # puts key-value pairs in additional_properties in the top level
119        if self.additional_properties is not None:
120            for _key, _value in self.additional_properties.items():
121                _dict[_key] = _value
122
123        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]:
125    @classmethod
126    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
127        """Create an instance of TeamSettingsChanges from a dict"""
128        if obj is None:
129            return None
130
131        if not isinstance(obj, dict):
132            return cls.model_validate(obj)
133
134        _obj = cls.model_validate(
135            {
136                "teamAccountDiscoverySettings": (
137                    TeamAccountDiscoverySettingsChanges.from_dict(obj["teamAccountDiscoverySettings"])
138                    if obj.get("teamAccountDiscoverySettings") is not None
139                    else None
140                ),
141                "teamCollaborationSettings": (
142                    TeamCollaborationSettingsChanges.from_dict(obj["teamCollaborationSettings"])
143                    if obj.get("teamCollaborationSettings") is not None
144                    else None
145                ),
146                "teamCopyAccessLevelSettings": (
147                    TeamCopyAccessLevelSettingsChanges.from_dict(obj["teamCopyAccessLevelSettings"])
148                    if obj.get("teamCopyAccessLevelSettings") is not None
149                    else None
150                ),
151                "teamInvitationSettings": (
152                    TeamInvitationSettingsChanges.from_dict(obj["teamInvitationSettings"])
153                    if obj.get("teamInvitationSettings") is not None
154                    else None
155                ),
156                "teamSharingPolicySettings": (
157                    TeamSharingPolicySettingsChanges.from_dict(obj["teamSharingPolicySettings"])
158                    if obj.get("teamSharingPolicySettings") is not None
159                    else None
160                ),
161            }
162        )
163        # store additional fields in additional_properties
164        for _key in obj.keys():
165            if _key not in cls.__properties:
166                _obj.additional_properties[_key] = obj.get(_key)
167
168        return _obj

Create an instance of TeamSettingsChanges 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 = {'team_account_discovery_settings': FieldInfo(annotation=Union[TeamAccountDiscoverySettingsChanges, NoneType], required=False, alias='teamAccountDiscoverySettings', alias_priority=2), 'team_collaboration_settings': FieldInfo(annotation=Union[TeamCollaborationSettingsChanges, NoneType], required=False, alias='teamCollaborationSettings', alias_priority=2), 'team_copy_access_level_settings': FieldInfo(annotation=Union[TeamCopyAccessLevelSettingsChanges, NoneType], required=False, alias='teamCopyAccessLevelSettings', alias_priority=2), 'team_invitation_settings': FieldInfo(annotation=Union[TeamInvitationSettingsChanges, NoneType], required=False, alias='teamInvitationSettings', alias_priority=2), 'team_sharing_policy_settings': FieldInfo(annotation=Union[TeamSharingPolicySettingsChanges, NoneType], required=False, alias='teamSharingPolicySettings', alias_priority=2), '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