asana 0.10.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +24 -0
  3. data/.github/workflows/pubilsh-to-rubygem.yml +18 -0
  4. data/.github/workflows/publish-to-github-releases.yml +16 -0
  5. data/.gitignore +0 -1
  6. data/.ruby-version +1 -1
  7. data/Gemfile.lock +174 -0
  8. data/README.md +22 -9
  9. data/Rakefile +10 -14
  10. data/VERSION +1 -1
  11. data/asana.gemspec +3 -3
  12. data/examples/Gemfile.lock +2 -2
  13. data/lib/asana/http_client/error_handling.rb +11 -4
  14. data/lib/asana/resources/gen/attachments_base.rb +7 -6
  15. data/lib/asana/resources/gen/audit_log_api_base.rb +37 -0
  16. data/lib/asana/resources/gen/goals_base.rb +229 -0
  17. data/lib/asana/resources/gen/project_briefs_base.rb +68 -0
  18. data/lib/asana/resources/gen/project_templates_base.rb +73 -0
  19. data/lib/asana/resources/gen/projects_base.rb +13 -0
  20. data/lib/asana/resources/gen/status_updates_base.rb +72 -0
  21. data/lib/asana/resources/gen/tasks_base.rb +7 -9
  22. data/lib/asana/resources/gen/teams_base.rb +27 -13
  23. data/lib/asana/resources/gen/time_periods_base.rb +47 -0
  24. data/lib/asana/resources/gen/typeahead_base.rb +1 -1
  25. data/lib/asana/resources/gen/users_base.rb +3 -4
  26. data/lib/asana/resources/gen/webhooks_base.rb +13 -0
  27. data/lib/asana/resources/gen/workspaces_base.rb +1 -1
  28. data/lib/asana/resources/portfolio.rb +3 -3
  29. data/lib/asana/version.rb +1 -1
  30. data/package-lock.json +115 -0
  31. data/samples/attachments_sample.yaml +3 -3
  32. data/samples/audit_log_api_sample.yaml +11 -0
  33. data/samples/goals_sample.yaml +161 -0
  34. data/samples/project_briefs_sample.yaml +41 -0
  35. data/samples/project_templates_sample.yaml +41 -0
  36. data/samples/projects_sample.yaml +10 -0
  37. data/samples/status_updates_sample.yaml +41 -0
  38. data/samples/teams_sample.yaml +14 -4
  39. data/samples/time_periods_sample.yaml +21 -0
  40. data/samples/webhooks_sample.yaml +10 -0
  41. metadata +36 -14
  42. data/.travis.yml +0 -16
