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, access_grant_key: nil, acs_entrance_ids: nil, customization_profile_id: nil, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, name: nil, reservation_key: nil, space_ids: nil, space_keys: nil, starts_at: nil) ⇒ Object



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

def create(requested_access_methods:, user_identity_id: nil, user_identity: nil, access_grant_key: nil, acs_entrance_ids: nil, customization_profile_id: nil, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, name: nil, reservation_key: nil, space_ids: nil, space_keys: 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, access_grant_key: access_grant_key, acs_entrance_ids: acs_entrance_ids, customization_profile_id: customization_profile_id, device_ids: device_ids, ends_at: ends_at, location: location, location_ids: location_ids, name: name, reservation_key: reservation_key, space_ids: space_ids, space_keys: space_keys, starts_at: starts_at}.compact)

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

#delete(access_grant_id:) ⇒ Object



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

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

  nil
end

#get(access_grant_id: nil, access_grant_key: nil) ⇒ Object



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

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

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


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

def get_related(access_grant_ids:, exclude: nil, include: nil)
  res = @client.post("/access_grants/get_related", {access_grant_ids: access_grant_ids, exclude: exclude, include: include}.compact)

  Seam::Resources::Batch.load_from_response(res.body["batch"])
end

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



39
40
41
42
43
# File 'lib/seam/routes/clients/access_grants.rb', line 39

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

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

#request_access_methods(access_grant_id:, requested_access_methods:) ⇒ Object



45
46
47
48
49
# File 'lib/seam/routes/clients/access_grants.rb', line 45

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

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

#unmanagedObject



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

def unmanaged
  @unmanaged ||= Seam::Clients::AccessGrantsUnmanaged.new(client: @client, defaults: @defaults)
end

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



51
52
53
54
55
# File 'lib/seam/routes/clients/access_grants.rb', line 51

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

  nil
end