miro_api.models.legal_hold_response_scope

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 json
 17import pprint
 18from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator
 19from typing import Any, List, Optional
 20from miro_api.models.legal_hold_response_scope_users import LegalHoldResponseScopeUsers
 21from pydantic import StrictStr, Field
 22from typing import Union, List, Optional, Dict
 23from typing_extensions import Literal, Self
 24
 25LEGALHOLDRESPONSESCOPE_ONE_OF_SCHEMAS = ["LegalHoldResponseScopeUsers"]
 26
 27
 28class LegalHoldResponseScope(BaseModel):
 29    """
 30    The legal hold scope determines the criteria used to put content items under hold. The variants of this field might get extended in the future, although the most common use case is to put users under hold. Currently only the `users` scope is supported. However, the parsing of this field must ignore unexpected variants.
 31    """
 32
 33    # data type: LegalHoldResponseScopeUsers
 34    oneof_schema_1_validator: Optional[LegalHoldResponseScopeUsers] = None
 35    actual_instance: Optional[Union[LegalHoldResponseScopeUsers]] = None
 36    one_of_schemas: List[str] = Field(default=Literal["LegalHoldResponseScopeUsers"])
 37
 38    model_config = {
 39        "validate_assignment": True,
 40        "protected_namespaces": (),
 41    }
 42
 43    def __init__(self, *args, **kwargs) -> None:
 44        if args:
 45            if len(args) > 1:
 46                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
 47            if kwargs:
 48                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
 49            super().__init__(actual_instance=args[0])
 50        else:
 51            super().__init__(**kwargs)
 52
 53    def __getattr__(self, attr: str):
 54        return getattr(self.actual_instance, attr)
 55
 56    @field_validator("actual_instance")
 57    def actual_instance_must_validate_oneof(cls, v):
 58        instance = LegalHoldResponseScope.model_construct()
 59        error_messages = []
 60        match = 0
 61        # validate data type: LegalHoldResponseScopeUsers
 62        if not isinstance(v, LegalHoldResponseScopeUsers):
 63            error_messages.append(f"Error! Input type `{type(v)}` is not `LegalHoldResponseScopeUsers`")
 64        else:
 65            match += 1
 66        if match > 1:
 67            # more than 1 match
 68            raise ValueError(
 69                "Multiple matches found when setting `actual_instance` in LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
 70                + ", ".join(error_messages)
 71            )
 72        elif match == 0:
 73            # no match
 74            raise ValueError(
 75                "No match found when setting `actual_instance` in LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
 76                + ", ".join(error_messages)
 77            )
 78        else:
 79            return v
 80
 81    @classmethod
 82    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
 83        return cls.from_json(json.dumps(obj))
 84
 85    @classmethod
 86    def from_json(cls, json_str: str) -> Union[LegalHoldResponseScopeUsers]:
 87        """Returns the object represented by the json string"""
 88        instance = cls.model_construct()
 89        error_messages = []
 90        matches = []
 91
 92        # deserialize data into LegalHoldResponseScopeUsers
 93        try:
 94            instance.actual_instance = LegalHoldResponseScopeUsers.from_json(json_str)
 95            matches.append(instance.actual_instance)
 96        except (ValidationError, ValueError) as e:
 97            error_messages.append(str(e))
 98
 99        if not matches:
