miro_api.models.board_item_content_log

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 datetime import datetime
 21from pydantic import BaseModel, Field, StrictStr, field_validator
 22from typing import Any, ClassVar, Dict, List, Optional
 23from miro_api.models.actor import Actor
 24from typing import Optional, Set
 25from typing_extensions import Self
 26
 27
 28class BoardItemContentLog(BaseModel):
 29    """
 30    Contains information about the content log of for a board item.
 31    """  # noqa: E501
 32
 33    id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the content log.")
 34    content_id: Optional[StrictStr] = Field(
 35        default=None, description="Unique identifier of the board where the action happened.", alias="contentId"
 36    )
 37    action_type: Optional[StrictStr] = Field(
 38        default=None,
 39        description="Type of action within the board, such as creation of a widget, update of a comment message, and so on.",
 40        alias="actionType",
 41    )
 42    action_time: Optional[datetime] = Field(
 43        default=None,
 44        description="Date and time when the action happened.<br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)). ",
 45        alias="actionTime",
 46    )
 47    actor: Optional[Actor] = None
 48    item_type: Optional[StrictStr] = Field(
 49        default=None, description="Type of the board item on which the action happened.", alias="itemType"
 50    )
 51    item_id: Optional[StrictStr] = Field(
 52        default=None,
 53        description="Unique identifier of the board item on which the action happened. For example, the widget ID.",
 54        alias="itemId",
 55    )
 56    state: Optional[Dict[str, Any]] = Field(
 57        default=None,
 58        description="Object that contains information about the state of the board item after the action was performed.",
 59    )
 60    additional_properties: Dict[str, Any] = {}
 61    __properties: ClassVar[List[str]] = [
 62        "id",
 63        "contentId",
 64        "actionType",
 65        "actionTime",
 66        "actor",
 67        "itemType",
 68        "itemId",
 69        "state",
 70    ]
 71
 72    @field_validator("action_type")
 73    def action_type_validate_enum(cls, value):
 74        """Validates the enum"""
 75        if value is None:
 76            return value
 77
 78        if value not in set(["create", "update", "delete"]):
 79            raise ValueError("must be one of enum values ('create', 'update', 'delete')")
 80        return value
 81
 82    @field_validator("item_type")
 83    def item_type_validate_enum(cls, value):
 84        """Validates the enum"""
 85        if value is None:
 86            return value
 87
 88        if value not in set(["widget", "comment_thread", "comment_message"]):
 89            raise ValueError("must be one of enum values ('widget', 'comment_thread', 'comment_message')")
 90        return value
 91
 92    model_config = {
 93        "populate_by_name": True,
 94        "validate_assignment": True,
 95        "protected_namespaces": (),
 96    }
 97
 98    def to_str(self) -> str:
 99        """Returns the string representation of the model using alias"""
