miro_api.models.legal_hold_response

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 pprint
 16import re  # noqa: F401
 17import json
 18
 19from datetime import datetime
 20from pydantic import BaseModel, Field, StrictStr, field_validator
 21from typing import Any, ClassVar, Dict, List, Optional
 22from typing_extensions import Annotated
 23from miro_api.models.legal_hold_response_scope import LegalHoldResponseScope
 24from miro_api.models.legal_hold_state import LegalHoldState
 25from miro_api.models.user import User
 26from typing import Optional, Set
 27from typing_extensions import Self
 28
 29
 30class LegalHoldResponse(BaseModel):
 31    """
 32    LegalHoldResponse
 33    """  # noqa: E501
 34
 35    id: Annotated[str, Field(strict=True)] = Field(description="Unique identifier of the legal hold.")
 36    organization_id: Annotated[str, Field(strict=True)] = Field(
 37        description="Unique identifier of the organization.", alias="organizationId"
 38    )
 39    case_id: Annotated[str, Field(strict=True)] = Field(description="Unique identifier of the case.", alias="caseId")
 40    name: StrictStr = Field(description="The name of the legal hold.")
 41    description: Optional[StrictStr] = Field(default=None, description="The description of the legal hold.")
 42    state: LegalHoldState
 43    scope: LegalHoldResponseScope
 44    created_by: User = Field(alias="createdBy")
 45    last_modified_by: Optional[User] = Field(default=None, alias="lastModifiedBy")
 46    created_at: datetime = Field(alias="createdAt")
 47    last_modified_at: datetime = Field(alias="lastModifiedAt")
 48    additional_properties: Dict[str, Any] = {}
 49    __properties: ClassVar[List[str]] = [
 50        "id",
 51        "organizationId",
 52        "caseId",
 53        "name",
 54        "description",
 55        "state",
 56        "scope",
 57        "createdBy",
 58        "lastModifiedBy",
 59        "createdAt",
 60        "lastModifiedAt",
 61    ]
 62
 63    @field_validator("id")
 64    def id_validate_regular_expression(cls, value):
 65        """Validates the regular expression"""
 66        if not re.match(r"^[0-9]+$", value):
 67            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
 68        return value
 69
 70    @field_validator("organization_id")
 71    def organization_id_validate_regular_expression(cls, value):
 72        """Validates the regular expression"""
 73        if not re.match(r"^[0-9]+$", value):
 74            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
 75        return value
 76
 77    @field_validator("case_id")
 78    def case_id_validate_regular_expression(cls, value):
 79        """Validates the regular expression"""
 80        if not re.match(r"^[0-9]+$", value):
 81            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
 82        return value
 83
 84    model_config = {
 85        "populate_by_name": True,
 86        "validate_assignment": True,
 87        "protected_namespaces": (),
 88    }
 89
 90    def to_str(self) -> str:
 91        """Returns the string representation of the model using alias"""
 92        return pprint.pformat(self.model_dump(by_alias=True))
 93
 94    def to_json(self) -> str:
 95        """Returns the JSON representation of the model using alias"""
 96        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 97        return json.dumps(self.to_dict())
 98
 99    @classmethod
