Skip to content

Add info field to cent.dto.Publication model #44

@korneevm

Description

@korneevm

The cent.dto.Publication model is currently defined as:

class Publication(CentResult):
    data: Any
    offset: int = 0
    tags: Optional[Dict[str, str]] = None

However, when I call client.history methiod, the response also includes an info field, like:

info = {'user': '123', 'client': '57e86faf-565d-48fc-8a82-58bf54deb2b6'}

As a result, accessing publication.info in my code causes linters to raise an error, since the field is not part of the model definition.

One simple fix would be to add the field to the model:

The solution can be just to add this field to model definition:

info: Optional[Dict[str, Any]] = None

I could subclass Publication and add the field myself, but that feels a bit awkward given that info is consistently returned by the API

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions