Class: Asana::Resources::TasksBase

Inherits:
Resource
  • Object
show all
Defined in:
lib/asana/resources/gen/tasks_base.rb

Direct Known Subclasses

Task

Class Method Summary collapse

Methods inherited from Resource

#initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s

Methods included from ResponseHelper

#parse

Constructor Details

This class inherits a constructor from Asana::Resources::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Asana::Resources::Resource

Class Method Details

.add_dependencies_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Set dependencies for a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



22
23
24
25
26
# File 'lib/asana/resources/gen/tasks_base.rb', line 22

def add_dependencies_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/addDependencies"
  path["{task_gid}"] = task_gid
  parse(client.post(path, body: data, options: options)).first
end

.add_dependents_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Set dependents for a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



35
36
37
38
39
# File 'lib/asana/resources/gen/tasks_base.rb', line 35

def add_dependents_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/addDependents"
  path["{task_gid}"] = task_gid
  parse(client.post(path, body: data, options: options)).first
end

.add_followers_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Add followers to a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



48
49
50
51
52
# File 'lib/asana/resources/gen/tasks_base.rb', line 48

def add_followers_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/addFollowers"
  path["{task_gid}"] = task_gid
  Task.new(parse(client.post(path, body: data, options: options)).first, client: client)
end

.add_project_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Add a project to a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



61
62
63
64
65
# File 'lib/asana/resources/gen/tasks_base.rb', line 61

def add_project_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/addProject"
  path["{task_gid}"] = task_gid
  parse(client.post(path, body: data, options: options)).first
end

.add_tag_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Add a tag to a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



74
75
76
77
78
# File 'lib/asana/resources/gen/tasks_base.rb', line 74

def add_tag_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/addTag"
  path["{task_gid}"] = task_gid
  parse(client.post(path, body: data, options: options)).first
end

.create_subtask_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Create a subtask

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



87
88
89
90
91
# File 'lib/asana/resources/gen/tasks_base.rb', line 87

def create_subtask_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/subtasks"
  path["{task_gid}"] = task_gid
  Task.new(parse(client.post(path, body: data, options: options)).first, client: client)
end

.create_task(client, options: {}, **data) ⇒ Object

options - [Hash] the request I/O options > opt_fields - [list] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

Parameters:

  • data (Hash)

    the attributes to POST



100
101
102
103
# File 'lib/asana/resources/gen/tasks_base.rb', line 100

def create_task(client, options: {}, **data)
  path = "/tasks"
  Task.new(parse(client.post(path, body: data, options: options)).first, client: client)
end

.delete_task(client, task_gid: required("task_gid"), options: {}) ⇒ Object

Delete a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



111
112
113
114
115
# File 'lib/asana/resources/gen/tasks_base.rb', line 111

def delete_task(client, task_gid: required("task_gid"), options: {})
  path = "/tasks/{task_gid}"
  path["{task_gid}"] = task_gid
  parse(client.delete(path, options: options)).first
end

.duplicate_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Duplicate a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



124
125
126
127
128
# File 'lib/asana/resources/gen/tasks_base.rb', line 124

def duplicate_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/duplicate"
  path["{task_gid}"] = task_gid
  Job.new(parse(client.post(path, body: data, options: options)).first, client: client)
end

.get_dependencies_for_task(client, task_gid: required("task_gid"), options: {}) ⇒ Object