100            # no match
101            raise ValueError(
102                "No match found when deserializing the JSON string into LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
103                + ", ".join(error_messages)
104            )
105
106        # Return one match that has least additional_properties
107        if len(matches) > 1:
108            instance.actual_instance = sorted(matches, key=lambda m: len(m.additional_properties))[0]
109
110        return instance
111
112    def to_json(self) -> str:
113        """Returns the JSON representation of the actual instance"""
114        if self.actual_instance is None:
115            return "null"
116
117        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
118            return self.actual_instance.to_json()
119        else:
120            return json.dumps(self.actual_instance)
121
122    def to_dict(self) -> Optional[Union[Dict[str, Any], LegalHoldResponseScopeUsers]]:
123        """Returns the dict representation of the actual instance"""
124        if self.actual_instance is None:
125            return None
126
127        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
128            return self.actual_instance.to_dict()
129        else:
130            # primitive type
131            return self.actual_instance
132
133    def to_str(self) -> str:
134        """Returns the string representation of the actual instance"""
135        return pprint.pformat(self.model_dump())
LEGALHOLDRESPONSESCOPE_ONE_OF_SCHEMAS = ['LegalHoldResponseScopeUsers']
class LegalHoldResponseScope(pydantic.main.BaseModel):
 29class LegalHoldResponseScope(BaseModel):
 30    """
 31    The legal hold scope determines the criteria used to put content items under hold. The variants of this field might get extended in the future, although the most common use case is to put users under hold. Currently only the `users` scope is supported. However, the parsing of this field must ignore unexpected variants.
 32    """
 33
 34    # data type: LegalHoldResponseScopeUsers
 35    oneof_schema_1_validator: Optional[LegalHoldResponseScopeUsers] = None
 36    actual_instance: Optional[Union[LegalHoldResponseScopeUsers]] = None
 37    one_of_schemas: List[str] = Field(default=Literal["LegalHoldResponseScopeUsers"])
 38
 39    model_config = {
 40        "validate_assignment": True,
 41        "protected_namespaces": (),
 42    }
 43
 44    def __init__(self, *args, **kwargs) -> None:
 45        if args:
 46            if len(args) > 1:
 47                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
 48            if kwargs:
 49                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
 50            super().__init__(actual_instance=args[0])
 51        else:
 52            super().__init__(**kwargs)
 53
 54    def __getattr__(self, attr: str):
 55        return getattr(self.actual_instance, attr)
 56
 57    @field_validator("actual_instance")
 58    def actual_instance_must_validate_oneof(cls, v):
 59        instance = LegalHoldResponseScope.model_construct()
 60        error_messages = []
 61        match = 0
 62        # validate data type: LegalHoldResponseScopeUsers
 63        if not isinstance(v, LegalHoldResponseScopeUsers):
 64            error_messages.append(f"Error! Input type `{type(v)}` is not `LegalHoldResponseScopeUsers`")
 65        else:
 66            match += 1
 67        if match > 1:
 68            # more than 1 match
 69            raise ValueError(
 70                "Multiple matches found when setting `actual_instance` in LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
 71                + ", ".join(error_messages)
 72            )
 73        elif match == 0:
 74            # no match
 75            raise ValueError(
 76                "No match found when setting `actual_instance` in LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
 77                + ", ".join(error_messages)
 78            )
 79        else:
 80            return v
 81
 82    @classmethod
 83    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
 84        return cls.from_json(json.dumps(obj))
 85
 86    @classmethod
 87    def from_json(cls, json_str: str) -> Union[LegalHoldResponseScopeUsers]:
 88        """Returns the object represented by the json string"""
 89        instance = cls.model_construct()
 90        error_messages = []
 91        matches = []
 92
 93        # deserialize data into LegalHoldResponseScopeUsers
 94        try:
 95            instance.actual_instance = LegalHoldResponseScopeUsers.from_json(json_str)
 96            matches.append(instance.actual_instance)
 97        except (ValidationError, ValueError) as e:
 98            error_messages.append(str(e))
 99
100        if not matches:
101            # no match
102            raise ValueError(
103                "No match found when deserializing the JSON string into LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
104                + ", ".join(error_messages)
105            )
106
107        # Return one match that has least additional_properties
108        if len(matches) > 1:
109            instance.actual_instance = sorted(matches, key=lambda m: len(m.additional_properties))[0]
110
111        return instance
112
113    def to_json(self) -> str:
114        """Returns the JSON representation of the actual instance"""
115        if self.actual_instance is None:
116            return "null"
117
118        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
119            return self.actual_instance.to_json()
120        else:
121            return json.dumps(self.actual_instance)
122
123    def to_dict(self) -> Optional[Union[Dict[str, Any], LegalHoldResponseScopeUsers]]:
124        """Returns the dict representation of the actual instance"""
125        if self.actual_instance is None:
126            return None
127
128        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
129            return self.actual_instance.to_dict()
130        else:
131            # primitive type
132            return self.actual_instance
133
134    def to_str(self) -> str:
135        """Returns the string representation of the actual instance"""
136        return pprint.pformat(self.model_dump())

