asana 0.10.3 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) 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/.rubocop.yml +38 -3
  7. data/.ruby-version +1 -1
  8. data/Appraisals +8 -3
  9. data/Gemfile +7 -3
  10. data/Gemfile.lock +166 -0
  11. data/Guardfile +12 -10
  12. data/README.md +45 -20
  13. data/Rakefile +20 -27
  14. data/VERSION +1 -1
  15. data/asana.gemspec +20 -18
  16. data/examples/Gemfile.lock +2 -2
  17. data/examples/cli_app.rb +2 -2
  18. data/examples/events.rb +3 -3
  19. data/examples/personal_access_token.rb +2 -2
  20. data/lib/asana/authentication/oauth2/access_token_authentication.rb +4 -1
  21. data/lib/asana/authentication/oauth2/bearer_token_authentication.rb +3 -2
  22. data/lib/asana/authentication/oauth2/client.rb +2 -0
  23. data/lib/asana/authentication/oauth2.rb +6 -4
  24. data/lib/asana/authentication/token_authentication.rb +3 -1
  25. data/lib/asana/authentication.rb +2 -0
  26. data/lib/asana/client/configuration.rb +6 -5
  27. data/lib/asana/client.rb +13 -11
  28. data/lib/asana/errors.rb +16 -11
  29. data/lib/asana/http_client/environment_info.rb +9 -8
  30. data/lib/asana/http_client/error_handling.rb +26 -20
  31. data/lib/asana/http_client/response.rb +2 -0
  32. data/lib/asana/http_client.rb +66 -65
  33. data/lib/asana/resource_includes/attachment_uploading.rb +6 -6
  34. data/lib/asana/resource_includes/collection.rb +4 -4
  35. data/lib/asana/resource_includes/event.rb +2 -0
  36. data/lib/asana/resource_includes/event_subscription.rb +2 -0
  37. data/lib/asana/resource_includes/events.rb +4 -1
  38. data/lib/asana/resource_includes/registry.rb +2 -0
  39. data/lib/asana/resource_includes/resource.rb +8 -5
  40. data/lib/asana/resource_includes/response_helper.rb +2 -0
  41. data/lib/asana/resources/audit_log_api.rb +42 -0
  42. data/lib/asana/resources/gen/attachments_base.rb +7 -6
  43. data/lib/asana/resources/gen/audit_log_api_base.rb +37 -0
  44. data/lib/asana/resources/gen/goal_relationships_base.rb +83 -0
  45. data/lib/asana/resources/gen/goals_base.rb +153 -0
  46. data/lib/asana/resources/gen/memberships_base.rb +71 -0
  47. data/lib/asana/resources/gen/portfolios_base.rb +3 -3
  48. data/lib/asana/resources/gen/project_briefs_base.rb +68 -0
  49. data/lib/asana/resources/gen/project_templates_base.rb +73 -0
  50. data/lib/asana/resources/gen/projects_base.rb +17 -4
  51. data/lib/asana/resources/gen/status_updates_base.rb +72 -0
  52. data/lib/asana/resources/gen/tasks_base.rb +13 -15
  53. data/lib/asana/resources/gen/teams_base.rb +41 -13
  54. data/lib/asana/resources/gen/time_periods_base.rb +47 -0
  55. data/lib/asana/resources/gen/typeahead_base.rb +2 -2
  56. data/lib/asana/resources/gen/users_base.rb +3 -4
  57. data/lib/asana/resources/gen/webhooks_base.rb +13 -0
  58. data/lib/asana/resources/gen/workspaces_base.rb +1 -1
  59. data/lib/asana/resources/goal.rb +54 -0
  60. data/lib/asana/resources/goal_relationship.rb +32 -0
  61. data/lib/asana/resources/membership.rb +20 -0
  62. data/lib/asana/resources/portfolio.rb +3 -3
  63. data/lib/asana/resources/project_brief.rb +30 -0
  64. data/lib/asana/resources/project_template.rb +36 -0
  65. data/lib/asana/resources/status_update.rb +54 -0
  66. data/lib/asana/resources/time_period.rb +30 -0
  67. data/lib/asana/resources/typeahead.rb +1 -1
  68. data/lib/asana/resources.rb +4 -4
  69. data/lib/asana/ruby2_0_0_compatibility.rb +2 -0
  70. data/lib/asana/version.rb +1 -1
  71. data/lib/asana.rb +2 -0
  72. data/package-lock.json +115 -0
  73. data/samples/attachments_sample.yaml +4 -4
  74. data/samples/audit_log_api_sample.yaml +11 -0
  75. data/samples/goal_relationships_sample.yaml +51 -0
  76. data/samples/goals_sample.yaml +101 -0
  77. data/samples/memberships_sample.yaml +41 -0
  78. data/samples/project_briefs_sample.yaml +41 -0
  79. data/samples/project_templates_sample.yaml +41 -0
  80. data/samples/projects_sample.yaml +10 -0
  81. data/samples/status_updates_sample.yaml +41 -0
  82. data/samples/teams_sample.yaml +24 -4
  83. data/samples/time_periods_sample.yaml +21 -0
  84. data/samples/webhooks_sample.yaml +10 -0
  85. metadata +75 -40
  86. data/.travis.yml +0 -16