@@ -0,0 +1,229 @@
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 GoalsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Add a collaborator to a goal
16
+ #
17
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
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_followers(client, goal_gid: required("goal_gid"), options: {}, **data)
23
+ path = "/goals/{goal_gid}/addFollowers"
24
+ path["{goal_gid}"] = goal_gid
25
+ parse(client.post(path, body: data, options: options)).first
26
+ end
27
+
28
+ # Add a subgoal to a parent goal
29
+ #
30
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
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_subgoal(client, goal_gid: required("goal_gid"), options: {}, **data)
36
+ path = "/goals/{goal_gid}/addSubgoal"
37
+ path["{goal_gid}"] = goal_gid
38
+ parse(client.post(path, body: data, options: options)).first
39
+ end
40
+
41
+ # Add a project/portfolio as supporting work for a goal.
42
+ #
43
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
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_supporting_work_for_goal(client, goal_gid: required("goal_gid"), options: {}, **data)
49
+ path = "/goals/{goal_gid}/addSupportingWork"
50
+ path["{goal_gid}"] = goal_gid
51
+ parse(client.post(path, body: data, options: options)).first
52
+ end
53
+
54
+ # Create a goal
55
+ #
56
+
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
+ # data - [Hash] the attributes to POST
63
+ def create_goal(client, options: {}, **data)
64
+ path = "/goals"
65
+ parse(client.post(path, body: data, options: options)).first
66
+ end
67
+
68
+ # Create a goal metric
69
+ #
70
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
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 POST
75
+ def create_goal_metric(client, goal_gid: required("goal_gid"), options: {}, **data)
76
+ path = "/goals/{goal_gid}/setMetric"
77
+ path["{goal_gid}"] = goal_gid
78
+ parse(client.post(path, body: data, options: options)).first
79
+ end
80
+
81
+ # Delete a goal
82
+ #
83
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
84
+ # options - [Hash] the request I/O options
85
+ # > 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.
86
+ # > 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.
87
+ def delete_goal(client, goal_gid: required("goal_gid"), options: {})
88
+ path = "/goals/{goal_gid}"
89
+ path["{goal_gid}"] = goal_gid
90
+ parse(client.delete(path, options: options)).first
91
+ end
92
+
93
+ # Get a goal
94
+ #
95
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
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
+ def get_goal(client, goal_gid: required("goal_gid"), options: {})
100
+ path = "/goals/{goal_gid}"
101
+ path["{goal_gid}"] = goal_gid
102
+ parse(client.get(path, options: options)).first
103
+ end
104
+
105
+ # Get goals
106
+ #
107
+
108
+ # portfolio - [str] Globally unique identifier for supporting portfolio.
109
+ # project - [str] Globally unique identifier for supporting project.
110
+ # is_workspace_level - [bool] Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter.
111
+ # team - [str] Globally unique identifier for the team.
112
+ # workspace - [str] Globally unique identifier for the workspace.
113
+ # time_periods - [list[str]] Globally unique identifiers for the time periods.
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
+ def get_goals(client, portfolio: nil, project: nil, is_workspace_level: nil, team: nil, workspace: nil, time_periods: nil, options: {})
120
+ path = "/goals"
121
+ params = { portfolio: portfolio, project: project, is_workspace_level: is_workspace_level, team: team, workspace: workspace, time_periods: time_periods }.reject { |_,v| v.nil? || Array(v).empty? }
122
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
123
+ end
124
+
125
+ # Get parent goals from a goal
126
+ #
127
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
128
+ # options - [Hash] the request I/O options
129
+ # > 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.
130
+ # > 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.
131
+ def get_parent_goals_for_goal(client, goal_gid: required("goal_gid"), options: {})
132
+ path = "/goals/{goal_gid}/parentGoals"
133
+ path["{goal_gid}"] = goal_gid
134
+ Collection.new(parse(client.get(path, options: options)), type: Resource, client: client)
135
+ end
136
+
137
+ # Get subgoals from a goal
138
+ #
139
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
140
+ # options - [Hash] the request I/O options
141
+ # > 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.
142
+ # > 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.
143
+ def get_subgoals_for_goal(client, goal_gid: required("goal_gid"), options: {})
144
+ path = "/goals/{goal_gid}/subgoals"
145
+ path["{goal_gid}"] = goal_gid
146
+ Collection.new(parse(client.get(path, options: options)), type: Resource, client: client)
147
+ end
148
+
149
+ # Remove a collaborator from a goal
150
+ #
151
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
152
+ # options - [Hash] the request I/O options
153
+ # > 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.
154
+ # > 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.
155
+ # data - [Hash] the attributes to POST
156
+ def remove_followers(client, goal_gid: required("goal_gid"), options: {}, **data)
157
+ path = "/goals/{goal_gid}/removeFollowers"
158
+ path["{goal_gid}"] = goal_gid
159
+ parse(client.post(path, body: data, options: options)).first
160
+ end
161
+
162
+ # Remove a subgoal from a goal
163
+ #
164
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
165
+ # options - [Hash] the request I/O options
166
+ # > 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.
167
+ # > 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.
168
+ # data - [Hash] the attributes to POST
169
+ def remove_subgoal(client, goal_gid: required("goal_gid"), options: {}, **data)
170
+ path = "/goals/{goal_gid}/removeSubgoal"
171
+ path["{goal_gid}"] = goal_gid
172
+ parse(client.post(path, body: data, options: options)).first
173
+ end
174
+
175
+ # Remove a project/portfolio as supporting work for a goal.
176
+ #
177
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
178
+ # options - [Hash] the request I/O options
179
+ # > 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.
180
+ # > 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.
181
+ # data - [Hash] the attributes to POST
182
+ def remove_supporting_work_for_goal(client, goal_gid: required("goal_gid"), options: {}, **data)
183
+ path = "/goals/{goal_gid}/removeSupportingWork"
184
+ path["{goal_gid}"] = goal_gid
185
+ parse(client.post(path, body: data, options: options)).first
186
+ end
187
+
188
+ # Get supporting work from a goal
189
+ #
190
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
191
+ # options - [Hash] the request I/O options
192
+ # > 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.
193
+ # > 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.
194
+ def supporting_work(client, goal_gid: required("goal_gid"), options: {})
195
+ path = "/goals/{goal_gid}/supportingWork"
196
+ path["{goal_gid}"] = goal_gid
197
+ Collection.new(parse(client.get(path, options: options)), type: Project, client: client)
198
+ end
199
+
200
+ # Update a goal
201
+ #
202
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
203
+ # options - [Hash] the request I/O options
204
+ # > 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.
205
+ # > 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.
206
+ # data - [Hash] the attributes to PUT
207
+ def update_goal(client, goal_gid: required("goal_gid"), options: {}, **data)
208
+ path = "/goals/{goal_gid}"
209
+ path["{goal_gid}"] = goal_gid
210
+ parse(client.put(path, body: data, options: options)).first
211
+ end
212
+
213
+ # Update a goal metric
214
+ #
215
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
216
+ # options - [Hash] the request I/O options
217
+ # > 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.
218
+ # > 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.
219
+ # data - [Hash] the attributes to POST
220
+ def update_goal_metric(client, goal_gid: required("goal_gid"), options: {}, **data)
221
+ path = "/goals/{goal_gid}/setMetricCurrentValue"
222
+ path["{goal_gid}"] = goal_gid
223
+ parse(client.post(path, body: data, options: options)).first
224
+ end
225
+
226
+ end
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,68 @@
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 ProjectBriefsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Create a project brief
16
+ #
17
+ # project_gid - [str] (required) Globally unique identifier for the project.
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_project_brief(client, project_gid: required("project_gid"), options: {}, **data)
23
+ path = "/projects/{project_gid}/project_briefs"
24
+ path["{project_gid}"] = project_gid
25
+ parse(client.post(path, body: data, options: options)).first
26
+ end
27
+
28
+ # Delete a project brief
29
+ #
30
+ # project_brief_gid - [str] (required) Globally unique identifier for the project brief.
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_project_brief(client, project_brief_gid: required("project_brief_gid"), options: {})
35
+ path = "/project_briefs/{project_brief_gid}"
36
+ path["{project_brief_gid}"] = project_brief_gid
37
+ parse(client.delete(path, options: options)).first
38
+ end
39
+
40
+ # Get a project brief
41
+ #
42
+ # project_brief_gid - [str] (required) Globally unique identifier for the project brief.
43
+ # options - [Hash] the request I/O options
44
+ # > 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.
45
+ # > 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.
46
+ def get_project_brief(client, project_brief_gid: required("project_brief_gid"), options: {})
47
+ path = "/project_briefs/{project_brief_gid}"
48
+ path["{project_brief_gid}"] = project_brief_gid
49
+ parse(client.get(path, options: options)).first
50
+ end
51
+
52
+ # Update a project brief
53
+ #
54
+ # project_brief_gid - [str] (required) Globally unique identifier for the project brief.
55
+ # options - [Hash] the request I/O options
56
+ # > 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.
57
+ # > 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.
58
+ # data - [Hash] the attributes to PUT
59
+ def update_project_brief(client, project_brief_gid: required("project_brief_gid"), options: {}, **data)
60
+ path = "/project_briefs/{project_brief_gid}"
61
+ path["{project_brief_gid}"] = project_brief_gid
62
+ parse(client.put(path, body: data, options: options)).first
63
+ end
64
+
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,73 @@
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 ProjectTemplatesBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Get a project template
16
+ #
17
+ # project_template_gid - [str] (required) Globally unique identifier for the project template.
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
+ def get_project_template(client, project_template_gid: required("project_template_gid"), options: {})
22
+ path = "/project_templates/{project_template_gid}"
23
+ path["{project_template_gid}"] = project_template_gid
24
+ parse(client.get(path, options: options)).first
25
+ end
26
+
27
+ # Get multiple project templates
28
+ #
29
+
30
+ # workspace - [str] The workspace to filter results on.
31
+ # team - [str] The team to filter projects on.
32
+ # options - [Hash] the request I/O options
33
+ # > 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.'
34
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
35
+ # > 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.
36
+ # > 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.
37
+ def get_project_templates(client, workspace: nil, team: nil, options: {})
38
+ path = "/project_templates"
39
+ params = { workspace: workspace, team: team }.reject { |_,v| v.nil? || Array(v).empty? }
40
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
41
+ end
42
+
43
+ # Get a team's project templates
44
+ #
45
+ # team_gid - [str] (required) Globally unique identifier for the team.
46
+ # options - [Hash] the request I/O options
47
+ # > 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.'
48
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
49
+ # > 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.
50
+ # > 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.
51
+ def get_project_templates_for_team(client, team_gid: required("team_gid"), options: {})
52
+ path = "/teams/{team_gid}/project_templates"
53
+ path["{team_gid}"] = team_gid
54
+ Collection.new(parse(client.get(path, options: options)), type: Resource, client: client)
55
+ end
56
+
57
+ # Instantiate a project from a project template
58
+ #
59
+ # project_template_gid - [str] (required) Globally unique identifier for the project template.
60
+ # options - [Hash] the request I/O options
61
+ # > 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.
62
+ # > 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.
63
+ # data - [Hash] the attributes to POST
64
+ def instantiate_project(client, project_template_gid: required("project_template_gid"), options: {}, **data)
65
+ path = "/project_templates/{project_template_gid}/instantiateProject"
66
+ path["{project_template_gid}"] = project_template_gid
67
+ Job.new(parse(client.post(path, body: data, options: options)).first, client: client)
68
+ end
69
+
70
+ end
71
+ end
72
+ end
73
+ end
@@ -202,6 +202,19 @@ module Asana
202
202
  parse(client.get(path, options: options)).first
