Skip to content

Actors

Actors are identities that generate events collected by Incydr. User cloud accounts are consolidated into a single actor through adoption, which tie related actors to one parent actor. These actor APIs can be used to retrieve information about actors and their relationships, and also manage adoption.

class _incydr_sdk.actors.client.ActorsV1(parent)

Client for /v1/actors endpoints.

Usage example:

>>> import incydr
>>> client = incydr.Client(**kwargs)
>>> client.actors.v1.get_page()
create_adoption(self, child_actor_id, parent_actor_id)

Create an adoption between an actor and a parent actor by adding the actor as a child to the parent, both are specified by their actor ID.

Activity originating from actors who have a parent will have said activity attributed to their parent.

Parameters:

  • child_actor_id: str (required) - Unique ID for the actor that will be added as a child to the parent actor.
  • parent_actor_id: str (required) - Unique ID for the parent actor.

Returns: A [ActorAdoption][actor-adoption-model] object representing the new parent-child actor adoption.

get_actor_by_id(self, actor_id, prefer_parent=False)

Get an actor by their actor ID.

Parameters:

  • actor_id: str (required) - Unique ID for the actor.
  • prefer_parent: str - Returns an actor's parent when applicable. Returns an actor themselves if they have no parent.

Returns: An Actor object representing the actor.

get_actor_by_name(self, name, prefer_parent=False)

Get an actor by their name.

Parameters:

  • name: str (required) - The actor name.
  • prefer_parent: str - Returns an actor's parent when applicable. Returns an actor themselves if they have no parent.

Returns: An Actor object representing the actor.

get_family_by_member_id(self, actor_id)

Get an actor family from the actor ID of any family member.

Parameters:

  • actor_id: str (required) - Unique ID for an actor.

Returns: An [Actor Family][actor-family-model] object representing the family of actors.

get_family_by_member_name(self, name)

Get an actor family from the name of any family member.

Parameters:

  • name: str (required) - Name of an actor.

Returns: An [ActorFamily][actor-family-model] object representing the family of actors.

get_page(self, active=None, name_starts_with=None, name_ends_with=None, page_num=1, page_size=500, prefer_parent=False)

Get a page of actors.

Filter results by passing the appropriate parameters:

Parameters:

  • active: bool - Find actors with the given active state. When True, returns only active actors. When False returns only inactive actors. Defaults to None, returning both.
  • name_starts_with: str - Find actors whose name (e.g. username/email) starts with this text, ignoring case.
  • name_ends_with: str - Find actors whose name (e.g. username/email) ends with this text, ignoring case.
  • page_num: int - Page number for results, starting at 1.
  • page_size: int - Max number of results to return per page. Must be between 1 and 500. Defaults to 500.
  • prefer_parent: bool = Returns an actor's parent when applicable. Returns an actor themselves if they have no parent.

Returns: An Actor object representing the actor.

iter_all(self, active=None, name_starts_with=None, name_ends_with=None, page_size=500, prefer_parent=False)

Iterate over all actors.

Accepts the same parameters as .get_page() excepting page_num.

Returns: A generator yielding individual Actor objects.

remove_adoption(self, child_actor_id)

Removes the adoption between a child and parent actor by removing the parent from a child actor, specified by actor ID.

Parameters:

  • child_actor_id: str (required) - Unique ID for the child actor.

Returns: A requests.Response indicating success.