Class: Seam::Clients::AcsAccessGroups

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/routes/acs_access_groups.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ AcsAccessGroups

Returns a new instance of AcsAccessGroups.



6
7
8
9
# File 'lib/seam/routes/acs_access_groups.rb', line 6

def initialize(client:, defaults:)
  @client = client
  @defaults = defaults
end

Instance Method Details

#add_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil) ⇒ nil

Adds a specified access system user to a specified access group.

Parameters:

  • acs_access_group_id

    ID of the access group to which you want to add an access system user.

  • acs_user_id (defaults to: nil)

    ID of the access system user that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id.

  • user_identity_id (defaults to: nil)

    ID of the desired user identity that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same email_address or phone_number as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created.

Returns:

  • (nil)

    OK



16
17
18
19
20
# File 'lib/seam/routes/acs_access_groups.rb', line 16

def add_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil)
  @client.post("/acs/access_groups/add_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)

  nil
end

#delete(acs_access_group_id:) ⇒ nil

Deletes a specified access group.

Parameters:

  • acs_access_group_id

    ID of the access group that you want to delete.

Returns:

  • (nil)

    OK



25
26
27
28
29
# File 'lib/seam/routes/acs_access_groups.rb', line 25

def delete(acs_access_group_id:)
  @client.post("/acs/access_groups/delete", {acs_access_group_id: acs_access_group_id}.compact)

  nil
end

#get(acs_access_group_id:) ⇒ Seam::Resources::AcsAccessGroup

Returns a specified access group.

Parameters:

  • acs_access_group_id

    ID of the access group that you want to get.

Returns:



34
35
36
37
38
# File 'lib/seam/routes/acs_access_groups.rb', line 34

def get(acs_access_group_id:)
  res = @client.post("/acs/access_groups/get", {acs_access_group_id: acs_access_group_id}.compact)

  Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_group"])
end

#list(acs_system_id: nil, acs_user_id: nil, search: nil, user_identity_id: nil) ⇒ Seam::Resources::AcsAccessGroup

Returns a list of all access groups.

Parameters:

  • acs_system_id (defaults to: nil)

    ID of the access system for which you want to retrieve all access groups.

  • acs_user_id (defaults to: nil)

    ID of the access system user for which you want to retrieve all access groups.

  • search (defaults to: nil)

    String for which to search. Filters returned access groups to include all records that satisfy a partial match using name or acs_access_group_id.

  • user_identity_id (defaults to: nil)

    ID of the user identity for which you want to retrieve all access groups.

Returns:



46
47
48
49
50
# File 'lib/seam/routes/acs_access_groups.rb', line 46

def list(acs_system_id: nil, acs_user_id: nil, search: nil, user_identity_id: nil)
  res = @client.post("/acs/access_groups/list", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, search: search, user_identity_id: user_identity_id}.compact)

  Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_groups"])
end

#list_accessible_entrances(acs_access_group_id:) ⇒ Seam::Resources::AcsEntrance

Returns a list of all accessible entrances for a specified access group.

Parameters:

  • acs_access_group_id

    ID of the access group for which you want to retrieve all accessible entrances.

Returns:



55
56
57
58
59
# File 'lib/seam/routes/acs_access_groups.rb', line 55

def list_accessible_entrances(acs_access_group_id:)
  res = @client.post("/acs/access_groups/list_accessible_entrances", {acs_access_group_id: acs_access_group_id}.compact)

  Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
end

#list_users(acs_access_group_id:) ⇒ Seam::Resources::AcsUser

Returns a list of all access system users in an access group.

Parameters:

  • acs_access_group_id

    ID of the access group for which you want to retrieve all access system users.

Returns:



64
65
66
67
68
# File 'lib/seam/routes/acs_access_groups.rb', line 64

def list_users(acs_access_group_id:)
  res = @client.post("/acs/access_groups/list_users", {acs_access_group_id: acs_access_group_id}.compact)

  Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
end

#remove_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil) ⇒ nil

Removes a specified access system user from a specified access group.

Parameters:

  • acs_access_group_id

    ID of the access group from which you want to remove an access system user.

  • acs_user_id (defaults to: nil)

    ID of the access system user that you want to remove from an access group.

  • user_identity_id (defaults to: nil)

    ID of the user identity associated with the user that you want to remove from an access group.

Returns:

  • (nil)

    OK



75
76
77
78
79
# File 'lib/seam/routes/acs_access_groups.rb', line 75

def remove_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil)
  @client.post("/acs/access_groups/remove_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)

  nil
end