203
203
  end
204
204
 
205
+ # Create a project template from a project
206
+ #
207
+ # project_gid - [str] (required) Globally unique identifier for the project.
208
+ # options - [Hash] the request I/O options
209
+ # > 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.
210
+ # > 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.
211
+ # data - [Hash] the attributes to POST
212
+ def project_save_as_template(client, project_gid: required("project_gid"), options: {}, **data)
213
+ path = "/projects/{project_gid}/saveAsTemplate"
214
+ path["{project_gid}"] = project_gid
215
+ Job.new(parse(client.post(path, body: data, options: options)).first, client: client)
216
+ end
217
+
205
218
  # Remove a custom field from a project
206
219
  #
207
220
  # project_gid - [str] (required) Globally unique identifier for the project.
@@ -0,0 +1,72 @@
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 StatusUpdatesBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Create a status update
16
+ #
17
+
18
+ # options - [Hash] the request I/O options
19
+ # > 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.'
20
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
21
+ # > 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.
22
+ # > 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.
23
+ # data - [Hash] the attributes to POST
24
+ def create_status_for_object(client, options: {}, **data)
25
+ path = "/status_updates"
26
+ parse(client.post(path, body: data, options: options)).first
27
+ end
28
+
29
+ # Delete a status update
30
+ #
31
+ # status_gid - [str] (required) The status update to get.
32
+ # options - [Hash] the request I/O options
33
+ # > 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.
34
+ # > 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.
35
+ def delete_status(client, status_gid: required("status_gid"), options: {})
36
+ path = "/status_updates/{status_gid}"
37
+ path["{status_gid}"] = status_gid
38
+ parse(client.delete(path, options: options)).first
39
+ end
40
+
41
+ # Get a status update
42
+ #
43
+ # status_gid - [str] (required) The status update to get.
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
+ def get_status(client, status_gid: required("status_gid"), options: {})
48
+ path = "/status_updates/{status_gid}"
49
+ path["{status_gid}"] = status_gid
50
+ parse(client.get(path, options: options)).first
51
+ end
52
+
53
+ # Get status updates from an object
54
+ #
55
+
56
+ # parent - [str] (required) Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal.
57
+ # created_since - [datetime] Only return statuses that have been created since the given time.
58
+ # options - [Hash] the request I/O options
59
+ # > 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.'
60
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
61
+ # > 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.
62
+ # > 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.
63
+ def get_statuses_for_object(client, parent: nil, created_since: nil, options: {})
64
+ path = "/status_updates"
65
+ params = { parent: parent, created_since: created_since }.reject { |_,v| v.nil? || Array(v).empty? }
66
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
67
+ end
68
+
69
+ end
70
+ end
71
+ end
72
+ end
@@ -184,7 +184,7 @@ module Asana
184
184
  # Get multiple tasks
