diff --git a/package-lock.json b/package-lock.json index 9b12c57..22ae4ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.85.1", "@seamapi/nextlove-sdk-generator": "^1.19.4", - "@seamapi/types": "1.591.0", + "@seamapi/types": "1.625.0", "del": "^7.1.0", "prettier": "^3.2.5" } @@ -475,9 +475,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 aa20e8b..521b078 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.85.1", "@seamapi/nextlove-sdk-generator": "^1.19.4", - "@seamapi/types": "1.591.0", + "@seamapi/types": "1.625.0", "del": "^7.1.0", "prettier": "^3.2.5" } diff --git a/seam/routes/access_grants.py b/seam/routes/access_grants.py index 82e093c..d9cb7b9 100644 --- a/seam/routes/access_grants.py +++ b/seam/routes/access_grants.py @@ -28,6 +28,7 @@ def create( location: Optional[Dict[str, Any]] = None, location_ids: Optional[List[str]] = None, name: Optional[str] = None, + reservation_key: Optional[str] = None, space_ids: Optional[List[str]] = None, space_keys: Optional[List[str]] = None, starts_at: Optional[str] = None @@ -56,6 +57,8 @@ def create( json_payload["location_ids"] = location_ids if name is not None: json_payload["name"] = name + if reservation_key is not None: + json_payload["reservation_key"] = reservation_key if space_ids is not None: json_payload["space_ids"] = space_ids if space_keys is not None: @@ -122,6 +125,7 @@ def list( acs_system_id: Optional[str] = None, customer_key: Optional[str] = None, location_id: Optional[str] = None, + reservation_key: Optional[str] = None, space_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> List[AccessGrant]: @@ -137,6 +141,8 @@ def list( json_payload["customer_key"] = customer_key if location_id is not None: json_payload["location_id"] = location_id + if reservation_key is not None: + json_payload["reservation_key"] = reservation_key if space_id is not None: json_payload["space_id"] = space_id if user_identity_id is not None: @@ -146,6 +152,22 @@ def list( return [AccessGrant.from_dict(item) for item in res["access_grants"]] + def request_access_methods( + self, *, access_grant_id: str, requested_access_methods: List[Dict[str, Any]] + ) -> AccessGrant: + json_payload = {} + + if access_grant_id is not None: + json_payload["access_grant_id"] = access_grant_id + if requested_access_methods is not None: + json_payload["requested_access_methods"] = requested_access_methods + + res = self.client.post( + "/access_grants/request_access_methods", json=json_payload + ) + + return AccessGrant.from_dict(res["access_grant"]) + def update( self, *, diff --git a/seam/routes/access_grants_unmanaged.py b/seam/routes/access_grants_unmanaged.py index fe321d2..537b20a 100644 --- a/seam/routes/access_grants_unmanaged.py +++ b/seam/routes/access_grants_unmanaged.py @@ -23,6 +23,7 @@ def list( *, acs_entrance_id: Optional[str] = None, acs_system_id: Optional[str] = None, + reservation_key: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: json_payload = {} @@ -31,9 +32,31 @@ def list( json_payload["acs_entrance_id"] = acs_entrance_id if acs_system_id is not None: json_payload["acs_system_id"] = acs_system_id + if reservation_key is not None: + json_payload["reservation_key"] = reservation_key if user_identity_id is not None: json_payload["user_identity_id"] = user_identity_id self.client.post("/access_grants/unmanaged/list", json=json_payload) return None + + def update( + self, + *, + access_grant_id: str, + is_managed: bool, + access_grant_key: Optional[str] = None + ) -> None: + json_payload = {} + + if access_grant_id is not None: + json_payload["access_grant_id"] = access_grant_id + if is_managed is not None: + json_payload["is_managed"] = is_managed + if access_grant_key is not None: + json_payload["access_grant_key"] = access_grant_key + + self.client.post("/access_grants/unmanaged/update", json=json_payload) + + return None diff --git a/seam/routes/acs_systems.py b/seam/routes/acs_systems.py index 43364e7..29a6d63 100644 --- a/seam/routes/acs_systems.py +++ b/seam/routes/acs_systems.py @@ -49,3 +49,23 @@ def list_compatible_credential_manager_acs_systems( ) return [AcsSystem.from_dict(item) for item in res["acs_systems"]] + + def report_devices( + self, + *, + acs_system_id: str, + acs_encoders: Optional[List[Dict[str, Any]]] = None, + acs_entrances: Optional[List[Dict[str, Any]]] = None + ) -> None: + json_payload = {} + + if acs_system_id is not None: + json_payload["acs_system_id"] = acs_system_id + if acs_encoders is not None: + json_payload["acs_encoders"] = acs_encoders + if acs_entrances is not None: + json_payload["acs_entrances"] = acs_entrances + + self.client.post("/acs/systems/report_devices", json=json_payload) + + return None diff --git a/seam/routes/customers.py b/seam/routes/customers.py index 5dedc41..3f640cf 100644 --- a/seam/routes/customers.py +++ b/seam/routes/customers.py @@ -48,6 +48,7 @@ def delete_data( resident_keys: Optional[List[str]] = None, room_keys: Optional[List[str]] = None, space_keys: Optional[List[str]] = None, + staff_member_keys: Optional[List[str]] = None, tenant_keys: Optional[List[str]] = None, unit_keys: Optional[List[str]] = None, user_identity_keys: Optional[List[str]] = None, @@ -83,6 +84,8 @@ def delete_data( json_payload["room_keys"] = room_keys if space_keys is not None: json_payload["space_keys"] = space_keys + if staff_member_keys is not None: + json_payload["staff_member_keys"] = staff_member_keys if tenant_keys is not None: json_payload["tenant_keys"] = tenant_keys if unit_keys is not None: @@ -114,6 +117,7 @@ def push_data( rooms: Optional[List[Dict[str, Any]]] = None, sites: Optional[List[Dict[str, Any]]] = None, spaces: Optional[List[Dict[str, Any]]] = None, + staff_members: Optional[List[Dict[str, Any]]] = None, tenants: Optional[List[Dict[str, Any]]] = None, units: Optional[List[Dict[str, Any]]] = None, user_identities: Optional[List[Dict[str, Any]]] = None, @@ -151,6 +155,8 @@ def push_data( json_payload["sites"] = sites if spaces is not None: json_payload["spaces"] = spaces + if staff_members is not None: + json_payload["staff_members"] = staff_members if tenants is not None: json_payload["tenants"] = tenants if units is not None: diff --git a/seam/routes/models.py b/seam/routes/models.py index a02f5d5..c2702de 100644 --- a/seam/routes/models.py +++ b/seam/routes/models.py @@ -78,6 +78,7 @@ class AccessGrant: location_ids: List[str] name: str requested_access_methods: List[Dict[str, Any]] + reservation_key: str space_ids: List[str] starts_at: str user_identity_id: str @@ -99,6 +100,7 @@ def from_dict(d: Dict[str, Any]): location_ids=d.get("location_ids", None), name=d.get("name", None), requested_access_methods=d.get("requested_access_methods", None), + reservation_key=d.get("reservation_key", None), space_ids=d.get("space_ids", None), starts_at=d.get("starts_at", None), user_identity_id=d.get("user_identity_id", None), @@ -326,6 +328,7 @@ class AcsEntrance: acs_entrance_id: str acs_system_id: str assa_abloy_vostio_metadata: Dict[str, Any] + can_belong_to_reservation: bool can_unlock_with_card: bool can_unlock_with_code: bool can_unlock_with_mobile_key: bool @@ -350,6 +353,7 @@ def from_dict(d: Dict[str, Any]): assa_abloy_vostio_metadata=DeepAttrDict( d.get("assa_abloy_vostio_metadata", None) ), + can_belong_to_reservation=d.get("can_belong_to_reservation", None), can_unlock_with_card=d.get("can_unlock_with_card", None), can_unlock_with_code=d.get("can_unlock_with_code", None), can_unlock_with_mobile_key=d.get("can_unlock_with_mobile_key", None), @@ -949,6 +953,10 @@ class SeamEvent: desired_temperature_fahrenheit: float device_name: str enrollment_automation_id: str + acs_entrance_ids: List[str] + device_ids: List[str] + space_id: str + space_key: str @staticmethod def from_dict(d: Dict[str, Any]): @@ -1018,6 +1026,10 @@ def from_dict(d: Dict[str, Any]): ), device_name=d.get("device_name", None), enrollment_automation_id=d.get("enrollment_automation_id", None), + acs_entrance_ids=d.get("acs_entrance_ids", None), + device_ids=d.get("device_ids", None), + space_id=d.get("space_id", None), + space_key=d.get("space_key", None), ) @@ -1197,6 +1209,43 @@ def from_dict(d: Dict[str, Any]): ) +@dataclass +class StaffMember: + building_keys: List[str] + common_area_keys: List[str] + email_address: str + facility_keys: List[str] + listing_keys: List[str] + name: str + phone_number: str + property_keys: List[str] + property_listing_keys: List[str] + room_keys: List[str] + site_keys: List[str] + space_keys: List[str] + staff_member_key: str + unit_keys: List[str] + + @staticmethod + def from_dict(d: Dict[str, Any]): + return StaffMember( + building_keys=d.get("building_keys", None), + common_area_keys=d.get("common_area_keys", None), + email_address=d.get("email_address", None), + facility_keys=d.get("facility_keys", None), + listing_keys=d.get("listing_keys", None), + name=d.get("name", None), + phone_number=d.get("phone_number", None), + property_keys=d.get("property_keys", None), + property_listing_keys=d.get("property_listing_keys", None), + room_keys=d.get("room_keys", None), + site_keys=d.get("site_keys", None), + space_keys=d.get("space_keys", None), + staff_member_key=d.get("staff_member_key", None), + unit_keys=d.get("unit_keys", None), + ) + + @dataclass class ThermostatDailyProgram: created_at: str @@ -1688,10 +1737,21 @@ def list( *, acs_entrance_id: Optional[str] = None, acs_system_id: Optional[str] = None, + reservation_key: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: raise NotImplementedError() + @abc.abstractmethod + def update( + self, + *, + access_grant_id: str, + is_managed: bool, + access_grant_key: Optional[str] = None + ) -> None: + raise NotImplementedError() + class AbstractAccessMethodsUnmanaged(abc.ABC): @@ -1978,6 +2038,16 @@ def list_compatible_credential_manager_acs_systems( ) -> List[AcsSystem]: raise NotImplementedError() + @abc.abstractmethod + def report_devices( + self, + *, + acs_system_id: str, + acs_encoders: Optional[List[Dict[str, Any]]] = None, + acs_entrances: Optional[List[Dict[str, Any]]] = None + ) -> None: + raise NotImplementedError() + class AbstractAcsUsers(abc.ABC): @@ -2307,6 +2377,7 @@ def delete_data( resident_keys: Optional[List[str]] = None, room_keys: Optional[List[str]] = None, space_keys: Optional[List[str]] = None, + staff_member_keys: Optional[List[str]] = None, tenant_keys: Optional[List[str]] = None, unit_keys: Optional[List[str]] = None, user_identity_keys: Optional[List[str]] = None, @@ -2333,6 +2404,7 @@ def push_data( rooms: Optional[List[Dict[str, Any]]] = None, sites: Optional[List[Dict[str, Any]]] = None, spaces: Optional[List[Dict[str, Any]]] = None, + staff_members: Optional[List[Dict[str, Any]]] = None, tenants: Optional[List[Dict[str, Any]]] = None, units: Optional[List[Dict[str, Any]]] = None, user_identities: Optional[List[Dict[str, Any]]] = None, @@ -2739,7 +2811,24 @@ def get(self, *, user_identity_id: str) -> None: raise NotImplementedError() @abc.abstractmethod - def list(self, *, search: Optional[str] = None) -> None: + def list( + self, + *, + created_before: Optional[str] = None, + limit: Optional[int] = None, + page_cursor: Optional[str] = None, + search: Optional[str] = None + ) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def update( + self, + *, + is_managed: bool, + user_identity_id: str, + user_identity_key: Optional[str] = None + ) -> None: raise NotImplementedError() @@ -2827,6 +2916,7 @@ def create( location: Optional[Dict[str, Any]] = None, location_ids: Optional[List[str]] = None, name: Optional[str] = None, + reservation_key: Optional[str] = None, space_ids: Optional[List[str]] = None, space_keys: Optional[List[str]] = None, starts_at: Optional[str] = None @@ -2865,11 +2955,18 @@ def list( acs_system_id: Optional[str] = None, customer_key: Optional[str] = None, location_id: Optional[str] = None, + reservation_key: Optional[str] = None, space_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> List[AccessGrant]: raise NotImplementedError() + @abc.abstractmethod + def request_access_methods( + self, *, access_grant_id: str, requested_access_methods: List[Dict[str, Any]] + ) -> AccessGrant: + raise NotImplementedError() + @abc.abstractmethod def update( self, @@ -3073,7 +3170,10 @@ def grant_access_to_device(self, *, device_id: str, user_identity_id: str) -> No def list( self, *, + created_before: Optional[str] = None, credential_manager_acs_system_id: Optional[str] = None, + limit: Optional[int] = None, + page_cursor: Optional[str] = None, search: Optional[str] = None ) -> List[UserIdentity]: raise NotImplementedError() diff --git a/seam/routes/user_identities.py b/seam/routes/user_identities.py index c74416a..e2bbb95 100644 --- a/seam/routes/user_identities.py +++ b/seam/routes/user_identities.py @@ -131,15 +131,24 @@ def grant_access_to_device(self, *, device_id: str, user_identity_id: str) -> No def list( self, *, + created_before: Optional[str] = None, credential_manager_acs_system_id: Optional[str] = None, + limit: Optional[int] = None, + page_cursor: Optional[str] = None, search: Optional[str] = None ) -> List[UserIdentity]: json_payload = {} + if created_before is not None: + json_payload["created_before"] = created_before if credential_manager_acs_system_id is not None: json_payload["credential_manager_acs_system_id"] = ( credential_manager_acs_system_id ) + if limit is not None: + json_payload["limit"] = limit + if page_cursor is not None: + json_payload["page_cursor"] = page_cursor if search is not None: json_payload["search"] = search diff --git a/seam/routes/user_identities_unmanaged.py b/seam/routes/user_identities_unmanaged.py index 305a8a0..70b503b 100644 --- a/seam/routes/user_identities_unmanaged.py +++ b/seam/routes/user_identities_unmanaged.py @@ -18,12 +18,45 @@ def get(self, *, user_identity_id: str) -> None: return None - def list(self, *, search: Optional[str] = None) -> None: + def list( + self, + *, + created_before: Optional[str] = None, + limit: Optional[int] = None, + page_cursor: Optional[str] = None, + search: Optional[str] = None + ) -> None: json_payload = {} + if created_before is not None: + json_payload["created_before"] = created_before + if limit is not None: + json_payload["limit"] = limit + if page_cursor is not None: + json_payload["page_cursor"] = page_cursor if search is not None: json_payload["search"] = search self.client.post("/user_identities/unmanaged/list", json=json_payload) return None + + def update( + self, + *, + is_managed: bool, + user_identity_id: str, + user_identity_key: Optional[str] = None + ) -> None: + json_payload = {} + + if is_managed is not None: + json_payload["is_managed"] = is_managed + if user_identity_id is not None: + json_payload["user_identity_id"] = user_identity_id + if user_identity_key is not None: + json_payload["user_identity_key"] = user_identity_key + + self.client.post("/user_identities/unmanaged/update", json=json_payload) + + return None