asana 0.10.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) 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/.swagger-codegen-ignore +0 -1
  8. data/Appraisals +2 -35
  9. data/Gemfile +2 -0
  10. data/Gemfile.lock +174 -0
  11. data/README.md +23 -58
  12. data/Rakefile +10 -14
  13. data/VERSION +1 -0
  14. data/asana.gemspec +5 -5
  15. data/examples/Gemfile.lock +10 -10
  16. data/lib/asana/client.rb +10 -10
  17. data/lib/asana/http_client/error_handling.rb +11 -4
  18. data/lib/asana/resource_includes/attachment_uploading.rb +14 -7
  19. data/lib/asana/resources/gen/attachments_base.rb +7 -6
  20. data/lib/asana/resources/gen/audit_log_api_base.rb +37 -0
  21. data/lib/asana/resources/gen/goals_base.rb +229 -0
  22. data/lib/asana/resources/gen/project_briefs_base.rb +68 -0
  23. data/lib/asana/resources/gen/project_templates_base.rb +73 -0
  24. data/lib/asana/resources/gen/projects_base.rb +14 -1
  25. data/lib/asana/resources/gen/status_updates_base.rb +72 -0
  26. data/lib/asana/resources/gen/tags_base.rb +16 -3
  27. data/lib/asana/resources/gen/tasks_base.rb +9 -10
  28. data/lib/asana/resources/gen/teams_base.rb +27 -13
  29. data/lib/asana/resources/gen/time_periods_base.rb +47 -0
  30. data/lib/asana/resources/gen/typeahead_base.rb +1 -1
  31. data/lib/asana/resources/gen/users_base.rb +3 -4
  32. data/lib/asana/resources/gen/webhooks_base.rb +13 -0
  33. data/lib/asana/resources/gen/workspaces_base.rb +1 -1
  34. data/lib/asana/resources/portfolio.rb +3 -3
  35. data/lib/asana/version.rb +1 -1
  36. data/package-lock.json +115 -0
  37. data/samples/attachments_sample.yaml +41 -0
  38. data/samples/audit_log_api_sample.yaml +11 -0
  39. data/samples/batch_api_sample.yaml +11 -0
  40. data/samples/custom_field_settings_sample.yaml +21 -0
  41. data/samples/custom_fields_sample.yaml +81 -0
  42. data/samples/events_sample.yaml +11 -0
  43. data/samples/goals_sample.yaml +161 -0
  44. data/samples/jobs_sample.yaml +11 -0
  45. data/samples/organization_exports_sample.yaml +21 -0
  46. data/samples/portfolio_memberships_sample.yaml +31 -0
  47. data/samples/portfolios_sample.yaml +121 -0
  48. data/samples/project_briefs_sample.yaml +41 -0
  49. data/samples/project_memberships_sample.yaml +21 -0
  50. data/samples/project_statuses_sample.yaml +41 -0
  51. data/samples/project_templates_sample.yaml +41 -0
  52. data/samples/projects_sample.yaml +191 -0
  53. data/samples/sections_sample.yaml +71 -0
  54. data/samples/status_updates_sample.yaml +41 -0
  55. data/samples/stories_sample.yaml +51 -0
  56. data/samples/tags_sample.yaml +81 -0
  57. data/samples/tasks_sample.yaml +261 -0
  58. data/samples/team_memberships_sample.yaml +41 -0
  59. data/samples/teams_sample.yaml +61 -0
  60. data/samples/time_periods_sample.yaml +21 -0
  61. data/samples/typeahead_sample.yaml +11 -0
  62. data/samples/user_task_lists_sample.yaml +21 -0
  63. data/samples/users_sample.yaml +51 -0
  64. data/samples/webhooks_sample.yaml +51 -0
  65. data/samples/workspace_memberships_sample.yaml +31 -0
  66. data/samples/workspaces_sample.yaml +51 -0
  67. data/swagger_templates/api.mustache +1 -1
  68. data/swagger_templates/api_doc.mustache +12 -0
  69. data/swagger_templates/ruby-config.json +1 -2
  70. metadata +62 -15
  71. data/.travis.yml +0 -15
@@ -37,6 +37,20 @@ module Asana
37
37
  Tag.new(parse(client.post(path, body: data, options: options)).first, client: client)
38
38
  end
39
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
+
40
54
  # Get a tag
41
55
  #
42
56
  # tag_gid - [str] (required) Globally unique identifier for the tag.
@@ -55,15 +69,14 @@ module Asana
55
69
  #
56
70
 
57
71
  # workspace - [str] The workspace to filter tags on.