185
185
  #
186
186
 
187
- # assignee - [str] The assignee to filter tasks on. *Note: If you specify `assignee`, you must also specify the `workspace` to filter on.*
187
+ # 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.*
188
188
  # project - [str] The project to filter tasks on.
189
189
  # section - [str] The section to filter tasks on. *Note: Currently, this is only supported in board views.*
190
190
  # workspace - [str] The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.*
@@ -204,15 +204,17 @@ module Asana
204
204
  # Get tasks from a project
205
205
  #
206
206
  # project_gid - [str] (required) Globally unique identifier for the project.
207
+ # 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*.
207
208
  # options - [Hash] the request I/O options
208
209
  # > 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
210
  # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
210
211
  # > 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
212
  # > 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
+ def get_tasks_for_project(client, project_gid: required("project_gid"), completed_since: nil, options: {})
213
214
  path = "/projects/{project_gid}/tasks"
214
215
  path["{project_gid}"] = project_gid
215
- Collection.new(parse(client.get(path, options: options)), type: Task, client: client)
216
+ params = { completed_since: completed_since }.reject { |_,v| v.nil? || Array(v).empty? }
217
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
216
218
  end
217
219
 
218
220
  # Get tasks from a section
@@ -331,7 +333,6 @@ module Asana
331
333
  # resource_subtype - [str] Filters results by the task's resource_subtype