The legal hold scope determines the criteria used to put content items under hold. The variants of this field might get extended in the future, although the most common use case is to put users under hold. Currently only the users scope is supported. However, the parsing of this field must ignore unexpected variants.

LegalHoldResponseScope(*args, **kwargs)
44    def __init__(self, *args, **kwargs) -> None:
45        if args:
46            if len(args) > 1:
47                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
48            if kwargs:
49                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
50            super().__init__(actual_instance=args[0])
51        else:
52            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.

one_of_schemas: List[str]
model_config = {'validate_assignment': True, 'protected_namespaces': ()}
@field_validator('actual_instance')
def actual_instance_must_validate_oneof(cls, v):
57    @field_validator("actual_instance")
58    def actual_instance_must_validate_oneof(cls, v):
59        instance = LegalHoldResponseScope.model_construct()
60        error_messages = []
61        match = 0
62        # validate data type: LegalHoldResponseScopeUsers
63        if not isinstance(v, LegalHoldResponseScopeUsers):
64            error_messages.append(f"Error! Input type `{type(v)}` is not `LegalHoldResponseScopeUsers`")
65        else:
66            match += 1
67        if match > 1:
68            # more than 1 match
69            raise ValueError(
70                "Multiple matches found when setting `actual_instance` in LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
71                + ", ".join(error_messages)
72            )
73        elif match == 0:
74            # no match
75            raise ValueError(
76                "No match found when setting `actual_instance` in LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
77                + ", ".join(error_messages)
78            )
79        else:
80            return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> typing_extensions.Self:
82    @classmethod
83    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
84        return cls.from_json(json.dumps(obj))
@classmethod
def from_json( cls, json_str: str) -> miro_api.models.legal_hold_response_scope_users.LegalHoldResponseScopeUsers:
 86    @classmethod
 87    def from_json(cls, json_str: str) -> Union[LegalHoldResponseScopeUsers]:
 88        """Returns the object represented by the json string"""
 89        instance = cls.model_construct()
 90        error_messages = []
 91        matches = []
 92
 93        # deserialize data into LegalHoldResponseScopeUsers
 94        try:
 95            instance.actual_instance = LegalHoldResponseScopeUsers.from_json(json_str)
 96            matches.append(instance.actual_instance)
 97        except (ValidationError, ValueError) as e:
 98            error_messages.append(str(e))
 99
100        if not matches:
101            # no match
102            raise ValueError(
103                "No match found when deserializing the JSON string into LegalHoldResponseScope with oneOf schemas: LegalHoldResponseScopeUsers. Details: "
104                + ", ".join(error_messages)
105            )
106
107        # Return one match that has least additional_properties
108        if len(matches) > 1:
109            instance.actual_instance = sorted(matches, key=lambda m: len(m.additional_properties))[0]
110
111        return instance

Returns the object represented by the json string

def to_json(self) -> str:
113    def to_json(self) -> str:
114        """Returns the JSON representation of the actual instance"""
115        if self.actual_instance is None:
116            return "null"
117
118        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
119            return self.actual_instance.to_json()
120        else:
121            return json.dumps(self.actual_instance)

Returns the JSON representation of the actual instance

def to_dict( self) -> Union[Dict[str, Any], miro_api.models.legal_hold_response_scope_users.LegalHoldResponseScopeUsers, NoneType]:
123    def to_dict(self) -> Optional[Union[Dict[str, Any], LegalHoldResponseScopeUsers]]:
124        """Returns the dict representation of the actual instance"""
125        if self.actual_instance is None:
126            return None
127
128        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
129            return self.actual_instance.to_dict()
130        else:
131            # primitive type
132            return self.actual_instance

Returns the dict representation of the actual instance

def to_str(self) -> str:
134    def to_str(self) -> str:
135        """Returns the string representation of the actual instance"""
136        return pprint.pformat(self.model_dump())

Returns the string representation of the actual instance

model_fields = {'oneof_schema_1_validator': FieldInfo(annotation=Union[LegalHoldResponseScopeUsers, NoneType], required=False), 'actual_instance': FieldInfo(annotation=Union[LegalHoldResponseScopeUsers, NoneType], required=False), 'one_of_schemas': FieldInfo(annotation=List[str], required=False, default=typing_extensions.Literal['LegalHoldResponseScopeUsers'])}
model_computed_fields = {}
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