Class: Seam::Clients::AccessGrantsUnmanaged

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

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ AccessGrantsUnmanaged

Returns a new instance of AccessGrantsUnmanaged.



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

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

Instance Method Details

#get(access_grant_id:) ⇒ Seam::Resources::UnmanagedAccessGrant

Get an unmanaged Access Grant (where is_managed = false).

Parameters:

  • access_grant_id

    ID of unmanaged Access Grant to get.

Returns:



14
15
16
17
18
# File 'lib/seam/routes/access_grants_unmanaged.rb', line 14

def get(access_grant_id:)
  res = @client.post("/access_grants/unmanaged/get", {access_grant_id: access_grant_id}.compact)

  Seam::Resources::UnmanagedAccessGrant.load_from_response(res.body["access_grant"])
end

#list(acs_entrance_id: nil, acs_system_id: nil, limit: nil, page_cursor: nil, reservation_key: nil, user_identity_id: nil) ⇒ Seam::Resources::UnmanagedAccessGrant

Gets unmanaged Access Grants (where is_managed = false).

Parameters:

  • acs_entrance_id (defaults to: nil)

    ID of the entrance by which you want to filter the list of unmanaged Access Grants.

  • acs_system_id (defaults to: nil)

    ID of the access system by which you want to filter the list of unmanaged Access Grants.

  • limit (defaults to: nil)

    Numerical limit on the number of unmanaged access grants to return.

  • page_cursor (defaults to: nil)

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

  • reservation_key (defaults to: nil)

    Filter unmanaged Access Grants by reservation_key.

  • user_identity_id (defaults to: nil)

    ID of user identity by which you want to filter the list of unmanaged Access Grants.

Returns:



28
29
30
31
32
# File 'lib/seam/routes/access_grants_unmanaged.rb', line 28

def list(acs_entrance_id: nil, acs_system_id: nil, limit: nil, page_cursor: nil, reservation_key: nil, user_identity_id: nil)
  res = @client.post("/access_grants/unmanaged/list", {acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, limit: limit, page_cursor: page_cursor, reservation_key: reservation_key, user_identity_id: user_identity_id}.compact)

  Seam::Resources::UnmanagedAccessGrant.load_from_response(res.body["access_grants"])
end

#update(access_grant_id:, is_managed:, access_grant_key: nil) ⇒ nil

Updates an unmanaged Access Grant to make it managed.

This endpoint can only be used to convert unmanaged access grants to managed ones by setting is_managed to true. It cannot be used to convert managed access grants back to unmanaged.

When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed.

Parameters:

  • access_grant_id

    ID of the unmanaged Access Grant to update.

  • is_managed

    Must be set to true to convert the unmanaged access grant to managed.

  • access_grant_key (defaults to: nil)

    Unique key for the access grant. If not provided, the existing key will be preserved.

Returns:

  • (nil)

    OK



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

def update(access_grant_id:, is_managed:, access_grant_key: nil)
  @client.post("/access_grants/unmanaged/update", {access_grant_id: access_grant_id, is_managed: is_managed, access_grant_key: access_grant_key}.compact)

  nil
end