Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Entity class

Spectre edited this page Jul 13, 2021 · 3 revisions

Entity class

Nearly all models in Kanka are based on the concept of entities, as described in the documentation.


Attributes

client: KankaClient object this Entity is part of.

child: Child object, depending on the Entity type.

data: Nested Object that holds the Entity data. Its parameters are:

  • id
  • name
  • type
  • child_id
  • campaign_id
  • is_private
  • is_attribute
  • is_template
  • tags
  • tooltip
  • updated_at
  • updated_by
  • created_at
  • created_by
  • header_image
  • image_uuid

Methods

@classmethod
def from_id(client: KankaClient, entity_id: int, child: GenericChildObject = None)

client: KankaClient object this Entity is part of.

entity_id: Entity ID of the Entity to be requested.

child: Existing Child object, depending on the Entity type. If none is given, it is constructed from the request response.

returns: Entity object.


@classmethod
def from_json(client: KankaClient, content: Union[str, dict])

client: KankaClient object this Entity is part of.

content: Either a json string or a dictionary representing an Entity.

returns: Entity object.


def to_json()

returns: json string representing this Entity object.

Clone this wiki locally