Class: Seam::Clients::UserIdentities
- Inherits:
-
Object
- Object
- Seam::Clients::UserIdentities
- Defined in:
- lib/seam/routes/user_identities.rb
Instance Method Summary collapse
-
#add_acs_user(acs_user_id:, user_identity_id: nil, user_identity_key: nil) ⇒ nil
Adds a specified access system user to a specified user identity.
-
#create(acs_system_ids: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) ⇒ Seam::Resources::UserIdentity
Creates a new user identity.
-
#delete(user_identity_id:) ⇒ nil
Deletes a specified user identity.
-
#generate_instant_key(user_identity_id:, customization_profile_id: nil, max_use_count: nil) ⇒ Seam::Resources::InstantKey
Generates a new instant key for a specified user identity.
-
#get(user_identity_id: nil, user_identity_key: nil) ⇒ Seam::Resources::UserIdentity
Returns a specified user identity.
-
#grant_access_to_device(device_id:, user_identity_id:) ⇒ nil
Grants a specified user identity access to a specified device.
-
#initialize(client:, defaults:) ⇒ UserIdentities
constructor
A new instance of UserIdentities.
-
#list(created_before: nil, credential_manager_acs_system_id: nil, limit: nil, page_cursor: nil, search: nil, user_identity_ids: nil) ⇒ Seam::Resources::UserIdentity
Returns a list of all user identities.
-
#list_accessible_devices(user_identity_id:) ⇒ Seam::Resources::Device
Returns a list of all devices associated with a specified user identity.
-
#list_accessible_entrances(user_identity_id:) ⇒ Seam::Resources::AcsEntrance
Returns a list of all ACS entrances accessible to a specified user identity.
-
#list_acs_systems(user_identity_id:) ⇒ Seam::Resources::AcsSystem
Returns a list of all access systems associated with a specified user identity.
-
#list_acs_users(user_identity_id:) ⇒ Seam::Resources::AcsUser
Returns a list of all access system users assigned to a specified user identity.
-
#remove_acs_user(acs_user_id:, user_identity_id:) ⇒ nil
Removes a specified access system user from a specified user identity.
-
#revoke_access_to_device(device_id:, user_identity_id:) ⇒ nil
Revokes access to a specified device from a specified user identity.
- #unmanaged ⇒ Object
-
#update(user_identity_id:, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) ⇒ nil
Updates a specified user identity.
Constructor Details
#initialize(client:, defaults:) ⇒ UserIdentities
Returns a new instance of UserIdentities.
6 7 8 9 |
# File 'lib/seam/routes/user_identities.rb', line 6 def initialize(client:, defaults:) @client = client @defaults = defaults end |
Instance Method Details
#add_acs_user(acs_user_id:, user_identity_id: nil, user_identity_key: nil) ⇒ nil
Adds a specified access system user to a specified user identity.
You must specify either user_identity_id or user_identity_key to identify the user identity.
If user_identity_key is provided, but the user identity doesn't exist, a new user identity will be created automatically using information from the ACS user.
24 25 26 27 28 |
# File 'lib/seam/routes/user_identities.rb', line 24 def add_acs_user(acs_user_id:, user_identity_id: nil, user_identity_key: nil) @client.post("/user_identities/add_acs_user", {acs_user_id: acs_user_id, user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact) nil end |
#create(acs_system_ids: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) ⇒ Seam::Resources::UserIdentity
Creates a new user identity.
37 38 39 40 41 |
# File 'lib/seam/routes/user_identities.rb', line 37 def create(acs_system_ids: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) res = @client.post("/user_identities/create", {acs_system_ids: acs_system_ids, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact) Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"]) end |
#delete(user_identity_id:) ⇒ nil
Deletes a specified user identity. This deletes the user identity and all associated resources, including any credentials, acs users and client sessions.
46 47 48 49 50 |
# File 'lib/seam/routes/user_identities.rb', line 46 def delete(user_identity_id:) @client.post("/user_identities/delete", {user_identity_id: user_identity_id}.compact) nil end |
#generate_instant_key(user_identity_id:, customization_profile_id: nil, max_use_count: nil) ⇒ Seam::Resources::InstantKey
Generates a new instant key for a specified user identity.
57 58 59 60 61 |
# File 'lib/seam/routes/user_identities.rb', line 57 def generate_instant_key(user_identity_id:, customization_profile_id: nil, max_use_count: nil) res = @client.post("/user_identities/generate_instant_key", {user_identity_id: user_identity_id, customization_profile_id: customization_profile_id, max_use_count: max_use_count}.compact) Seam::Resources::InstantKey.load_from_response(res.body["instant_key"]) end |
#get(user_identity_id: nil, user_identity_key: nil) ⇒ Seam::Resources::UserIdentity
Returns a specified user identity.
67 68 69 70 71 |
# File 'lib/seam/routes/user_identities.rb', line 67 def get(user_identity_id: nil, user_identity_key: nil) res = @client.post("/user_identities/get", {user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact) Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"]) end |
#grant_access_to_device(device_id:, user_identity_id:) ⇒ nil
Grants a specified user identity access to a specified device.
77 78 79 80 81 |
# File 'lib/seam/routes/user_identities.rb', line 77 def grant_access_to_device(device_id:, user_identity_id:) @client.post("/user_identities/grant_access_to_device", {device_id: device_id, user_identity_id: user_identity_id}.compact) nil end |
#list(created_before: nil, credential_manager_acs_system_id: nil, limit: nil, page_cursor: nil, search: nil, user_identity_ids: nil) ⇒ Seam::Resources::UserIdentity
Returns a list of all user identities.
91 92 93 94 95 |
# File 'lib/seam/routes/user_identities.rb', line 91 def list(created_before: nil, credential_manager_acs_system_id: nil, limit: nil, page_cursor: nil, search: nil, user_identity_ids: nil) res = @client.post("/user_identities/list", {created_before: created_before, credential_manager_acs_system_id: credential_manager_acs_system_id, limit: limit, page_cursor: page_cursor, search: search, user_identity_ids: user_identity_ids}.compact) Seam::Resources::UserIdentity.load_from_response(res.body["user_identities"]) end |
#list_accessible_devices(user_identity_id:) ⇒ Seam::Resources::Device
Returns a list of all devices associated with a specified user identity. This includes devices derived from the access grants assigned to the user identity and devices directly linked to the user identity.
100 101 102 103 104 |
# File 'lib/seam/routes/user_identities.rb', line 100 def list_accessible_devices(user_identity_id:) res = @client.post("/user_identities/list_accessible_devices", {user_identity_id: user_identity_id}.compact) Seam::Resources::Device.load_from_response(res.body["devices"]) end |
#list_accessible_entrances(user_identity_id:) ⇒ Seam::Resources::AcsEntrance
Returns a list of all ACS entrances accessible to a specified user identity. This includes entrances derived from the access grants assigned to the user identity and entrances accessible through ACS users linked to the user identity.
109 110 111 112 113 |
# File 'lib/seam/routes/user_identities.rb', line 109 def list_accessible_entrances(user_identity_id:) res = @client.post("/user_identities/list_accessible_entrances", {user_identity_id: user_identity_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) end |
#list_acs_systems(user_identity_id:) ⇒ Seam::Resources::AcsSystem
Returns a list of all access systems associated with a specified user identity.
118 119 120 121 122 |
# File 'lib/seam/routes/user_identities.rb', line 118 def list_acs_systems(user_identity_id:) res = @client.post("/user_identities/list_acs_systems", {user_identity_id: user_identity_id}.compact) Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"]) end |
#list_acs_users(user_identity_id:) ⇒ Seam::Resources::AcsUser
Returns a list of all access system users assigned to a specified user identity.
127 128 129 130 131 |
# File 'lib/seam/routes/user_identities.rb', line 127 def list_acs_users(user_identity_id:) res = @client.post("/user_identities/list_acs_users", {user_identity_id: user_identity_id}.compact) Seam::Resources::AcsUser.load_from_response(res.body["acs_users"]) end |
#remove_acs_user(acs_user_id:, user_identity_id:) ⇒ nil
Removes a specified access system user from a specified user identity.
137 138 139 140 141 |
# File 'lib/seam/routes/user_identities.rb', line 137 def remove_acs_user(acs_user_id:, user_identity_id:) @client.post("/user_identities/remove_acs_user", {acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end |
#revoke_access_to_device(device_id:, user_identity_id:) ⇒ nil
Revokes access to a specified device from a specified user identity.
147 148 149 150 151 |
# File 'lib/seam/routes/user_identities.rb', line 147 def revoke_access_to_device(device_id:, user_identity_id:) @client.post("/user_identities/revoke_access_to_device", {device_id: device_id, user_identity_id: user_identity_id}.compact) nil end |
#unmanaged ⇒ Object
11 12 13 |
# File 'lib/seam/routes/user_identities.rb', line 11 def unmanaged @unmanaged ||= Seam::Clients::UserIdentitiesUnmanaged.new(client: @client, defaults: @defaults) end |
#update(user_identity_id:, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) ⇒ nil
Updates a specified user identity.
160 161 162 163 164 |
# File 'lib/seam/routes/user_identities.rb', line 160 def update(user_identity_id:, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) @client.post("/user_identities/update", {user_identity_id: user_identity_id, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact) nil end |