@@ -0,0 +1,153 @@
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
+ # Create a goal
29
+ #
30
+
31
+ # options - [Hash] the request I/O options
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
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
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
+ # > 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
+ # data - [Hash] the attributes to POST
37
+ def create_goal(client, options: {}, **data)
38
+ path = "/goals"
39
+ parse(client.post(path, body: data, options: options)).first
40
+ end
41
+
42
+ # Create a goal metric
43
+ #
44
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
45
+ # options - [Hash] the request I/O options
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
+ # data - [Hash] the attributes to POST
49
+ def create_goal_metric(client, goal_gid: required("goal_gid"), options: {}, **data)
50
+ path = "/goals/{goal_gid}/setMetric"
51
+ path["{goal_gid}"] = goal_gid
52
+ parse(client.post(path, body: data, options: options)).first
53
+ end
54
+
55
+ # Delete a goal
56
+ #
57
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
58
+ # options - [Hash] the request I/O options
59
+ # > 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.
60
+ # > 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.
61
+ def delete_goal(client, goal_gid: required("goal_gid"), options: {})
62
+ path = "/goals/{goal_gid}"
63
+ path["{goal_gid}"] = goal_gid
64
+ parse(client.delete(path, options: options)).first
65
+ end
66
+
67
+ # Get a goal
68
+ #
69
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
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
+ def get_goal(client, goal_gid: required("goal_gid"), options: {})
74
+ path = "/goals/{goal_gid}"
75
+ path["{goal_gid}"] = goal_gid
76
+ parse(client.get(path, options: options)).first
77
+ end
78
+
79
+ # Get goals
80
+ #
81
+
82
+ # portfolio - [str] Globally unique identifier for supporting portfolio.
83
+ # project - [str] Globally unique identifier for supporting project.
84
+ # is_workspace_level - [bool] Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter.
85
+ # team - [str] Globally unique identifier for the team.
86
+ # workspace - [str] Globally unique identifier for the workspace.
87
+ # time_periods - [list[str]] Globally unique identifiers for the time periods.
88
+ # options - [Hash] the request I/O options
89
+ # > 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.'
90
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
91
+ # > 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.
92
+ # > 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.
93
+ def get_goals(client, portfolio: nil, project: nil, is_workspace_level: nil, team: nil, workspace: nil, time_periods: nil, options: {})
94
+ path = "/goals"
95
+ 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? }
96
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
97
+ end
98
+
99
+ # Get parent goals from a goal
100
+ #
101
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
102
+ # options - [Hash] the request I/O options
103
+ # > opt_fields - [list[str]] Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
104
+ # > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
105
+ def get_parent_goals_for_goal(client, goal_gid: required("goal_gid"), options: {})
106
+ path = "/goals/{goal_gid}/parentGoals"
107
+ path["{goal_gid}"] = goal_gid
108
+ Collection.new(parse(client.get(path, options: options)), type: Resource, client: client)
109
+ end
110
+
111
+ # Remove a collaborator from a goal
112
+ #
113
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
114
+ # options - [Hash] the request I/O options
115
+ # > 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.
116
+ # > 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.
117
+ # data - [Hash] the attributes to POST
118
+ def remove_followers(client, goal_gid: required("goal_gid"), options: {}, **data)
119
+ path = "/goals/{goal_gid}/removeFollowers"
120
+ path["{goal_gid}"] = goal_gid
121
+ parse(client.post(path, body: data, options: options)).first
122
+ end
123
+
124
+ # Update a goal
125
+ #
126
+ # goal_gid - [str] (required) Globally unique identifier for the goal.
127
+ # options - [Hash] the request I/O options
128
+ # > 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.
129
+ # > 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.
130
+ # data - [Hash] the attributes to PUT
131
+ def update_goal(client, goal_gid: required("goal_gid"), options: {}, **data)
132
+ path = "/goals/{goal_gid}"
133
+ path["{goal_gid}"] = goal_gid
134
+ parse(client.put(path, body: data, options: options)).first
135
+ end
136
+
137
+ # Update a goal metric
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
+ # data - [Hash] the attributes to POST
144
+ def update_goal_metric(client, goal_gid: required("goal_gid"), options: {}, **data)
145
+ path = "/goals/{goal_gid}/setMetricCurrentValue"
146
+ path["{goal_gid}"] = goal_gid
147
+ parse(client.post(path, body: data, options: options)).first
148
+ end
149
+
150
+ end
151
+ end
152
+ end
153
+ end
@@ -0,0 +1,71 @@
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 MembershipsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Create a membership
16
+ #
17
+
18
+ # options - [Hash] the request I/O options
19
+ # > opt_fields - [list[str]] Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
20
+ # > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
21
+ # data - [Hash] the attributes to POST
22
+ def create_membership(client, options: {}, **data)
23
+ path = "/memberships"
24
+ parse(client.post(path, body: data, options: options)).first
25
+ end
26
+
27
+ # Delete a membership
28
+ #
29
+ # membership_gid - [str] (required) Globally unique identifier for the membership.
30
+ # options - [Hash] the request I/O options
31
+ # > opt_fields - [list[str]] Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
32
+ # > opt_pretty - [bool] Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
33
+ def delete_membership(client, membership_gid: required("membership_gid"), options: {})
34
+ path = "/memberships/{membership_gid}"
35
+ path["{membership_gid}"] = membership_gid
36
+ parse(client.delete(path, options: options)).first
37
+ end
38
+
39
+ # Get multiple memberships
40
+ #
41
+
42
+ # parent - [str] (required) Globally unique identifier for `project`, `portfolio`, `team`, `goal`, and `workspace`.
43
+ # member - [str] Globally unique identifier for `team` and `user`.
44
+ # options - [Hash] the request I/O options
45
+ # > 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.'
46
+ # > limit - [int] Pagination limit for the request.
47
+ # > 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.
48
+ # > 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.
49
+ def get_memberships(client, parent: nil, member: nil, options: {})
50
+ path = "/memberships"
51
+ params = { parent: parent, member: member }.reject { |_,v| v.nil? || Array(v).empty? }
52
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
53
+ end
54
+
55
+ # Update a membership
56
+ #
57
+ # membership_gid - [str] (required) Globally unique identifier for the membership.
58
+ # options - [Hash] the request I/O options
59
+ # > 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.
60
+ # > 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.
61
+ # data - [Hash] the attributes to PUT
62
+ def update_membership(client, membership_gid: required("membership_gid"), options: {}, **data)
63
+ path = "/memberships/{membership_gid}"
64
+ path["{membership_gid}"] = membership_gid
65
+ parse(client.put(path, body: data, options: options)).first
66
+ end
67
+
68
+ end
69
+ end
70
+ end
71
+ end
@@ -21,7 +21,7 @@ module Asana
21
21
  def add_custom_field_setting_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
