diff --git a/package-lock.json b/package-lock.json index bdc5227..c4e58cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "sdk1", - "version": "1.0.0", + "name": "@seamapi/php", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "sdk1", - "version": "1.0.0", + "name": "@seamapi/php", + "version": "2.0.0", "license": "MIT", "devDependencies": { "@prettier/plugin-php": "^0.22.1", diff --git a/src/Objects/AccessCode.php b/src/Objects/AccessCode.php deleted file mode 100644 index c324f22..0000000 --- a/src/Objects/AccessCode.php +++ /dev/null @@ -1,65 +0,0 @@ -common_code_key ?? null, - is_scheduled_on_device: $json->is_scheduled_on_device ?? null, - type: $json->type, - is_waiting_for_code_assignment: $json->is_waiting_for_code_assignment ?? null, - access_code_id: $json->access_code_id, - device_id: $json->device_id, - name: $json->name ?? null, - code: $json->code ?? null, - created_at: $json->created_at, - errors: $json->errors ?? null, - warnings: $json->warnings ?? null, - is_managed: $json->is_managed, - starts_at: $json->starts_at ?? null, - ends_at: $json->ends_at ?? null, - status: $json->status, - is_backup_access_code_available: $json->is_backup_access_code_available, - is_backup: $json->is_backup ?? null, - pulled_backup_access_code_id: $json->pulled_backup_access_code_id ?? null, - is_external_modification_allowed: $json->is_external_modification_allowed, - is_one_time_use: $json->is_one_time_use, - is_offline_access_code: $json->is_offline_access_code, - ); - } - - - - public function __construct( - public string | null $common_code_key, - public bool | null $is_scheduled_on_device, - public string $type, - public bool | null $is_waiting_for_code_assignment, - public string $access_code_id, - public string $device_id, - public string | null $name, - public string | null $code, - public string $created_at, - public mixed $errors, - public mixed $warnings, - public bool $is_managed, - public string | null $starts_at, - public string | null $ends_at, - public string $status, - public bool $is_backup_access_code_available, - public bool | null $is_backup, - public string | null $pulled_backup_access_code_id, - public bool $is_external_modification_allowed, - public bool $is_one_time_use, - public bool $is_offline_access_code, - ) { - } - -} diff --git a/src/Objects/AcsAccessGroup.php b/src/Objects/AcsAccessGroup.php deleted file mode 100644 index 81c6c89..0000000 --- a/src/Objects/AcsAccessGroup.php +++ /dev/null @@ -1,41 +0,0 @@ -acs_access_group_id, - acs_system_id: $json->acs_system_id, - workspace_id: $json->workspace_id, - name: $json->name, - access_group_type: $json->access_group_type, - access_group_type_display_name: $json->access_group_type_display_name, - external_type: $json->external_type, - external_type_display_name: $json->external_type_display_name, - created_at: $json->created_at, - ); - } - - - - public function __construct( - public string $acs_access_group_id, - public string $acs_system_id, - public string $workspace_id, - public string $name, - public string $access_group_type, - public string $access_group_type_display_name, - public string $external_type, - public string $external_type_display_name, - public string $created_at, - ) { - } - -} diff --git a/src/Objects/AcsSystem.php b/src/Objects/AcsSystem.php deleted file mode 100644 index f69c771..0000000 --- a/src/Objects/AcsSystem.php +++ /dev/null @@ -1,41 +0,0 @@ -acs_system_id, - external_type: $json->external_type, - external_type_display_name: $json->external_type_display_name, - system_type: $json->system_type, - system_type_display_name: $json->system_type_display_name, - name: $json->name, - created_at: $json->created_at, - workspace_id: $json->workspace_id, - connected_account_ids: $json->connected_account_ids, - ); - } - - - - public function __construct( - public string $acs_system_id, - public string $external_type, - public string $external_type_display_name, - public string $system_type, - public string $system_type_display_name, - public string $name, - public string $created_at, - public string $workspace_id, - public array $connected_account_ids, - ) { - } - -} diff --git a/src/Objects/AcsUser.php b/src/Objects/AcsUser.php deleted file mode 100644 index 6609b6c..0000000 --- a/src/Objects/AcsUser.php +++ /dev/null @@ -1,57 +0,0 @@ -acs_user_id, - acs_system_id: $json->acs_system_id, - hid_acs_system_id: $json->hid_acs_system_id ?? null, - workspace_id: $json->workspace_id, - created_at: $json->created_at, - display_name: $json->display_name, - external_type: $json->external_type ?? null, - external_type_display_name: $json->external_type_display_name ?? null, - is_suspended: $json->is_suspended, - access_schedule: isset($json->access_schedule) ? AcsUserAccessSchedule::from_json($json->access_schedule) : null, - user_identity_id: $json->user_identity_id ?? null, - user_identity_email_address: $json->user_identity_email_address ?? null, - user_identity_phone_number: $json->user_identity_phone_number ?? null, - full_name: $json->full_name ?? null, - email: $json->email ?? null, - email_address: $json->email_address ?? null, - phone_number: $json->phone_number ?? null, - ); - } - - - - public function __construct( - public string $acs_user_id, - public string $acs_system_id, - public string | null $hid_acs_system_id, - public string $workspace_id, - public string $created_at, - public string $display_name, - public string | null $external_type, - public string | null $external_type_display_name, - public bool $is_suspended, - public AcsUserAccessSchedule | null $access_schedule, - public string | null $user_identity_id, - public string | null $user_identity_email_address, - public string | null $user_identity_phone_number, - public string | null $full_name, - public string | null $email, - public string | null $email_address, - public string | null $phone_number, - ) { - } - -} diff --git a/src/Objects/AcsUserAccessSchedule.php b/src/Objects/AcsUserAccessSchedule.php deleted file mode 100644 index fe297d5..0000000 --- a/src/Objects/AcsUserAccessSchedule.php +++ /dev/null @@ -1,27 +0,0 @@ -starts_at, - ends_at: $json->ends_at, - ); - } - - - - public function __construct( - public string $starts_at, - public string $ends_at, - ) { - } - -} diff --git a/src/Objects/ActionAttempt.php b/src/Objects/ActionAttempt.php deleted file mode 100644 index fe8c5b2..0000000 --- a/src/Objects/ActionAttempt.php +++ /dev/null @@ -1,33 +0,0 @@ -status ?? null, - action_type: $json->action_type ?? null, - action_attempt_id: $json->action_attempt_id ?? null, - result: $json->result ?? null, - error: isset($json->error) ? ActionAttemptError::from_json($json->error) : null, - ); - } - - - - public function __construct( - public string | null $status, - public string | null $action_type, - public string | null $action_attempt_id, - public mixed $result, - public ActionAttemptError | null $error, - ) { - } - -} diff --git a/src/Objects/ActionAttemptError.php b/src/Objects/ActionAttemptError.php deleted file mode 100644 index 0f36f54..0000000 --- a/src/Objects/ActionAttemptError.php +++ /dev/null @@ -1,27 +0,0 @@ -type, - message: $json->message, - ); - } - - - - public function __construct( - public string $type, - public string $message, - ) { - } - -} diff --git a/src/Objects/ClientSession.php b/src/Objects/ClientSession.php deleted file mode 100644 index 1b863c2..0000000 --- a/src/Objects/ClientSession.php +++ /dev/null @@ -1,41 +0,0 @@ -client_session_id, - user_identifier_key: $json->user_identifier_key ?? null, - created_at: $json->created_at, - token: $json->token, - device_count: $json->device_count, - connected_account_ids: $json->connected_account_ids, - connect_webview_ids: $json->connect_webview_ids, - user_identity_ids: $json->user_identity_ids, - workspace_id: $json->workspace_id, - ); - } - - - - public function __construct( - public string $client_session_id, - public string | null $user_identifier_key, - public string $created_at, - public string $token, - public int $device_count, - public array $connected_account_ids, - public array $connect_webview_ids, - public array $user_identity_ids, - public string $workspace_id, - ) { - } - -} diff --git a/src/Objects/ClimateSettingSchedule.php b/src/Objects/ClimateSettingSchedule.php deleted file mode 100644 index 4eaefd7..0000000 --- a/src/Objects/ClimateSettingSchedule.php +++ /dev/null @@ -1,55 +0,0 @@ -climate_setting_schedule_id, - schedule_type: $json->schedule_type, - device_id: $json->device_id, - name: $json->name ?? null, - schedule_starts_at: $json->schedule_starts_at, - schedule_ends_at: $json->schedule_ends_at, - created_at: $json->created_at, - errors: $json->errors ?? null, - automatic_heating_enabled: $json->automatic_heating_enabled ?? null, - automatic_cooling_enabled: $json->automatic_cooling_enabled ?? null, - hvac_mode_setting: $json->hvac_mode_setting ?? null, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, - heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, - manual_override_allowed: $json->manual_override_allowed ?? null, - ); - } - - - - public function __construct( - public string $climate_setting_schedule_id, - public string $schedule_type, - public string $device_id, - public string | null $name, - public string $schedule_starts_at, - public string $schedule_ends_at, - public string $created_at, - public mixed $errors, - public bool | null $automatic_heating_enabled, - public bool | null $automatic_cooling_enabled, - public string | null $hvac_mode_setting, - public int | null $cooling_set_point_celsius, - public int | null $heating_set_point_celsius, - public int | null $cooling_set_point_fahrenheit, - public int | null $heating_set_point_fahrenheit, - public bool | null $manual_override_allowed, - ) { - } - -} diff --git a/src/Objects/ConnectWebview.php b/src/Objects/ConnectWebview.php deleted file mode 100644 index 20adb4f..0000000 --- a/src/Objects/ConnectWebview.php +++ /dev/null @@ -1,61 +0,0 @@ -connect_webview_id, - connected_account_id: $json->connected_account_id ?? null, - url: $json->url, - workspace_id: $json->workspace_id, - device_selection_mode: $json->device_selection_mode, - accepted_providers: $json->accepted_providers, - accepted_devices: $json->accepted_devices, - any_provider_allowed: $json->any_provider_allowed, - any_device_allowed: $json->any_device_allowed, - created_at: $json->created_at, - login_successful: $json->login_successful, - status: $json->status, - custom_redirect_url: $json->custom_redirect_url ?? null, - custom_redirect_failure_url: $json->custom_redirect_failure_url ?? null, - custom_metadata: $json->custom_metadata, - automatically_manage_new_devices: $json->automatically_manage_new_devices, - wait_for_device_creation: $json->wait_for_device_creation, - authorized_at: $json->authorized_at ?? null, - selected_provider: $json->selected_provider ?? null, - ); - } - - - - public function __construct( - public string $connect_webview_id, - public string | null $connected_account_id, - public string $url, - public string $workspace_id, - public string $device_selection_mode, - public array $accepted_providers, - public array $accepted_devices, - public bool $any_provider_allowed, - public bool $any_device_allowed, - public string $created_at, - public bool $login_successful, - public string $status, - public string | null $custom_redirect_url, - public string | null $custom_redirect_failure_url, - public mixed $custom_metadata, - public bool $automatically_manage_new_devices, - public bool $wait_for_device_creation, - public string | null $authorized_at, - public string | null $selected_provider, - ) { - } - -} diff --git a/src/Objects/ConnectedAccount.php b/src/Objects/ConnectedAccount.php deleted file mode 100644 index 025ac61..0000000 --- a/src/Objects/ConnectedAccount.php +++ /dev/null @@ -1,41 +0,0 @@ -connected_account_id ?? null, - created_at: $json->created_at ?? null, - user_identifier: isset($json->user_identifier) ? ConnectedAccountUserIdentifier::from_json($json->user_identifier) : null, - account_type: $json->account_type ?? null, - account_type_display_name: $json->account_type_display_name, - errors: $json->errors ?? null, - warnings: $json->warnings ?? null, - custom_metadata: $json->custom_metadata ?? null, - automatically_manage_new_devices: $json->automatically_manage_new_devices, - ); - } - - - - public function __construct( - public string | null $connected_account_id, - public string | null $created_at, - public ConnectedAccountUserIdentifier | null $user_identifier, - public string | null $account_type, - public string $account_type_display_name, - public mixed $errors, - public mixed $warnings, - public mixed $custom_metadata, - public bool $automatically_manage_new_devices, - ) { - } - -} diff --git a/src/Objects/ConnectedAccountUserIdentifier.php b/src/Objects/ConnectedAccountUserIdentifier.php deleted file mode 100644 index b8c0356..0000000 --- a/src/Objects/ConnectedAccountUserIdentifier.php +++ /dev/null @@ -1,33 +0,0 @@ -username ?? null, - api_url: $json->api_url ?? null, - email: $json->email ?? null, - phone: $json->phone ?? null, - exclusive: $json->exclusive ?? null, - ); - } - - - - public function __construct( - public string | null $username, - public string | null $api_url, - public string | null $email, - public string | null $phone, - public bool | null $exclusive, - ) { - } - -} diff --git a/src/Objects/Device.php b/src/Objects/Device.php deleted file mode 100644 index 6a8c53a..0000000 --- a/src/Objects/Device.php +++ /dev/null @@ -1,57 +0,0 @@ -device_id, - device_type: $json->device_type, - capabilities_supported: $json->capabilities_supported, - properties: DeviceProperties::from_json($json->properties), - location: isset($json->location) ? DeviceLocation::from_json($json->location) : null, - connected_account_id: $json->connected_account_id, - workspace_id: $json->workspace_id, - errors: array_map( - fn ($e) => DeviceErrors::from_json($e), - $json->errors ?? [] - ), - warnings: array_map( - fn ($w) => DeviceWarnings::from_json($w), - $json->warnings ?? [] - ), - created_at: $json->created_at, - is_managed: $json->is_managed, - custom_metadata: $json->custom_metadata ?? null, - can_remotely_unlock: $json->can_remotely_unlock ?? null, - can_program_online_access_codes: $json->can_program_online_access_codes ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_type, - public array $capabilities_supported, - public DeviceProperties $properties, - public DeviceLocation | null $location, - public string $connected_account_id, - public string $workspace_id, - public array $errors, - public array $warnings, - public string $created_at, - public bool $is_managed, - public mixed $custom_metadata, - public bool | null $can_remotely_unlock, - public bool | null $can_program_online_access_codes, - ) { - } - -} diff --git a/src/Objects/DeviceAccelerometerZ.php b/src/Objects/DeviceAccelerometerZ.php deleted file mode 100644 index 0bec93e..0000000 --- a/src/Objects/DeviceAccelerometerZ.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public int $value, - ) { - } - -} diff --git a/src/Objects/DeviceActiveClimateSettingSchedule.php b/src/Objects/DeviceActiveClimateSettingSchedule.php deleted file mode 100644 index 43182c6..0000000 --- a/src/Objects/DeviceActiveClimateSettingSchedule.php +++ /dev/null @@ -1,55 +0,0 @@ -climate_setting_schedule_id, - schedule_type: $json->schedule_type, - device_id: $json->device_id, - name: $json->name ?? null, - schedule_starts_at: $json->schedule_starts_at, - schedule_ends_at: $json->schedule_ends_at, - created_at: $json->created_at, - errors: $json->errors ?? null, - automatic_heating_enabled: $json->automatic_heating_enabled ?? null, - automatic_cooling_enabled: $json->automatic_cooling_enabled ?? null, - hvac_mode_setting: $json->hvac_mode_setting ?? null, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, - heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, - manual_override_allowed: $json->manual_override_allowed ?? null, - ); - } - - - - public function __construct( - public string $climate_setting_schedule_id, - public string $schedule_type, - public string $device_id, - public string | null $name, - public string $schedule_starts_at, - public string $schedule_ends_at, - public string $created_at, - public mixed $errors, - public bool | null $automatic_heating_enabled, - public bool | null $automatic_cooling_enabled, - public string | null $hvac_mode_setting, - public int | null $cooling_set_point_celsius, - public int | null $heating_set_point_celsius, - public int | null $cooling_set_point_fahrenheit, - public int | null $heating_set_point_fahrenheit, - public bool | null $manual_override_allowed, - ) { - } - -} diff --git a/src/Objects/DeviceAssaAbloyCredentialServiceMetadata.php b/src/Objects/DeviceAssaAbloyCredentialServiceMetadata.php deleted file mode 100644 index 3c8cfef..0000000 --- a/src/Objects/DeviceAssaAbloyCredentialServiceMetadata.php +++ /dev/null @@ -1,30 +0,0 @@ -has_active_endpoint, - endpoints: array_map( - fn ($e) => DeviceEndpoints::from_json($e), - $json->endpoints ?? [] - ), - ); - } - - - - public function __construct( - public bool $has_active_endpoint, - public array $endpoints, - ) { - } - -} diff --git a/src/Objects/DeviceAugustMetadata.php b/src/Objects/DeviceAugustMetadata.php deleted file mode 100644 index 0096bb2..0000000 --- a/src/Objects/DeviceAugustMetadata.php +++ /dev/null @@ -1,37 +0,0 @@ -lock_id, - lock_name: $json->lock_name, - house_name: $json->house_name, - has_keypad: $json->has_keypad, - keypad_battery_level: $json->keypad_battery_level ?? null, - model: $json->model ?? null, - house_id: $json->house_id ?? null, - ); - } - - - - public function __construct( - public string $lock_id, - public string $lock_name, - public string $house_name, - public bool $has_keypad, - public string | null $keypad_battery_level, - public string | null $model, - public string | null $house_id, - ) { - } - -} diff --git a/src/Objects/DeviceAvigilonAltaMetadata.php b/src/Objects/DeviceAvigilonAltaMetadata.php deleted file mode 100644 index 79db219..0000000 --- a/src/Objects/DeviceAvigilonAltaMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -entry_name, - org_name: $json->org_name, - zone_id: $json->zone_id, - zone_name: $json->zone_name, - site_id: $json->site_id, - site_name: $json->site_name, - ); - } - - - - public function __construct( - public string $entry_name, - public string $org_name, - public int $zone_id, - public string $zone_name, - public int $site_id, - public string $site_name, - ) { - } - -} diff --git a/src/Objects/DeviceBattery.php b/src/Objects/DeviceBattery.php deleted file mode 100644 index 91f14c7..0000000 --- a/src/Objects/DeviceBattery.php +++ /dev/null @@ -1,27 +0,0 @@ -level, - status: $json->status, - ); - } - - - - public function __construct( - public int $level, - public string $status, - ) { - } - -} diff --git a/src/Objects/DeviceBrivoMetadata.php b/src/Objects/DeviceBrivoMetadata.php deleted file mode 100644 index f72ce3c..0000000 --- a/src/Objects/DeviceBrivoMetadata.php +++ /dev/null @@ -1,25 +0,0 @@ -device_name, - ); - } - - - - public function __construct( - public string $device_name, - ) { - } - -} diff --git a/src/Objects/DeviceCodeConstraints.php b/src/Objects/DeviceCodeConstraints.php deleted file mode 100644 index 737404f..0000000 --- a/src/Objects/DeviceCodeConstraints.php +++ /dev/null @@ -1,29 +0,0 @@ -constraint_type, - min_length: $json->min_length ?? null, - max_length: $json->max_length ?? null, - ); - } - - - - public function __construct( - public string $constraint_type, - public int | null $min_length, - public int | null $max_length, - ) { - } - -} diff --git a/src/Objects/DeviceControlbywebMetadata.php b/src/Objects/DeviceControlbywebMetadata.php deleted file mode 100644 index 9e38bd1..0000000 --- a/src/Objects/DeviceControlbywebMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - relay_name: $json->relay_name ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string | null $relay_name, - ) { - } - -} diff --git a/src/Objects/DeviceCurrentClimateSetting.php b/src/Objects/DeviceCurrentClimateSetting.php deleted file mode 100644 index be6edea..0000000 --- a/src/Objects/DeviceCurrentClimateSetting.php +++ /dev/null @@ -1,39 +0,0 @@ -automatic_heating_enabled, - automatic_cooling_enabled: $json->automatic_cooling_enabled, - hvac_mode_setting: $json->hvac_mode_setting, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, - heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, - manual_override_allowed: $json->manual_override_allowed, - ); - } - - - - public function __construct( - public bool $automatic_heating_enabled, - public bool $automatic_cooling_enabled, - public string $hvac_mode_setting, - public int | null $cooling_set_point_celsius, - public int | null $heating_set_point_celsius, - public int | null $cooling_set_point_fahrenheit, - public int | null $heating_set_point_fahrenheit, - public bool $manual_override_allowed, - ) { - } - -} diff --git a/src/Objects/DeviceDefaultClimateSetting.php b/src/Objects/DeviceDefaultClimateSetting.php deleted file mode 100644 index 35af97f..0000000 --- a/src/Objects/DeviceDefaultClimateSetting.php +++ /dev/null @@ -1,39 +0,0 @@ -automatic_heating_enabled, - automatic_cooling_enabled: $json->automatic_cooling_enabled, - hvac_mode_setting: $json->hvac_mode_setting, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, - heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, - manual_override_allowed: $json->manual_override_allowed, - ); - } - - - - public function __construct( - public bool $automatic_heating_enabled, - public bool $automatic_cooling_enabled, - public string $hvac_mode_setting, - public int | null $cooling_set_point_celsius, - public int | null $heating_set_point_celsius, - public int | null $cooling_set_point_fahrenheit, - public int | null $heating_set_point_fahrenheit, - public bool $manual_override_allowed, - ) { - } - -} diff --git a/src/Objects/DeviceDormakabaOracodeMetadata.php b/src/Objects/DeviceDormakabaOracodeMetadata.php deleted file mode 100644 index e27dd21..0000000 --- a/src/Objects/DeviceDormakabaOracodeMetadata.php +++ /dev/null @@ -1,40 +0,0 @@ -door_id, - door_name: $json->door_name, - device_id: $json->device_id ?? null, - site_id: $json->site_id, - site_name: $json->site_name, - iana_timezone: $json->iana_timezone ?? null, - predefined_time_slots: array_map( - fn ($p) => DevicePredefinedTimeSlots::from_json($p), - $json->predefined_time_slots ?? [] - ), - ); - } - - - - public function __construct( - public int $door_id, - public string $door_name, - public int | null $device_id, - public int $site_id, - public string $site_name, - public string | null $iana_timezone, - public array | null $predefined_time_slots, - ) { - } - -} diff --git a/src/Objects/DeviceEcobeeMetadata.php b/src/Objects/DeviceEcobeeMetadata.php deleted file mode 100644 index 70a64d9..0000000 --- a/src/Objects/DeviceEcobeeMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -ecobee_device_id, - device_name: $json->device_name, - ); - } - - - - public function __construct( - public string $ecobee_device_id, - public string $device_name, - ) { - } - -} diff --git a/src/Objects/DeviceEndpoints.php b/src/Objects/DeviceEndpoints.php deleted file mode 100644 index 6df6381..0000000 --- a/src/Objects/DeviceEndpoints.php +++ /dev/null @@ -1,27 +0,0 @@ -endpoint_id, - is_active: $json->is_active, - ); - } - - - - public function __construct( - public string $endpoint_id, - public bool $is_active, - ) { - } - -} diff --git a/src/Objects/DeviceErrors.php b/src/Objects/DeviceErrors.php deleted file mode 100644 index b3322de..0000000 --- a/src/Objects/DeviceErrors.php +++ /dev/null @@ -1,29 +0,0 @@ -error_code, - message: $json->message, - created_at: $json->created_at ?? null, - ); - } - - - - public function __construct( - public string $error_code, - public string $message, - public string | null $created_at, - ) { - } - -} diff --git a/src/Objects/DeviceFourSuitesMetadata.php b/src/Objects/DeviceFourSuitesMetadata.php deleted file mode 100644 index d47fa3d..0000000 --- a/src/Objects/DeviceFourSuitesMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - reclose_delay_in_seconds: $json->reclose_delay_in_seconds, - ); - } - - - - public function __construct( - public int $device_id, - public string $device_name, - public int $reclose_delay_in_seconds, - ) { - } - -} diff --git a/src/Objects/DeviceGenieMetadata.php b/src/Objects/DeviceGenieMetadata.php deleted file mode 100644 index fe16a73..0000000 --- a/src/Objects/DeviceGenieMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -device_name, - door_name: $json->door_name, - ); - } - - - - public function __construct( - public string $device_name, - public string $door_name, - ) { - } - -} diff --git a/src/Objects/DeviceHoneywellMetadata.php b/src/Objects/DeviceHoneywellMetadata.php deleted file mode 100644 index 6d3314d..0000000 --- a/src/Objects/DeviceHoneywellMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -honeywell_device_id, - device_name: $json->device_name, - ); - } - - - - public function __construct( - public string $honeywell_device_id, - public string $device_name, - ) { - } - -} diff --git a/src/Objects/DeviceHubitatMetadata.php b/src/Objects/DeviceHubitatMetadata.php deleted file mode 100644 index ca71788..0000000 --- a/src/Objects/DeviceHubitatMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - device_label: $json->device_label, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string $device_label, - ) { - } - -} diff --git a/src/Objects/DeviceHumidity.php b/src/Objects/DeviceHumidity.php deleted file mode 100644 index afc93ee..0000000 --- a/src/Objects/DeviceHumidity.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public int $value, - ) { - } - -} diff --git a/src/Objects/DeviceIglooMetadata.php b/src/Objects/DeviceIglooMetadata.php deleted file mode 100644 index b9ac728..0000000 --- a/src/Objects/DeviceIglooMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - bridge_id: $json->bridge_id, - model: $json->model ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $bridge_id, - public string | null $model, - ) { - } - -} diff --git a/src/Objects/DeviceIgloohomeMetadata.php b/src/Objects/DeviceIgloohomeMetadata.php deleted file mode 100644 index 002f521..0000000 --- a/src/Objects/DeviceIgloohomeMetadata.php +++ /dev/null @@ -1,31 +0,0 @@ -device_id, - device_name: $json->device_name, - bridge_id: $json->bridge_id ?? null, - bridge_name: $json->bridge_name ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string | null $bridge_id, - public string | null $bridge_name, - ) { - } - -} diff --git a/src/Objects/DeviceKeypadBattery.php b/src/Objects/DeviceKeypadBattery.php deleted file mode 100644 index 2189d4e..0000000 --- a/src/Objects/DeviceKeypadBattery.php +++ /dev/null @@ -1,25 +0,0 @@ -level, - ); - } - - - - public function __construct( - public int $level, - ) { - } - -} diff --git a/src/Objects/DeviceKwiksetMetadata.php b/src/Objects/DeviceKwiksetMetadata.php deleted file mode 100644 index fbd01dd..0000000 --- a/src/Objects/DeviceKwiksetMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - model_number: $json->model_number, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string $model_number, - ) { - } - -} diff --git a/src/Objects/DeviceLatestSensorValues.php b/src/Objects/DeviceLatestSensorValues.php deleted file mode 100644 index 3330a5a..0000000 --- a/src/Objects/DeviceLatestSensorValues.php +++ /dev/null @@ -1,33 +0,0 @@ -temperature), - sound: DeviceSound::from_json($json->sound), - humidity: DeviceHumidity::from_json($json->humidity), - pressure: DevicePressure::from_json($json->pressure), - accelerometer_z: DeviceAccelerometerZ::from_json($json->accelerometer_z), - ); - } - - - - public function __construct( - public DeviceTemperature $temperature, - public DeviceSound $sound, - public DeviceHumidity $humidity, - public DevicePressure $pressure, - public DeviceAccelerometerZ $accelerometer_z, - ) { - } - -} diff --git a/src/Objects/DeviceLocation.php b/src/Objects/DeviceLocation.php deleted file mode 100644 index 62ec8ee..0000000 --- a/src/Objects/DeviceLocation.php +++ /dev/null @@ -1,27 +0,0 @@ -location_name ?? null, - timezone: $json->timezone ?? null, - ); - } - - - - public function __construct( - public string | null $location_name, - public string | null $timezone, - ) { - } - -} diff --git a/src/Objects/DeviceLocklyMetadata.php b/src/Objects/DeviceLocklyMetadata.php deleted file mode 100644 index 5ff72fb..0000000 --- a/src/Objects/DeviceLocklyMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - model: $json->model ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string | null $model, - ) { - } - -} diff --git a/src/Objects/DeviceMinutMetadata.php b/src/Objects/DeviceMinutMetadata.php deleted file mode 100644 index 2d6443e..0000000 --- a/src/Objects/DeviceMinutMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - latest_sensor_values: DeviceLatestSensorValues::from_json($json->latest_sensor_values), - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public DeviceLatestSensorValues $latest_sensor_values, - ) { - } - -} diff --git a/src/Objects/DeviceModel.php b/src/Objects/DeviceModel.php deleted file mode 100644 index 48de7a0..0000000 --- a/src/Objects/DeviceModel.php +++ /dev/null @@ -1,33 +0,0 @@ -display_name, - manufacturer_display_name: $json->manufacturer_display_name, - offline_access_codes_supported: $json->offline_access_codes_supported ?? null, - online_access_codes_supported: $json->online_access_codes_supported ?? null, - accessory_keypad_supported: $json->accessory_keypad_supported ?? null, - ); - } - - - - public function __construct( - public string $display_name, - public string $manufacturer_display_name, - public bool | null $offline_access_codes_supported, - public bool | null $online_access_codes_supported, - public bool | null $accessory_keypad_supported, - ) { - } - -} diff --git a/src/Objects/DeviceNestMetadata.php b/src/Objects/DeviceNestMetadata.php deleted file mode 100644 index 824984c..0000000 --- a/src/Objects/DeviceNestMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -nest_device_id, - device_name: $json->device_name, - custom_name: $json->custom_name, - ); - } - - - - public function __construct( - public string $nest_device_id, - public string $device_name, - public string $custom_name, - ) { - } - -} diff --git a/src/Objects/DeviceNoiseawareMetadata.php b/src/Objects/DeviceNoiseawareMetadata.php deleted file mode 100644 index 5e480a4..0000000 --- a/src/Objects/DeviceNoiseawareMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -device_model, - noise_level_nrs: $json->noise_level_nrs, - noise_level_decibel: $json->noise_level_decibel, - device_name: $json->device_name, - device_id: $json->device_id, - ); - } - - - - public function __construct( - public string $device_model, - public int $noise_level_nrs, - public int $noise_level_decibel, - public string $device_name, - public string $device_id, - ) { - } - -} diff --git a/src/Objects/DeviceNukiMetadata.php b/src/Objects/DeviceNukiMetadata.php deleted file mode 100644 index e52354a..0000000 --- a/src/Objects/DeviceNukiMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - keypad_battery_critical: $json->keypad_battery_critical ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public bool | null $keypad_battery_critical, - ) { - } - -} diff --git a/src/Objects/DevicePredefinedTimeSlots.php b/src/Objects/DevicePredefinedTimeSlots.php deleted file mode 100644 index 285673c..0000000 --- a/src/Objects/DevicePredefinedTimeSlots.php +++ /dev/null @@ -1,43 +0,0 @@ -name, - prefix: $json->prefix, - check_in_time: $json->check_in_time, - check_out_time: $json->check_out_time, - is_24_hour: $json->is_24_hour, - is_biweekly_mode: $json->is_biweekly_mode, - is_one_shot: $json->is_one_shot, - is_master: $json->is_master, - ext_dormakaba_oracode_user_level_prefix: $json->ext_dormakaba_oracode_user_level_prefix, - dormakaba_oracode_user_level_id: $json->dormakaba_oracode_user_level_id, - ); - } - - - - public function __construct( - public string $name, - public int $prefix, - public string $check_in_time, - public string $check_out_time, - public bool $is_24_hour, - public bool $is_biweekly_mode, - public bool $is_one_shot, - public bool $is_master, - public int $ext_dormakaba_oracode_user_level_prefix, - public string $dormakaba_oracode_user_level_id, - ) { - } - -} diff --git a/src/Objects/DevicePressure.php b/src/Objects/DevicePressure.php deleted file mode 100644 index 97eb23c..0000000 --- a/src/Objects/DevicePressure.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public int $value, - ) { - } - -} diff --git a/src/Objects/DeviceProperties.php b/src/Objects/DeviceProperties.php deleted file mode 100644 index 913b194..0000000 --- a/src/Objects/DeviceProperties.php +++ /dev/null @@ -1,180 +0,0 @@ -online, - name: $json->name, - model: DeviceModel::from_json($json->model), - has_direct_power: $json->has_direct_power ?? null, - battery_level: $json->battery_level ?? null, - battery: isset($json->battery) ? DeviceBattery::from_json($json->battery) : null, - manufacturer: $json->manufacturer ?? null, - image_url: $json->image_url ?? null, - image_alt_text: $json->image_alt_text ?? null, - serial_number: $json->serial_number ?? null, - online_access_codes_enabled: $json->online_access_codes_enabled ?? null, - offline_access_codes_enabled: $json->offline_access_codes_enabled ?? null, - supports_accessory_keypad: $json->supports_accessory_keypad ?? null, - supports_offline_access_codes: $json->supports_offline_access_codes ?? null, - assa_abloy_credential_service_metadata: isset($json->assa_abloy_credential_service_metadata) ? DeviceAssaAbloyCredentialServiceMetadata::from_json($json->assa_abloy_credential_service_metadata) : null, - august_metadata: isset($json->august_metadata) ? DeviceAugustMetadata::from_json($json->august_metadata) : null, - avigilon_alta_metadata: isset($json->avigilon_alta_metadata) ? DeviceAvigilonAltaMetadata::from_json($json->avigilon_alta_metadata) : null, - schlage_metadata: isset($json->schlage_metadata) ? DeviceSchlageMetadata::from_json($json->schlage_metadata) : null, - smartthings_metadata: isset($json->smartthings_metadata) ? DeviceSmartthingsMetadata::from_json($json->smartthings_metadata) : null, - lockly_metadata: isset($json->lockly_metadata) ? DeviceLocklyMetadata::from_json($json->lockly_metadata) : null, - nuki_metadata: isset($json->nuki_metadata) ? DeviceNukiMetadata::from_json($json->nuki_metadata) : null, - kwikset_metadata: isset($json->kwikset_metadata) ? DeviceKwiksetMetadata::from_json($json->kwikset_metadata) : null, - salto_metadata: isset($json->salto_metadata) ? DeviceSaltoMetadata::from_json($json->salto_metadata) : null, - genie_metadata: isset($json->genie_metadata) ? DeviceGenieMetadata::from_json($json->genie_metadata) : null, - brivo_metadata: isset($json->brivo_metadata) ? DeviceBrivoMetadata::from_json($json->brivo_metadata) : null, - igloo_metadata: isset($json->igloo_metadata) ? DeviceIglooMetadata::from_json($json->igloo_metadata) : null, - noiseaware_metadata: isset($json->noiseaware_metadata) ? DeviceNoiseawareMetadata::from_json($json->noiseaware_metadata) : null, - minut_metadata: isset($json->minut_metadata) ? DeviceMinutMetadata::from_json($json->minut_metadata) : null, - four_suites_metadata: isset($json->four_suites_metadata) ? DeviceFourSuitesMetadata::from_json($json->four_suites_metadata) : null, - two_n_metadata: isset($json->two_n_metadata) ? DeviceTwoNMetadata::from_json($json->two_n_metadata) : null, - controlbyweb_metadata: isset($json->controlbyweb_metadata) ? DeviceControlbywebMetadata::from_json($json->controlbyweb_metadata) : null, - ttlock_metadata: isset($json->ttlock_metadata) ? DeviceTtlockMetadata::from_json($json->ttlock_metadata) : null, - seam_bridge_metadata: isset($json->seam_bridge_metadata) ? DeviceSeamBridgeMetadata::from_json($json->seam_bridge_metadata) : null, - igloohome_metadata: isset($json->igloohome_metadata) ? DeviceIgloohomeMetadata::from_json($json->igloohome_metadata) : null, - nest_metadata: isset($json->nest_metadata) ? DeviceNestMetadata::from_json($json->nest_metadata) : null, - ecobee_metadata: isset($json->ecobee_metadata) ? DeviceEcobeeMetadata::from_json($json->ecobee_metadata) : null, - honeywell_metadata: isset($json->honeywell_metadata) ? DeviceHoneywellMetadata::from_json($json->honeywell_metadata) : null, - hubitat_metadata: isset($json->hubitat_metadata) ? DeviceHubitatMetadata::from_json($json->hubitat_metadata) : null, - dormakaba_oracode_metadata: isset($json->dormakaba_oracode_metadata) ? DeviceDormakabaOracodeMetadata::from_json($json->dormakaba_oracode_metadata) : null, - wyze_metadata: isset($json->wyze_metadata) ? DeviceWyzeMetadata::from_json($json->wyze_metadata) : null, - tedee_metadata: isset($json->tedee_metadata) ? DeviceTedeeMetadata::from_json($json->tedee_metadata) : null, - _experimental_supported_code_from_access_codes_lengths: $json->_experimental_supported_code_from_access_codes_lengths ?? null, - code_constraints: array_map( - fn ($c) => DeviceCodeConstraints::from_json($c), - $json->code_constraints ?? [] - ), - supported_code_lengths: $json->supported_code_lengths ?? null, - max_active_codes_supported: $json->max_active_codes_supported ?? null, - supports_backup_access_code_pool: $json->supports_backup_access_code_pool ?? null, - has_native_entry_events: $json->has_native_entry_events ?? null, - locked: $json->locked ?? null, - keypad_battery: isset($json->keypad_battery) ? DeviceKeypadBattery::from_json($json->keypad_battery) : null, - door_open: $json->door_open ?? null, - temperature_fahrenheit: $json->temperature_fahrenheit ?? null, - temperature_celsius: $json->temperature_celsius ?? null, - relative_humidity: $json->relative_humidity ?? null, - can_enable_automatic_heating: $json->can_enable_automatic_heating ?? null, - can_enable_automatic_cooling: $json->can_enable_automatic_cooling ?? null, - available_hvac_mode_settings: $json->available_hvac_mode_settings ?? null, - is_heating_available: $json->is_heating_available ?? null, - is_cooling_available: $json->is_cooling_available ?? null, - is_heating: $json->is_heating ?? null, - is_cooling: $json->is_cooling ?? null, - is_fan_running: $json->is_fan_running ?? null, - fan_mode_setting: $json->fan_mode_setting ?? null, - is_temporary_manual_override_active: $json->is_temporary_manual_override_active ?? null, - current_climate_setting: isset($json->current_climate_setting) ? DeviceCurrentClimateSetting::from_json($json->current_climate_setting) : null, - default_climate_setting: isset($json->default_climate_setting) ? DeviceDefaultClimateSetting::from_json($json->default_climate_setting) : null, - is_climate_setting_schedule_active: $json->is_climate_setting_schedule_active ?? null, - active_climate_setting_schedule: isset($json->active_climate_setting_schedule) ? DeviceActiveClimateSettingSchedule::from_json($json->active_climate_setting_schedule) : null, - min_cooling_set_point_celsius: $json->min_cooling_set_point_celsius ?? null, - min_cooling_set_point_fahrenheit: $json->min_cooling_set_point_fahrenheit ?? null, - max_cooling_set_point_celsius: $json->max_cooling_set_point_celsius ?? null, - max_cooling_set_point_fahrenheit: $json->max_cooling_set_point_fahrenheit ?? null, - min_heating_set_point_celsius: $json->min_heating_set_point_celsius ?? null, - min_heating_set_point_fahrenheit: $json->min_heating_set_point_fahrenheit ?? null, - max_heating_set_point_celsius: $json->max_heating_set_point_celsius ?? null, - max_heating_set_point_fahrenheit: $json->max_heating_set_point_fahrenheit ?? null, - min_heating_cooling_delta_celsius: $json->min_heating_cooling_delta_celsius ?? null, - min_heating_cooling_delta_fahrenheit: $json->min_heating_cooling_delta_fahrenheit ?? null, - ); - } - - - - public function __construct( - public bool $online, - public string $name, - public DeviceModel $model, - public bool | null $has_direct_power, - public int | null $battery_level, - public DeviceBattery | null $battery, - public string | null $manufacturer, - public string | null $image_url, - public string | null $image_alt_text, - public string | null $serial_number, - public bool | null $online_access_codes_enabled, - public bool | null $offline_access_codes_enabled, - public bool | null $supports_accessory_keypad, - public bool | null $supports_offline_access_codes, - public DeviceAssaAbloyCredentialServiceMetadata | null $assa_abloy_credential_service_metadata, - public DeviceAugustMetadata | null $august_metadata, - public DeviceAvigilonAltaMetadata | null $avigilon_alta_metadata, - public DeviceSchlageMetadata | null $schlage_metadata, - public DeviceSmartthingsMetadata | null $smartthings_metadata, - public DeviceLocklyMetadata | null $lockly_metadata, - public DeviceNukiMetadata | null $nuki_metadata, - public DeviceKwiksetMetadata | null $kwikset_metadata, - public DeviceSaltoMetadata | null $salto_metadata, - public DeviceGenieMetadata | null $genie_metadata, - public DeviceBrivoMetadata | null $brivo_metadata, - public DeviceIglooMetadata | null $igloo_metadata, - public DeviceNoiseawareMetadata | null $noiseaware_metadata, - public DeviceMinutMetadata | null $minut_metadata, - public DeviceFourSuitesMetadata | null $four_suites_metadata, - public DeviceTwoNMetadata | null $two_n_metadata, - public DeviceControlbywebMetadata | null $controlbyweb_metadata, - public DeviceTtlockMetadata | null $ttlock_metadata, - public DeviceSeamBridgeMetadata | null $seam_bridge_metadata, - public DeviceIgloohomeMetadata | null $igloohome_metadata, - public DeviceNestMetadata | null $nest_metadata, - public DeviceEcobeeMetadata | null $ecobee_metadata, - public DeviceHoneywellMetadata | null $honeywell_metadata, - public DeviceHubitatMetadata | null $hubitat_metadata, - public DeviceDormakabaOracodeMetadata | null $dormakaba_oracode_metadata, - public DeviceWyzeMetadata | null $wyze_metadata, - public DeviceTedeeMetadata | null $tedee_metadata, - public array | null $_experimental_supported_code_from_access_codes_lengths, - public array | null $code_constraints, - public array | null $supported_code_lengths, - public int | null $max_active_codes_supported, - public bool | null $supports_backup_access_code_pool, - public bool | null $has_native_entry_events, - public bool | null $locked, - public DeviceKeypadBattery | null $keypad_battery, - public bool | null $door_open, - public int | null $temperature_fahrenheit, - public int | null $temperature_celsius, - public int | null $relative_humidity, - public bool | null $can_enable_automatic_heating, - public bool | null $can_enable_automatic_cooling, - public array | null $available_hvac_mode_settings, - public bool | null $is_heating_available, - public bool | null $is_cooling_available, - public bool | null $is_heating, - public bool | null $is_cooling, - public bool | null $is_fan_running, - public string | null $fan_mode_setting, - public bool | null $is_temporary_manual_override_active, - public DeviceCurrentClimateSetting | null $current_climate_setting, - public DeviceDefaultClimateSetting | null $default_climate_setting, - public bool | null $is_climate_setting_schedule_active, - public DeviceActiveClimateSettingSchedule | null $active_climate_setting_schedule, - public int | null $min_cooling_set_point_celsius, - public int | null $min_cooling_set_point_fahrenheit, - public int | null $max_cooling_set_point_celsius, - public int | null $max_cooling_set_point_fahrenheit, - public int | null $min_heating_set_point_celsius, - public int | null $min_heating_set_point_fahrenheit, - public int | null $max_heating_set_point_celsius, - public int | null $max_heating_set_point_fahrenheit, - public int | null $min_heating_cooling_delta_celsius, - public int | null $min_heating_cooling_delta_fahrenheit, - ) { - } - -} diff --git a/src/Objects/DeviceProvider.php b/src/Objects/DeviceProvider.php deleted file mode 100644 index 4a59aec..0000000 --- a/src/Objects/DeviceProvider.php +++ /dev/null @@ -1,31 +0,0 @@ -device_provider_name, - display_name: $json->display_name, - image_url: $json->image_url, - provider_categories: $json->provider_categories, - ); - } - - - - public function __construct( - public string $device_provider_name, - public string $display_name, - public string $image_url, - public array $provider_categories, - ) { - } - -} diff --git a/src/Objects/DeviceSaltoMetadata.php b/src/Objects/DeviceSaltoMetadata.php deleted file mode 100644 index 380052c..0000000 --- a/src/Objects/DeviceSaltoMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -lock_id, - customer_reference: $json->customer_reference, - lock_type: $json->lock_type, - battery_level: $json->battery_level, - locked_state: $json->locked_state, - model: $json->model ?? null, - ); - } - - - - public function __construct( - public string $lock_id, - public string $customer_reference, - public string $lock_type, - public string $battery_level, - public string $locked_state, - public string | null $model, - ) { - } - -} diff --git a/src/Objects/DeviceSchlageMetadata.php b/src/Objects/DeviceSchlageMetadata.php deleted file mode 100644 index 54ec590..0000000 --- a/src/Objects/DeviceSchlageMetadata.php +++ /dev/null @@ -1,31 +0,0 @@ -device_id, - device_name: $json->device_name, - access_code_length: $json->access_code_length ?? null, - model: $json->model ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public int | null $access_code_length, - public string | null $model, - ) { - } - -} diff --git a/src/Objects/DeviceSeamBridgeMetadata.php b/src/Objects/DeviceSeamBridgeMetadata.php deleted file mode 100644 index 3fa8ff4..0000000 --- a/src/Objects/DeviceSeamBridgeMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -unlock_method ?? null, - device_num: $json->device_num, - name: $json->name, - ); - } - - - - public function __construct( - public string | null $unlock_method, - public int $device_num, - public string $name, - ) { - } - -} diff --git a/src/Objects/DeviceSmartthingsMetadata.php b/src/Objects/DeviceSmartthingsMetadata.php deleted file mode 100644 index c4191fb..0000000 --- a/src/Objects/DeviceSmartthingsMetadata.php +++ /dev/null @@ -1,31 +0,0 @@ -device_id, - device_name: $json->device_name, - model: $json->model ?? null, - location_id: $json->location_id ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string | null $model, - public string | null $location_id, - ) { - } - -} diff --git a/src/Objects/DeviceSound.php b/src/Objects/DeviceSound.php deleted file mode 100644 index cb071f5..0000000 --- a/src/Objects/DeviceSound.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public int $value, - ) { - } - -} diff --git a/src/Objects/DeviceTedeeMetadata.php b/src/Objects/DeviceTedeeMetadata.php deleted file mode 100644 index be8f730..0000000 --- a/src/Objects/DeviceTedeeMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -device_id, - serial_number: $json->serial_number, - device_name: $json->device_name, - device_model: $json->device_model, - bridge_id: $json->bridge_id, - bridge_name: $json->bridge_name, - ); - } - - - - public function __construct( - public int $device_id, - public string $serial_number, - public string $device_name, - public string $device_model, - public int $bridge_id, - public string $bridge_name, - ) { - } - -} diff --git a/src/Objects/DeviceTemperature.php b/src/Objects/DeviceTemperature.php deleted file mode 100644 index 797ab01..0000000 --- a/src/Objects/DeviceTemperature.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public int $value, - ) { - } - -} diff --git a/src/Objects/DeviceTtlockMetadata.php b/src/Objects/DeviceTtlockMetadata.php deleted file mode 100644 index 4fa95f8..0000000 --- a/src/Objects/DeviceTtlockMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -lock_id, - lock_alias: $json->lock_alias, - ); - } - - - - public function __construct( - public int $lock_id, - public string $lock_alias, - ) { - } - -} diff --git a/src/Objects/DeviceTwoNMetadata.php b/src/Objects/DeviceTwoNMetadata.php deleted file mode 100644 index 491c777..0000000 --- a/src/Objects/DeviceTwoNMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -device_id, - device_name: $json->device_name, - ); - } - - - - public function __construct( - public int $device_id, - public string $device_name, - ) { - } - -} diff --git a/src/Objects/DeviceWarnings.php b/src/Objects/DeviceWarnings.php deleted file mode 100644 index a39c076..0000000 --- a/src/Objects/DeviceWarnings.php +++ /dev/null @@ -1,29 +0,0 @@ -warning_code, - message: $json->message, - created_at: $json->created_at ?? null, - ); - } - - - - public function __construct( - public string $warning_code, - public string $message, - public string | null $created_at, - ) { - } - -} diff --git a/src/Objects/DeviceWyzeMetadata.php b/src/Objects/DeviceWyzeMetadata.php deleted file mode 100644 index 6573d79..0000000 --- a/src/Objects/DeviceWyzeMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -device_id, - device_name: $json->device_name, - product_name: $json->product_name, - product_type: $json->product_type, - product_model: $json->product_model, - device_info_model: $json->device_info_model, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string $product_name, - public string $product_type, - public string $product_model, - public string $device_info_model, - ) { - } - -} diff --git a/src/Objects/EnrollmentAutomation.php b/src/Objects/EnrollmentAutomation.php deleted file mode 100644 index 87a72d5..0000000 --- a/src/Objects/EnrollmentAutomation.php +++ /dev/null @@ -1,33 +0,0 @@ -credential_manager_acs_system_id, - user_identity_id: $json->user_identity_id, - created_at: $json->created_at, - workspace_id: $json->workspace_id, - enrollment_automation_id: $json->enrollment_automation_id, - ); - } - - - - public function __construct( - public string $credential_manager_acs_system_id, - public string $user_identity_id, - public string $created_at, - public string $workspace_id, - public string $enrollment_automation_id, - ) { - } - -} diff --git a/src/Objects/Event.php b/src/Objects/Event.php deleted file mode 100644 index abfc808..0000000 --- a/src/Objects/Event.php +++ /dev/null @@ -1,35 +0,0 @@ -event_id, - device_id: $json->device_id ?? null, - event_type: $json->event_type, - workspace_id: $json->workspace_id, - created_at: $json->created_at, - occurred_at: $json->occurred_at, - ); - } - - - - public function __construct( - public string $event_id, - public string | null $device_id, - public string $event_type, - public string $workspace_id, - public string $created_at, - public string $occurred_at, - ) { - } - -} diff --git a/src/Objects/NoiseThreshold.php b/src/Objects/NoiseThreshold.php deleted file mode 100644 index 5447cbf..0000000 --- a/src/Objects/NoiseThreshold.php +++ /dev/null @@ -1,37 +0,0 @@ -noise_threshold_id, - device_id: $json->device_id, - name: $json->name, - noise_threshold_nrs: $json->noise_threshold_nrs ?? null, - starts_daily_at: $json->starts_daily_at, - ends_daily_at: $json->ends_daily_at, - noise_threshold_decibels: $json->noise_threshold_decibels, - ); - } - - - - public function __construct( - public string $noise_threshold_id, - public string $device_id, - public string $name, - public int | null $noise_threshold_nrs, - public string $starts_daily_at, - public string $ends_daily_at, - public int $noise_threshold_decibels, - ) { - } - -} diff --git a/src/Objects/Phone.php b/src/Objects/Phone.php deleted file mode 100644 index 2fc6a21..0000000 --- a/src/Objects/Phone.php +++ /dev/null @@ -1,55 +0,0 @@ -device_id, - device_type: $json->device_type, - capabilities_supported: $json->capabilities_supported, - properties: PhoneProperties::from_json($json->properties), - location: isset($json->location) ? PhoneLocation::from_json($json->location) : null, - workspace_id: $json->workspace_id, - errors: array_map( - fn ($e) => PhoneErrors::from_json($e), - $json->errors ?? [] - ), - warnings: array_map( - fn ($w) => PhoneWarnings::from_json($w), - $json->warnings ?? [] - ), - created_at: $json->created_at, - is_managed: $json->is_managed, - custom_metadata: $json->custom_metadata ?? null, - can_remotely_unlock: $json->can_remotely_unlock ?? null, - can_program_online_access_codes: $json->can_program_online_access_codes ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_type, - public array $capabilities_supported, - public PhoneProperties $properties, - public PhoneLocation | null $location, - public string $workspace_id, - public array $errors, - public array $warnings, - public string $created_at, - public bool $is_managed, - public mixed $custom_metadata, - public bool | null $can_remotely_unlock, - public bool | null $can_program_online_access_codes, - ) { - } - -} diff --git a/src/Objects/PhoneAssaAbloyCredentialServiceMetadata.php b/src/Objects/PhoneAssaAbloyCredentialServiceMetadata.php deleted file mode 100644 index 4e66cea..0000000 --- a/src/Objects/PhoneAssaAbloyCredentialServiceMetadata.php +++ /dev/null @@ -1,30 +0,0 @@ -has_active_endpoint, - endpoints: array_map( - fn ($e) => PhoneEndpoints::from_json($e), - $json->endpoints ?? [] - ), - ); - } - - - - public function __construct( - public bool $has_active_endpoint, - public array $endpoints, - ) { - } - -} diff --git a/src/Objects/PhoneEndpoints.php b/src/Objects/PhoneEndpoints.php deleted file mode 100644 index 6e7c901..0000000 --- a/src/Objects/PhoneEndpoints.php +++ /dev/null @@ -1,27 +0,0 @@ -endpoint_id, - is_active: $json->is_active, - ); - } - - - - public function __construct( - public string $endpoint_id, - public bool $is_active, - ) { - } - -} diff --git a/src/Objects/PhoneErrors.php b/src/Objects/PhoneErrors.php deleted file mode 100644 index 00396ce..0000000 --- a/src/Objects/PhoneErrors.php +++ /dev/null @@ -1,29 +0,0 @@ -error_code, - message: $json->message, - created_at: $json->created_at ?? null, - ); - } - - - - public function __construct( - public string $error_code, - public string $message, - public string | null $created_at, - ) { - } - -} diff --git a/src/Objects/PhoneLocation.php b/src/Objects/PhoneLocation.php deleted file mode 100644 index ba3e557..0000000 --- a/src/Objects/PhoneLocation.php +++ /dev/null @@ -1,27 +0,0 @@ -location_name ?? null, - timezone: $json->timezone ?? null, - ); - } - - - - public function __construct( - public string | null $location_name, - public string | null $timezone, - ) { - } - -} diff --git a/src/Objects/PhoneProperties.php b/src/Objects/PhoneProperties.php deleted file mode 100644 index 0dea6a2..0000000 --- a/src/Objects/PhoneProperties.php +++ /dev/null @@ -1,25 +0,0 @@ -assa_abloy_credential_service_metadata) ? PhoneAssaAbloyCredentialServiceMetadata::from_json($json->assa_abloy_credential_service_metadata) : null, - ); - } - - - - public function __construct( - public PhoneAssaAbloyCredentialServiceMetadata | null $assa_abloy_credential_service_metadata, - ) { - } - -} diff --git a/src/Objects/PhoneWarnings.php b/src/Objects/PhoneWarnings.php deleted file mode 100644 index 45ef34b..0000000 --- a/src/Objects/PhoneWarnings.php +++ /dev/null @@ -1,29 +0,0 @@ -warning_code, - message: $json->message, - created_at: $json->created_at ?? null, - ); - } - - - - public function __construct( - public string $warning_code, - public string $message, - public string | null $created_at, - ) { - } - -} diff --git a/src/Objects/ServiceHealth.php b/src/Objects/ServiceHealth.php deleted file mode 100644 index dc4dd0b..0000000 --- a/src/Objects/ServiceHealth.php +++ /dev/null @@ -1,29 +0,0 @@ -service, - status: $json->status, - description: $json->description, - ); - } - - - - public function __construct( - public string $service, - public string $status, - public string $description, - ) { - } - -} diff --git a/src/Objects/UnmanagedAccessCode.php b/src/Objects/UnmanagedAccessCode.php deleted file mode 100644 index c86570e..0000000 --- a/src/Objects/UnmanagedAccessCode.php +++ /dev/null @@ -1,47 +0,0 @@ -type, - access_code_id: $json->access_code_id, - device_id: $json->device_id, - name: $json->name ?? null, - code: $json->code ?? null, - created_at: $json->created_at, - errors: $json->errors ?? null, - warnings: $json->warnings ?? null, - is_managed: $json->is_managed, - starts_at: $json->starts_at ?? null, - ends_at: $json->ends_at ?? null, - status: $json->status, - ); - } - - - - public function __construct( - public string $type, - public string $access_code_id, - public string $device_id, - public string | null $name, - public string | null $code, - public string $created_at, - public mixed $errors, - public mixed $warnings, - public bool $is_managed, - public string | null $starts_at, - public string | null $ends_at, - public string $status, - ) { - } - -} diff --git a/src/Objects/UnmanagedDevice.php b/src/Objects/UnmanagedDevice.php deleted file mode 100644 index b22a5ba..0000000 --- a/src/Objects/UnmanagedDevice.php +++ /dev/null @@ -1,49 +0,0 @@ -device_id, - device_type: $json->device_type, - connected_account_id: $json->connected_account_id, - capabilities_supported: $json->capabilities_supported, - workspace_id: $json->workspace_id, - errors: array_map( - fn ($e) => UnmanagedDeviceErrors::from_json($e), - $json->errors ?? [] - ), - warnings: array_map( - fn ($w) => UnmanagedDeviceWarnings::from_json($w), - $json->warnings ?? [] - ), - created_at: $json->created_at, - is_managed: $json->is_managed, - properties: UnmanagedDeviceProperties::from_json($json->properties), - ); - } - - - - public function __construct( - public string $device_id, - public string $device_type, - public string $connected_account_id, - public array $capabilities_supported, - public string $workspace_id, - public array $errors, - public array $warnings, - public string $created_at, - public bool $is_managed, - public UnmanagedDeviceProperties $properties, - ) { - } - -} diff --git a/src/Objects/UnmanagedDeviceBattery.php b/src/Objects/UnmanagedDeviceBattery.php deleted file mode 100644 index 3e4c6d8..0000000 --- a/src/Objects/UnmanagedDeviceBattery.php +++ /dev/null @@ -1,27 +0,0 @@ -level, - status: $json->status, - ); - } - - - - public function __construct( - public int $level, - public string $status, - ) { - } - -} diff --git a/src/Objects/UnmanagedDeviceErrors.php b/src/Objects/UnmanagedDeviceErrors.php deleted file mode 100644 index 005e3bd..0000000 --- a/src/Objects/UnmanagedDeviceErrors.php +++ /dev/null @@ -1,29 +0,0 @@ -error_code, - message: $json->message, - created_at: $json->created_at ?? null, - ); - } - - - - public function __construct( - public string $error_code, - public string $message, - public string | null $created_at, - ) { - } - -} diff --git a/src/Objects/UnmanagedDeviceModel.php b/src/Objects/UnmanagedDeviceModel.php deleted file mode 100644 index 1ac143f..0000000 --- a/src/Objects/UnmanagedDeviceModel.php +++ /dev/null @@ -1,33 +0,0 @@ -display_name, - manufacturer_display_name: $json->manufacturer_display_name, - offline_access_codes_supported: $json->offline_access_codes_supported ?? null, - online_access_codes_supported: $json->online_access_codes_supported ?? null, - accessory_keypad_supported: $json->accessory_keypad_supported ?? null, - ); - } - - - - public function __construct( - public string $display_name, - public string $manufacturer_display_name, - public bool | null $offline_access_codes_supported, - public bool | null $online_access_codes_supported, - public bool | null $accessory_keypad_supported, - ) { - } - -} diff --git a/src/Objects/UnmanagedDeviceProperties.php b/src/Objects/UnmanagedDeviceProperties.php deleted file mode 100644 index 5a2321d..0000000 --- a/src/Objects/UnmanagedDeviceProperties.php +++ /dev/null @@ -1,43 +0,0 @@ -name, - online: $json->online, - manufacturer: $json->manufacturer ?? null, - image_url: $json->image_url ?? null, - image_alt_text: $json->image_alt_text ?? null, - battery_level: $json->battery_level ?? null, - battery: isset($json->battery) ? UnmanagedDeviceBattery::from_json($json->battery) : null, - online_access_codes_enabled: $json->online_access_codes_enabled ?? null, - offline_access_codes_enabled: $json->offline_access_codes_enabled ?? null, - model: UnmanagedDeviceModel::from_json($json->model), - ); - } - - - - public function __construct( - public string $name, - public bool $online, - public string | null $manufacturer, - public string | null $image_url, - public string | null $image_alt_text, - public int | null $battery_level, - public UnmanagedDeviceBattery | null $battery, - public bool | null $online_access_codes_enabled, - public bool | null $offline_access_codes_enabled, - public UnmanagedDeviceModel $model, - ) { - } - -} diff --git a/src/Objects/UnmanagedDeviceWarnings.php b/src/Objects/UnmanagedDeviceWarnings.php deleted file mode 100644 index db80a1a..0000000 --- a/src/Objects/UnmanagedDeviceWarnings.php +++ /dev/null @@ -1,29 +0,0 @@ -warning_code, - message: $json->message, - created_at: $json->created_at ?? null, - ); - } - - - - public function __construct( - public string $warning_code, - public string $message, - public string | null $created_at, - ) { - } - -} diff --git a/src/Objects/Webhook.php b/src/Objects/Webhook.php deleted file mode 100644 index cddfcc9..0000000 --- a/src/Objects/Webhook.php +++ /dev/null @@ -1,31 +0,0 @@ -webhook_id, - url: $json->url, - event_types: $json->event_types ?? null, - secret: $json->secret ?? null, - ); - } - - - - public function __construct( - public string $webhook_id, - public string $url, - public array | null $event_types, - public string | null $secret, - ) { - } - -} diff --git a/src/Objects/Workspace.php b/src/Objects/Workspace.php deleted file mode 100644 index 5bd81db..0000000 --- a/src/Objects/Workspace.php +++ /dev/null @@ -1,31 +0,0 @@ -workspace_id, - name: $json->name, - is_sandbox: $json->is_sandbox, - connect_partner_name: $json->connect_partner_name ?? null, - ); - } - - - - public function __construct( - public string $workspace_id, - public string $name, - public bool $is_sandbox, - public string | null $connect_partner_name, - ) { - } - -} diff --git a/src/SeamClient.php b/src/SeamClient.php deleted file mode 100644 index 42a53c7..0000000 --- a/src/SeamClient.php +++ /dev/null @@ -1,4713 +0,0 @@ -api_key = $api_key; - $this->client = new HTTPClient([ - "base_uri" => $endpoint, - "timeout" => 60.0, - "headers" => [ - "Authorization" => "Bearer " . $this->api_key, - "User-Agent" => "Seam PHP Client 0.0.1", - ], - "http_errors" => $throw_http_errors, - ]); - $this->access_codes = new AccessCodesClient($this); - $this->action_attempts = new ActionAttemptsClient($this); - $this->client_sessions = new ClientSessionsClient($this); - $this->connect_webviews = new ConnectWebviewsClient($this); - $this->connected_accounts = new ConnectedAccountsClient($this); - $this->devices = new DevicesClient($this); - $this->events = new EventsClient($this); - $this->health = new HealthClient($this); - $this->locks = new LocksClient($this); - $this->networks = new NetworksClient($this); - $this->phones = new PhonesClient($this); - $this->thermostats = new ThermostatsClient($this); - $this->user_identities = new UserIdentitiesClient($this); - $this->webhooks = new WebhooksClient($this); - $this->workspaces = new WorkspacesClient($this); - $this->acs = new AcsClient($this); - $this->noise_sensors = new NoiseSensorsClient($this); - } - - public function request( - $method, - $path, - $json = null, - $query = null, - $inner_object = null - ) { - $options = [ - "json" => $json, - "query" => $query, - ]; - $options = array_filter($options, fn ($option) => $option !== null); - - // TODO handle request errors - $response = $this->client->request($method, $path, $options); - $status_code = $response->getStatusCode(); - - $res_json = null; - try { - $res_json = json_decode($response->getBody()); - } catch (Exception $ignoreError) { - } - - if (($res_json->error ?? null) != null) { - throw new Exception( - "Error Calling \"" . - $method . - " " . - $path . - "\" : " . - ($res_json->error->type ?? "") . - ": " . - $res_json->error->message - ); - } - - if ($status_code >= 400) { - $error_message = $response->getReasonPhrase(); - - throw new Exception( - "HTTP Error: " . $error_message . " [" . $status_code . "] " . $method . " " . $path - ); - } - - if ($inner_object) { - if (!is_array($res_json->$inner_object) && ($res_json->$inner_object ?? null) == null) { - throw new Exception( - 'Missing Inner Object "' . - $inner_object . - '" for ' . - $method . - " " . - $path - ); - } - return $res_json->$inner_object; - } - return $res_json; - } -} - -class AccessCodesClient -{ - private SeamClient $seam; - public AccessCodesSimulateClient $simulate; - public AccessCodesUnmanagedClient $unmanaged; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->simulate = new AccessCodesSimulateClient($seam); -$this->unmanaged = new AccessCodesUnmanagedClient($seam); - } - - - public function create( - string $device_id, - string $name = null, - string $starts_at = null, - string $ends_at = null, - string $code = null, - bool $sync = null, - bool $attempt_for_offline_device = null, - string $common_code_key = null, - bool $prefer_native_scheduling = null, - bool $use_backup_access_code_pool = null, - bool $allow_external_modification = null, - bool $is_external_modification_allowed = null, - bool $use_offline_access_code = null, - bool $is_offline_access_code = null, - bool $is_one_time_use = null, - string $max_time_rounding = null - ): AccessCode { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($starts_at !== null) { - $request_payload["starts_at"] = $starts_at; - } - if ($ends_at !== null) { - $request_payload["ends_at"] = $ends_at; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - if ($attempt_for_offline_device !== null) { - $request_payload["attempt_for_offline_device"] = $attempt_for_offline_device; - } - if ($common_code_key !== null) { - $request_payload["common_code_key"] = $common_code_key; - } - if ($prefer_native_scheduling !== null) { - $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; - } - if ($use_backup_access_code_pool !== null) { - $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; - } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; - } - if ($is_external_modification_allowed !== null) { - $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; - } - if ($use_offline_access_code !== null) { - $request_payload["use_offline_access_code"] = $use_offline_access_code; - } - if ($is_offline_access_code !== null) { - $request_payload["is_offline_access_code"] = $is_offline_access_code; - } - if ($is_one_time_use !== null) { - $request_payload["is_one_time_use"] = $is_one_time_use; - } - if ($max_time_rounding !== null) { - $request_payload["max_time_rounding"] = $max_time_rounding; - } - - $res = $this->seam->request( - "POST", - "/access_codes/create", - json: $request_payload, - inner_object: "access_code", - ); - - - - - - return AccessCode::from_json($res); - } - - public function create_multiple( - array $device_ids, - string $behavior_when_code_cannot_be_shared = null, - int $preferred_code_length = null, - string $name = null, - string $starts_at = null, - string $ends_at = null, - string $code = null, - bool $attempt_for_offline_device = null, - bool $prefer_native_scheduling = null, - bool $use_backup_access_code_pool = null, - bool $allow_external_modification = null, - bool $is_external_modification_allowed = null, - bool $use_offline_access_code = null, - bool $is_offline_access_code = null, - bool $is_one_time_use = null, - string $max_time_rounding = null - ): array { - $request_payload = []; - - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($behavior_when_code_cannot_be_shared !== null) { - $request_payload["behavior_when_code_cannot_be_shared"] = $behavior_when_code_cannot_be_shared; - } - if ($preferred_code_length !== null) { - $request_payload["preferred_code_length"] = $preferred_code_length; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($starts_at !== null) { - $request_payload["starts_at"] = $starts_at; - } - if ($ends_at !== null) { - $request_payload["ends_at"] = $ends_at; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - if ($attempt_for_offline_device !== null) { - $request_payload["attempt_for_offline_device"] = $attempt_for_offline_device; - } - if ($prefer_native_scheduling !== null) { - $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; - } - if ($use_backup_access_code_pool !== null) { - $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; - } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; - } - if ($is_external_modification_allowed !== null) { - $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; - } - if ($use_offline_access_code !== null) { - $request_payload["use_offline_access_code"] = $use_offline_access_code; - } - if ($is_offline_access_code !== null) { - $request_payload["is_offline_access_code"] = $is_offline_access_code; - } - if ($is_one_time_use !== null) { - $request_payload["is_one_time_use"] = $is_one_time_use; - } - if ($max_time_rounding !== null) { - $request_payload["max_time_rounding"] = $max_time_rounding; - } - - $res = $this->seam->request( - "POST", - "/access_codes/create_multiple", - json: $request_payload, - inner_object: "access_codes", - ); - - - - - - return array_map(fn ($r) => AccessCode::from_json($r), $res); - } - - public function delete( - string $access_code_id, - string $device_id = null, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $res = $this->seam->request( - "POST", - "/access_codes/delete", - json: $request_payload, - inner_object: "action_attempt", - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - - - } - - public function generate_code( - string $device_id - ): AccessCode { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - - $res = $this->seam->request( - "POST", - "/access_codes/generate_code", - json: $request_payload, - inner_object: "generated_code", - ); - - - - - - return AccessCode::from_json($res); - } - - public function get( - string $device_id = null, - string $access_code_id = null, - string $code = null - ): AccessCode { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - - $res = $this->seam->request( - "POST", - "/access_codes/get", - json: $request_payload, - inner_object: "access_code", - ); - - - - - - return AccessCode::from_json($res); - } - - public function list( - string $device_id = null, - array $access_code_ids = null, - string $user_identifier_key = null - ): array { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($access_code_ids !== null) { - $request_payload["access_code_ids"] = $access_code_ids; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - - $res = $this->seam->request( - "POST", - "/access_codes/list", - json: $request_payload, - inner_object: "access_codes", - ); - - - - - - return array_map(fn ($r) => AccessCode::from_json($r), $res); - } - - public function pull_backup_access_code( - string $access_code_id - ): AccessCode { - $request_payload = []; - - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - - $res = $this->seam->request( - "POST", - "/access_codes/pull_backup_access_code", - json: $request_payload, - inner_object: "backup_access_code", - ); - - - - - - return AccessCode::from_json($res); - } - - public function update( - string $access_code_id, - string $name = null, - string $starts_at = null, - string $ends_at = null, - string $code = null, - bool $sync = null, - bool $attempt_for_offline_device = null, - bool $prefer_native_scheduling = null, - bool $use_backup_access_code_pool = null, - bool $allow_external_modification = null, - bool $is_external_modification_allowed = null, - bool $use_offline_access_code = null, - bool $is_offline_access_code = null, - bool $is_one_time_use = null, - string $max_time_rounding = null, - string $device_id = null, - string $type = null, - bool $is_managed = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($starts_at !== null) { - $request_payload["starts_at"] = $starts_at; - } - if ($ends_at !== null) { - $request_payload["ends_at"] = $ends_at; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - if ($attempt_for_offline_device !== null) { - $request_payload["attempt_for_offline_device"] = $attempt_for_offline_device; - } - if ($prefer_native_scheduling !== null) { - $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; - } - if ($use_backup_access_code_pool !== null) { - $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; - } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; - } - if ($is_external_modification_allowed !== null) { - $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; - } - if ($use_offline_access_code !== null) { - $request_payload["use_offline_access_code"] = $use_offline_access_code; - } - if ($is_offline_access_code !== null) { - $request_payload["is_offline_access_code"] = $is_offline_access_code; - } - if ($is_one_time_use !== null) { - $request_payload["is_one_time_use"] = $is_one_time_use; - } - if ($max_time_rounding !== null) { - $request_payload["max_time_rounding"] = $max_time_rounding; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($type !== null) { - $request_payload["type"] = $type; - } - if ($is_managed !== null) { - $request_payload["is_managed"] = $is_managed; - } - - $res = $this->seam->request( - "POST", - "/access_codes/update", - json: $request_payload, - inner_object: "action_attempt", - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - - - } - -} - -class ActionAttemptsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function get( - string $action_attempt_id - ): ActionAttempt { - $request_payload = []; - - if ($action_attempt_id !== null) { - $request_payload["action_attempt_id"] = $action_attempt_id; - } - - $res = $this->seam->request( - "POST", - "/action_attempts/get", - json: $request_payload, - inner_object: "action_attempt", - ); - - - - - - return ActionAttempt::from_json($res); - } - - public function list( - array $action_attempt_ids - ): array { - $request_payload = []; - - if ($action_attempt_ids !== null) { - $request_payload["action_attempt_ids"] = $action_attempt_ids; - } - - $res = $this->seam->request( - "POST", - "/action_attempts/list", - json: $request_payload, - inner_object: "action_attempts", - ); - - - - - - return array_map(fn ($r) => ActionAttempt::from_json($r), $res); - } - public function poll_until_ready(string $action_attempt_id): ActionAttempt - { - $seam = $this->seam; - $time_waiting = 0.0; - $action_attempt = $seam->action_attempts->get($action_attempt_id); - - while ($action_attempt->status == "pending") { - $action_attempt = $seam->action_attempts->get( - $action_attempt->action_attempt_id - ); - if ($time_waiting > 20.0) { - throw new Exception("Timed out waiting for action attempt to be ready"); - } - $time_waiting += 0.4; - usleep(400000); // sleep for 0.4 seconds - } - - if ($action_attempt->status == "failed") { - throw new Exception( - "Action Attempt failed: " . $action_attempt->error->message - ); - } - - return $action_attempt; - } -} - -class ClientSessionsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function create( - string $user_identifier_key = null, - array $connect_webview_ids = null, - array $connected_account_ids = null, - array $user_identity_ids = null, - string $expires_at = null - ): ClientSession { - $request_payload = []; - - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($connect_webview_ids !== null) { - $request_payload["connect_webview_ids"] = $connect_webview_ids; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($user_identity_ids !== null) { - $request_payload["user_identity_ids"] = $user_identity_ids; - } - if ($expires_at !== null) { - $request_payload["expires_at"] = $expires_at; - } - - $res = $this->seam->request( - "POST", - "/client_sessions/create", - json: $request_payload, - inner_object: "client_session", - ); - - - - - - return ClientSession::from_json($res); - } - - public function delete( - string $client_session_id - ): void { - $request_payload = []; - - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; - } - - $this->seam->request( - "POST", - "/client_sessions/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $client_session_id = null, - string $user_identifier_key = null - ): ClientSession { - $request_payload = []; - - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - - $res = $this->seam->request( - "POST", - "/client_sessions/get", - json: $request_payload, - inner_object: "client_session", - ); - - - - - - return ClientSession::from_json($res); - } - - public function get_or_create( - string $user_identifier_key = null, - array $connect_webview_ids = null, - array $connected_account_ids = null, - array $user_identity_ids = null, - string $expires_at = null - ): ClientSession { - $request_payload = []; - - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($connect_webview_ids !== null) { - $request_payload["connect_webview_ids"] = $connect_webview_ids; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($user_identity_ids !== null) { - $request_payload["user_identity_ids"] = $user_identity_ids; - } - if ($expires_at !== null) { - $request_payload["expires_at"] = $expires_at; - } - - $res = $this->seam->request( - "POST", - "/client_sessions/get_or_create", - json: $request_payload, - inner_object: "client_session", - ); - - - - - - return ClientSession::from_json($res); - } - - public function grant_access( - string $client_session_id = null, - string $user_identifier_key = null, - array $connected_account_ids = null, - array $connect_webview_ids = null, - array $user_identity_ids = null - ): void { - $request_payload = []; - - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_ids !== null) { - $request_payload["connect_webview_ids"] = $connect_webview_ids; - } - if ($user_identity_ids !== null) { - $request_payload["user_identity_ids"] = $user_identity_ids; - } - - $this->seam->request( - "POST", - "/client_sessions/grant_access", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $client_session_id = null, - string $user_identifier_key = null, - string $connect_webview_id = null, - bool $without_user_identifier_key = null - ): array { - $request_payload = []; - - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($without_user_identifier_key !== null) { - $request_payload["without_user_identifier_key"] = $without_user_identifier_key; - } - - $res = $this->seam->request( - "POST", - "/client_sessions/list", - json: $request_payload, - inner_object: "client_sessions", - ); - - - - - - return array_map(fn ($r) => ClientSession::from_json($r), $res); - } - - public function revoke( - string $client_session_id - ): void { - $request_payload = []; - - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; - } - - $this->seam->request( - "POST", - "/client_sessions/revoke", - json: $request_payload, - - ); - - - - - - - } - -} - -class ConnectWebviewsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function create( - string $device_selection_mode = null, - string $custom_redirect_url = null, - string $custom_redirect_failure_url = null, - array $accepted_providers = null, - string $provider_category = null, - mixed $custom_metadata = null, - bool $automatically_manage_new_devices = null, - bool $wait_for_device_creation = null - ): ConnectWebview { - $request_payload = []; - - if ($device_selection_mode !== null) { - $request_payload["device_selection_mode"] = $device_selection_mode; - } - if ($custom_redirect_url !== null) { - $request_payload["custom_redirect_url"] = $custom_redirect_url; - } - if ($custom_redirect_failure_url !== null) { - $request_payload["custom_redirect_failure_url"] = $custom_redirect_failure_url; - } - if ($accepted_providers !== null) { - $request_payload["accepted_providers"] = $accepted_providers; - } - if ($provider_category !== null) { - $request_payload["provider_category"] = $provider_category; - } - if ($custom_metadata !== null) { - $request_payload["custom_metadata"] = $custom_metadata; - } - if ($automatically_manage_new_devices !== null) { - $request_payload["automatically_manage_new_devices"] = $automatically_manage_new_devices; - } - if ($wait_for_device_creation !== null) { - $request_payload["wait_for_device_creation"] = $wait_for_device_creation; - } - - $res = $this->seam->request( - "POST", - "/connect_webviews/create", - json: $request_payload, - inner_object: "connect_webview", - ); - - - - - - return ConnectWebview::from_json($res); - } - - public function delete( - string $connect_webview_id - ): void { - $request_payload = []; - - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - - $this->seam->request( - "POST", - "/connect_webviews/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $connect_webview_id - ): ConnectWebview { - $request_payload = []; - - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - - $res = $this->seam->request( - "POST", - "/connect_webviews/get", - json: $request_payload, - inner_object: "connect_webview", - ); - - - - - - return ConnectWebview::from_json($res); - } - - public function list( - string $user_identifier_key = null, - mixed $custom_metadata_has = null - ): array { - $request_payload = []; - - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; - } - - $res = $this->seam->request( - "POST", - "/connect_webviews/list", - json: $request_payload, - inner_object: "connect_webviews", - ); - - - - - - return array_map(fn ($r) => ConnectWebview::from_json($r), $res); - } - -} - -class ConnectedAccountsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function delete( - string $connected_account_id, - bool $sync = null - ): void { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $this->seam->request( - "POST", - "/connected_accounts/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $connected_account_id = null, - string $email = null - ): ConnectedAccount { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($email !== null) { - $request_payload["email"] = $email; - } - - $res = $this->seam->request( - "POST", - "/connected_accounts/get", - json: $request_payload, - inner_object: "connected_account", - ); - - - - - - return ConnectedAccount::from_json($res); - } - - public function list( - mixed $custom_metadata_has = null - ): array { - $request_payload = []; - - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; - } - - $res = $this->seam->request( - "POST", - "/connected_accounts/list", - json: $request_payload, - inner_object: "connected_accounts", - ); - - - - - - return array_map(fn ($r) => ConnectedAccount::from_json($r), $res); - } - - public function update( - string $connected_account_id, - bool $automatically_manage_new_devices = null, - mixed $custom_metadata = null - ): ConnectedAccount { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($automatically_manage_new_devices !== null) { - $request_payload["automatically_manage_new_devices"] = $automatically_manage_new_devices; - } - if ($custom_metadata !== null) { - $request_payload["custom_metadata"] = $custom_metadata; - } - - $res = $this->seam->request( - "POST", - "/connected_accounts/update", - json: $request_payload, - inner_object: "connected_account", - ); - - - - - - return ConnectedAccount::from_json($res); - } - -} - -class DevicesClient -{ - private SeamClient $seam; - public DevicesUnmanagedClient $unmanaged; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->unmanaged = new DevicesUnmanagedClient($seam); - } - - - public function delete( - string $device_id - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - - $this->seam->request( - "POST", - "/devices/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $device_id = null, - string $name = null - ): Device { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - - $res = $this->seam->request( - "POST", - "/devices/get", - json: $request_payload, - inner_object: "device", - ); - - - - - - return Device::from_json($res); - } - - public function list( - string $connected_account_id = null, - array $connected_account_ids = null, - string $connect_webview_id = null, - string $device_type = null, - array $device_types = null, - string $manufacturer = null, - array $device_ids = null, - int $limit = null, - string $created_before = null, - string $user_identifier_key = null, - mixed $custom_metadata_has = null - ): array { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($device_type !== null) { - $request_payload["device_type"] = $device_type; - } - if ($device_types !== null) { - $request_payload["device_types"] = $device_types; - } - if ($manufacturer !== null) { - $request_payload["manufacturer"] = $manufacturer; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($limit !== null) { - $request_payload["limit"] = $limit; - } - if ($created_before !== null) { - $request_payload["created_before"] = $created_before; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; - } - - $res = $this->seam->request( - "POST", - "/devices/list", - json: $request_payload, - inner_object: "devices", - ); - - - - - - return array_map(fn ($r) => Device::from_json($r), $res); - } - - public function list_device_providers( - string $provider_category = null - ): array { - $request_payload = []; - - if ($provider_category !== null) { - $request_payload["provider_category"] = $provider_category; - } - - $res = $this->seam->request( - "POST", - "/devices/list_device_providers", - json: $request_payload, - inner_object: "device_providers", - ); - - - - - - return array_map(fn ($r) => DeviceProvider::from_json($r), $res); - } - - public function update( - string $device_id, - mixed $properties = null, - string $name = null, - bool $is_managed = null, - mixed $custom_metadata = null - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($properties !== null) { - $request_payload["properties"] = $properties; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($is_managed !== null) { - $request_payload["is_managed"] = $is_managed; - } - if ($custom_metadata !== null) { - $request_payload["custom_metadata"] = $custom_metadata; - } - - $this->seam->request( - "POST", - "/devices/update", - json: $request_payload, - - ); - - - - - - - } - -} - -class EventsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function get( - string $event_id = null, - string $event_type = null, - string $device_id = null - ): Event { - $request_payload = []; - - if ($event_id !== null) { - $request_payload["event_id"] = $event_id; - } - if ($event_type !== null) { - $request_payload["event_type"] = $event_type; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - - $res = $this->seam->request( - "POST", - "/events/get", - json: $request_payload, - inner_object: "event", - ); - - - - - - return Event::from_json($res); - } - - public function list( - string $since = null, - array $between = null, - string $device_id = null, - array $device_ids = null, - string $access_code_id = null, - array $access_code_ids = null, - string $event_type = null, - array $event_types = null, - string $connected_account_id = null - ): array { - $request_payload = []; - - if ($since !== null) { - $request_payload["since"] = $since; - } - if ($between !== null) { - $request_payload["between"] = $between; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($access_code_ids !== null) { - $request_payload["access_code_ids"] = $access_code_ids; - } - if ($event_type !== null) { - $request_payload["event_type"] = $event_type; - } - if ($event_types !== null) { - $request_payload["event_types"] = $event_types; - } - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - - $res = $this->seam->request( - "POST", - "/events/list", - json: $request_payload, - inner_object: "events", - ); - - - - - - return array_map(fn ($r) => Event::from_json($r), $res); - } - -} - -class HealthClient -{ - private SeamClient $seam; - public HealthServiceClient $service; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->service = new HealthServiceClient($seam); - } - - - public function get_health( - - ): void { - $request_payload = []; - - - - $this->seam->request( - "POST", - "/health/get_health", - json: $request_payload, - - ); - - - - - - - } - - public function get_service_health( - string $service - ): void { - $request_payload = []; - - if ($service !== null) { - $request_payload["service"] = $service; - } - - $this->seam->request( - "POST", - "/health/get_service_health", - json: $request_payload, - - ); - - - - - - - } - -} - -class LocksClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function get( - string $device_id = null, - string $name = null - ): Device { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - - $res = $this->seam->request( - "POST", - "/locks/get", - json: $request_payload, - inner_object: "device", - ); - - - - - - return Device::from_json($res); - } - - public function list( - string $connected_account_id = null, - array $connected_account_ids = null, - string $connect_webview_id = null, - string $device_type = null, - array $device_types = null, - string $manufacturer = null, - array $device_ids = null, - int $limit = null, - string $created_before = null, - string $user_identifier_key = null, - mixed $custom_metadata_has = null - ): array { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($device_type !== null) { - $request_payload["device_type"] = $device_type; - } - if ($device_types !== null) { - $request_payload["device_types"] = $device_types; - } - if ($manufacturer !== null) { - $request_payload["manufacturer"] = $manufacturer; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($limit !== null) { - $request_payload["limit"] = $limit; - } - if ($created_before !== null) { - $request_payload["created_before"] = $created_before; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; - } - - $res = $this->seam->request( - "POST", - "/locks/list", - json: $request_payload, - inner_object: "devices", - ); - - - - - - return array_map(fn ($r) => Device::from_json($r), $res); - } - - public function lock_door( - string $device_id, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $res = $this->seam->request( - "POST", - "/locks/lock_door", - json: $request_payload, - inner_object: "action_attempt", - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - - - } - - public function unlock_door( - string $device_id, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $res = $this->seam->request( - "POST", - "/locks/unlock_door", - json: $request_payload, - inner_object: "action_attempt", - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - - - } - -} - -class NetworksClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function get( - string $network_id - ): void { - $request_payload = []; - - if ($network_id !== null) { - $request_payload["network_id"] = $network_id; - } - - $this->seam->request( - "POST", - "/networks/get", - json: $request_payload, - - ); - - - - - - - } - - public function list( - - ): void { - $request_payload = []; - - - - $this->seam->request( - "POST", - "/networks/list", - json: $request_payload, - - ); - - - - - - - } - -} - -class PhonesClient -{ - private SeamClient $seam; - public PhonesSimulateClient $simulate; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->simulate = new PhonesSimulateClient($seam); - } - - - public function deactivate( - string $device_id - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - - $this->seam->request( - "POST", - "/phones/deactivate", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $owner_user_identity_id = null - ): array { - $request_payload = []; - - if ($owner_user_identity_id !== null) { - $request_payload["owner_user_identity_id"] = $owner_user_identity_id; - } - - $res = $this->seam->request( - "POST", - "/phones/list", - json: $request_payload, - inner_object: "phones", - ); - - - - - - return array_map(fn ($r) => Phone::from_json($r), $res); - } - -} - -class ThermostatsClient -{ - private SeamClient $seam; - public ThermostatsClimateSettingSchedulesClient $climate_setting_schedules; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->climate_setting_schedules = new ThermostatsClimateSettingSchedulesClient($seam); - } - - - public function cool( - string $device_id, - int $cooling_set_point_celsius = null, - int $cooling_set_point_fahrenheit = null, - bool $sync = null - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($cooling_set_point_celsius !== null) { - $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; - } - if ($cooling_set_point_fahrenheit !== null) { - $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $this->seam->request( - "POST", - "/thermostats/cool", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $device_id = null, - string $name = null - ): Device { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - - $res = $this->seam->request( - "POST", - "/thermostats/get", - json: $request_payload, - inner_object: "thermostat", - ); - - - - - - return Device::from_json($res); - } - - public function heat( - string $device_id, - int $heating_set_point_celsius = null, - int $heating_set_point_fahrenheit = null, - bool $sync = null - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($heating_set_point_celsius !== null) { - $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; - } - if ($heating_set_point_fahrenheit !== null) { - $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $this->seam->request( - "POST", - "/thermostats/heat", - json: $request_payload, - - ); - - - - - - - } - - public function heat_cool( - string $device_id, - int $heating_set_point_celsius = null, - int $heating_set_point_fahrenheit = null, - int $cooling_set_point_celsius = null, - int $cooling_set_point_fahrenheit = null, - bool $sync = null - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($heating_set_point_celsius !== null) { - $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; - } - if ($heating_set_point_fahrenheit !== null) { - $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; - } - if ($cooling_set_point_celsius !== null) { - $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; - } - if ($cooling_set_point_fahrenheit !== null) { - $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $this->seam->request( - "POST", - "/thermostats/heat_cool", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $connected_account_id = null, - array $connected_account_ids = null, - string $connect_webview_id = null, - string $device_type = null, - array $device_types = null, - string $manufacturer = null, - array $device_ids = null, - int $limit = null, - string $created_before = null, - string $user_identifier_key = null, - mixed $custom_metadata_has = null - ): array { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($device_type !== null) { - $request_payload["device_type"] = $device_type; - } - if ($device_types !== null) { - $request_payload["device_types"] = $device_types; - } - if ($manufacturer !== null) { - $request_payload["manufacturer"] = $manufacturer; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($limit !== null) { - $request_payload["limit"] = $limit; - } - if ($created_before !== null) { - $request_payload["created_before"] = $created_before; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; - } - - $res = $this->seam->request( - "POST", - "/thermostats/list", - json: $request_payload, - inner_object: "thermostats", - ); - - - - - - return array_map(fn ($r) => Device::from_json($r), $res); - } - - public function off( - string $device_id, - bool $sync = null - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $this->seam->request( - "POST", - "/thermostats/off", - json: $request_payload, - - ); - - - - - - - } - - public function set_fan_mode( - string $device_id, - string $fan_mode = null, - string $fan_mode_setting = null, - bool $sync = null - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($fan_mode !== null) { - $request_payload["fan_mode"] = $fan_mode; - } - if ($fan_mode_setting !== null) { - $request_payload["fan_mode_setting"] = $fan_mode_setting; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $this->seam->request( - "POST", - "/thermostats/set_fan_mode", - json: $request_payload, - - ); - - - - - - - } - - public function update( - string $device_id, - mixed $default_climate_setting - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($default_climate_setting !== null) { - $request_payload["default_climate_setting"] = $default_climate_setting; - } - - $this->seam->request( - "POST", - "/thermostats/update", - json: $request_payload, - - ); - - - - - - - } - -} - -class UserIdentitiesClient -{ - private SeamClient $seam; - public UserIdentitiesEnrollmentAutomationsClient $enrollment_automations; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->enrollment_automations = new UserIdentitiesEnrollmentAutomationsClient($seam); - } - - - public function add_acs_user( - string $user_identity_id, - string $acs_user_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/user_identities/add_acs_user", - json: $request_payload, - - ); - - - - - - - } - - public function create( - string $user_identity_key = null, - string $email_address = null, - string $phone_number = null, - string $full_name = null - ): void { - $request_payload = []; - - if ($user_identity_key !== null) { - $request_payload["user_identity_key"] = $user_identity_key; - } - if ($email_address !== null) { - $request_payload["email_address"] = $email_address; - } - if ($phone_number !== null) { - $request_payload["phone_number"] = $phone_number; - } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; - } - - $this->seam->request( - "POST", - "/user_identities/create", - json: $request_payload, - - ); - - - - - - - } - - public function delete( - string $user_identity_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - - $this->seam->request( - "POST", - "/user_identities/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $user_identity_id = null, - string $user_identity_key = null - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($user_identity_key !== null) { - $request_payload["user_identity_key"] = $user_identity_key; - } - - $this->seam->request( - "POST", - "/user_identities/get", - json: $request_payload, - - ); - - - - - - - } - - public function grant_access_to_device( - string $user_identity_id, - string $device_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - - $this->seam->request( - "POST", - "/user_identities/grant_access_to_device", - json: $request_payload, - - ); - - - - - - - } - - public function list( - - ): void { - $request_payload = []; - - - - $this->seam->request( - "POST", - "/user_identities/list", - json: $request_payload, - inner_object: "user_identities", - ); - - - - - - - } - - public function list_accessible_devices( - string $user_identity_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - - $this->seam->request( - "POST", - "/user_identities/list_accessible_devices", - json: $request_payload, - - ); - - - - - - - } - - public function list_acs_systems( - string $user_identity_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - - $this->seam->request( - "POST", - "/user_identities/list_acs_systems", - json: $request_payload, - - ); - - - - - - - } - - public function list_acs_users( - string $user_identity_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - - $this->seam->request( - "POST", - "/user_identities/list_acs_users", - json: $request_payload, - - ); - - - - - - - } - - public function remove_acs_user( - string $user_identity_id, - string $acs_user_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/user_identities/remove_acs_user", - json: $request_payload, - - ); - - - - - - - } - - public function revoke_access_to_device( - string $user_identity_id, - string $device_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - - $this->seam->request( - "POST", - "/user_identities/revoke_access_to_device", - json: $request_payload, - - ); - - - - - - - } - - public function update( - string $user_identity_id, - string $user_identity_key = null, - string $email_address = null, - string $phone_number = null, - string $full_name = null - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($user_identity_key !== null) { - $request_payload["user_identity_key"] = $user_identity_key; - } - if ($email_address !== null) { - $request_payload["email_address"] = $email_address; - } - if ($phone_number !== null) { - $request_payload["phone_number"] = $phone_number; - } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; - } - - $this->seam->request( - "POST", - "/user_identities/update", - json: $request_payload, - - ); - - - - - - - } - -} - -class WebhooksClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function create( - string $url, - array $event_types = null - ): Webhook { - $request_payload = []; - - if ($url !== null) { - $request_payload["url"] = $url; - } - if ($event_types !== null) { - $request_payload["event_types"] = $event_types; - } - - $res = $this->seam->request( - "POST", - "/webhooks/create", - json: $request_payload, - inner_object: "webhook", - ); - - - - - - return Webhook::from_json($res); - } - - public function delete( - string $webhook_id - ): void { - $request_payload = []; - - if ($webhook_id !== null) { - $request_payload["webhook_id"] = $webhook_id; - } - - $this->seam->request( - "POST", - "/webhooks/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $webhook_id - ): Webhook { - $request_payload = []; - - if ($webhook_id !== null) { - $request_payload["webhook_id"] = $webhook_id; - } - - $res = $this->seam->request( - "POST", - "/webhooks/get", - json: $request_payload, - inner_object: "webhook", - ); - - - - - - return Webhook::from_json($res); - } - - public function list( - - ): array { - $request_payload = []; - - - - $res = $this->seam->request( - "POST", - "/webhooks/list", - json: $request_payload, - inner_object: "webhooks", - ); - - - - - - return array_map(fn ($r) => Webhook::from_json($r), $res); - } - - public function update( - string $webhook_id, - array $event_types - ): void { - $request_payload = []; - - if ($webhook_id !== null) { - $request_payload["webhook_id"] = $webhook_id; - } - if ($event_types !== null) { - $request_payload["event_types"] = $event_types; - } - - $this->seam->request( - "POST", - "/webhooks/update", - json: $request_payload, - - ); - - - - - - - } - -} - -class WorkspacesClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function create( - string $name, - string $connect_partner_name, - bool $is_sandbox = null, - string $webview_primary_button_color = null, - string $webview_logo_shape = null - ): void { - $request_payload = []; - - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($connect_partner_name !== null) { - $request_payload["connect_partner_name"] = $connect_partner_name; - } - if ($is_sandbox !== null) { - $request_payload["is_sandbox"] = $is_sandbox; - } - if ($webview_primary_button_color !== null) { - $request_payload["webview_primary_button_color"] = $webview_primary_button_color; - } - if ($webview_logo_shape !== null) { - $request_payload["webview_logo_shape"] = $webview_logo_shape; - } - - $this->seam->request( - "POST", - "/workspaces/create", - json: $request_payload, - - ); - - - - - - - } - - public function get( - - ): Workspace { - $request_payload = []; - - - - $res = $this->seam->request( - "POST", - "/workspaces/get", - json: $request_payload, - inner_object: "workspace", - ); - - - - - - return Workspace::from_json($res); - } - - public function list( - - ): array { - $request_payload = []; - - - - $res = $this->seam->request( - "POST", - "/workspaces/list", - json: $request_payload, - inner_object: "workspaces", - ); - - - - - - return array_map(fn ($r) => Workspace::from_json($r), $res); - } - - public function reset_sandbox( - - ): void { - $request_payload = []; - - - - $this->seam->request( - "POST", - "/workspaces/reset_sandbox", - json: $request_payload, - inner_object: "message", - ); - - - - - - - } - -} - -class AccessCodesSimulateClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function create_unmanaged_access_code( - string $device_id, - string $name, - string $code - ): UnmanagedAccessCode { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - - $res = $this->seam->request( - "POST", - "/access_codes/simulate/create_unmanaged_access_code", - json: $request_payload, - inner_object: "access_code", - ); - - - - - - return UnmanagedAccessCode::from_json($res); - } - -} - -class AccessCodesUnmanagedClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function convert_to_managed( - string $access_code_id, - bool $is_external_modification_allowed = null, - bool $allow_external_modification = null, - bool $force = null, - bool $sync = null - ): void { - $request_payload = []; - - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($is_external_modification_allowed !== null) { - $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; - } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; - } - if ($force !== null) { - $request_payload["force"] = $force; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $this->seam->request( - "POST", - "/access_codes/unmanaged/convert_to_managed", - json: $request_payload, - - ); - - - - - - - } - - public function delete( - string $access_code_id, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $res = $this->seam->request( - "POST", - "/access_codes/unmanaged/delete", - json: $request_payload, - inner_object: "action_attempt", - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - - - } - - public function get( - string $device_id = null, - string $access_code_id = null, - string $code = null - ): UnmanagedAccessCode { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - - $res = $this->seam->request( - "POST", - "/access_codes/unmanaged/get", - json: $request_payload, - inner_object: "access_code", - ); - - - - - - return UnmanagedAccessCode::from_json($res); - } - - public function list( - string $device_id, - string $user_identifier_key = null - ): array { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - - $res = $this->seam->request( - "POST", - "/access_codes/unmanaged/list", - json: $request_payload, - inner_object: "access_codes", - ); - - - - - - return array_map(fn ($r) => UnmanagedAccessCode::from_json($r), $res); - } - - public function update( - string $access_code_id, - bool $is_managed, - bool $allow_external_modification = null, - bool $is_external_modification_allowed = null, - bool $force = null - ): void { - $request_payload = []; - - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($is_managed !== null) { - $request_payload["is_managed"] = $is_managed; - } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; - } - if ($is_external_modification_allowed !== null) { - $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; - } - if ($force !== null) { - $request_payload["force"] = $force; - } - - $this->seam->request( - "POST", - "/access_codes/unmanaged/update", - json: $request_payload, - - ); - - - - - - - } - -} - -class AcsAccessGroupsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function add_user( - string $acs_access_group_id, - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/access_groups/add_user", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $acs_access_group_id - ): void { - $request_payload = []; - - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; - } - - $this->seam->request( - "POST", - "/acs/access_groups/get", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $acs_system_id = null, - string $acs_user_id = null - ): void { - $request_payload = []; - - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/access_groups/list", - json: $request_payload, - - ); - - - - - - - } - - public function list_users( - string $acs_access_group_id - ): void { - $request_payload = []; - - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; - } - - $this->seam->request( - "POST", - "/acs/access_groups/list_users", - json: $request_payload, - - ); - - - - - - - } - - public function remove_user( - string $acs_access_group_id, - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/access_groups/remove_user", - json: $request_payload, - - ); - - - - - - - } - -} - -class AcsClient -{ - private SeamClient $seam; - public AcsAccessGroupsClient $access_groups; - public AcsCredentialPoolsClient $credential_pools; - public AcsCredentialProvisioningAutomationsClient $credential_provisioning_automations; - public AcsCredentialsClient $credentials; - public AcsEntrancesClient $entrances; - public AcsSystemsClient $systems; - public AcsUsersClient $users; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->access_groups = new AcsAccessGroupsClient($seam); -$this->credential_pools = new AcsCredentialPoolsClient($seam); -$this->credential_provisioning_automations = new AcsCredentialProvisioningAutomationsClient($seam); -$this->credentials = new AcsCredentialsClient($seam); -$this->entrances = new AcsEntrancesClient($seam); -$this->systems = new AcsSystemsClient($seam); -$this->users = new AcsUsersClient($seam); - } - - -} - -class AcsCredentialPoolsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function list( - string $acs_system_id - ): void { - $request_payload = []; - - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } - - $this->seam->request( - "POST", - "/acs/credential_pools/list", - json: $request_payload, - - ); - - - - - - - } - -} - -class AcsCredentialProvisioningAutomationsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function launch( - string $user_identity_id, - string $credential_manager_acs_system_id, - string $acs_credential_pool_id = null, - bool $create_credential_manager_user = null, - string $credential_manager_acs_user_id = null - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($credential_manager_acs_system_id !== null) { - $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; - } - if ($acs_credential_pool_id !== null) { - $request_payload["acs_credential_pool_id"] = $acs_credential_pool_id; - } - if ($create_credential_manager_user !== null) { - $request_payload["create_credential_manager_user"] = $create_credential_manager_user; - } - if ($credential_manager_acs_user_id !== null) { - $request_payload["credential_manager_acs_user_id"] = $credential_manager_acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/credential_provisioning_automations/launch", - json: $request_payload, - - ); - - - - - - - } - -} - -class AcsCredentialsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function assign( - string $acs_user_id, - string $acs_credential_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; - } - - $this->seam->request( - "POST", - "/acs/credentials/assign", - json: $request_payload, - - ); - - - - - - - } - - public function create( - string $acs_user_id, - string $access_method, - string $code = null, - bool $is_multi_phone_sync_credential = null, - string $external_type = null, - mixed $visionline_metadata = null, - string $starts_at = null, - string $ends_at = null - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($access_method !== null) { - $request_payload["access_method"] = $access_method; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - if ($is_multi_phone_sync_credential !== null) { - $request_payload["is_multi_phone_sync_credential"] = $is_multi_phone_sync_credential; - } - if ($external_type !== null) { - $request_payload["external_type"] = $external_type; - } - if ($visionline_metadata !== null) { - $request_payload["visionline_metadata"] = $visionline_metadata; - } - if ($starts_at !== null) { - $request_payload["starts_at"] = $starts_at; - } - if ($ends_at !== null) { - $request_payload["ends_at"] = $ends_at; - } - - $this->seam->request( - "POST", - "/acs/credentials/create", - json: $request_payload, - - ); - - - - - - - } - - public function delete( - string $acs_credential_id - ): void { - $request_payload = []; - - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; - } - - $this->seam->request( - "POST", - "/acs/credentials/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $acs_credential_id - ): void { - $request_payload = []; - - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; - } - - $this->seam->request( - "POST", - "/acs/credentials/get", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $acs_user_id = null, - string $acs_system_id = null, - string $user_identity_id = null - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - - $this->seam->request( - "POST", - "/acs/credentials/list", - json: $request_payload, - - ); - - - - - - - } - - public function unassign( - string $acs_user_id, - string $acs_credential_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; - } - - $this->seam->request( - "POST", - "/acs/credentials/unassign", - json: $request_payload, - - ); - - - - - - - } - - public function update( - string $acs_credential_id, - string $code - ): void { - $request_payload = []; - - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - - $this->seam->request( - "POST", - "/acs/credentials/update", - json: $request_payload, - - ); - - - - - - - } - -} - -class AcsEntrancesClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function get( - string $acs_entrance_id - ): void { - $request_payload = []; - - if ($acs_entrance_id !== null) { - $request_payload["acs_entrance_id"] = $acs_entrance_id; - } - - $this->seam->request( - "POST", - "/acs/entrances/get", - json: $request_payload, - - ); - - - - - - - } - - public function grant_access( - string $acs_entrance_id, - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_entrance_id !== null) { - $request_payload["acs_entrance_id"] = $acs_entrance_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/entrances/grant_access", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $acs_system_id = null, - string $acs_credential_id = null - ): void { - $request_payload = []; - - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; - } - - $this->seam->request( - "POST", - "/acs/entrances/list", - json: $request_payload, - - ); - - - - - - - } - - public function list_credentials_with_access( - string $acs_entrance_id, - array $include_if = null - ): void { - $request_payload = []; - - if ($acs_entrance_id !== null) { - $request_payload["acs_entrance_id"] = $acs_entrance_id; - } - if ($include_if !== null) { - $request_payload["include_if"] = $include_if; - } - - $this->seam->request( - "POST", - "/acs/entrances/list_credentials_with_access", - json: $request_payload, - - ); - - - - - - - } - -} - -class AcsSystemsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function get( - string $acs_system_id - ): void { - $request_payload = []; - - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } - - $this->seam->request( - "POST", - "/acs/systems/get", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $connected_account_id = null - ): void { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - - $this->seam->request( - "POST", - "/acs/systems/list", - json: $request_payload, - - ); - - - - - - - } - -} - -class AcsUsersClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function add_to_access_group( - string $acs_user_id, - string $acs_access_group_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; - } - - $this->seam->request( - "POST", - "/acs/users/add_to_access_group", - json: $request_payload, - - ); - - - - - - - } - - public function create( - string $acs_system_id, - array $acs_access_group_ids = null, - string $user_identity_id = null, - mixed $access_schedule = null, - string $full_name = null, - string $email = null, - string $phone_number = null, - string $email_address = null - ): void { - $request_payload = []; - - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } - if ($acs_access_group_ids !== null) { - $request_payload["acs_access_group_ids"] = $acs_access_group_ids; - } - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($access_schedule !== null) { - $request_payload["access_schedule"] = $access_schedule; - } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; - } - if ($email !== null) { - $request_payload["email"] = $email; - } - if ($phone_number !== null) { - $request_payload["phone_number"] = $phone_number; - } - if ($email_address !== null) { - $request_payload["email_address"] = $email_address; - } - - $this->seam->request( - "POST", - "/acs/users/create", - json: $request_payload, - - ); - - - - - - - } - - public function delete( - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/users/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/users/get", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $user_identity_id = null, - string $user_identity_phone_number = null, - string $user_identity_email_address = null, - string $acs_system_id = null - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($user_identity_phone_number !== null) { - $request_payload["user_identity_phone_number"] = $user_identity_phone_number; - } - if ($user_identity_email_address !== null) { - $request_payload["user_identity_email_address"] = $user_identity_email_address; - } - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } - - $this->seam->request( - "POST", - "/acs/users/list", - json: $request_payload, - - ); - - - - - - - } - - public function list_accessible_entrances( - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/users/list_accessible_entrances", - json: $request_payload, - - ); - - - - - - - } - - public function remove_from_access_group( - string $acs_user_id, - string $acs_access_group_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; - } - - $this->seam->request( - "POST", - "/acs/users/remove_from_access_group", - json: $request_payload, - - ); - - - - - - - } - - public function revoke_access_to_all_entrances( - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/users/revoke_access_to_all_entrances", - json: $request_payload, - - ); - - - - - - - } - - public function suspend( - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/users/suspend", - json: $request_payload, - - ); - - - - - - - } - - public function unsuspend( - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/users/unsuspend", - json: $request_payload, - - ); - - - - - - - } - - public function update( - string $acs_user_id, - mixed $access_schedule = null, - string $full_name = null, - string $email = null, - string $phone_number = null, - string $email_address = null, - string $hid_acs_system_id = null - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($access_schedule !== null) { - $request_payload["access_schedule"] = $access_schedule; - } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; - } - if ($email !== null) { - $request_payload["email"] = $email; - } - if ($phone_number !== null) { - $request_payload["phone_number"] = $phone_number; - } - if ($email_address !== null) { - $request_payload["email_address"] = $email_address; - } - if ($hid_acs_system_id !== null) { - $request_payload["hid_acs_system_id"] = $hid_acs_system_id; - } - - $this->seam->request( - "POST", - "/acs/users/update", - json: $request_payload, - - ); - - - - - - - } - -} - -class DevicesUnmanagedClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function get( - string $device_id = null, - string $name = null - ): UnmanagedDevice { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - - $res = $this->seam->request( - "POST", - "/devices/unmanaged/get", - json: $request_payload, - inner_object: "device", - ); - - - - - - return UnmanagedDevice::from_json($res); - } - - public function list( - string $connected_account_id = null, - array $connected_account_ids = null, - string $connect_webview_id = null, - string $device_type = null, - array $device_types = null, - string $manufacturer = null, - array $device_ids = null, - int $limit = null, - string $created_before = null, - string $user_identifier_key = null, - mixed $custom_metadata_has = null - ): array { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($device_type !== null) { - $request_payload["device_type"] = $device_type; - } - if ($device_types !== null) { - $request_payload["device_types"] = $device_types; - } - if ($manufacturer !== null) { - $request_payload["manufacturer"] = $manufacturer; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($limit !== null) { - $request_payload["limit"] = $limit; - } - if ($created_before !== null) { - $request_payload["created_before"] = $created_before; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; - } - - $res = $this->seam->request( - "POST", - "/devices/unmanaged/list", - json: $request_payload, - inner_object: "devices", - ); - - - - - - return array_map(fn ($r) => UnmanagedDevice::from_json($r), $res); - } - - public function update( - string $device_id, - bool $is_managed - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($is_managed !== null) { - $request_payload["is_managed"] = $is_managed; - } - - $this->seam->request( - "POST", - "/devices/unmanaged/update", - json: $request_payload, - - ); - - - - - - - } - -} - -class HealthServiceClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function by_service_name( - string $service_name - ): void { - $request_payload = []; - - if ($service_name !== null) { - $request_payload["service_name"] = $service_name; - } - - $this->seam->request( - "POST", - "/health/service/[service_name]", - json: $request_payload, - - ); - - - - - - - } - -} - -class NoiseSensorsNoiseThresholdsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function create( - string $device_id, - string $starts_daily_at, - string $ends_daily_at, - bool $sync = null, - string $name = null, - int $noise_threshold_decibels = null, - int $noise_threshold_nrs = null - ): NoiseThreshold { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($starts_daily_at !== null) { - $request_payload["starts_daily_at"] = $starts_daily_at; - } - if ($ends_daily_at !== null) { - $request_payload["ends_daily_at"] = $ends_daily_at; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($noise_threshold_decibels !== null) { - $request_payload["noise_threshold_decibels"] = $noise_threshold_decibels; - } - if ($noise_threshold_nrs !== null) { - $request_payload["noise_threshold_nrs"] = $noise_threshold_nrs; - } - - $res = $this->seam->request( - "POST", - "/noise_sensors/noise_thresholds/create", - json: $request_payload, - inner_object: "noise_threshold", - ); - - - - - - return NoiseThreshold::from_json($res); - } - - public function delete( - string $noise_threshold_id, - string $device_id, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - - if ($noise_threshold_id !== null) { - $request_payload["noise_threshold_id"] = $noise_threshold_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $res = $this->seam->request( - "POST", - "/noise_sensors/noise_thresholds/delete", - json: $request_payload, - inner_object: "action_attempt", - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - - - } - - public function get( - string $noise_threshold_id - ): NoiseThreshold { - $request_payload = []; - - if ($noise_threshold_id !== null) { - $request_payload["noise_threshold_id"] = $noise_threshold_id; - } - - $res = $this->seam->request( - "POST", - "/noise_sensors/noise_thresholds/get", - json: $request_payload, - inner_object: "noise_threshold", - ); - - - - - - return NoiseThreshold::from_json($res); - } - - public function list( - string $device_id, - bool $is_programmed = null - ): array { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($is_programmed !== null) { - $request_payload["is_programmed"] = $is_programmed; - } - - $res = $this->seam->request( - "POST", - "/noise_sensors/noise_thresholds/list", - json: $request_payload, - inner_object: "noise_thresholds", - ); - - - - - - return array_map(fn ($r) => NoiseThreshold::from_json($r), $res); - } - - public function update( - string $noise_threshold_id, - string $device_id, - bool $sync = null, - string $name = null, - string $starts_daily_at = null, - string $ends_daily_at = null, - int $noise_threshold_decibels = null, - int $noise_threshold_nrs = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - - if ($noise_threshold_id !== null) { - $request_payload["noise_threshold_id"] = $noise_threshold_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($starts_daily_at !== null) { - $request_payload["starts_daily_at"] = $starts_daily_at; - } - if ($ends_daily_at !== null) { - $request_payload["ends_daily_at"] = $ends_daily_at; - } - if ($noise_threshold_decibels !== null) { - $request_payload["noise_threshold_decibels"] = $noise_threshold_decibels; - } - if ($noise_threshold_nrs !== null) { - $request_payload["noise_threshold_nrs"] = $noise_threshold_nrs; - } - - $res = $this->seam->request( - "POST", - "/noise_sensors/noise_thresholds/update", - json: $request_payload, - inner_object: "action_attempt", - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - - - } - -} - -class NoiseSensorsClient -{ - private SeamClient $seam; - public NoiseSensorsNoiseThresholdsClient $noise_thresholds; - public NoiseSensorsSimulateClient $simulate; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->noise_thresholds = new NoiseSensorsNoiseThresholdsClient($seam); -$this->simulate = new NoiseSensorsSimulateClient($seam); - } - - -} - -class NoiseSensorsSimulateClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function trigger_noise_threshold( - string $device_id - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - - $this->seam->request( - "POST", - "/noise_sensors/simulate/trigger_noise_threshold", - json: $request_payload, - - ); - - - - - - - } - -} - -class PhonesSimulateClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function create_sandbox_phone( - string $assa_abloy_credential_service_acs_system_id, - string $user_identity_id, - string $custom_sdk_installation_id = null, - mixed $phone_metadata = null, - mixed $assa_abloy_metadata = null - ): Phone { - $request_payload = []; - - if ($assa_abloy_credential_service_acs_system_id !== null) { - $request_payload["assa_abloy_credential_service_acs_system_id"] = $assa_abloy_credential_service_acs_system_id; - } - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($custom_sdk_installation_id !== null) { - $request_payload["custom_sdk_installation_id"] = $custom_sdk_installation_id; - } - if ($phone_metadata !== null) { - $request_payload["phone_metadata"] = $phone_metadata; - } - if ($assa_abloy_metadata !== null) { - $request_payload["assa_abloy_metadata"] = $assa_abloy_metadata; - } - - $res = $this->seam->request( - "POST", - "/phones/simulate/create_sandbox_phone", - json: $request_payload, - inner_object: "phone", - ); - - - - - - return Phone::from_json($res); - } - -} - -class ThermostatsClimateSettingSchedulesClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function create( - string $device_id, - string $schedule_starts_at, - string $schedule_ends_at, - string $schedule_type = null, - string $name = null, - bool $automatic_heating_enabled = null, - bool $automatic_cooling_enabled = null, - string $hvac_mode_setting = null, - int $cooling_set_point_celsius = null, - int $heating_set_point_celsius = null, - int $cooling_set_point_fahrenheit = null, - int $heating_set_point_fahrenheit = null, - bool $manual_override_allowed = null - ): ClimateSettingSchedule { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($schedule_starts_at !== null) { - $request_payload["schedule_starts_at"] = $schedule_starts_at; - } - if ($schedule_ends_at !== null) { - $request_payload["schedule_ends_at"] = $schedule_ends_at; - } - if ($schedule_type !== null) { - $request_payload["schedule_type"] = $schedule_type; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($automatic_heating_enabled !== null) { - $request_payload["automatic_heating_enabled"] = $automatic_heating_enabled; - } - if ($automatic_cooling_enabled !== null) { - $request_payload["automatic_cooling_enabled"] = $automatic_cooling_enabled; - } - if ($hvac_mode_setting !== null) { - $request_payload["hvac_mode_setting"] = $hvac_mode_setting; - } - if ($cooling_set_point_celsius !== null) { - $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; - } - if ($heating_set_point_celsius !== null) { - $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; - } - if ($cooling_set_point_fahrenheit !== null) { - $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; - } - if ($heating_set_point_fahrenheit !== null) { - $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; - } - if ($manual_override_allowed !== null) { - $request_payload["manual_override_allowed"] = $manual_override_allowed; - } - - $res = $this->seam->request( - "POST", - "/thermostats/climate_setting_schedules/create", - json: $request_payload, - inner_object: "climate_setting_schedule", - ); - - - - - - return ClimateSettingSchedule::from_json($res); - } - - public function delete( - string $climate_setting_schedule_id - ): void { - $request_payload = []; - - if ($climate_setting_schedule_id !== null) { - $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; - } - - $this->seam->request( - "POST", - "/thermostats/climate_setting_schedules/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $climate_setting_schedule_id = null, - string $device_id = null - ): ClimateSettingSchedule { - $request_payload = []; - - if ($climate_setting_schedule_id !== null) { - $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - - $res = $this->seam->request( - "POST", - "/thermostats/climate_setting_schedules/get", - json: $request_payload, - inner_object: "climate_setting_schedule", - ); - - - - - - return ClimateSettingSchedule::from_json($res); - } - - public function list( - string $device_id, - string $user_identifier_key = null - ): array { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - - $res = $this->seam->request( - "POST", - "/thermostats/climate_setting_schedules/list", - json: $request_payload, - inner_object: "climate_setting_schedules", - ); - - - - - - return array_map(fn ($r) => ClimateSettingSchedule::from_json($r), $res); - } - - public function update( - string $climate_setting_schedule_id, - string $schedule_type = null, - string $name = null, - string $schedule_starts_at = null, - string $schedule_ends_at = null, - bool $automatic_heating_enabled = null, - bool $automatic_cooling_enabled = null, - string $hvac_mode_setting = null, - int $cooling_set_point_celsius = null, - int $heating_set_point_celsius = null, - int $cooling_set_point_fahrenheit = null, - int $heating_set_point_fahrenheit = null, - bool $manual_override_allowed = null - ): ClimateSettingSchedule { - $request_payload = []; - - if ($climate_setting_schedule_id !== null) { - $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; - } - if ($schedule_type !== null) { - $request_payload["schedule_type"] = $schedule_type; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($schedule_starts_at !== null) { - $request_payload["schedule_starts_at"] = $schedule_starts_at; - } - if ($schedule_ends_at !== null) { - $request_payload["schedule_ends_at"] = $schedule_ends_at; - } - if ($automatic_heating_enabled !== null) { - $request_payload["automatic_heating_enabled"] = $automatic_heating_enabled; - } - if ($automatic_cooling_enabled !== null) { - $request_payload["automatic_cooling_enabled"] = $automatic_cooling_enabled; - } - if ($hvac_mode_setting !== null) { - $request_payload["hvac_mode_setting"] = $hvac_mode_setting; - } - if ($cooling_set_point_celsius !== null) { - $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; - } - if ($heating_set_point_celsius !== null) { - $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; - } - if ($cooling_set_point_fahrenheit !== null) { - $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; - } - if ($heating_set_point_fahrenheit !== null) { - $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; - } - if ($manual_override_allowed !== null) { - $request_payload["manual_override_allowed"] = $manual_override_allowed; - } - - $res = $this->seam->request( - "POST", - "/thermostats/climate_setting_schedules/update", - json: $request_payload, - inner_object: "climate_setting_schedule", - ); - - - - - - return ClimateSettingSchedule::from_json($res); - } - -} - -class UserIdentitiesEnrollmentAutomationsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function delete( - string $enrollment_automation_id - ): void { - $request_payload = []; - - if ($enrollment_automation_id !== null) { - $request_payload["enrollment_automation_id"] = $enrollment_automation_id; - } - - $this->seam->request( - "POST", - "/user_identities/enrollment_automations/delete", - json: $request_payload, - - ); - - - - - - - } - - public function get( - string $enrollment_automation_id - ): void { - $request_payload = []; - - if ($enrollment_automation_id !== null) { - $request_payload["enrollment_automation_id"] = $enrollment_automation_id; - } - - $this->seam->request( - "POST", - "/user_identities/enrollment_automations/get", - json: $request_payload, - - ); - - - - - - - } - - public function launch( - string $user_identity_id, - string $credential_manager_acs_system_id, - string $acs_credential_pool_id = null, - bool $create_credential_manager_user = null, - string $credential_manager_acs_user_id = null - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($credential_manager_acs_system_id !== null) { - $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; - } - if ($acs_credential_pool_id !== null) { - $request_payload["acs_credential_pool_id"] = $acs_credential_pool_id; - } - if ($create_credential_manager_user !== null) { - $request_payload["create_credential_manager_user"] = $create_credential_manager_user; - } - if ($credential_manager_acs_user_id !== null) { - $request_payload["credential_manager_acs_user_id"] = $credential_manager_acs_user_id; - } - - $this->seam->request( - "POST", - "/user_identities/enrollment_automations/launch", - json: $request_payload, - - ); - - - - - - - } - - public function list( - string $user_identity_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - - $this->seam->request( - "POST", - "/user_identities/enrollment_automations/list", - json: $request_payload, - - ); - - - - - - - } - -}