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

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. The request must always include a list of all users to be placed under hold, whether it's for a new legal hold or an update to an existing one. You can have up to 200 users per legal hold, including users added in legal hold updates.

LegalHoldRequestScope(*args, **kwargs)
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)

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):
56    @field_validator("actual_instance")
57    def actual_instance_must_validate_oneof(cls, v):
58        instance = LegalHoldRequestScope.model_construct()
59        error_messages = []
60        match = 0
61        # validate data type: LegalHoldRequestScopeUsers
62        if not isinstance(v, LegalHoldRequestScopeUsers):
63            error_messages.append(f"Error! Input type `{type(v)}` is not `LegalHoldRequestScopeUsers`")
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 LegalHoldRequestScope with oneOf schemas: LegalHoldRequestScopeUsers. 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 LegalHoldRequestScope with oneOf schemas: LegalHoldRequestScopeUsers. Details: "
76                + ", ".join(error_messages)
77            )
78        else:
79            return v
@classmethod
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> typing_extensions.Self:
81    @classmethod
82    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
83        return cls.from_json(json.dumps(obj))
@classmethod
def from_json( cls, json_str: str) -> miro_api.models.legal_hold_request_scope_users.LegalHoldRequestScopeUsers:
 85    @classmethod
 86    def from_json(cls, json_str: str) -> Union[LegalHoldRequestScopeUsers]:
 87        """Returns the object represented by the json string"""
 88        instance = cls.model_construct()
 89        error_messages = []
 90        matches = []
 91
 92        # deserialize data into LegalHoldRequestScopeUsers
 93        try:
 94            instance.actual_instance = LegalHoldRequestScopeUsers.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 LegalHoldRequestScope with oneOf schemas: LegalHoldRequestScopeUsers. 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

Returns the object represented by the json string

def to_json(self) -> str:
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)

Returns the JSON representation of the actual instance

def to_dict( self) -> Union[Dict[str, Any], miro_api.models.legal_hold_request_scope_users.LegalHoldRequestScopeUsers, NoneType]:
122    def to_dict(self) -> Optional[Union[Dict[str, Any], LegalHoldRequestScopeUsers]]:
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

Returns the dict representation of the actual instance

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

Returns the string representation of the actual instance

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