100        return pprint.pformat(self.model_dump(by_alias=True))
101
102    def to_json(self) -> str:
103        """Returns the JSON representation of the model using alias"""
104        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
105        return json.dumps(self.to_dict())
106
107    @classmethod
108    def from_json(cls, json_str: str) -> Optional[Self]:
109        """Create an instance of BoardItemContentLog from a JSON string"""
110        return cls.from_dict(json.loads(json_str))
111
112    def to_dict(self) -> Dict[str, Any]:
113        """Return the dictionary representation of the model using alias.
114
115        This has the following differences from calling pydantic's
116        `self.model_dump(by_alias=True)`:
117
118        * `None` is only added to the output dict for nullable fields that
119          were set at model initialization. Other fields with value `None`
120          are ignored.
121        * Fields in `self.additional_properties` are added to the output dict.
122        """
123        excluded_fields: Set[str] = set(
124            [
125                "additional_properties",
126            ]
127        )
128
129        _dict = self.model_dump(
130            by_alias=True,
131            exclude=excluded_fields,
132            exclude_none=True,
133        )
134        # override the default output from pydantic by calling `to_dict()` of actor
135        if self.actor:
136            _dict["actor"] = self.actor.to_dict()
137        # puts key-value pairs in additional_properties in the top level
138        if self.additional_properties is not None:
139            for _key, _value in self.additional_properties.items():
140                _dict[_key] = _value
141
142        return _dict
143
144    @classmethod
145    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
146        """Create an instance of BoardItemContentLog from a dict"""
147        if obj is None:
148            return None
149
150        if not isinstance(obj, dict):
151            return cls.model_validate(obj)
152
153        _obj = cls.model_validate(
154            {
155                "id": obj.get("id"),
156                "contentId": obj.get("contentId"),
157                "actionType": obj.get("actionType"),
158                "actionTime": obj.get("actionTime"),
159                "actor": Actor.from_dict(obj["actor"]) if obj.get("actor") is not None else None,
160                "itemType": obj.get("itemType"),
161                "itemId": obj.get("itemId"),
162                "state": obj.get("state"),
163            }
164        )
165        # store additional fields in additional_properties
166        for _key in obj.keys():
167            if _key not in cls.__properties:
168                _obj.additional_properties[_key] = obj.get(_key)
169
170        return _obj
class BoardItemContentLog(pydantic.main.BaseModel):
 29class BoardItemContentLog(BaseModel):
 30    """
 31    Contains information about the content log of for a board item.
 32    """  # noqa: E501
 33
 34    id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the content log.")
 35    content_id: Optional[StrictStr] = Field(
 36        default=None, description="Unique identifier of the board where the action happened.", alias="contentId"
 37    )
 38    action_type: Optional[StrictStr] = Field(
 39        default=None,
 40        description="Type of action within the board, such as creation of a widget, update of a comment message, and so on.",
 41        alias="actionType",
 42    )
 43    action_time: Optional[datetime] = Field(
 44        default=None,
 45        description="Date and time when the action happened.<br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)). ",
 46        alias="actionTime",
 47    )
 48    actor: Optional[Actor] = None
 49    item_type: Optional[StrictStr] = Field(
 50        default=None, description="Type of the board item on which the action happened.", alias="itemType"
 51    )
 52    item_id: Optional[StrictStr] = Field(
 53        default=None,
 54        description="Unique identifier of the board item on which the action happened. For example, the widget ID.",
 55        alias="itemId",
 56    )
 57    state: Optional[Dict[str, Any]] = Field(
 58        default=None,
 59        description="Object that contains information about the state of the board item after the action was performed.",
 60    )
 61    additional_properties: Dict[str, Any] = {}
 62    __properties: ClassVar[List[str]] = [
 63        "id",
 64        "contentId",
 65        "actionType",
 66        "actionTime",
 67        "actor",
 68        "itemType",
 69        "itemId",
 70        "state",
 71    ]
 72
 73    @field_validator("action_type")
 74    def action_type_validate_enum(cls, value):
 75        """Validates the enum"""
 76        if value is None:
 77            return value
 78
 79        if value not in set(["create", "update", "delete"]):
 80            raise ValueError("must be one of enum values ('create', 'update', 'delete')")
 81        return value
 82
 83    @field_validator("item_type")
 84    def item_type_validate_enum(cls, value):
 85        """Validates the enum"""
 86        if value is None:
 87            return value
 88
 89        if value not in set(["widget", "comment_thread", "comment_message"]):
 90            raise ValueError("must be one of enum values ('widget', 'comment_thread', 'comment_message')")
 91        return value
 92
 93    model_config = {
 94        "populate_by_name": True,
 95        "validate_assignment": True,
 96        "protected_namespaces": (),
 97    }
 98
 99    def to_str(self) -> str:
100        """Returns the string representation of the model using alias"""
101        return pprint.pformat(self.model_dump(by_alias=True))
102
103    def to_json(self) -> str:
104        """Returns the JSON representation of the model using alias"""
105        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
106        return json.dumps(self.to_dict())
107
108    @classmethod
109    def from_json(cls, json_str: str) -> Optional[Self]:
110        """Create an instance of BoardItemContentLog from a JSON string"""
111        return cls.from_dict(json.loads(json_str))
112
113    def to_dict(self) -> Dict[str, Any]:
114        """Return the dictionary representation of the model using alias.
115
116        This has the following differences from calling pydantic's
117        `self.model_dump(by_alias=True)`:
118
119        * `None` is only added to the output dict for nullable fields that
120          were set at model initialization. Other fields with value `None`
121          are ignored.
122        * Fields in `self.additional_properties` are added to the output dict.
123        """
124        excluded_fields: Set[str] = set(
125            [
126                "additional_properties",
127            ]
128        )
129
130        _dict = self.model_dump(
131            by_alias=True,
132            exclude=excluded_fields,
133            exclude_none=True,
134        )
135        # override the default output from pydantic by calling `to_dict()` of actor
136        if self.actor:
137            _dict["actor"] = self.actor.to_dict()
138        # puts key-value pairs in additional_properties in the top level
139        if self.additional_properties is not None:
140            for _key, _value in self.additional_properties.items():
141                _dict[_key] = _value
142
143        return _dict
144
145    @classmethod
146    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
147        """Create an instance of BoardItemContentLog from a dict"""
148        if obj is None:
149            return None
150
151        if not isinstance(obj, dict):
152            return cls.model_validate(obj)
153
154        _obj = cls.model_validate(
155            {
156                "id": obj.get("id"),
157                "contentId": obj.get("contentId"),
158                "actionType": obj.get("actionType"),
159                "actionTime": obj.get("actionTime"),
160                "actor": Actor.from_dict(obj["actor"]) if obj.get("actor") is not None else None,
161                "itemType": obj.get("itemType"),
162                "itemId": obj.get("itemId"),
163                "state": obj.get("state"),
164            }
165        )
166        # store additional fields in additional_properties
167        for _key in obj.keys():
168            if _key not in cls.__properties:
169                _obj.additional_properties[_key] = obj.get(_key)
170
171        return _obj

