diff --git a/lib/seam/routes/clients/access_methods.rb b/lib/seam/routes/clients/access_methods.rb index 9557b47..dc9c973 100644 --- a/lib/seam/routes/clients/access_methods.rb +++ b/lib/seam/routes/clients/access_methods.rb @@ -14,6 +14,12 @@ def unmanaged @unmanaged ||= Seam::Clients::AccessMethodsUnmanaged.new(client: @client, defaults: @defaults) end + def assign_card(access_method_id:, card_number:) + res = @client.post("/access_methods/assign_card", {access_method_id: access_method_id, card_number: card_number}.compact) + + Seam::Resources::AccessMethod.load_from_response(res.body["access_method"]) + end + def delete(access_method_id: nil, access_grant_id: nil, reservation_key: nil) @client.post("/access_methods/delete", {access_method_id: access_method_id, access_grant_id: access_grant_id, reservation_key: reservation_key}.compact) @@ -45,6 +51,14 @@ def list(access_code_id: nil, access_grant_id: nil, access_grant_key: nil, acs_e Seam::Resources::AccessMethod.load_from_response(res.body["access_methods"]) end + + def unlock_door(access_method_id:, acs_entrance_id:, wait_for_action_attempt: nil) + res = @client.post("/access_methods/unlock_door", {access_method_id: access_method_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 end end end diff --git a/lib/seam/routes/resources/access_method.rb b/lib/seam/routes/resources/access_method.rb index 4ae1abc..492aebd 100644 --- a/lib/seam/routes/resources/access_method.rb +++ b/lib/seam/routes/resources/access_method.rb @@ -3,7 +3,7 @@ module Seam module Resources class AccessMethod < BaseResource - attr_accessor :access_method_id, :client_session_token, :code, :customization_profile_id, :display_name, :instant_key_url, :is_encoding_required, :is_issued, :is_ready_for_encoding, :mode, :pending_mutations, :workspace_id + attr_accessor :access_method_id, :client_session_token, :code, :customization_profile_id, :display_name, :instant_key_url, :is_assignment_required, :is_encoding_required, :is_issued, :is_ready_for_assignment, :is_ready_for_encoding, :mode, :pending_mutations, :workspace_id date_accessor :created_at, :issued_at diff --git a/package-lock.json b/package-lock.json index cae853a..1fce8b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.86.0", "@seamapi/nextlove-sdk-generator": "^1.19.10", - "@seamapi/types": "1.874.0", + "@seamapi/types": "1.878.0", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5" @@ -536,9 +536,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.874.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.874.0.tgz", - "integrity": "sha512-dx9B6ZONj/jeySZCrwAIxsHEwdy/jCKKVgQB3wVGsW+PPaSIdzMTmb5IrTFtFt1gxZ0E3R00Q8mfD3IehvcJLw==", + "version": "1.878.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.878.0.tgz", + "integrity": "sha512-FnOvLZiSW6DKo2XFi+nwv96Sh1Vd0MheJ/N1OvAgVSk8X2nW4XrJkmUB4IHEQHhYUAXTbCTOq5O8oUpIgwEJZw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 32eee8e..1c72e7b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.86.0", "@seamapi/nextlove-sdk-generator": "^1.19.10", - "@seamapi/types": "1.874.0", + "@seamapi/types": "1.878.0", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5"