22
22
  path = "/portfolios/{portfolio_gid}/addCustomFieldSetting"
23
23
  path["{portfolio_gid}"] = portfolio_gid
24
- parse(client.post(path, body: data, options: options)).first
24
+ CustomFieldSetting.new(parse(client.post(path, body: data, options: options)).first, client: client)
25
25
  end
26
26
 
27
27
  # Add a portfolio item
@@ -47,7 +47,7 @@ module Asana
47
47
  def add_members_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
48
48
  path = "/portfolios/{portfolio_gid}/addMembers"
49
49
  path["{portfolio_gid}"] = portfolio_gid
50
- parse(client.post(path, body: data, options: options)).first
50
+ Portfolio.new(parse(client.post(path, body: data, options: options)).first, client: client)
51
51
  end
52
52
 
53
53
  # Create a portfolio
@@ -151,7 +151,7 @@ module Asana
151
151
  def remove_members_for_portfolio(client, portfolio_gid: required("portfolio_gid"), options: {}, **data)
152
152
  path = "/portfolios/{portfolio_gid}/removeMembers"
153
153
  path["{portfolio_gid}"] = portfolio_gid
154
- parse(client.post(path, body: data, options: options)).first
154
+ Portfolio.new(parse(client.post(path, body: data, options: options)).first, client: client)
155
155
  end
156
156
 
157
157
  # Update a portfolio
@@ -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
@@ -34,7 +34,7 @@ module Asana
34
34
  def add_followers_for_project(client, project_gid: required("project_gid"), options: {}, **data)
35
35
  path = "/projects/{project_gid}/addFollowers"
36
36
  path["{project_gid}"] = project_gid
37
- parse(client.post(path, body: data, options: options)).first
37
+ Project.new(parse(client.post(path, body: data, options: options)).first, client: client)
38
38
  end
39
39
 
40
40
  # Add users to a project
@@ -47,7 +47,7 @@ module Asana
47
47
  def add_members_for_project(client, project_gid: required("project_gid"), options: {}, **data)
48
48
  path = "/projects/{project_gid}/addMembers"
49
49
  path["{project_gid}"] = project_gid
50
- parse(client.post(path, body: data, options: options)).first
50
+ Project.new(parse(client.post(path, body: data, options: options)).first, client: client)
51
51
  end
52
52
 
53
53
  # Create a project
@@ -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.
@@ -224,7 +237,7 @@ module Asana
224
237
  def remove_followers_for_project(client, project_gid: required("project_gid"), options: {}, **data)
225
238
  path = "/projects/{project_gid}/removeFollowers"
226
239
  path["{project_gid}"] = project_gid
227
- parse(client.post(path, body: data, options: options)).first
240
+ Project.new(parse(client.post(path, body: data, options: options)).first, client: client)
228
241
  end
229
242
 
230
243
  # Remove users from a project
@@ -237,7 +250,7 @@ module Asana
237
250
  def remove_members_for_project(client, project_gid: required("project_gid"), options: {}, **data)
238
251
  path = "/projects/{project_gid}/removeMembers"
239
252
  path["{project_gid}"] = project_gid
240
- parse(client.post(path, body: data, options: options)).first
253
+ Project.new(parse(client.post(path, body: data, options: options)).first, client: client)
241
254
  end
242
255
 
243
256
  # Update a 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