miro_api.models.update_user_group_members_result_inner
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 json 16import pprint 17from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator 18from typing import Any, List, Optional 19from miro_api.models.update_user_group_members_result_error import UpdateUserGroupMembersResultError 20from miro_api.models.update_user_group_members_result_success import UpdateUserGroupMembersResultSuccess 21from pydantic import StrictStr, Field 22from typing import Union, List, Optional, Dict 23from typing_extensions import Literal, Self 24 25UPDATEUSERGROUPMEMBERSRESULTINNER_ONE_OF_SCHEMAS = [ 26 "UpdateUserGroupMembersResultError", 27 "UpdateUserGroupMembersResultSuccess", 28] 29 30 31class UpdateUserGroupMembersResultInner(BaseModel): 32 """ 33 UpdateUserGroupMembersResultInner 34 """ 35 36 # data type: UpdateUserGroupMembersResultSuccess 37 oneof_schema_1_validator: Optional[UpdateUserGroupMembersResultSuccess] = None 38 # data type: UpdateUserGroupMembersResultError 39 oneof_schema_2_validator: Optional[UpdateUserGroupMembersResultError] = None 40 actual_instance: Optional[Union[UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess]] = None 41 one_of_schemas: List[str] = Field( 42 default=Literal["UpdateUserGroupMembersResultError", "UpdateUserGroupMembersResultSuccess"] 43 ) 44 45 model_config = { 46 "validate_assignment": True, 47 "protected_namespaces": (), 48 } 49 50 def __init__(self, *args, **kwargs) -> None: 51 if args: 52 if len(args) > 1: 53 raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") 54 if kwargs: 55 raise ValueError("If a position argument is used, keyword arguments cannot be used.") 56 super().__init__(actual_instance=args[0]) 57 else: 58 super().__init__(**kwargs) 59 60 def __getattr__(self, attr: str): 61 return getattr(self.actual_instance, attr) 62 63 @field_validator("actual_instance") 64 def actual_instance_must_validate_oneof(cls, v): 65 instance = UpdateUserGroupMembersResultInner.model_construct() 66 error_messages = [] 67 match = 0 68 # validate data type: UpdateUserGroupMembersResultSuccess 69 if not isinstance(v, UpdateUserGroupMembersResultSuccess): 70 error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateUserGroupMembersResultSuccess`") 71 else: 72 match += 1 73 # validate data type: UpdateUserGroupMembersResultError 74 if not isinstance(v, UpdateUserGroupMembersResultError): 75 error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateUserGroupMembersResultError`") 76 else: 77 match += 1 78 if match > 1: 79 # more than 1 match 80 raise ValueError( 81 "Multiple matches found when setting `actual_instance` in UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 82 + ", ".join(error_messages) 83 ) 84 elif match == 0: 85 # no match 86 raise ValueError( 87 "No match found when setting `actual_instance` in UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 88 + ", ".join(error_messages) 89 ) 90 else: 91 return v 92 93 @classmethod 94 def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: 95 return cls.from_json(json.dumps(obj)) 96 97 @classmethod 98 def from_json(cls, json_str: str) -> Union[UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess]: 99 """Returns the object represented by the json string""" 100 instance = cls.model_construct() 101 error_messages = [] 102 matches = [] 103 104 # deserialize data into UpdateUserGroupMembersResultSuccess 105 try: 106 instance.actual_instance = UpdateUserGroupMembersResultSuccess.from_json(json_str) 107 matches.append(instance.actual_instance) 108 except (ValidationError, ValueError) as e: 109 error_messages.append(str(e)) 110 # deserialize data into UpdateUserGroupMembersResultError 111 try: 112 instance.actual_instance = UpdateUserGroupMembersResultError.from_json(json_str) 113 matches.append(instance.actual_instance) 114 except (ValidationError, ValueError) as e: 115 error_messages.append(str(e)) 116 117 if not matches: 118 # no match 119 raise ValueError( 120 "No match found when deserializing the JSON string into UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 121 + ", ".join(error_messages) 122 ) 123 124 # Return one match that has least additional_properties 125 if len(matches) > 1: 126 instance.actual_instance = sorted(matches, key=lambda m: len(m.additional_properties))[0] 127 128 return instance 129 130 def to_json(self) -> str: 131 """Returns the JSON representation of the actual instance""" 132 if self.actual_instance is None: 133 return "null" 134 135 if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): 136 return self.actual_instance.to_json() 137 else: 138 return json.dumps(self.actual_instance) 139 140 def to_dict( 141 self, 142 ) -> Optional[Union[Dict[str, Any], UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess]]: 143 """Returns the dict representation of the actual instance""" 144 if self.actual_instance is None: 145 return None 146 147 if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): 148 return self.actual_instance.to_dict() 149 else: 150 # primitive type 151 return self.actual_instance 152 153 def to_str(self) -> str: 154 """Returns the string representation of the actual instance""" 155 return pprint.pformat(self.model_dump())
32class UpdateUserGroupMembersResultInner(BaseModel): 33 """ 34 UpdateUserGroupMembersResultInner 35 """ 36 37 # data type: UpdateUserGroupMembersResultSuccess 38 oneof_schema_1_validator: Optional[UpdateUserGroupMembersResultSuccess] = None 39 # data type: UpdateUserGroupMembersResultError 40 oneof_schema_2_validator: Optional[UpdateUserGroupMembersResultError] = None 41 actual_instance: Optional[Union[UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess]] = None 42 one_of_schemas: List[str] = Field( 43 default=Literal["UpdateUserGroupMembersResultError", "UpdateUserGroupMembersResultSuccess"] 44 ) 45 46 model_config = { 47 "validate_assignment": True, 48 "protected_namespaces": (), 49 } 50 51 def __init__(self, *args, **kwargs) -> None: 52 if args: 53 if len(args) > 1: 54 raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") 55 if kwargs: 56 raise ValueError("If a position argument is used, keyword arguments cannot be used.") 57 super().__init__(actual_instance=args[0]) 58 else: 59 super().__init__(**kwargs) 60 61 def __getattr__(self, attr: str): 62 return getattr(self.actual_instance, attr) 63 64 @field_validator("actual_instance") 65 def actual_instance_must_validate_oneof(cls, v): 66 instance = UpdateUserGroupMembersResultInner.model_construct() 67 error_messages = [] 68 match = 0 69 # validate data type: UpdateUserGroupMembersResultSuccess 70 if not isinstance(v, UpdateUserGroupMembersResultSuccess): 71 error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateUserGroupMembersResultSuccess`") 72 else: 73 match += 1 74 # validate data type: UpdateUserGroupMembersResultError 75 if not isinstance(v, UpdateUserGroupMembersResultError): 76 error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateUserGroupMembersResultError`") 77 else: 78 match += 1 79 if match > 1: 80 # more than 1 match 81 raise ValueError( 82 "Multiple matches found when setting `actual_instance` in UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 83 + ", ".join(error_messages) 84 ) 85 elif match == 0: 86 # no match 87 raise ValueError( 88 "No match found when setting `actual_instance` in UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 89 + ", ".join(error_messages) 90 ) 91 else: 92 return v 93 94 @classmethod 95 def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: 96 return cls.from_json(json.dumps(obj)) 97 98 @classmethod 99 def from_json(cls, json_str: str) -> Union[UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess]: 100 """Returns the object represented by the json string""" 101 instance = cls.model_construct() 102 error_messages = [] 103 matches = [] 104 105 # deserialize data into UpdateUserGroupMembersResultSuccess 106 try: 107 instance.actual_instance = UpdateUserGroupMembersResultSuccess.from_json(json_str) 108 matches.append(instance.actual_instance) 109 except (ValidationError, ValueError) as e: 110 error_messages.append(str(e)) 111 # deserialize data into UpdateUserGroupMembersResultError 112 try: 113 instance.actual_instance = UpdateUserGroupMembersResultError.from_json(json_str) 114 matches.append(instance.actual_instance) 115 except (ValidationError, ValueError) as e: 116 error_messages.append(str(e)) 117 118 if not matches: 119 # no match 120 raise ValueError( 121 "No match found when deserializing the JSON string into UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 122 + ", ".join(error_messages) 123 ) 124 125 # Return one match that has least additional_properties 126 if len(matches) > 1: 127 instance.actual_instance = sorted(matches, key=lambda m: len(m.additional_properties))[0] 128 129 return instance 130 131 def to_json(self) -> str: 132 """Returns the JSON representation of the actual instance""" 133 if self.actual_instance is None: 134 return "null" 135 136 if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): 137 return self.actual_instance.to_json() 138 else: 139 return json.dumps(self.actual_instance) 140 141 def to_dict( 142 self, 143 ) -> Optional[Union[Dict[str, Any], UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess]]: 144 """Returns the dict representation of the actual instance""" 145 if self.actual_instance is None: 146 return None 147 148 if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): 149 return self.actual_instance.to_dict() 150 else: 151 # primitive type 152 return self.actual_instance 153 154 def to_str(self) -> str: 155 """Returns the string representation of the actual instance""" 156 return pprint.pformat(self.model_dump())
UpdateUserGroupMembersResultInner
51 def __init__(self, *args, **kwargs) -> None: 52 if args: 53 if len(args) > 1: 54 raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") 55 if kwargs: 56 raise ValueError("If a position argument is used, keyword arguments cannot be used.") 57 super().__init__(actual_instance=args[0]) 58 else: 59 super().__init__(**kwargs)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be
validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
64 @field_validator("actual_instance") 65 def actual_instance_must_validate_oneof(cls, v): 66 instance = UpdateUserGroupMembersResultInner.model_construct() 67 error_messages = [] 68 match = 0 69 # validate data type: UpdateUserGroupMembersResultSuccess 70 if not isinstance(v, UpdateUserGroupMembersResultSuccess): 71 error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateUserGroupMembersResultSuccess`") 72 else: 73 match += 1 74 # validate data type: UpdateUserGroupMembersResultError 75 if not isinstance(v, UpdateUserGroupMembersResultError): 76 error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateUserGroupMembersResultError`") 77 else: 78 match += 1 79 if match > 1: 80 # more than 1 match 81 raise ValueError( 82 "Multiple matches found when setting `actual_instance` in UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 83 + ", ".join(error_messages) 84 ) 85 elif match == 0: 86 # no match 87 raise ValueError( 88 "No match found when setting `actual_instance` in UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 89 + ", ".join(error_messages) 90 ) 91 else: 92 return v
98 @classmethod 99 def from_json(cls, json_str: str) -> Union[UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess]: 100 """Returns the object represented by the json string""" 101 instance = cls.model_construct() 102 error_messages = [] 103 matches = [] 104 105 # deserialize data into UpdateUserGroupMembersResultSuccess 106 try: 107 instance.actual_instance = UpdateUserGroupMembersResultSuccess.from_json(json_str) 108 matches.append(instance.actual_instance) 109 except (ValidationError, ValueError) as e: 110 error_messages.append(str(e)) 111 # deserialize data into UpdateUserGroupMembersResultError 112 try: 113 instance.actual_instance = UpdateUserGroupMembersResultError.from_json(json_str) 114 matches.append(instance.actual_instance) 115 except (ValidationError, ValueError) as e: 116 error_messages.append(str(e)) 117 118 if not matches: 119 # no match 120 raise ValueError( 121 "No match found when deserializing the JSON string into UpdateUserGroupMembersResultInner with oneOf schemas: UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess. Details: " 122 + ", ".join(error_messages) 123 ) 124 125 # Return one match that has least additional_properties 126 if len(matches) > 1: 127 instance.actual_instance = sorted(matches, key=lambda m: len(m.additional_properties))[0] 128 129 return instance
Returns the object represented by the json string
131 def to_json(self) -> str: 132 """Returns the JSON representation of the actual instance""" 133 if self.actual_instance is None: 134 return "null" 135 136 if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): 137 return self.actual_instance.to_json() 138 else: 139 return json.dumps(self.actual_instance)
Returns the JSON representation of the actual instance
141 def to_dict( 142 self, 143 ) -> Optional[Union[Dict[str, Any], UpdateUserGroupMembersResultError, UpdateUserGroupMembersResultSuccess]]: 144 """Returns the dict representation of the actual instance""" 145 if self.actual_instance is None: 146 return None 147 148 if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): 149 return self.actual_instance.to_dict() 150 else: 151 # primitive type 152 return self.actual_instance
Returns the dict representation of the actual instance
154 def to_str(self) -> str: 155 """Returns the string representation of the actual instance""" 156 return pprint.pformat(self.model_dump())
Returns the string representation of the actual instance
Inherited Members
- pydantic.main.BaseModel
- model_extra
- model_fields_set
- model_construct
- model_copy
- model_dump
- model_dump_json
- model_json_schema
- model_parametrized_name
- model_post_init
- 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