Class: Seam::Clients::AcsEntrances
- Inherits:
-
Object
- Object
- Seam::Clients::AcsEntrances
- Defined in:
- lib/seam/routes/acs_entrances.rb
Instance Method Summary collapse
-
#get(acs_entrance_id:) ⇒ Seam::Resources::AcsEntrance
Returns a specified access system entrance.
-
#grant_access(acs_entrance_id:, acs_user_id: nil, user_identity_id: nil) ⇒ nil
Grants a specified access system user access to a specified access system entrance.
-
#initialize(client:, defaults:) ⇒ AcsEntrances
constructor
A new instance of AcsEntrances.
-
#list(access_method_id: nil, acs_credential_id: nil, acs_entrance_ids: nil, acs_system_id: nil, connected_account_id: nil, customer_key: nil, limit: nil, location_id: nil, page_cursor: nil, search: nil, space_id: nil) ⇒ Seam::Resources::AcsEntrance
deprecated
Deprecated.
location_id: Use
space_id. -
#list_credentials_with_access(acs_entrance_id:, include_if: nil) ⇒ Seam::Resources::AcsCredential
Returns a list of all credentials with access to a specified entrance.
-
#unlock(acs_credential_id:, acs_entrance_id:, wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Remotely unlocks a specified entrance using a cloud_key credential.
Constructor Details
#initialize(client:, defaults:) ⇒ AcsEntrances
Returns a new instance of AcsEntrances.
8 9 10 11 |
# File 'lib/seam/routes/acs_entrances.rb', line 8 def initialize(client:, defaults:) @client = client @defaults = defaults end |
Instance Method Details
#get(acs_entrance_id:) ⇒ Seam::Resources::AcsEntrance
Returns a specified access system entrance.
16 17 18 19 20 |
# File 'lib/seam/routes/acs_entrances.rb', line 16 def get(acs_entrance_id:) res = @client.post("/acs/entrances/get", {acs_entrance_id: acs_entrance_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrance"]) end |
#grant_access(acs_entrance_id:, acs_user_id: nil, user_identity_id: nil) ⇒ nil
Grants a specified access system user access to a specified access system entrance.
27 28 29 30 31 |
# File 'lib/seam/routes/acs_entrances.rb', line 27 def grant_access(acs_entrance_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/entrances/grant_access", {acs_entrance_id: acs_entrance_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end |
#list(access_method_id: nil, acs_credential_id: nil, acs_entrance_ids: nil, acs_system_id: nil, connected_account_id: nil, customer_key: nil, limit: nil, location_id: nil, page_cursor: nil, search: nil, space_id: nil) ⇒ Seam::Resources::AcsEntrance
location_id: Use space_id.
Returns a list of all access system entrances.
47 48 49 50 51 |
# File 'lib/seam/routes/acs_entrances.rb', line 47 def list(access_method_id: nil, acs_credential_id: nil, acs_entrance_ids: nil, acs_system_id: nil, connected_account_id: nil, customer_key: nil, limit: nil, location_id: nil, page_cursor: nil, search: nil, space_id: nil) res = @client.post("/acs/entrances/list", {access_method_id: access_method_id, acs_credential_id: acs_credential_id, acs_entrance_ids: acs_entrance_ids, acs_system_id: acs_system_id, connected_account_id: connected_account_id, customer_key: customer_key, limit: limit, location_id: location_id, page_cursor: page_cursor, search: search, space_id: space_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) end |
#list_credentials_with_access(acs_entrance_id:, include_if: nil) ⇒ Seam::Resources::AcsCredential
Returns a list of all credentials with access to a specified entrance.
57 58 59 60 61 |
# File 'lib/seam/routes/acs_entrances.rb', line 57 def list_credentials_with_access(acs_entrance_id:, include_if: nil) res = @client.post("/acs/entrances/list_credentials_with_access", {acs_entrance_id: acs_entrance_id, include_if: include_if}.compact) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"]) end |
#unlock(acs_credential_id:, acs_entrance_id:, wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Remotely unlocks a specified entrance using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation.
67 68 69 70 71 72 73 |
# File 'lib/seam/routes/acs_entrances.rb', line 67 def unlock(acs_credential_id:, acs_entrance_id:, wait_for_action_attempt: nil) res = @client.post("/acs/entrances/unlock", {acs_credential_id: acs_credential_id, acs_entrance_id: acs_entrance_id}.compact) wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end |