Class: Seam::Clients::AccessGrants

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

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ AccessGrants

Returns a new instance of AccessGrants.



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

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

Instance Method Details

#create(requested_access_methods:, user_identity_id: nil, user_identity: nil, acs_entrance_ids: nil, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, space_ids: nil, starts_at: nil) ⇒ Object



11
12
13
14
15
# File 'lib/seam/routes/clients/access_grants.rb', line 11

def create(requested_access_methods:, user_identity_id: nil, user_identity: nil, acs_entrance_ids: nil, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, space_ids: nil, starts_at: nil)
  res = @client.post("/access_grants/create", {requested_access_methods: requested_access_methods, user_identity_id: user_identity_id, user_identity: user_identity, acs_entrance_ids: acs_entrance_ids, device_ids: device_ids, ends_at: ends_at, location: location, location_ids: location_ids, space_ids: space_ids, starts_at: starts_at}.compact)

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

#delete(access_grant_id:) ⇒ Object



17
18
19
20
21
# File 'lib/seam/routes/clients/access_grants.rb', line 17

def delete(access_grant_id:)
  @client.post("/access_grants/delete", {access_grant_id: access_grant_id}.compact)

  nil
end

#get(access_grant_id:) ⇒ Object



23
24
25
26
27
# File 'lib/seam/routes/clients/access_grants.rb', line 23

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

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

#list(acs_entrance_id: nil, acs_system_id: nil, location_id: nil, space_id: nil, user_identity_id: nil) ⇒ Object



29
30
31
32
33
# File 'lib/seam/routes/clients/access_grants.rb', line 29

def list(acs_entrance_id: nil, acs_system_id: nil, location_id: nil, space_id: nil, user_identity_id: nil)
  res = @client.post("/access_grants/list", {acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, location_id: location_id, space_id: space_id, user_identity_id: user_identity_id}.compact)

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

#update(access_grant_id:, ends_at: nil, starts_at: nil) ⇒ Object



35
36
37
38
39
# File 'lib/seam/routes/clients/access_grants.rb', line 35

def update(access_grant_id:, ends_at: nil, starts_at: nil)
  @client.post("/access_grants/update", {access_grant_id: access_grant_id, ends_at: ends_at, starts_at: starts_at}.compact)

  nil
end