diff --git a/lib/seam/routes/clients/access_codes.rb b/lib/seam/routes/clients/access_codes.rb index 437ebfd..c52d632 100644 --- a/lib/seam/routes/clients/access_codes.rb +++ b/lib/seam/routes/clients/access_codes.rb @@ -15,7 +15,7 @@ def create(device_id:, allow_external_modification: nil, attempt_for_offline_dev request_seam_object( :post, "/access_codes/create", - Seam::AccessCode, + Seam::Resources::AccessCode, "access_code", body: {device_id: device_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, common_code_key: common_code_key, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, sync: sync, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact ) @@ -25,7 +25,7 @@ def create_multiple(device_ids:, allow_external_modification: nil, attempt_for_o request_seam_object( :post, "/access_codes/create_multiple", - Seam::AccessCode, + Seam::Resources::AccessCode, "access_codes", body: {device_ids: device_ids, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, behavior_when_code_cannot_be_shared: behavior_when_code_cannot_be_shared, code: code, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact ) @@ -45,7 +45,7 @@ def generate_code(device_id:) request_seam_object( :post, "/access_codes/generate_code", - Seam::AccessCode, + Seam::Resources::AccessCode, "generated_code", body: {device_id: device_id}.compact ) @@ -55,7 +55,7 @@ def get(access_code_id: nil, code: nil, device_id: nil) request_seam_object( :post, "/access_codes/get", - Seam::AccessCode, + Seam::Resources::AccessCode, "access_code", body: {access_code_id: access_code_id, code: code, device_id: device_id}.compact ) @@ -65,7 +65,7 @@ def list(access_code_ids: nil, device_id: nil, user_identifier_key: nil) request_seam_object( :post, "/access_codes/list", - Seam::AccessCode, + Seam::Resources::AccessCode, "access_codes", body: {access_code_ids: access_code_ids, device_id: device_id, user_identifier_key: user_identifier_key}.compact ) @@ -75,7 +75,7 @@ def pull_backup_access_code(access_code_id:) request_seam_object( :post, "/access_codes/pull_backup_access_code", - Seam::AccessCode, + Seam::Resources::AccessCode, "backup_access_code", body: {access_code_id: access_code_id}.compact ) @@ -90,6 +90,16 @@ def update(access_code_id:, allow_external_modification: nil, attempt_for_offlin nil end + + def update_multiple(common_code_key:, allow_external_modification: nil, code: nil, ends_at: nil, is_external_modification_allowed: nil, name: nil, prefer_native_scheduling: nil, starts_at: nil) + request_seam( + :post, + "/access_codes/update_multiple", + body: {common_code_key: common_code_key, allow_external_modification: allow_external_modification, code: code, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, name: name, prefer_native_scheduling: prefer_native_scheduling, starts_at: starts_at}.compact + ) + + nil + end end end end diff --git a/lib/seam/routes/clients/access_codes_simulate.rb b/lib/seam/routes/clients/access_codes_simulate.rb index 01bae3a..e6b84e0 100644 --- a/lib/seam/routes/clients/access_codes_simulate.rb +++ b/lib/seam/routes/clients/access_codes_simulate.rb @@ -7,7 +7,7 @@ def create_unmanaged_access_code(code:, device_id:, name:) request_seam_object( :post, "/access_codes/simulate/create_unmanaged_access_code", - Seam::UnmanagedAccessCode, + Seam::Resources::UnmanagedAccessCode, "access_code", body: {code: code, device_id: device_id, name: name}.compact ) diff --git a/lib/seam/routes/clients/access_codes_unmanaged.rb b/lib/seam/routes/clients/access_codes_unmanaged.rb index f0f4f54..3d96d67 100644 --- a/lib/seam/routes/clients/access_codes_unmanaged.rb +++ b/lib/seam/routes/clients/access_codes_unmanaged.rb @@ -27,7 +27,7 @@ def get(access_code_id: nil, code: nil, device_id: nil) request_seam_object( :post, "/access_codes/unmanaged/get", - Seam::UnmanagedAccessCode, + Seam::Resources::UnmanagedAccessCode, "access_code", body: {access_code_id: access_code_id, code: code, device_id: device_id}.compact ) @@ -37,7 +37,7 @@ def list(device_id:, user_identifier_key: nil) request_seam_object( :post, "/access_codes/unmanaged/list", - Seam::UnmanagedAccessCode, + Seam::Resources::UnmanagedAccessCode, "access_codes", body: {device_id: device_id, user_identifier_key: user_identifier_key}.compact ) diff --git a/lib/seam/routes/clients/acs_access_groups.rb b/lib/seam/routes/clients/acs_access_groups.rb index fbe0857..b4f5b5a 100644 --- a/lib/seam/routes/clients/acs_access_groups.rb +++ b/lib/seam/routes/clients/acs_access_groups.rb @@ -17,7 +17,7 @@ def get(acs_access_group_id:) request_seam_object( :post, "/acs/access_groups/get", - Seam::AcsAccessGroup, + Seam::Resources::AcsAccessGroup, "acs_access_group", body: {acs_access_group_id: acs_access_group_id}.compact ) @@ -27,7 +27,7 @@ def list(acs_system_id: nil, acs_user_id: nil) request_seam_object( :post, "/acs/access_groups/list", - Seam::AcsAccessGroup, + Seam::Resources::AcsAccessGroup, "acs_access_groups", body: {acs_system_id: acs_system_id, acs_user_id: acs_user_id}.compact ) @@ -37,7 +37,7 @@ def list_accessible_entrances(acs_access_group_id:) request_seam_object( :post, "/acs/access_groups/list_accessible_entrances", - Seam::AcsEntrance, + Seam::Resources::AcsEntrance, "acs_entrances", body: {acs_access_group_id: acs_access_group_id}.compact ) @@ -47,7 +47,7 @@ def list_users(acs_access_group_id:) request_seam_object( :post, "/acs/access_groups/list_users", - Seam::AcsUser, + Seam::Resources::AcsUser, "acs_users", body: {acs_access_group_id: acs_access_group_id}.compact ) diff --git a/lib/seam/routes/clients/acs_credential_pools.rb b/lib/seam/routes/clients/acs_credential_pools.rb index dbede9e..66996e5 100644 --- a/lib/seam/routes/clients/acs_credential_pools.rb +++ b/lib/seam/routes/clients/acs_credential_pools.rb @@ -7,7 +7,7 @@ def list(acs_system_id:) request_seam_object( :post, "/acs/credential_pools/list", - Seam::AcsCredentialPool, + Seam::Resources::AcsCredentialPool, "acs_credential_pools", body: {acs_system_id: acs_system_id}.compact ) diff --git a/lib/seam/routes/clients/acs_credential_provisioning_automations.rb b/lib/seam/routes/clients/acs_credential_provisioning_automations.rb index c77f4f3..6864f62 100644 --- a/lib/seam/routes/clients/acs_credential_provisioning_automations.rb +++ b/lib/seam/routes/clients/acs_credential_provisioning_automations.rb @@ -7,7 +7,7 @@ def launch(credential_manager_acs_system_id:, user_identity_id:, acs_credential_ request_seam_object( :post, "/acs/credential_provisioning_automations/launch", - Seam::AcsCredentialProvisioningAutomation, + Seam::Resources::AcsCredentialProvisioningAutomation, "acs_credential_provisioning_automation", body: {credential_manager_acs_system_id: credential_manager_acs_system_id, user_identity_id: user_identity_id, acs_credential_pool_id: acs_credential_pool_id, create_credential_manager_user: create_credential_manager_user, credential_manager_acs_user_id: credential_manager_acs_user_id}.compact ) diff --git a/lib/seam/routes/clients/acs_credentials.rb b/lib/seam/routes/clients/acs_credentials.rb index c095548..ea83200 100644 --- a/lib/seam/routes/clients/acs_credentials.rb +++ b/lib/seam/routes/clients/acs_credentials.rb @@ -17,7 +17,7 @@ def create(access_method:, acs_user_id:, allowed_acs_entrance_ids: nil, code: ni request_seam_object( :post, "/acs/credentials/create", - Seam::AcsCredential, + Seam::Resources::AcsCredential, "acs_credential", body: {access_method: access_method, acs_user_id: acs_user_id, allowed_acs_entrance_ids: allowed_acs_entrance_ids, code: code, credential_manager_acs_system_id: credential_manager_acs_system_id, ends_at: ends_at, is_multi_phone_sync_credential: is_multi_phone_sync_credential, starts_at: starts_at, visionline_metadata: visionline_metadata}.compact ) @@ -37,7 +37,7 @@ def get(acs_credential_id:) request_seam_object( :post, "/acs/credentials/get", - Seam::AcsCredential, + Seam::Resources::AcsCredential, "acs_credential", body: {acs_credential_id: acs_credential_id}.compact ) @@ -47,7 +47,7 @@ def list(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil, created_be request_seam_object( :post, "/acs/credentials/list", - Seam::AcsCredential, + Seam::Resources::AcsCredential, "acs_credentials", body: {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id, created_before: created_before, is_multi_phone_sync_credential: is_multi_phone_sync_credential, limit: limit}.compact ) @@ -57,7 +57,7 @@ def list_accessible_entrances(acs_credential_id:) request_seam_object( :post, "/acs/credentials/list_accessible_entrances", - Seam::AcsEntrance, + Seam::Resources::AcsEntrance, "acs_entrances", body: {acs_credential_id: acs_credential_id}.compact ) diff --git a/lib/seam/routes/clients/acs_encoders.rb b/lib/seam/routes/clients/acs_encoders.rb index d32e310..37de954 100644 --- a/lib/seam/routes/clients/acs_encoders.rb +++ b/lib/seam/routes/clients/acs_encoders.rb @@ -9,7 +9,7 @@ def encode_card(acs_system_id: nil, device_name: nil, device_id: nil, wait_for_a action_attempt = request_seam_object( :post, "/acs/encoders/encode_card", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {acs_system_id: acs_system_id, device_name: device_name, device_id: device_id}.compact ) @@ -21,17 +21,17 @@ def list(acs_system_ids: nil, device_ids: nil, limit: nil) request_seam_object( :post, "/acs/encoders/list", - Seam::Device, + Seam::Resources::Device, "devices", body: {acs_system_ids: acs_system_ids, device_ids: device_ids, limit: limit}.compact ) end - def read_card(acs_system_id: nil, device_name: nil, device_id: nil, wait_for_action_attempt: nil) + def scan_card(acs_system_id:, device_name: nil, device_id: nil, wait_for_action_attempt: nil) action_attempt = request_seam_object( :post, - "/acs/encoders/read_card", - Seam::ActionAttempt, + "/acs/encoders/scan_card", + Seam::Resources::ActionAttempt, "action_attempt", body: {acs_system_id: acs_system_id, device_name: device_name, device_id: device_id}.compact ) diff --git a/lib/seam/routes/clients/acs_entrances.rb b/lib/seam/routes/clients/acs_entrances.rb index c32b7e9..896c69a 100644 --- a/lib/seam/routes/clients/acs_entrances.rb +++ b/lib/seam/routes/clients/acs_entrances.rb @@ -7,7 +7,7 @@ def get(acs_entrance_id:) request_seam_object( :post, "/acs/entrances/get", - Seam::AcsEntrance, + Seam::Resources::AcsEntrance, "acs_entrance", body: {acs_entrance_id: acs_entrance_id}.compact ) @@ -27,7 +27,7 @@ def list(acs_credential_id: nil, acs_system_id: nil) request_seam_object( :post, "/acs/entrances/list", - Seam::AcsEntrance, + Seam::Resources::AcsEntrance, "acs_entrances", body: {acs_credential_id: acs_credential_id, acs_system_id: acs_system_id}.compact ) @@ -37,7 +37,7 @@ def list_credentials_with_access(acs_entrance_id:, include_if: nil) request_seam_object( :post, "/acs/entrances/list_credentials_with_access", - Seam::AcsCredential, + Seam::Resources::AcsCredential, "acs_credentials", body: {acs_entrance_id: acs_entrance_id, include_if: include_if}.compact ) diff --git a/lib/seam/routes/clients/acs_systems.rb b/lib/seam/routes/clients/acs_systems.rb index 936c847..31fa209 100644 --- a/lib/seam/routes/clients/acs_systems.rb +++ b/lib/seam/routes/clients/acs_systems.rb @@ -7,7 +7,7 @@ def get(acs_system_id:) request_seam_object( :post, "/acs/systems/get", - Seam::AcsSystem, + Seam::Resources::AcsSystem, "acs_system", body: {acs_system_id: acs_system_id}.compact ) @@ -17,7 +17,7 @@ def list(connected_account_id: nil) request_seam_object( :post, "/acs/systems/list", - Seam::AcsSystem, + Seam::Resources::AcsSystem, "acs_systems", body: {connected_account_id: connected_account_id}.compact ) @@ -27,7 +27,7 @@ def list_compatible_credential_manager_acs_systems(acs_system_id:) request_seam_object( :post, "/acs/systems/list_compatible_credential_manager_acs_systems", - Seam::AcsSystem, + Seam::Resources::AcsSystem, "acs_systems", body: {acs_system_id: acs_system_id}.compact ) diff --git a/lib/seam/routes/clients/acs_users.rb b/lib/seam/routes/clients/acs_users.rb index 54dadf1..323cb95 100644 --- a/lib/seam/routes/clients/acs_users.rb +++ b/lib/seam/routes/clients/acs_users.rb @@ -17,7 +17,7 @@ def create(acs_system_id:, access_schedule: nil, acs_access_group_ids: nil, emai request_seam_object( :post, "/acs/users/create", - Seam::AcsUser, + Seam::Resources::AcsUser, "acs_user", body: {acs_system_id: acs_system_id, access_schedule: access_schedule, acs_access_group_ids: acs_access_group_ids, email: email, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_id: user_identity_id}.compact ) @@ -37,7 +37,7 @@ def get(acs_user_id:) request_seam_object( :post, "/acs/users/get", - Seam::AcsUser, + Seam::Resources::AcsUser, "acs_user", body: {acs_user_id: acs_user_id}.compact ) @@ -47,7 +47,7 @@ def list(acs_system_id: nil, created_before: nil, limit: nil, user_identity_emai request_seam_object( :post, "/acs/users/list", - Seam::AcsUser, + Seam::Resources::AcsUser, "acs_users", body: {acs_system_id: acs_system_id, created_before: created_before, limit: limit, user_identity_email_address: user_identity_email_address, user_identity_id: user_identity_id, user_identity_phone_number: user_identity_phone_number}.compact ) @@ -57,7 +57,7 @@ def list_accessible_entrances(acs_user_id:) request_seam_object( :post, "/acs/users/list_accessible_entrances", - Seam::AcsEntrance, + Seam::Resources::AcsEntrance, "acs_entrances", body: {acs_user_id: acs_user_id}.compact ) diff --git a/lib/seam/routes/clients/action_attempts.rb b/lib/seam/routes/clients/action_attempts.rb index 4c85542..d9bc0ff 100644 --- a/lib/seam/routes/clients/action_attempts.rb +++ b/lib/seam/routes/clients/action_attempts.rb @@ -9,7 +9,7 @@ def get(action_attempt_id:, wait_for_action_attempt: nil) action_attempt = request_seam_object( :post, "/action_attempts/get", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {action_attempt_id: action_attempt_id}.compact ) @@ -21,7 +21,7 @@ def list(action_attempt_ids:) request_seam_object( :post, "/action_attempts/list", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempts", body: {action_attempt_ids: action_attempt_ids}.compact ) diff --git a/lib/seam/routes/clients/client_sessions.rb b/lib/seam/routes/clients/client_sessions.rb index 10a0fb6..16ca468 100644 --- a/lib/seam/routes/clients/client_sessions.rb +++ b/lib/seam/routes/clients/client_sessions.rb @@ -7,7 +7,7 @@ def create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil request_seam_object( :post, "/client_sessions/create", - Seam::ClientSession, + Seam::Resources::ClientSession, "client_session", body: {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_ids: user_identity_ids}.compact ) @@ -27,7 +27,7 @@ def get(client_session_id: nil, user_identifier_key: nil) request_seam_object( :post, "/client_sessions/get", - Seam::ClientSession, + Seam::Resources::ClientSession, "client_session", body: {client_session_id: client_session_id, user_identifier_key: user_identifier_key}.compact ) @@ -37,7 +37,7 @@ def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_ request_seam_object( :post, "/client_sessions/get_or_create", - Seam::ClientSession, + Seam::Resources::ClientSession, "client_session", body: {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_ids: user_identity_ids}.compact ) @@ -57,7 +57,7 @@ def list(client_session_id: nil, connect_webview_id: nil, user_identifier_key: n request_seam_object( :post, "/client_sessions/list", - Seam::ClientSession, + Seam::Resources::ClientSession, "client_sessions", body: {client_session_id: client_session_id, connect_webview_id: connect_webview_id, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, without_user_identifier_key: without_user_identifier_key}.compact ) diff --git a/lib/seam/routes/clients/connect_webviews.rb b/lib/seam/routes/clients/connect_webviews.rb index 7872852..bbfcf96 100644 --- a/lib/seam/routes/clients/connect_webviews.rb +++ b/lib/seam/routes/clients/connect_webviews.rb @@ -7,7 +7,7 @@ def create(accepted_providers: nil, automatically_manage_new_devices: nil, custo request_seam_object( :post, "/connect_webviews/create", - Seam::ConnectWebview, + Seam::Resources::ConnectWebview, "connect_webview", body: {accepted_providers: accepted_providers, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: custom_metadata, custom_redirect_failure_url: custom_redirect_failure_url, custom_redirect_url: custom_redirect_url, device_selection_mode: device_selection_mode, provider_category: provider_category, wait_for_device_creation: wait_for_device_creation}.compact ) @@ -27,7 +27,7 @@ def get(connect_webview_id:) request_seam_object( :post, "/connect_webviews/get", - Seam::ConnectWebview, + Seam::Resources::ConnectWebview, "connect_webview", body: {connect_webview_id: connect_webview_id}.compact ) @@ -37,7 +37,7 @@ def list(custom_metadata_has: nil, limit: nil, user_identifier_key: nil) request_seam_object( :post, "/connect_webviews/list", - Seam::ConnectWebview, + Seam::Resources::ConnectWebview, "connect_webviews", body: {custom_metadata_has: custom_metadata_has, limit: limit, user_identifier_key: user_identifier_key}.compact ) diff --git a/lib/seam/routes/clients/connected_accounts.rb b/lib/seam/routes/clients/connected_accounts.rb index 36b9b23..66e6311 100644 --- a/lib/seam/routes/clients/connected_accounts.rb +++ b/lib/seam/routes/clients/connected_accounts.rb @@ -17,7 +17,7 @@ def get(connected_account_id: nil, email: nil) request_seam_object( :post, "/connected_accounts/get", - Seam::ConnectedAccount, + Seam::Resources::ConnectedAccount, "connected_account", body: {connected_account_id: connected_account_id, email: email}.compact ) @@ -27,20 +27,20 @@ def list(custom_metadata_has: nil, user_identifier_key: nil) request_seam_object( :post, "/connected_accounts/list", - Seam::ConnectedAccount, + Seam::Resources::ConnectedAccount, "connected_accounts", body: {custom_metadata_has: custom_metadata_has, user_identifier_key: user_identifier_key}.compact ) end def update(connected_account_id:, automatically_manage_new_devices: nil, custom_metadata: nil) - request_seam_object( + request_seam( :post, "/connected_accounts/update", - Seam::ConnectedAccount, - "connected_account", body: {connected_account_id: connected_account_id, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: custom_metadata}.compact ) + + nil end end end diff --git a/lib/seam/routes/clients/devices.rb b/lib/seam/routes/clients/devices.rb index f505d68..72104f7 100644 --- a/lib/seam/routes/clients/devices.rb +++ b/lib/seam/routes/clients/devices.rb @@ -25,7 +25,7 @@ def get(device_id: nil, name: nil) request_seam_object( :post, "/devices/get", - Seam::Device, + Seam::Resources::Device, "device", body: {device_id: device_id, name: name}.compact ) @@ -35,7 +35,7 @@ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_i request_seam_object( :post, "/devices/list", - Seam::Device, + Seam::Resources::Device, "devices", body: {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact ) @@ -45,7 +45,7 @@ def list_device_providers(provider_category: nil) request_seam_object( :post, "/devices/list_device_providers", - Seam::DeviceProvider, + Seam::Resources::DeviceProvider, "device_providers", body: {provider_category: provider_category}.compact ) diff --git a/lib/seam/routes/clients/devices_unmanaged.rb b/lib/seam/routes/clients/devices_unmanaged.rb index ffb8d51..745c174 100644 --- a/lib/seam/routes/clients/devices_unmanaged.rb +++ b/lib/seam/routes/clients/devices_unmanaged.rb @@ -7,7 +7,7 @@ def get(device_id: nil, name: nil) request_seam_object( :post, "/devices/unmanaged/get", - Seam::UnmanagedDevice, + Seam::Resources::UnmanagedDevice, "device", body: {device_id: device_id, name: name}.compact ) @@ -17,7 +17,7 @@ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_i request_seam_object( :post, "/devices/unmanaged/list", - Seam::UnmanagedDevice, + Seam::Resources::UnmanagedDevice, "devices", body: {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact ) diff --git a/lib/seam/routes/clients/events.rb b/lib/seam/routes/clients/events.rb index ba99c1c..e6bc60c 100644 --- a/lib/seam/routes/clients/events.rb +++ b/lib/seam/routes/clients/events.rb @@ -7,7 +7,7 @@ def get(device_id: nil, event_id: nil, event_type: nil) request_seam_object( :post, "/events/get", - Seam::SeamEvent, + Seam::Resources::SeamEvent, "event", body: {device_id: device_id, event_id: event_id, event_type: event_type}.compact ) @@ -17,7 +17,7 @@ def list(access_code_id: nil, access_code_ids: nil, between: nil, connect_webvie request_seam_object( :post, "/events/list", - Seam::SeamEvent, + Seam::Resources::SeamEvent, "events", body: {access_code_id: access_code_id, access_code_ids: access_code_ids, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, device_id: device_id, device_ids: device_ids, event_type: event_type, event_types: event_types, limit: limit, since: since}.compact ) diff --git a/lib/seam/routes/clients/index.rb b/lib/seam/routes/clients/index.rb index d08e382..7625080 100644 --- a/lib/seam/routes/clients/index.rb +++ b/lib/seam/routes/clients/index.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "seam/base_client" require_relative "access_codes" require_relative "access_codes_simulate" require_relative "access_codes_unmanaged" diff --git a/lib/seam/routes/clients/locks.rb b/lib/seam/routes/clients/locks.rb index 44f3c84..70b6570 100644 --- a/lib/seam/routes/clients/locks.rb +++ b/lib/seam/routes/clients/locks.rb @@ -9,7 +9,7 @@ def get(device_id: nil, name: nil) request_seam_object( :post, "/locks/get", - Seam::Device, + Seam::Resources::Device, "device", body: {device_id: device_id, name: name}.compact ) @@ -19,7 +19,7 @@ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_i request_seam_object( :post, "/locks/list", - Seam::Device, + Seam::Resources::Device, "devices", body: {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact ) @@ -29,7 +29,7 @@ def lock_door(device_id:, sync: nil, wait_for_action_attempt: nil) action_attempt = request_seam_object( :post, "/locks/lock_door", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {device_id: device_id, sync: sync}.compact ) @@ -41,7 +41,7 @@ def unlock_door(device_id:, sync: nil, wait_for_action_attempt: nil) action_attempt = request_seam_object( :post, "/locks/unlock_door", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {device_id: device_id, sync: sync}.compact ) diff --git a/lib/seam/routes/clients/networks.rb b/lib/seam/routes/clients/networks.rb index df41258..fef8687 100644 --- a/lib/seam/routes/clients/networks.rb +++ b/lib/seam/routes/clients/networks.rb @@ -7,7 +7,7 @@ def get(network_id:) request_seam_object( :post, "/networks/get", - Seam::Network, + Seam::Resources::Network, "network", body: {network_id: network_id}.compact ) @@ -17,7 +17,7 @@ def list request_seam_object( :post, "/networks/list", - Seam::Network, + Seam::Resources::Network, "networks", body: {}.compact ) diff --git a/lib/seam/routes/clients/noise_sensors.rb b/lib/seam/routes/clients/noise_sensors.rb index 820379a..771ea81 100644 --- a/lib/seam/routes/clients/noise_sensors.rb +++ b/lib/seam/routes/clients/noise_sensors.rb @@ -15,7 +15,7 @@ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_i request_seam_object( :post, "/noise_sensors/list", - Seam::Device, + Seam::Resources::Device, "devices", body: {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact ) diff --git a/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb b/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb index 3ef7b8a..2be00f0 100644 --- a/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +++ b/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb @@ -7,7 +7,7 @@ def create(device_id:, ends_daily_at:, starts_daily_at:, name: nil, noise_thresh request_seam_object( :post, "/noise_sensors/noise_thresholds/create", - Seam::NoiseThreshold, + Seam::Resources::NoiseThreshold, "noise_threshold", body: {device_id: device_id, ends_daily_at: ends_daily_at, starts_daily_at: starts_daily_at, name: name, noise_threshold_decibels: noise_threshold_decibels, noise_threshold_nrs: noise_threshold_nrs, sync: sync}.compact ) @@ -27,7 +27,7 @@ def get(noise_threshold_id:) request_seam_object( :post, "/noise_sensors/noise_thresholds/get", - Seam::NoiseThreshold, + Seam::Resources::NoiseThreshold, "noise_threshold", body: {noise_threshold_id: noise_threshold_id}.compact ) @@ -37,7 +37,7 @@ def list(device_id:, is_programmed: nil) request_seam_object( :post, "/noise_sensors/noise_thresholds/list", - Seam::NoiseThreshold, + Seam::Resources::NoiseThreshold, "noise_thresholds", body: {device_id: device_id, is_programmed: is_programmed}.compact ) diff --git a/lib/seam/routes/clients/phones.rb b/lib/seam/routes/clients/phones.rb index 99ad70e..00f0dd5 100644 --- a/lib/seam/routes/clients/phones.rb +++ b/lib/seam/routes/clients/phones.rb @@ -21,7 +21,7 @@ def list(acs_credential_id: nil, owner_user_identity_id: nil) request_seam_object( :post, "/phones/list", - Seam::Phone, + Seam::Resources::Phone, "phones", body: {acs_credential_id: acs_credential_id, owner_user_identity_id: owner_user_identity_id}.compact ) diff --git a/lib/seam/routes/clients/phones_simulate.rb b/lib/seam/routes/clients/phones_simulate.rb index 91696b7..747a7a9 100644 --- a/lib/seam/routes/clients/phones_simulate.rb +++ b/lib/seam/routes/clients/phones_simulate.rb @@ -7,7 +7,7 @@ def create_sandbox_phone(user_identity_id:, assa_abloy_metadata: nil, custom_sdk request_seam_object( :post, "/phones/simulate/create_sandbox_phone", - Seam::Phone, + Seam::Resources::Phone, "phone", body: {user_identity_id: user_identity_id, assa_abloy_metadata: assa_abloy_metadata, custom_sdk_installation_id: custom_sdk_installation_id, phone_metadata: phone_metadata}.compact ) diff --git a/lib/seam/routes/clients/thermostats.rb b/lib/seam/routes/clients/thermostats.rb index bd9ae8f..0f5f54f 100644 --- a/lib/seam/routes/clients/thermostats.rb +++ b/lib/seam/routes/clients/thermostats.rb @@ -13,7 +13,7 @@ def activate_climate_preset(climate_preset_key:, device_id:, wait_for_action_att action_attempt = request_seam_object( :post, "/thermostats/activate_climate_preset", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {climate_preset_key: climate_preset_key, device_id: device_id}.compact ) @@ -25,7 +25,7 @@ def cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenhei action_attempt = request_seam_object( :post, "/thermostats/cool", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {device_id: device_id, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, sync: sync}.compact ) @@ -57,7 +57,7 @@ def get(device_id: nil, name: nil) request_seam_object( :post, "/thermostats/get", - Seam::Device, + Seam::Resources::Device, "thermostat", body: {device_id: device_id, name: name}.compact ) @@ -67,7 +67,7 @@ def heat(device_id:, heating_set_point_celsius: nil, heating_set_point_fahrenhei action_attempt = request_seam_object( :post, "/thermostats/heat", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {device_id: device_id, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, sync: sync}.compact ) @@ -79,7 +79,7 @@ def heat_cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahr action_attempt = request_seam_object( :post, "/thermostats/heat_cool", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {device_id: device_id, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, sync: sync}.compact ) @@ -91,8 +91,8 @@ def list(connect_webview_id: nil, connected_account_id: nil, connected_account_i request_seam_object( :post, "/thermostats/list", - Seam::Device, - "thermostats", + Seam::Resources::Device, + "devices", body: {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact ) end @@ -101,7 +101,7 @@ def off(device_id:, sync: nil, wait_for_action_attempt: nil) action_attempt = request_seam_object( :post, "/thermostats/off", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {device_id: device_id, sync: sync}.compact ) @@ -123,7 +123,7 @@ def set_fan_mode(device_id:, fan_mode: nil, fan_mode_setting: nil, sync: nil, wa action_attempt = request_seam_object( :post, "/thermostats/set_fan_mode", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {device_id: device_id, fan_mode: fan_mode, fan_mode_setting: fan_mode_setting, sync: sync}.compact ) diff --git a/lib/seam/routes/clients/thermostats_schedules.rb b/lib/seam/routes/clients/thermostats_schedules.rb index c0983a8..6b24a58 100644 --- a/lib/seam/routes/clients/thermostats_schedules.rb +++ b/lib/seam/routes/clients/thermostats_schedules.rb @@ -7,7 +7,7 @@ def create(climate_preset_key:, device_id:, ends_at:, starts_at:, max_override_p request_seam_object( :post, "/thermostats/schedules/create", - Seam::ThermostatSchedule, + Seam::Resources::ThermostatSchedule, "thermostat_schedule", body: {climate_preset_key: climate_preset_key, device_id: device_id, ends_at: ends_at, starts_at: starts_at, max_override_period_minutes: max_override_period_minutes, name: name}.compact ) @@ -27,7 +27,7 @@ def get(thermostat_schedule_id:) request_seam_object( :post, "/thermostats/schedules/get", - Seam::ThermostatSchedule, + Seam::Resources::ThermostatSchedule, "thermostat_schedule", body: {thermostat_schedule_id: thermostat_schedule_id}.compact ) @@ -37,7 +37,7 @@ def list(device_id:, user_identifier_key: nil) request_seam_object( :post, "/thermostats/schedules/list", - Seam::ThermostatSchedule, + Seam::Resources::ThermostatSchedule, "thermostat_schedules", body: {device_id: device_id, user_identifier_key: user_identifier_key}.compact ) diff --git a/lib/seam/routes/clients/user_identities.rb b/lib/seam/routes/clients/user_identities.rb index 0194e6f..246a907 100644 --- a/lib/seam/routes/clients/user_identities.rb +++ b/lib/seam/routes/clients/user_identities.rb @@ -21,7 +21,7 @@ def create(email_address: nil, full_name: nil, phone_number: nil, user_identity_ request_seam_object( :post, "/user_identities/create", - Seam::UserIdentity, + Seam::Resources::UserIdentity, "user_identity", body: {email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact ) @@ -41,7 +41,7 @@ def get(user_identity_id: nil, user_identity_key: nil) request_seam_object( :post, "/user_identities/get", - Seam::UserIdentity, + Seam::Resources::UserIdentity, "user_identity", body: {user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact ) @@ -61,7 +61,7 @@ def list(credential_manager_acs_system_id: nil) request_seam_object( :post, "/user_identities/list", - Seam::UserIdentity, + Seam::Resources::UserIdentity, "user_identities", body: {credential_manager_acs_system_id: credential_manager_acs_system_id}.compact ) @@ -71,7 +71,7 @@ def list_accessible_devices(user_identity_id:) request_seam_object( :post, "/user_identities/list_accessible_devices", - Seam::Device, + Seam::Resources::Device, "devices", body: {user_identity_id: user_identity_id}.compact ) @@ -81,7 +81,7 @@ def list_acs_systems(user_identity_id:) request_seam_object( :post, "/user_identities/list_acs_systems", - Seam::AcsSystem, + Seam::Resources::AcsSystem, "acs_systems", body: {user_identity_id: user_identity_id}.compact ) @@ -91,7 +91,7 @@ def list_acs_users(user_identity_id:) request_seam_object( :post, "/user_identities/list_acs_users", - Seam::AcsUser, + Seam::Resources::AcsUser, "acs_users", body: {user_identity_id: user_identity_id}.compact ) diff --git a/lib/seam/routes/clients/user_identities_enrollment_automations.rb b/lib/seam/routes/clients/user_identities_enrollment_automations.rb index 038422c..d7caf2e 100644 --- a/lib/seam/routes/clients/user_identities_enrollment_automations.rb +++ b/lib/seam/routes/clients/user_identities_enrollment_automations.rb @@ -17,7 +17,7 @@ def get(enrollment_automation_id:) request_seam_object( :post, "/user_identities/enrollment_automations/get", - Seam::EnrollmentAutomation, + Seam::Resources::EnrollmentAutomation, "enrollment_automation", body: {enrollment_automation_id: enrollment_automation_id}.compact ) @@ -37,7 +37,7 @@ def list(user_identity_id:) request_seam_object( :post, "/user_identities/enrollment_automations/list", - Seam::EnrollmentAutomation, + Seam::Resources::EnrollmentAutomation, "enrollment_automations", body: {user_identity_id: user_identity_id}.compact ) diff --git a/lib/seam/routes/clients/webhooks.rb b/lib/seam/routes/clients/webhooks.rb index 4bb585e..d7e4e89 100644 --- a/lib/seam/routes/clients/webhooks.rb +++ b/lib/seam/routes/clients/webhooks.rb @@ -7,7 +7,7 @@ def create(url:, event_types: nil) request_seam_object( :post, "/webhooks/create", - Seam::Webhook, + Seam::Resources::Webhook, "webhook", body: {url: url, event_types: event_types}.compact ) @@ -27,7 +27,7 @@ def get(webhook_id:) request_seam_object( :post, "/webhooks/get", - Seam::Webhook, + Seam::Resources::Webhook, "webhook", body: {webhook_id: webhook_id}.compact ) @@ -37,7 +37,7 @@ def list request_seam_object( :post, "/webhooks/list", - Seam::Webhook, + Seam::Resources::Webhook, "webhooks", body: {}.compact ) diff --git a/lib/seam/routes/clients/workspaces.rb b/lib/seam/routes/clients/workspaces.rb index 9493226..91267cf 100644 --- a/lib/seam/routes/clients/workspaces.rb +++ b/lib/seam/routes/clients/workspaces.rb @@ -9,7 +9,7 @@ def create(name:, company_name: nil, connect_partner_name: nil, is_sandbox: nil, request_seam_object( :post, "/workspaces/create", - Seam::Workspace, + Seam::Resources::Workspace, "workspace", body: {name: name, company_name: company_name, connect_partner_name: connect_partner_name, is_sandbox: is_sandbox, webview_logo_shape: webview_logo_shape, webview_primary_button_color: webview_primary_button_color}.compact ) @@ -19,7 +19,7 @@ def get request_seam_object( :post, "/workspaces/get", - Seam::Workspace, + Seam::Resources::Workspace, "workspace", body: {}.compact ) @@ -29,7 +29,7 @@ def list request_seam_object( :post, "/workspaces/list", - Seam::Workspace, + Seam::Resources::Workspace, "workspaces", body: {}.compact ) @@ -39,7 +39,7 @@ def reset_sandbox(wait_for_action_attempt: nil) action_attempt = request_seam_object( :post, "/workspaces/reset_sandbox", - Seam::ActionAttempt, + Seam::Resources::ActionAttempt, "action_attempt", body: {}.compact ) diff --git a/lib/seam/routes/resources/access_code.rb b/lib/seam/routes/resources/access_code.rb index 1f5ef01..b34e4b0 100644 --- a/lib/seam/routes/resources/access_code.rb +++ b/lib/seam/routes/resources/access_code.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class AccessCode < BaseResource - attr_accessor :access_code_id, :code, :common_code_key, :device_id, :is_backup, :is_backup_access_code_available, :is_external_modification_allowed, :is_managed, :is_offline_access_code, :is_one_time_use, :is_scheduled_on_device, :is_waiting_for_code_assignment, :name, :pulled_backup_access_code_id, :status, :type + module Resources + class AccessCode < BaseResource + attr_accessor :access_code_id, :code, :common_code_key, :device_id, :is_backup, :is_backup_access_code_available, :is_external_modification_allowed, :is_managed, :is_offline_access_code, :is_one_time_use, :is_scheduled_on_device, :is_waiting_for_code_assignment, :name, :pulled_backup_access_code_id, :status, :type - date_accessor :created_at, :ends_at, :starts_at + date_accessor :created_at, :ends_at, :starts_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/acs_access_group.rb b/lib/seam/routes/resources/acs_access_group.rb index 23ffc5b..d797da9 100644 --- a/lib/seam/routes/resources/acs_access_group.rb +++ b/lib/seam/routes/resources/acs_access_group.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class AcsAccessGroup < BaseResource - attr_accessor :access_group_type, :access_group_type_display_name, :acs_access_group_id, :acs_system_id, :display_name, :external_type, :external_type_display_name, :is_managed, :name, :workspace_id + module Resources + class AcsAccessGroup < BaseResource + attr_accessor :access_group_type, :access_group_type_display_name, :acs_access_group_id, :acs_system_id, :display_name, :external_type, :external_type_display_name, :is_managed, :name, :workspace_id - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/acs_credential.rb b/lib/seam/routes/resources/acs_credential.rb index 8dc035e..4cb87ac 100644 --- a/lib/seam/routes/resources/acs_credential.rb +++ b/lib/seam/routes/resources/acs_credential.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class AcsCredential < BaseResource - attr_accessor :access_method, :acs_credential_id, :acs_credential_pool_id, :acs_system_id, :acs_user_id, :card_number, :code, :display_name, :ends_at, :external_type, :external_type_display_name, :is_encoded, :is_latest_desired_state_synced_with_provider, :is_managed, :is_multi_phone_sync_credential, :parent_acs_credential_id, :starts_at, :visionline_metadata, :workspace_id + module Resources + class AcsCredential < BaseResource + attr_accessor :access_method, :acs_credential_id, :acs_credential_pool_id, :acs_system_id, :acs_user_id, :card_number, :code, :display_name, :ends_at, :external_type, :external_type_display_name, :is_issued, :is_latest_desired_state_synced_with_provider, :is_managed, :is_multi_phone_sync_credential, :parent_acs_credential_id, :starts_at, :visionline_metadata, :workspace_id - date_accessor :created_at, :encoded_at, :latest_desired_state_synced_with_provider_at + date_accessor :created_at, :issued_at, :latest_desired_state_synced_with_provider_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/acs_credential_pool.rb b/lib/seam/routes/resources/acs_credential_pool.rb index b7e6816..3c5586d 100644 --- a/lib/seam/routes/resources/acs_credential_pool.rb +++ b/lib/seam/routes/resources/acs_credential_pool.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class AcsCredentialPool < BaseResource - attr_accessor :acs_credential_pool_id, :acs_system_id, :display_name, :external_type, :external_type_display_name, :workspace_id + module Resources + class AcsCredentialPool < BaseResource + attr_accessor :acs_credential_pool_id, :acs_system_id, :display_name, :external_type, :external_type_display_name, :workspace_id - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/acs_credential_provisioning_automation.rb b/lib/seam/routes/resources/acs_credential_provisioning_automation.rb index 43e0d5b..ac0a2e1 100644 --- a/lib/seam/routes/resources/acs_credential_provisioning_automation.rb +++ b/lib/seam/routes/resources/acs_credential_provisioning_automation.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class AcsCredentialProvisioningAutomation < BaseResource - attr_accessor :acs_credential_provisioning_automation_id, :credential_manager_acs_system_id, :user_identity_id, :workspace_id + module Resources + class AcsCredentialProvisioningAutomation < BaseResource + attr_accessor :acs_credential_provisioning_automation_id, :credential_manager_acs_system_id, :user_identity_id, :workspace_id - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/acs_entrance.rb b/lib/seam/routes/resources/acs_entrance.rb index b95f4d2..ad0ca2f 100644 --- a/lib/seam/routes/resources/acs_entrance.rb +++ b/lib/seam/routes/resources/acs_entrance.rb @@ -1,11 +1,13 @@ # frozen_string_literal: true module Seam - class AcsEntrance < BaseResource - attr_accessor :acs_entrance_id, :acs_system_id, :display_name, :latch_metadata, :salto_ks_metadata, :visionline_metadata + module Resources + class AcsEntrance < BaseResource + attr_accessor :acs_entrance_id, :acs_system_id, :display_name, :latch_metadata, :salto_ks_metadata, :visionline_metadata - date_accessor :created_at + date_accessor :created_at - include Seam::ResourceErrorsSupport + include Seam::Resources::ResourceErrorsSupport + end end end diff --git a/lib/seam/routes/resources/acs_system.rb b/lib/seam/routes/resources/acs_system.rb index a141959..79253b5 100644 --- a/lib/seam/routes/resources/acs_system.rb +++ b/lib/seam/routes/resources/acs_system.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class AcsSystem < BaseResource - attr_accessor :acs_system_id, :can_add_acs_users_to_acs_access_groups, :can_automate_enrollment, :can_create_acs_access_groups, :can_remove_acs_users_from_acs_access_groups, :connected_account_ids, :external_type, :external_type_display_name, :image_alt_text, :image_url, :name, :system_type, :system_type_display_name, :visionline_metadata, :workspace_id + module Resources + class AcsSystem < BaseResource + attr_accessor :acs_system_id, :can_add_acs_users_to_acs_access_groups, :can_automate_enrollment, :can_create_acs_access_groups, :can_remove_acs_users_from_acs_access_groups, :connected_account_ids, :external_type, :external_type_display_name, :image_alt_text, :image_url, :name, :system_type, :system_type_display_name, :visionline_metadata, :workspace_id - date_accessor :created_at + date_accessor :created_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/acs_user.rb b/lib/seam/routes/resources/acs_user.rb index 4f78d6e..ef9c2a2 100644 --- a/lib/seam/routes/resources/acs_user.rb +++ b/lib/seam/routes/resources/acs_user.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class AcsUser < BaseResource - attr_accessor :access_schedule, :acs_system_id, :acs_user_id, :display_name, :email, :email_address, :external_type, :external_type_display_name, :full_name, :hid_acs_system_id, :is_latest_desired_state_synced_with_provider, :is_managed, :is_suspended, :phone_number, :user_identity_email_address, :user_identity_full_name, :user_identity_id, :user_identity_phone_number, :workspace_id + module Resources + class AcsUser < BaseResource + attr_accessor :access_schedule, :acs_system_id, :acs_user_id, :display_name, :email, :email_address, :external_type, :external_type_display_name, :full_name, :hid_acs_system_id, :is_latest_desired_state_synced_with_provider, :is_managed, :is_suspended, :phone_number, :user_identity_email_address, :user_identity_full_name, :user_identity_id, :user_identity_phone_number, :workspace_id - date_accessor :created_at, :latest_desired_state_synced_with_provider_at + date_accessor :created_at, :latest_desired_state_synced_with_provider_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/action_attempt.rb b/lib/seam/routes/resources/action_attempt.rb index 0f2ace8..58f3278 100644 --- a/lib/seam/routes/resources/action_attempt.rb +++ b/lib/seam/routes/resources/action_attempt.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true module Seam - class ActionAttempt < BaseResource - attr_accessor :action_attempt_id, :action_type, :error, :result, :status + module Resources + class ActionAttempt < BaseResource + attr_accessor :action_attempt_id, :action_type, :error, :result, :status + end end end diff --git a/lib/seam/routes/resources/client_session.rb b/lib/seam/routes/resources/client_session.rb index a4b09b3..ff34b6b 100644 --- a/lib/seam/routes/resources/client_session.rb +++ b/lib/seam/routes/resources/client_session.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class ClientSession < BaseResource - attr_accessor :client_session_id, :connect_webview_ids, :connected_account_ids, :device_count, :token, :user_identifier_key, :user_identity_ids, :workspace_id + module Resources + class ClientSession < BaseResource + attr_accessor :client_session_id, :connect_webview_ids, :connected_account_ids, :device_count, :token, :user_identifier_key, :user_identity_ids, :workspace_id - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/connect_webview.rb b/lib/seam/routes/resources/connect_webview.rb index b9e06d3..563f8ea 100644 --- a/lib/seam/routes/resources/connect_webview.rb +++ b/lib/seam/routes/resources/connect_webview.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class ConnectWebview < BaseResource - attr_accessor :accepted_devices, :accepted_providers, :any_device_allowed, :any_provider_allowed, :automatically_manage_new_devices, :connect_webview_id, :connected_account_id, :custom_metadata, :custom_redirect_failure_url, :custom_redirect_url, :device_selection_mode, :login_successful, :selected_provider, :status, :url, :wait_for_device_creation, :workspace_id + module Resources + class ConnectWebview < BaseResource + attr_accessor :accepted_devices, :accepted_providers, :any_device_allowed, :any_provider_allowed, :automatically_manage_new_devices, :connect_webview_id, :connected_account_id, :custom_metadata, :custom_redirect_failure_url, :custom_redirect_url, :device_selection_mode, :login_successful, :selected_provider, :status, :url, :wait_for_device_creation, :workspace_id - date_accessor :authorized_at, :created_at + date_accessor :authorized_at, :created_at + end end end diff --git a/lib/seam/routes/resources/connected_account.rb b/lib/seam/routes/resources/connected_account.rb index e4d1f86..2593f37 100644 --- a/lib/seam/routes/resources/connected_account.rb +++ b/lib/seam/routes/resources/connected_account.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class ConnectedAccount < BaseResource - attr_accessor :account_type, :account_type_display_name, :automatically_manage_new_devices, :connected_account_id, :custom_metadata, :user_identifier + module Resources + class ConnectedAccount < BaseResource + attr_accessor :account_type, :account_type_display_name, :automatically_manage_new_devices, :connected_account_id, :custom_metadata, :user_identifier - date_accessor :created_at + date_accessor :created_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/device.rb b/lib/seam/routes/resources/device.rb index 3eb943b..72a6f12 100644 --- a/lib/seam/routes/resources/device.rb +++ b/lib/seam/routes/resources/device.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class Device < BaseResource - attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :connected_account_id, :custom_metadata, :device_id, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :workspace_id + module Resources + class Device < BaseResource + attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :connected_account_id, :custom_metadata, :device_id, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :workspace_id - date_accessor :created_at + date_accessor :created_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/device_provider.rb b/lib/seam/routes/resources/device_provider.rb index 9990f9c..7b2bdd9 100644 --- a/lib/seam/routes/resources/device_provider.rb +++ b/lib/seam/routes/resources/device_provider.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true module Seam - class DeviceProvider < BaseResource - attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :device_provider_name, :display_name, :image_url, :provider_categories + module Resources + class DeviceProvider < BaseResource + attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :device_provider_name, :display_name, :image_url, :provider_categories + end end end diff --git a/lib/seam/routes/resources/enrollment_automation.rb b/lib/seam/routes/resources/enrollment_automation.rb index 3fba969..91ed104 100644 --- a/lib/seam/routes/resources/enrollment_automation.rb +++ b/lib/seam/routes/resources/enrollment_automation.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class EnrollmentAutomation < BaseResource - attr_accessor :credential_manager_acs_system_id, :enrollment_automation_id, :user_identity_id, :workspace_id + module Resources + class EnrollmentAutomation < BaseResource + attr_accessor :credential_manager_acs_system_id, :enrollment_automation_id, :user_identity_id, :workspace_id - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/event.rb b/lib/seam/routes/resources/event.rb index 70c438c..ac6e2dc 100644 --- a/lib/seam/routes/resources/event.rb +++ b/lib/seam/routes/resources/event.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class SeamEvent < BaseResource - attr_accessor :acs_credential_id, :acs_system_id, :acs_user_id, :action_attempt_id, :client_session_id, :climate_preset_key, :cooling_set_point_celsius, :cooling_set_point_fahrenheit, :device_id, :enrollment_automation_id, :event_description, :event_id, :event_type, :fan_mode_setting, :heating_set_point_celsius, :heating_set_point_fahrenheit, :hvac_mode_setting, :is_fallback_climate_preset, :thermostat_schedule_id, :workspace_id + module Resources + class SeamEvent < BaseResource + attr_accessor :acs_credential_id, :acs_system_id, :acs_user_id, :action_attempt_id, :client_session_id, :climate_preset_key, :cooling_set_point_celsius, :cooling_set_point_fahrenheit, :device_id, :enrollment_automation_id, :event_description, :event_id, :event_type, :fan_mode_setting, :heating_set_point_celsius, :heating_set_point_fahrenheit, :hvac_mode_setting, :is_fallback_climate_preset, :thermostat_schedule_id, :workspace_id - date_accessor :created_at, :occurred_at + date_accessor :created_at, :occurred_at + end end end diff --git a/lib/seam/routes/resources/index.rb b/lib/seam/routes/resources/index.rb index c894805..c06af56 100644 --- a/lib/seam/routes/resources/index.rb +++ b/lib/seam/routes/resources/index.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "seam/base_resource" require_relative "resource_error" require_relative "resource_warning" require_relative "resource_errors_support" diff --git a/lib/seam/routes/resources/network.rb b/lib/seam/routes/resources/network.rb index 343a602..08ba313 100644 --- a/lib/seam/routes/resources/network.rb +++ b/lib/seam/routes/resources/network.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class Network < BaseResource - attr_accessor :display_name, :network_id, :workspace_id + module Resources + class Network < BaseResource + attr_accessor :display_name, :network_id, :workspace_id - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/noise_threshold.rb b/lib/seam/routes/resources/noise_threshold.rb index 8a8ad13..16f7737 100644 --- a/lib/seam/routes/resources/noise_threshold.rb +++ b/lib/seam/routes/resources/noise_threshold.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true module Seam - class NoiseThreshold < BaseResource - attr_accessor :device_id, :ends_daily_at, :name, :noise_threshold_decibels, :noise_threshold_id, :noise_threshold_nrs, :starts_daily_at + module Resources + class NoiseThreshold < BaseResource + attr_accessor :device_id, :ends_daily_at, :name, :noise_threshold_decibels, :noise_threshold_id, :noise_threshold_nrs, :starts_daily_at + end end end diff --git a/lib/seam/routes/resources/phone.rb b/lib/seam/routes/resources/phone.rb index 319ea4c..327152e 100644 --- a/lib/seam/routes/resources/phone.rb +++ b/lib/seam/routes/resources/phone.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class Phone < BaseResource - attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :custom_metadata, :device_id, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :workspace_id + module Resources + class Phone < BaseResource + attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :custom_metadata, :device_id, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :workspace_id - date_accessor :created_at + date_accessor :created_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/resource_error.rb b/lib/seam/routes/resources/resource_error.rb index 412927b..fc8239b 100644 --- a/lib/seam/routes/resources/resource_error.rb +++ b/lib/seam/routes/resources/resource_error.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class ResourceError < BaseResource - attr_accessor :error_code, :message + module Resources + class ResourceError < BaseResource + attr_accessor :error_code, :message - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/resource_errors_support.rb b/lib/seam/routes/resources/resource_errors_support.rb index cfd89cb..5c54054 100644 --- a/lib/seam/routes/resources/resource_errors_support.rb +++ b/lib/seam/routes/resources/resource_errors_support.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - module ResourceErrorsSupport - def errors - @errors_converted ||= @errors.is_a?(Array) ? Seam::ResourceError.load_from_response(@errors) : [] + module Resources + module ResourceErrorsSupport + def errors + @errors_converted ||= @errors.is_a?(Array) ? Seam::Resources::ResourceError.load_from_response(@errors) : [] + end end end end diff --git a/lib/seam/routes/resources/resource_warning.rb b/lib/seam/routes/resources/resource_warning.rb index e822cab..05e4ce9 100644 --- a/lib/seam/routes/resources/resource_warning.rb +++ b/lib/seam/routes/resources/resource_warning.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class ResourceWarning < BaseResource - attr_accessor :warning_code, :message + module Resources + class ResourceWarning < BaseResource + attr_accessor :warning_code, :message - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/resource_warnings_support.rb b/lib/seam/routes/resources/resource_warnings_support.rb index 765eb78..3efcc76 100644 --- a/lib/seam/routes/resources/resource_warnings_support.rb +++ b/lib/seam/routes/resources/resource_warnings_support.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - module ResourceWarningsSupport - def warnings - @warnings_converted ||= @warnings.is_a?(Array) ? Seam::ResourceWarning.load_from_response(@warnings) : [] + module Resources + module ResourceWarningsSupport + def warnings + @warnings_converted ||= @warnings.is_a?(Array) ? Seam::Resources::ResourceWarning.load_from_response(@warnings) : [] + end end end end diff --git a/lib/seam/routes/resources/service_health.rb b/lib/seam/routes/resources/service_health.rb index b0480e9..235d7c1 100644 --- a/lib/seam/routes/resources/service_health.rb +++ b/lib/seam/routes/resources/service_health.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true module Seam - class ServiceHealth < BaseResource - attr_accessor :description, :service, :status + module Resources + class ServiceHealth < BaseResource + attr_accessor :description, :service, :status + end end end diff --git a/lib/seam/routes/resources/thermostat_schedule.rb b/lib/seam/routes/resources/thermostat_schedule.rb index b9a23b8..a871110 100644 --- a/lib/seam/routes/resources/thermostat_schedule.rb +++ b/lib/seam/routes/resources/thermostat_schedule.rb @@ -1,11 +1,13 @@ # frozen_string_literal: true module Seam - class ThermostatSchedule < BaseResource - attr_accessor :climate_preset_key, :device_id, :max_override_period_minutes, :name, :thermostat_schedule_id + module Resources + class ThermostatSchedule < BaseResource + attr_accessor :climate_preset_key, :device_id, :max_override_period_minutes, :name, :thermostat_schedule_id - date_accessor :created_at, :ends_at, :starts_at + date_accessor :created_at, :ends_at, :starts_at - include Seam::ResourceErrorsSupport + include Seam::Resources::ResourceErrorsSupport + end end end diff --git a/lib/seam/routes/resources/unmanaged_access_code.rb b/lib/seam/routes/resources/unmanaged_access_code.rb index be46405..5bd5d14 100644 --- a/lib/seam/routes/resources/unmanaged_access_code.rb +++ b/lib/seam/routes/resources/unmanaged_access_code.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class UnmanagedAccessCode < BaseResource - attr_accessor :access_code_id, :code, :device_id, :is_managed, :name, :status, :type + module Resources + class UnmanagedAccessCode < BaseResource + attr_accessor :access_code_id, :code, :device_id, :is_managed, :name, :status, :type - date_accessor :created_at, :ends_at, :starts_at + date_accessor :created_at, :ends_at, :starts_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/unmanaged_device.rb b/lib/seam/routes/resources/unmanaged_device.rb index d15f360..a29a1af 100644 --- a/lib/seam/routes/resources/unmanaged_device.rb +++ b/lib/seam/routes/resources/unmanaged_device.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true module Seam - class UnmanagedDevice < BaseResource - attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :connected_account_id, :device_id, :device_type, :is_managed, :location, :properties, :workspace_id + module Resources + class UnmanagedDevice < BaseResource + attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :connected_account_id, :device_id, :device_type, :is_managed, :location, :properties, :workspace_id - date_accessor :created_at + date_accessor :created_at - include Seam::ResourceErrorsSupport - include Seam::ResourceWarningsSupport + include Seam::Resources::ResourceErrorsSupport + include Seam::Resources::ResourceWarningsSupport + end end end diff --git a/lib/seam/routes/resources/user_identity.rb b/lib/seam/routes/resources/user_identity.rb index 0424719..e8e54d0 100644 --- a/lib/seam/routes/resources/user_identity.rb +++ b/lib/seam/routes/resources/user_identity.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true module Seam - class UserIdentity < BaseResource - attr_accessor :display_name, :email_address, :full_name, :phone_number, :user_identity_id, :user_identity_key, :workspace_id + module Resources + class UserIdentity < BaseResource + attr_accessor :display_name, :email_address, :full_name, :phone_number, :user_identity_id, :user_identity_key, :workspace_id - date_accessor :created_at + date_accessor :created_at + end end end diff --git a/lib/seam/routes/resources/webhook.rb b/lib/seam/routes/resources/webhook.rb index 86fc582..3e26abb 100644 --- a/lib/seam/routes/resources/webhook.rb +++ b/lib/seam/routes/resources/webhook.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true module Seam - class Webhook < BaseResource - attr_accessor :event_types, :secret, :url, :webhook_id + module Resources + class Webhook < BaseResource + attr_accessor :event_types, :secret, :url, :webhook_id + end end end diff --git a/lib/seam/routes/resources/workspace.rb b/lib/seam/routes/resources/workspace.rb index 8693bb2..da015bc 100644 --- a/lib/seam/routes/resources/workspace.rb +++ b/lib/seam/routes/resources/workspace.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true module Seam - class Workspace < BaseResource - attr_accessor :company_name, :connect_partner_name, :is_sandbox, :name, :workspace_id + module Resources + class Workspace < BaseResource + attr_accessor :company_name, :connect_partner_name, :is_sandbox, :name, :workspace_id + end end end diff --git a/package-lock.json b/package-lock.json index e1642d5..3e9936c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,8 +6,8 @@ "": { "name": "@seamapi/ruby", "devDependencies": { - "@seamapi/nextlove-sdk-generator": "1.14.4", - "@seamapi/types": "1.258.2", + "@seamapi/nextlove-sdk-generator": "1.14.6", + "@seamapi/types": "1.264.2", "del": "^7.1.0", "prettier": "^3.2.5" } @@ -416,9 +416,9 @@ } }, "node_modules/@seamapi/nextlove-sdk-generator": { - "version": "1.14.4", - "resolved": "https://registry.npmjs.org/@seamapi/nextlove-sdk-generator/-/nextlove-sdk-generator-1.14.4.tgz", - "integrity": "sha512-kL7lyKEOh/kp5HgEzNYVGZZGYo9Li8LPU/QSGKNLx8chupHt9Prar3d+JEykeOhIcvIFLIWcJicTXhtoY+vYYg==", + "version": "1.14.6", + "resolved": "https://registry.npmjs.org/@seamapi/nextlove-sdk-generator/-/nextlove-sdk-generator-1.14.6.tgz", + "integrity": "sha512-SGOGUUZ+bzdm2xPzkbBc/a+t9Zlhee/nLF61rHcqGpljugKUTzyyoyT6iGdtFqO0zJiUtljakS1od6AJtONOow==", "dev": true, "dependencies": { "@nodelib/fs.walk": "^2.0.0", @@ -437,9 +437,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.258.2", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.258.2.tgz", - "integrity": "sha512-8V5+qRXXtMM+hXcMrgmtqxodDKtbCodAE72I7eBjDROBs3olqB+Z8TRiUVqHogVEVelU+1hO3Vm6Mzjh386tXw==", + "version": "1.264.2", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.264.2.tgz", + "integrity": "sha512-PJzQEN1TVmJ9rCIbgC/0R6iG0uc+/vlHzspknnxF5O5QzuH/pv+YN0vRFkF9WxTMo99lDjIPr6myEnlvAsX1WQ==", "dev": true, "engines": { "node": ">=18.12.0", diff --git a/package.json b/package.json index dc160e9..3216a19 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "format": "prettier --write --ignore-path .gitignore ." }, "devDependencies": { - "@seamapi/nextlove-sdk-generator": "1.14.4", - "@seamapi/types": "1.258.2", + "@seamapi/nextlove-sdk-generator": "1.14.6", + "@seamapi/types": "1.264.2", "del": "^7.1.0", "prettier": "^3.2.5" }