diff --git a/lib/seam/routes/clients/access_grants.rb b/lib/seam/routes/clients/access_grants.rb index 7d8eca4d..113eb820 100644 --- a/lib/seam/routes/clients/access_grants.rb +++ b/lib/seam/routes/clients/access_grants.rb @@ -9,9 +9,9 @@ def initialize(client:, defaults:) end 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) - @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) + 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) - nil + Seam::Resources::AccessGrant.load_from_response(res.body["access_grant"]) end def delete(access_grant_id:) @@ -21,15 +21,15 @@ def delete(access_grant_id:) end def get(access_grant_id:) - @client.post("/access_grants/get", {access_grant_id: access_grant_id}.compact) + res = @client.post("/access_grants/get", {access_grant_id: access_grant_id}.compact) - nil + Seam::Resources::AccessGrant.load_from_response(res.body["access_grant"]) end def list(acs_entrance_id: nil, acs_system_id: nil, location_id: nil, space_id: nil, user_identity_id: nil) - @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) + 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) - nil + Seam::Resources::AccessGrant.load_from_response(res.body["access_grants"]) end end end diff --git a/lib/seam/routes/clients/access_methods.rb b/lib/seam/routes/clients/access_methods.rb index c681c76f..05e5d1a2 100644 --- a/lib/seam/routes/clients/access_methods.rb +++ b/lib/seam/routes/clients/access_methods.rb @@ -15,15 +15,15 @@ def delete(access_method_id:) end def get(access_method_id:) - @client.post("/access_methods/get", {access_method_id: access_method_id}.compact) + res = @client.post("/access_methods/get", {access_method_id: access_method_id}.compact) - nil + Seam::Resources::AccessMethod.load_from_response(res.body["access_method"]) end def list(access_grant_id:) - @client.post("/access_methods/list", {access_grant_id: access_grant_id}.compact) + res = @client.post("/access_methods/list", {access_grant_id: access_grant_id}.compact) - nil + Seam::Resources::AccessMethod.load_from_response(res.body["access_methods"]) end end end diff --git a/lib/seam/routes/resources/access_grant.rb b/lib/seam/routes/resources/access_grant.rb new file mode 100644 index 00000000..794eb1c3 --- /dev/null +++ b/lib/seam/routes/resources/access_grant.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Seam + module Resources + class AccessGrant < BaseResource + attr_accessor :access_grant_id, :access_method_ids, :display_name, :location_ids, :requested_access_methods, :space_ids, :user_identity_id, :workspace_id + + date_accessor :created_at + end + end +end diff --git a/lib/seam/routes/resources/access_method.rb b/lib/seam/routes/resources/access_method.rb new file mode 100644 index 00000000..e63a8493 --- /dev/null +++ b/lib/seam/routes/resources/access_method.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Seam + module Resources + class AccessMethod < BaseResource + attr_accessor :access_method_id, :display_name, :instant_key_url, :is_card_encoding_required, :mode, :workspace_id + + date_accessor :created_at, :issued_at + end + end +end diff --git a/lib/seam/routes/resources/index.rb b/lib/seam/routes/resources/index.rb index 9fef35f7..ca9886b1 100644 --- a/lib/seam/routes/resources/index.rb +++ b/lib/seam/routes/resources/index.rb @@ -6,6 +6,8 @@ require_relative "resource_errors_support" require_relative "resource_warnings_support" require_relative "access_code" +require_relative "access_grant" +require_relative "access_method" require_relative "acs_access_group" require_relative "acs_credential" require_relative "acs_credential_pool" diff --git a/package-lock.json b/package-lock.json index bb31635d..50acae2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.83.1", "@seamapi/nextlove-sdk-generator": "^1.18.1", - "@seamapi/types": "1.410.1", + "@seamapi/types": "1.411.1", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5" @@ -476,9 +476,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.410.1", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.410.1.tgz", - "integrity": "sha512-PmPBVbx2B7sRirjJYMx4DMoHWJwZT0cZTkM0NioUa6AfCzcRUi3uT1ZG/efy2SeTTSm1NqMf90mNoQ8EaNrdjQ==", + "version": "1.411.1", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.411.1.tgz", + "integrity": "sha512-ZXQ2JjNoKs094/NHx6wVigNbfdQtHa6aCrOiIDBPiW/IfGuEW8cG+eojI1EmODdG/zD0OCZnkqCrcdFy9YcY0Q==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index fd377c64..486802e7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.83.1", "@seamapi/nextlove-sdk-generator": "^1.18.1", - "@seamapi/types": "1.410.1", + "@seamapi/types": "1.411.1", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5"