asana 0.9.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.swagger-codegen-ignore +3 -0
- data/.travis.yml +2 -1
- data/Appraisals +2 -35
- data/Gemfile +2 -0
- data/README.md +3 -51
- data/VERSION +1 -0
- data/asana.gemspec +3 -3
- data/examples/Gemfile.lock +10 -10
- data/lib/asana/client.rb +10 -10
- data/lib/asana/http_client.rb +8 -2
- data/lib/asana/resource_includes/attachment_uploading.rb +14 -7
- data/lib/asana/resource_includes/collection.rb +5 -0
- data/lib/asana/resource_includes/resource.rb +0 -4
- data/lib/asana/resources/attachment.rb +2 -5
- data/lib/asana/resources/batch_api.rb +15 -0
- data/lib/asana/resources/custom_field_settings.rb +2 -5
- data/lib/asana/resources/custom_fields.rb +2 -5
- data/lib/asana/resources/events.rb +28 -0
- data/lib/asana/resources/gen/attachments_base.rb +56 -0
- data/lib/asana/resources/gen/batch_api_base.rb +30 -0
- data/lib/asana/resources/gen/custom_field_settings_base.rb +46 -0
- data/lib/asana/resources/gen/custom_fields_base.rb +124 -0
- data/lib/asana/resources/gen/events_base.rb +32 -0
- data/lib/asana/resources/gen/jobs_base.rb +30 -0
- data/lib/asana/resources/gen/organization_exports_base.rb +44 -0
- data/lib/asana/resources/gen/portfolio_memberships_base.rb +63 -0
- data/lib/asana/resources/gen/portfolios_base.rb +173 -0
- data/lib/asana/resources/gen/project_memberships_base.rb +46 -0
- data/lib/asana/resources/gen/project_statuses_base.rb +69 -0
- data/lib/asana/resources/gen/projects_base.rb +259 -0
- data/lib/asana/resources/gen/sections_base.rb +108 -0
- data/lib/asana/resources/gen/stories_base.rb +84 -0
- data/lib/asana/resources/gen/tags_base.rb +129 -0
- data/lib/asana/resources/gen/tasks_base.rb +425 -0
- data/lib/asana/resources/gen/team_memberships_base.rb +77 -0
- data/lib/asana/resources/gen/teams_base.rb +88 -0
- data/lib/asana/resources/gen/typeahead_base.rb +35 -0
- data/lib/asana/resources/gen/user_task_lists_base.rb +44 -0
- data/lib/asana/resources/gen/users_base.rb +88 -0
- data/lib/asana/resources/gen/webhooks_base.rb +70 -0
- data/lib/asana/resources/gen/workspace_memberships_base.rb +60 -0
- data/lib/asana/resources/gen/workspaces_base.rb +82 -0
- data/lib/asana/resources/job.rb +2 -3
- data/lib/asana/resources/organization_export.rb +2 -5
- data/lib/asana/resources/portfolio.rb +2 -5
- data/lib/asana/resources/portfolio_membership.rb +2 -5
- data/lib/asana/resources/project.rb +2 -5
- data/lib/asana/resources/project_membership.rb +2 -5
- data/lib/asana/resources/project_status.rb +2 -5
- data/lib/asana/resources/section.rb +18 -22
- data/lib/asana/resources/story.rb +2 -5
- data/lib/asana/resources/tag.rb +2 -5
- data/lib/asana/resources/task.rb +5 -5
- data/lib/asana/resources/team.rb +2 -5
- data/lib/asana/resources/team_membership.rb +26 -0
- data/lib/asana/resources/typeahead.rb +22 -0
- data/lib/asana/resources/user.rb +2 -5
- data/lib/asana/resources/user_task_list.rb +2 -5
- data/lib/asana/resources/webhook.rb +2 -5
- data/lib/asana/resources/workspace.rb +2 -6
- data/lib/asana/resources/workspace_membership.rb +32 -0
- data/lib/asana/version.rb +1 -1
- data/samples/attachments_sample.yaml +41 -0
- data/samples/batch_api_sample.yaml +11 -0
- data/samples/custom_field_settings_sample.yaml +21 -0
- data/samples/custom_fields_sample.yaml +81 -0
- data/samples/events_sample.yaml +11 -0
- data/samples/jobs_sample.yaml +11 -0
- data/samples/organization_exports_sample.yaml +21 -0
- data/samples/portfolio_memberships_sample.yaml +31 -0
- data/samples/portfolios_sample.yaml +121 -0
- data/samples/project_memberships_sample.yaml +21 -0
- data/samples/project_statuses_sample.yaml +41 -0
- data/samples/projects_sample.yaml +181 -0
- data/samples/sections_sample.yaml +71 -0
- data/samples/stories_sample.yaml +51 -0
- data/samples/tags_sample.yaml +81 -0
- data/samples/tasks_sample.yaml +261 -0
- data/samples/team_memberships_sample.yaml +41 -0
- data/samples/teams_sample.yaml +51 -0
- data/samples/typeahead_sample.yaml +11 -0
- data/samples/user_task_lists_sample.yaml +21 -0
- data/samples/users_sample.yaml +51 -0
- data/samples/webhooks_sample.yaml +41 -0
- data/samples/workspace_memberships_sample.yaml +31 -0
- data/samples/workspaces_sample.yaml +51 -0
- data/swagger_templates/api.mustache +41 -0
- data/swagger_templates/api_doc.mustache +12 -0
- data/swagger_templates/ruby-config.json +6 -0
- metadata +70 -13
@@ -0,0 +1,84 @@
|
|
1
|
+
### WARNING: This file is auto-generated by our OpenAPI spec. Do not
|
2
|
+
### edit it manually.
|
3
|
+
|
4
|
+
require_relative '../../resource_includes/response_helper'
|
5
|
+
|
6
|
+
module Asana
|
7
|
+
module Resources
|
8
|
+
class StoriesBase < Resource
|
9
|
+
|
10
|
+
def self.inherited(base)
|
11
|
+
Registry.register(base)
|
12
|
+
end
|
13
|
+
|
14
|
+
class << self
|
15
|
+
# Create a story on a task
|
16
|
+
#
|
17
|
+
# task_gid - [str] (required) The task to operate on.
|
18
|
+
# options - [Hash] the request I/O options
|
19
|
+
# > opt_fields - [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.
|
20
|
+
# > 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.
|
21
|
+
# data - [Hash] the attributes to POST
|
22
|
+
def create_story_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
23
|
+
path = "/tasks/{task_gid}/stories"
|
24
|
+
path["{task_gid}"] = task_gid
|
25
|
+
Story.new(parse(client.post(path, body: data, options: options)).first, client: client)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Delete a story
|
29
|
+
#
|
30
|
+
# story_gid - [str] (required) Globally unique identifier for the story.
|
31
|
+
# options - [Hash] the request I/O options
|
32
|
+
# > opt_fields - [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.
|
33
|
+
# > 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.
|
34
|
+
def delete_story(client, story_gid: required("story_gid"), options: {})
|
35
|
+
path = "/stories/{story_gid}"
|
36
|
+
path["{story_gid}"] = story_gid
|
37
|
+
parse(client.delete(path, options: options)).first
|
38
|
+
end
|
39
|
+
|
40
|
+
# Get stories from a task
|
41
|
+
#
|
42
|
+
# task_gid - [str] (required) The task to operate on.
|
43
|
+
# options - [Hash] the request I/O options
|
44
|
+
# > 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.'
|
45
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
46
|
+
# > opt_fields - [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.
|
47
|
+
# > 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.
|
48
|
+
def get_stories_for_task(client, task_gid: required("task_gid"), options: {})
|
49
|
+
path = "/tasks/{task_gid}/stories"
|
50
|
+
path["{task_gid}"] = task_gid
|
51
|
+
Collection.new(parse(client.get(path, options: options)), type: Story, client: client)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Get a story
|
55
|
+
#
|
56
|
+
# story_gid - [str] (required) Globally unique identifier for the story.
|
57
|
+
# options - [Hash] the request I/O options
|
58
|
+
# > 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.'
|
59
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
60
|
+
# > opt_fields - [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.
|
61
|
+
# > 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.
|
62
|
+
def get_story(client, story_gid: required("story_gid"), options: {})
|
63
|
+
path = "/stories/{story_gid}"
|
64
|
+
path["{story_gid}"] = story_gid
|
65
|
+
Story.new(parse(client.get(path, options: options)).first, client: client)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Update a story
|
69
|
+
#
|
70
|
+
# story_gid - [str] (required) Globally unique identifier for the story.
|
71
|
+
# options - [Hash] the request I/O options
|
72
|
+
# > opt_fields - [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.
|
73
|
+
# > 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.
|
74
|
+
# data - [Hash] the attributes to PUT
|
75
|
+
def update_story(client, story_gid: required("story_gid"), options: {}, **data)
|
76
|
+
path = "/stories/{story_gid}"
|
77
|
+
path["{story_gid}"] = story_gid
|
78
|
+
Story.new(parse(client.put(path, body: data, options: options)).first, client: client)
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
### WARNING: This file is auto-generated by our OpenAPI spec. Do not
|
2
|
+
### edit it manually.
|
3
|
+
|
4
|
+
require_relative '../../resource_includes/response_helper'
|
5
|
+
|
6
|
+
module Asana
|
7
|
+
module Resources
|
8
|
+
class TagsBase < Resource
|
9
|
+
|
10
|
+
def self.inherited(base)
|
11
|
+
Registry.register(base)
|
12
|
+
end
|
13
|
+
|
14
|
+
class << self
|
15
|
+
# Create a tag
|
16
|
+
#
|
17
|
+
|
18
|
+
# options - [Hash] the request I/O options
|
19
|
+
# > opt_fields - [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.
|
20
|
+
# > 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.
|
21
|
+
# data - [Hash] the attributes to POST
|
22
|
+
def create_tag(client, options: {}, **data)
|
23
|
+
path = "/tags"
|
24
|
+
Tag.new(parse(client.post(path, body: data, options: options)).first, client: client)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Create a tag in a workspace
|
28
|
+
#
|
29
|
+
# workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
|
30
|
+
# options - [Hash] the request I/O options
|
31
|
+
# > opt_fields - [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.
|
32
|
+
# > 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.
|
33
|
+
# data - [Hash] the attributes to POST
|
34
|
+
def create_tag_for_workspace(client, workspace_gid: required("workspace_gid"), options: {}, **data)
|
35
|
+
path = "/workspaces/{workspace_gid}/tags"
|
36
|
+
path["{workspace_gid}"] = workspace_gid
|
37
|
+
Tag.new(parse(client.post(path, body: data, options: options)).first, client: client)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Delete a tag
|
41
|
+
#
|
42
|
+
# tag_gid - [str] (required) Globally unique identifier for the tag.
|
43
|
+
# options - [Hash] the request I/O options
|
44
|
+
# > 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.'
|
45
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
46
|
+
# > opt_fields - [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.
|
47
|
+
# > 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.
|
48
|
+
def delete_tag(client, tag_gid: required("tag_gid"), options: {})
|
49
|
+
path = "/tags/{tag_gid}"
|
50
|
+
path["{tag_gid}"] = tag_gid
|
51
|
+
parse(client.delete(path, options: options)).first
|
52
|
+
end
|
53
|
+
|
54
|
+
# Get a tag
|
55
|
+
#
|
56
|
+
# tag_gid - [str] (required) Globally unique identifier for the tag.
|
57
|
+
# options - [Hash] the request I/O options
|
58
|
+
# > 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.'
|
59
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
60
|
+
# > opt_fields - [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.
|
61
|
+
# > 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.
|
62
|
+
def get_tag(client, tag_gid: required("tag_gid"), options: {})
|
63
|
+
path = "/tags/{tag_gid}"
|
64
|
+
path["{tag_gid}"] = tag_gid
|
65
|
+
Tag.new(parse(client.get(path, options: options)).first, client: client)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Get multiple tags
|
69
|
+
#
|
70
|
+
|
71
|
+
# workspace - [str] The workspace to filter tags on.
|
72
|
+
# options - [Hash] the request I/O options
|
73
|
+
# > 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.'
|
74
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
75
|
+
# > opt_fields - [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.
|
76
|
+
# > 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.
|
77
|
+
def get_tags(client, workspace: nil, options: {})
|
78
|
+
path = "/tags"
|
79
|
+
params = { workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? }
|
80
|
+
Collection.new(parse(client.get(path, params: params, options: options)), type: Tag, client: client)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Get a task's tags
|
84
|
+
#
|
85
|
+
# task_gid - [str] (required) The task to operate on.
|
86
|
+
# options - [Hash] the request I/O options
|
87
|
+
# > 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.'
|
88
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
89
|
+
# > opt_fields - [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.
|
90
|
+
# > 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.
|
91
|
+
def get_tags_for_task(client, task_gid: required("task_gid"), options: {})
|
92
|
+
path = "/tasks/{task_gid}/tags"
|
93
|
+
path["{task_gid}"] = task_gid
|
94
|
+
Collection.new(parse(client.get(path, options: options)), type: Tag, client: client)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Get tags in a workspace
|
98
|
+
#
|
99
|
+
# workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
|
100
|
+
# options - [Hash] the request I/O options
|
101
|
+
# > 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.'
|
102
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
103
|
+
# > opt_fields - [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.
|
104
|
+
# > 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.
|
105
|
+
def get_tags_for_workspace(client, workspace_gid: required("workspace_gid"), options: {})
|
106
|
+
path = "/workspaces/{workspace_gid}/tags"
|
107
|
+
path["{workspace_gid}"] = workspace_gid
|
108
|
+
Collection.new(parse(client.get(path, options: options)), type: Tag, client: client)
|
109
|
+
end
|
110
|
+
|
111
|
+
# Update a tag
|
112
|
+
#
|
113
|
+
# tag_gid - [str] (required) Globally unique identifier for the tag.
|
114
|
+
# options - [Hash] the request I/O options
|
115
|
+
# > 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.'
|
116
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
117
|
+
# > opt_fields - [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.
|
118
|
+
# > 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.
|
119
|
+
# data - [Hash] the attributes to PUT
|
120
|
+
def update_tag(client, tag_gid: required("tag_gid"), options: {}, **data)
|
121
|
+
path = "/tags/{tag_gid}"
|
122
|
+
path["{tag_gid}"] = tag_gid
|
123
|
+
Tag.new(parse(client.put(path, body: data, options: options)).first, client: client)
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,425 @@
|
|
1
|
+
### WARNING: This file is auto-generated by our OpenAPI spec. Do not
|
2
|
+
### edit it manually.
|
3
|
+
|
4
|
+
require_relative '../../resource_includes/response_helper'
|
5
|
+
|
6
|
+
module Asana
|
7
|
+
module Resources
|
8
|
+
class TasksBase < Resource
|
9
|
+
|
10
|
+
def self.inherited(base)
|
11
|
+
Registry.register(base)
|
12
|
+
end
|
13
|
+
|
14
|
+
class << self
|
15
|
+
# Set dependencies for a task
|
16
|
+
#
|
17
|
+
# task_gid - [str] (required) The task to operate on.
|
18
|
+
# options - [Hash] the request I/O options
|
19
|
+
# > opt_fields - [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.
|
20
|
+
# > 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.
|
21
|
+
# data - [Hash] the attributes to POST
|
22
|
+
def add_dependencies_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
23
|
+
path = "/tasks/{task_gid}/addDependencies"
|
24
|
+
path["{task_gid}"] = task_gid
|
25
|
+
parse(client.post(path, body: data, options: options)).first
|
26
|
+
end
|
27
|
+
|
28
|
+
# Set dependents for a task
|
29
|
+
#
|
30
|
+
# task_gid - [str] (required) The task to operate on.
|
31
|
+
# options - [Hash] the request I/O options
|
32
|
+
# > opt_fields - [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.
|
33
|
+
# > 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.
|
34
|
+
# data - [Hash] the attributes to POST
|
35
|
+
def add_dependents_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
36
|
+
path = "/tasks/{task_gid}/addDependents"
|
37
|
+
path["{task_gid}"] = task_gid
|
38
|
+
Collection.new(parse(client.post(path, body: data, options: options)), type: Task, client: client)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Add followers to a task
|
42
|
+
#
|
43
|
+
# task_gid - [str] (required) The task to operate on.
|
44
|
+
# options - [Hash] the request I/O options
|
45
|
+
# > opt_fields - [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.
|
46
|
+
# > 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.
|
47
|
+
# data - [Hash] the attributes to POST
|
48
|
+
def add_followers_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
49
|
+
path = "/tasks/{task_gid}/addFollowers"
|
50
|
+
path["{task_gid}"] = task_gid
|
51
|
+
parse(client.post(path, body: data, options: options)).first
|
52
|
+
end
|
53
|
+
|
54
|
+
# Add a project to a task
|
55
|
+
#
|
56
|
+
# task_gid - [str] (required) The task to operate on.
|
57
|
+
# options - [Hash] the request I/O options
|
58
|
+
# > opt_fields - [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.
|
59
|
+
# > 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.
|
60
|
+
# data - [Hash] the attributes to POST
|
61
|
+
def add_project_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
62
|
+
path = "/tasks/{task_gid}/addProject"
|
63
|
+
path["{task_gid}"] = task_gid
|
64
|
+
parse(client.post(path, body: data, options: options)).first
|
65
|
+
end
|
66
|
+
|
67
|
+
# Add a tag to a task
|
68
|
+
#
|
69
|
+
# task_gid - [str] (required) The task to operate on.
|
70
|
+
# options - [Hash] the request I/O options
|
71
|
+
# > opt_fields - [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.
|
72
|
+
# > 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.
|
73
|
+
# data - [Hash] the attributes to POST
|
74
|
+
def add_tag_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
75
|
+
path = "/tasks/{task_gid}/addTag"
|
76
|
+
path["{task_gid}"] = task_gid
|
77
|
+
parse(client.post(path, body: data, options: options)).first
|
78
|
+
end
|
79
|
+
|
80
|
+
# Create a subtask
|
81
|
+
#
|
82
|
+
# task_gid - [str] (required) The task to operate on.
|
83
|
+
# options - [Hash] the request I/O options
|
84
|
+
# > opt_fields - [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.
|
85
|
+
# > 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.
|
86
|
+
# data - [Hash] the attributes to POST
|
87
|
+
def create_subtask_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
88
|
+
path = "/tasks/{task_gid}/subtasks"
|
89
|
+
path["{task_gid}"] = task_gid
|
90
|
+
Task.new(parse(client.post(path, body: data, options: options)).first, client: client)
|
91
|
+
end
|
92
|
+
|
93
|
+
# Create a task
|
94
|
+
#
|
95
|
+
|
96
|
+
# options - [Hash] the request I/O options
|
97
|
+
# > opt_fields - [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.
|
98
|
+
# > 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.
|
99
|
+
# data - [Hash] the attributes to POST
|
100
|
+
def create_task(client, options: {}, **data)
|
101
|
+
path = "/tasks"
|
102
|
+
Task.new(parse(client.post(path, body: data, options: options)).first, client: client)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Delete a task
|
106
|
+
#
|
107
|
+
# task_gid - [str] (required) The task to operate on.
|
108
|
+
# options - [Hash] the request I/O options
|
109
|
+
# > opt_fields - [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.
|
110
|
+
# > 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
|
+
def delete_task(client, task_gid: required("task_gid"), options: {})
|
112
|
+
path = "/tasks/{task_gid}"
|
113
|
+
path["{task_gid}"] = task_gid
|
114
|
+
parse(client.delete(path, options: options)).first
|
115
|
+
end
|
116
|
+
|
117
|
+
# Duplicate a task
|
118
|
+
#
|
119
|
+
# task_gid - [str] (required) The task to operate on.
|
120
|
+
# options - [Hash] the request I/O options
|
121
|
+
# > opt_fields - [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.
|
122
|
+
# > 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.
|
123
|
+
# data - [Hash] the attributes to POST
|
124
|
+
def duplicate_task(client, task_gid: required("task_gid"), options: {}, **data)
|
125
|
+
path = "/tasks/{task_gid}/duplicate"
|
126
|
+
path["{task_gid}"] = task_gid
|
127
|
+
Job.new(parse(client.post(path, body: data, options: options)).first, client: client)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Get dependencies from a task
|
131
|
+
#
|
132
|
+
# task_gid - [str] (required) The task to operate on.
|
133
|
+
# options - [Hash] the request I/O options
|
134
|
+
# > 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.'
|
135
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
136
|
+
# > opt_fields - [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.
|
137
|
+
# > 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
|
+
def get_dependencies_for_task(client, task_gid: required("task_gid"), options: {})
|
139
|
+
path = "/tasks/{task_gid}/dependencies"
|
140
|
+
path["{task_gid}"] = task_gid
|
141
|
+
Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
|
142
|
+
end
|
143
|
+
|
144
|
+
# Get dependents from a task
|
145
|
+
#
|
146
|
+
# task_gid - [str] (required) The task to operate on.
|
147
|
+
# options - [Hash] the request I/O options
|
148
|
+
# > 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.'
|
149
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
150
|
+
# > opt_fields - [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.
|
151
|
+
# > 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
|
+
def get_dependents_for_task(client, task_gid: required("task_gid"), options: {})
|
153
|
+
path = "/tasks/{task_gid}/dependents"
|
154
|
+
path["{task_gid}"] = task_gid
|
155
|
+
Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
|
156
|
+
end
|
157
|
+
|
158
|
+
# Get subtasks from a task
|
159
|
+
#
|
160
|
+
# task_gid - [str] (required) The task to operate on.
|
161
|
+
# options - [Hash] the request I/O options
|
162
|
+
# > 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.'
|
163
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
164
|
+
# > opt_fields - [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.
|
165
|
+
# > 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
|
+
def get_subtasks_for_task(client, task_gid: required("task_gid"), options: {})
|
167
|
+
path = "/tasks/{task_gid}/subtasks"
|
168
|
+
path["{task_gid}"] = task_gid
|
169
|
+
Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
|
170
|
+
end
|
171
|
+
|
172
|
+
# Get a task
|
173
|
+
#
|
174
|
+
# task_gid - [str] (required) The task to operate on.
|
175
|
+
# options - [Hash] the request I/O options
|
176
|
+
# > opt_fields - [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.
|
177
|
+
# > 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
|
+
def get_task(client, task_gid: required("task_gid"), options: {})
|
179
|
+
path = "/tasks/{task_gid}"
|
180
|
+
path["{task_gid}"] = task_gid
|
181
|
+
Task.new(parse(client.get(path, options: options)).first, client: client)
|
182
|
+
end
|
183
|
+
|
184
|
+
# Get multiple tasks
|
185
|
+
#
|
186
|
+
|
187
|
+
# assignee - [str] The assignee to filter tasks on. *Note: If you specify `assignee`, you must also specify the `workspace` to filter on.*
|
188
|
+
# project - [str] The project to filter tasks on.
|
189
|
+
# section - [str] The section to filter tasks on. *Note: Currently, this is only supported in board views.*
|
190
|
+
# workspace - [str] The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.*
|
191
|
+
# completed_since - [datetime] Only return tasks that are either incomplete or that have been completed since this time.
|
192
|
+
# modified_since - [datetime] 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.*
|
193
|
+
# options - [Hash] the request I/O options
|
194
|
+
# > 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.'
|
195
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
196
|
+
# > opt_fields - [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.
|
197
|
+
# > 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
|
+
def get_tasks(client, assignee: nil, project: nil, section: nil, workspace: nil, completed_since: nil, modified_since: nil, options: {})
|
199
|
+
path = "/tasks"
|
200
|
+
params = { assignee: assignee, project: project, section: section, workspace: workspace, completed_since: completed_since, modified_since: modified_since }.reject { |_,v| v.nil? || Array(v).empty? }
|
201
|
+
Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
|
202
|
+
end
|
203
|
+
|
204
|
+
# Get tasks from a project
|
205
|
+
#
|
206
|
+
# project_gid - [str] (required) Globally unique identifier for the project.
|
207
|
+
# options - [Hash] the request I/O options
|
208
|
+
# > 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.'
|
209
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
210
|
+
# > opt_fields - [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.
|
211
|
+
# > 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.
|
212
|
+
def get_tasks_for_project(client, project_gid: required("project_gid"), options: {})
|
213
|
+
path = "/projects/{project_gid}/tasks"
|
214
|
+
path["{project_gid}"] = project_gid
|
215
|
+
Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
|
216
|
+
end
|
217
|
+
|
218
|
+
# Get tasks from a section
|
219
|
+
#
|
220
|
+
# section_gid - [str] (required) The globally unique identifier for the section.
|
221
|
+
# options - [Hash] the request I/O options
|
222
|
+
# > 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.'
|
223
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
224
|
+
# > opt_fields - [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.
|
225
|
+
# > 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.
|
226
|
+
def get_tasks_for_section(client, section_gid: required("section_gid"), options: {})
|
227
|
+
path = "/sections/{section_gid}/tasks"
|
228
|
+
path["{section_gid}"] = section_gid
|
229
|
+
Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
|
230
|
+
end
|
231
|
+
|
232
|
+
# Get tasks from a tag
|
233
|
+
#
|
234
|
+
# tag_gid - [str] (required) Globally unique identifier for the tag.
|
235
|
+
# options - [Hash] the request I/O options
|
236
|
+
# > 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.'
|
237
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
238
|
+
# > opt_fields - [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.
|
239
|
+
# > 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.
|
240
|
+
def get_tasks_for_tag(client, tag_gid: required("tag_gid"), options: {})
|
241
|
+
path = "/tags/{tag_gid}/tasks"
|
242
|
+
path["{tag_gid}"] = tag_gid
|
243
|
+
Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
|
244
|
+
end
|
245
|
+
|
246
|
+
# Get tasks from a user task list
|
247
|
+
#
|
248
|
+
# user_task_list_gid - [str] (required) Globally unique identifier for the user task list.
|
249
|
+
# completed_since - [str] Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*.
|
250
|
+
# options - [Hash] the request I/O options
|
251
|
+
# > 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.'
|
252
|
+
# > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
|
253
|
+
# > opt_fields - [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.
|
254
|
+
# > 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.
|
255
|
+
def get_tasks_for_user_task_list(client, user_task_list_gid: required("user_task_list_gid"), completed_since: nil, options: {})
|
256
|
+
path = "/user_task_lists/{user_task_list_gid}/tasks"
|
257
|
+
path["{user_task_list_gid}"] = user_task_list_gid
|
258
|
+
params = { completed_since: completed_since }.reject { |_,v| v.nil? || Array(v).empty? }
|
259
|
+
Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
|
260
|
+
end
|
261
|
+
|
262
|
+
# Unlink dependencies from a task
|
263
|
+
#
|
264
|
+
# task_gid - [str] (required) The task to operate on.
|
265
|
+
# options - [Hash] the request I/O options
|
266
|
+
# > opt_fields - [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.
|
267
|
+
# > 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.
|
268
|
+
# data - [Hash] the attributes to POST
|
269
|
+
def remove_dependencies_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
270
|
+
path = "/tasks/{task_gid}/removeDependencies"
|
271
|
+
path["{task_gid}"] = task_gid
|
272
|
+
Collection.new(parse(client.post(path, body: data, options: options)), type: Resource, client: client)
|
273
|
+
end
|
274
|
+
|
275
|
+
# Unlink dependents from a task
|
276
|
+
#
|
277
|
+
# task_gid - [str] (required) The task to operate on.
|
278
|
+
# options - [Hash] the request I/O options
|
279
|
+
# > opt_fields - [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.
|
280
|
+
# > 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.
|
281
|
+
# data - [Hash] the attributes to POST
|
282
|
+
def remove_dependents_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
283
|
+
path = "/tasks/{task_gid}/removeDependents"
|
284
|
+
path["{task_gid}"] = task_gid
|
285
|
+
Collection.new(parse(client.post(path, body: data, options: options)), type: Resource, client: client)
|
286
|
+
end
|
287
|
+
|
288
|
+
# Remove followers from a task
|
289
|
+
#
|
290
|
+
# task_gid - [str] (required) The task to operate on.
|
291
|
+
# options - [Hash] the request I/O options
|
292
|
+
# > opt_fields - [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.
|
293
|
+
# > 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.
|
294
|
+
# data - [Hash] the attributes to POST
|
295
|
+
def remove_follower_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
296
|
+
path = "/tasks/{task_gid}/removeFollowers"
|
297
|
+
path["{task_gid}"] = task_gid
|
298
|
+
parse(client.post(path, body: data, options: options)).first
|
299
|
+
end
|
300
|
+
|
301
|
+
# Remove a project from a task
|
302
|
+
#
|
303
|
+
# task_gid - [str] (required) The task to operate on.
|
304
|
+
# options - [Hash] the request I/O options
|
305
|
+
# > opt_fields - [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.
|
306
|
+
# > 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.
|
307
|
+
# data - [Hash] the attributes to POST
|
308
|
+
def remove_project_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
309
|
+
path = "/tasks/{task_gid}/removeProject"
|
310
|
+
path["{task_gid}"] = task_gid
|
311
|
+
parse(client.post(path, body: data, options: options)).first
|
312
|
+
end
|
313
|
+
|
314
|
+
# Remove a tag from a task
|
315
|
+
#
|
316
|
+
# task_gid - [str] (required) The task to operate on.
|
317
|
+
# options - [Hash] the request I/O options
|
318
|
+
# > opt_fields - [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.
|
319
|
+
# > 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.
|
320
|
+
# data - [Hash] the attributes to POST
|
321
|
+
def remove_tag_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
322
|
+
path = "/tasks/{task_gid}/removeTag"
|
323
|
+
path["{task_gid}"] = task_gid
|
324
|
+
parse(client.post(path, body: data, options: options)).first
|
325
|
+
end
|
326
|
+
|
327
|
+
# Search tasks in a workspace
|
328
|
+
#
|
329
|
+
# workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
|
330
|
+
# text - [str] Performs full-text search on both task name and description
|
331
|
+
# resource_subtype - [str] Filters results by the task's resource_subtype
|
332
|
+
# assignee_any - [str] Comma-separated list of user identifiers
|
333
|
+
# assignee_not - [str] Comma-separated list of user identifiers
|
334
|
+
# assignee_status - [str] One of `inbox`, `today`, `upcoming`, or `later`
|
335
|
+
# portfolios_any - [str] Comma-separated list of portfolio IDs
|
336
|
+
# projects_any - [str] Comma-separated list of project IDs
|
337
|
+
# projects_not - [str] Comma-separated list of project IDs
|
338
|
+
# projects_all - [str] Comma-separated list of project IDs
|
339
|
+
# sections_any - [str] Comma-separated list of section or column IDs
|
340
|
+
# sections_not - [str] Comma-separated list of section or column IDs
|
341
|
+
# sections_all - [str] Comma-separated list of section or column IDs
|
342
|
+
# tags_any - [str] Comma-separated list of tag IDs
|
343
|
+
# tags_not - [str] Comma-separated list of tag IDs
|
344
|
+
# tags_all - [str] Comma-separated list of tag IDs
|
345
|
+
# teams_any - [str] Comma-separated list of team IDs
|
346
|
+
# followers_any - [str] Comma-separated list of user identifiers
|
347
|
+
# followers_not - [str] Comma-separated list of user identifiers
|
348
|
+
# created_by_any - [str] Comma-separated list of user identifiers
|
349
|
+
# created_by_not - [str] Comma-separated list of user identifiers
|
350
|
+
# assigned_by_any - [str] Comma-separated list of user identifiers
|
351
|
+
# assigned_by_not - [str] Comma-separated list of user identifiers
|
352
|
+
# liked_by_any - [str] Comma-separated list of user identifiers
|
353
|
+
# liked_by_not - [str] Comma-separated list of user identifiers
|
354
|
+
# commented_on_by_any - [str] Comma-separated list of user identifiers
|
355
|
+
# commented_on_by_not - [str] Comma-separated list of user identifiers
|
356
|
+
# due_on_before - [date] ISO 8601 date string
|
357
|
+
# due_on_after - [date] ISO 8601 date string
|
358
|
+
# due_on - [date] ISO 8601 date string or `null`
|
359
|
+
# due_at_before - [datetime] ISO 8601 datetime string
|
360
|
+
# due_at_after - [datetime] ISO 8601 datetime string
|
361
|
+
# start_on_before - [date] ISO 8601 date string
|
362
|
+
# start_on_after - [date] ISO 8601 date string
|
363
|
+
# start_on - [date] ISO 8601 date string or `null`
|
364
|
+
# created_on_before - [date] ISO 8601 date string
|
365
|
+
# created_on_after - [date] ISO 8601 date string
|
366
|
+
# created_on - [date] ISO 8601 date string or `null`
|
367
|
+
# created_at_before - [datetime] ISO 8601 datetime string
|
368
|
+
# created_at_after - [datetime] ISO 8601 datetime string
|
369
|
+
# completed_on_before - [date] ISO 8601 date string
|
370
|
+
# completed_on_after - [date] ISO 8601 date string
|
371
|
+
# completed_on - [date] ISO 8601 date string or `null`
|
372
|
+
# completed_at_before - [datetime] ISO 8601 datetime string
|
373
|
+
# completed_at_after - [datetime] ISO 8601 datetime string
|
374
|
+
# modified_on_before - [date] ISO 8601 date string
|
375
|
+
# modified_on_after - [date] ISO 8601 date string
|
376
|
+
# modified_on - [date] ISO 8601 date string or `null`
|
377
|
+
# modified_at_before - [datetime] ISO 8601 datetime string
|
378
|
+
# modified_at_after - [datetime] ISO 8601 datetime string
|
379
|
+
# is_blocking - [bool] Filter to incomplete tasks with dependents
|
380
|
+
# is_blocked - [bool] Filter to tasks with incomplete dependencies
|
381
|
+
# has_attachment - [bool] Filter to tasks with attachments
|
382
|
+
# completed - [bool] Filter to completed tasks
|
383
|
+
# is_subtask - [bool] Filter to subtasks
|
384
|
+
# sort_by - [str] One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at`
|
385
|
+
# sort_ascending - [bool] Default `false`
|
386
|
+
# options - [Hash] the request I/O options
|
387
|
+
# > opt_fields - [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.
|
388
|
+
# > 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.
|
389
|
+
def search_tasks_for_workspace(client, workspace_gid: required("workspace_gid"), text: nil, resource_subtype: nil, assignee_any: nil, assignee_not: nil, assignee_status: 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_any: nil, followers_not: nil, created_by_any: nil, created_by_not: nil, assigned_by_any: nil, assigned_by_not: nil, liked_by_any: nil, liked_by_not: nil, commented_on_by_any: 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: {})
|
390
|
+
path = "/workspaces/{workspace_gid}/tasks/search"
|
391
|
+
path["{workspace_gid}"] = workspace_gid
|
392
|
+
params = { text: text, resource_subtype: resource_subtype, "assignee.any": assignee_any, "assignee.not": assignee_not, assignee_status: assignee_status, "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.any": followers_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.any": liked_by_any, "liked_by.not": liked_by_not, "commented_on_by.any": commented_on_by_any, "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? }
|
393
|
+
Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
|
394
|
+
end
|
395
|
+
|
396
|
+
# Set the parent of a task
|
397
|
+
#
|
398
|
+
# task_gid - [str] (required) The task to operate on.
|
399
|
+
# options - [Hash] the request I/O options
|
400
|
+
# > opt_fields - [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.
|
401
|
+
# > 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.
|
402
|
+
# data - [Hash] the attributes to POST
|
403
|
+
def set_parent_for_task(client, task_gid: required("task_gid"), options: {}, **data)
|
404
|
+
path = "/tasks/{task_gid}/setParent"
|
405
|
+
path["{task_gid}"] = task_gid
|
406
|
+
Task.new(parse(client.post(path, body: data, options: options)).first, client: client)
|
407
|
+
end
|
408
|
+
|
409
|
+
# Update a task
|
410
|
+
#
|
411
|
+
# task_gid - [str] (required) The task to operate on.
|
412
|
+
# options - [Hash] the request I/O options
|
413
|
+
# > opt_fields - [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.
|
414
|
+
# > 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.
|
415
|
+
# data - [Hash] the attributes to PUT
|
416
|
+
def update_task(client, task_gid: required("task_gid"), options: {}, **data)
|
417
|
+
path = "/tasks/{task_gid}"
|
418
|
+
path["{task_gid}"] = task_gid
|
419
|
+
Task.new(parse(client.put(path, body: data, options: options)).first, client: client)
|
420
|
+
end
|
421
|
+
|
422
|
+
end
|
423
|
+
end
|
424
|
+
end
|
425
|
+
end
|