100    def from_json(cls, json_str: str) -> Optional[Self]:
101        """Create an instance of LegalHoldResponse from a JSON string"""
102        return cls.from_dict(json.loads(json_str))
103
104    def to_dict(self) -> Dict[str, Any]:
105        """Return the dictionary representation of the model using alias.
106
107        This has the following differences from calling pydantic's
108        `self.model_dump(by_alias=True)`:
109
110        * `None` is only added to the output dict for nullable fields that
111          were set at model initialization. Other fields with value `None`
112          are ignored.
113        * Fields in `self.additional_properties` are added to the output dict.
114        """
115        excluded_fields: Set[str] = set(
116            [
117                "additional_properties",
118            ]
119        )
120
121        _dict = self.model_dump(
122            by_alias=True,
123            exclude=excluded_fields,
124            exclude_none=True,
125        )
126        # override the default output from pydantic by calling `to_dict()` of scope
127        if self.scope:
128            _dict["scope"] = self.scope.to_dict()
129        # override the default output from pydantic by calling `to_dict()` of created_by
130        if self.created_by:
131            _dict["createdBy"] = self.created_by.to_dict()
132        # override the default output from pydantic by calling `to_dict()` of last_modified_by
133        if self.last_modified_by:
134            _dict["lastModifiedBy"] = self.last_modified_by.to_dict()
135        # puts key-value pairs in additional_properties in the top level
136        if self.additional_properties is not None:
137            for _key, _value in self.additional_properties.items():
138                _dict[_key] = _value
139
140        return _dict
141
142    @classmethod
143    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
144        """Create an instance of LegalHoldResponse from a dict"""
145        if obj is None:
146            return None
147
148        if not isinstance(obj, dict):
149            return cls.model_validate(obj)
150
151        _obj = cls.model_validate(
152            {
153                "id": obj.get("id"),
154                "organizationId": obj.get("organizationId"),
155                "caseId": obj.get("caseId"),
156                "name": obj.get("name"),
157                "description": obj.get("description"),
158                "state": obj.get("state"),
159                "scope": LegalHoldResponseScope.from_dict(obj["scope"]) if obj.get("scope") is not None else None,
160                "createdBy": User.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None,
161                "lastModifiedBy": (
162                    User.from_dict(obj["lastModifiedBy"]) if obj.get("lastModifiedBy") is not None else None
163                ),
164                "createdAt": obj.get("createdAt"),
165                "lastModifiedAt": obj.get("lastModifiedAt"),
166            }
167        )
168        # store additional fields in additional_properties
169        for _key in obj.keys():
170            if _key not in cls.__properties:
171                _obj.additional_properties[_key] = obj.get(_key)
172
173        return _obj
class LegalHoldResponse(pydantic.main.BaseModel):
 31class LegalHoldResponse(BaseModel):
 32    """
 33    LegalHoldResponse
 34    """  # noqa: E501
 35
 36    id: Annotated[str, Field(strict=True)] = Field(description="Unique identifier of the legal hold.")
 37    organization_id: Annotated[str, Field(strict=True)] = Field(
 38        description="Unique identifier of the organization.", alias="organizationId"
 39    )
 40    case_id: Annotated[str, Field(strict=True)] = Field(description="Unique identifier of the case.", alias="caseId")
 41    name: StrictStr = Field(description="The name of the legal hold.")
 42    description: Optional[StrictStr] = Field(default=None, description="The description of the legal hold.")
 43    state: LegalHoldState
 44    scope: LegalHoldResponseScope
 45    created_by: User = Field(alias="createdBy")
 46    last_modified_by: Optional[User] = Field(default=None, alias="lastModifiedBy")
 47    created_at: datetime = Field(alias="createdAt")
 48    last_modified_at: datetime = Field(alias="lastModifiedAt")
 49    additional_properties: Dict[str, Any] = {}
 50    __properties: ClassVar[List[str]] = [
 51        "id",
 52        "organizationId",
 53        "caseId",
 54        "name",
 55        "description",
 56        "state",
 57        "scope",
 58        "createdBy",
 59        "lastModifiedBy",
 60        "createdAt",
 61        "lastModifiedAt",
 62    ]
 63
 64    @field_validator("id")
 65    def id_validate_regular_expression(cls, value):
 66        """Validates the regular expression"""
 67        if not re.match(r"^[0-9]+$", value):
 68            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
 69        return value
 70
 71    @field_validator("organization_id")
 72    def organization_id_validate_regular_expression(cls, value):
 73        """Validates the regular expression"""
 74        if not re.match(r"^[0-9]+$", value):
 75            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
 76        return value
 77
 78    @field_validator("case_id")
 79    def case_id_validate_regular_expression(cls, value):
 80        """Validates the regular expression"""
 81        if not re.match(r"^[0-9]+$", value):
 82            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
 83        return value
 84
 85    model_config = {
 86        "populate_by_name": True,
 87        "validate_assignment": True,
 88        "protected_namespaces": (),
 89    }
 90
 91    def to_str(self) -> str:
 92        """Returns the string representation of the model using alias"""
 93        return pprint.pformat(self.model_dump(by_alias=True))
 94
 95    def to_json(self) -> str:
 96        """Returns the JSON representation of the model using alias"""
 97        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
 98        return json.dumps(self.to_dict())
 99
