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
 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 miro_api.models.actor import Actor
 23from miro_api.models.relationship import Relationship
 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    relationships: Optional[List[Relationship]] = Field(
 61        default=None, description="Contains the list of items related to the current board item."
 62    )
 63    additional_properties: Dict[str, Any] = {}
 64    __properties: ClassVar[List[str]] = [
 65        "id",
 66        "contentId",
 67        "actionType",
 68        "actionTime",
 69        "actor",
 70        "itemType",
 71        "itemId",
 72        "state",
 73        "relationships",
 74    ]
 75
 76    @field_validator("action_type")
 77    def action_type_validate_enum(cls, value):
 78        """Validates the enum"""
 79        if value is None:
 80            return value
 81
 82        if value not in set(["create", "update", "delete"]):
 83            raise ValueError("must be one of enum values ('create', 'update', 'delete')")
 84        return value
 85
 86    @field_validator("item_type")
 87    def item_type_validate_enum(cls, value):
 88        """Validates the enum"""
 89        if value is None:
 90            return value
 91
 92        if value not in set(["widget", "comment_thread", "comment_message"]):
 93            raise ValueError("must be one of enum values ('widget', 'comment_thread', 'comment_message')")
 94        return value
 95
 96    model_config = {
 97        "populate_by_name": True,
 98        "validate_assignment": True,
 99        "protected_namespaces": (),
100    }
101
102    def to_str(self) -> str:
103        """Returns the string representation of the model using alias"""
104        return pprint.pformat(self.model_dump(by_alias=True))
105
106    def to_json(self) -> str:
107        """Returns the JSON representation of the model using alias"""
108        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
109        return json.dumps(self.to_dict())
110
111    @classmethod
112    def from_json(cls, json_str: str) -> Optional[Self]:
113        """Create an instance of BoardItemContentLog from a JSON string"""
114        return cls.from_dict(json.loads(json_str))
115
116    def to_dict(self) -> Dict[str, Any]:
117        """Return the dictionary representation of the model using alias.
118
119        This has the following differences from calling pydantic's
120        `self.model_dump(by_alias=True)`:
121
122        * `None` is only added to the output dict for nullable fields that
123          were set at model initialization. Other fields with value `None`
124          are ignored.
125        * Fields in `self.additional_properties` are added to the output dict.
126        """
127        excluded_fields: Set[str] = set(
128            [
129                "additional_properties",
130            ]
131        )
132
133        _dict = self.model_dump(
134            by_alias=True,
135            exclude=excluded_fields,
136            exclude_none=True,
137        )
138        # override the default output from pydantic by calling `to_dict()` of actor
139        if self.actor:
140            _dict["actor"] = self.actor.to_dict()
141        # override the default output from pydantic by calling `to_dict()` of each item in relationships (list)
142        _items = []
143        if self.relationships:
144            for _item in self.relationships:
145                if _item:
146                    _items.append(_item.to_dict())
147            _dict["relationships"] = _items
148        # puts key-value pairs in additional_properties in the top level
149        if self.additional_properties is not None:
150            for _key, _value in self.additional_properties.items():
151                _dict[_key] = _value
152
153        return _dict
154
155    @classmethod
156    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
157        """Create an instance of BoardItemContentLog from a dict"""
158        if obj is None:
159            return None
160
161        if not isinstance(obj, dict):
162            return cls.model_validate(obj)
163
164        _obj = cls.model_validate(
165            {
166                "id": obj.get("id"),
167                "contentId": obj.get("contentId"),
168                "actionType": obj.get("actionType"),
169                "actionTime": obj.get("actionTime"),
170                "actor": Actor.from_dict(obj["actor"]) if obj.get("actor") is not None else None,
171                "itemType": obj.get("itemType"),
172                "itemId": obj.get("itemId"),
173                "state": obj.get("state"),
174                "relationships": (
175                    [Relationship.from_dict(_item) for _item in obj["relationships"]]
176                    if obj.get("relationships") is not None
177                    else None
178                ),
179            }
180        )
181        # store additional fields in additional_properties
182        for _key in obj.keys():
183            if _key not in cls.__properties:
184                _obj.additional_properties[_key] = obj.get(_key)
185
186        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    relationships: Optional[List[Relationship]] = Field(
 62        default=None, description="Contains the list of items related to the current board item."
 63    )
 64    additional_properties: Dict[str, Any] = {}
 65    __properties: ClassVar[List[str]] = [
 66        "id",
 67        "contentId",
 68        "actionType",
 69        "actionTime",
 70        "actor",
 71        "itemType",
 72        "itemId",
 73        "state",
 74        "relationships",
 75    ]
 76
 77    @field_validator("action_type")
 78    def action_type_validate_enum(cls, value):
 79        """Validates the enum"""
 80        if value is None:
 81            return value
 82
 83        if value not in set(["create", "update", "delete"]):
 84            raise ValueError("must be one of enum values ('create', 'update', 'delete')")
 85        return value
 86
 87    @field_validator("item_type")
 88    def item_type_validate_enum(cls, value):
 89        """Validates the enum"""
 90        if value is None:
 91            return value
 92
 93        if value not in set(["widget", "comment_thread", "comment_message"]):
 94            raise ValueError("must be one of enum values ('widget', 'comment_thread', 'comment_message')")
 95        return value
 96
 97    model_config = {
 98        "populate_by_name": True,
 99        "validate_assignment": True,
100        "protected_namespaces": (),
101    }
102
103    def to_str(self) -> str:
104        """Returns the string representation of the model using alias"""
105        return pprint.pformat(self.model_dump(by_alias=True))
106
107    def to_json(self) -> str:
108        """Returns the JSON representation of the model using alias"""
109        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
110        return json.dumps(self.to_dict())
111
112    @classmethod
113    def from_json(cls, json_str: str) -> Optional[Self]:
114        """Create an instance of BoardItemContentLog from a JSON string"""
115        return cls.from_dict(json.loads(json_str))
116
117    def to_dict(self) -> Dict[str, Any]:
118        """Return the dictionary representation of the model using alias.
119
120        This has the following differences from calling pydantic's
121        `self.model_dump(by_alias=True)`:
122
123        * `None` is only added to the output dict for nullable fields that
124          were set at model initialization. Other fields with value `None`
125          are ignored.
126        * Fields in `self.additional_properties` are added to the output dict.
127        """
128        excluded_fields: Set[str] = set(
129            [
130                "additional_properties",
131            ]
132        )
133
134        _dict = self.model_dump(
135            by_alias=True,
136            exclude=excluded_fields,
137            exclude_none=True,
138        )
139        # override the default output from pydantic by calling `to_dict()` of actor
140        if self.actor:
141            _dict["actor"] = self.actor.to_dict()
142        # override the default output from pydantic by calling `to_dict()` of each item in relationships (list)
143        _items = []
144        if self.relationships:
145            for _item in self.relationships:
146                if _item:
147                    _items.append(_item.to_dict())
148            _dict["relationships"] = _items
149        # puts key-value pairs in additional_properties in the top level
150        if self.additional_properties is not None:
151            for _key, _value in self.additional_properties.items():
152                _dict[_key] = _value
153
154        return _dict
155
156    @classmethod
157    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
158        """Create an instance of BoardItemContentLog from a dict"""
159        if obj is None:
160            return None
161
162        if not isinstance(obj, dict):
163            return cls.model_validate(obj)
164
165        _obj = cls.model_validate(
166            {
167                "id": obj.get("id"),
168                "contentId": obj.get("contentId"),
169                "actionType": obj.get("actionType"),
170                "actionTime": obj.get("actionTime"),
171                "actor": Actor.from_dict(obj["actor"]) if obj.get("actor") is not None else None,
172                "itemType": obj.get("itemType"),
173                "itemId": obj.get("itemId"),
174                "state": obj.get("state"),
175                "relationships": (
176                    [Relationship.from_dict(_item) for _item in obj["relationships"]]
177                    if obj.get("relationships") is not None
178                    else None
179                ),
180            }
181        )
182        # store additional fields in additional_properties
183        for _key in obj.keys():
184            if _key not in cls.__properties:
185                _obj.additional_properties[_key] = obj.get(_key)
186
187        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]]
relationships: Optional[List[miro_api.models.relationship.Relationship]]
additional_properties: Dict[str, Any]
@field_validator('action_type')
def action_type_validate_enum(cls, value):
77    @field_validator("action_type")
78    def action_type_validate_enum(cls, value):
79        """Validates the enum"""
80        if value is None:
81            return value
82
83        if value not in set(["create", "update", "delete"]):
84            raise ValueError("must be one of enum values ('create', 'update', 'delete')")
85        return value

