asana 0.9.2 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.swagger-codegen-ignore +3 -0
  3. data/.travis.yml +2 -1
  4. data/Appraisals +2 -35
  5. data/Gemfile +2 -0
  6. data/README.md +3 -51
  7. data/VERSION +1 -0
  8. data/asana.gemspec +3 -3
  9. data/examples/Gemfile.lock +10 -10
  10. data/lib/asana/client.rb +10 -10
  11. data/lib/asana/http_client.rb +8 -2
  12. data/lib/asana/resource_includes/attachment_uploading.rb +14 -7
  13. data/lib/asana/resource_includes/collection.rb +5 -0
  14. data/lib/asana/resource_includes/resource.rb +0 -4
  15. data/lib/asana/resources/attachment.rb +2 -5
  16. data/lib/asana/resources/batch_api.rb +15 -0
  17. data/lib/asana/resources/custom_field_settings.rb +2 -5
  18. data/lib/asana/resources/custom_fields.rb +2 -5
  19. data/lib/asana/resources/events.rb +28 -0
  20. data/lib/asana/resources/gen/attachments_base.rb +56 -0
  21. data/lib/asana/resources/gen/batch_api_base.rb +30 -0
  22. data/lib/asana/resources/gen/custom_field_settings_base.rb +46 -0
  23. data/lib/asana/resources/gen/custom_fields_base.rb +124 -0
  24. data/lib/asana/resources/gen/events_base.rb +32 -0
  25. data/lib/asana/resources/gen/jobs_base.rb +30 -0
  26. data/lib/asana/resources/gen/organization_exports_base.rb +44 -0
  27. data/lib/asana/resources/gen/portfolio_memberships_base.rb +63 -0
  28. data/lib/asana/resources/gen/portfolios_base.rb +173 -0
  29. data/lib/asana/resources/gen/project_memberships_base.rb +46 -0
  30. data/lib/asana/resources/gen/project_statuses_base.rb +69 -0
  31. data/lib/asana/resources/gen/projects_base.rb +259 -0
  32. data/lib/asana/resources/gen/sections_base.rb +108 -0
  33. data/lib/asana/resources/gen/stories_base.rb +84 -0
  34. data/lib/asana/resources/gen/tags_base.rb +129 -0
  35. data/lib/asana/resources/gen/tasks_base.rb +425 -0
  36. data/lib/asana/resources/gen/team_memberships_base.rb +77 -0
  37. data/lib/asana/resources/gen/teams_base.rb +88 -0
  38. data/lib/asana/resources/gen/typeahead_base.rb +35 -0
  39. data/lib/asana/resources/gen/user_task_lists_base.rb +44 -0
  40. data/lib/asana/resources/gen/users_base.rb +88 -0
  41. data/lib/asana/resources/gen/webhooks_base.rb +70 -0
  42. data/lib/asana/resources/gen/workspace_memberships_base.rb +60 -0
  43. data/lib/asana/resources/gen/workspaces_base.rb +82 -0
  44. data/lib/asana/resources/job.rb +2 -3
  45. data/lib/asana/resources/organization_export.rb +2 -5
  46. data/lib/asana/resources/portfolio.rb +2 -5
  47. data/lib/asana/resources/portfolio_membership.rb +2 -5
  48. data/lib/asana/resources/project.rb +2 -5
  49. data/lib/asana/resources/project_membership.rb +2 -5
  50. data/lib/asana/resources/project_status.rb +2 -5
  51. data/lib/asana/resources/section.rb +18 -22
  52. data/lib/asana/resources/story.rb +2 -5
  53. data/lib/asana/resources/tag.rb +2 -5
  54. data/lib/asana/resources/task.rb +5 -5
  55. data/lib/asana/resources/team.rb +2 -5
  56. data/lib/asana/resources/team_membership.rb +26 -0
  57. data/lib/asana/resources/typeahead.rb +22 -0
  58. data/lib/asana/resources/user.rb +2 -5
  59. data/lib/asana/resources/user_task_list.rb +2 -5
  60. data/lib/asana/resources/webhook.rb +2 -5
  61. data/lib/asana/resources/workspace.rb +2 -6
  62. data/lib/asana/resources/workspace_membership.rb +32 -0
  63. data/lib/asana/version.rb +1 -1
  64. data/samples/attachments_sample.yaml +41 -0
  65. data/samples/batch_api_sample.yaml +11 -0
  66. data/samples/custom_field_settings_sample.yaml +21 -0
  67. data/samples/custom_fields_sample.yaml +81 -0
  68. data/samples/events_sample.yaml +11 -0
  69. data/samples/jobs_sample.yaml +11 -0
  70. data/samples/organization_exports_sample.yaml +21 -0
  71. data/samples/portfolio_memberships_sample.yaml +31 -0
  72. data/samples/portfolios_sample.yaml +121 -0
  73. data/samples/project_memberships_sample.yaml +21 -0
  74. data/samples/project_statuses_sample.yaml +41 -0
  75. data/samples/projects_sample.yaml +181 -0
  76. data/samples/sections_sample.yaml +71 -0
  77. data/samples/stories_sample.yaml +51 -0
  78. data/samples/tags_sample.yaml +81 -0
  79. data/samples/tasks_sample.yaml +261 -0
  80. data/samples/team_memberships_sample.yaml +41 -0
  81. data/samples/teams_sample.yaml +51 -0
  82. data/samples/typeahead_sample.yaml +11 -0
  83. data/samples/user_task_lists_sample.yaml +21 -0
  84. data/samples/users_sample.yaml +51 -0
  85. data/samples/webhooks_sample.yaml +41 -0
  86. data/samples/workspace_memberships_sample.yaml +31 -0
  87. data/samples/workspaces_sample.yaml +51 -0
  88. data/swagger_templates/api.mustache +41 -0
  89. data/swagger_templates/api_doc.mustache +12 -0
  90. data/swagger_templates/ruby-config.json +6 -0
  91. metadata +70 -13
