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