Aliases

class Aliases(session_kwargs, client, return_type='raw')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.aliases.list_shares(...)

Methods

delete(id)

Delete an alias

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get an Alias

get_object_type(object_type, alias)

Get details about an alias within an FCO type

list(*[, object_type, limit, page_num, ...])

List Aliases

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, object_id, object_type, ...])

Update some attributes of this Alias

post(object_id, object_type, alias, *[, ...])

Create an Alias

put(id, object_id, object_type, alias, *[, ...])

Replace all attributes of this Alias

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete(id: int)

Delete an alias

Parameters:
idint

The id of the Alias object.

Returns:
None

Response code 204: success

delete_shares_groups(id: int, group_id: int)

Revoke the permissions a group has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idint

The ID of the group.

Returns:
None

Response code 204: success

delete_shares_users(id: int, user_id: int)

Revoke the permissions a user has on this object

Parameters:
idint

The ID of the resource that is shared.

user_idint

The ID of the user.

Returns:
None

Response code 204: success

get(id: int)

Get an Alias

Parameters:
idint
Returns:
civis.response.Response
  • idint

    The id of the Alias object.

  • object_idint

    The id of the object

  • object_typestr

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstr

    The alias of the object

  • user_idint

    The id of the user who created the alias

  • display_namestr

    The display name of the Alias object. Defaults to object name if not provided.

get_object_type(object_type: str, alias: str)

Get details about an alias within an FCO type

Parameters:
object_typestr

The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

aliasstr

The alias of the object

Returns:
civis.response.Response
  • idint

    The id of the Alias object.

  • object_idint

    The id of the object

  • object_typestr

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstr

    The alias of the object

  • user_idint

    The id of the user who created the alias

  • display_namestr

    The display name of the Alias object. Defaults to object name if not provided.

list(*, object_type: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None)

List Aliases

Parameters:
object_typestr, optional

Filter results by object type. Pass multiple object types with a comma- separatedlist. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

limitint, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to id. Must be one of: id, object_type.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns:
civis.response.PaginatedResponse
  • idint

    The id of the Alias object.

  • object_idint

    The id of the object

  • object_typestr

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstr

    The alias of the object

  • user_idint

    The id of the user who created the alias

  • display_namestr

    The display name of the Alias object. Defaults to object name if not provided.

list_dependencies(id: int, *, user_id: int = None)

List dependent objects for this object

Parameters:
idint

The ID of the resource that is shared.

user_idint, optional

ID of target user

Returns:
civis.response.Response
  • object_typestr

    Dependent object type

  • fco_typestr

    Human readable dependent object type

  • idint

    Dependent object ID

  • namestr

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstr

    Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

  • descriptionstr

    Additional information about the dependency, if relevant

  • shareablebool

    Whether or not the requesting user can share this object.

list_shares(id: int)

List users and groups permissioned on this object

Parameters:
idint

The ID of the resource that is shared.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id: int, *, object_id: int = None, object_type: str = None, alias: str = None, display_name: str = None)

Update some attributes of this Alias

Parameters:
idint

The id of the Alias object.

object_idint, optional

The id of the object

object_typestr, optional

The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

aliasstr, optional

The alias of the object

display_namestr, optional

The display name of the Alias object. Defaults to object name if not provided.

Returns:
civis.response.Response
  • idint

    The id of the Alias object.

  • object_idint

    The id of the object

  • object_typestr

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstr

    The alias of the object

  • user_idint

    The id of the user who created the alias

  • display_namestr

    The display name of the Alias object. Defaults to object name if not provided.

post(object_id: int, object_type: str, alias: str, *, display_name: str = None)

Create an Alias

Parameters:
object_idint

The id of the object

object_typestr

The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

aliasstr

The alias of the object

display_namestr, optional

The display name of the Alias object. Defaults to object name if not provided.

Returns:
civis.response.Response
  • idint

    The id of the Alias object.

  • object_idint

    The id of the object

  • object_typestr

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstr

    The alias of the object

  • user_idint

    The id of the user who created the alias

  • display_namestr

    The display name of the Alias object. Defaults to object name if not provided.

put(id: int, object_id: int, object_type: str, alias: str, *, display_name: str = None)

Replace all attributes of this Alias

Parameters:
idint

The id of the Alias object.

object_idint

The id of the object

object_typestr

The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

aliasstr

The alias of the object

display_namestr, optional

The display name of the Alias object. Defaults to object name if not provided.

Returns:
civis.response.Response
  • idint

    The id of the Alias object.

  • object_idint

    The id of the object

  • object_typestr

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, identity_resolution, dbt_script, python_script, r_script, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstr

    The alias of the object

  • user_idint

    The id of the user who created the alias

  • display_namestr

    The display name of the Alias object. Defaults to object name if not provided.

put_shares_groups(id: int, group_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions groups has on this object

Parameters:
idint

The ID of the resource that is shared.

group_idsList[int]

An array of one or more group IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id: int, user_ids: List[int], permission_level: str, *, share_email_body: str = None, send_shared_email: bool = None)

Set the permissions users have on this object

Parameters:
idint

The ID of the resource that is shared.

user_idsList[int]

An array of one or more user IDs.

permission_levelstr

Options are: “read”, “write”, or “manage”.

share_email_bodystr, optional

Custom body text for e-mail sent on a share.

send_shared_emailbool, optional

Send email to the recipients of a share.

Returns:
civis.response.Response
  • readersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • writersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • ownersdict
    • usersList[dict]
      • id : int

      • name : str

    • groupsList[dict]
      • id : int

      • name : str

  • total_user_sharesint

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesint

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id: int, user_id: int, include_dependencies: bool, *, email_body: str = None, send_email: bool = None)

Transfer ownership of this object to another user

Parameters:
idint

The ID of the resource that is shared.

user_idint

ID of target user

include_dependenciesbool

Whether or not to give manage permissions on all dependencies

email_bodystr, optional

Custom body text for e-mail sent on transfer.

send_emailbool, optional

Send email to the target user of the transfer?

Returns:
civis.response.Response
  • dependenciesList[dict]

    Dependent objects for this object

    • object_typestr

      Dependent object type

    • fco_typestr

      Human readable dependent object type

    • idint

      Dependent object ID

    • namestr

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstr

      Permission level of target user (not user’s groups) for dependent object. Null if no target user or not shareable (e.g. a database table).

    • descriptionstr

      Additional information about the dependency, if relevant

    • sharedbool

      Whether dependent object was successfully shared with target user