diff --git a/lib/seam/routes/clients/access_methods.rb b/lib/seam/routes/clients/access_methods.rb index dc9c973..15e33cb 100644 --- a/lib/seam/routes/clients/access_methods.rb +++ b/lib/seam/routes/clients/access_methods.rb @@ -14,10 +14,12 @@ def unmanaged @unmanaged ||= Seam::Clients::AccessMethodsUnmanaged.new(client: @client, defaults: @defaults) end - def assign_card(access_method_id:, card_number:) + def assign_card(access_method_id:, card_number:, wait_for_action_attempt: nil) 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"]) + 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 def delete(access_method_id: nil, access_grant_id: nil, reservation_key: nil) diff --git a/lib/seam/routes/clients/spaces.rb b/lib/seam/routes/clients/spaces.rb index 1753142..58c1f09 100644 --- a/lib/seam/routes/clients/spaces.rb +++ b/lib/seam/routes/clients/spaces.rb @@ -74,8 +74,8 @@ def remove_devices(device_ids:, space_id:) nil end - def update(acs_entrance_ids: nil, customer_data: nil, customer_key: nil, device_ids: nil, name: nil, space_id: nil, space_key: nil) - res = @client.post("/spaces/update", {acs_entrance_ids: acs_entrance_ids, customer_data: customer_data, customer_key: customer_key, device_ids: device_ids, name: name, space_id: space_id, space_key: space_key}.compact) + def update(acs_entrance_ids: nil, customer_data: nil, device_ids: nil, name: nil, space_id: nil, space_key: nil) + res = @client.post("/spaces/update", {acs_entrance_ids: acs_entrance_ids, customer_data: customer_data, device_ids: device_ids, name: name, space_id: space_id, space_key: space_key}.compact) Seam::Resources::Space.load_from_response(res.body["space"]) end diff --git a/package-lock.json b/package-lock.json index 1fce8b9..5c1d6d2 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.878.0", + "@seamapi/types": "1.885.0", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5" @@ -536,9 +536,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.878.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.878.0.tgz", - "integrity": "sha512-FnOvLZiSW6DKo2XFi+nwv96Sh1Vd0MheJ/N1OvAgVSk8X2nW4XrJkmUB4IHEQHhYUAXTbCTOq5O8oUpIgwEJZw==", + "version": "1.885.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.885.0.tgz", + "integrity": "sha512-6UZr0c5a8xY0G3+rx5d7akRyBGfjlBy4W9rg2ZBIdQyc1PwwNDsHUyfhbobxin/EV9vi+EI91KHm51/Ont74SQ==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 1c72e7b..ed27f92 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.878.0", + "@seamapi/types": "1.885.0", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5"