Class: SmartRecruiters::AccessGroupsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/smartrecruiters/resources/access_groups.rb

Constant Summary collapse

ACCESS_GROUP_API =
'user-api/v201804/access-groups'

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from SmartRecruiters::Resource

Instance Method Details

#assign_users(group_id:, user_ids:) ⇒ Object



11
12
13
# File 'lib/smartrecruiters/resources/access_groups.rb', line 11

def assign_users(group_id:, user_ids:)
  Collection.from_response post_request("#{ACCESS_GROUP_API}/#{group_id}/users", body: user_ids), type: User
end

#listObject



7
8
9
# File 'lib/smartrecruiters/resources/access_groups.rb', line 7

def list
  Collection.from_response get_request(ACCESS_GROUP_API.to_s), type: AccessGroup
end

#remove_user(group_id:, user_id:) ⇒ Object



15
16
17
# File 'lib/smartrecruiters/resources/access_groups.rb', line 15

def remove_user(group_id:, user_id:)
  delete_request("#{ACCESS_GROUP_API}/#{group_id}/users/#{user_id}")
end