airflow.providers.asana.hooks.asana

Connect to Asana.

Module Contents

Classes

AsanaHook

Wrapper around Asana Python client library.

class airflow.providers.asana.hooks.asana.AsanaHook(conn_id=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]

Returns connection for the hook.

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, params)[source]

Creates an Asana task.

Parameters
Returns

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

Return type

dict

delete_task(self, task_id)[source]

Deletes an Asana task.

Parameters

task_id (str) -- Asana GID of the task to delete

Returns

A dict containing the response from Asana

Return type

dict

find_task(self, params)[source]

Retrieves a list of Asana tasks that match search parameters.

Parameters

params (Optional[dict]) -- 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

Return type

list

update_task(self, task_id, params)[source]

Updates an existing Asana task.

Parameters
Returns

A dict containing the updated task's attributes

Return type

dict

create_project(self, params)[source]

Creates a new project.

Parameters

params (dict) -- 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.

Return type

dict

find_project(self, params)[source]

Retrieves a list of Asana projects that match search parameters.

Parameters

params (dict) -- 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

Return type

list

update_project(self, project_id, params)[source]

Updates an existing project.

Parameters
Returns

A dict containing the updated project's attributes

Return type

dict

delete_project(self, project_id)[source]

Deletes a project.

Parameters

project_id (str) -- Asana GID of the project to delete

Returns

A dict containing the response from Asana

Return type

dict

Was this entry helpful?