Class: Asana::Resources::UsersBase
- Defined in:
- lib/asana/resources/gen/users_base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.get_favorites_for_user(client, user_gid: required("user_gid"), resource_type: nil, workspace: nil, options: {}) ⇒ Object
Get a user’s favorites.
-
.get_user(client, user_gid: required("user_gid"), options: {}) ⇒ Object
Get a user.
-
.get_users(client, workspace: nil, team: nil, options: {}) ⇒ Object
workspace - [str] The workspace or organization ID to filter users on.
-
.get_users_for_team(client, team_gid: required("team_gid"), options: {}) ⇒ Object
Get users in a team.
-
.get_users_for_workspace(client, workspace_gid: required("workspace_gid"), options: {}) ⇒ Object
Get users in a workspace or organization.
- .inherited(base) ⇒ Object
Methods inherited from Resource
#initialize, #method_missing, #refresh, #respond_to_missing?, #to_h, #to_s
Methods included from ResponseHelper
Constructor Details
This class inherits a constructor from Asana::Resources::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Asana::Resources::Resource
Class Method Details
.get_favorites_for_user(client, user_gid: required("user_gid"), resource_type: nil, workspace: nil, options: {}) ⇒ Object
Get a user’s favorites
23 24 25 26 27 28 |
# File 'lib/asana/resources/gen/users_base.rb', line 23 def get_favorites_for_user(client, user_gid: required("user_gid"), resource_type: nil, workspace: nil, options: {}) path = "/users/{user_gid}/favorites" path["{user_gid}"] = user_gid params = { resource_type: resource_type, workspace: workspace }.reject { |_,v| v.nil? || Array(v).empty? } Collection.new(parse(client.get(path, params: params, options: )), type: Resource, client: client) end |
.get_user(client, user_gid: required("user_gid"), options: {}) ⇒ Object
Get a user
36 37 38 39 40 |
# File 'lib/asana/resources/gen/users_base.rb', line 36 def get_user(client, user_gid: required("user_gid"), options: {}) path = "/users/{user_gid}" path["{user_gid}"] = user_gid User.new(parse(client.get(path, options: )).first, client: client) end |
.get_users(client, workspace: nil, team: nil, options: {}) ⇒ Object
workspace - [str] The workspace or organization ID to filter users on.
52 53 54 55 56 |
# File 'lib/asana/resources/gen/users_base.rb', line 52 def get_users(client, workspace: nil, team: nil, options: {}) path = "/users" params = { workspace: workspace, team: team }.reject { |_,v| v.nil? || Array(v).empty? } Collection.new(parse(client.get(path, params: params, options: )), type: User, client: client) end |
.get_users_for_team(client, team_gid: required("team_gid"), options: {}) ⇒ Object
Get users in a team
65 66 67 68 69 |
# File 'lib/asana/resources/gen/users_base.rb', line 65 def get_users_for_team(client, team_gid: required("team_gid"), options: {}) path = "/teams/{team_gid}/users" path["{team_gid}"] = team_gid Collection.new(parse(client.get(path, options: )), type: User, client: client) end |
.get_users_for_workspace(client, workspace_gid: required("workspace_gid"), options: {}) ⇒ Object
Get users in a workspace or organization
78 79 80 81 82 |
# File 'lib/asana/resources/gen/users_base.rb', line 78 def get_users_for_workspace(client, workspace_gid: required("workspace_gid"), options: {}) path = "/workspaces/{workspace_gid}/users" path["{workspace_gid}"] = workspace_gid Collection.new(parse(client.get(path, options: )), type: User, client: client) end |