Class: Seam::Clients::AcsEntrances

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

Instance Method Summary collapse

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.

Parameters:

  • acs_entrance_id

    ID of the entrance that you want to get.

Returns:



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.

Parameters:

  • acs_entrance_id

    ID of the entrance to which you want to grant an access system user access.

  • acs_user_id (defaults to: nil)

    ID of the access system user to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id.

  • user_identity_id (defaults to: nil)

    ID of the user identity to whom you want to grant access to an entrance. 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



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

Deprecated.

location_id: Use space_id.

Returns a list of all access system entrances.

Parameters:

  • access_method_id (defaults to: nil)

    ID of the access method for which you want to retrieve all entrances to which it grants access.

  • acs_credential_id (defaults to: nil)

    ID of the credential for which you want to retrieve all entrances.

  • acs_entrance_ids (defaults to: nil)

    IDs of the entrances for which you want to retrieve all entrances.

  • acs_system_id (defaults to: nil)

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

  • connected_account_id (defaults to: nil)

    ID of the connected account for which you want to retrieve all entrances.

  • customer_key (defaults to: nil)

    Customer key for which you want to list entrances.

  • limit (defaults to: nil)

    Maximum number of records to return per page.

  • location_id (defaults to: nil)
  • 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 entrances to include all records that satisfy a partial match using display_name.

  • space_id (defaults to: nil)

    ID of the space for which you want to list entrances.

Returns:



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: , 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.

Parameters:

  • acs_entrance_id

    ID of the entrance for which you want to list all credentials that grant access.

  • include_if (defaults to: nil)

    Conditions that credentials must meet to be included in the returned list.

Returns:



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.

Parameters:

  • acs_credential_id

    ID of the cloud_key credential to use for the unlock operation.

  • acs_entrance_id

    ID of the entrance to unlock.

Returns:



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