@@ -0,0 +1,77 @@
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 TeamMembershipsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Get a team membership
16
+ #
17
+ # team_membership_gid - [str] (required)
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_team_membership(client, team_membership_gid: required("team_membership_gid"), options: {})
22
+ path = "/team_memberships/{team_membership_gid}"
23
+ path["{team_membership_gid}"] = team_membership_gid
24
+ parse(client.get(path, options: options)).first
25
+ end
26
+
27
+ # Get team memberships
28
+ #
29
+
30
+ # team - [str] Globally unique identifier for the team.
31
+ # user - [str] A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. This parameter must be used with the workspace parameter.
32
+ # workspace - [str] Globally unique identifier for the workspace. This parameter must be used with the user parameter.
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_team_memberships(client, team: nil, user: nil, workspace: nil, options: {})
39
+ path = "/team_memberships"
40
+ params = { team: team, user: user, 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
+ # Get memberships from a team
45
+ #
46
+ # team_gid - [str] (required) Globally unique identifier for the team.
47
+ # options - [Hash] the request I/O options
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.'
49
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
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.
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.
52
+ def get_team_memberships_for_team(client, team_gid: required("team_gid"), options: {})
53
+ path = "/teams/{team_gid}/team_memberships"
54
+ path["{team_gid}"] = team_gid
55
+ Collection.new(parse(client.get(path, options: options)), type: Resource, client: client)
56
+ end
57
+
58
+ # Get memberships from a user
59
+ #
60
+ # user_gid - [str] (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
61
+ # workspace - [str] (required) Globally unique identifier for the workspace.
62
+ # options - [Hash] the request I/O options
63
+ # > 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.'
64
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
65
+ # > 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.
66
+ # > 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.
67
+ def get_team_memberships_for_user(client, user_gid: required("user_gid"), workspace: nil, options: {})
68
+ path = "/users/{user_gid}/team_memberships"
69
+ path["{user_gid}"] = user_gid
70
+ params = { workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? }
71
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
72
+ end
73
+
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,88 @@
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 TeamsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Add a user to a team
16
+ #
17
+ # team_gid - [str] (required) Globally unique identifier for the team.
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_user_for_team(client, team_gid: required("team_gid"), options: {}, **data)
23
+ path = "/teams/{team_gid}/addUser"
24
+ path["{team_gid}"] = team_gid
25
+ User.new(parse(client.post(path, body: data, options: options)).first, client: client)
26
+ end
27
+
28
+ # Get a team
29
+ #
30
+ # team_gid - [str] (required) Globally unique identifier for the team.
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
+ 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)
40
+ end
41
+
42
+ # Get teams in an organization
43
+ #
44
+ # workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
45
+ # options - [Hash] the request I/O options
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
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
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
+ # > 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)
54
+ end
55
+
56
+ # Get teams for a user
57
+ #
58
+ # user_gid - [str] (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
59
+ # organization - [str] (required) The workspace or organization to filter teams on.
60
+ # options - [Hash] the request I/O options
61
+ # > 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
+ # > 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
+ # > 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
+ def get_teams_for_user(client, user_gid: required("user_gid"), organization: nil, options: {})
66
+ path = "/users/{user_gid}/teams"
67
+ path["{user_gid}"] = user_gid
68
+ params = { organization: organization }.reject { |_,v| v.nil? || Array(v).empty? }
69
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Team, client: client)
70
+ end
71
+
72
+ # Remove a user from a team
73
+ #
74
+ # team_gid - [str] (required) Globally unique identifier for the team.
75
+ # options - [Hash] the request I/O options
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.
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.
78
+ # data - [Hash] the attributes to POST
79
+ def remove_user_for_team(client, team_gid: required("team_gid"), options: {}, **data)
80
+ path = "/teams/{team_gid}/removeUser"
81
+ path["{team_gid}"] = team_gid
82
+ parse(client.post(path, body: data, options: options)).first
83
+ end
84
+
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,35 @@
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 TypeaheadBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Get objects via typeahead
16
+ #
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.
19
+ # type - [str] *Deprecated: new integrations should prefer the resource_type field.*
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
+ # 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.
22
+ # options - [Hash] the request I/O options
23
+ # > 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.
24
+ # > 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.
25
+ def typeahead_for_workspace(client, workspace_gid: required("workspace_gid"), resource_type: nil, type: nil, query: nil, count: nil, options: {})
26
+ path = "/workspaces/{workspace_gid}/typeahead"
27
+ path["{workspace_gid}"] = workspace_gid
28
+ params = { resource_type: resource_type, type: type, query: query, count: count }.reject { |_,v| v.nil? || Array(v).empty? }
29
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
30
+ end
31
+
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,44 @@
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 UserTaskListsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Get a user task list
16
+ #
17
+ # user_task_list_gid - [str] (required) Globally unique identifier for the user task list.
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_user_task_list(client, user_task_list_gid: required("user_task_list_gid"), options: {})
22
+ path = "/user_task_lists/{user_task_list_gid}"
23
+ path["{user_task_list_gid}"] = user_task_list_gid
24
+ UserTaskList.new(parse(client.get(path, options: options)).first, client: client)
25
+ end
26
+
27
+ # Get a user's task list
28
+ #
29
+ # user_gid - [str] (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
30
+ # workspace - [str] (required) The workspace in which to get the user task list.
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 get_user_task_list_for_user(client, user_gid: required("user_gid"), workspace: nil, options: {})
35
+ path = "/users/{user_gid}/user_task_list"
36
+ path["{user_gid}"] = user_gid
37
+ params = { workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? }
38
+ UserTaskList.new(parse(client.get(path, params: params, options: options)).first, client: client)
39
+ end
40
+
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,88 @@
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 UsersBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Get a user's favorites
16
+ #
17
+ # user_gid - [str] (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
18
+ # resource_type - [str] (required) The resource type of favorites to be returned.
19
+ # workspace - [str] (required) The workspace in which to get favorites.
20
+ # options - [Hash] the request I/O options
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
+ def get_favorites_for_user(client, user_gid: required("user_gid"), resource_type: nil, workspace: nil, options: {})
24
+ path = "/users/{user_gid}/favorites"
25
+ path["{user_gid}"] = user_gid
26
+ params = { resource_type: resource_type, workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? }
27
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
28
+ end
29
+
30
+ # Get a user
31
+ #
32
+ # user_gid - [str] (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
33
+ # options - [Hash] the request I/O options
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
+ def get_user(client, user_gid: required("user_gid"), options: {})
37
+ path = "/users/{user_gid}"
38
+ path["{user_gid}"] = user_gid
39
+ User.new(parse(client.get(path, options: options)).first, client: client)
40
+ end
41
+
42
+ # Get multiple users
43
+ #
44
+
45
+ # workspace - [str] The workspace or organization ID to filter users on.
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_users(client, workspace: nil, options: {})
52
+ path = "/users"
53
+ params = { workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? }
54
+ Collection.new(parse(client.get(path, params: params, options: options)), type: User, client: client)
55
+ end
56
+
57
+ # Get users in a team
58
+ #
59
+ # team_gid - [str] (required) Globally unique identifier for the team.
60
+ # options - [Hash] the request I/O options
61
+ # > 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
+ # > 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
+ # > 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
+ def get_users_for_team(client, team_gid: required("team_gid"), options: {})
66
+ path = "/teams/{team_gid}/users"
67
+ path["{team_gid}"] = team_gid
68
+ Collection.new(parse(client.get(path, options: options)), type: User, client: client)
69
+ end
70
+
71
+ # Get users in a workspace or organization
72
+ #
73
+ # workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
74
+ # options - [Hash] the request I/O options
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
+ # > 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
+ # > 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
+ def get_users_for_workspace(client, workspace_gid: required("workspace_gid"), options: {})
80
+ path = "/workspaces/{workspace_gid}/users"
81
+ path["{workspace_gid}"] = workspace_gid
82
+ Collection.new(parse(client.get(path, options: options)), type: User, client: client)
83
+ end
84
+
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,70 @@
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 WebhooksBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Establish a webhook
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_webhook(client, options: {}, **data)
23
+ path = "/webhooks"
24
+ Webhook.new(parse(client.post(path, body: data, options: options)).first, client: client)
25
+ end
26
+
27
+ # Delete a webhook
28
+ #
29
+ # webhook_gid - [str] (required) Globally unique identifier for the webhook.
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_webhook(client, webhook_gid: required("webhook_gid"), options: {})
34
+ path = "/webhooks/{webhook_gid}"
35
+ path["{webhook_gid}"] = webhook_gid
36
+ parse(client.delete(path, options: options)).first
37
+ end
38
+
39
+ # Get a webhook
40
+ #
41
+ # webhook_gid - [str] (required) Globally unique identifier for the webhook.
42
+ # options - [Hash] the request I/O options
43
+ # > 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.
44
+ # > 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.
45
+ def get_webhook(client, webhook_gid: required("webhook_gid"), options: {})
46
+ path = "/webhooks/{webhook_gid}"
47
+ path["{webhook_gid}"] = webhook_gid
48
+ Webhook.new(parse(client.get(path, options: options)).first, client: client)
49
+ end
50
+
51
+ # Get multiple webhooks
52
+ #
53
+
54
+ # workspace - [str] (required) The workspace to query for webhooks in.
55
+ # resource - [str] Only return webhooks for the given resource.
56
+ # options - [Hash] the request I/O options
57
+ # > 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.'
58
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
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 get_webhooks(client, workspace: nil, resource: nil, options: {})
62
+ path = "/webhooks"
63
+ params = { workspace: workspace, resource: resource }.reject { |_,v| v.nil? || Array(v).empty? }
64
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Webhook, client: client)
65
+ end
66
+
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,60 @@
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 WorkspaceMembershipsBase < Resource
9
+
10
+ def self.inherited(base)
11
+ Registry.register(base)
12
+ end
13
+
14
+ class << self
15
+ # Get a workspace membership
16
+ #
17
+ # workspace_membership_gid - [str] (required)
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_workspace_membership(client, workspace_membership_gid: required("workspace_membership_gid"), options: {})
22
+ path = "/workspace_memberships/{workspace_membership_gid}"
23
+ path["{workspace_membership_gid}"] = workspace_membership_gid
24
+ parse(client.get(path, options: options)).first
25
+ end
26
+
27
+ # Get workspace memberships for a user
28
+ #
29
+ # user_gid - [str] (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
30
+ # options - [Hash] the request I/O options
31
+ # > 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.'
32
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
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 get_workspace_memberships_for_user(client, user_gid: required("user_gid"), options: {})
36
+ path = "/users/{user_gid}/workspace_memberships"
37
+ path["{user_gid}"] = user_gid
38
+ Collection.new(parse(client.get(path, options: options)), type: Resource, client: client)
39
+ end
40
+
41
+ # Get the workspace memberships for a workspace
42
+ #
43
+ # workspace_gid - [str] (required) Globally unique identifier for the workspace or organization.
44
+ # user - [str] A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
45
+ # options - [Hash] the request I/O options
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
+ # > limit - [int] Results per page. The number of objects to return per page. The value must be between 1 and 100.
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
+ # > 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_workspace_memberships_for_workspace(client, workspace_gid: required("workspace_gid"), user: nil, options: {})
51
+ path = "/workspaces/{workspace_gid}/workspace_memberships"
52
+ path["{workspace_gid}"] = workspace_gid
53
+ params = { user: user }.reject { |_,v| v.nil? || Array(v).empty? }
54
+ Collection.new(parse(client.get(path, params: params, options: options)), type: Resource, client: client)
55
+ end
56
+
57
+ end
58
+ end
59
+ end
60
+ end