Trusted Activities

class py42.clients.trustedactivities.TrustedActivityType

Bases: py42.choices.Choices

Constants available for setting the type of a trusted activity.

  • DOMAIN

  • SLACK

class py42.clients.trustedactivities.TrustedActivitiesClient(trusted_activities_service)

Bases: object

A client to expose the trusted activities/data preferences API

Rest documentation

create(type, value, description=None)

Gets all trusted activities with the given type. Rest documentation

Parameters
  • type (str) – Type of the trusted activity. Constants available at py42.constants.TrustedActivityType.

  • value (str) – The URL of the domain or name of the Slack workspace.

  • description (str, optional) – Description of the trusted activity.

Returns

py42.response.Py42Response

delete(id)

Deletes a trusted activity by given resource number. Rest documentation

Parameters

id (int) – Resource number of the trusted activity or domain.

Returns

py42.response.Py42Response

get(id)

Retrieve trusted activity details by given resource number. Rest documentation

Parameters

id (int) – Resource number of the trusted activity or domain.

Returns

py42.response.Py42Response

get_all(type=None, page_size=None)

Gets all trusted activities. Rest documentation

Parameters
  • type (str, optional) – Type of the trusted activity. Defaults to None. Constants available at py42.constants.TrustedActivityType.

  • page_size (int, optional) – Number of results to return per page. Defaults to 100.

Returns

An object that iterates over py42.response.Py42Response objects that each contain a page of cases.

Return type

generator

update(id, value=None, description=None)

Updates trusted activity details by given resource number. Rest documentation

Parameters
  • id (int) – Resource number of the trusted activity.

  • value (str, optional) – The URL of the domain or name of the Slack workspace.

  • description (str, optional) – Description of the trusted activity.

Returns

py42.response.Py42Response