Class: Seam::Clients::AccessGrants
- Inherits:
-
Object
- Object
- Seam::Clients::AccessGrants
- Defined in:
- lib/seam/routes/clients/access_grants.rb
Instance Method Summary collapse
- #create(requested_access_methods:, user_identity_id: nil, user_identity: nil, access_grant_key: nil, acs_entrance_ids: nil, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, name: nil, space_ids: nil, space_keys: nil, starts_at: nil) ⇒ Object
- #delete(access_grant_id:) ⇒ Object
- #get(access_grant_id: nil, access_grant_key: nil) ⇒ Object
- #get_related(access_grant_ids:, exclude: nil, include: nil) ⇒ Object
-
#initialize(client:, defaults:) ⇒ AccessGrants
constructor
A new instance of AccessGrants.
- #list(access_grant_key: nil, acs_entrance_id: nil, acs_system_id: nil, location_id: nil, space_id: nil, user_identity_id: nil) ⇒ Object
- #update(access_grant_id:, ends_at: nil, name: nil, starts_at: nil) ⇒ Object
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, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, name: nil, space_ids: nil, space_keys: 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, access_grant_key: nil, acs_entrance_ids: nil, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, name: 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, device_ids: device_ids, ends_at: ends_at, location: location, location_ids: location_ids, name: name, 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
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: nil, access_grant_key: nil) ⇒ Object
23 24 25 26 27 |
# File 'lib/seam/routes/clients/access_grants.rb', line 23 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 |
#get_related(access_grant_ids:, exclude: nil, include: nil) ⇒ Object
29 30 31 32 33 |
# File 'lib/seam/routes/clients/access_grants.rb', line 29 def (access_grant_ids:, exclude: nil, include: nil) @client.post("/access_grants/get_related", {access_grant_ids: access_grant_ids, exclude: exclude, include: include}.compact) nil end |
#list(access_grant_key: nil, acs_entrance_id: nil, acs_system_id: nil, location_id: nil, space_id: nil, user_identity_id: nil) ⇒ Object
35 36 37 38 39 |
# File 'lib/seam/routes/clients/access_grants.rb', line 35 def list(access_grant_key: nil, acs_entrance_id: nil, acs_system_id: nil, location_id: 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, 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, name: nil, starts_at: nil) ⇒ Object
41 42 43 44 45 |
# File 'lib/seam/routes/clients/access_grants.rb', line 41 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 |