100    @classmethod
101    def from_json(cls, json_str: str) -> Optional[Self]:
102        """Create an instance of LegalHoldResponse from a JSON string"""
103        return cls.from_dict(json.loads(json_str))
104
105    def to_dict(self) -> Dict[str, Any]:
106        """Return the dictionary representation of the model using alias.
107
108        This has the following differences from calling pydantic's
109        `self.model_dump(by_alias=True)`:
110
111        * `None` is only added to the output dict for nullable fields that
112          were set at model initialization. Other fields with value `None`
113          are ignored.
114        * Fields in `self.additional_properties` are added to the output dict.
115        """
116        excluded_fields: Set[str] = set(
117            [
118                "additional_properties",
119            ]
120        )
121
122        _dict = self.model_dump(
123            by_alias=True,
124            exclude=excluded_fields,
125            exclude_none=True,
126        )
127        # override the default output from pydantic by calling `to_dict()` of scope
128        if self.scope:
129            _dict["scope"] = self.scope.to_dict()
130        # override the default output from pydantic by calling `to_dict()` of created_by
131        if self.created_by:
132            _dict["createdBy"] = self.created_by.to_dict()
133        # override the default output from pydantic by calling `to_dict()` of last_modified_by
134        if self.last_modified_by:
135            _dict["lastModifiedBy"] = self.last_modified_by.to_dict()
136        # puts key-value pairs in additional_properties in the top level
137        if self.additional_properties is not None:
138            for _key, _value in self.additional_properties.items():
139                _dict[_key] = _value
140
141        return _dict
142
143    @classmethod
144    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
145        """Create an instance of LegalHoldResponse from a dict"""
146        if obj is None:
147            return None
148
149        if not isinstance(obj, dict):
150            return cls.model_validate(obj)
151
152        _obj = cls.model_validate(
153            {
154                "id": obj.get("id"),
155                "organizationId": obj.get("organizationId"),
156                "caseId": obj.get("caseId"),
157                "name": obj.get("name"),
158                "description": obj.get("description"),
159                "state": obj.get("state"),
160                "scope": LegalHoldResponseScope.from_dict(obj["scope"]) if obj.get("scope") is not None else None,
161                "createdBy": User.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None,
162                "lastModifiedBy": (
163                    User.from_dict(obj["lastModifiedBy"]) if obj.get("lastModifiedBy") is not None else None
164                ),
165                "createdAt": obj.get("createdAt"),
166                "lastModifiedAt": obj.get("lastModifiedAt"),
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

LegalHoldResponse

id: typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])]
organization_id: typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])]
case_id: typing.Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[Strict(strict=True)])]
name: typing.Annotated[str, Strict(strict=True)]
description: Optional[Annotated[str, Strict(strict=True)]]
last_modified_by: Optional[miro_api.models.user.User]
created_at: datetime.datetime
last_modified_at: datetime.datetime
additional_properties: Dict[str, Any]
@field_validator('id')
def id_validate_regular_expression(cls, value):
64    @field_validator("id")
65    def id_validate_regular_expression(cls, value):
66        """Validates the regular expression"""
67        if not re.match(r"^[0-9]+$", value):
68            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
69        return value

Validates the regular expression

@field_validator('organization_id')
def organization_id_validate_regular_expression(cls, value):
71    @field_validator("organization_id")
72    def organization_id_validate_regular_expression(cls, value):
73        """Validates the regular expression"""
74        if not re.match(r"^[0-9]+$", value):
75            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
76        return value

Validates the regular expression

@field_validator('case_id')
def case_id_validate_regular_expression(cls, value):
78    @field_validator("case_id")
79    def case_id_validate_regular_expression(cls, value):
80        """Validates the regular expression"""
81        if not re.match(r"^[0-9]+$", value):
82            raise ValueError(r"must validate the regular expression /^[0-9]+$/")
83        return value

Validates the regular expression

model_config = {'populate_by_name': True, 'validate_assignment': True, 'protected_namespaces': ()}
def to_str(self) -> str:
91    def to_str(self) -> str:
92        """Returns the string representation of the model using alias"""
93        return pprint.pformat(self.model_dump(by_alias=True))

