Class: Seam::Clients::AcsCredentials
- Inherits:
-
Object
- Object
- Seam::Clients::AcsCredentials
- Defined in:
- lib/seam/routes/acs_credentials.rb
Instance Method Summary collapse
-
#assign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil) ⇒ nil
Assigns a specified credential to a specified access system user.
-
#create(access_method:, acs_system_id: nil, acs_user_id: nil, allowed_acs_entrance_ids: nil, assa_abloy_vostio_metadata: nil, code: nil, credential_manager_acs_system_id: nil, ends_at: nil, is_multi_phone_sync_credential: nil, salto_space_metadata: nil, starts_at: nil, user_identity_id: nil, visionline_metadata: nil) ⇒ Seam::Resources::AcsCredential
Creates a new credential for a specified ACS user.
-
#delete(acs_credential_id:) ⇒ nil
Deletes a specified credential.
-
#get(acs_credential_id:) ⇒ Seam::Resources::AcsCredential
Returns a specified credential.
-
#initialize(client:, defaults:) ⇒ AcsCredentials
constructor
A new instance of AcsCredentials.
-
#list(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil, created_before: nil, is_multi_phone_sync_credential: nil, limit: nil, page_cursor: nil, search: nil) ⇒ Seam::Resources::AcsCredential
Returns a list of all credentials.
-
#list_accessible_entrances(acs_credential_id:) ⇒ Seam::Resources::AcsEntrance
Returns a list of all entrances to which a credential grants access.
-
#unassign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil) ⇒ nil
Unassigns a specified credential from a specified access system user.
-
#update(acs_credential_id:, code: nil, ends_at: nil) ⇒ nil
Updates the code and ends at date and time for a specified credential.
Constructor Details
#initialize(client:, defaults:) ⇒ AcsCredentials
Returns a new instance of AcsCredentials.
6 7 8 9 |
# File 'lib/seam/routes/acs_credentials.rb', line 6 def initialize(client:, defaults:) @client = client @defaults = defaults end |
Instance Method Details
#assign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil) ⇒ nil
Assigns a specified credential to a specified access system user.
16 17 18 19 20 |
# File 'lib/seam/routes/acs_credentials.rb', line 16 def assign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/credentials/assign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end |
#create(access_method:, acs_system_id: nil, acs_user_id: nil, allowed_acs_entrance_ids: nil, assa_abloy_vostio_metadata: nil, code: nil, credential_manager_acs_system_id: nil, ends_at: nil, is_multi_phone_sync_credential: nil, salto_space_metadata: nil, starts_at: nil, user_identity_id: nil, visionline_metadata: nil) ⇒ Seam::Resources::AcsCredential
Creates a new credential for a specified ACS user. For granting access, we recommend Access Grants instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential.
37 38 39 40 41 |
# File 'lib/seam/routes/acs_credentials.rb', line 37 def create(access_method:, acs_system_id: nil, acs_user_id: nil, allowed_acs_entrance_ids: nil, assa_abloy_vostio_metadata: nil, code: nil, credential_manager_acs_system_id: nil, ends_at: nil, is_multi_phone_sync_credential: nil, salto_space_metadata: nil, starts_at: nil, user_identity_id: nil, visionline_metadata: nil) res = @client.post("/acs/credentials/create", {access_method: access_method, acs_system_id: acs_system_id, acs_user_id: acs_user_id, allowed_acs_entrance_ids: allowed_acs_entrance_ids, assa_abloy_vostio_metadata: , code: code, credential_manager_acs_system_id: credential_manager_acs_system_id, ends_at: ends_at, is_multi_phone_sync_credential: is_multi_phone_sync_credential, salto_space_metadata: , starts_at: starts_at, user_identity_id: user_identity_id, visionline_metadata: }.compact) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"]) end |
#delete(acs_credential_id:) ⇒ nil
Deletes a specified credential.
46 47 48 49 50 |
# File 'lib/seam/routes/acs_credentials.rb', line 46 def delete(acs_credential_id:) @client.post("/acs/credentials/delete", {acs_credential_id: acs_credential_id}.compact) nil end |
#get(acs_credential_id:) ⇒ Seam::Resources::AcsCredential
Returns a specified credential.
55 56 57 58 59 |
# File 'lib/seam/routes/acs_credentials.rb', line 55 def get(acs_credential_id:) res = @client.post("/acs/credentials/get", {acs_credential_id: acs_credential_id}.compact) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"]) end |
#list(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil, created_before: nil, is_multi_phone_sync_credential: nil, limit: nil, page_cursor: nil, search: nil) ⇒ Seam::Resources::AcsCredential
Returns a list of all credentials.
71 72 73 74 75 |
# File 'lib/seam/routes/acs_credentials.rb', line 71 def list(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil, created_before: nil, is_multi_phone_sync_credential: nil, limit: nil, page_cursor: nil, search: nil) res = @client.post("/acs/credentials/list", {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id, created_before: created_before, is_multi_phone_sync_credential: is_multi_phone_sync_credential, limit: limit, page_cursor: page_cursor, search: search}.compact) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"]) end |
#list_accessible_entrances(acs_credential_id:) ⇒ Seam::Resources::AcsEntrance
Returns a list of all entrances to which a credential grants access.
80 81 82 83 84 |
# File 'lib/seam/routes/acs_credentials.rb', line 80 def list_accessible_entrances(acs_credential_id:) res = @client.post("/acs/credentials/list_accessible_entrances", {acs_credential_id: acs_credential_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) end |
#unassign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil) ⇒ nil
Unassigns a specified credential from a specified access system user.
91 92 93 94 95 |
# File 'lib/seam/routes/acs_credentials.rb', line 91 def unassign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/credentials/unassign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end |
#update(acs_credential_id:, code: nil, ends_at: nil) ⇒ nil
Updates the code and ends at date and time for a specified credential.
102 103 104 105 106 |
# File 'lib/seam/routes/acs_credentials.rb', line 102 def update(acs_credential_id:, code: nil, ends_at: nil) @client.post("/acs/credentials/update", {acs_credential_id: acs_credential_id, code: code, ends_at: ends_at}.compact) nil end |