diff --git a/package-lock.json b/package-lock.json index 5cf743c..e16465c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.24.0", "@seamapi/nextlove-sdk-generator": "^1.19.4", - "@seamapi/types": "1.591.0", + "@seamapi/types": "1.625.0", "del": "^7.1.0", "prettier": "^3.0.0" } @@ -456,9 +456,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.591.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.591.0.tgz", - "integrity": "sha512-9r1414GHNbTX85XpEl9tvbiPDvw/TDghWMJk5TSz0CXkwafhOpvY08Wfl16KAPHdN5qVClDlLO9eG4ZS8z8BUQ==", + "version": "1.625.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.625.0.tgz", + "integrity": "sha512-NXY0AWqNUz/z+UGPHFpNgcFj37jaHJ4yuYInWisy43B23oIX1u+XYQo2Gm5/z9UrDrnsYW78op1l0/xaSohBtg==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index f144792..152673e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.24.0", "@seamapi/nextlove-sdk-generator": "^1.19.4", - "@seamapi/types": "1.591.0", + "@seamapi/types": "1.625.0", "del": "^7.1.0", "prettier": "^3.0.0" } diff --git a/src/Objects/AccessGrant.php b/src/Objects/AccessGrant.php index a18908d..2080f31 100644 --- a/src/Objects/AccessGrant.php +++ b/src/Objects/AccessGrant.php @@ -31,6 +31,7 @@ public static function from_json(mixed $json): AccessGrant|null client_session_token: $json->client_session_token ?? null, customization_profile_id: $json->customization_profile_id ?? null, instant_key_url: $json->instant_key_url ?? null, + reservation_key: $json->reservation_key ?? null, ends_at: $json->ends_at ?? null, name: $json->name ?? null, ); @@ -52,6 +53,7 @@ public function __construct( public string|null $client_session_token, public string|null $customization_profile_id, public string|null $instant_key_url, + public string|null $reservation_key, public string|null $ends_at, public string|null $name, ) {} diff --git a/src/Objects/AcsEntrance.php b/src/Objects/AcsEntrance.php index b8abe55..b248776 100644 --- a/src/Objects/AcsEntrance.php +++ b/src/Objects/AcsEntrance.php @@ -25,6 +25,7 @@ public static function from_json(mixed $json): AcsEntrance|null $json->assa_abloy_vostio_metadata, ) : null, + can_belong_to_reservation: $json->can_belong_to_reservation ?? null, can_unlock_with_card: $json->can_unlock_with_card ?? null, can_unlock_with_code: $json->can_unlock_with_code ?? null, can_unlock_with_mobile_key: $json->can_unlock_with_mobile_key ?? @@ -76,6 +77,7 @@ public function __construct( public array $errors, public array $space_ids, public AcsEntranceAssaAbloyVostioMetadata|null $assa_abloy_vostio_metadata, + public bool|null $can_belong_to_reservation, public bool|null $can_unlock_with_card, public bool|null $can_unlock_with_code, public bool|null $can_unlock_with_mobile_key, diff --git a/src/Objects/AcsEntranceHotekMetadata.php b/src/Objects/AcsEntranceHotekMetadata.php index b692cd7..648ce74 100644 --- a/src/Objects/AcsEntranceHotekMetadata.php +++ b/src/Objects/AcsEntranceHotekMetadata.php @@ -10,15 +10,15 @@ public static function from_json(mixed $json): AcsEntranceHotekMetadata|null return null; } return new self( - display_name: $json->display_name, - door_type: $json->door_type, - room_number: $json->room_number, + common_area_name: $json->common_area_name ?? null, + common_area_number: $json->common_area_number ?? null, + room_number: $json->room_number ?? null, ); } public function __construct( - public string $display_name, - public string $door_type, - public string $room_number, + public string|null $common_area_name, + public string|null $common_area_number, + public string|null $room_number, ) {} } diff --git a/src/Objects/AcsUserPendingMutations.php b/src/Objects/AcsUserPendingMutations.php index 6043ffd..92af152 100644 --- a/src/Objects/AcsUserPendingMutations.php +++ b/src/Objects/AcsUserPendingMutations.php @@ -17,6 +17,7 @@ public static function from_json(mixed $json): AcsUserPendingMutations|null ? AcsUserFrom::from_json($json->from) : null, to: isset($json->to) ? AcsUserTo::from_json($json->to) : null, + scheduled_at: $json->scheduled_at ?? null, ); } @@ -26,5 +27,6 @@ public function __construct( public string $mutation_code, public AcsUserFrom|null $from, public AcsUserTo|null $to, + public string|null $scheduled_at, ) {} } diff --git a/src/Objects/DeviceProperties.php b/src/Objects/DeviceProperties.php index 9cdf333..7b5e2d9 100644 --- a/src/Objects/DeviceProperties.php +++ b/src/Objects/DeviceProperties.php @@ -252,6 +252,9 @@ public static function from_json(mixed $json): DeviceProperties|null two_n_metadata: isset($json->two_n_metadata) ? DeviceTwoNMetadata::from_json($json->two_n_metadata) : null, + ultraloq_metadata: isset($json->ultraloq_metadata) + ? DeviceUltraloqMetadata::from_json($json->ultraloq_metadata) + : null, visionline_metadata: isset($json->visionline_metadata) ? DeviceVisionlineMetadata::from_json( $json->visionline_metadata, @@ -359,6 +362,7 @@ public function __construct( public DeviceThermostatWeeklyProgram|null $thermostat_weekly_program, public DeviceTtlockMetadata|null $ttlock_metadata, public DeviceTwoNMetadata|null $two_n_metadata, + public DeviceUltraloqMetadata|null $ultraloq_metadata, public DeviceVisionlineMetadata|null $visionline_metadata, public DeviceWyzeMetadata|null $wyze_metadata, public string|null $active_thermostat_schedule_id, diff --git a/src/Objects/DeviceUltraloqMetadata.php b/src/Objects/DeviceUltraloqMetadata.php new file mode 100644 index 0000000..cfe88ee --- /dev/null +++ b/src/Objects/DeviceUltraloqMetadata.php @@ -0,0 +1,22 @@ +device_id, + device_name: $json->device_name, + ); + } + + public function __construct( + public string $device_id, + public string $device_name, + ) {} +} diff --git a/src/Objects/Event.php b/src/Objects/Event.php index 9709d3b..fc70bbd 100644 --- a/src/Objects/Event.php +++ b/src/Objects/Event.php @@ -20,6 +20,7 @@ public static function from_json(mixed $json): Event|null acs_credential_id: $json->acs_credential_id ?? null, acs_encoder_id: $json->acs_encoder_id ?? null, acs_entrance_id: $json->acs_entrance_id ?? null, + acs_entrance_ids: $json->acs_entrance_ids ?? null, acs_system_id: $json->acs_system_id ?? null, acs_user_id: $json->acs_user_id ?? null, action_attempt_id: $json->action_attempt_id ?? null, @@ -45,6 +46,7 @@ public static function from_json(mixed $json): Event|null null, device_custom_metadata: $json->device_custom_metadata ?? null, device_id: $json->device_id ?? null, + device_ids: $json->device_ids ?? null, device_name: $json->device_name ?? null, ends_at: $json->ends_at ?? null, enrollment_automation_id: $json->enrollment_automation_id ?? null, @@ -67,6 +69,8 @@ public static function from_json(mixed $json): Event|null noise_threshold_name: $json->noise_threshold_name ?? null, noiseaware_metadata: $json->noiseaware_metadata ?? null, occurred_at: $json->occurred_at ?? null, + space_id: $json->space_id ?? null, + space_key: $json->space_key ?? null, starts_at: $json->starts_at ?? null, status: $json->status ?? null, temperature_celsius: $json->temperature_celsius ?? null, @@ -91,6 +95,7 @@ public function __construct( public string|null $acs_credential_id, public string|null $acs_encoder_id, public string|null $acs_entrance_id, + public array|null $acs_entrance_ids, public string|null $acs_system_id, public string|null $acs_user_id, public string|null $action_attempt_id, @@ -112,6 +117,7 @@ public function __construct( public float|null $desired_temperature_fahrenheit, public mixed $device_custom_metadata, public string|null $device_id, + public array|null $device_ids, public string|null $device_name, public string|null $ends_at, public string|null $enrollment_automation_id, @@ -132,6 +138,8 @@ public function __construct( public string|null $noise_threshold_name, public mixed $noiseaware_metadata, public string|null $occurred_at, + public string|null $space_id, + public string|null $space_key, public string|null $starts_at, public string|null $status, public float|null $temperature_celsius, diff --git a/src/Objects/PhoneSessionAcsEntrances.php b/src/Objects/PhoneSessionAcsEntrances.php index d961d8f..2388648 100644 --- a/src/Objects/PhoneSessionAcsEntrances.php +++ b/src/Objects/PhoneSessionAcsEntrances.php @@ -25,6 +25,7 @@ public static function from_json(mixed $json): PhoneSessionAcsEntrances|null $json->assa_abloy_vostio_metadata, ) : null, + can_belong_to_reservation: $json->can_belong_to_reservation ?? null, can_unlock_with_card: $json->can_unlock_with_card ?? null, can_unlock_with_code: $json->can_unlock_with_code ?? null, can_unlock_with_mobile_key: $json->can_unlock_with_mobile_key ?? @@ -76,6 +77,7 @@ public function __construct( public array $errors, public array $space_ids, public PhoneSessionAssaAbloyVostioMetadata|null $assa_abloy_vostio_metadata, + public bool|null $can_belong_to_reservation, public bool|null $can_unlock_with_card, public bool|null $can_unlock_with_code, public bool|null $can_unlock_with_mobile_key, diff --git a/src/Objects/PhoneSessionHotekMetadata.php b/src/Objects/PhoneSessionHotekMetadata.php index a15fe33..c836d11 100644 --- a/src/Objects/PhoneSessionHotekMetadata.php +++ b/src/Objects/PhoneSessionHotekMetadata.php @@ -11,15 +11,15 @@ public static function from_json( return null; } return new self( - display_name: $json->display_name, - door_type: $json->door_type, - room_number: $json->room_number, + common_area_name: $json->common_area_name ?? null, + common_area_number: $json->common_area_number ?? null, + room_number: $json->room_number ?? null, ); } public function __construct( - public string $display_name, - public string $door_type, - public string $room_number, + public string|null $common_area_name, + public string|null $common_area_number, + public string|null $room_number, ) {} } diff --git a/src/Objects/StaffMember.php b/src/Objects/StaffMember.php new file mode 100644 index 0000000..e8ff277 --- /dev/null +++ b/src/Objects/StaffMember.php @@ -0,0 +1,46 @@ +name, + staff_member_key: $json->staff_member_key, + building_keys: $json->building_keys ?? null, + common_area_keys: $json->common_area_keys ?? null, + email_address: $json->email_address ?? null, + facility_keys: $json->facility_keys ?? null, + listing_keys: $json->listing_keys ?? null, + phone_number: $json->phone_number ?? null, + property_keys: $json->property_keys ?? null, + property_listing_keys: $json->property_listing_keys ?? null, + room_keys: $json->room_keys ?? null, + site_keys: $json->site_keys ?? null, + space_keys: $json->space_keys ?? null, + unit_keys: $json->unit_keys ?? null, + ); + } + + public function __construct( + public string $name, + public string $staff_member_key, + public array|null $building_keys, + public array|null $common_area_keys, + public string|null $email_address, + public array|null $facility_keys, + public array|null $listing_keys, + public string|null $phone_number, + public array|null $property_keys, + public array|null $property_listing_keys, + public array|null $room_keys, + public array|null $site_keys, + public array|null $space_keys, + public array|null $unit_keys, + ) {} +} diff --git a/src/Objects/UnmanagedAcsUserPendingMutations.php b/src/Objects/UnmanagedAcsUserPendingMutations.php index fd14ebf..201dac3 100644 --- a/src/Objects/UnmanagedAcsUserPendingMutations.php +++ b/src/Objects/UnmanagedAcsUserPendingMutations.php @@ -20,6 +20,7 @@ public static function from_json( to: isset($json->to) ? UnmanagedAcsUserTo::from_json($json->to) : null, + scheduled_at: $json->scheduled_at ?? null, ); } @@ -29,5 +30,6 @@ public function __construct( public string $mutation_code, public UnmanagedAcsUserFrom|null $from, public UnmanagedAcsUserTo|null $to, + public string|null $scheduled_at, ) {} } diff --git a/src/SeamClient.php b/src/SeamClient.php index 7ce9f4d..3782042 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -32,6 +32,7 @@ use Seam\Objects\PhoneRegistration; use Seam\Objects\PhoneSession; use Seam\Objects\Space; +use Seam\Objects\StaffMember; use Seam\Objects\ThermostatDailyProgram; use Seam\Objects\ThermostatSchedule; use Seam\Objects\UnmanagedAccessCode; @@ -895,6 +896,7 @@ public function create( mixed $location = null, ?array $location_ids = null, ?string $name = null, + ?string $reservation_key = null, ?array $space_ids = null, ?array $space_keys = null, ?string $starts_at = null, @@ -938,6 +940,9 @@ public function create( if ($name !== null) { $request_payload["name"] = $name; } + if ($reservation_key !== null) { + $request_payload["reservation_key"] = $reservation_key; + } if ($space_ids !== null) { $request_payload["space_ids"] = $space_ids; } @@ -1024,6 +1029,7 @@ public function list( ?string $acs_system_id = null, ?string $customer_key = null, ?string $location_id = null, + ?string $reservation_key = null, ?string $space_id = null, ?string $user_identity_id = null, ): array { @@ -1044,6 +1050,9 @@ public function list( if ($location_id !== null) { $request_payload["location_id"] = $location_id; } + if ($reservation_key !== null) { + $request_payload["reservation_key"] = $reservation_key; + } if ($space_id !== null) { $request_payload["space_id"] = $space_id; } @@ -1063,6 +1072,30 @@ public function list( ); } + public function request_access_methods( + string $access_grant_id, + array $requested_access_methods, + ): AccessGrant { + $request_payload = []; + + if ($access_grant_id !== null) { + $request_payload["access_grant_id"] = $access_grant_id; + } + if ($requested_access_methods !== null) { + $request_payload[ + "requested_access_methods" + ] = $requested_access_methods; + } + + $res = $this->seam->request( + "POST", + "/access_grants/request_access_methods", + json: (object) $request_payload, + ); + + return AccessGrant::from_json($res->access_grant); + } + public function update( string $access_grant_id, ?string $ends_at = null, @@ -1119,6 +1152,7 @@ public function get(string $access_grant_id): void public function list( ?string $acs_entrance_id = null, ?string $acs_system_id = null, + ?string $reservation_key = null, ?string $user_identity_id = null, ): void { $request_payload = []; @@ -1129,6 +1163,9 @@ public function list( if ($acs_system_id !== null) { $request_payload["acs_system_id"] = $acs_system_id; } + if ($reservation_key !== null) { + $request_payload["reservation_key"] = $reservation_key; + } if ($user_identity_id !== null) { $request_payload["user_identity_id"] = $user_identity_id; } @@ -1139,6 +1176,30 @@ public function list( json: (object) $request_payload, ); } + + public function update( + string $access_grant_id, + bool $is_managed, + ?string $access_grant_key = null, + ): void { + $request_payload = []; + + if ($access_grant_id !== null) { + $request_payload["access_grant_id"] = $access_grant_id; + } + if ($is_managed !== null) { + $request_payload["is_managed"] = $is_managed; + } + if ($access_grant_key !== null) { + $request_payload["access_grant_key"] = $access_grant_key; + } + + $this->seam->request( + "POST", + "/access_grants/unmanaged/update", + json: (object) $request_payload, + ); + } } class AccessMethodsClient @@ -2196,6 +2257,30 @@ public function list_compatible_credential_manager_acs_systems( return array_map(fn($r) => AcsSystem::from_json($r), $res->acs_systems); } + + public function report_devices( + string $acs_system_id, + ?array $acs_encoders = null, + ?array $acs_entrances = null, + ): void { + $request_payload = []; + + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; + } + if ($acs_encoders !== null) { + $request_payload["acs_encoders"] = $acs_encoders; + } + if ($acs_entrances !== null) { + $request_payload["acs_entrances"] = $acs_entrances; + } + + $this->seam->request( + "POST", + "/acs/systems/report_devices", + json: (object) $request_payload, + ); + } } class AcsUsersClient @@ -3195,6 +3280,7 @@ public function delete_data( ?array $resident_keys = null, ?array $room_keys = null, ?array $space_keys = null, + ?array $staff_member_keys = null, ?array $tenant_keys = null, ?array $unit_keys = null, ?array $user_identity_keys = null, @@ -3244,6 +3330,9 @@ public function delete_data( if ($space_keys !== null) { $request_payload["space_keys"] = $space_keys; } + if ($staff_member_keys !== null) { + $request_payload["staff_member_keys"] = $staff_member_keys; + } if ($tenant_keys !== null) { $request_payload["tenant_keys"] = $tenant_keys; } @@ -3280,6 +3369,7 @@ public function push_data( ?array $rooms = null, ?array $sites = null, ?array $spaces = null, + ?array $staff_members = null, ?array $tenants = null, ?array $units = null, ?array $user_identities = null, @@ -3332,6 +3422,9 @@ public function push_data( if ($spaces !== null) { $request_payload["spaces"] = $spaces; } + if ($staff_members !== null) { + $request_payload["staff_members"] = $staff_members; + } if ($tenants !== null) { $request_payload["tenants"] = $tenants; } @@ -6030,16 +6123,29 @@ public function grant_access_to_device( } public function list( + ?string $created_before = null, ?string $credential_manager_acs_system_id = null, + mixed $limit = null, + ?string $page_cursor = null, ?string $search = null, + ?callable $on_response = null, ): array { $request_payload = []; + if ($created_before !== null) { + $request_payload["created_before"] = $created_before; + } if ($credential_manager_acs_system_id !== null) { $request_payload[ "credential_manager_acs_system_id" ] = $credential_manager_acs_system_id; } + if ($limit !== null) { + $request_payload["limit"] = $limit; + } + if ($page_cursor !== null) { + $request_payload["page_cursor"] = $page_cursor; + } if ($search !== null) { $request_payload["search"] = $search; } @@ -6050,6 +6156,10 @@ public function list( json: (object) $request_payload, ); + if ($on_response !== null) { + $on_response($res); + } + return array_map( fn($r) => UserIdentity::from_json($r), $res->user_identities, @@ -6204,10 +6314,24 @@ public function get(string $user_identity_id): void ); } - public function list(?string $search = null): void - { + public function list( + ?string $created_before = null, + mixed $limit = null, + ?string $page_cursor = null, + ?string $search = null, + ?callable $on_response = null, + ): void { $request_payload = []; + if ($created_before !== null) { + $request_payload["created_before"] = $created_before; + } + if ($limit !== null) { + $request_payload["limit"] = $limit; + } + if ($page_cursor !== null) { + $request_payload["page_cursor"] = $page_cursor; + } if ($search !== null) { $request_payload["search"] = $search; } @@ -6217,6 +6341,34 @@ public function list(?string $search = null): void "/user_identities/unmanaged/list", json: (object) $request_payload, ); + + if ($on_response !== null) { + $on_response($res); + } + } + + public function update( + bool $is_managed, + string $user_identity_id, + ?string $user_identity_key = null, + ): void { + $request_payload = []; + + if ($is_managed !== null) { + $request_payload["is_managed"] = $is_managed; + } + 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/unmanaged/update", + json: (object) $request_payload, + ); } }