Returns the string representation of the model using alias

def to_json(self) -> str:
95    def to_json(self) -> str:
96        """Returns the JSON representation of the model using alias"""
97        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
98        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]:
100    @classmethod
101    def from_json(cls, json_str: str) -> Optional[Self]:
102        """Create an instance of LegalHoldResponse from a JSON string"""
103        return cls.from_dict(json.loads(json_str))

Create an instance of LegalHoldResponse from a JSON string

def to_dict(self) -> Dict[str, Any]:
105    def to_dict(self) -> Dict[str, Any]:
106        """Return the dictionary representation of the model using alias.
107
108        This has the following differences from calling pydantic's
109        `self.model_dump(by_alias=True)`:
110
111        * `None` is only added to the output dict for nullable fields that
112          were set at model initialization. Other fields with value `None`
113          are ignored.
114        * Fields in `self.additional_properties` are added to the output dict.
115        """
116        excluded_fields: Set[str] = set(
117            [
118                "additional_properties",
119            ]
120        )
121
122        _dict = self.model_dump(
123            by_alias=True,
124            exclude=excluded_fields,
125            exclude_none=True,
126        )
127        # override the default output from pydantic by calling `to_dict()` of scope
128        if self.scope:
129            _dict["scope"] = self.scope.to_dict()
130        # override the default output from pydantic by calling `to_dict()` of created_by
131        if self.created_by:
132            _dict["createdBy"] = self.created_by.to_dict()
133        # override the default output from pydantic by calling `to_dict()` of last_modified_by
134        if self.last_modified_by:
135            _dict["lastModifiedBy"] = self.last_modified_by.to_dict()
136        # puts key-value pairs in additional_properties in the top level
137        if self.additional_properties is not None:
138            for _key, _value in self.additional_properties.items():
139                _dict[_key] = _value
140
141        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]:
143    @classmethod
144    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
145        """Create an instance of LegalHoldResponse from a dict"""
146        if obj is None:
147            return None
148
149        if not isinstance(obj, dict):
150            return cls.model_validate(obj)
151
152        _obj = cls.model_validate(
153            {
154                "id": obj.get("id"),
155                "organizationId": obj.get("organizationId"),
156                "caseId": obj.get("caseId"),
157                "name": obj.get("name"),
158                "description": obj.get("description"),
159                "state": obj.get("state"),
160                "scope": LegalHoldResponseScope.from_dict(obj["scope"]) if obj.get("scope") is not None else None,
161                "createdBy": User.from_dict(obj["createdBy"]) if obj.get("createdBy") is not None else None,
162                "lastModifiedBy": (
163                    User.from_dict(obj["lastModifiedBy"]) if obj.get("lastModifiedBy") is not None else None
164                ),
165                "createdAt": obj.get("createdAt"),
166                "lastModifiedAt": obj.get("lastModifiedAt"),
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

Create an instance of LegalHoldResponse 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 = {'id': FieldInfo(annotation=str, required=True, description='Unique identifier of the legal hold.', metadata=[Strict(strict=True)]), 'organization_id': FieldInfo(annotation=str, required=True, alias='organizationId', alias_priority=2, description='Unique identifier of the organization.', metadata=[Strict(strict=True)]), 'case_id': FieldInfo(annotation=str, required=True, alias='caseId', alias_priority=2, description='Unique identifier of the case.', metadata=[Strict(strict=True)]), 'name': FieldInfo(annotation=str, required=True, description='The name of the legal hold.', metadata=[Strict(strict=True)]), 'description': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, description='The description of the legal hold.'), 'state': FieldInfo(annotation=LegalHoldState, required=True), 'scope': FieldInfo(annotation=LegalHoldResponseScope, required=True), 'created_by': FieldInfo(annotation=User, required=True, alias='createdBy', alias_priority=2), 'last_modified_by': FieldInfo(annotation=Union[User, NoneType], required=False, alias='lastModifiedBy', alias_priority=2), 'created_at': FieldInfo(annotation=datetime, required=True, alias='createdAt', alias_priority=2), 'last_modified_at': FieldInfo(annotation=datetime, required=True, alias='lastModifiedAt', 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