332
334
  # assignee_any - [str] Comma-separated list of user identifiers
333
335
  # assignee_not - [str] Comma-separated list of user identifiers
334
- # assignee_status - [str] One of `inbox`, `today`, `upcoming`, or `later`
335
336
  # portfolios_any - [str] Comma-separated list of portfolio IDs
336
337
  # projects_any - [str] Comma-separated list of project IDs
337
338
  # projects_not - [str] Comma-separated list of project IDs
@@ -343,15 +344,12 @@ module Asana
343
344
  # tags_not - [str] Comma-separated list of tag IDs
344
345
  # tags_all - [str] Comma-separated list of tag IDs
345
346
  # teams_any - [str] Comma-separated list of team IDs
346
- # followers_any - [str] Comma-separated list of user identifiers
347
347
  # followers_not - [str] Comma-separated list of user identifiers
348
348
  # created_by_any - [str] Comma-separated list of user identifiers
349
349
  # created_by_not - [str] Comma-separated list of user identifiers
350
350
  # assigned_by_any - [str] Comma-separated list of user identifiers
351
351
  # assigned_by_not - [str] Comma-separated list of user identifiers
352
- # liked_by_any - [str] Comma-separated list of user identifiers
353
352
  # liked_by_not - [str] Comma-separated list of user identifiers
354
- # commented_on_by_any - [str] Comma-separated list of user identifiers
355
353
  # commented_on_by_not - [str] Comma-separated list of user identifiers
356
354
  # due_on_before - [date] ISO 8601 date string
357
355
  # due_on_after - [date] ISO 8601 date string
@@ -386,10 +384,10 @@ module Asana
386
384
  # options - [Hash] the request I/O options
387
385
  # > 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
386
  # > 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: {})
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: {})
390
388
  path = "/workspaces/{workspace_gid}/tasks/search"
391
389
  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? }
390
+ 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? }
393
391
  Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
394
392
  end
395
393