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.BaseHookWrapper around Asana Python client library.
-
create_task(self, task_name: str, params: dict)[source]¶ Creates an Asana task.
- Parameters
task_name -- Name of the new task
params -- Other task attributes, such as due_on, parent, and notes. For a complete list of possible parameters, see https://developers.asana.com/docs/create-a-task
- 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
task_id -- Asana GID of task to update
params -- New values of the task's attributes. For a list of possible parameters, see https://developers.asana.com/docs/update-a-task
- 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
project_id -- Asana GID of the project to update
params -- New attributes that the project should have. See https://developers.asana.com/docs/update-a-project#update-a-project-parameters for a list of possible parameters
- Returns
A dict containing the updated project's attributes
-