Class: Seam::Clients::AcsUsers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ AcsUsers

Returns a new instance of AcsUsers.



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

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

Instance Method Details

#add_to_access_group(acs_access_group_id:, acs_user_id:) ⇒ 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

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

Returns:

  • (nil)

    OK



15
16
17
18
19
# File 'lib/seam/routes/acs_users.rb', line 15

def add_to_access_group(acs_access_group_id:, acs_user_id:)
  @client.post("/acs/users/add_to_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)

  nil
end

#create(acs_system_id:, full_name:, access_schedule: nil, acs_access_group_ids: nil, email: nil, email_address: nil, phone_number: nil, user_identity_id: nil) ⇒ Seam::Resources::AcsUser

Deprecated.

email: use email_address.

Creates a new access system user.

Parameters:

  • acs_system_id

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

  • full_name

    Full name of the new access system user.

  • access_schedule (defaults to: nil)

    starts_at and ends_at timestamps for the new access system user's access. If you specify an access_schedule, you may include both starts_at and ends_at. If you omit starts_at, it defaults to the current time. ends_at is optional and must be a time in the future and after starts_at.

  • acs_access_group_ids (defaults to: nil)

    Array of access group IDs to indicate the access groups to which you want to add the new access system user.

  • email (defaults to: nil)
  • email_address (defaults to: nil)

    Email address of the access system user.

  • phone_number (defaults to: nil)

    Phone number of the access system user in E.164 format (for example, +15555550100).

  • user_identity_id (defaults to: nil)

    ID of the user identity with which you want to associate the new access system user.

Returns:



32
33
34
35
36
# File 'lib/seam/routes/acs_users.rb', line 32

def create(acs_system_id:, full_name:, access_schedule: nil, acs_access_group_ids: nil, email: nil, email_address: nil, phone_number: nil, user_identity_id: nil)
  res = @client.post("/acs/users/create", {acs_system_id: acs_system_id, full_name: full_name, access_schedule: access_schedule, acs_access_group_ids: acs_access_group_ids, email: email, email_address: email_address, phone_number: phone_number, user_identity_id: user_identity_id}.compact)

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

#delete(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) ⇒ nil

Deletes a specified access system user and invalidates the access system user's credentials.

Parameters:

  • acs_system_id (defaults to: nil)

    ID of the access system that you want to delete. You must provide acs_system_id with user_identity_id.

  • acs_user_id (defaults to: nil)

    ID of the access system user that you want to delete. You must provide either acs_user_id or user_identity_id

  • user_identity_id (defaults to: nil)

    ID of the user identity that you want to delete. You must provide either acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id.

Returns:

  • (nil)

    OK



43
44
45
46
47
# File 'lib/seam/routes/acs_users.rb', line 43

def delete(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
  @client.post("/acs/users/delete", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)

  nil
end

#get(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil) ⇒ Seam::Resources::AcsUser

Returns a specified access system user.

Parameters:

  • acs_user_id (defaults to: nil)

    ID of the access system user that you want to get. You can only provide acs_user_id or user_identity_id.

  • acs_system_id (defaults to: nil)

    ID of the access system that you want to get. You can only provide acs_user_id or user_identity_id.

  • user_identity_id (defaults to: nil)

    ID of the user identity that you want to get. You can only provide acs_user_id or user_identity_id.

Returns:



54
55
56
57
58
# File 'lib/seam/routes/acs_users.rb', line 54

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

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

#list(acs_system_id: nil, created_before: nil, limit: nil, page_cursor: nil, search: nil, user_identity_email_address: nil, user_identity_id: nil, user_identity_phone_number: nil) ⇒ Seam::Resources::AcsUser

Returns a list of all access system users.

Parameters:

  • acs_system_id (defaults to: nil)

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

  • created_before (defaults to: nil)

    Timestamp by which to limit returned access system users. Returns users created before this timestamp.

  • limit (defaults to: nil)

    Maximum number of records to return per page.

  • page_cursor (defaults to: nil)

    Identifies the specific page of results to return, obtained from the previous page's next_page_cursor.

  • search (defaults to: nil)

    String for which to search. Filters returned access system users to include all records that satisfy a partial match using full_name, phone_number, email_address, acs_user_id, user_identity_id, user_identity_full_name or user_identity_phone_number.

  • user_identity_email_address (defaults to: nil)

    Email address of the user identity for which you want to retrieve all access system users.

  • user_identity_id (defaults to: nil)

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

  • user_identity_phone_number (defaults to: nil)

    Phone number of the user identity for which you want to retrieve all access system users, in E.164 format (for example, +15555550100).

Returns:



70
71
72
73
74
# File 'lib/seam/routes/acs_users.rb', line 70

def list(acs_system_id: nil, created_before: nil, limit: nil, page_cursor: nil, search: nil, user_identity_email_address: nil, user_identity_id: nil, user_identity_phone_number: nil)
  res = @client.post("/acs/users/list", {acs_system_id: acs_system_id, created_before: created_before, limit: limit, page_cursor: page_cursor, search: search, user_identity_email_address: user_identity_email_address, user_identity_id: user_identity_id, user_identity_phone_number: user_identity_phone_number}.compact)

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

#list_accessible_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) ⇒ Seam::Resources::AcsEntrance

Lists the entrances to which a specified access system user has access.

Parameters:

  • acs_system_id (defaults to: nil)

    ID of the access system for which you want to list accessible entrances. You can only provide acs_system_id with user_identity_id.

  • acs_user_id (defaults to: nil)

    ID of the access system user for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id.

  • user_identity_id (defaults to: nil)

    ID of the user identity for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id.

Returns:



81
82
83
84
85
# File 'lib/seam/routes/acs_users.rb', line 81

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

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

#remove_from_access_group(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. You can only provide acs_user_id or user_identity_id.

  • user_identity_id (defaults to: nil)

    ID of the user identity that you want to remove from an access group. You can only provide acs_user_id or user_identity_id.

Returns:

  • (nil)

    OK



92
93
94
95
96
# File 'lib/seam/routes/acs_users.rb', line 92

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

  nil
end

#revoke_access_to_all_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) ⇒ nil

Revokes access to all entrances for a specified access system user.

Parameters:

  • acs_system_id (defaults to: nil)

    ID of the access system for which you want to revoke access. You can only provide acs_system_id with user_identity_id.

  • acs_user_id (defaults to: nil)

    ID of the access system user for whom you want to revoke access. You can only provide acs_user_id or user_identity_id.

  • user_identity_id (defaults to: nil)

    ID of the user identity for whom you want to revoke access. You can only provide acs_user_id or user_identity_id.

Returns:

  • (nil)

    OK



103
104
105
106
107
# File 'lib/seam/routes/acs_users.rb', line 103

def revoke_access_to_all_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
  @client.post("/acs/users/revoke_access_to_all_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)

  nil
end

#suspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) ⇒ nil

Suspends a specified access system user. Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can unsuspend them.

Parameters:

  • acs_system_id (defaults to: nil)

    ID of the access system that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.

  • acs_user_id (defaults to: nil)

    ID of the access system user that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.

  • user_identity_id (defaults to: nil)

    ID of the user identity that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.

Returns:

  • (nil)

    OK



114
115
116
117
118
# File 'lib/seam/routes/acs_users.rb', line 114

def suspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
  @client.post("/acs/users/suspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)

  nil
end

#unsuspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) ⇒ nil

Unsuspends a specified suspended access system user. While suspending an access system user revokes their access temporarily, unsuspending the access system user restores their access.

Parameters:

  • acs_system_id (defaults to: nil)

    ID of the access system of the user that you want to unsuspend. You can only provide acs_system_id with user_identity_id.

  • acs_user_id (defaults to: nil)

    ID of the access system user that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.

  • user_identity_id (defaults to: nil)

    ID of the user identity that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.

Returns:

  • (nil)

    OK



125
126
127
128
129
# File 'lib/seam/routes/acs_users.rb', line 125

def unsuspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
  @client.post("/acs/users/unsuspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)

  nil
end

#update(access_schedule: nil, acs_system_id: nil, acs_user_id: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil, user_identity_id: nil) ⇒ nil

Deprecated.

email: use email_address.

Updates the properties of a specified access system user.

Parameters:

  • access_schedule (defaults to: nil)

    starts_at and ends_at timestamps for the access system user's access. If you specify an access_schedule, you may include both starts_at and ends_at. If you omit starts_at, it defaults to the current time. ends_at is optional and must be a time in the future and after starts_at.

  • acs_system_id (defaults to: nil)

    ID of the access system that you want to update. You can only provide acs_system_id with user_identity_id.

  • acs_user_id (defaults to: nil)

    ID of the access system user that you want to update. You can only provide acs_user_id or user_identity_id.

  • email (defaults to: nil)
  • email_address (defaults to: nil)

    Email address of the access system user.

  • full_name (defaults to: nil)

    Full name of the access system user.

  • hid_acs_system_id (defaults to: nil)

    ID of the HID access control system associated with the user.

  • phone_number (defaults to: nil)

    Phone number of the access system user in E.164 format (for example, +15555550100).

  • user_identity_id (defaults to: nil)

    ID of the user identity that you want to update. You can only provide acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id.

Returns:

  • (nil)

    OK



143
144
145
146
147
# File 'lib/seam/routes/acs_users.rb', line 143

def update(access_schedule: nil, acs_system_id: nil, acs_user_id: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil, user_identity_id: nil)
  @client.post("/acs/users/update", {access_schedule: access_schedule, acs_system_id: acs_system_id, acs_user_id: acs_user_id, email: email, email_address: email_address, full_name: full_name, hid_acs_system_id: hid_acs_system_id, phone_number: phone_number, user_identity_id: user_identity_id}.compact)

  nil
end