airflow.providers.asana.hooks.asana

Connect to Asana.

Module Contents

class airflow.providers.asana.hooks.asana.AsanaHook(conn_id: str = default_conn_name, *args, **kwargs)[source]

Bases: airflow.hooks.base.BaseHook

Wrapper around Asana Python client library.

conn_name_attr = asana_conn_id[source]
default_conn_name = asana_default[source]
conn_type = asana[source]
hook_name = Asana[source]
get_conn(self)[source]
static get_connection_form_widgets()[source]

Returns connection widgets to add to connection form

static get_ui_field_behaviour()[source]

Returns custom field behaviour

client(self)[source]

Instantiates python-asana Client

create_task(self, task_name: str, params: dict)[source]

Creates an Asana task.

Parameters
Returns

A dict of attributes of the created task, including its gid

delete_task(self, task_id: str)[source]

Deletes an Asana task.

Parameters

task_id -- Asana GID of the task to delete

Returns

A dict containing the response from Asana

find_task(self, params: dict)[source]

Retrieves a list of Asana tasks that match search parameters.

Parameters

params -- Attributes that matching tasks should have. For a list of possible parameters, see https://developers.asana.com/docs/get-multiple-tasks

Returns

A list of dicts containing attributes of matching Asana tasks

update_task(self, task_id: str, params: dict)[source]

Updates an existing Asana task.

Parameters
Returns

A dict containing the updated task's attributes

create_project(self, params: dict)[source]

Creates a new project.

Parameters

params -- Attributes that the new project should have. See https://developers.asana.com/docs/create-a-project#create-a-project-parameters for a list of possible parameters.

Returns

A dict containing the new project's attributes, including its GID.

find_project(self, params: dict)[source]

Retrieves a list of Asana projects that match search parameters.

Parameters

params -- Attributes which matching projects should have. See https://developers.asana.com/docs/get-multiple-projects for a list of possible parameters.

Returns

A list of dicts containing attributes of matching Asana projects

update_project(self, project_id: str, params: dict)[source]

Updates an existing project.

Parameters
Returns

A dict containing the updated project's attributes

delete_project(self, project_id: str)[source]

Deletes a project.

Parameters

project_id -- Asana GID of the project to delete

Returns

A dict containing the response from Asana

Was this entry helpful?