From 76b4b92d0f466f27215aee6c59696ecbc158522f Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 12 Aug 2026 23:34:20 -0700 Subject: [PATCH 1/3] fix: Throw is trying to use paginator with unsupported endpoint --- lib/seam/paginator.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/seam/paginator.rb b/lib/seam/paginator.rb index 4e6ebe32..00ab87b3 100644 --- a/lib/seam/paginator.rb +++ b/lib/seam/paginator.rb @@ -11,6 +11,9 @@ class Paginator def initialize(request, params = {}) raise ArgumentError, "request must be a Method" unless request.is_a?(Method) raise ArgumentError, "params must be a Hash" unless params.is_a?(Hash) + unless request.parameters.any? { |_, name| name == :page_cursor } + raise ArgumentError, "request does not support pagination" + end @request = request @params = params.transform_keys(&:to_sym) From cf2b1d7f549e0a55d59d4e590e38f3310865540b Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Wed, 12 Aug 2026 23:38:59 -0700 Subject: [PATCH 2/3] fix: Throw if missing required parameter --- codegen/layouts/partials/client-method.hbs | 7 ++++++- codegen/lib/layouts/client.ts | 2 ++ codegen/lib/routes.ts | 3 +++ codegen/lib/ruby-client.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/codegen/layouts/partials/client-method.hbs b/codegen/layouts/partials/client-method.hbs index 5204dadc..8e7155a5 100644 --- a/codegen/layouts/partials/client-method.hbs +++ b/codegen/layouts/partials/client-method.hbs @@ -9,7 +9,12 @@ {{{rubyDeprecatedDoc this 6}}} {{/if}} def {{name}}{{#if hasSignature}}({{signatureParams}}){{/if}} - {{#if usesRes}}res = {{/if}}@client.post("{{path}}"{{#if hasParams}}, {{bodyParams}}.compact{{/if}}) +{{#if requiresAtLeastOneParameter}} + if {{#each parameters}}{{name}}.nil?{{#unless @last}} && {{/unless}}{{/each}} + raise TypeError, "At least one parameter is required for {{path}}" + end + +{{/if}} {{#if usesRes}}res = {{/if}}@client.post("{{path}}"{{#if hasParams}}, {{bodyParams}}.compact{{/if}}) {{#if isResource}} Seam::Resources::{{returnResource}}.load_from_response(res.body["{{returnPath}}"]) diff --git a/codegen/lib/layouts/client.ts b/codegen/lib/layouts/client.ts index 350fa3e4..94504cb2 100644 --- a/codegen/lib/layouts/client.ts +++ b/codegen/lib/layouts/client.ts @@ -13,6 +13,7 @@ export interface ClientMethodLayoutContext { isDeprecated: boolean deprecationMessage: string responseDescription: string + requiresAtLeastOneParameter: boolean parameters: ClientMethod['parameters'] name: string hasSignature: boolean @@ -64,6 +65,7 @@ const getMethodLayoutContext = ( isDeprecated: method.isDeprecated, deprecationMessage: method.deprecationMessage, responseDescription: method.responseDescription, + requiresAtLeastOneParameter: method.requiresAtLeastOneParameter, parameters: sortedParameters, name: methodName, hasSignature: signatureParams.length > 0, diff --git a/codegen/lib/routes.ts b/codegen/lib/routes.ts index 38a882c3..e938056e 100644 --- a/codegen/lib/routes.ts +++ b/codegen/lib/routes.ts @@ -212,6 +212,9 @@ const createClientMethod = (endpoint: Endpoint): ClientMethod => { isDeprecated: endpoint.isDeprecated, deprecationMessage: endpoint.deprecationMessage, responseDescription: endpoint.response.description, + requiresAtLeastOneParameter: + endpoint.request.hasRequiredParameters && + endpoint.request.parameters.every(({ isRequired }) => !isRequired), path: endpoint.path, parameters: endpoint.request.parameters.map((parameter) => ({ name: parameter.name, diff --git a/codegen/lib/ruby-client.ts b/codegen/lib/ruby-client.ts index 60a459f8..ab05a5bc 100644 --- a/codegen/lib/ruby-client.ts +++ b/codegen/lib/ruby-client.ts @@ -18,6 +18,7 @@ export interface ClientMethod { isDeprecated: boolean deprecationMessage: string responseDescription: string + requiresAtLeastOneParameter: boolean path: string parameters: ClientMethodParameter[] returnResource: string | null From dcd331e0ada68fc43bd36395c3c8e82c72b503ad Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Thu, 13 Aug 2026 06:39:58 +0000 Subject: [PATCH 3/3] ci: Generate code --- lib/seam/routes/access_codes.rb | 8 +++++++ lib/seam/routes/access_codes_unmanaged.rb | 4 ++++ lib/seam/routes/access_grants.rb | 12 ++++++++++ lib/seam/routes/access_methods.rb | 8 +++++++ lib/seam/routes/acs_users.rb | 28 +++++++++++++++++++++++ lib/seam/routes/client_sessions.rb | 4 ++++ lib/seam/routes/connected_accounts.rb | 4 ++++ lib/seam/routes/devices.rb | 4 ++++ lib/seam/routes/devices_unmanaged.rb | 4 ++++ lib/seam/routes/events.rb | 8 +++++++ lib/seam/routes/instant_keys.rb | 4 ++++ lib/seam/routes/locks.rb | 4 ++++ lib/seam/routes/spaces.rb | 8 +++++++ lib/seam/routes/user_identities.rb | 4 ++++ 14 files changed, 104 insertions(+) diff --git a/lib/seam/routes/access_codes.rb b/lib/seam/routes/access_codes.rb index c8bddf80..c4dfce6f 100644 --- a/lib/seam/routes/access_codes.rb +++ b/lib/seam/routes/access_codes.rb @@ -110,6 +110,10 @@ def generate_code(device_id:) # @param device_id [String, nil] ID of the device containing the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. # @return [Seam::Resources::AccessCode] OK def get(access_code_id: nil, code: nil, device_id: nil) + if access_code_id.nil? && code.nil? && device_id.nil? + raise TypeError, "At least one parameter is required for /access_codes/get" + end + res = @client.post("/access_codes/get", {access_code_id: access_code_id, code: code, device_id: device_id}.compact) Seam::Resources::AccessCode.load_from_response(res.body["access_code"]) @@ -130,6 +134,10 @@ def get(access_code_id: nil, code: nil, device_id: nil) # @param user_identifier_key [String, nil] Your user ID for the user by which to filter access codes. # @return [Seam::Resources::AccessCode] OK def list(access_code_ids: nil, access_grant_id: nil, access_grant_key: nil, access_method_id: nil, customer_key: nil, device_id: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil) + if access_code_ids.nil? && access_grant_id.nil? && access_grant_key.nil? && access_method_id.nil? && customer_key.nil? && device_id.nil? && limit.nil? && page_cursor.nil? && search.nil? && user_identifier_key.nil? + raise TypeError, "At least one parameter is required for /access_codes/list" + end + res = @client.post("/access_codes/list", {access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_key: access_grant_key, access_method_id: access_method_id, customer_key: customer_key, device_id: device_id, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact) Seam::Resources::AccessCode.load_from_response(res.body["access_codes"]) diff --git a/lib/seam/routes/access_codes_unmanaged.rb b/lib/seam/routes/access_codes_unmanaged.rb index ffd25ead..bfb092f5 100644 --- a/lib/seam/routes/access_codes_unmanaged.rb +++ b/lib/seam/routes/access_codes_unmanaged.rb @@ -41,6 +41,10 @@ def delete(access_code_id:) # @param device_id [String, nil] ID of the device containing the unmanaged access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. # @return [Seam::Resources::UnmanagedAccessCode] OK def get(access_code_id: nil, code: nil, device_id: nil) + if access_code_id.nil? && code.nil? && device_id.nil? + raise TypeError, "At least one parameter is required for /access_codes/unmanaged/get" + end + res = @client.post("/access_codes/unmanaged/get", {access_code_id: access_code_id, code: code, device_id: device_id}.compact) Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_code"]) diff --git a/lib/seam/routes/access_grants.rb b/lib/seam/routes/access_grants.rb index 2b02927b..f942ae93 100644 --- a/lib/seam/routes/access_grants.rb +++ b/lib/seam/routes/access_grants.rb @@ -51,6 +51,10 @@ def delete(access_grant_id:) # @param access_grant_key [String, nil] Unique key of Access Grant to get. # @return [Seam::Resources::AccessGrant] OK def get(access_grant_id: nil, access_grant_key: nil) + if access_grant_id.nil? && access_grant_key.nil? + raise TypeError, "At least one parameter is required for /access_grants/get" + end + 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"]) @@ -63,6 +67,10 @@ def get(access_grant_id: nil, access_grant_key: nil) # @param include [Array, nil] # @return [Seam::Resources::Batch] OK def get_related(access_grant_ids: nil, access_grant_keys: nil, exclude: nil, include: nil) + if access_grant_ids.nil? && access_grant_keys.nil? && exclude.nil? && include.nil? + raise TypeError, "At least one parameter is required for /access_grants/get_related" + end + res = @client.post("/access_grants/get_related", {access_grant_ids: access_grant_ids, access_grant_keys: access_grant_keys, exclude: exclude, include: include}.compact) Seam::Resources::Batch.load_from_response(res.body["batch"]) @@ -108,6 +116,10 @@ def request_access_methods(access_grant_id:, requested_access_methods:) # @param starts_at [Time, nil] Date and time at which the validity of the grant starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. # @return [nil] OK def update(access_grant_id: nil, access_grant_key: nil, ends_at: nil, name: nil, starts_at: nil) + if access_grant_id.nil? && access_grant_key.nil? && ends_at.nil? && name.nil? && starts_at.nil? + raise TypeError, "At least one parameter is required for /access_grants/update" + end + @client.post("/access_grants/update", {access_grant_id: access_grant_id, access_grant_key: access_grant_key, ends_at: ends_at, name: name, starts_at: starts_at}.compact) nil diff --git a/lib/seam/routes/access_methods.rb b/lib/seam/routes/access_methods.rb index 02a589b0..320f3360 100644 --- a/lib/seam/routes/access_methods.rb +++ b/lib/seam/routes/access_methods.rb @@ -32,6 +32,10 @@ def assign_card(access_method_id:, card_number:, wait_for_action_attempt: nil) # @param reservation_key [String, nil] Reservation key of the access grant whose access methods should be deleted. # @return [nil] OK def delete(access_method_id: nil, access_grant_id: nil, reservation_key: nil) + if access_method_id.nil? && access_grant_id.nil? && reservation_key.nil? + raise TypeError, "At least one parameter is required for /access_methods/delete" + end + @client.post("/access_methods/delete", {access_method_id: access_method_id, access_grant_id: access_grant_id, reservation_key: reservation_key}.compact) nil @@ -80,6 +84,10 @@ def get_related(access_method_ids:, exclude: nil, include: nil) # @param space_id [String, nil] ID of the space by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. # @return [Seam::Resources::AccessMethod] OK def list(access_code_id: nil, access_grant_id: nil, access_grant_key: nil, acs_entrance_id: nil, device_id: nil, limit: nil, page_cursor: nil, space_id: nil) + if access_code_id.nil? && access_grant_id.nil? && access_grant_key.nil? && acs_entrance_id.nil? && device_id.nil? && limit.nil? && page_cursor.nil? && space_id.nil? + raise TypeError, "At least one parameter is required for /access_methods/list" + end + res = @client.post("/access_methods/list", {access_code_id: access_code_id, access_grant_id: access_grant_id, access_grant_key: access_grant_key, acs_entrance_id: acs_entrance_id, device_id: device_id, limit: limit, page_cursor: page_cursor, space_id: space_id}.compact) Seam::Resources::AccessMethod.load_from_response(res.body["access_methods"]) diff --git a/lib/seam/routes/acs_users.rb b/lib/seam/routes/acs_users.rb index 777551af..b68596a0 100644 --- a/lib/seam/routes/acs_users.rb +++ b/lib/seam/routes/acs_users.rb @@ -41,6 +41,10 @@ def create(acs_system_id:, full_name:, access_schedule: nil, acs_access_group_id # @param user_identity_id [String, nil] ID of the user identity that you want to delete. You must provide either acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. # @return [nil] OK def delete(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) + if acs_system_id.nil? && acs_user_id.nil? && user_identity_id.nil? + raise TypeError, "At least one parameter is required for /acs/users/delete" + end + @client.post("/acs/users/delete", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil @@ -52,6 +56,10 @@ def delete(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) # @param user_identity_id [String, nil] ID of the user identity that you want to get. You can only provide acs_user_id or user_identity_id. # @return [Seam::Resources::AcsUser] OK def get(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil) + if acs_user_id.nil? && acs_system_id.nil? && user_identity_id.nil? + raise TypeError, "At least one parameter is required for /acs/users/get" + end + res = @client.post("/acs/users/get", {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id}.compact) Seam::Resources::AcsUser.load_from_response(res.body["acs_user"]) @@ -79,6 +87,10 @@ def list(acs_system_id: nil, created_before: nil, limit: nil, page_cursor: nil, # @param user_identity_id [String, nil] ID of the user identity for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. # @return [Seam::Resources::AcsEntrance] OK def list_accessible_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) + if acs_system_id.nil? && acs_user_id.nil? && user_identity_id.nil? + raise TypeError, "At least one parameter is required for /acs/users/list_accessible_entrances" + end + res = @client.post("/acs/users/list_accessible_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) @@ -101,6 +113,10 @@ def remove_from_access_group(acs_access_group_id:, acs_user_id: nil, user_identi # @param user_identity_id [String, nil] ID of the user identity for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. # @return [nil] OK def revoke_access_to_all_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) + if acs_system_id.nil? && acs_user_id.nil? && user_identity_id.nil? + raise TypeError, "At least one parameter is required for /acs/users/revoke_access_to_all_entrances" + end + @client.post("/acs/users/revoke_access_to_all_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil @@ -112,6 +128,10 @@ def revoke_access_to_all_entrances(acs_system_id: nil, acs_user_id: nil, user_id # @param user_identity_id [String, nil] ID of the user identity that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. # @return [nil] OK def suspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) + if acs_system_id.nil? && acs_user_id.nil? && user_identity_id.nil? + raise TypeError, "At least one parameter is required for /acs/users/suspend" + end + @client.post("/acs/users/suspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil @@ -123,6 +143,10 @@ def suspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) # @param user_identity_id [String, nil] ID of the user identity that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. # @return [nil] OK def unsuspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) + if acs_system_id.nil? && acs_user_id.nil? && user_identity_id.nil? + raise TypeError, "At least one parameter is required for /acs/users/unsuspend" + end + @client.post("/acs/users/unsuspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil @@ -141,6 +165,10 @@ def unsuspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) # @param user_identity_id [String, nil] ID of the user identity that you want to update. You can only provide acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. # @return [nil] OK def update(access_schedule: nil, acs_system_id: nil, acs_user_id: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil, user_identity_id: nil) + if access_schedule.nil? && acs_system_id.nil? && acs_user_id.nil? && email.nil? && email_address.nil? && full_name.nil? && hid_acs_system_id.nil? && phone_number.nil? && user_identity_id.nil? + raise TypeError, "At least one parameter is required for /acs/users/update" + end + @client.post("/acs/users/update", {access_schedule: access_schedule, acs_system_id: acs_system_id, acs_user_id: acs_user_id, email: email, email_address: email_address, full_name: full_name, hid_acs_system_id: hid_acs_system_id, phone_number: phone_number, user_identity_id: user_identity_id}.compact) nil diff --git a/lib/seam/routes/client_sessions.rb b/lib/seam/routes/client_sessions.rb index 82018210..c7295143 100644 --- a/lib/seam/routes/client_sessions.rb +++ b/lib/seam/routes/client_sessions.rb @@ -69,6 +69,10 @@ def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_ # @deprecated user_identity_ids: Use `user_identity_id`. # @return [nil] OK def grant_access(client_session_id: nil, connect_webview_ids: nil, connected_account_ids: nil, user_identifier_key: nil, user_identity_id: nil, user_identity_ids: nil) + if client_session_id.nil? && connect_webview_ids.nil? && connected_account_ids.nil? && user_identifier_key.nil? && user_identity_id.nil? && user_identity_ids.nil? + raise TypeError, "At least one parameter is required for /client_sessions/grant_access" + end + @client.post("/client_sessions/grant_access", {client_session_id: client_session_id, connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, user_identity_ids: user_identity_ids}.compact) nil diff --git a/lib/seam/routes/connected_accounts.rb b/lib/seam/routes/connected_accounts.rb index fdeb191b..5f52ae7e 100644 --- a/lib/seam/routes/connected_accounts.rb +++ b/lib/seam/routes/connected_accounts.rb @@ -30,6 +30,10 @@ def delete(connected_account_id:) # @param email [String, nil] Email address associated with the connected account that you want to get. # @return [Seam::Resources::ConnectedAccount] OK def get(connected_account_id: nil, email: nil) + if connected_account_id.nil? && email.nil? + raise TypeError, "At least one parameter is required for /connected_accounts/get" + end + res = @client.post("/connected_accounts/get", {connected_account_id: connected_account_id, email: email}.compact) Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_account"]) diff --git a/lib/seam/routes/devices.rb b/lib/seam/routes/devices.rb index dbebaa2f..b3baf795 100644 --- a/lib/seam/routes/devices.rb +++ b/lib/seam/routes/devices.rb @@ -23,6 +23,10 @@ def unmanaged # @param name [String, nil] Name of the device that you want to get. # @return [Seam::Resources::Device] OK def get(device_id: nil, name: nil) + if device_id.nil? && name.nil? + raise TypeError, "At least one parameter is required for /devices/get" + end + res = @client.post("/devices/get", {device_id: device_id, name: name}.compact) Seam::Resources::Device.load_from_response(res.body["device"]) diff --git a/lib/seam/routes/devices_unmanaged.rb b/lib/seam/routes/devices_unmanaged.rb index ac45147d..752a5d5c 100644 --- a/lib/seam/routes/devices_unmanaged.rb +++ b/lib/seam/routes/devices_unmanaged.rb @@ -17,6 +17,10 @@ def initialize(client:, defaults:) # @param name [String, nil] Name of the unmanaged device that you want to get. # @return [Seam::Resources::UnmanagedDevice] OK def get(device_id: nil, name: nil) + if device_id.nil? && name.nil? + raise TypeError, "At least one parameter is required for /devices/unmanaged/get" + end + res = @client.post("/devices/unmanaged/get", {device_id: device_id, name: name}.compact) Seam::Resources::UnmanagedDevice.load_from_response(res.body["device"]) diff --git a/lib/seam/routes/events.rb b/lib/seam/routes/events.rb index 96c3932f..068e0cb5 100644 --- a/lib/seam/routes/events.rb +++ b/lib/seam/routes/events.rb @@ -14,6 +14,10 @@ def initialize(client:, defaults:) # @param event_type [String, nil] Type of the event that you want to get. # @return [Seam::Resources::SeamEvent] OK def get(event_id: nil, device_id: nil, event_type: nil) + if event_id.nil? && device_id.nil? && event_type.nil? + raise TypeError, "At least one parameter is required for /events/get" + end + res = @client.post("/events/get", {event_id: event_id, device_id: device_id, event_type: event_type}.compact) Seam::Resources::SeamEvent.load_from_response(res.body["event"]) @@ -50,6 +54,10 @@ def get(event_id: nil, device_id: nil, event_type: nil) # @param user_identity_id [String, nil] ID of the user identity for which you want to list events. # @return [Seam::Resources::SeamEvent] OK def list(access_code_id: nil, access_code_ids: nil, access_grant_id: nil, access_grant_ids: nil, access_method_id: nil, access_method_ids: nil, acs_access_group_id: nil, acs_credential_id: nil, acs_encoder_id: nil, acs_entrance_id: nil, acs_system_id: nil, acs_system_ids: nil, acs_user_id: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_id: nil, device_ids: nil, event_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, space_id: nil, space_ids: nil, unstable_offset: nil, user_identity_id: nil) + if access_code_id.nil? && access_code_ids.nil? && access_grant_id.nil? && access_grant_ids.nil? && access_method_id.nil? && access_method_ids.nil? && acs_access_group_id.nil? && acs_credential_id.nil? && acs_encoder_id.nil? && acs_entrance_id.nil? && acs_system_id.nil? && acs_system_ids.nil? && acs_user_id.nil? && between.nil? && connect_webview_id.nil? && connected_account_id.nil? && customer_key.nil? && device_id.nil? && device_ids.nil? && event_ids.nil? && event_type.nil? && event_types.nil? && limit.nil? && since.nil? && space_id.nil? && space_ids.nil? && unstable_offset.nil? && user_identity_id.nil? + raise TypeError, "At least one parameter is required for /events/list" + end + res = @client.post("/events/list", {access_code_id: access_code_id, access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_ids: access_grant_ids, access_method_id: access_method_id, access_method_ids: access_method_ids, acs_access_group_id: acs_access_group_id, acs_credential_id: acs_credential_id, acs_encoder_id: acs_encoder_id, acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_user_id: acs_user_id, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, customer_key: customer_key, device_id: device_id, device_ids: device_ids, event_ids: event_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, space_id: space_id, space_ids: space_ids, unstable_offset: unstable_offset, user_identity_id: user_identity_id}.compact) Seam::Resources::SeamEvent.load_from_response(res.body["events"]) diff --git a/lib/seam/routes/instant_keys.rb b/lib/seam/routes/instant_keys.rb index bd2c1c93..dc7c2a15 100644 --- a/lib/seam/routes/instant_keys.rb +++ b/lib/seam/routes/instant_keys.rb @@ -22,6 +22,10 @@ def delete(instant_key_id:) # @param instant_key_url [String, nil] URL of the instant key to get. # @return [Seam::Resources::InstantKey] OK def get(instant_key_id: nil, instant_key_url: nil) + if instant_key_id.nil? && instant_key_url.nil? + raise TypeError, "At least one parameter is required for /instant_keys/get" + end + res = @client.post("/instant_keys/get", {instant_key_id: instant_key_id, instant_key_url: instant_key_url}.compact) Seam::Resources::InstantKey.load_from_response(res.body["instant_key"]) diff --git a/lib/seam/routes/locks.rb b/lib/seam/routes/locks.rb index 0ae1529e..9eac6577 100644 --- a/lib/seam/routes/locks.rb +++ b/lib/seam/routes/locks.rb @@ -33,6 +33,10 @@ def configure_auto_lock(auto_lock_enabled:, device_id:, auto_lock_delay_seconds: # @return [Seam::Resources::Device] OK # @deprecated Use `/devices/get` instead. def get(device_id: nil, name: nil) + if device_id.nil? && name.nil? + raise TypeError, "At least one parameter is required for /locks/get" + end + res = @client.post("/locks/get", {device_id: device_id, name: name}.compact) Seam::Resources::Device.load_from_response(res.body["device"]) diff --git a/lib/seam/routes/spaces.rb b/lib/seam/routes/spaces.rb index 0561cdb8..1f35d1da 100644 --- a/lib/seam/routes/spaces.rb +++ b/lib/seam/routes/spaces.rb @@ -67,6 +67,10 @@ def delete(space_id:) # @param space_key [String, nil] Unique key of the space that you want to get. # @return [Seam::Resources::Space] OK def get(space_id: nil, space_key: nil) + if space_id.nil? && space_key.nil? + raise TypeError, "At least one parameter is required for /spaces/get" + end + res = @client.post("/spaces/get", {space_id: space_id, space_key: space_key}.compact) Seam::Resources::Space.load_from_response(res.body["space"]) @@ -79,6 +83,10 @@ def get(space_id: nil, space_key: nil) # @param space_keys [Array, nil] Keys of the spaces that you want to get along with their related resources. # @return [Seam::Resources::Batch] OK def get_related(exclude: nil, include: nil, space_ids: nil, space_keys: nil) + if exclude.nil? && include.nil? && space_ids.nil? && space_keys.nil? + raise TypeError, "At least one parameter is required for /spaces/get_related" + end + res = @client.post("/spaces/get_related", {exclude: exclude, include: include, space_ids: space_ids, space_keys: space_keys}.compact) Seam::Resources::Batch.load_from_response(res.body["batch"]) diff --git a/lib/seam/routes/user_identities.rb b/lib/seam/routes/user_identities.rb index 639a3416..46bae5f1 100644 --- a/lib/seam/routes/user_identities.rb +++ b/lib/seam/routes/user_identities.rb @@ -65,6 +65,10 @@ def generate_instant_key(user_identity_id:, customization_profile_id: nil, max_u # @param user_identity_key [String, nil] # @return [Seam::Resources::UserIdentity] OK def get(user_identity_id: nil, user_identity_key: nil) + if user_identity_id.nil? && user_identity_key.nil? + raise TypeError, "At least one parameter is required for /user_identities/get" + end + res = @client.post("/user_identities/get", {user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact) Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"])