Get dependencies from a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • str (>]'Note: You can only pass in an offset that was returned to you via a previously paginated request.')

    offset [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. ‘Note: You can only pass in an offset that was returned to you via a previously paginated request.’

  • int (>])

    limit [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



138
139
140
141
142
# File 'lib/asana/resources/gen/tasks_base.rb', line 138

def get_dependencies_for_task(client, task_gid: required("task_gid"), options: {})
  path = "/tasks/{task_gid}/dependencies"
  path["{task_gid}"] = task_gid
  Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
end

.get_dependents_for_task(client, task_gid: required("task_gid"), options: {}) ⇒ Object

Get dependents from a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • str (>]'Note: You can only pass in an offset that was returned to you via a previously paginated request.')

    offset [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. ‘Note: You can only pass in an offset that was returned to you via a previously paginated request.’

  • int (>])

    limit [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



152
153
154
155
156
# File 'lib/asana/resources/gen/tasks_base.rb', line 152

def get_dependents_for_task(client, task_gid: required("task_gid"), options: {})
  path = "/tasks/{task_gid}/dependents"
  path["{task_gid}"] = task_gid
  Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
end

.get_subtasks_for_task(client, task_gid: required("task_gid"), options: {}) ⇒ Object

Get subtasks from a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • str (>]'Note: You can only pass in an offset that was returned to you via a previously paginated request.')

    offset [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. ‘Note: You can only pass in an offset that was returned to you via a previously paginated request.’

  • int (>])

    limit [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



166
167
168
169
170
# File 'lib/asana/resources/gen/tasks_base.rb', line 166

def get_subtasks_for_task(client, task_gid: required("task_gid"), options: {})
  path = "/tasks/{task_gid}/subtasks"
  path["{task_gid}"] = task_gid
  Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
end

.get_task(client, task_gid: required("task_gid"), options: {}) ⇒ Object

Get a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



178
179
180
181
182
# File 'lib/asana/resources/gen/tasks_base.rb', line 178

def get_task(client, task_gid: required("task_gid"), options: {})
  path = "/tasks/{task_gid}"
  path["{task_gid}"] = task_gid
  Task.new(parse(client.get(path, options: options)).first, client: client)
end

.get_tasks(client, assignee: nil, project: nil, section: nil, workspace: nil, completed_since: nil, modified_since: nil, options: {}) ⇒ Object

assignee - [str] The assignee to filter tasks on. If searching for unassigned tasks, assignee.any = null can be specified. *Note: If you specify ‘assignee`, you must also specify the `workspace` to filter on.*

Parameters:

  • project (str) (defaults to: nil)

    The project to filter tasks on.

  • section (str) (defaults to: nil)

    The section to filter tasks on.

  • workspace (str) (defaults to: nil)

    The workspace to filter tasks on. *Note: If you specify ‘workspace`, you must also specify the `assignee` to filter on.*

  • completed_since (datetime) (defaults to: nil)

    Only return tasks that are either incomplete or that have been completed since this time.

  • modified_since (datetime) (defaults to: nil)

    Only return tasks that have been modified since the given time. *Note: A task is considered “modified” if any of its properties change, or associations between it and other objects are modified (e.g. a task being added to a project). A task is not considered modified just because another object it is associated with (e.g. a subtask) is modified. Actions that count as modifying the task include assigning, renaming, completing, and adding stories.*

  • options (Hash) (defaults to: {})

    the request I/O options

  • str (>]'Note: You can only pass in an offset that was returned to you via a previously paginated request.')

    offset [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. ‘Note: You can only pass in an offset that was returned to you via a previously paginated request.’

  • int (>])

    limit [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



198
199
200
201
202
# File 'lib/asana/resources/gen/tasks_base.rb', line 198

def get_tasks(client, assignee: nil, project: nil, section: nil, workspace: nil, completed_since: nil, modified_since: nil, options: {})
  path = "/tasks"
  params = { assignee: assignee, project: project, section: section, workspace: workspace, completed_since: completed_since, modified_since: modified_since }.reject { |_,v| v.nil? || Array(v).empty? }
  Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
end

.get_tasks_for_project(client, project_gid: required("project_gid"), completed_since: nil, options: {}) ⇒ Object

Get tasks from a project

Parameters:

  • project_gid (str) (defaults to: required("project_gid"))

    (required) Globally unique identifier for the project.

  • completed_since (str) (defaults to: nil)

    Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword now.

  • options (Hash) (defaults to: {})

    the request I/O options

  • str (>]'Note: You can only pass in an offset that was returned to you via a previously paginated request.')

    offset [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. ‘Note: You can only pass in an offset that was returned to you via a previously paginated request.’

  • int (>])

    limit [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



213
214
215
216
217
218
# File 'lib/asana/resources/gen/tasks_base.rb', line 213

def get_tasks_for_project(client, project_gid: required("project_gid"), completed_since: nil, options: {})
  path = "/projects/{project_gid}/tasks"
  path["{project_gid}"] = project_gid
  params = { completed_since: completed_since }.reject { |_,v| v.nil? || Array(v).empty? }
  Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
end

.get_tasks_for_section(client, section_gid: required("section_gid"), options: {}) ⇒ Object

Get tasks from a section

Parameters:

  • section_gid (str) (defaults to: required("section_gid"))

    (required) The globally unique identifier for the section.

  • options (Hash) (defaults to: {})

    the request I/O options

  • str (>]'Note: You can only pass in an offset that was returned to you via a previously paginated request.')

    offset [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. ‘Note: You can only pass in an offset that was returned to you via a previously paginated request.’

  • int (>])

    limit [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



228
229
230
231
232
# File 'lib/asana/resources/gen/tasks_base.rb', line 228

def get_tasks_for_section(client, section_gid: required("section_gid"), options: {})
  path = "/sections/{section_gid}/tasks"
  path["{section_gid}"] = section_gid
  Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
end

.get_tasks_for_tag(client, tag_gid: required("tag_gid"), options: {}) ⇒ Object

Get tasks from a tag

Parameters:

  • tag_gid (str) (defaults to: required("tag_gid"))

    (required) Globally unique identifier for the tag.

  • options (Hash) (defaults to: {})

    the request I/O options

  • str (>]'Note: You can only pass in an offset that was returned to you via a previously paginated request.')

    offset [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. ‘Note: You can only pass in an offset that was returned to you via a previously paginated request.’

  • int (>])

    limit [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



242
243
244
245
246
# File 'lib/asana/resources/gen/tasks_base.rb', line 242

def get_tasks_for_tag(client, tag_gid: required("tag_gid"), options: {})
  path = "/tags/{tag_gid}/tasks"
  path["{tag_gid}"] = tag_gid
  Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
end

.get_tasks_for_user_task_list(client, user_task_list_gid: required("user_task_list_gid"), completed_since: nil, options: {}) ⇒ Object

Get tasks from a user task list

Parameters:

  • user_task_list_gid (str) (defaults to: required("user_task_list_gid"))

    (required) Globally unique identifier for the user task list.

  • completed_since (str) (defaults to: nil)

    Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword now.

  • options (Hash) (defaults to: {})

    the request I/O options

  • str (>]'Note: You can only pass in an offset that was returned to you via a previously paginated request.')

    offset [str] Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. ‘Note: You can only pass in an offset that was returned to you via a previously paginated request.’

  • int (>])

    limit [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



257
258
259
260
261
262
# File 'lib/asana/resources/gen/tasks_base.rb', line 257

def get_tasks_for_user_task_list(client, user_task_list_gid: required("user_task_list_gid"), completed_since: nil, options: {})
  path = "/user_task_lists/{user_task_list_gid}/tasks"
  path["{user_task_list_gid}"] = user_task_list_gid
  params = { completed_since: completed_since }.reject { |_,v| v.nil? || Array(v).empty? }
  Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
end

.inherited(base) ⇒ Object



10
11
12
# File 'lib/asana/resources/gen/tasks_base.rb', line 10

def self.inherited(base)
  Registry.register(base)
end

.remove_dependencies_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Unlink dependencies from a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



271
272
273
274
275
# File 'lib/asana/resources/gen/tasks_base.rb', line 271

def remove_dependencies_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/removeDependencies"
  path["{task_gid}"] = task_gid
  parse(client.post(path, body: data, options: options)).first
end

.remove_dependents_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Unlink dependents from a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



284
285
286
287
288
# File 'lib/asana/resources/gen/tasks_base.rb', line 284

def remove_dependents_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/removeDependents"
  path["{task_gid}"] = task_gid
  parse(client.post(path, body: data, options: options)).first
end

.remove_follower_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Remove followers from a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



297
298
299
300
301
# File 'lib/asana/resources/gen/tasks_base.rb', line 297

def remove_follower_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/removeFollowers"
  path["{task_gid}"] = task_gid
  Task.new(parse(client.post(path, body: data, options: options)).first, client: client)
end

.remove_project_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Remove a project from a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



310
311
312
313
314
# File 'lib/asana/resources/gen/tasks_base.rb', line 310

def remove_project_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/removeProject"
  path["{task_gid}"] = task_gid
  parse(client.post(path, body: data, options: options)).first
end

.remove_tag_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Remove a tag from a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



323
324
325
326
327
# File 'lib/asana/resources/gen/tasks_base.rb', line 323

def remove_tag_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/removeTag"
  path["{task_gid}"] = task_gid
  parse(client.post(path, body: data, options: options)).first
end

.search_tasks_for_workspace(client, workspace_gid: required("workspace_gid"), text: nil, resource_subtype: nil, assignee_any: nil, assignee_not: nil, portfolios_any: nil, projects_any: nil, projects_not: nil, projects_all: nil, sections_any: nil, sections_not: nil, sections_all: nil, tags_any: nil, tags_not: nil, tags_all: nil, teams_any: nil, followers_not: nil, created_by_any: nil, created_by_not: nil, assigned_by_any: nil, assigned_by_not: nil, liked_by_not: nil, commented_on_by_not: nil, due_on_before: nil, due_on_after: nil, due_on: nil, due_at_before: nil, due_at_after: nil, start_on_before: nil, start_on_after: nil, start_on: nil, created_on_before: nil, created_on_after: nil, created_on: nil, created_at_before: nil, created_at_after: nil, completed_on_before: nil, completed_on_after: nil, completed_on: nil, completed_at_before: nil, completed_at_after: nil, modified_on_before: nil, modified_on_after: nil, modified_on: nil, modified_at_before: nil, modified_at_after: nil, is_blocking: nil, is_blocked: nil, has_attachment: nil, completed: nil, is_subtask: nil, sort_by: nil, sort_ascending: nil, options: {}) ⇒ Object

Search tasks in a workspace

Parameters:

  • workspace_gid (str) (defaults to: required("workspace_gid"))

    (required) Globally unique identifier for the workspace or organization.

  • text (str) (defaults to: nil)

    Performs full-text search on both task name and description

  • resource_subtype (str) (defaults to: nil)

    Filters results by the task’s resource_subtype

  • assignee_any (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • assignee_not (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • portfolios_any (str) (defaults to: nil)

    Comma-separated list of portfolio IDs

  • projects_any (str) (defaults to: nil)

    Comma-separated list of project IDs

  • projects_not (str) (defaults to: nil)

    Comma-separated list of project IDs

  • projects_all (str) (defaults to: nil)

    Comma-separated list of project IDs

  • sections_any (str) (defaults to: nil)

    Comma-separated list of section or column IDs

  • sections_not (str) (defaults to: nil)

    Comma-separated list of section or column IDs

  • sections_all (str) (defaults to: nil)

    Comma-separated list of section or column IDs

  • tags_any (str) (defaults to: nil)

    Comma-separated list of tag IDs

  • tags_not (str) (defaults to: nil)

    Comma-separated list of tag IDs

  • tags_all (str) (defaults to: nil)

    Comma-separated list of tag IDs

  • teams_any (str) (defaults to: nil)

    Comma-separated list of team IDs

  • followers_not (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • created_by_any (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • created_by_not (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • assigned_by_any (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • assigned_by_not (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • liked_by_not (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • commented_on_by_not (str) (defaults to: nil)

    Comma-separated list of user identifiers

  • due_on_before (date) (defaults to: nil)

    ISO 8601 date string

  • due_on_after (date) (defaults to: nil)

    ISO 8601 date string

  • due_on (date) (defaults to: nil)

    ISO 8601 date string or ‘null`

  • due_at_before (datetime) (defaults to: nil)

    ISO 8601 datetime string

  • due_at_after (datetime) (defaults to: nil)

    ISO 8601 datetime string

  • start_on_before (date) (defaults to: nil)

    ISO 8601 date string

  • start_on_after (date) (defaults to: nil)

    ISO 8601 date string

  • start_on (date) (defaults to: nil)

    ISO 8601 date string or ‘null`

  • created_on_before (date) (defaults to: nil)

    ISO 8601 date string

  • created_on_after (date) (defaults to: nil)

    ISO 8601 date string

  • created_on (date) (defaults to: nil)

    ISO 8601 date string or ‘null`

  • created_at_before (datetime) (defaults to: nil)

    ISO 8601 datetime string

  • created_at_after (datetime) (defaults to: nil)

    ISO 8601 datetime string

  • completed_on_before (date) (defaults to: nil)

    ISO 8601 date string

  • completed_on_after (date) (defaults to: nil)

    ISO 8601 date string

  • completed_on (date) (defaults to: nil)

    ISO 8601 date string or ‘null`

  • completed_at_before (datetime) (defaults to: nil)

    ISO 8601 datetime string

  • completed_at_after (datetime) (defaults to: nil)

    ISO 8601 datetime string

  • modified_on_before (date) (defaults to: nil)

    ISO 8601 date string

  • modified_on_after (date) (defaults to: nil)

    ISO 8601 date string

  • modified_on (date) (defaults to: nil)

    ISO 8601 date string or ‘null`

  • modified_at_before (datetime) (defaults to: nil)

    ISO 8601 datetime string

  • modified_at_after (datetime) (defaults to: nil)

    ISO 8601 datetime string

  • is_blocking (bool) (defaults to: nil)

    Filter to incomplete tasks with dependents

  • is_blocked (bool) (defaults to: nil)

    Filter to tasks with incomplete dependencies

  • has_attachment (bool) (defaults to: nil)

    Filter to tasks with attachments

  • completed (bool) (defaults to: nil)

    Filter to completed tasks

  • is_subtask (bool) (defaults to: nil)

    Filter to subtasks

  • sort_by (str) (defaults to: nil)

    One of ‘due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at`

  • sort_ascending (bool) (defaults to: nil)

    Default ‘false`

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.



387
388
389
390
391
392
# File 'lib/asana/resources/gen/tasks_base.rb', line 387

def search_tasks_for_workspace(client, workspace_gid: required("workspace_gid"), text: nil, resource_subtype: nil, assignee_any: nil, assignee_not: nil, portfolios_any: nil, projects_any: nil, projects_not: nil, projects_all: nil, sections_any: nil, sections_not: nil, sections_all: nil, tags_any: nil, tags_not: nil, tags_all: nil, teams_any: nil, followers_not: nil, created_by_any: nil, created_by_not: nil, assigned_by_any: nil, assigned_by_not: nil, liked_by_not: nil, commented_on_by_not: nil, due_on_before: nil, due_on_after: nil, due_on: nil, due_at_before: nil, due_at_after: nil, start_on_before: nil, start_on_after: nil, start_on: nil, created_on_before: nil, created_on_after: nil, created_on: nil, created_at_before: nil, created_at_after: nil, completed_on_before: nil, completed_on_after: nil, completed_on: nil, completed_at_before: nil, completed_at_after: nil, modified_on_before: nil, modified_on_after: nil, modified_on: nil, modified_at_before: nil, modified_at_after: nil, is_blocking: nil, is_blocked: nil, has_attachment: nil, completed: nil, is_subtask: nil, sort_by: nil, sort_ascending: nil, options: {})
  path = "/workspaces/{workspace_gid}/tasks/search"
  path["{workspace_gid}"] = workspace_gid
  params = { text: text, resource_subtype: resource_subtype, "assignee.any": assignee_any, "assignee.not": assignee_not, "portfolios.any": portfolios_any, "projects.any": projects_any, "projects.not": projects_not, "projects.all": projects_all, "sections.any": sections_any, "sections.not": sections_not, "sections.all": sections_all, "tags.any": tags_any, "tags.not": tags_not, "tags.all": tags_all, "teams.any": teams_any, "followers.not": followers_not, "created_by.any": created_by_any, "created_by.not": created_by_not, "assigned_by.any": assigned_by_any, "assigned_by.not": assigned_by_not, "liked_by.not": liked_by_not, "commented_on_by.not": commented_on_by_not, due_on_before: due_on_before, due_on_after: due_on_after, due_on: due_on, due_at_before: due_at_before, due_at_after: due_at_after, start_on_before: start_on_before, start_on_after: start_on_after, start_on: start_on, created_on_before: created_on_before, created_on_after: created_on_after, created_on: created_on, created_at_before: created_at_before, created_at_after: created_at_after, completed_on_before: completed_on_before, completed_on_after: completed_on_after, completed_on: completed_on, completed_at_before: completed_at_before, completed_at_after: completed_at_after, modified_on_before: modified_on_before, modified_on_after: modified_on_after, modified_on: modified_on, modified_at_before: modified_at_before, modified_at_after: modified_at_after, is_blocking: is_blocking, is_blocked: is_blocked, has_attachment: has_attachment, completed: completed, is_subtask: is_subtask, sort_by: sort_by, sort_ascending: sort_ascending }.reject { |_,v| v.nil? || Array(v).empty? }
  Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
end

.set_parent_for_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Set the parent of a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to POST



401
402
403
404
405
# File 'lib/asana/resources/gen/tasks_base.rb', line 401

def set_parent_for_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}/setParent"
  path["{task_gid}"] = task_gid
  Task.new(parse(client.post(path, body: data, options: options)).first, client: client)
end

.update_task(client, task_gid: required("task_gid"), options: {}, **data) ⇒ Object

Update a task

Parameters:

  • task_gid (str) (defaults to: required("task_gid"))

    (required) The task to operate on.

  • options (Hash) (defaults to: {})

    the request I/O options

  • list (>str)

    ] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.

  • bool (>])

    opt_pretty [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

  • data (Hash)

    the attributes to PUT



414
415
416
417
418
# File 'lib/asana/resources/gen/tasks_base.rb', line 414

def update_task(client, task_gid: required("task_gid"), options: {}, **data)
  path = "/tasks/{task_gid}"
  path["{task_gid}"] = task_gid
  Task.new(parse(client.put(path, body: data, options: options)).first, client: client)
end