58
- # archived - [bool] Only return tags whose `archived` field takes on the value of this parameter.
59
72
  # options - [Hash] the request I/O options
60
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.'
61
74
  # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
62
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.
63
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.
64
- def get_tags(client, workspace: nil, archived: nil, options: {})
77
+ def get_tags(client, workspace: nil, options: {})
65
78
  path = "/tags"
66
- params = { workspace: workspace, archived: archived }.reject { |_,v| v.nil? || Array(v).empty? }
79
+ params = { workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? }
67
80
  Collection.new(parse(client.get(path, params: params, options: options)), type: Tag, client: client)
68
81
  end
69
82
 
@@ -22,7 +22,7 @@ module Asana
22
22
  def add_dependencies_for_task(client, task_gid: required("task_gid"), options: {}, **data)
23
23
  path = "/tasks/{task_gid}/addDependencies"
24
24
  path["{task_gid}"] = task_gid
25
- Collection.new(parse(client.post(path, body: data, options: options)), type: Task, client: client)
25
+ parse(client.post(path, body: data, options: options)).first
26
26
  end
27
27
 
28
28
  # Set dependents for a task
@@ -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,7 @@ 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`
336
+ # portfolios_any - [str] Comma-separated list of portfolio IDs
335
337
  # projects_any - [str] Comma-separated list of project IDs
336
338
  # projects_not - [str] Comma-separated list of project IDs
337
339
  # projects_all - [str] Comma-separated list of project IDs
@@ -342,15 +344,12 @@ module Asana
342
344
  # tags_not - [str] Comma-separated list of tag IDs
343
345
  # tags_all - [str] Comma-separated list of tag IDs
344
346
  # teams_any - [str] Comma-separated list of team IDs
345
- # followers_any - [str] Comma-separated list of user identifiers
346
347
  # followers_not - [str] Comma-separated list of user identifiers
347
348
  # created_by_any - [str] Comma-separated list of user identifiers
348
349
  # created_by_not - [str] Comma-separated list of user identifiers
349
350
  # assigned_by_any - [str] Comma-separated list of user identifiers
350
351
  # assigned_by_not - [str] Comma-separated list of user identifiers
351
- # liked_by_any - [str] Comma-separated list of user identifiers
352
352
  # liked_by_not - [str] Comma-separated list of user identifiers
353
- # commented_on_by_any - [str] Comma-separated list of user identifiers
354
353
  # commented_on_by_not - [str] Comma-separated list of user identifiers
355
354
  # due_on_before - [date] ISO 8601 date string
356
355
  # due_on_after - [date] ISO 8601 date string
@@ -385,10 +384,10 @@ module Asana
385
384
  # options - [Hash] the request I/O options
386
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.
387
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.
388
- 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, 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: {})
389
388
  path = "/workspaces/{workspace_gid}/tasks/search"
390
389
  path["{workspace_gid}"] = workspace_gid
391
- params = { text: text, resource_subtype: resource_subtype, assignee_any: assignee_any, assignee_not: assignee_not, assignee_status: assignee_status, 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? }
392
391
  Collection.new(parse(client.get(path, params: params, options: options)), type: Task, client: client)
393
392
  end
394
393
 
@@ -22,35 +22,35 @@ module Asana
22
22
  def add_user_for_team(client, team_gid: required("team_gid"), options: {}, **data)
23
23
  path = "/teams/{team_gid}/addUser"
24
24
  path["{team_gid}"] = team_gid
25
- User.new(parse(client.post(path, body: data, options: options)).first, client: client)
25
+ parse(client.post(path, body: data, options: options)).first
26
26
  end
27
27
 
28
- # Get a team
28
+ # Create a team
29
29
  #
30
- # team_gid - [str] (required) Globally unique identifier for the team.
30
+
31
31
  # options - [Hash] the request I/O options
32
32
  # > 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.'
33
33
  # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
34
34
  # > 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.
35
35
  # > 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.
36
- def get_team(client, team_gid: required("team_gid"), options: {})
37
- path = "/teams/{team_gid}"
38
- path["{team_gid}"] = team_gid
39
- Team.new(parse(client.get(path, options: options)).first, client: client)
36
+ # data - [Hash] the attributes to POST
37
+ def create_team(client, options: {}, **data)
38
+ path = "/teams"
39
+ Team.new(parse(client.post(path, body: data, options: options)).first, client: client)
40
40
  end
41
41
 
42
- # Get teams in an organization
42
+ # Get a team
43
43
  #
44
- # workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
44
+ # team_gid - [str] (required) Globally unique identifier for the team.
45
45
  # options - [Hash] the request I/O options
46
46
  # > 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.'
47
47
  # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
48
48
  # > 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.
49
49
  # > 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.
50
- def get_teams_for_organization(client, workspace_gid: required("workspace_gid"), options: {})
51
- path = "/organizations/{workspace_gid}/teams"
52
- path["{workspace_gid}"] = workspace_gid
53
- Collection.new(parse(client.get(path, options: options)), type: Team, client: client)
50
+ def get_team(client, team_gid: required("team_gid"), options: {})
51
+ path = "/teams/{team_gid}"
52
+ path["{team_gid}"] = team_gid
53
+ Team.new(parse(client.get(path, options: options)).first, client: client)
54
54
  end
55
55
 
56
56
  # Get teams for a user
@@ -69,6 +69,20 @@ module Asana
69
69
  Collection.new(parse(client.get(path, params: params, options: options)), type: Team, client: client)
70
70
  end
71
71
 
72
+ # Get teams in a workspace
73
+ #
74
+ # workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
75
+ # options - [Hash] the request I/O options
76
+ # > 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.'
77
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
78
+ # > 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.
79
+ # > 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.
80
+ def get_teams_for_workspace(client, workspace_gid: required("workspace_gid"), options: {})
81
+ path = "/workspaces/{workspace_gid}/teams"
82
+ path["{workspace_gid}"] = workspace_gid
83
+ Collection.new(parse(client.get(path, options: options)), type: Team, client: client)
84
+ end
85
+
72
86
  # Remove a user from a team
73
87
  #
74
88
  # team_gid - [str] (required) Globally unique identifier for the team.
@@ -0,0 +1,47 @@
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 TimePeriodsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Get a time period
16
+ #
17
+ # time_period_gid - [str] (required) Globally unique identifier for the time period.
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_time_period(client, time_period_gid: required("time_period_gid"), options: {})
22
+ path = "/time_periods/{time_period_gid}"
23
+ path["{time_period_gid}"] = time_period_gid
24
+ parse(client.get(path, options: options)).first
25
+ end
26
+
27
+ # Get time periods
28
+ #
29
+
30
+ # start_on - [date] ISO 8601 date string
31
+ # end_on - [date] ISO 8601 date string
32
+ # workspace - [str] (required) Globally unique identifier for the workspace.
33
+ # options - [Hash] the request I/O options
34
+ # > 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.'
35
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
36
+ # > 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.
37
+ # > 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.
38
+ def get_time_periods(client, start_on: nil, end_on: nil, workspace: nil, options: {})
39
+ path = "/time_periods"
40
+ params = { start_on: start_on, end_on: end_on, workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? }
41
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -15,7 +15,7 @@ module Asana
15
15
  # Get objects via typeahead
16
16
  #
17
17
  # workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
18
- # resource_type - [str] (required) The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported.
18
+ # resource_type - [str] (required) The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported.
19
19
  # type - [str] *Deprecated: new integrations should prefer the resource_type field.*
20
20
  # query - [str] The string that will be used to search for relevant objects. If an empty string is passed in, the API will currently return an empty result set.
21
21
  # count - [int] The number of results to return. The default is 20 if this parameter is omitted, with a minimum of 1 and a maximum of 100. If there are fewer results found than requested, all will be returned.
@@ -43,14 +43,15 @@ module Asana
43
43
  #
44
44
 
45
45
  # workspace - [str] The workspace or organization ID to filter users on.
46
+ # team - [str] The team ID to filter users on.
46
47
  # options - [Hash] the request I/O options
47
48
  # > 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
49
  # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
49
50
  # > 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
51
  # > 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_users(client, workspace: nil, options: {})
52
+ def get_users(client, workspace: nil, team: nil, options: {})
52
53
  path = "/users"
53
- params = { workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? }
54
+ params = { workspace: workspace, team: team }.reject { |_,v| v.nil? || Array(v).empty? }
54
55
  Collection.new(parse(client.get(path, params: params, options: options)), type: User, client: client)
55
56
  end
56
57
 
@@ -59,7 +60,6 @@ module Asana
59
60
  # team_gid - [str] (required) Globally unique identifier for the team.
60
61
  # options - [Hash] the request I/O options
61
62
  # > 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.'
62
- # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
63
63
  # > 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.
64
64
  # > 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.
65
65
  def get_users_for_team(client, team_gid: required("team_gid"), options: {})
@@ -73,7 +73,6 @@ module Asana
73
73
  # workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
74
74
  # options - [Hash] the request I/O options
75
75
  # > 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.'
76
- # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
77
76
  # > 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.
78
77
  # > 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.
79
78
  def get_users_for_workspace(client, workspace_gid: required("workspace_gid"), options: {})
@@ -64,6 +64,19 @@ module Asana
64
64
  Collection.new(parse(client.get(path, params: params, options: options)), type: Webhook, client: client)
65
65
  end
66
66
 
67
+ # Update a webhook
68
+ #
69
+ # webhook_gid - [str] (required) Globally unique identifier for the webhook.
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 PUT
74
+ def update_webhook(client, webhook_gid: required("webhook_gid"), options: {}, **data)
75
+ path = "/webhooks/{webhook_gid}"
76
+ path["{webhook_gid}"] = webhook_gid
77
+ Webhook.new(parse(client.put(path, body: data, options: options)).first, client: client)
78
+ end
79
+
67
80
  end
68
81
  end
69
82
  end
@@ -22,7 +22,7 @@ module Asana
22
22
  def add_user_for_workspace(client, workspace_gid: required("workspace_gid"), options: {}, **data)
23
23
  path = "/workspaces/{workspace_gid}/addUser"
24
24
  path["{workspace_gid}"] = workspace_gid
25
- User.new(parse(client.post(path, body: data, options: options)).first, client: client)
25
+ parse(client.post(path, body: data, options: options)).first
26
26
  end
27
27
 
28
28
  # Get a workspace
@@ -107,7 +107,7 @@ module Asana
107
107
  # options - [Hash] the request I/O options.
108
108
  def get_items(options: {})
109
109
 
110
- Collection.new(parse(client.get("/portfolios/#{gid}/items", options: options)), type: self, client: client)
110
+ Collection.new(parse(client.get("/portfolios/#{gid}/items", options: options)), type: Resource, client: client)
111
111
  end
112
112
 
113
113
  # Add an item to a portfolio.
@@ -165,7 +165,7 @@ module Asana
165
165
  # options - [Hash] the request I/O options.
166
166
  def custom_field_settings(options: {})
167
167
 
168
- Collection.new(parse(client.get("/portfolios/#{gid}/custom_field_settings", options: options)), type: self, client: client)
168
+ Collection.new(parse(client.get("/portfolios/#{gid}/custom_field_settings", options: options)), type: CustomFieldSetting, client: client)
169
169
  end
170
170
 
171
171
  # Create a new custom field setting on the portfolio. Returns the full
@@ -200,4 +200,4 @@ module Asana
200
200
 
201
201
  end
202
202
  end
203
- end
203
+ end
data/lib/asana/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #:nodoc:
2
2
  module Asana
3
3
  # Public: Version of the gem.
4
- VERSION = '0.10.0'
4
+ VERSION = '1.0.0'
5
5
  end
data/package-lock.json ADDED
@@ -0,0 +1,115 @@
1
+ {
2
+ "name": "ruby-asana",
3
+ "lockfileVersion": 2,
4
+ "requires": true,
5
+ "packages": {
6
+ "": {
7
+ "devDependencies": {
8
+ "inflect": "^0.3.0",
9
+ "js-yaml": "^3.2.5",
10
+ "lodash": "^4.17.13"
11
+ }
12
+ },
13
+ "node_modules/argparse": {
14
+ "version": "1.0.10",
15
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
16
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
17
+ "dev": true,
18
+ "dependencies": {
19
+ "sprintf-js": "~1.0.2"
20
+ }
21
+ },
22
+ "node_modules/esprima": {
23
+ "version": "4.0.1",
24
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
25
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
26
+ "dev": true,
27
+ "bin": {
28
+ "esparse": "bin/esparse.js",
29
+ "esvalidate": "bin/esvalidate.js"
30
+ },
31
+ "engines": {
32
+ "node": ">=4"
33
+ }
34
+ },
35
+ "node_modules/inflect": {
36
+ "version": "0.3.0",
37
+ "resolved": "https://registry.npmjs.org/inflect/-/inflect-0.3.0.tgz",
38
+ "integrity": "sha1-gdDqqja1CmAjC3UQBIs5xBQv5So=",
39
+ "dev": true,
40
+ "engines": {
41
+ "node": ">=0.4"
42
+ }
43
+ },
44
+ "node_modules/js-yaml": {
45
+ "version": "3.14.1",
46
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
47
+ "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
48
+ "dev": true,
49
+ "dependencies": {
50
+ "argparse": "^1.0.7",
51
+ "esprima": "^4.0.0"
52
+ },
53
+ "bin": {
54
+ "js-yaml": "bin/js-yaml.js"
55
+ }
56
+ },
57
+ "node_modules/lodash": {
58
+ "version": "4.17.21",
59
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
60
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
61
+ "dev": true
62
+ },
63
+ "node_modules/sprintf-js": {
64
+ "version": "1.0.3",
65
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
66
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
67
+ "dev": true
68
+ }
69
+ },
70
+ "dependencies": {
71
+ "argparse": {
72
+ "version": "1.0.10",
73
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
74
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
75
+ "dev": true,
76
+ "requires": {
77
+ "sprintf-js": "~1.0.2"
78
+ }
79
+ },
80
+ "esprima": {
81
+ "version": "4.0.1",
82
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
83
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
84
+ "dev": true
85
+ },
86
+ "inflect": {
87
+ "version": "0.3.0",
88
+ "resolved": "https://registry.npmjs.org/inflect/-/inflect-0.3.0.tgz",
89
+ "integrity": "sha1-gdDqqja1CmAjC3UQBIs5xBQv5So=",
90
+ "dev": true
91
+ },
92
+ "js-yaml": {
93
+ "version": "3.14.1",
94
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
95
+ "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
96
+ "dev": true,
97
+ "requires": {
98
+ "argparse": "^1.0.7",
99
+ "esprima": "^4.0.0"
100
+ }
101
+ },
102
+ "lodash": {
103
+ "version": "4.17.21",
104
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
105
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
106
+ "dev": true
107
+ },
108
+ "sprintf-js": {
109
+ "version": "1.0.3",
110
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
111
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
112
+ "dev": true
113
+ }
114
+ }
115
+ }
@@ -0,0 +1,41 @@
1
+ attachments:
2
+ create_attachment_for_task: >-
3
+ require 'asana'
4
+
5
+
6
+ client = Asana::Client.new do |c|
7
+ c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
8
+ end
9
+
10
+
11
+ result = client.attachments.create_attachment_for_task(field: "value", field: "value", options: {pretty: true})
12
+ delete_attachment: >-
13
+ require 'asana'
14
+
15
+
16
+ client = Asana::Client.new do |c|
17
+ c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
18
+ end
19
+
20
+
21
+ result = client.attachments.delete_attachment(attachment_gid: 'attachment_gid', options: {pretty: true})
22
+ get_attachment: >-
23
+ require 'asana'
24
+
25
+
26
+ client = Asana::Client.new do |c|
27
+ c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
28
+ end
29
+
30
+
31
+ result = client.attachments.get_attachment(attachment_gid: 'attachment_gid', param: "value", param: "value", options: {pretty: true})
32
+ get_attachments_for_object: >-
33
+ require 'asana'
34
+
35
+
36
+ client = Asana::Client.new do |c|
37
+ c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
38
+ end
39
+
40
+
41
+ result = client.attachments.get_attachments_for_object(parent: '&#x27;parent_example&#x27;', param: "value", param: "value", options: {pretty: true})
@@ -0,0 +1,11 @@
1
+ auditlogapi:
2
+ get_audit_log_events: >-
3
+ require 'asana'
4
+
5
+
6
+ client = Asana::Client.new do |c|
7
+ c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
8
+ end
9
+
10
+
11
+ result = client.audit_log_api.get_audit_log_events(workspace_gid: 'workspace_gid', param: "value", param: "value", options: {pretty: true})
@@ -0,0 +1,11 @@
1
+ batchapi:
2
+ create_batch_request: >-
3
+ require 'asana'
4
+
5
+
6
+ client = Asana::Client.new do |c|
7
+ c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
8
+ end
9
+
10
+
11
+ result = client.batch_api.create_batch_request(field: "value", field: "value", options: {pretty: true})
@@ -0,0 +1,21 @@
1
+ customfieldsettings:
2
+ get_custom_field_settings_for_portfolio: >-
3
+ require 'asana'
4
+
5
+
6
+ client = Asana::Client.new do |c|
7
+ c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
8
+ end
9
+
10
+
11
+ result = client.custom_field_settings.get_custom_field_settings_for_portfolio(portfolio_gid: 'portfolio_gid', param: "value", param: "value", options: {pretty: true})
12
+ get_custom_field_settings_for_project: >-
13
+ require 'asana'
14
+
15
+
16
+ client = Asana::Client.new do |c|
17
+ c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
18
+ end
19
+
20
+
21
+ result = client.custom_field_settings.get_custom_field_settings_for_project(project_gid: 'project_gid', param: "value", param: "value", options: {pretty: true})