Validates the enum

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

Validates the enum

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

Returns the string representation of the model using alias

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

Create an instance of BoardItemContentLog from a JSON string

def to_dict(self) -> Dict[str, Any]:
117    def to_dict(self) -> Dict[str, Any]:
118        """Return the dictionary representation of the model using alias.
119
120        This has the following differences from calling pydantic's
121        `self.model_dump(by_alias=True)`:
122
123        * `None` is only added to the output dict for nullable fields that
124          were set at model initialization. Other fields with value `None`
125          are ignored.
126        * Fields in `self.additional_properties` are added to the output dict.
127        """
128        excluded_fields: Set[str] = set(
129            [
130                "additional_properties",
131            ]
132        )
133
134        _dict = self.model_dump(
135            by_alias=True,
136            exclude=excluded_fields,
137            exclude_none=True,
138        )
139        # override the default output from pydantic by calling `to_dict()` of actor
140        if self.actor:
141            _dict["actor"] = self.actor.to_dict()
142        # override the default output from pydantic by calling `to_dict()` of each item in relationships (list)
143        _items = []
144        if self.relationships:
145            for _item in self.relationships:
146                if _item:
147                    _items.append(_item.to_dict())
148            _dict["relationships"] = _items
149        # puts key-value pairs in additional_properties in the top level
150        if self.additional_properties is not None:
151            for _key, _value in self.additional_properties.items():
152                _dict[_key] = _value
153
154        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]:
156    @classmethod
157    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
158        """Create an instance of BoardItemContentLog from a dict"""
159        if obj is None:
160            return None
161
162        if not isinstance(obj, dict):
163            return cls.model_validate(obj)
164
165        _obj = cls.model_validate(
166            {
167                "id": obj.get("id"),
168                "contentId": obj.get("contentId"),
169                "actionType": obj.get("actionType"),
170                "actionTime": obj.get("actionTime"),
171                "actor": Actor.from_dict(obj["actor"]) if obj.get("actor") is not None else None,
172                "itemType": obj.get("itemType"),
173                "itemId": obj.get("itemId"),
174                "state": obj.get("state"),
175                "relationships": (
176                    [Relationship.from_dict(_item) for _item in obj["relationships"]]
177                    if obj.get("relationships") is not None
178                    else None
179                ),
180            }
181        )
182        # store additional fields in additional_properties
183        for _key in obj.keys():
184            if _key not in cls.__properties:
185                _obj.additional_properties[_key] = obj.get(_key)
186
187        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.'), 'relationships': FieldInfo(annotation=Union[List[miro_api.models.relationship.Relationship], NoneType], required=False, description='Contains the list of items related to the current board item.'), '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