Contains information about the content log of for a board item.

id: Optional[Annotated[str, Strict(strict=True)]]
content_id: Optional[Annotated[str, Strict(strict=True)]]
action_type: Optional[Annotated[str, Strict(strict=True)]]
action_time: Optional[datetime.datetime]
actor: Optional[miro_api.models.actor.Actor]
item_type: Optional[Annotated[str, Strict(strict=True)]]
item_id: Optional[Annotated[str, Strict(strict=True)]]
state: Optional[Dict[str, Any]]
additional_properties: Dict[str, Any]
@field_validator('action_type')
def action_type_validate_enum(cls, value):
73    @field_validator("action_type")
74    def action_type_validate_enum(cls, value):
75        """Validates the enum"""
76        if value is None:
77            return value
78
79        if value not in set(["create", "update", "delete"]):
80            raise ValueError("must be one of enum values ('create', 'update', 'delete')")
81        return value

Validates the enum

@field_validator('item_type')
def item_type_validate_enum(cls, value):
83    @field_validator("item_type")
84    def item_type_validate_enum(cls, value):
85        """Validates the enum"""
86        if value is None:
87            return value
88
89        if value not in set(["widget", "comment_thread", "comment_message"]):
90            raise ValueError("must be one of enum values ('widget', 'comment_thread', 'comment_message')")
91        return value

Validates the enum

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

Returns the string representation of the model using alias

def to_json(self) -> str:
103    def to_json(self) -> str:
104        """Returns the JSON representation of the model using alias"""
105        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
106        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]:
108    @classmethod
109    def from_json(cls, json_str: str) -> Optional[Self]:
110        """Create an instance of BoardItemContentLog from a JSON string"""
111        return cls.from_dict(json.loads(json_str))

Create an instance of BoardItemContentLog from a JSON string

def to_dict(self) -> Dict[str, Any]:
113    def to_dict(self) -> Dict[str, Any]:
114        """Return the dictionary representation of the model using alias.
115
116        This has the following differences from calling pydantic's
117        `self.model_dump(by_alias=True)`:
118
119        * `None` is only added to the output dict for nullable fields that
120          were set at model initialization. Other fields with value `None`
121          are ignored.
122        * Fields in `self.additional_properties` are added to the output dict.
123        """
124        excluded_fields: Set[str] = set(
125            [
126                "additional_properties",
127            ]
128        )
129
130        _dict = self.model_dump(
131            by_alias=True,
132            exclude=excluded_fields,
133            exclude_none=True,
134        )
135        # override the default output from pydantic by calling `to_dict()` of actor
136        if self.actor:
137            _dict["actor"] = self.actor.to_dict()
138        # puts key-value pairs in additional_properties in the top level
139        if self.additional_properties is not None:
140            for _key, _value in self.additional_properties.items():
141                _dict[_key] = _value
142
143        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]:
145    @classmethod
146    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
147        """Create an instance of BoardItemContentLog from a dict"""
148        if obj is None:
149            return None
150
151        if not isinstance(obj, dict):
152            return cls.model_validate(obj)
153
154        _obj = cls.model_validate(
155            {
156                "id": obj.get("id"),
157                "contentId": obj.get("contentId"),
158                "actionType": obj.get("actionType"),
159                "actionTime": obj.get("actionTime"),
160                "actor": Actor.from_dict(obj["actor"]) if obj.get("actor") is not None else None,
161                "itemType": obj.get("itemType"),
162                "itemId": obj.get("itemId"),
163                "state": obj.get("state"),
164            }
165        )
166        # store additional fields in additional_properties
167        for _key in obj.keys():
168            if _key not in cls.__properties:
169                _obj.additional_properties[_key] = obj.get(_key)
170
171        return _obj

Create an instance of BoardItemContentLog 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=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, description='Unique identifier of the content log.'), 'content_id': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='contentId', alias_priority=2, description='Unique identifier of the board where the action happened.'), 'action_type': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='actionType', alias_priority=2, description='Type of action within the board, such as creation of a widget, update of a comment message, and so on.'), 'action_time': FieldInfo(annotation=Union[datetime, NoneType], required=False, alias='actionTime', alias_priority=2, description='Date and time when the action happened.<br>Format: UTC, adheres to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)). '), 'actor': FieldInfo(annotation=Union[Actor, NoneType], required=False), 'item_type': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='itemType', alias_priority=2, description='Type of the board item on which the action happened.'), 'item_id': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='itemId', alias_priority=2, description='Unique identifier of the board item on which the action happened. For example, the widget ID.'), 'state': FieldInfo(annotation=Union[Dict[str, Any], NoneType], required=False, description='Object that contains information about the state of the board item after the action was performed.'), '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