diff --git a/package-lock.json b/package-lock.json index 804a39e..c608a02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.86.0", "@seamapi/nextlove-sdk-generator": "^1.19.10", - "@seamapi/types": "1.848.0", + "@seamapi/types": "1.853.0", "del": "^7.1.0", "prettier": "^3.2.5" } @@ -535,9 +535,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.848.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.848.0.tgz", - "integrity": "sha512-TB+7aiq70TOCoSOvuqTQ9n5xZ5wBOGewb6VauQ7HTuwO19L5osZm6MndqQL7qiQW8d4dawZBT15nevo7Pvre3g==", + "version": "1.853.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.853.0.tgz", + "integrity": "sha512-Rmwm6M5TGPuMSLZwIsX7EDzgY/aCmvo51ZkZkxBVeMAQgOiMPWKahDClQKcstr268IGoGe6PD8gJBH2W2rgdTw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 75422b1..75c35ec 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.86.0", "@seamapi/nextlove-sdk-generator": "^1.19.10", - "@seamapi/types": "1.848.0", + "@seamapi/types": "1.853.0", "del": "^7.1.0", "prettier": "^3.2.5" } diff --git a/seam/routes/acs_encoders.py b/seam/routes/acs_encoders.py index 91a7b07..1350f56 100644 --- a/seam/routes/acs_encoders.py +++ b/seam/routes/acs_encoders.py @@ -101,3 +101,36 @@ def scan_credential( action_attempt=ActionAttempt.from_dict(res["action_attempt"]), wait_for_action_attempt=wait_for_action_attempt, ) + + def scan_to_assign_credential( + self, + *, + acs_encoder_id: str, + acs_user_id: Optional[str] = None, + user_identity_id: Optional[str] = None, + wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None + ) -> ActionAttempt: + json_payload = {} + + if acs_encoder_id is not None: + json_payload["acs_encoder_id"] = acs_encoder_id + if acs_user_id is not None: + json_payload["acs_user_id"] = acs_user_id + if user_identity_id is not None: + json_payload["user_identity_id"] = user_identity_id + + res = self.client.post( + "/acs/encoders/scan_to_assign_credential", json=json_payload + ) + + wait_for_action_attempt = ( + self.defaults.get("wait_for_action_attempt") + if wait_for_action_attempt is None + else wait_for_action_attempt + ) + + return resolve_action_attempt( + client=self.client, + action_attempt=ActionAttempt.from_dict(res["action_attempt"]), + wait_for_action_attempt=wait_for_action_attempt, + ) diff --git a/seam/routes/models.py b/seam/routes/models.py index 991feed..1cfa049 100644 --- a/seam/routes/models.py +++ b/seam/routes/models.py @@ -2154,6 +2154,17 @@ def scan_credential( ) -> ActionAttempt: raise NotImplementedError() + @abc.abstractmethod + def scan_to_assign_credential( + self, + *, + acs_encoder_id: str, + acs_user_id: Optional[str] = None, + user_identity_id: Optional[str] = None, + wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None + ) -> ActionAttempt: + raise NotImplementedError() + class AbstractAcsEncodersSimulate(abc.ABC):