From 9cf4b78fb8e7219e5e5cd52decf7b444793183c3 Mon Sep 17 00:00:00 2001 From: Gerardo Rodriguez Date: Fri, 25 Sep 2026 20:14:58 +0000 Subject: [PATCH] Refresh Desktop API SDK for v6 --- .github/workflows/ci.yml | 6 +- .release-please-manifest.json | 2 +- .stats.yml | 5 +- .stdy.log | 102 +++ README.md | 47 +- composer.json | 1 + composer.lock | 488 ++++++++++-- scripts/mock | 46 +- scripts/test | 16 +- src/APIError.php | 100 +++ src/Accounts/Account.php | 161 +++- src/Accounts/Account/Status.php | 27 + src/Accounts/AccountBridge.php | 118 +++ src/Accounts/AccountBridge/Provider.php | 19 + src/Accounts/AccountGetResponse.php | 242 ++++++ src/Accounts/AccountGetResponse/Status.php | 27 + src/Accounts/Contacts/ContactListParams.php | 4 +- src/Accounts/Contacts/ContactSearchParams.php | 6 +- src/App/RecoveryKeyResetResponse.php | 97 +++ src/App/RecoveryKeyResetResponse/Session.php | 158 ++++ .../RecoveryKeyResetResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../RecoveryKey/RecoveryKeyVerifyParams.php | 74 ++ .../RecoveryKey/RecoveryKeyVerifyResponse.php | 77 ++ .../RecoveryKeyVerifyResponse/Session.php | 158 ++++ .../Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../RecoveryKey/Reset/ResetConfirmParams.php | 74 ++ .../Reset/ResetConfirmResponse.php | 75 ++ .../Reset/ResetConfirmResponse/Session.php | 158 ++++ .../ResetConfirmResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../ResetConfirmResponse/Session/Matrix.php | 111 +++ .../ResetConfirmResponse/Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../RecoveryKey/Reset/ResetCreateParams.php | 60 ++ .../RecoveryKey/Reset/ResetNewResponse.php | 97 +++ .../Reset/ResetNewResponse/Session.php | 158 ++++ .../Reset/ResetNewResponse/Session/E2EE.php | 261 +++++++ .../ResetNewResponse/Session/E2EE/Secrets.php | 164 ++++ .../Reset/ResetNewResponse/Session/Matrix.php | 111 +++ .../Reset/ResetNewResponse/Session/State.php | 25 + .../ResetNewResponse/Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + src/App/Setup/SetupEmailParams.php | 94 +++ src/App/Setup/SetupGetResponse.php | 156 ++++ src/App/Setup/SetupGetResponse/E2EE.php | 261 +++++++ .../Setup/SetupGetResponse/E2EE/Secrets.php | 164 ++++ src/App/Setup/SetupGetResponse/Matrix.php | 111 +++ src/App/Setup/SetupGetResponse/State.php | 25 + .../Setup/SetupGetResponse/Verification.php | 343 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../SetupGetResponse/Verification/Error.php | 88 +++ .../SetupGetResponse/Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../SetupGetResponse/Verification/Purpose.php | 15 + .../SetupGetResponse/Verification/QR.php | 70 ++ .../SetupGetResponse/Verification/SAS.php | 90 +++ .../SetupGetResponse/Verification/State.php | 25 + src/App/Setup/SetupRegisterParams.php | 135 ++++ src/App/Setup/SetupRegisterResponse.php | 102 +++ .../Setup/SetupRegisterResponse/Matrix.php | 134 ++++ .../Setup/SetupRegisterResponse/Session.php | 159 ++++ .../SetupRegisterResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../SetupRegisterResponse/Session/Matrix.php | 111 +++ .../SetupRegisterResponse/Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + src/App/Setup/SetupResponseParams.php | 94 +++ src/App/Setup/SetupResponseResponse.php | 34 + .../AppSetupCompleteResponse.php | 102 +++ .../AppSetupCompleteResponse/Matrix.php | 134 ++++ .../AppSetupCompleteResponse/Session.php | 159 ++++ .../AppSetupCompleteResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../AppSetupRegistrationRequiredResponse.php | 168 +++++ .../Copy.php | 124 +++ src/App/Setup/SetupStartResponse.php | 96 +++ .../QR/QRConfirmScannedResponse.php | 105 +++ .../QR/QRConfirmScannedResponse/Session.php | 159 ++++ .../QRConfirmScannedResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../QRConfirmScannedResponse/Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../Verification/Error.php | 88 +++ .../Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../Verification/Purpose.php | 15 + .../Verification/QR.php | 70 ++ .../Verification/SAS.php | 90 +++ .../Verification/State.php | 25 + .../Setup/Verifications/QR/QRScanParams.php | 74 ++ .../Setup/Verifications/QR/QRScanResponse.php | 105 +++ .../QR/QRScanResponse/Session.php | 159 ++++ .../QR/QRScanResponse/Session/E2EE.php | 261 +++++++ .../QRScanResponse/Session/E2EE/Secrets.php | 164 ++++ .../QR/QRScanResponse/Session/Matrix.php | 111 +++ .../QR/QRScanResponse/Session/State.php | 25 + .../QRScanResponse/Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../QR/QRScanResponse/Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../QRScanResponse/Verification/Direction.php | 15 + .../QR/QRScanResponse/Verification/Error.php | 88 +++ .../QR/QRScanResponse/Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../QRScanResponse/Verification/Purpose.php | 15 + .../QR/QRScanResponse/Verification/QR.php | 70 ++ .../QR/QRScanResponse/Verification/SAS.php | 90 +++ .../QR/QRScanResponse/Verification/State.php | 25 + .../Verifications/SAS/SASConfirmResponse.php | 105 +++ .../SAS/SASConfirmResponse/Session.php | 159 ++++ .../SAS/SASConfirmResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../SAS/SASConfirmResponse/Session/Matrix.php | 111 +++ .../SAS/SASConfirmResponse/Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../SAS/SASConfirmResponse/Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../SASConfirmResponse/Verification/Error.php | 88 +++ .../Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../Verification/Purpose.php | 15 + .../SASConfirmResponse/Verification/QR.php | 70 ++ .../SASConfirmResponse/Verification/SAS.php | 90 +++ .../SASConfirmResponse/Verification/State.php | 25 + .../Verifications/SAS/SASStartResponse.php | 105 +++ .../SAS/SASStartResponse/Session.php | 159 ++++ .../SAS/SASStartResponse/Session/E2EE.php | 261 +++++++ .../SASStartResponse/Session/E2EE/Secrets.php | 164 ++++ .../SAS/SASStartResponse/Session/Matrix.php | 111 +++ .../SAS/SASStartResponse/Session/State.php | 25 + .../SASStartResponse/Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../SAS/SASStartResponse/Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../SASStartResponse/Verification/Error.php | 88 +++ .../SASStartResponse/Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../SASStartResponse/Verification/Purpose.php | 15 + .../SAS/SASStartResponse/Verification/QR.php | 70 ++ .../SAS/SASStartResponse/Verification/SAS.php | 90 +++ .../SASStartResponse/Verification/State.php | 25 + .../VerificationAcceptResponse.php | 105 +++ .../VerificationAcceptResponse/Session.php | 159 ++++ .../Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../Verification/Error.php | 88 +++ .../Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../Verification/Purpose.php | 15 + .../Verification/QR.php | 70 ++ .../Verification/SAS.php | 90 +++ .../Verification/State.php | 25 + .../VerificationCancelParams.php | 82 ++ .../VerificationCancelResponse.php | 105 +++ .../VerificationCancelResponse/Session.php | 159 ++++ .../Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../Verification/Error.php | 88 +++ .../Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../Verification/Purpose.php | 15 + .../Verification/QR.php | 70 ++ .../Verification/SAS.php | 90 +++ .../Verification/State.php | 25 + .../VerificationCreateParams.php | 89 +++ .../VerificationCreateParams/Purpose.php | 15 + .../Verifications/VerificationGetResponse.php | 105 +++ .../VerificationGetResponse/Session.php | 159 ++++ .../VerificationGetResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../VerificationGetResponse/Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../VerificationGetResponse/Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../Verification/Error.php | 88 +++ .../Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../Verification/Purpose.php | 15 + .../Verification/QR.php | 70 ++ .../Verification/SAS.php | 90 +++ .../Verification/State.php | 25 + .../VerificationListResponse.php | 71 ++ .../VerificationListResponse/Item.php | 340 +++++++++ .../Item/AvailableAction.php | 18 + .../Item/Direction.php | 15 + .../VerificationListResponse/Item/Error.php | 88 +++ .../VerificationListResponse/Item/Method.php | 12 + .../Item/OtherDevice.php | 90 +++ .../VerificationListResponse/Item/Purpose.php | 15 + .../VerificationListResponse/Item/QR.php | 70 ++ .../VerificationListResponse/Item/SAS.php | 90 +++ .../VerificationListResponse/Item/State.php | 25 + .../Verifications/VerificationNewResponse.php | 105 +++ .../VerificationNewResponse/Session.php | 159 ++++ .../VerificationNewResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../VerificationNewResponse/Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../VerificationNewResponse/Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../Verification/Error.php | 88 +++ .../Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../Verification/Purpose.php | 15 + .../Verification/QR.php | 70 ++ .../Verification/SAS.php | 90 +++ .../Verification/State.php | 25 + src/App/SetupCompleteResponse.php | 102 +++ src/App/SetupCompleteResponse/Matrix.php | 134 ++++ src/App/SetupCompleteResponse/Session.php | 159 ++++ .../SetupCompleteResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../SetupCompleteResponse/Session/Matrix.php | 111 +++ .../SetupCompleteResponse/Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + src/App/SetupRegistrationRequiredResponse.php | 168 +++++ .../Copy.php | 124 +++ src/App/SetupResponseOutput.php | 34 + .../AppSetupCompleteResponse.php | 102 +++ .../AppSetupCompleteResponse/Matrix.php | 134 ++++ .../AppSetupCompleteResponse/Session.php | 159 ++++ .../AppSetupCompleteResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../Session/Matrix.php | 111 +++ .../Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + .../AppSetupRegistrationRequiredResponse.php | 168 +++++ .../Copy.php | 124 +++ src/App/SetupStateResponse.php | 75 ++ src/App/SetupStateResponse/Session.php | 158 ++++ src/App/SetupStateResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ src/App/SetupStateResponse/Session/Matrix.php | 111 +++ src/App/SetupStateResponse/Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + src/App/Verification.php | 340 +++++++++ src/App/Verification/AvailableAction.php | 18 + src/App/Verification/Direction.php | 15 + src/App/Verification/Error.php | 88 +++ src/App/Verification/Method.php | 12 + src/App/Verification/OtherDevice.php | 90 +++ src/App/Verification/Purpose.php | 15 + src/App/Verification/QR.php | 70 ++ src/App/Verification/SAS.php | 90 +++ src/App/Verification/State.php | 25 + src/App/VerificationResponse.php | 106 +++ src/App/VerificationResponse/Session.php | 159 ++++ src/App/VerificationResponse/Session/E2EE.php | 261 +++++++ .../Session/E2EE/Secrets.php | 164 ++++ .../VerificationResponse/Session/Matrix.php | 111 +++ .../VerificationResponse/Session/State.php | 25 + .../Session/Verification.php | 343 +++++++++ .../Session/Verification/AvailableAction.php | 18 + .../Session/Verification/Direction.php | 15 + .../Session/Verification/Error.php | 88 +++ .../Session/Verification/Method.php | 12 + .../Session/Verification/OtherDevice.php | 90 +++ .../Session/Verification/Purpose.php | 15 + .../Session/Verification/QR.php | 70 ++ .../Session/Verification/SAS.php | 90 +++ .../Session/Verification/State.php | 25 + src/App/VerificationResponse/Verification.php | 340 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + .../Verification/Error.php | 88 +++ .../Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ .../Verification/Purpose.php | 15 + .../VerificationResponse/Verification/QR.php | 70 ++ .../VerificationResponse/Verification/SAS.php | 90 +++ .../Verification/State.php | 25 + src/AppStateSnapshot.php | 156 ++++ src/AppStateSnapshot/E2EE.php | 261 +++++++ src/AppStateSnapshot/E2EE/Secrets.php | 164 ++++ src/AppStateSnapshot/Matrix.php | 111 +++ src/AppStateSnapshot/State.php | 25 + src/AppStateSnapshot/Verification.php | 341 +++++++++ .../Verification/AvailableAction.php | 18 + .../Verification/Direction.php | 15 + src/AppStateSnapshot/Verification/Error.php | 88 +++ src/AppStateSnapshot/Verification/Method.php | 12 + .../Verification/OtherDevice.php | 90 +++ src/AppStateSnapshot/Verification/Purpose.php | 15 + src/AppStateSnapshot/Verification/QR.php | 70 ++ src/AppStateSnapshot/Verification/SAS.php | 90 +++ src/AppStateSnapshot/Verification/State.php | 25 + src/Assets/AssetDownloadParams.php | 6 +- src/Assets/AssetDownloadResponse.php | 4 +- src/Assets/AssetServeParams.php | 4 +- src/Assets/AssetUploadBase64Params.php | 2 +- src/Assets/AssetUploadBase64Response.php | 8 +- src/Assets/AssetUploadParams.php | 9 +- src/Assets/AssetUploadResponse.php | 8 +- src/Attachment.php | 37 +- src/Attachment/Transcription.php | 113 +++ src/AttachmentCapabilities.php | 228 ++++++ src/AttachmentCapabilities/Caption.php | 21 + src/AttachmentCapabilities/MimeType.php | 21 + src/BeeperDesktopFocusParams.php | 10 +- src/BeeperDesktopSearchParams.php | 6 +- src/Bridges/Bridge.php | 294 ++++++++ src/Bridges/Bridge/Provider.php | 19 + src/Bridges/Bridge/Status.php | 21 + src/Bridges/BridgeGetResponse.php | 294 ++++++++ src/Bridges/BridgeGetResponse/Provider.php | 19 + src/Bridges/BridgeGetResponse/Status.php | 21 + src/Bridges/BridgeListResponse.php | 72 ++ src/Bridges/BridgeLogin.php | 211 ++++++ src/Bridges/BridgeLogin/RemoveScope.php | 15 + src/Bridges/BridgeLogin/Status.php | 18 + src/Bridges/CookieField.php | 118 +++ src/Bridges/CookieField/Type.php | 17 + src/Bridges/DisappearingTimerCapability.php | 109 +++ .../DisappearingTimerCapability/Type.php | 16 + src/Bridges/GroupFieldCapability.php | 138 ++++ src/Bridges/GroupTypeCapabilities.php | 234 ++++++ src/Bridges/LoginFlow.php | 113 +++ .../LoginFlows/LoginFlowListResponse.php | 73 ++ src/Bridges/LoginInputField.php | 173 +++++ src/Bridges/LoginSession.php | 256 +++++++ src/Bridges/LoginSession/CurrentStep.php | 42 ++ .../CurrentStep/CompleteLoginStep.php | 140 ++++ .../CurrentStep/CookiesLoginStep.php | 207 +++++ .../CurrentStep/DisplayAndWaitLoginStep.php | 131 ++++ .../DisplayAndWaitLoginStep/Display.php | 40 + .../Display/CodeLoginDisplay.php | 77 ++ .../Display/EmojiLoginDisplay.php | 77 ++ .../Display/EmptyLoginDisplay.php | 48 ++ .../Display/QRCodeLoginDisplay.php | 77 ++ .../CurrentStep/UserInputLoginStep.php | 146 ++++ src/Bridges/LoginSession/Status.php | 20 + .../LoginSessionCancelParams.php | 74 ++ .../LoginSessionCancelResponse.php | 91 +++ .../LoginSessionCreateParams.php | 101 +++ .../LoginSessionRetrieveParams.php | 74 ++ .../LoginSessions/Steps/StepSubmitParams.php | 194 +++++ .../Steps/StepSubmitParams/Source.php | 17 + .../Steps/StepSubmitParams/Type.php | 14 + src/Bridges/Logins/LoginListResponse.php | 73 ++ src/Bridges/Logins/LoginRemoveParams.php | 101 +++ .../Logins/LoginRemoveParams/Scope.php | 15 + src/Bridges/Logins/LoginRemoveResponse.php | 143 ++++ .../Logins/LoginRemoveResponse/Scope.php | 15 + src/Bridges/Logins/LoginRetrieveParams.php | 74 ++ src/Bridges/ProvisioningCapabilities.php | 118 +++ src/Bridges/ResolveIdentifierCapabilities.php | 166 ++++ src/ChatCapabilities.php | 664 ++++++++++++++++ src/ChatCapabilities/Delete.php | 21 + src/ChatCapabilities/DisappearingTimer.php | 111 +++ .../DisappearingTimer/Type.php | 14 + src/ChatCapabilities/Edit.php | 21 + src/ChatCapabilities/Formatting.php | 21 + src/ChatCapabilities/LocationMessage.php | 21 + src/ChatCapabilities/MessageRequest.php | 94 +++ .../MessageRequest/AcceptWithButton.php | 21 + .../MessageRequest/AcceptWithMessage.php | 21 + src/ChatCapabilities/ParticipantActions.php | 170 +++++ .../ParticipantActions/Ban.php | 21 + .../ParticipantActions/Invite.php | 21 + .../ParticipantActions/Kick.php | 21 + .../ParticipantActions/Leave.php | 21 + .../ParticipantActions/RevokeInvite.php | 21 + src/ChatCapabilities/Poll.php | 21 + src/ChatCapabilities/Reaction.php | 21 + src/ChatCapabilities/Reply.php | 21 + src/ChatCapabilities/Thread.php | 21 + src/ChatDraft.php | 101 +++ src/ChatStateCapabilities.php | 142 ++++ src/ChatStateCapabilities/Avatar.php | 77 ++ src/ChatStateCapabilities/Avatar/Level.php | 21 + src/ChatStateCapabilities/Description.php | 77 ++ .../Description/Level.php | 21 + .../DisappearingTimer.php | 77 ++ .../DisappearingTimer/Level.php | 21 + src/ChatStateCapabilities/Title.php | 77 ++ src/ChatStateCapabilities/Title/Level.php | 21 + src/Chats/Chat.php | 338 ++++++++- src/Chats/Chat/Merge.php | 100 +++ src/Chats/Chat/Participants.php | 14 +- src/Chats/Chat/Participants/Item.php | 275 +++++++ src/Chats/Chat/Reminder.php | 79 ++ src/Chats/Chat/Snooze.php | 78 ++ src/Chats/ChatArchiveParams.php | 2 +- src/Chats/ChatCreateParams.php | 126 +++- src/Chats/ChatCreateParams/Chat.php | 237 ------ src/Chats/ChatCreateParams/Chat/Mode.php | 15 - src/Chats/ChatCreateParams/Chat/Type.php | 15 - src/Chats/ChatCreateParams/Type.php | 15 + src/Chats/ChatListParams.php | 20 + src/Chats/ChatListResponse.php | 340 ++++++++- src/Chats/ChatMarkReadParams.php | 60 ++ src/Chats/ChatMarkUnreadParams.php | 60 ++ src/Chats/ChatNewResponse.php | 623 +++++++++++++++- src/Chats/ChatNewResponse/Status.php | 4 +- src/Chats/ChatRetrieveParams.php | 6 +- src/Chats/ChatSearchParams.php | 42 +- src/Chats/ChatSearchParams/Inbox.php | 2 +- src/Chats/ChatStartParams.php | 146 ++++ .../Chat => ChatStartParams}/User.php | 4 +- src/Chats/ChatStartResponse.php | 706 ++++++++++++++++++ src/Chats/ChatStartResponse/Status.php | 17 + src/Chats/ChatUpdateParams.php | 230 ++++++ src/Chats/ChatUpdateParams/Draft.php | 101 +++ .../ChatUpdateParams/Draft/Attachment.php | 206 +++++ .../Draft/Attachment/Size.php | 76 ++ .../Draft/Attachment/Type.php | 25 + .../Messages/Reactions/ReactionAddParams.php | 8 +- .../Reactions/ReactionAddResponse.php | 12 +- .../Reactions/ReactionDeleteParams.php | 26 +- .../Reactions/ReactionDeleteResponse.php | 8 +- .../ReminderCreateParams/Reminder.php | 20 +- src/Client.php | 96 ++- src/Core/Attributes/Required.php | 17 +- src/Core/BaseClient.php | 11 +- src/Core/Conversion.php | 50 ++ src/Core/Conversion/EnumOf.php | 15 +- src/Core/FileParam.php | 63 ++ .../Implementation/StreamingHttpClient.php | 29 + src/Core/Util.php | 72 +- src/CursorNoLimit.php | 212 +++--- src/CursorSearch.php | 212 +++--- src/CursorSortKey.php | 113 --- src/CursorSortKey/Item.php | 48 -- src/DraftAttachment.php | 246 ++++++ src/DraftAttachment/Size.php | 62 ++ src/DraftAttachment/Type.php | 17 + src/Info/InfoGetResponse/Server.php | 4 +- src/Labels/Label.php | 88 +++ src/LinkPreview.php | 202 +++++ src/LinkPreview/ImgSize.php | 62 ++ src/Message.php | 180 ++++- src/Message/Seen.php | 34 + src/Message/Seen/MessageSeenByParticipant.php | 28 + src/Messages/MessageDeleteParams.php | 96 +++ src/Messages/MessageRetrieveParams.php | 74 ++ src/Messages/MessageSearchParams.php | 20 +- src/Messages/MessageSearchParams/Sender.php | 15 - src/Messages/MessageSendParams.php | 4 +- src/Messages/MessageSendParams/Attachment.php | 4 +- .../MessageSendParams/Attachment/Type.php | 12 +- src/Messages/MessageSendResponse.php | 8 +- src/Messages/MessageUpdateParams.php | 4 +- src/Messages/MessageUpdateResponse.php | 492 +++++++++++- src/Reaction.php | 8 +- src/RequestOptions.php | 17 + src/SendStatus.php | 187 +++++ src/SendStatus/Status.php | 19 + .../Accounts/ContactsContract.php | 4 +- src/ServiceContracts/AccountsContract.php | 14 + src/ServiceContracts/AccountsRawContract.php | 16 + .../App/Setup/RecoveryKey/ResetContract.php | 42 ++ .../Setup/RecoveryKey/ResetRawContract.php | 49 ++ .../App/Setup/RecoveryKeyContract.php | 28 + .../App/Setup/RecoveryKeyRawContract.php | 32 + .../App/Setup/Verifications/QRContract.php | 42 ++ .../App/Setup/Verifications/QRRawContract.php | 48 ++ .../App/Setup/Verifications/SASContract.php | 42 ++ .../Setup/Verifications/SASRawContract.php | 47 ++ .../App/Setup/VerificationsContract.php | 89 +++ .../App/Setup/VerificationsRawContract.php | 97 +++ src/ServiceContracts/App/SetupContract.php | 90 +++ src/ServiceContracts/App/SetupRawContract.php | 94 +++ src/ServiceContracts/AppContract.php | 7 + src/ServiceContracts/AppRawContract.php | 7 + src/ServiceContracts/AssetsContract.php | 11 +- src/ServiceContracts/AssetsRawContract.php | 2 +- .../BeeperDesktopClientContract.php | 6 +- .../Bridges/LoginFlowsContract.php | 28 + .../Bridges/LoginFlowsRawContract.php | 31 + .../Bridges/LoginSessions/StepsContract.php | 42 ++ .../LoginSessions/StepsRawContract.php | 34 + .../Bridges/LoginSessionsContract.php | 65 ++ .../Bridges/LoginSessionsRawContract.php | 71 ++ .../Bridges/LoginsContract.php | 63 ++ .../Bridges/LoginsRawContract.php | 69 ++ src/ServiceContracts/BridgesContract.php | 54 ++ src/ServiceContracts/BridgesRawContract.php | 61 ++ .../Chats/Messages/ReactionsContract.php | 16 +- .../Chats/Messages/ReactionsRawContract.php | 6 +- .../Chats/RemindersContract.php | 4 +- .../Chats/RemindersRawContract.php | 4 +- src/ServiceContracts/ChatsContract.php | 147 +++- src/ServiceContracts/ChatsRawContract.php | 90 ++- src/ServiceContracts/LabelsContract.php | 28 + src/ServiceContracts/LabelsRawContract.php | 29 + src/ServiceContracts/MessagesContract.php | 55 +- src/ServiceContracts/MessagesRawContract.php | 46 +- src/Services/Accounts/ContactsRawService.php | 2 +- src/Services/Accounts/ContactsService.php | 6 +- src/Services/AccountsRawService.php | 28 +- src/Services/AccountsService.php | 23 +- .../App/Setup/RecoveryKey/ResetRawService.php | 91 +++ .../App/Setup/RecoveryKey/ResetService.php | 80 ++ .../App/Setup/RecoveryKeyRawService.php | 58 ++ src/Services/App/Setup/RecoveryKeyService.php | 62 ++ .../App/Setup/Verifications/QRRawService.php | 86 +++ .../App/Setup/Verifications/QRService.php | 76 ++ .../App/Setup/Verifications/SASRawService.php | 77 ++ .../App/Setup/Verifications/SASService.php | 73 ++ .../App/Setup/VerificationsRawService.php | 172 +++++ .../App/Setup/VerificationsService.php | 160 ++++ src/Services/App/SetupRawService.php | 184 +++++ src/Services/App/SetupService.php | 174 +++++ src/Services/AppRawService.php | 20 + src/Services/AppService.php | 34 + src/Services/AssetsRawService.php | 16 +- src/Services/AssetsService.php | 19 +- .../BeeperDesktopClientRawService.php | 6 +- src/Services/BeeperDesktopClientService.php | 12 +- src/Services/Bridges/LoginFlowsRawService.php | 51 ++ src/Services/Bridges/LoginFlowsService.php | 52 ++ .../Bridges/LoginSessions/StepsRawService.php | 81 ++ .../Bridges/LoginSessions/StepsService.php | 78 ++ .../Bridges/LoginSessionsRawService.php | 133 ++++ src/Services/Bridges/LoginSessionsService.php | 119 +++ src/Services/Bridges/LoginsRawService.php | 127 ++++ src/Services/Bridges/LoginsService.php | 106 +++ src/Services/BridgesRawService.php | 101 +++ src/Services/BridgesService.php | 113 +++ .../Chats/Messages/ReactionsRawService.php | 20 +- .../Chats/Messages/ReactionsService.php | 22 +- src/Services/Chats/RemindersRawService.php | 8 +- src/Services/Chats/RemindersService.php | 8 +- src/Services/ChatsRawService.php | 218 +++++- src/Services/ChatsService.php | 229 +++++- src/Services/InfoRawService.php | 5 +- src/Services/InfoService.php | 4 +- src/Services/LabelsRawService.php | 50 ++ src/Services/LabelsService.php | 52 ++ src/Services/MessagesRawService.php | 90 ++- src/Services/MessagesService.php | 77 +- src/User.php | 4 +- src/Version.php | 2 +- tests/Core/StreamingTransportTest.php | 122 +++ tests/Services/AccountsTest.php | 10 + .../App/Setup/RecoveryKey/ResetTest.php | 61 ++ tests/Services/App/Setup/RecoveryKeyTest.php | 47 ++ .../App/Setup/Verifications/QRTest.php | 57 ++ .../App/Setup/Verifications/SASTest.php | 48 ++ .../Services/App/Setup/VerificationsTest.php | 78 ++ tests/Services/App/SetupTest.php | 124 +++ tests/Services/AssetsTest.php | 13 +- tests/Services/Bridges/LoginFlowsTest.php | 38 + .../Bridges/LoginSessions/StepsTest.php | 60 ++ tests/Services/Bridges/LoginSessionsTest.php | 87 +++ tests/Services/Bridges/LoginsTest.php | 90 +++ tests/Services/BridgesTest.php | 58 ++ .../Services/Chats/Messages/ReactionsTest.php | 12 +- tests/Services/Chats/RemindersTest.php | 9 +- tests/Services/ChatsTest.php | 97 ++- tests/Services/LabelsTest.php | 37 + tests/Services/MessagesTest.php | 57 +- 736 files changed, 62378 insertions(+), 1219 deletions(-) create mode 100644 .stdy.log create mode 100644 src/APIError.php create mode 100644 src/Accounts/Account/Status.php create mode 100644 src/Accounts/AccountBridge.php create mode 100644 src/Accounts/AccountBridge/Provider.php create mode 100644 src/Accounts/AccountGetResponse.php create mode 100644 src/Accounts/AccountGetResponse/Status.php create mode 100644 src/App/RecoveryKeyResetResponse.php create mode 100644 src/App/RecoveryKeyResetResponse/Session.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/E2EE.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/E2EE/Secrets.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Matrix.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/State.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/Direction.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/Error.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/Method.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/Purpose.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/QR.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/SAS.php create mode 100644 src/App/RecoveryKeyResetResponse/Session/Verification/State.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyParams.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/E2EE.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Matrix.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/State.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/State.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmParams.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/E2EE.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Matrix.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/State.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/State.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetCreateParams.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/E2EE.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Matrix.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/State.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/State.php create mode 100644 src/App/Setup/SetupEmailParams.php create mode 100644 src/App/Setup/SetupGetResponse.php create mode 100644 src/App/Setup/SetupGetResponse/E2EE.php create mode 100644 src/App/Setup/SetupGetResponse/E2EE/Secrets.php create mode 100644 src/App/Setup/SetupGetResponse/Matrix.php create mode 100644 src/App/Setup/SetupGetResponse/State.php create mode 100644 src/App/Setup/SetupGetResponse/Verification.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/Direction.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/Error.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/Method.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/Purpose.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/QR.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/SAS.php create mode 100644 src/App/Setup/SetupGetResponse/Verification/State.php create mode 100644 src/App/Setup/SetupRegisterParams.php create mode 100644 src/App/Setup/SetupRegisterResponse.php create mode 100644 src/App/Setup/SetupRegisterResponse/Matrix.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/E2EE.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Matrix.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/State.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/SetupRegisterResponse/Session/Verification/State.php create mode 100644 src/App/Setup/SetupResponseParams.php create mode 100644 src/App/Setup/SetupResponseResponse.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Matrix.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/E2EE.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Matrix.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/State.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/State.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupRegistrationRequiredResponse.php create mode 100644 src/App/Setup/SetupResponseResponse/AppSetupRegistrationRequiredResponse/Copy.php create mode 100644 src/App/Setup/SetupStartResponse.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/E2EE.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Matrix.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/State.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/State.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Error.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Method.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/QR.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/State.php create mode 100644 src/App/Setup/Verifications/QR/QRScanParams.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/E2EE.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Matrix.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/State.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/State.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/Error.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/Method.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/QR.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/QR/QRScanResponse/Verification/State.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/E2EE.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Matrix.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/State.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/State.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Error.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Method.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/QR.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/State.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/E2EE.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Matrix.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/State.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/State.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Error.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Method.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/QR.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/SAS/SASStartResponse/Verification/State.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/E2EE.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Matrix.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/State.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/State.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Error.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Method.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/QR.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationAcceptResponse/Verification/State.php create mode 100644 src/App/Setup/Verifications/VerificationCancelParams.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/E2EE.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Matrix.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/State.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/State.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/Error.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/Method.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/QR.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationCancelResponse/Verification/State.php create mode 100644 src/App/Setup/Verifications/VerificationCreateParams.php create mode 100644 src/App/Setup/Verifications/VerificationCreateParams/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/E2EE.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Matrix.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/State.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/State.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/Error.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/Method.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/QR.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationGetResponse/Verification/State.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/Error.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/Method.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/QR.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationListResponse/Item/State.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/E2EE.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/E2EE/Secrets.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Matrix.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/State.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Error.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Method.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/QR.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/State.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/AvailableAction.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/Direction.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/Error.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/Method.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/OtherDevice.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/Purpose.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/QR.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/SAS.php create mode 100644 src/App/Setup/Verifications/VerificationNewResponse/Verification/State.php create mode 100644 src/App/SetupCompleteResponse.php create mode 100644 src/App/SetupCompleteResponse/Matrix.php create mode 100644 src/App/SetupCompleteResponse/Session.php create mode 100644 src/App/SetupCompleteResponse/Session/E2EE.php create mode 100644 src/App/SetupCompleteResponse/Session/E2EE/Secrets.php create mode 100644 src/App/SetupCompleteResponse/Session/Matrix.php create mode 100644 src/App/SetupCompleteResponse/Session/State.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/Direction.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/Error.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/Method.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/Purpose.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/QR.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/SAS.php create mode 100644 src/App/SetupCompleteResponse/Session/Verification/State.php create mode 100644 src/App/SetupRegistrationRequiredResponse.php create mode 100644 src/App/SetupRegistrationRequiredResponse/Copy.php create mode 100644 src/App/SetupResponseOutput.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Matrix.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/E2EE.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/E2EE/Secrets.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Matrix.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/State.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Direction.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Error.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Method.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Purpose.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/QR.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/SAS.php create mode 100644 src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/State.php create mode 100644 src/App/SetupResponseOutput/AppSetupRegistrationRequiredResponse.php create mode 100644 src/App/SetupResponseOutput/AppSetupRegistrationRequiredResponse/Copy.php create mode 100644 src/App/SetupStateResponse.php create mode 100644 src/App/SetupStateResponse/Session.php create mode 100644 src/App/SetupStateResponse/Session/E2EE.php create mode 100644 src/App/SetupStateResponse/Session/E2EE/Secrets.php create mode 100644 src/App/SetupStateResponse/Session/Matrix.php create mode 100644 src/App/SetupStateResponse/Session/State.php create mode 100644 src/App/SetupStateResponse/Session/Verification.php create mode 100644 src/App/SetupStateResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/SetupStateResponse/Session/Verification/Direction.php create mode 100644 src/App/SetupStateResponse/Session/Verification/Error.php create mode 100644 src/App/SetupStateResponse/Session/Verification/Method.php create mode 100644 src/App/SetupStateResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/SetupStateResponse/Session/Verification/Purpose.php create mode 100644 src/App/SetupStateResponse/Session/Verification/QR.php create mode 100644 src/App/SetupStateResponse/Session/Verification/SAS.php create mode 100644 src/App/SetupStateResponse/Session/Verification/State.php create mode 100644 src/App/Verification.php create mode 100644 src/App/Verification/AvailableAction.php create mode 100644 src/App/Verification/Direction.php create mode 100644 src/App/Verification/Error.php create mode 100644 src/App/Verification/Method.php create mode 100644 src/App/Verification/OtherDevice.php create mode 100644 src/App/Verification/Purpose.php create mode 100644 src/App/Verification/QR.php create mode 100644 src/App/Verification/SAS.php create mode 100644 src/App/Verification/State.php create mode 100644 src/App/VerificationResponse.php create mode 100644 src/App/VerificationResponse/Session.php create mode 100644 src/App/VerificationResponse/Session/E2EE.php create mode 100644 src/App/VerificationResponse/Session/E2EE/Secrets.php create mode 100644 src/App/VerificationResponse/Session/Matrix.php create mode 100644 src/App/VerificationResponse/Session/State.php create mode 100644 src/App/VerificationResponse/Session/Verification.php create mode 100644 src/App/VerificationResponse/Session/Verification/AvailableAction.php create mode 100644 src/App/VerificationResponse/Session/Verification/Direction.php create mode 100644 src/App/VerificationResponse/Session/Verification/Error.php create mode 100644 src/App/VerificationResponse/Session/Verification/Method.php create mode 100644 src/App/VerificationResponse/Session/Verification/OtherDevice.php create mode 100644 src/App/VerificationResponse/Session/Verification/Purpose.php create mode 100644 src/App/VerificationResponse/Session/Verification/QR.php create mode 100644 src/App/VerificationResponse/Session/Verification/SAS.php create mode 100644 src/App/VerificationResponse/Session/Verification/State.php create mode 100644 src/App/VerificationResponse/Verification.php create mode 100644 src/App/VerificationResponse/Verification/AvailableAction.php create mode 100644 src/App/VerificationResponse/Verification/Direction.php create mode 100644 src/App/VerificationResponse/Verification/Error.php create mode 100644 src/App/VerificationResponse/Verification/Method.php create mode 100644 src/App/VerificationResponse/Verification/OtherDevice.php create mode 100644 src/App/VerificationResponse/Verification/Purpose.php create mode 100644 src/App/VerificationResponse/Verification/QR.php create mode 100644 src/App/VerificationResponse/Verification/SAS.php create mode 100644 src/App/VerificationResponse/Verification/State.php create mode 100644 src/AppStateSnapshot.php create mode 100644 src/AppStateSnapshot/E2EE.php create mode 100644 src/AppStateSnapshot/E2EE/Secrets.php create mode 100644 src/AppStateSnapshot/Matrix.php create mode 100644 src/AppStateSnapshot/State.php create mode 100644 src/AppStateSnapshot/Verification.php create mode 100644 src/AppStateSnapshot/Verification/AvailableAction.php create mode 100644 src/AppStateSnapshot/Verification/Direction.php create mode 100644 src/AppStateSnapshot/Verification/Error.php create mode 100644 src/AppStateSnapshot/Verification/Method.php create mode 100644 src/AppStateSnapshot/Verification/OtherDevice.php create mode 100644 src/AppStateSnapshot/Verification/Purpose.php create mode 100644 src/AppStateSnapshot/Verification/QR.php create mode 100644 src/AppStateSnapshot/Verification/SAS.php create mode 100644 src/AppStateSnapshot/Verification/State.php create mode 100644 src/Attachment/Transcription.php create mode 100644 src/AttachmentCapabilities.php create mode 100644 src/AttachmentCapabilities/Caption.php create mode 100644 src/AttachmentCapabilities/MimeType.php create mode 100644 src/Bridges/Bridge.php create mode 100644 src/Bridges/Bridge/Provider.php create mode 100644 src/Bridges/Bridge/Status.php create mode 100644 src/Bridges/BridgeGetResponse.php create mode 100644 src/Bridges/BridgeGetResponse/Provider.php create mode 100644 src/Bridges/BridgeGetResponse/Status.php create mode 100644 src/Bridges/BridgeListResponse.php create mode 100644 src/Bridges/BridgeLogin.php create mode 100644 src/Bridges/BridgeLogin/RemoveScope.php create mode 100644 src/Bridges/BridgeLogin/Status.php create mode 100644 src/Bridges/CookieField.php create mode 100644 src/Bridges/CookieField/Type.php create mode 100644 src/Bridges/DisappearingTimerCapability.php create mode 100644 src/Bridges/DisappearingTimerCapability/Type.php create mode 100644 src/Bridges/GroupFieldCapability.php create mode 100644 src/Bridges/GroupTypeCapabilities.php create mode 100644 src/Bridges/LoginFlow.php create mode 100644 src/Bridges/LoginFlows/LoginFlowListResponse.php create mode 100644 src/Bridges/LoginInputField.php create mode 100644 src/Bridges/LoginSession.php create mode 100644 src/Bridges/LoginSession/CurrentStep.php create mode 100644 src/Bridges/LoginSession/CurrentStep/CompleteLoginStep.php create mode 100644 src/Bridges/LoginSession/CurrentStep/CookiesLoginStep.php create mode 100644 src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep.php create mode 100644 src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display.php create mode 100644 src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/CodeLoginDisplay.php create mode 100644 src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/EmojiLoginDisplay.php create mode 100644 src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/EmptyLoginDisplay.php create mode 100644 src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/QRCodeLoginDisplay.php create mode 100644 src/Bridges/LoginSession/CurrentStep/UserInputLoginStep.php create mode 100644 src/Bridges/LoginSession/Status.php create mode 100644 src/Bridges/LoginSessions/LoginSessionCancelParams.php create mode 100644 src/Bridges/LoginSessions/LoginSessionCancelResponse.php create mode 100644 src/Bridges/LoginSessions/LoginSessionCreateParams.php create mode 100644 src/Bridges/LoginSessions/LoginSessionRetrieveParams.php create mode 100644 src/Bridges/LoginSessions/Steps/StepSubmitParams.php create mode 100644 src/Bridges/LoginSessions/Steps/StepSubmitParams/Source.php create mode 100644 src/Bridges/LoginSessions/Steps/StepSubmitParams/Type.php create mode 100644 src/Bridges/Logins/LoginListResponse.php create mode 100644 src/Bridges/Logins/LoginRemoveParams.php create mode 100644 src/Bridges/Logins/LoginRemoveParams/Scope.php create mode 100644 src/Bridges/Logins/LoginRemoveResponse.php create mode 100644 src/Bridges/Logins/LoginRemoveResponse/Scope.php create mode 100644 src/Bridges/Logins/LoginRetrieveParams.php create mode 100644 src/Bridges/ProvisioningCapabilities.php create mode 100644 src/Bridges/ResolveIdentifierCapabilities.php create mode 100644 src/ChatCapabilities.php create mode 100644 src/ChatCapabilities/Delete.php create mode 100644 src/ChatCapabilities/DisappearingTimer.php create mode 100644 src/ChatCapabilities/DisappearingTimer/Type.php create mode 100644 src/ChatCapabilities/Edit.php create mode 100644 src/ChatCapabilities/Formatting.php create mode 100644 src/ChatCapabilities/LocationMessage.php create mode 100644 src/ChatCapabilities/MessageRequest.php create mode 100644 src/ChatCapabilities/MessageRequest/AcceptWithButton.php create mode 100644 src/ChatCapabilities/MessageRequest/AcceptWithMessage.php create mode 100644 src/ChatCapabilities/ParticipantActions.php create mode 100644 src/ChatCapabilities/ParticipantActions/Ban.php create mode 100644 src/ChatCapabilities/ParticipantActions/Invite.php create mode 100644 src/ChatCapabilities/ParticipantActions/Kick.php create mode 100644 src/ChatCapabilities/ParticipantActions/Leave.php create mode 100644 src/ChatCapabilities/ParticipantActions/RevokeInvite.php create mode 100644 src/ChatCapabilities/Poll.php create mode 100644 src/ChatCapabilities/Reaction.php create mode 100644 src/ChatCapabilities/Reply.php create mode 100644 src/ChatCapabilities/Thread.php create mode 100644 src/ChatDraft.php create mode 100644 src/ChatStateCapabilities.php create mode 100644 src/ChatStateCapabilities/Avatar.php create mode 100644 src/ChatStateCapabilities/Avatar/Level.php create mode 100644 src/ChatStateCapabilities/Description.php create mode 100644 src/ChatStateCapabilities/Description/Level.php create mode 100644 src/ChatStateCapabilities/DisappearingTimer.php create mode 100644 src/ChatStateCapabilities/DisappearingTimer/Level.php create mode 100644 src/ChatStateCapabilities/Title.php create mode 100644 src/ChatStateCapabilities/Title/Level.php create mode 100644 src/Chats/Chat/Merge.php create mode 100644 src/Chats/Chat/Participants/Item.php create mode 100644 src/Chats/Chat/Reminder.php create mode 100644 src/Chats/Chat/Snooze.php delete mode 100644 src/Chats/ChatCreateParams/Chat.php delete mode 100644 src/Chats/ChatCreateParams/Chat/Mode.php delete mode 100644 src/Chats/ChatCreateParams/Chat/Type.php create mode 100644 src/Chats/ChatCreateParams/Type.php create mode 100644 src/Chats/ChatMarkReadParams.php create mode 100644 src/Chats/ChatMarkUnreadParams.php create mode 100644 src/Chats/ChatStartParams.php rename src/Chats/{ChatCreateParams/Chat => ChatStartParams}/User.php (94%) create mode 100644 src/Chats/ChatStartResponse.php create mode 100644 src/Chats/ChatStartResponse/Status.php create mode 100644 src/Chats/ChatUpdateParams.php create mode 100644 src/Chats/ChatUpdateParams/Draft.php create mode 100644 src/Chats/ChatUpdateParams/Draft/Attachment.php create mode 100644 src/Chats/ChatUpdateParams/Draft/Attachment/Size.php create mode 100644 src/Chats/ChatUpdateParams/Draft/Attachment/Type.php create mode 100644 src/Core/FileParam.php create mode 100644 src/Core/Implementation/StreamingHttpClient.php delete mode 100644 src/CursorSortKey.php delete mode 100644 src/CursorSortKey/Item.php create mode 100644 src/DraftAttachment.php create mode 100644 src/DraftAttachment/Size.php create mode 100644 src/DraftAttachment/Type.php create mode 100644 src/Labels/Label.php create mode 100644 src/LinkPreview.php create mode 100644 src/LinkPreview/ImgSize.php create mode 100644 src/Message/Seen.php create mode 100644 src/Message/Seen/MessageSeenByParticipant.php create mode 100644 src/Messages/MessageDeleteParams.php create mode 100644 src/Messages/MessageRetrieveParams.php delete mode 100644 src/Messages/MessageSearchParams/Sender.php create mode 100644 src/SendStatus.php create mode 100644 src/SendStatus/Status.php create mode 100644 src/ServiceContracts/App/Setup/RecoveryKey/ResetContract.php create mode 100644 src/ServiceContracts/App/Setup/RecoveryKey/ResetRawContract.php create mode 100644 src/ServiceContracts/App/Setup/RecoveryKeyContract.php create mode 100644 src/ServiceContracts/App/Setup/RecoveryKeyRawContract.php create mode 100644 src/ServiceContracts/App/Setup/Verifications/QRContract.php create mode 100644 src/ServiceContracts/App/Setup/Verifications/QRRawContract.php create mode 100644 src/ServiceContracts/App/Setup/Verifications/SASContract.php create mode 100644 src/ServiceContracts/App/Setup/Verifications/SASRawContract.php create mode 100644 src/ServiceContracts/App/Setup/VerificationsContract.php create mode 100644 src/ServiceContracts/App/Setup/VerificationsRawContract.php create mode 100644 src/ServiceContracts/App/SetupContract.php create mode 100644 src/ServiceContracts/App/SetupRawContract.php create mode 100644 src/ServiceContracts/AppContract.php create mode 100644 src/ServiceContracts/AppRawContract.php create mode 100644 src/ServiceContracts/Bridges/LoginFlowsContract.php create mode 100644 src/ServiceContracts/Bridges/LoginFlowsRawContract.php create mode 100644 src/ServiceContracts/Bridges/LoginSessions/StepsContract.php create mode 100644 src/ServiceContracts/Bridges/LoginSessions/StepsRawContract.php create mode 100644 src/ServiceContracts/Bridges/LoginSessionsContract.php create mode 100644 src/ServiceContracts/Bridges/LoginSessionsRawContract.php create mode 100644 src/ServiceContracts/Bridges/LoginsContract.php create mode 100644 src/ServiceContracts/Bridges/LoginsRawContract.php create mode 100644 src/ServiceContracts/BridgesContract.php create mode 100644 src/ServiceContracts/BridgesRawContract.php create mode 100644 src/ServiceContracts/LabelsContract.php create mode 100644 src/ServiceContracts/LabelsRawContract.php create mode 100644 src/Services/App/Setup/RecoveryKey/ResetRawService.php create mode 100644 src/Services/App/Setup/RecoveryKey/ResetService.php create mode 100644 src/Services/App/Setup/RecoveryKeyRawService.php create mode 100644 src/Services/App/Setup/RecoveryKeyService.php create mode 100644 src/Services/App/Setup/Verifications/QRRawService.php create mode 100644 src/Services/App/Setup/Verifications/QRService.php create mode 100644 src/Services/App/Setup/Verifications/SASRawService.php create mode 100644 src/Services/App/Setup/Verifications/SASService.php create mode 100644 src/Services/App/Setup/VerificationsRawService.php create mode 100644 src/Services/App/Setup/VerificationsService.php create mode 100644 src/Services/App/SetupRawService.php create mode 100644 src/Services/App/SetupService.php create mode 100644 src/Services/AppRawService.php create mode 100644 src/Services/AppService.php create mode 100644 src/Services/Bridges/LoginFlowsRawService.php create mode 100644 src/Services/Bridges/LoginFlowsService.php create mode 100644 src/Services/Bridges/LoginSessions/StepsRawService.php create mode 100644 src/Services/Bridges/LoginSessions/StepsService.php create mode 100644 src/Services/Bridges/LoginSessionsRawService.php create mode 100644 src/Services/Bridges/LoginSessionsService.php create mode 100644 src/Services/Bridges/LoginsRawService.php create mode 100644 src/Services/Bridges/LoginsService.php create mode 100644 src/Services/BridgesRawService.php create mode 100644 src/Services/BridgesService.php create mode 100644 src/Services/LabelsRawService.php create mode 100644 src/Services/LabelsService.php create mode 100644 tests/Core/StreamingTransportTest.php create mode 100644 tests/Services/App/Setup/RecoveryKey/ResetTest.php create mode 100644 tests/Services/App/Setup/RecoveryKeyTest.php create mode 100644 tests/Services/App/Setup/Verifications/QRTest.php create mode 100644 tests/Services/App/Setup/Verifications/SASTest.php create mode 100644 tests/Services/App/Setup/VerificationsTest.php create mode 100644 tests/Services/App/SetupTest.php create mode 100644 tests/Services/Bridges/LoginFlowsTest.php create mode 100644 tests/Services/Bridges/LoginSessions/StepsTest.php create mode 100644 tests/Services/Bridges/LoginSessionsTest.php create mode 100644 tests/Services/Bridges/LoginsTest.php create mode 100644 tests/Services/BridgesTest.php create mode 100644 tests/Services/LabelsTest.php diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2509fdf..9b85ac7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/beeper-desktop-api-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -35,8 +34,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/beeper-desktop-api-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1332969..112e32b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "6.0.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 8ec4701..b369758 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1 @@ -configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/beeper%2Fbeeper-desktop-api-774bb08472b6bb14c280fe5b767925675516b5c8ccc0b89b5abd7ac7bc30fe5a.yml -openapi_spec_hash: ddd1ce1f334b45206ac008b0f5296842 -config_hash: b5ac0c1579dfe6257bcdb84cfd1002fc +configured_endpoints: 60 diff --git a/.stdy.log b/.stdy.log new file mode 100644 index 0000000..d71b97f --- /dev/null +++ b/.stdy.log @@ -0,0 +1,102 @@ +Steady - Beeper Client API v5.0.0 + +warning[E1017]: 304 response on GET /v1/assets/serve has no Location header. HTTP redirects require Location per RFC 9110 + --> #/paths/~1v1~1assets~1serve/get/responses/304 + = Add a Location header with an example value, e.g. headers: { Location: { schema: { type: string }, example: '/resource/123' } }. Without one, Steady redirects to /_x-steady/redirected. + +info[E1015]: exclusiveMinimum is a boolean but OpenAPI 3.1.0 expects a number + --> #/paths/~1v1~1messages~1search/get/parameters/10/schema + = Steady handles this, but other tools may not. In 3.1.x, use exclusiveMinimum: as a standalone bound +For details, try: steady explain E1017 E1015 + +Loaded: 60/60 endpoints (49ms) (1 warning, 1 info) +Ready to accept requests on http://127.0.0.1:4010 (reject-on-sdk-error) + +[8:12:21 PM] GET /v1/accounts/accountID/contacts/list?limit=50 → 200 OK (5ms) [91 bytes] +[8:12:21 PM] GET /v1/accounts/accountID/contacts?query=x → 200 OK (1ms) [28 bytes] +[8:12:21 PM] GET /v1/accounts/accountID/contacts?query=x → 200 OK (0ms) [28 bytes] +[8:12:21 PM] GET /v1/accounts/accountID → 200 OK (1ms) [140 bytes] +[8:12:21 PM] GET /v1/accounts → 200 OK (0ms) [1198 bytes] +[8:12:21 PM] POST /v1/app/setup/verification/recovery-key/reset → 200 OK (1ms) [324 bytes] +[8:12:21 PM] POST /v1/app/setup/verification/recovery-key/reset/confirm → 200 OK (1ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verification/recovery-key/reset/confirm → 200 OK (1ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verification/recovery-key → 200 OK (1ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verification/recovery-key → 200 OK (1ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verifications/x/qr/confirm-scanned → 200 OK (0ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verifications/qr/scan → 200 OK (0ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verifications/qr/scan → 200 OK (0ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verifications/x/sas/confirm → 200 OK (0ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verifications/x/sas/start → 200 OK (0ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verifications → 200 OK (1ms) [310 bytes] +[8:12:21 PM] GET /v1/app/setup/verifications/x → 200 OK (0ms) [310 bytes] +[8:12:21 PM] GET /v1/app/setup/verifications → 200 OK (0ms) [141 bytes] +[8:12:21 PM] POST /v1/app/setup/verifications/x/accept → 200 OK (0ms) [310 bytes] +[8:12:21 PM] POST /v1/app/setup/verifications/x/cancel → 200 OK (0ms) [310 bytes] +[8:12:21 PM] GET /v1/app/setup → 200 OK (0ms) [298 bytes] +[8:12:21 PM] POST /v1/app/setup/email → 204 No Content (0ms) [4 bytes] +[8:12:21 PM] POST /v1/app/setup/email → 204 No Content (0ms) [4 bytes] +[8:12:21 PM] POST /v1/app/setup/register → 200 OK (0ms) [401 bytes] +[8:12:21 PM] POST /v1/app/setup/register → 200 OK (0ms) [401 bytes] +[8:12:21 PM] POST /v1/app/setup/response → 200 OK (0ms) [401 bytes] +[8:12:21 PM] POST /v1/app/setup/response → 200 OK (0ms) [401 bytes] +[8:12:21 PM] POST /v1/app/setup/start → 200 OK (0ms) [48 bytes] +[8:12:21 PM] POST /v1/assets/download → 200 OK (0ms) [2 bytes] +[8:12:21 PM] POST /v1/assets/download → 200 OK (0ms) [2 bytes] +[8:12:21 PM] GET /v1/assets/serve?url=x → 200 OK (0ms) [4 bytes] +[8:12:21 PM] GET /v1/assets/serve?url=x → 200 OK (0ms) [4 bytes] +[8:12:21 PM] POST /v1/assets/upload → 200 OK (2ms) [2 bytes] +[8:12:21 PM] POST /v1/assets/upload → 200 OK (1ms) [2 bytes] +[8:12:21 PM] POST /v1/assets/upload/base64 → 200 OK (0ms) [2 bytes] +[8:12:21 PM] POST /v1/assets/upload/base64 → 200 OK (0ms) [2 bytes] +[8:12:21 PM] POST /v1/focus → 200 OK (0ms) [17 bytes] +[8:12:21 PM] GET /v1/search?query=x → 200 OK (0ms) [3677 bytes] +[8:12:21 PM] GET /v1/search?query=x → 200 OK (0ms) [3677 bytes] +[8:12:21 PM] GET /v1/bridges/local-whatsapp/login-flows → 200 OK (0ms) [28 bytes] +[8:12:21 PM] POST /v1/bridges/local-whatsapp/login-sessions/123/steps/x → 200 OK (1ms) [78 bytes] +[8:12:21 PM] POST /v1/bridges/local-whatsapp/login-sessions/123/steps/x → 200 OK (0ms) [78 bytes] +[8:12:21 PM] POST /v1/bridges/local-whatsapp/login-sessions → 200 OK (0ms) [78 bytes] +[8:12:21 PM] GET /v1/bridges/local-whatsapp/login-sessions/123 → 200 OK (0ms) [78 bytes] +[8:12:21 PM] GET /v1/bridges/local-whatsapp/login-sessions/123 → 200 OK (0ms) [78 bytes] +[8:12:21 PM] DELETE /v1/bridges/local-whatsapp/login-sessions/123 → 200 OK (0ms) [68 bytes] +[8:12:21 PM] DELETE /v1/bridges/local-whatsapp/login-sessions/123 → 200 OK (0ms) [68 bytes] +[8:12:21 PM] GET /v1/bridges/local-whatsapp/logins/ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc → 200 OK (0ms) [93 bytes] +[8:12:21 PM] GET /v1/bridges/local-whatsapp/logins/ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc → 200 OK (0ms) [93 bytes] +[8:12:21 PM] GET /v1/bridges/local-whatsapp/logins → 200 OK (0ms) [109 bytes] +[8:12:21 PM] POST /v1/bridges/local-whatsapp/logins/ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc/remove → 200 OK (0ms) [81 bytes] +[8:12:21 PM] POST /v1/bridges/local-whatsapp/logins/ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc/remove → 200 OK (0ms) [81 bytes] +[8:12:21 PM] GET /v1/bridges/local-whatsapp → 200 OK (0ms) [292 bytes] +[8:12:21 PM] GET /v1/bridges → 200 OK (0ms) [302 bytes] +[8:12:21 PM] GET /v1/bridges/local-whatsapp/capabilities → 200 OK (0ms) [178 bytes] +[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993/reactions/x → 200 OK (0ms) [150 bytes] +[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993/reactions/x → 200 OK (0ms) [150 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993/reactions → 200 OK (0ms) [185 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993/reactions → 200 OK (0ms) [185 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/reminders → 204 No Content (0ms) [4 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/reminders → 204 No Content (0ms) [4 bytes] +[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/reminders → 204 No Content (0ms) [4 bytes] +[8:12:21 PM] POST /v1/chats → 200 OK (0ms) [937 bytes] +[8:12:21 PM] POST /v1/chats → 200 OK (0ms) [937 bytes] +[8:12:21 PM] GET /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com?maxParticipantCount=100 → 200 OK (0ms) [717 bytes] +[8:12:21 PM] PATCH /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com → 200 OK (0ms) [717 bytes] +[8:12:21 PM] GET /v1/chats?limit=25 → 200 OK (0ms) [806 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/archive → 204 No Content (0ms) [4 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/read → 200 OK (0ms) [717 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/unread → 200 OK (0ms) [717 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/notify-anyway → 200 OK (0ms) [717 bytes] +[8:12:21 PM] GET /v1/chats/search?includeMuted=true&limit=50&scope=titles&type=any → 200 OK (0ms) [2236 bytes] +[8:12:21 PM] POST /v1/chats/start → 200 OK (0ms) [937 bytes] +[8:12:21 PM] POST /v1/chats/start → 200 OK (0ms) [937 bytes] +[8:12:21 PM] GET /v1/info → 200 OK (0ms) [470 bytes] +[8:12:21 PM] GET /v1/labels → 200 OK (0ms) [35 bytes] +[8:12:21 PM] GET /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993 → 200 OK (0ms) [424 bytes] +[8:12:21 PM] GET /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993 → 200 OK (0ms) [424 bytes] +[8:12:21 PM] PUT /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993 → 200 OK (0ms) [423 bytes] +[8:12:21 PM] PUT /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993 → 200 OK (0ms) [423 bytes] +[8:12:21 PM] GET /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages → 200 OK (0ms) [499 bytes] +[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993?forEveryone=true → 204 No Content (0ms) [4 bytes] +[8:12:21 PM] DELETE /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages/1343993?forEveryone=true → 204 No Content (0ms) [4 bytes] +[8:12:21 PM] GET /v1/messages/search?excludeLowPriority=true&includeMuted=true&limit=20 → 200 OK (0ms) [2192 bytes] +[8:12:21 PM] POST /v1/chats/%21NCdzlIaMjZUmvmvyHU%3Abeeper.com/messages → 200 OK (0ms) [129 bytes] + +Session: 85 requests (100% structurally valid) +Coverage: 60/60 endpoints (100%) diff --git a/README.md b/README.md index b5d91b8..dbf8da9 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ To use this package, install via Composer by adding the following to your applic "repositories": [ { "type": "vcs", - "url": "git@github.com:beeper/desktop-api-php.git" + "url": "https://github.com/beeper/desktop-api-php.git" } ], "require": { - "beeper/desktop-api-php": "dev-main" + "beeper/desktop-api-php": "^6.0" } } ``` @@ -42,7 +42,14 @@ $client = new Client( accessToken: getenv('BEEPER_ACCESS_TOKEN') ?: 'My Access Token' ); -$page = $client->chats->search(includeMuted: true, limit: 3, type: 'single'); +$page = $client->chats->search( + accountIDs: [ + 'matrix', 'discordgo', 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc' + ], + includeMuted: true, + limit: 3, + type: 'single', +); var_dump($page->id); ``` @@ -70,9 +77,9 @@ $client = new Client( ); $page = $client->messages->search( - accountIDs: ['local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI'], + accountIDs: ['discordgo', 'local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc'], limit: 10, - query: 'deployment', + query: 'oauth', ); var_dump($page); @@ -147,6 +154,36 @@ $client = new Client(requestOptions: ['maxRetries' => 0]); $result = $client->accounts->list(requestOptions: ['maxRetries' => 5]); ``` +### File uploads + +Request parameters that correspond to file uploads can be passed as a resource returned by `fopen()`, a string of file contents, or a `FileParam` instance. + +```php +assets->upload( + file: FileParam::fromString($contents, filename: '/path/to/file', contentType: '…'), +); + +// Pass in only a string (where applicable) +$response = $client->assets->upload(file: '…'); + +// Pass an open resource: +$fd = fopen('/path/to/file', 'r'); +try { + $response = $client->assets->upload( + file: FileParam::fromResource($fd, filename: '/path/to/file', contentType: '…'), + ); +} finally { + fclose($fd); +} +``` + ## Advanced concepts ### Making custom or undocumented requests diff --git a/composer.json b/composer.json index 93480e2..c429851 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", + "guzzlehttp/guzzle": "^7", "nyholm/psr7": "^1", "pestphp/pest": "^3", "php-http/mock-client": "^1", diff --git a/composer.lock b/composer.lock index 3f6c209..b0e2283 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5fc63f7c84d94b42416689723c547f69", + "content-hash": "bbae64cb4d21c987158bc3723eda4226", "packages": [ { "name": "php-http/discovery", @@ -194,16 +194,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v7.8.4", + "version": "v7.8.5", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "130a9bf0e269ee5f5b320108f794ad03e275cad4" + "reference": "9b324c8fc319cf9728b581c7a90e1c8f6361c5e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/130a9bf0e269ee5f5b320108f794ad03e275cad4", - "reference": "130a9bf0e269ee5f5b320108f794ad03e275cad4", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/9b324c8fc319cf9728b581c7a90e1c8f6361c5e5", + "reference": "9b324c8fc319cf9728b581c7a90e1c8f6361c5e5", "shasum": "" }, "require": { @@ -211,27 +211,27 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^1.2.0", + "fidry/cpu-core-counter": "^1.3.0", "jean85/pretty-package-versions": "^2.1.1", - "php": "~8.2.0 || ~8.3.0 || ~8.4.0", - "phpunit/php-code-coverage": "^11.0.10", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "phpunit/php-code-coverage": "^11.0.12", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-timer": "^7.0.1", - "phpunit/phpunit": "^11.5.24", + "phpunit/phpunit": "^11.5.46", "sebastian/environment": "^7.2.1", - "symfony/console": "^6.4.22 || ^7.3.0", - "symfony/process": "^6.4.20 || ^7.3.0" + "symfony/console": "^6.4.22 || ^7.3.4 || ^8.0.3", + "symfony/process": "^6.4.20 || ^7.3.4 || ^8.0.3" }, "require-dev": { "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^2.1.17", + "phpstan/phpstan": "^2.1.33", "phpstan/phpstan-deprecation-rules": "^2.0.3", - "phpstan/phpstan-phpunit": "^2.0.6", - "phpstan/phpstan-strict-rules": "^2.0.4", - "squizlabs/php_codesniffer": "^3.13.2", - "symfony/filesystem": "^6.4.13 || ^7.3.0" + "phpstan/phpstan-phpunit": "^2.0.11", + "phpstan/phpstan-strict-rules": "^2.0.7", + "squizlabs/php_codesniffer": "^3.13.5", + "symfony/filesystem": "^6.4.13 || ^7.3.2 || ^8.0.1" }, "bin": [ "bin/paratest", @@ -271,7 +271,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.8.4" + "source": "https://github.com/paratestphp/paratest/tree/v7.8.5" }, "funding": [ { @@ -283,7 +283,7 @@ "type": "paypal" } ], - "time": "2025-06-23T06:07:21+00:00" + "time": "2026-01-08T08:02:38+00:00" }, { "name": "clue/ndjson-react", @@ -968,6 +968,332 @@ ], "time": "2026-01-08T21:57:37+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "7.10.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.10.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-08-23T22:36:01+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "481557b130ef3790cf82b713667b43030dc9c957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-08-22T14:34:08+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.9.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2026-03-10T16:41:02+00:00" + }, { "name": "jean85/pretty-package-versions", "version": "2.1.1", @@ -1412,38 +1738,38 @@ }, { "name": "pestphp/pest", - "version": "v3.8.4", + "version": "v3.8.5", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "72cf695554420e21858cda831d5db193db102574" + "reference": "7796630eafcfd1c02660cecdde3bc6984fbf01f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/72cf695554420e21858cda831d5db193db102574", - "reference": "72cf695554420e21858cda831d5db193db102574", + "url": "https://api.github.com/repos/pestphp/pest/zipball/7796630eafcfd1c02660cecdde3bc6984fbf01f4", + "reference": "7796630eafcfd1c02660cecdde3bc6984fbf01f4", "shasum": "" }, "require": { - "brianium/paratest": "^7.8.4", - "nunomaduro/collision": "^8.8.2", - "nunomaduro/termwind": "^2.3.1", + "brianium/paratest": "^7.8.5", + "nunomaduro/collision": "^8.8.3", + "nunomaduro/termwind": "^2.3.3", "pestphp/pest-plugin": "^3.0.0", "pestphp/pest-plugin-arch": "^3.1.1", "pestphp/pest-plugin-mutate": "^3.0.5", "php": "^8.2.0", - "phpunit/phpunit": "^11.5.33" + "phpunit/phpunit": "^11.5.50" }, "conflict": { "filp/whoops": "<2.16.0", - "phpunit/phpunit": ">11.5.33", + "phpunit/phpunit": ">11.5.50", "sebastian/exporter": "<6.0.0", "webmozart/assert": "<1.11.0" }, "require-dev": { "pestphp/pest-dev-tools": "^3.4.0", "pestphp/pest-plugin-type-coverage": "^3.6.1", - "symfony/process": "^7.3.0" + "symfony/process": "^7.4.4" }, "bin": [ "bin/pest" @@ -1508,7 +1834,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v3.8.4" + "source": "https://github.com/pestphp/pest/tree/v3.8.5" }, "funding": [ { @@ -1520,7 +1846,7 @@ "type": "github" } ], - "time": "2025-08-20T19:12:42+00:00" + "time": "2026-01-28T01:33:45+00:00" }, { "name": "pestphp/pest-plugin", @@ -2627,28 +2953,28 @@ }, { "name": "phpunit/php-file-iterator", - "version": "5.1.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", - "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/2f3a64888c814fc235386b7387dd5b5ed92ad903", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2676,15 +3002,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" } ], - "time": "2024-08-27T05:02:59+00:00" + "time": "2026-02-02T13:52:54+00:00" }, { "name": "phpunit/php-invoker", @@ -2872,16 +3210,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.33", + "version": "11.5.50", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5965e9ff57546cb9137c0ff6aa78cb7442b05cf6" + "reference": "fdfc727f0fcacfeb8fcb30c7e5da173125b58be3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5965e9ff57546cb9137c0ff6aa78cb7442b05cf6", - "reference": "5965e9ff57546cb9137c0ff6aa78cb7442b05cf6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fdfc727f0fcacfeb8fcb30c7e5da173125b58be3", + "reference": "fdfc727f0fcacfeb8fcb30c7e5da173125b58be3", "shasum": "" }, "require": { @@ -2895,17 +3233,17 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.10", + "phpunit/php-code-coverage": "^11.0.12", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", "phpunit/php-timer": "^7.0.1", "sebastian/cli-parser": "^3.0.2", "sebastian/code-unit": "^3.0.3", - "sebastian/comparator": "^6.3.2", + "sebastian/comparator": "^6.3.3", "sebastian/diff": "^6.0.2", "sebastian/environment": "^7.2.1", - "sebastian/exporter": "^6.3.0", + "sebastian/exporter": "^6.3.2", "sebastian/global-state": "^7.0.2", "sebastian/object-enumerator": "^6.0.1", "sebastian/type": "^5.1.3", @@ -2953,7 +3291,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.33" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.50" }, "funding": [ { @@ -2977,7 +3315,7 @@ "type": "tidelift" } ], - "time": "2025-08-16T05:19:02+00:00" + "time": "2026-01-27T05:59:18+00:00" }, { "name": "psr/container", @@ -3238,6 +3576,50 @@ }, "time": "2021-10-29T13:26:27+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "react/cache", "version": "v1.2.0", @@ -3936,16 +4318,16 @@ }, { "name": "sebastian/comparator", - "version": "6.3.2", + "version": "6.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "85c77556683e6eee4323e4c5468641ca0237e2e8" + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/85c77556683e6eee4323e4c5468641ca0237e2e8", - "reference": "85c77556683e6eee4323e4c5468641ca0237e2e8", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", "shasum": "" }, "require": { @@ -4004,7 +4386,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.2" + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.3" }, "funding": [ { @@ -4024,7 +4406,7 @@ "type": "tidelift" } ], - "time": "2025-08-10T08:07:46+00:00" + "time": "2026-01-24T09:26:40+00:00" }, { "name": "sebastian/complexity", diff --git a/scripts/mock b/scripts/mock index 0b28f6e..d961d45 100755 --- a/scripts/mock +++ b/scripts/mock @@ -7,35 +7,47 @@ cd "$(dirname "$0")/.." if [[ -n "$1" && "$1" != '--'* ]]; then URL="$1" shift +elif [ -n "$STAINLESS_OPENAPI_SPEC_URL" ]; then + URL="$STAINLESS_OPENAPI_SPEC_URL" else - URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" -fi - -# Check if the URL is empty -if [ -z "$URL" ]; then - echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" - exit 1 + # Embedded OpenAPI spec (base64-encoded, gzipped) + EMBEDDED_SPEC="H4sIAAAAAAAAA+y9y3Ikx5Io9isxNVfW5D1VhXc/QBvpoAF0EzyNBohH9yHZLXRUZlRVEFkZyYxMAEVOa6W9ttrItJHZ3d7VNe3nfol+QPoEmbtHZEY+qioLQD9I5NjMsFEZD48ID3cPf/7RUZEIeSQ7252N/lp/tdPtyHCoOtt/dBKZBKKz3XkuRCRithtIESZs5/ig0+1ciVhLFXa2O1v9VezlC+3FMkro10ofJjWjHx9pFiiPB+z7s7NjxkOfvRWDU+VdCmzYZVrEV8Jng6npwPaEvkxUhG3NT6fQJu6zo1AwniZjESbS4zA5GwbqGpuqUDBvzBOmxzwS7FrFl4x7sdKavR3zRO9EUZfJQ6E1H4kuOxOBGMV80mWnAfcuu+yQJ7G86bI9qT0V+112di2TRMQr/+yyUzkKedDFeSYqFv134bvQwCY1G6QySJgKWTIWZhymEx76HMbRimk1EUz6APZQiljjQLH0xiwRNwlLddbNU+EVNFOh7rMPkxtve2XlAzb/gNtofzk/eaXtiFM2oVWxifAl7zOzSBpcahaLJI1D4TOu81n77MPfY6UmH9hE8FAzcSXiKWyiDBlno1ilEe4nrvVf/5X9mErvUic8Tt6Fa33apisR45rxDGN2LZMx+/By/4ytXK2tAGJ96LOzsWC1+IHr6akwmLI0DITWOFSqRczGXDMR8kEgfBaLiUoE454ntO6/C9f7bCdHAUGT8tA0YIm6FCEbxmpSxicVF9GpC7/EaciOYLx1HFXF8nfCq13lm7GP/7G7z9LQN2vF1izho/67cKPPdnkQ5GvmnqfSMNEfWKKYFgLOMxReInzCTfu9C0OFeT/4qD+woaI50hDwxGcyHKgbewDZvXkX7tKoMMkH6H6tPxCseBh8AjvOYwAYd0MSZqbRKOa+YLH4LRU66bNzLRh37qNH55MApB4PmRahjz2LWzMW3IfbuDNMiucP7TX7EAvuTz90qfuHP951kmkk3nW233V0OsjIhu5rkbzrdN91YPEHe/pdZ/uXd53//K7zvvuuw6PoXWf7j3cdnfAEOidxKj5+xH2NhSfklbntaeTzRNCN0iJJI4Y97O+Efwa+WESBFNrgaREYau9/MCejk1jwiWYf8AqkkRYxfaUffBEI87e5e4U29re8Gd5gHkV9hC6bDc92TwQSLh9cCp70JkonPRV6AmGPBfwcKgSeT4HKxMJglRlWi98+QCNAbfNFqrDPTsRQJN6YXUluqC8eGGc+3N0Mg3A4TwaC+bEcJn12EMpE8oC5G2R2VWomJlEy/a68fVokHwhET2gWxeJKqlRTr+/YB3OwHwCtQpWwAdyMyUACUcLT0JHw5FB6dKgHe9pi/W5OEN+FPfiCi/bSWCsgpLFgKuK/pQKOTIYj6NhjZ3IidMInEbU4OD1iTx+vrplLIifidxWKLhM3nogSc6WHUgS+JuwHinweAhmHzfFpb09e7OLgx3wkQ7oKEjAEQfnAoiDV7IMvY9r/fxuIoYrFv+Omf8COp3g/iBozzj5EIvRlODLk+mDvw3csFloFV4LJpERNkUKs/EF35eOKwTC98sfE9v74AQjaNZcJ0pEqYrKMXmdXHsE6wjPkgd2BCZ/CAakJ8D+fXcN9SMPLUF2HffY6DQIgzOw6lomwXWC/PoRpEHwAHsNDJm6iQHoSaIrgMVORiHHHcMJ9xPZY6EiFWjCPxzFcyw//7BGB7hmS3XtDcscH4KFEnDQSpkQEAbseAyvjUcSMeMKiWPmpB3Qz6Xe6nUTEE300BGovPRBtxkkS6e2Vlevr6/4AZ+p7arKC7TrdjqfChHsJCEMhn+SyUKfbERMuAxhBBNHf866dbieNg5kjdz52O4H0RKiFM+hxrKJYioTH0wX9DWQfP3Y7RMF0Z/uXP5wu2ysryEXHSifb6xsbTzYaiGY0VOfjexjVS2OZTHHYAbIMuAqd7V/ew+eEj2hGA/lOFFXGP1NRLxBXImAc0V5vs6HyUl3ivl32azqJgNxwvOIZ87WsTgsew3GSxIbYTuKWQfR+52M3A4QYeAUW+pnIG6IYUgoe8YEMZAJiUsJ9nnDifFZGYXRRy4IlMpPCrDuGeVfm3XVZu8PyE8WScSYJV8+gz/Y5rhl7AvmMhUYkBzlMy1Eo/J4MjZyXIPHnZkdkOGKhSEDMLQD5PJb+SFRh3Lniki7ugFp0zT9YoEYy1F36L9NCw13SSEMsl0Bx1XIdFLk18R7uX/EQbpwBJd9tWTqyXbpcVcCORdyzO2BuIJ28HTJQ6jKNDCMH2SYSsVYhEgIeRUBeSDqbpEEio0BkR1EEAFCq9uh0F4RMCWPgP7lPfKvLACVB0jB/vlLX7DiWCq5Ml01SbAJPj2RMrBeuKGFPhmouCK/4QARVGM61iHteLEAiYAG2IS6k4hEP5e/CXge6G9nqGAKP5HMKZF3GpjdBRY8hulawV0MZAPsfABqJAlyGAVUhsx+YDLX0hbm72yyQOumasUnOg31LYimugKv6Mukykn26Bne4lxSmfCGDmvngV5ZGgeJ+l/nqOqR/oWyHAhlgPdBgeEMBgtqHD08S7o0neHegtR/zYVKmGUlaJV8vZKyTXsTjZIoXDq4bDCBCL55GcCD5dSPxcpi/I2a/VN2JUbqoTNzg0dFnp3v/YB78hiJgwkYiBD4qfPtS0IKJ0I+UDBP9HfPgLZKMxYSRFBJMUYp6EajrbRaLkdQk/0XpIABRi+gRzXd0esZWFNDAFduymz8A8FWWKIbSCLXiBnJhJGZx4415CK/OschfnF6+ImcGfJYQFS60LrzhuC7uzrZ91KiQHqvm3tkNwLW+VonQ2zgyvttO17ce91Ec7AVyIpPSJIDZXpD6AgQWGQt9IcPv7CcAW6UJyGK+wv2nRv3CMrr2LxkmsQI51sjl2W5eqUvcQaBWgWEvKze96+vr3lDFk14aByKEjfLZQPlAONmppyJBsivSIxgPBa4+8m1xk4g45MGe8jRIFotY/p7yUrgcOHVF6PCBfYOEpl3ZwzcyGGiLPoJwNIlUCBcMJrSyG/7xnPsn9KSswnIQXvFA+vbNySIe84lIQJTpdughiWPMEv3g23+KxbCz3fnXlRyGFdN1ZWa/jx9JoBMhQuVu/a+axtXeWEz4rBnoq17Zj2MVdz5+hAHPwwzrffq9suAdF4WlZhOpNRAPFTNJe/FnXPgLFQ+k74uwyap9JYhcjfmVveC/pTIGKQ/w+s+4Aa9V8kKloV9d+onQKo09gSseYps/4fp2VTgMpFdzg83VBvEGW+hc0+SlcSxQcDVbgHLSn3H552EUK0BhkJD3Udiu7kShETMieY/hpSb+LXDIP+H6z5Q65OHUnHUNTzlTik14OLWEXLMeA0mEIVdFRYrwxZ8S9Q9CYqYkus0gcLaRVSX+aU/6Ofdf8kRc8zoEj0jKZr4A1ZQIvakjm4WWgWWamz/f+j82hrhWpMoE/hwUV/l0JUGdR29+u0egiMqhBE14Z7tDqkrQK93wSYRmt000rH0kXQ9pZU6hG4lYrm4mGwXkNzs6/E2NajRAjimgqOToswLjVoOEo0oWNMbmgYJSNBrZQB9gHqky7IEum51Yvg7PEXh8gLCZ6frw/dVBKXjdAdv80PxBhLPnphiYiyCFzaZFF4V6fFmgSfFw99jcWI26J9dwZBSKcECo0UAcc2eHySs/ns9RvpVfRqCDBIAa9MF2eJgg+JOIzX1kv9x5smTqsC7pBIwWJldM4SOhs915i9rZvB++5PLO8ER3/sT3eXF4q/pwptEiyRUl9jqZOwYQZ6TTHvTgV+ElnW4nigEnQCUEX80cddehiBE4ngWJ3iB+g26H3BvLUPRgA4lT4zjY+SM0TrgM6LTD6dEQFZzzIZZap/Qv047HMQflrUzERC9ecTO43+RyBE5IELs0wtDfCxznY7f5Tn6fTniYb4jzkakhinJXpclh+IgXyE1l0ZXty2a/6Wm4n2DU7V3xWPIweU3KELQXoHbE9AnTyQCJ1uw+gHA3nY/vP1ZUhzwZM3z7I9lVuBLLpHAmJBvG/BnxKaiT3B39pTNQPqyJzCqd94DR9rECn80R2I02e1KF5JXUCWxleRtJee+OaH5+P+f0CV8tns7bmXy6C9vc2doMG7nvSzLxHBfwMjS2HLKuFifi4dQYXSua5Gy07GaF4FAwF1LbBvVipWlLw8cDmcQ8ntodsAfHdApslwh7bnXuzIB7HjTczlEDz8fK0VQWbAEb4r8H6QjUg5WTzpEGsQiQ5lQkp67Z9LBygWdQEPpaIz+E6QTmqhhjcTojqx/sVbt+tDjfhKzlfXwx5GmQoIGoCxLZYtDpTZg3GygVCB5WtovavZ+FrUMeaFHug0Mu6NLtvD0FJjq9t81G/wbc4KtcXiyTM9N47f2tdvqr2dx8jfkyGmx4AcvPydnhEyG7caX4JAj/FR3DEpuPctO97Ta9dBvs7gwhx45z8PrNzquDvYvdo8PDndd7nW72y/HOT6+OduCX10dnF6fnz093Tw6e71OTs/2T1zuvLvZPTo5OEIqZQs+sjSuy8Ab7t6cmXIb74HZyb7tYcCMyx2ndg3Lo3BYlHyJcuxa/OZPIMBEjJDYTGcoJTLT6sdtJajC52wFLA0862x24LT1wgcmvRO15Sn/JmyJCMAAuJSY3E0zooVFztLAduN5sIQR2gzPeiaJTuIz3TZsqLl6f5ty4AX950lSBOBTC1z00/qM3MPp+yd+pEX1Eu3MPzKMyHPW0MaTStysRg9+WtSzRj1p4scBzob+HaGXV09DrdC37rFjijTK5mRWW3NFqbLFlL0/UQUzQuXbxZoGZs+46VBxNMtcMMxfaRw/2+iQjgbtRk2HskqmH7T9WE2FE24UjmOnzLuAYbIzDMnMV6Fdoo1moA2xh3srh5Au2rhpGBu6zI+MmloaJDLLTk+AHA48sNFl2O2JdNEDWDPuEX8NNy0C9HQtjAJ6FJeBHjC7LwkcoCC9PExUXL/uiGVAjJ9ilmDJNndFX07rU4Nh4SU7pjiwxtHtO6KaBF2rKkjjVsCQ6IFKl0V1bam9weINfUmejAoaUt81MYu/uYj0OByeBf4jpUuBk3jm5VxNsa2U7tQiGZjeXn8IsGFdbPzxcgFsPT94QswefiJEKJs+5d5lGy49eORc2wJHq5wK3LHCGWG4ezmy/ulHLD9nsoCvHUtnI6uKLIFYoy37N5b0UUwcgCqzI0BhXfSmmNMMdyES2r5U9RXZ1Og29PRUuQybg9LBvzVzA/CpUccw1LEP459HJrc4xw0awzsp4Ak6H4PaVjIFU8Sv8GxzD3OMu481L61W0k9S9ZMtGUHmDHtToXo2EBB2Eyczv4NQ119ZeUEUpl9CXyXKJlDpkLydOLgaUz2vmtjbCvVy8SF2iawScxRzMX8y03zgjsoM9UFxGXIMrEnMnMw61DFSOBEqUxpHSc6U5K8fRXaku+e14SpepMJO4kZrc5TqZ//q8WWToqQn9pNJkpOCfNVNVWZBhxuj8S1Ec5F/mQkPkf5HYah6jiBUkUXY7musL++/f4gsNwQbYwCe88MBXNQjwJ/OsnSWSGUbZM3AXdovkeyL0yVgt807K4f8tJoBrlMkF/DBToPJTxbnrHzJzHmpCEoQmI2I75Il9G7DAYhQl2V7hRvYNcTnN9lNz3cejNP82DRatxXiIE4kC3zajqTdRT9adJN9fdPA7byiUHyG2uQI5uHVKT0Yc7QOl65VPsEd35V7uNgFRFOjJD3Spnr7UGO0DXbtMDhlFX1TpqF9F4cJAi7fgtwYmO/BkXryCH0/I3dPq6xOVrQOOuDRzaSU4RWUtP54Ur551qcabsxBsMVG/ylp0L/EBaMc0UJQQxEaFXBpDi0I2UMm4IIX7wpMTHjQY9zWy0IYDl/bDwF7lWQirihnxZzOg1GZz6nbaErv7slMWOEdmWzVSBdf1rKPG5X3IPUDKq+p4VvdV2RWjzDPTVI1o1aHMOxUvUYmKqyiqlU2AwllW6zJEy5Vyul9Dc+frnirRM4VXXhHAKFajGGJeZ6iRzaP6VtpkR3OWqZIaaM0ODN9v7Vafx251ZIQrZ7+b+iy0Rqy7GbFaI9UnNFK1NqmlbFKt8ekvZHxqLUytham1MLUWptbC1FqYWgtTa2FqLUytham1MLUWptbC1FqYWgtTa2FqLUythemBWpjuqhorYOUn1Y61IlsrsrUiWyuytSJbK7K1Ilsrsn0FIltV7ioIKZ9V9oKc/VefRvZasOoFywSAIPQPVHAnmOaSUtXYRDYnNrPRwmsR1/SuVauaDQJbcgU1D0Ifc9HoTKdKPAptmkgZUL3JuOVgmbmtmN3AUyEkXzTpGjStbqZjRMX0hgpJm6GRZE9IV4laV4SAshoJx9rX7QSC+2eYtWbhBO5Om1RDWVqprO5HZjQB9naajkZCLymwVOQMMwqYDs24OpMrQnFdWI6nouniUzdFUmZfg92xUlqwqUrjbNIqSTqDYfJqD6Yd04mI5h+tbXoMefbHKvDrTbgWmvOZEDgDVOHA1CkLcCwdTGQydycUpGVJa+Y+xb5skCaJCill8fzJKA36nLmeTzEJiQxTGY66sPuMj2IhbE6YMxgA8rNgxQvMmASyUyB8k6/2OJZX3JuyYxVIb9qvOTEcAbpGpmmoEknsW4/VdZZE3NpZ8doAp529sDIpQ9yqP+Nsw+1mLMdRdlU0dSUvP4UNrAG2DFMtlatQGJcYmJu0CD5bbagRMZ6XyqWuY8eh8rvGGtacsv+pXDkow1dDOlxkIoWcaZDLzVBkKD2CNGHo5MaGMgtZRvwv5kDirrbsTrLEddjJ8R49BLjJ5TN7wSYrfusM1TpDtc5QrTNU6wzVOkO1zlCtM1TrDNU6Q7WWtday1lrWWstaa1lrLWutZe2vaFlbwhlqFn9DbdISmhaq1Gt61D0RUMGS66WWVbdWtKLzVKynKardOgXbGfU7SpMopeocDePS/1S6oVa72mpXW+1qq11ttautdrXVrrba1Va72mpXW+1qq11ttautdrXVrrba1Va72mpXW+1qq129H+1qG3LQhhy0IQdtyIE9sTbk4M8UcuCGlmG6g+YRB639o7V/tPaP1v7R2j9a+0dr/2jtH639o7V/tPaP1v7R2j9a+0dr/2jtH639o7V/3KP9owaGRoYOo+CCIU5DHumxShajYauyalVWrcqqVVm1KqtWZdWqrFqVVauyalVWrcqqVVm1KqtWZdWqrFqVVauy+kurrEhn9KaVYVoZppVhWhmmlWFaGaaVYVoZ5gvIMN2Oo4s5EVokyxT7qFOOzcJYcV1Ud7FT8NaXCeX+wVgAfekochVqyphM2mQ4rWWttay1lrXWstZa1lrLWmtZay1rrWWt1Uq1WqlWK9VqpVqtVKuVarVSfzmt1Bd3BjfJcAo5V8KyBqsmSUMufDXNk/OxS2lf3KNsroJrhbVWWGuFtVZYa4W1VlhrhbVWWPsyJsTWONca51rjXGuca41zrXGuNc61xrnWONca51p9T6vvafU9rb6n1fe0+p5W3/NX0vd8cePcHTI17Y55o0oM0A4oJjsIozRhsUqhNgQPtGLElJBHBMrjAfOoLRvGakK8UIY64UFAO4cCqSPSdzvihoPY3dnu/MvrXf/34IAf/vrz+eRqcjX9/nx7QEUYPDUBHDZlY5vAbCvMghAHUMRCqzT2BBuIQIUjKGOB12I3jbVqoM45ivhvKRDQkQxpKR72/I75CpLuwzIj4SV9TOafqBFJWNcyGbNHGaI+Kq547cn61ubTZ2vrG5tbj//dW3+W/HweJN66/+NPb/2glGA+n7pnaAM+RzLJsxOKm+SCoLqIeMwniBl7TaRGNPB2uh0qF1BTlyFfdrYWYOS+WSDN+mibPaIRHrGhSLyx0IxqOcRCp0Giu+wRzpR/DsV1/rnP9sSQw7+AHmdDIc6oMJhm88BrLYrVlfSFX9xRs4AcV57H0h/dkwRBYxntyFCKuG9lmt1Apb5Vn0BJh0Tg/hhTeXKt4ksGg7NvUL9D8DJSfgLL8KX2VOyP1LffMRVa2TYbEIbi5oYNCIqDveJY+LF3PeaJ5lH0bZ/tZK/0XBlqVbFXm/31/pOnW3/DO0Crbrh6aNRlOvXGjGuzgm4Of5fpgHuX8A8LS5clIhCjmE+6sNTkGrSS8TIAmrOeW1TEgyMwapDeWJn3B+4KHHbAk6GKJz3tX9a+h2JR1PfFaai3S/oNgD4HFc+8+SrqWBmuxVleBTCz5xOR8EyEcCveNJ0dKAmR0l5GfHtahiBbd2Z1g50HaeB+Ls9pgmCWtPJU+kTjoqJYTrhVUYyxGs9QxCJEUYSzSMTaCE1ZCZuFs36fTnjYg5cnzj7moQ97NXR0WN+I/qjfZY/+zgPpiUff9tkhn7JBdm97QNeB9yM3BlI/CtSAB8GUpaH8LSXxKhqrUJBU2UzGeqQZ9rHSogzZfn/t8Sac8YQnGVh/W9tc29ra2lp//GQNgAOlPiwgDe3Do9sREy6DJsI0lwHjvg+yS/50Ya9hTSmPeZgI4TOr1CGFWxoErxtt9Z7zMIIjhfozISzLC6QAImZXtAP7zPaJbtn9lqEXpL5gJFzj1HIyOj951YDVX/GEx0xOQJkHRhb3ePvsDC7whI4UlKsTlWCzLpsIX3L6J94u/JeKDZ0dyoCG80UkQh+QUJEyjSSJDE8SMYlUDJir4oJuNJiWCAgIC9chvsCiWE2iJJgCsH4aYw+OVb6AuYFtzhwAvOxVckhidwP941mcIoKbi0bdGWn1EpEZFKgGkdR0E83RDAIFurluxrJiAXuO7B53JlRs7xDVXt/CxhoNJ2yuTmQQZCrVqUrpCPWpCIZLQJ2DFIsoFhoRBylemoyB7UJdsozTPtIMccyYK5o9ws91ydpRkgiN4LCY6vHm0ihK0HY+7vsCn+CmwhhJjKg2UiRc26Y97akIl4svmL69NDq7LkaCyK2tK4dljowfOUP+aISHjEn3z/Z3Dnvnp/snpC5W8aWOuCfsxG4n3UUCWJQzLgb8ot/vY29XPKEbjCrPJvtj+By2x9dDyUzaJYZg6NVRKKwURD3AOAeVtrgM2SQNEgkCkefsOYEzyGTB/xSLYWe7868r8EZXIWDZivbGYsL1SlFwBCURXYamzGYYSxH6wTS7RFS8rMy5rXE2U9Hb5nABHNqeGg48D2Tk0kY1m85VInoqDIVHspH5NzUAg8tQBgH9ZT+p8CK7TmSYwN/dH3mSwO0rtkTky2fypQYCV3MZ7aM3n9Ao+Oss5XaBZ+Kmtsbb3NOwt88Mn4gbU2GPR3wgA5nV0ivd+fon9B+dMA2QzlPVtOJTjYfTrEpcEagTsMVPCDlXLLV0QcjXnW1g6RLMMQfmFClDdoNAGW5UTmCncFEqxAm26KVIzKXQR2kSpe7mV9TXDa5Wp7ItLn3UZDEbpTFYI4oGRnZAdC/DioO9riUFVkjuMhXRgRVuIFEvZC05v3Cejr8UCHpe4DOjYflPOR0BwTf/3WxJ9nf+bDGvE5eYGLG7k99wHOzvA56kYx66mg9X4O3UfjcCoP34d7Mq8zWX4TrPqQH77//1P/7Lf/y33zs5i7YVFA0JcSgFVB11tybjLIXdcX8tbZD7yeyR+9P8bdqjluV9Wl9f23q2+uTp+sbTzdW1jY21zdptkp76feEOGDmzAxLf9soKklO9YkZYeSUHINyt7ERRYBSA/8P66ikZfVboFIEi6RWUJ1eQDfbz47EDXfw64a+vf/vx+PzgbCIev3mzdXT6z/H3Gz//FE3ks/Mp/+nHzY3T9fOdZ79dXv4+XVv78dkP5zvy6unZT5OjS/VjfKvDqrLr/auf9p4/1z8PTn7cmW6cH52+/e3l6qv07M2lVzjQhU1Lp1ycKT9q5xfnpOlhXjjpt9BwBxsWjnohIIW3V+dv8FxaXVtdW11d+xJHD7qH4l6sXIwun+/s7Ow8X7vR4fDHfxyeeddHZ5e/H+2dbx3uFL41O+T3BapcIcqtwNoKrK3A2gqsD1Vg/QRKf6urRHuHucsi9CMl7WVtpkU/D30RB1PQJg3uWaH++TTlmaSenb1ZS5yGTZTm5M2E6sJmusXS1TCzUXVyq2Z0zr8xAXxtSNgoVmkEZ4I2LeQ/1u+XFoqMRE6kOWvgb1fCEN7dkrpIhokYIQpPZCgnsOmrM/wP1JDRUDVbaslrjY+l8TjSh4Z12NfZst7HZh+BG40hvVjGiuqBEkzDjhvA+s0IeHb7cypN+Aa7CT5h3hj/tlpUGUwv0tDtNZsYz1qMcVcKUD2LR4r+HTg5Rq4WuOwdaLRDm+HmemPAIYPqFoMmPOQjMQGmEfBwlJL3RNfSvrm+YLd7TJfpcOWeIinT+YlaYzkNDWTo5f4ZW7laW3E2qokBq3ita+/JHOzN0MnZnCr5zxTsln4CNzACFR4weTCaP6pC1SupjaxU1WbM4hMl37ylzsnKZZUNxM4L10e0h1yFKxxWW/0MTdJ4PS3fa/ley/davtfyvYfD906EVsGVOMi8l3YXPCRLHqgYMHLhT2ouG2pO1GUaXaAqbm6Lsq9CtUWNd4fTiIfTebOgVsVLLgKpk/oWWvDYG9d9K3u0ZisuLa+0lirgLpQlkLL5KwecHwyj8WY8sw0qd9C3D9ii4HBlz+TEOdLp4gOFr7cKRIDlgRcfBnQU/rgYTC9i4ckIHD6yL1qEfuc97C5oEuImc1pWAp0U0EsxiZLpBfavJfYGNlBhvC+qNjwVAiagcqN0wLQDlYNwd7VnVR44dX4iFKn1EtjnCykCf5mN50GgrmtDRQvw1X2dyPAiEOEoGddtFkRT38z9rkUC6rOFNHYeYlV0OGY5lX3E3TFZg1TIhrBPtTt4No3EcsQIvl4UZiujqxPcMW+htSdY8jC7TX+OPkm37Z2oSHq37ezbs7vtAFlgimHStxxDkHC4fO+aW1o460WIViGb4GWHki6+ORDvjoFzg5e8DEfLoV5MbPQi9wJetMr5jPdjt4OwXVj4l9HpLtzcytX6iI51fCQuIu5dXkgQPmsZZSWbV2XZFcCrMot/BbFqfibTV47GCouG48FzY1Q4TXqyg9HkRaCu7+dpCyO50Z2opc6ym/GiqcZEUywRLlZwhLQviGGgro0+PPdcL4uwC31oxypOmLiJAm688fMgX2X8zaWeMVcD17jdOkkSRjMuFcYy50ggoEzJTufz6FNyZJilUsksANh0MTi3tfo5Nrolept+meljCRlsgd8MvgjImzFz73RxuWCUdE11PAiOhugC08Bo90fFHkOe2fBgR8Th3hjfKck4VulonFmN3/AgBXVWDEE4OumJ4RDQGe48ZtcAD9rB1Hlmv7+bhRAT3FzYsOtAjUbCv1ApnL+xV3be3+0ZXCQUJTsdeBpfiVOwS99KzDaPeRMLAkwgCMwfNUKrE8JQhGqs0sAHfQDBg5SgdG0s/jvI7DxJC+uYk34mSxpSIBK3tn3nalq8xZ9TV0tkYw51OcEtcRo3BW42sZjnfADUYjhEHN+5DdVodI0MenTmPJ+6HfSy+EJIWzwMB1Nz9M1wluB8b0UHjFtEOfOeBAh8ypAEAa9bTFcCulhKMyICXzMafgkN+Wk6GmHaBCYxzLKoHwey0kVx5VrFPuq/UftAbit8IBrEfxDY2Bghh5JDyCfIj58U6QH3xBij9hYPeJw3Jl2gHTXzEaFHn9QMH/AUE0AJRpAbLJ7igFqbga6gU0m0AZ7huKNQ8gDjAdpAMZxHHth8LTxkgQC1MAlTOLEFv0aIgiBSpS6l+PoQLGeRAB+kXxGc1JVo9bgwGbPq4s7UNeyFTallYmczHRSewxIiMW1Ql9H8TpCNnQBivlBXHQS0qPqNxtt8mghMLqRCYaSWxcqCebsDp36Bd24B8UtENIM8Q4xznFZyezQIsXd75vsLU5l8R3DWdxKVHeIHu8qThHtjUMvPHbaZt1DdW72T7VQG/ntQ/SUYoIspQwCi/CiLg1/xWPIwMS6bWXMUPO92znQL9FdzyIPskpnDTuMGRBwi0hLFVCTC7HGZUW/4x85IhA1E2ZzdINXj0CsbMAPNefzeDRVdEglYI24iFGheyJAH5yevTsRI3CyG+kSM0oBD1DNEhwFs9OrJ1BLakEhw/4etotTlJp8CBUveJDH3kh9OF892ZAMJTB/09sPvuFNml3oDDqY2m7NhLAJ4EPXZGWgUgHfzkClKH0DfMvK54PYAPtTdIdpL3ewGmcb3cH+MieuCh/7FNZdfIbU0EN4nc/gtnr/M+vw7M07WZtKxB/njya7y6QVhlEZzj5Ka38NJYpDt/HWhjrA2/HbG2rIOzvowI07j5WHre6HzvviEh7bUkd3TgYUqGZtMbkvYtopHESXTJY4iAk38+0UUyl44ZyIz/E7ov+WyIZcv9rkXFKBUjp+JRO3SdMAe3I51+l6eRxc3dHIIrBKzueJiPioYaEVT/mG28mNV95OIiNLDYYS/fbbjC1DFWT5NBolpauIHjHDhpt7ssiwRID4ShlwGZuN2jg/275IrC3MCloPoXb0qJqNaxvhyOxHZ5MmysOSvmqZpwwOndRO181mWnqDOrnFXNfadImaKRgZd0U/fNmCp4fCLlWIg5shwdDFU9oXYLfxmnxTFX/2MwmZ0qJjhktAaz94ozOybduFrDht+JjriZKebO4e9mbV65RxT69TLqD3BnXEvwf2pU+fck2bGhezUmrPesmrS3QFn2aci9E/LAMw0OjdL3nfIwRVP5AlvANMgPzoN0GfHlFPDJcKhb00XELtke/TnEswFaXbcQQ0VByDy3IFNtv70fHd3//S00+0c77/eO3j9stPtvNg5eHVxsn92crDz/NW+/eF4/+Rw5/X+67M5pQsMMKTnyzI/A5wQDzaJjCLNZk+uA4wS80DwMk9ED5pWaW0h+3J5f8WVgLAwN1/Z+ur6Vm/1aW9j7Wx9Y3tjdXttvb+1vvozsaRAXolY+GcKw1LvYCc8p3RLurB6SAOdzcES1bVZl0w22xq9KrgSxSEPypx4piWcj0KlE+kVUj7a5IDCyWhoPQS4zyPMDrZHafVQmKCcc8HUWLnjGYkXUfWfH2EFGQ7dYy9H7ZldmbEJjsn7DHL71tjsZ4mqM5rP4tam+QCOxJoSRTiSYYNrWACNUS9jICAH3AZHJhLyoVWg/Qno347/blm2LKwug7TqCZJpHVmhSzFXE8p5Wcv7UaU7M+e+K12wrkgPk3jxkE1uvO2VFdAX2dhmkWdqwjxQNuQBMHAkkiwZH36EfEiN9PDW7IyB55A+XfoCMiDw1Jdq/qZZxyUde42SYh2ng0B6qAIrZrQCYGEVmIHRKMuCz5XMaiIn4qyRNezw4HCfMibaPGVZ/jDUNKxE4ejRt0YxGYhm4RRHsRyhZhC6oHtOBf3gy6n83R1sRrr9F7CbWv6OqfcGU0iJ6mSDhjD+l3K51FeCcQdZgRm/PHhh82gl0ruc4fzafDxNo5gx3yjpidcqqXOlXmbUKxgHqDVtIWBAidjN2MI905Lhe8RToa/ZN3gZVvBq0PlWKOg8YbRIncGgCYE+8cFk1ODOxOJKimsnkxymbAZInDVr9g2NyYYxn4hvP9PV0UWknEERr6Vf8P01Gw8FLYQcjWuqSHysCAvH8kYEzJcTEWpUtKrysW8znGeFxoTTi25mqLPxfSvDS7O3i1fQyAhiXCohNim8RLqNVl9zvRsRyIwWwDln4rB5ugmfEgliFsM4EaEtjECSiM2NyK+k14Spv6CGNckJPwvqyNsh/5eB9PTz4XlhxTm+m5cAKssW7RqgNovMQNjHBKpNIJXpkv1Nr5qaYGgIIpAqUkJhCJNmxeRl5oUn14ng5UTQd5Cr7GgYIfoW8zwwx3Mc3SjAFzBhE4VOPmAFCz3RxXt2sIc1r8ai0OdgDzzDIMVjiGkecRFUvsZMdimm3zEsDXEttWAyYeK3lAd1Q9ms99ixWLtnlvhcmmkbZEO0lbBv/r//83//X7/tMl7NCnsppqir5EQrsM5CIC8Fe9fREwn5ScB6Jd51lkpqasy87uIfaULVz3QXnd1sooAzT0zLLNyzuB4rWoQZmcxPy8kczkGi0GEOZkZ8nnvs5ZUARzIvwVMhwufT4/zzMupfHk6LFsZ8GbO16Xksz630CwenR+zp49W1vMxTQ3XCPJjyF/PHapUYiq0AzQ6VBYpMERhAe3oel2/d3OVPL5zmneJJ/FU3tTtfYp2Ji1WDy0n1GGboL4qPmmr24DsQfqtFobN2ihlsbG48e7aBQZh/tsISSxgaSlHOWF8i16mVcgmDpqlZiaQXKegigJdh7m1GPfM86SZivzfA6mmoy0t1igoMm1rNzckVxWIob9C3Pi8eWtyVv19KPebhgI8AcbeLadL6WSq7fBnN3tiZaG5W4NZLuhcd66ETkbnMbYV1qDhpJAnsmNTuXQZdkEeCh6INqYcfndKc7vRP19eebG6uPnnWRB90tv/Ps0638/ro7GAXtNkHhzsv4b9vDvb2j+C/R/T7zvneAfz94gCV3qdnB7v/2D/pdDuvjnZ3zg6OXne6nZP9nV3850y1JzjdZ7ok0HMN0wDphy812K5SqTGO3zJPbTOk25VSPj2iO6jL1nQbY+OURekA3IqlSaOoihPpjXtuZzZQPgooJgU4SQ2+TIR/dm8a+uzN5+rDaRK3rldT3IKsjaG/vIamkNc8Jae7MHEByyhJbi2ax08cuxKC9b30fREuCZbdE6nZGPvTSYewwYG900aNtCfAxNmk9G3dDFAIeCBECKYIYSXEhk6qc62SuR65ItTsOMqc4oupyErhBRzaZZ6HGO9+631MsX+eV7Fy8Jlcr8hTgjT3MrwUvrnCTRhJLoJnoevILDUWP4jQiJKvbAYDn1CGxLrNL3s9NDVBHdKQFskP9nSX/T1WinL5wKiUk1OMuDd1yhQA2zfyPREYrB0pw1G2Pbd3j3b0UhV43Wd1YyzJSOdtQcre6NVEjCKr0ajc4y3Mr40Y3VDerH88GemtW8jOmEkyLgPPOep7B5FshubNtY1n606b7c7m1tbak7XVzWfPnm7mE213/sVkfbpYW3329Mnjrc2NdfuvYp7rWWmoczmr83c7VjVDdHEsV6jp/ANlIfachKHCIpHsP+6tbvVWt87WV7fXkexvPnvyc57j2DByYneoRzjaSZMxAxkMH+FRoKbC77NdHkJxjKyUOFbEpro74KPyP3VcRmLKxDkU1vySX89f8vVubDzZ3Fp7+mx9de3J1ubW+tpjd73vXRJGBeAgDL749F0yDnTBW0Lv+BO5HOOBul7OcxJ4A4dBoDbQlQzECDMJk8/ZmCeGMh9TeZa7zoRcSIZXEu2+Kf0INuhflQS6NRV2QiOMP1d1kfON53QqnPAQ+IGaIC/ITOFZHtmP1aegyYLqjAfJlhMBJhRUxSChwjYTAQpQPZZRliOfssfEfJjct7kVBy1YiPJqaU1EYrC/QWYBOTT5e2Nf+BczDKSVyUi0fXnwAiVV251hdww8nqQJPZrEjRekGpJ9QR99Z+vkp7FEHvOClnuWEjmz7uqpTsSEbLxW0PBLm3TPZk5jUmwimhgbpoMSVkwqw1i1VuIRWnvhKdkKFwO/gwfv15gZi2v4imxr8zKOvTdFOxHv6wAuC2clV5QlX2N0KvgW41BBM0njkHR+Ts7BelH9TplLyoSpsovle69zbaSDQ2gCKNskYQtmeonRggl2J6/1mCe5kIrPxlCZtmAhNGzhVSkI9w5E9ByVD+49MWiCsbu3TUVSGqMOy3DUGl4DInuP8qFlAcTAWlQ84qH8XdAmQerzWGldDOTPU/uYwgmvxFVho/K8kYYJ9Na7vbXuanetu16Bpbe+zWLxKxphu6y3ts38GKsFd9nqNkvDrBh7l61tE3tEeu/8vr7Nhmnht5Lj0XIJgSzXuDf0n7FhlVtwmtWdz9gRulviXxG4NcZulBR6/2RvQmSUh1Jr0Pg4/fPQ+8QcN179X3Ort8cbOWLMXsWE3+zSGK9mpSqr+rXeQEJRZuZmlOPMJO6h3yixSPFIJ/ymxOQWTTCscDs70NsS9V80ElmVM/8RZB7oKQEcIBv1+zLnWHJYxwOjMO5e1Qdn0cgkJGUj1zBNHBzew0dYOHQ5yRd3FkUmsAwPBKm5uGYwYA8sw6RtrFKm/IJVCXddqi+HBRTQvWO4JyjHlsw355fz4S3uElgqd5tLUnakx1+XSVRIStpSsr08Kd0XB53CNahwZy2sZf+LLwwqglMPaX0Gry8Mr/PTCmYTrIO9Pp0UNUwjv9BeGkoITZa7O6SUT4oP9M/MIONMps2hYUPBkzQWjvBofiFxqVBde6ACsAqEgQzFBbh4dBn8/wusmNrX0zDhNxdjORoHQI9lOPo2D3ibCB6CIsGd2/ApfOf4V7BsPVf1faf9miHZzNmvGSTUzUUPtaSJnEMkTMwhH3w330qq6sQmeoSNVMwiLVJf9ewvxULofeRrXTbpI/cBcXvUp5zw/Yn2NtY3t/roZvptLrUUIVssuEz4DWT5WlroMMKGGlrzR9XOBdZS6OUY2m+HwJEKbk0eup1kbE0Ut+uP9oHbdwfj2d16H/Kb2Vnl608nzDLKwwDgPYDpaDNpwDWimSl2RsuIhBbN4P8QZ2GablksIuvVXSgX9L8zcDRMb6jinrgS8VSFYgaoL1R8uIwQh72ca6fJz2y2OQvfxkVxnHqeiN9SoRvoG8kH5K1Mxne+V/lQz9Mkuf3rpcasRQcQ06KqDDN2vC5veytphNvfjMwsld0OBe6aQEWD4g0x30+a2LEWGPx2zFTnUITTzz34dJkz8iAwXpYOnFBtgwagR2eqEzXBDBF1sC1CXupeO0sRRW8h6Ce3zaOOqWlOnBzq8O/n05NyAvVTyp8+m1u7QBv5P1dqL59zfdZB1kxzRSk9IZMjlOKzVKZ8wOHUtJe6cKpg6MZUE+WtXnSemI7NjEnH4goAxn5OLguTovdLndjbJOG7c539E/LAWwYBXQfKOryDcLRw9FqBuo9EiWVGp95gq8q710wCdQfk1TJE3/RYSUPzrxqizuPLneWdI6AbwEx6Q+MbURmcWBW8OW7DqWjsZThUPt8LFe8bBnq3qS0brk7m2O52KhRtVsQ7vwMjIdvm7ftfSu/y9r0xp+JduOCVuhQHd1pC1RzjmGOdejWVW49v4oWz1uqWZryyC5nQy9HGthZV9uL+xGYFk30XdffWtLOcAy26i+7OdPst26Xq7JfWwTcLrLAprF0/32XTguy4brrGllN20m1cNctYU3oo+I6LKQ8MTCtuDd1lAomspYYUTYVzofQ4qYMflG9nxXr1Lk4jP3//Tf2Eer1RjTv57BiWJudctlMbdybP0QiSkrtm5kXeAyTR2soEs3R500hss0fU9pHxgIWwPsfR9REOQB9H2fZo4/8BgtpRGEyX4Xf21QTeayrJFOAyzBGzzBUa8IM7Zbs+LoZizCSNju23YBRl32AxsxwvzSPoOzYhR0bOdDrQIqE43jHXhypeMtgY3gHgtwExZO7WUEBZ5pYH+cdhyYQlKuH1BsbSNNDOeSYVxi+6GdWmAs+XZOesR7jSuKQGtMQs4BrZ/1WxdtDtfJrVkMF4VMcOlbxN3ZdJAmv6xMzL+BnJrdYZfiMb1zh/6juPT2Zn4/82S6xTMXmWZvt7giCQ22PTEIBXsI/u3Mz4MRK9tR4YiwQCctWgcgCy5B/e0G2Deu7Uum7czuPdwmLfTEksR6My05+bmkbqidT6KDwIPTWR4agaYTTrblO2pxwEOWRaTYSjqqu5e/XuGtkYC1w18rlybw0dKlXv9DP/MKjfeZjI2jD1250HDQpJbWVcDiiZe2m1iE+x772ih4lCSBzYmsI086zMEktBa/XnZdo6pyX1Dr0/l3liIosCjYPpakY65PGl8G/lzY8jYpjITRRIT0IY7QSHs3TKMMIa534zebpcpATOWH3XT9IkW8+xDMNb7UuEHc0or9T1cSxVXORCTYcymwCVgiIziiG+AxHcWj4hj6qqZz4OyngUBZLisXIJiu0MivnNEEJy5AVVuC2XFJgxYsxbwkSIlVZzxMyOzNCkfbia06rfYc7A5ou+c1RMjlNijcTrlWyti/hN2cI3EXGTwE9yxV9KjfmVhnLWguVkfkPBgtQzKNhb6RUjOuKR8HNR3BdDngbJ7Gdt2RSQjW3DVjwhr4TOGRuFdtn4jWy2bon2Ar5GEgM9VSj67Axdx2MxFLEARxn4S8Q9G9tPG4aI38WwS037n82kNAGDpYFNjWPaieV2t5zK1CBNReotZRm0zwV06nWWvY0GOlM96nqsNGppr0SsLakjlYR5U2v2DVaMK7gYMiMGuhWav8V7bU9XhonKjR2GSrhgMKhgggb63LQ1ZGBLhKxTPVYUQJ3cdTkqmchIyCsnJJVmVrhWbJKlr1NxzeGbMh90YiYKgFKT9bML7B+EiWqKh29rdz2ru11EPJOMA68HStb5FWC7qGbIYrBQhHIaaFBNwAm6h2ZFSih2W1kphiNLX5juHo9jrAifF1q5Ez6iC6sbtGQ1O1YLkxdudh/ZxcdPTSTTv9io6Iu1ra2t1bXVtdXV9e0Bv9i/+mnv+XP98+Dkx53pxvnR6dvfXq6+Ss/eXHr9mfHUJWVZZ+vxxrNSaFOx78X8mZx1wtnzRO9EUSdP91wNbTLYY3UlZY2Dofi/mNX/3V30nFVhuWN6uHW2O39zeoEgmgbBrFAr0ohkL4gs6ulUBEMbq9S1wMzfi3nwOSA850kKMPz3//of/+U//tvvC2HALK/vHQ2G+W4UDeuVZ3wpZGxtbXtrs7+6ijkjCi/t1dkP1HK0nHlygpxRFIgzYI1wmf1tJcMs3OsUS0+biT5PRTW7pbMM5zqvHw/U4rdUxFOkE0MZJJjps5hlI4J0oUhpegZKlFejNI6URokMofp4K31T7lzFYqHTAGkUOqtitkQU5S2kWfkpL421ugWgY64vIDP6RYT7A+bQwBc62cXxlteuUj8UYRFaAJRKc9m1fAMVQjEujDiSVOG/PRqIoYrFI/BXoxolNB1kDELRWIagkC+lrV17sr61+fTZ2vrG5tbjf/fWnyU/nweJt+7/+NNbP1h2J3AXaBsvhlmFmFBc3/NuwIgLdgMN7ve7GSYfyv2FB4A9qHqdOGr/SCRjvf/RqvMxqz1uA/HcTIgs6EwXqjcLqFk6G7u+EucscpEsGvhPFPSLOo71p2dra9urm9vrz/qP19d+nhfQ/Knif4txu113SzcKW3rPgspdZBL3dBpKEIXD2fH5hL3hIftpAgg753Q2t9fXt9e2+psb67Wns7W6vrman84ecMWY8YQ9gQhD0Dvh4wLuyASfm3NOwEoC2Y1uiMWZKNkU6Ysy4tr6+rMn66tzLkMuAu7Rr44EaFIWkTjPdo4PciGQ7GSLZcCm9wuerxSa1qH0Qvcp+zWLdC8AMSBJT3rq93sWAYnpGAnwca0EaHWka0+2N55ur6/2N55t1EmASwlzpnbN/V71z/PSISxe+5SPnRqq8WVfO1WA/qLPnQzZH29vbm2vrfbX1qvIvj4f2U1GmerDpXTrioJyZ+3J1uONJ89WHz97jNhVlBxBTswfP4CMn+flUy+n4fzFN0/70vnqXjp/9efL3QT+uYL+v/zj+MVZ8vNPb9P9k2s5eHr2ZHX99bOD4W9y17tXTrLx7JNykhd8IoMpO4v5lQjYcUBJp5aXnL4q7Vk+7MatgNkoAvNSxDz2FTtRfixHYjFnIXBmilFb8znLs+3Nte3NtVpF2sY8Rdrmsyerj9fXn24+Xe3cSty6u/S++uRpK70jEE+3Ntc31p6tbj3eXHu2vr71eHUmEBAtea1CP+ZFQA55krC39sOdUG6B5P50e3ULJPfHm0+X090iyj15uk6vNhflrJAzX1uboVxyDcEM8YU/uYjGCq1Dibm75tN8Ovn02dbjWjppBx7wi9H5+drB969fqotdffbzq2j1au/F+U+Xz/bT/QJynlGXlX866IlncZgGgQivxegWAneTVTk4kTWvQQkXjGWxYikZdx2dXrZqZdy1RWix9ezp+sbmIkpULwtX8bgkC4vpD6ve9ODx4Zm39vrXn9Zf/74/Pdz7afVo91rytz/KI3kwPl17/vLN9yf87Rt/7eTNDxv87cHmmz3v+vDX4Oj07c83/Pz1r0eTH8b/XH2z/vb8ZPfH8DWfBC9O/dUXW4drb47P1/ybk9+fH/pvTt7y9UP5aveH339afzb9+RTm/eFZRQSvQHV0dnh9eLZzfehANQii4O2ef/nz3k8b/1z7YXz+cit5s+r/4/Rt9Iav/TT1Nn5+gVBtvP7p51+fj39+uSW9Xw82X0+39GD99Xiwu7b689ub4OeNH8aDU/Pby/GVt/FjCcKd9PU/V/8NhaBXUifkT1J5E9yjq0rBsG/S6FBqYfI+yJzFzRtFhQn37vGZsmRev3L2H2Ohh/+NMXpujC7vyThW6WhsIwbYGwoGA9v7QOikJ4ZDCHEHYw68La6wBOnUqSf3vlIclSB+bw7m4exD1ThGRnOzAU41QVORLcsN2L4Z2zfjn+LN+LEL8UeQ256IXNNLbWBv5sJ2z8qaM2XCYgwQpgbmBcrdn2CukSm2QadVqq2BOiObj8oYzxdNVWvwr3PjgoPMF+ZMUCkBb88DDvSF8lJ4Njc9S51ioZkGNOftWJAbFTjTRhE63ZrelLtNRVCUa2UIEKATa7keqJmqpoaGjlQItYNCH31qMRuLHRknw0EZBYnjdtt1om9jU2fKxY5aR5Ehp+aJZ73BvskqNppfvsWCjQQV3FZcvSW18HhnB0Mb9dw19X8iEWqzPTprt6Qv5aR52vFsLda5FXxBf0gnkclXzfNMMo53P3kImtXkgRVnjRJVZlNGAYcxIStLolikojQAL3NZTO+P9butl5mdKU+N0yzVajYnnQ8FqtkwtmYzV24+YpfFgT1jDQZpQZnJzHGCE6ONjSTnvV/TSWQ9DU0ycEi0E4veEOyauCMwEERKTWyKByA/kAjDqcjXTC4ydGsR9kfLjpu7CJVFLozBsbtoS5yVggdKeXPf1yVLRi9g5HsqO7+aoQvXo/X9++q0l38eY9hX6PuHD6rPavxyicwMOxik547pDVyIW8yL+7BvHO91NpSxhmjS9tXztbx6ZrjBPYD30Oy13/2ltIs6Irgj+W29VybdVETd2z8+2d/dOdvfYz1QYTHpY7CO4ODMpiYRTyRl2mA8kNwkYUUMoyQFeimZE6aPYoFhc/ZQXTyyXwGRJpZgQ+lJFy6bsCOdm31J3FDVK2AApJGrSbDqrt5UptEJj5OeZzNlpnVLZq/Ftf3DBkQYvDHxtyacHgWTDO7brf5g8cD1gTud9x/rgh0SwScXAU9Db3wRGbNn8Yxyf8PFbe1BZJtcEYG2Nst2XMr7WJBtSDp2JJtXOOkd7LLF6nfzzWC1re5RrEGJZJEP28zZbyXRZLPnNrYGZriZMCxvkcsA4D6fXE1nTl73+c7+VbPluc2F8hzYfvrPHj9bSp57+nj9ydbjrccb9yPM5fyhoUriFilzEmVMFfCmRKqXP9uNXsQQoSWf6yjElfOy2RBrm/rI1vzSUOM5B6VQ+eeu2WCyFDDZXOKGU6BeWMg2crD3XZYRxuTw0mySBomE5LWF9B7uu90pCF4YbLmsihMZHtDHtUpCJ1NJDTbIVgE1uocQOFC2Uc1yEB0V4C7nvvmOyVGoYhMl7YRTYgwmSuk2ULPKcdyovGoMHgaRgvkLsOyhYzXQvgavswb5vv4BBW5sub264PKczC5MHWZarox56AeYw9+XkFSCsNt9/i8a6hga26w72Tjsm/3+2uNNE+UcC/9bUyqc1yfaKI65D81KQOVMomnuLUz7PZZhQoVeAc1jHmKaQtCp1qYiIQtdDwu+405HfIp11m2t2Jjq4eIZgzmwXBAL82Hmae1qXqUYhF7/xLFqcsrs1xtwmHTvkPAKizfkKV/x/O2drMk0N+fGIkpWyCfeVsZt8iy8QhgdzXEnVoz10u5In+1kJeplWNZ3Xm321/tPV5/+jd7MxO57Gbr2tMSaE51Z3Tp5mWu4uGUCMrdaGehJ+yBKWi0yEHFIE+LD/QE7LkU4J3SiBgTIKU/NTU1IE4Qep4HQdPyDKcWEw3iQNtotxp1rnmeVHLNsDFW3Hai84QtwFqNiaN1iqTRMjt4LVSI6WU2umko+xVJphOzfmNzrJvM6Dt/FNG1dNpLDLsvH7tqaXN8WTQ4Qtt7zRULGacq7aoup1S25IX1PI0CcJuT9HFtmSSWo446GJDYi9CMloT7eiUV+vJY2mQK1FT4lprt1IbhvMq6vrkQcQ5Q7xONxVBFhntxvO0uViHthK8M1HPlTFjFzCQONkLWvqUqSFTdrCLlfLVYzo57bXk0lt4aTWGGxgSWidDXLG5Bh5ftqEcUMsZcyfZT7Nyiu2YD9Z6JJtbpezoKK1xjFRrc8n2YjEYqYU7qhjx8LFehm3uJmZegabExOyj9Lpblsqjou0aDcHNvn3rhQPCNF3bUlNTxkFnkK5fTQP4woGJZJykhWw/p1e27dOqhPL6A0G/MCweM+e63CHiXMRkQgzyQ0ElNmHisboBRaqIQnNWXa7jMIiKQf/w1TdYHsCqM7NkZnexI1IrmEFMkAD9rZCb9wGCqZJ3XylWUjyNK7kHUx99HLLBJ9qK/KXA3uiqu/RbEx13dTxRQQx9hAJWNMmUJ6Zcqd3toyvh5bxl/dYnF3uwSQAXNVmt7XppYGSs3reE2Ayw/3TLlekzirzzC5kaaCz9b1oZDOiGrdlxI0GefJ0MdRMdWSj+mfl/OHiWjew+ZuMaY0NQimXGs5Cm3CunydhkaS0oaSR3sqHMp4ojOw++yYa6s0eLl/xlau1lZQ97LyB23wxxXrsrXyR+a289F5gFLuOy6TzJk0C0K0BUDSSNMjBwQpbPJWDE6VdynK5q6NzY1nzzZm2RVqNqpoaPhkCQuqB9SZrD1+tvnk6ca6sc49Qaj3oRJQGZGXd1e5vbubedwBFZhvdvIKRjZyImKnucNabPzZbM0UUEhP89riuYCxvrpqLVZQj2WxuQkLey1nhYN5vj87O8bJLGR2Vtc+t4Rn2X2bIC3y3pOtcYbfobvEWjtbDoazF86vGfIQZHlWC845X/szZP24vbvOLROBlNK0mHwf51jJME/jjD+7ST5spE0xywpUBPazQkj34eE678rvBNd8qhl8gxSa6Jlq/DZtuSJkXb+lIhX+d2zIZYC1C+kZAS8LEccYlkCXrizPOJf5Y3c5pvw1ZPVcgl7YilxQ/ruWaeUVtRolArcoAI8+cmRFycT3bememIeamjQB7yxvDruVaZpROkli7l2SK+xMupIx2XxPiisqg1QkPiW68smoSD1VK+x85//5P/6v//f//t8qAG93kpvw4mqDPx1ues/8dbGG23EiJupKfE03MgaIeNDezK/pZuKhzAsJaHCFvvorA2vbU9dhpuZufB1ib0btllm1Wtj5ySv7ZvHNlEZbTiY6wO4GJjq8BJlL/LAwHt4ao2IsLaypqSCuNRNOZFZkvmI9N3YcrDqOi/xmcuNtr6wwG35Bf36bPZiohLnKoK6iGEBRxB2Eq0MjmZ/7Kh6t/Lh582z3t5e/r0XPN47443+OfsDBzqOlT3QJIwnVf0pzW4l1pU/EJFIxBCaiUQmsCbfDk2/gX4VNK5hXlrOAnNDLlbqinXop28yetUdhTITRZmUGGwvKadFsMsPwAMYYBhYWsDwMpgklV59hTKlYaaEZdIzkDYQDk8FNr6DBTX87z/hSHup7bDd/rDuaU9D+54532wtuNdp4telmO+h9iO4zPG6A4Yg5iwUr54aaqb+Z8Bu2tbrKDp+j03hWDmMgQx5Pl8PGo1iCSjDIsLHP9sg2ry15LOA6uRPIzLxyS8Nin+3UGFf5SHqEh4UZSuQIN64i2RhbKS/d+j7LjKiZWtjJFmps2VnxAm4NAq69wxSAgkoGeBJj4UxiDiUGnw5I7l5wRXEwo2mUHbnYLKb6E35j/3qytUr/U+EFXIvHmz0RgmrEnJ/14UEs+l+2VlcPnzNfYIMlTbk1qPPSmtW+LIbYTfxzIMmuCkPhJQfhUDXljjyKFjdq5gO1E0XMciHId18ksXM62cYfu51BCu5TF03Mt9CTmjsW2coBIkA5PO4MoLC3/j2L90A1KPJxFAHOYsQsFfBzAaP6sg1eLsfnVJIH0DWNBYn9geC6iUiQhqD9YaZDvrWlbVEg5iM8sAtUKLGBcDwzaqDk+YTjGb0mHivX4mKGCFolNCgpmYIklexOzAALh6cK3HFWsTSwolI4MHYAaULppBlO533xDUJ1ylQiLviykdrUj1E/tBxTTR0kal50Yf9sPuLh7nFmCS8MWH7X0TE4p2C2ztmI8rqKMAGO2JkaZBpQUN6pAelJk7GK5e8oYl3Y8RvcMkwdXeid7QOVN7wUy4+HvQrjyDCJFZoGbwNfoXdhXHD+gyqHSw9pOxZGg7q/3u22kJacD1AadyR1Et9uZH8a8gmEYdO1dcdyJil7VNbjQ+VAZ55M3dbWb9Cs5SExjITXiNSHSI0i4RX2beJFDWQT5+riQ0lfiKuS486s6jXW5Miox+z9pGtoFkSAuTNVMldwDI3OOGLGFty7j50iHvOJgJysAG5edocsgIt8TEz7wuS1xn6jlSsne4CHiol9yfRUEjpAmgEYdsf1em8GU95lIVjlislgPk5jTxSqJmcQul7COZCZBgQ3MJt8P1eLoPPLbexL6WQCL7ftzimOZRMhMVgaRsZkrhcNT4vaF7bFxN2ULwT6VjiePeT8UXGzQPegzAMKfTUeZc4aj9zTtW4WuHFY+QTg2LNtmy8i77J4Hcf5AjKoyApBoBJUj7aZ9ZwxvkG66GzTZcbtJPtccFQpvo2zoSjdB7ie2XmwlplRzjh7k4FW2h66nskYEQucIGwdMPh7JBJS11ocAenGFjc3zeoEoGITePeF9JKypQVnCWldE3UD8tMglj54URsfji5FA5CAnEypQJgZGctkodACK074COIS7TXBlDWKBG0VHoCpeCSSnRx+LbyUyjT+8kdnIHgs4h2UR35BO3PmDwBbsb66Cv8pq9Xw/YWeBYGAdbqZddCzl/uG+P2zR2vvGYf73pv84VOHkabrysx+cIDOyx2LOBL3WvlVL4PzL/NNyfIaweCbtOS6rtnWrDznvtmFDnZZW9zlPLT8W/io6qKeG4t7vlDxQPq+CJ1um4u7vVbJC5WGPnV4trjDrgqHgfRoSevrTZYUxQoOHqTgfcRT6ttgsjOlDnk4NbuIj6CtJjt/ECYQSRTQEyrbka3VBvA+5/5LnohrPjVn7RKAlT8yXvSxlhi8FMWLXiEF0ADL2TmNliAGy97lxVfZlUN+ce9Fs1C3uRz8ry0HPEg62JLBB0wGSfyYIwZlmlRmm9aKQpVmUCyV/kmVRIE69hxHVaCOaOrjCSqEzU+UItX+URCwwGvPEtVM6EqN9yCG0FnaQzgOPvPW5zUbwyG2z816KrQWapA+zxbbyk2UqTjflJZgtARj5Q/6xzypiVrMlJfsyyd/C2UR9XVvKpMtWSaN7vBIGGy9R3GpaB6MOKSbhwX9z7/s9H7mvd9Xe88ueu//9p+qynuig2X/paLwsli0Kgxjk7yYUygqex4QXXppD7qlSi1VcqjSiscjjv79coZ4k5MoVmhbR6+4f8XRUp1JME4P9FniZqw+OxtLXTBAgQEu9I2/rucWRx+kMoBIOZ2oiSsBobCUJWOACp/NJJeM6u0WF9RSwL8wBTwGNSgMKcNR4dxbUtiSQiSFgRrJsIdkZPZDDxsRrZmh7Tb0CTTS+RMNOpjMVWVCCAYNjg1sGiEiaRjRbSgvzaqF1pg0fanX2Svo+8IA3JK4vzCJw3I72Wm3kl5L3irkbQ5lc0nNDNpWaOKorog8oQKLorB78KcxzhXIXVanB9NXyRCfuODYDEHaRT3WLahcS+EeAIVzz7ulcS2Nq9K4lT/wv4uVbkS4FqjeqNFyD8tXZtyHR4y6zZdROwWxkjK8CyyWTeF3BzerMJjyYCmqi68tGW3JaC0ZXaGoX5ggAkf2AjmlwPH5FNW0Kb1n84hpX1xJDwTBLr2ATRroPL2KtYJQBtQgMD2aSYkEfUuZ/yqUGW/Mc+VjEHtjKrggOMVT8/PEmtx9PUK8DqYWNn/U1MF7OxaYdUrqkgqHylVgXNesQHqE5P1HU771YbChk/IVbSX7liVVlbNGA6rrORHVbajVmVaDzEx67Tw2sq4bZuK0Ct0s63/mDlfwwoFUJKbqTfHlwI4m0iiOIVFdmPnlgPNfeXyn9PBCvkb57fG6nGbLfHiM7ZPxBNLJL8su85oFoPOvyUUblOwITg5tN11wVrZUKVtk1GSrx27oZGp55JIg7tfhKSN0zBDa4O1sDP3YnV8iohEEhfu0NAQfHxaXLFz1ljW2rLGGNZpXm8GSpjqwmXwSGrqpqyGyBlPAL2KdTRVmD5593fpddjZfdKnkAVvfWAx2ozHdB1qGZw9Wg9YS5YdLlOH6AOaW3iHgBBc0o6+m7b1QUw/HaglqS1D/1AR1t4LGrTLoIRLXW0u8KzoRkV75A/5jBOCqsug0HWRqGQYtqyoiaiExBaxNuJjLwSIiMfjW5Frj+ITnNH9Lq/8StPrWi9o1yFU7PWIcwLA490mjYbKl0DX5TDo1WyhslpkF8jpc4JWDTMJKXZpYAyoiecFD/wLKbGCuHSzXsFS1quKslTpFL2BAUzoor0JFyWnhC6Tly0sYOZSAqqJjBPe8xfFIQhIdMbiS4hpSasXqGtYrbhIq6lY1JH2vrilyE44NEjBnvN1ox1LMc00QUdB8KISPiUF80rGlUo9ROz0ZCMirzgwAoL42ELAMAlIrcp00y0/L0SuQxoC8a5BOGSod+WlMDszmCBH+LlZJcnIOlstvTR+e4at9PT54AScrLaSFzfFY0ded4ieb/7fqnlv6zrgXK62pgLQrjNhKbDXSCI5wmE/wCYSRSmLYVzIRMaT4V7HPCII+eyEhU3K2FOMpbCJfoUCXin0IF2M8nDIV+1Bn8Tz7HTMFAznKqlsBQH7XZJGi8scwKKTx131m0mVsY4z8u44PxeDjdx0Wc8wwlYx5mP0MBX1D/a5TNNSQfUdnVcSGMkgETIKpmAwDUThavmlF8YSGb5Bf6mFvmBFYKFtVKbNX8wwu95hrzBEwn6xvbT41VbD+3Vt/lvx8HiTeuv/jT2/94C7l73ALSrzyi+ZQm7fTmaQD2ctAwsHUZFWx5ivPk+b4N9EC/uqZ3+oOtVL7c4H0/EqCPEpECeukRsKTQ8jjSakXizTvl0XVT7rwaFtbfbKBsv5Cuthg7kLeR333HbhtaqiGoOdW8fLOTXgSyxt6Fnkq9kdQsHy5JE932dMSYOUkVU12tkIwRrFKUQUiw1FdWv0XyCOAOVDFyWkkttkj7PUIlTP4TxJ4uuwRDUNf1rbXrCC0eNH3M08B1zDh/D0gW0Zbw6lTr97Wrw9keGnL1r+vednisjIZYTA1lVlgEk0c4ZdHPJw+ek/xWqHbAKtb0vFPmbjhHm2MZoG8hH4Iy6Mue4TAPHpvnqYwUKjMOMTkqfpW01P4OsDNDhO/wGkuheGz8IvK8G2zRxPxiH2TLRVrsRoZCN5rEESHVRRRSPu2yx6hZKTr+tCXb3H9PL+vKN0d7JnKtVjlNu5L/9vl7sPXAG+us6LqgkscQ1adBOoV9iDNfVUwBAZKeXZEjnvIvrOiiAiUl0B5b2DTROgPTo/Y08erawzGxgz634j+qN9lj9ZX1zd7q096q2tnq6vb+L8/P4Ll1n352+r69urqo2+LEoitwegO0eDgvqbFWOGDJ2LHCIZf7tyyisCN1rqxdra+sb31bHvrWWmtzpf5B+cOce8H94lX45zcc5KEFx9dXklhIkM5Aaa1CvviBamWV+LQ/kiq6wm/oT/XUTuAwq39o5D0nNoxKrYEppdsb9BnEJ6Uhf1fX128100HtUp/kIga7EBee6FakdwssE5vv39TOvQJjy+Fz16pa3YcSwXaGEtqkSbax8C2KaR4KtBbEpcK/7BYxIOgCa3/tPNnuyhomlfq2g766bb0oHyPZEgyml0b1+wwdQKNYF0QhCS9MZZ8TjXpRFDJLsE+lHDw1J23clN+D9nYNYc0RpwC3GMxlOAIbBQ3DY7k64Y/O1Jz0AhJ6TAfkOPCaUGF2jotPGCdPt7RBgp9bDdLm08XHS62TAI3+b1CxWgiPRlxMPjxSTESchdHnaHi3zVTfpr02K1ytVWutsrVWxxqFEskDaDIu+5FuWSE1dyu5qrEZDhQN0ZX9c6O9K7DvrGpYrVbDY1a67G61tssVGHPzIAmn7DnTt9lYxUqfIVTL0ihh5nzpixOAzA0hj4L+EAE8Ix/V4D9XQcp1Tu7AmMGgstinvowJcKBId230NH9pRbuSFMDdXMH+5b7gLSbgPnD43hKL0UEvM9ewX+o2KSaCHJtsbnAaW1NjuN+58sfW/BD7pd0y7dBka2ikAuf4L94pWORxFJcFQAf8yvB0jAW3M8t7ov34U7DZ8umD7Cnt3tqrxWe1O6beqvypj41wT2TyjPYgKuyBfTZGx5In8U8HIltttaDsbOARKnZ1mrTLbq/CZd+mFeorjE3dDP7AyjX3zubZrTtpWUY3TIWV51GonYB1kBOU7zroH6ZWER27EA5cGbzuWBcIBISAj1LFBtBft0gIE12k63+4jBmp5M0M4A0cpG0DhBonbEOEDXODMaHQafwDtaOn0KfvQV+PsEC2YHtB09ly9G7uIZJqhM24QmMv8u16MlQg4tcIq9EE6r4lQB6e6cJe0Xw8QGn6Tw5dPGOZE1qnzGY0GKbPaJWjwhW0LDB3+xv9lnzHXvkzpC3q3nqNKE0n2ru3AaBiTo+oSqbritKuOCRCQ468gp1cPOUvrdk2ctP43BqneyYTo21xPe/K/NsGPe3KfNnqd2TpjaPz+huYF2vKq4SbvrNL+Rx0Ai22zgd3FGH/PXoXZvrjb8emFtdcY2uGHVxraL4ASuK6dlbqyKmfPP0vTYdMyaTwe/5HRxDiAjmBaJCGioe8VD+blOtaPAWRu1JplzGEdiV5NlT3FVeWxaIb3FXx/yKAKtNyfzKAt1WBcsTs+OetHf9Ad/1umKqK+it780osWwNQbbNLEOR+c5U6PpRWT/NFJ73bCLiUV4TMOuTmZUMp6ZayuQ1Rynch1JAEXV1mUZQtkeYj/SLUXOloSY9ORAi5OaUDj4aQyJlUvN0mZhwGTDu+7HQpDwAmgVywXcs4lpTNniQKBQ5EIBIG2Di0GxRkYh1McB21+7OLINXvnttSdhPVRr+9nG8NyhN6hImD6ZQX6Ap+rDrGGJLQuJWnAWCY6m8vyMWZsGgINsqBaJwGoE0jCn7SoiuCIczxQDGzFBki7hJckUNZwOQmcc89ANBDoyEmhhWCVcOpGgArmsWJ3SeINC5scG0zw5B3YAJ2cSYX0lQwolIQFRPEZwGaNRu6HIbOldB9oBklNMCrWzllFZOqZdTVkDAn/1emSmq4Fcjg2SXdVh0/LY8BYkO2dp7Aw5m/tzvohnnByBbvv+F+X7rGdR6BrWeQct6Bt3Rpm9d2jMamzmygzgFaNrIGNJomNvb3xslUDYiLD0nsSosAWMfo01sOo3HauXAXFfVSoGtFLjYebmmygvSh4l9exkfEdeGbu3qMiz6kYDOifIsxTpB6uIE42QWQVMv0IN4EuKmmBTdNwGHZCQMM68qe+ltfnWSN+tFyZ0omqU/+mSJ2Yq7d65F3ENvkCzmWtyQ1ACRq07eD7vBDYTL2wzaUkKihOchemoSsrek8AGTwqHy0hk1R17AJ+tgbFCRQZLEitNybcPQN1WhUZemIlFQ4ANB67Jf00kE4he3dI0CQGLRG0pwtgOFH1YVCRkGtC8ka7icnahBxsnb5gCcd61emNkPwvxCPRSSYtfeUpMHTE0o5mu2Bq02JAw/ZcECTGfV8Yread9MlAYPKg8yLKAw9W2f7arJALTn2N8q95gMkaaQ66+VioSP5WkaBJOhhq0NJWsVRq3C6M+kMFrf+pQxGetbnzkIZH1reSXUZ3SznZU1q5AO0SJQVtv0K/DBvTvgixx0H9BD8pVlla3Y9xDFvu7sUpUcSV61KIz9akKxClFXdN1cpRpezBOTVBUjX40DKDRvIMpR812C5Au8CHez+R/imzBffUseHiJ5KGYMgbK09ZomW7HW0IRawnGS+UuCI5f12TBqJtQtOb2BZqTahLLbnMxuFVunrZVcBQhdQzjOPtuxmfxBL28UW1eb/fX+09Wnf2uSjgQW9OWozqmdviU6LdF50ETnD8qIXF8p9MTNYMB8kXBZE49S26proinJ+zzhPk94wRzoGP4CngidBZ03oB4j0ZB23FL7tEuJo/sMyQOLVZqgBk0reOaIyITfwPPLJpm2tWEkKNd0woOA9AxIO526J67eYkES7MW1fszUKi7CUsl3vbhEUa5HKIdHZnqFnqtY2CooFtZWG6RsdM/eybCIiq7eGrkDBsF35B98LbVgq72t1dWiNmUNfiB9aOhXbbzGSyVFm8n6anHOyEQ+FQ5hbfVWqSK/qsXYFMX85jhvsgtP74f77kb60DK2B8XYsNwdua3kPOw8ggj9epHZfNNpFJFNhd7YWFqsz16rsCcmUTJlfsyHCeXfIPpv65VkYU+2IBi2BDkZO0K8dOjTj/8GhBXr2QeCUz1BamwyLWiRoOANRe7pAxp3gZAkCffGExEmTRL94Ra03PHW3PGTVb/DQ21CtvagoXmYdCm/St2hzM93tZvqRE1MIQMYos9OCc3L0TBuegVkRPhDJOKJpBqbVQ33ssC8zBVYzoeVREXSuyNccjKaUa1uPkivECWgYoKe6kSAUi0Zk6eFo27jVzzhsXGtuCOgesdknOvUZaUo2R2oKUZlhSaTXDaXGc7Nobx4xEMeX9JwkBDCgVuzQF0zm76ObmROEG1yf1qdmfkYshQ1WcaxDGnOSDpb1WQKyhDRYFlpYnZpAv8qbJF5T+zfRDKengpPhYWCkQ1E3opUuyfB0iI4oFjPehpC9hdIMMg0zYEuOkVqX1xyHwWTB6VyaKWxByeN1aoZVmxG01o1Zy3Zm2EnmdOW0tTYBJ//ZpMyTtSVYGTfNJ2p+Ihtl6Wutw0H3LvErI5jQZlAG4hfZrRWAPv6BDA+n//OyQJ1ZjCIW7TJUCVDvVkkffOrI+ktDX7oNDgWExlaDFtgn2a2cU3+EbBI2c8mnJdkysR1ZLbJ8RYmqEed7kk+XUs8vyLimaFBw5Y7Sd1RNMj3eJbVOcqUKxmO6bFKA58lsRyNRDyv4tLG6vbaen9rncpl+VLDW+woPAg9NZHhyNTpaPDA2OWhJ4IcBDlkWk0EWEPduiz24VGpa57tRsW90mI6RCMO5SiluzBjABHPKI7e8peWv3xJjasvAMWKDGQPf1vIQHbxaew6HeTMBL0KG/swwUAt87gf5tFSl5a6fCXUZZb0yv16wRV1nDzTa2LDWj1osU3XDcNLxrFKR2NXgLV6vmIOzBm0CLSrRIpw8pYMfUUyrDnIg73FO5zljsgPHzVDgD1YvMPgSSnAaGNz49mzjVa92xLnB0qcqYJNI/Jsmi4g0NSqQKKNcHg3+nxuZ28p9F+PQpsCS7ChLYFuCXRLoHMCHapEDqc9Hk6hWS2dfo1NmGlSVftCugmG4xhkBKeOSBrzeyw8GUkMQcesFzoBZXKmy8sSTpMxXDOZ9NkueU9hCZZEhL7JXy+Nmg4cLSbcOzr9jqVh7jhghsocJUGTAPvVgAvQLuzYFbY84OvhAR+LYfjoR9czTRH+lnK3lPshUu6sXOTM7CFOQckZCURck4WRsefm22WnuY+Wtcu45NXWO69PEXKYw9NS2PuJ02jTpbTpUtp0KY3SpTygYJdXDrFtYzofoshQl2fCvNQMz5/1kMMok8yVWZVTEGZe7/DMioIpmGkTlZtsrUSRJ6GA0h2h73wrKeZmywxahP5hBm0rMnw9j7IOYAmOEQRHQ9zwefTIHCKUo7FxLGXCa5/2lJL2OODgRGOzWYIO2FfXYTHiCkMrVHglUCRNlM07EEuT2haVBplWAOutG20BI8ejhBLnUiakKJieqcPmCsdjYj35jTIaR8Bawg4sZIMD40UKK7cEzj2P5lp6P3eyrrN29ZQS+uVzZAAix8bMWxaU9w9NCXqak5eWST5EJjn/Xb3yR2Z9WJANYTZPrTaBp/NQFu0UXcshM+qDgQiHmOONiSsREosiCNmEQzluxi2983LewKvcYTGbHYmk5bKf6WF+WBCBagxRi0AsDmAj/TOutcB/6y9Lyy0CtxT8QVHwbgfYdoEq7/symUOR8TMQGxQQDe5BBo8a8azPLNE0pQ/zwHvm8RD0TQPBhC8TUkAsJrXQtqW1f1la+ylfWsuUD3ktrov4DQ+hgrBfCirASeoDCv6yLGM/v4ut+P8wmcfcYIVZHKTcoE6i77Pjis6L8sUA08g0GAPh8VQ7kUM5VyHQfHY9loHAJ7upx7OYyVDXls38FdlMHVx5qFo1xUmDIGbDtgjj4DiAWYgrEU8hqG2eo853edwz4RzZZyyzAXIHlZ+pIBckIa3mvVhoc/oaoMwOZajifTPlQuNSGyrT8rY/g2oL4mfQXDoj+nvH91GLza1NtZR2o/B5hp67Gd/ivn+ST9Nyrb8O1/qEUeiEL/8Q07olz3sjWVRjl4LMM77PvhET9avsQlx5nHjKp4QwHqVOw2/Q+ltMwxbzUNMIS3mnO/0Qt1QMRSvTbAtM6k8wIcXcu4SxqhHg+aIf2JttJycR7Zut5WvN+NrKH86N+UhXo/ruOxGY5mkOqzMtyKndXGHu+07KuqooSbFJt+WIMc7YMsW/JFO8dU30MuciLFmGec1fxB3Hz9bt8qmHapc6Kdzglmc9YJ7FtRaJXgE/pkDNiondM18Zx1y0VeVj8XvGXyY33vbKSkYazZ/nJ69svkJfXElPsDgNQ3TZGwvrPrAbYHTWzvGBU/zFofg4z/nJK5dlvYA8uTWaRwPdDiz1y1Ry2XNBeIjVXAob0BKcluBoGK9T58CEM82iNKdJLPjE0pmRvBJhTmi6LplBOQBaGZLTZxYHNZUdhiRpYNbwuDcWvuNBfAKlPK1qV+NjWAsBj14ISAp4PBKUkrsB7cFlNiQ8jeXkeWLYC0MXyaUyhgKlOygt6yabpPuLBbE7z5CJYmkc3CYaAgHQiAhfjvwpLxFJz0BRpxuqZhMcyBAwnK7C+urj6sqwMIplbn/2FW7UGRvw7ODWTZQvh1L4rX3hs7GYtRqMM0sWpoAxHo3midRDiSa7z3E6D431pdFsSfs8midnF75SGEwiJpGKeTxFomti31ClkwaJhGJMK3A9e1DZzIl+gYJNMBaWjObABEOw78diKGIRemjiB3Oj8RfI3QrgcQ2Zd+lXKgGTe6A14Ig0751l8ZrlNZdGz3MYDu04D0wgd7agFcdbcZxu5QqE1j/ebECa2DfU9NsFNIpoEWc/nB69ZgPlT8lnlTr3RAgaO986BH4G+sR2AtzABEvVkBIiIyVmzqy43XLU7Dnt3RfRLzi3+SFqF1pi1hIzJGZRtKJFkkaLq1QbNSOPIoY9ajQN0MzWu0sj28MgMRAa8wuB32dnY8GGUKYqc/PK7Gt2NqoeRfWsoYSercdFJEuFLsU5RbCq/ihRhF8QviK1afR6PpWjsCfDzHUNp/4M77Alrvp87wo8LoNrTZwccLey5VI0LLi3Suubd5MwbTZFJyJCFQj8cBAeimSsCuW4eBxjLi6ZiImuzl0uQdfJK5DbKSY0pvH0k5rQz8LXr/hVlJZbBu19FzyUJPlxHDsbhe6FLRl82GRQTLgMZpBBgS49gHsWNUEYm5WAwW1jBSf0JcApwOMgFpqwOqOpS1CzfQS0Ss0+hXvWnQkIGaNyDwtNrMLSjmzTZ+rJhFltKQissJN5zL4ob34DIkEzNCEOix2ET93ZtcB6za3OrqVZn4hm2Yb1ZGvXPFRKpIvyw9XRrxcylHpc1xyr4Vicnk3T+uxgmH8KhfAhgYYjvXWN8xWBzWToBakPrkol4Y55Kpqi6AcjgQ2E6XQ0Ejqh8quNieWJ3aG/Br10D3zByC4lMr5e7pE1IIzZZLegjXOk6ez9/DXJ0TycmrQtC/JZY0qHxYgAG90IAeQoFD5si3n34AmB9xnKx+Dy0WSYXVutnJxETH+O6okzdSlqSzwXhyi+uxj1ZQl0tsomLJLuCZRc0C7cA1XQ1JViPnY7YzURaOyMG0+ad0FraSbv5yWES7hqttfZouJqC1DMR9/KMyQnRT74gvJAL1iwFtoi6gLqAJmT6zbFZiREitkL1EhS7rv/v72r620bx6J/RfDTDuDEwD52njLpoCiwmLR20z4MBgNapmMhsqSIUjLewf73xb380AdpW3ITdBKfPrW1xC+Rl/ecc3mZUPXJf8311/xjXOZKXZBxphuLLR7Xvz3K0qVwdv+pZFzKSrl/636oXRbzEhernZ/50E4nuweQIZZZXO740KPmDwmrm52CE0KvG5S/F/fTaL2qFfSj5nJ39u7rsF2rK1mJJFWX0c02qThyOauS1H29RDmbq53uf0t5fPzd7Bt0bfe3jU7UuX+WbITSu5k5Nqjn5aLKy2H39tkaeBuXHNqq9MvUwVbEMpl9WiQLvUZGFN3+Tkyj84LaRVVZs+6rP5AO/NBrbdTYcPFmfiXKlcrnIHvDZiqxa/f4NQtCVbLsHqI53hx3R3uUsKmrdjys3nAqma7NaI6vwnSYexsunhbAycXzaj9Q+Fbe5en2FxHf18X40r3vwldI10W4rlLGOZ0uHVcPHVjQ74VK7RmL5kN7n8UbSL/z3SZ6luXXwOK9l7tWgyhxf2sac6/v5U7X8B1mwo2rN6a8XS12WfyezuyO+3o6ds2vizY/zypuhKJuyNVtMT/pO7rZyNd/lltKaUh6XLUhUyUe+d8yKTufuz9vPsiMYIzsXrea1dtl4L7F2yz5q0njzYakdcVqa049CWXJa39KtQ193yz3TGnL7DXGqT0D+t9r77AOmnuNe1G3ja5xcI7vYKvjm/bXVomG8C6E4nTq7coic6CCjj/oprg82Pu9OevH6bXid/nbZqcXU6cmFkJ0HU0i5AO1JOYG3Ml0ktfVXU5/DVTlb0FmMyYvrZSxTMwE7bRGm/9jbmtpI6OcRzmdKKH+tH9/KP9UlBiDH1jpeRHzNbwp/xdf8rHfCzUb5YVpd2e0uG3G0I8UIJr2P5S6wZM/PFGiMz+sHtHcWOK8u9apUA29rBG7ao5mj22WPrrlxooH8tIYl4UbTyXUpbICl1D2gWN9MUfrtImivCaPIk1WLqlCbBGAG9+cJtDtQKf8hmdb2yEn4JTESaHDDXrLq6ngvV4rz7K2dSO6Dr0Opx315ipRRSp2Eb06pUjo+yx/ygJ2dOVP4U5Bx4fgYcBt3DZ863APPs8181OIHcdpUO4M0w/6xL2aez3hKry+fJ53lx6HybF9EAM8VD5fFpzufWafzqEpsihENVQ579I0QfMsWubVpuOFr2ScbEU6oNzfeAsdWHBvPEzb/T2L20opinXhusBEmcEJjbQ1dkfHiwnacdsXl8yf3XgVQoW3jp4XoWR5sRYxTcpHvzx33rU/KoZCNtV4gxNomsGpvIh6VjwviqBvQhbObrXTzs0Aeldq7H7A5o4jfr50UF63gUWZ3zHB7bOmphkMqsdVaPc3ZpNGMC1894J9IwQRmGBpeKljraqSig/JXhnO3OoGLe68fTHIoygTkVW/6YMJCx0Dxadhj6V6uEtUpTn6uWtvwL02+x8dqPBm1cdsxaezlfOt21oDLWp2c5vcuo526XYizjNlr5+aPlucBHvfLqauBbB5QaZSrAaSsfPWWGkOtqMM6L458Ew706KRR74jBsOUIhvdRTmXoCXjaJIlL3bH7ZiZXPu9nOtNnisZ7fK6dJX61uQLFeOa0ohCLIwc+rT20U+piOWGrzE51JrbvS1oFeC3Y53IdHVkjtXLbRJMBOlGIs+qJKsDdS/43WhZV1VOx6qWMj1cWSXLw77lLzuOJE2yOsnupjT6kbgrpYtX+EIFUFZVuoaHjJKIye1J5epOJ1D4VCaPIt5Fn/I0iXeXgS/GJdCrhXmU7ujTO6/a5E+RvhcmGNe1r2P9pJc8t8Lf2A24HYyRtpn0x5bTtKpLDpP1GuvndglYOc/CtI2BWUljrfQ8UNEgix160VwegFiCc44loGmhrWMglsBsq2b+64OeoVjQ6/D+a5yWhiNjq0/RAc6GaiujT0f2TdAoxd/0420o/i/qNITKPHRi9tbtuzKVcdU0mgp0knNRfeltP8N8u2vNXPRdO96XGMGSi/B7ZadFreQf/9pUVaHezWZPT0+XTSqaGT90kWfLXJR06uEnnl0kQfE90lyQ3ZYK3sH2FmUe+2nEvnTQ2Lux7w7W88RYXLX3p39WhAXiKhBXgbgKxFUgrgJxFYirQFwF4ioQV4G4CsRVIK4CcRWIq0BcBeIqEFeBuArEVSCuohtXAVnunGW5SSjt6wfpJ2WJ7ILpa0IuGbR1PY6QiWOWDCVySZRLAkXYr6iXaRJbcd8lC8mppXw9Hu2XjFe0i9Qi04hHlaufu+twqnGD0MKNps3HiIH6+u4jqaamfw9Lp9qxLJ1RfyUyC5hyMOVgysGUgykHUw6mHEw5mHIw5WDKwZSDKQdTDqYcTDmY8jfNlINMPmsyedaeUTPrn1/ca5DhH/r4qskHzgDZ9uYDMCDN4/sAh9Bkj+QtuIs7BrO47YXcduFf7P6AYwdZQ+Bs4M2vLUykEVn3BIV3mqwDWJ4jC2OLMK2L1es6JYCIcPDc4LnBc4PnBs8Nnhs8N3hu8NzgucFzg+cGzw2eGzw3eG7w3M8YER66I2VI6DdodtDsQZqdipB77to0iZMoy95Brt0lWOo/2SASjY1ERjfUU1pCxtf2fs08G5NNaQ/1PpffeSf597DAtith8Lhvt7P9bw8Z20c3YsSbJYY2PHem/YjG0dvxezPxMlpQgr+k0mltOLGXum+RSDmjdD3YyPMCVh+sPlh9sPpg9cHqg9UHqw9WH6w+WH2w+mD1weqD1QerD1b/JfK8dK5p6XOphyNxh6aAgQ4AHeCADjCzrkZYD9A/DhAEzIMua74nDKhNXqeraMn4ahWg1J5FDjDteIVR+X3+2ruTgT+XvZMBIfoI0QeZDzIfZD7IfJD5IPNB5oPMB5kPMh9kPsh8kPkg80Hmg8wHmY8QfVDzr4SaZxPjJVn/T6Iqdgweu9NfeTaDnyxktuIbwvkWY34rsHbUJV+orr2k3OISQxpSrpy8riIRfZPLRR7fy4rgUyaNJ3USS6+odUM4+eNXywaH4pXQ0n3/cp/fCfQE9AT0BPQE9AT0BPQE9PSy6KnfRDbjAC4ALg64TAORQQvaokNzyw8H4Ce1cKtD3RqfbV3m20hkudaRnYxutazTwIY+nPyjQoBOdKTXok6ryTv7f8N860RFS8lkREvGHxqm0Q3OoA1Ef6PL6L1uDaNDcp6aD9MkCD33ECMIX4BugG6AboBugG6AboBuPwK6IWsJAp0R6IxAZwQ6I9AZgc4IdEagMwKdwfeA7wHfA74HfA/4HvA9b4vvQaAz4gVeQ7zA4UDn2UM5I59sEsw4snDkh10AZj/x2bd6uU10shG75RhX72XCCj7PqW0/Kqxg3957KKVIfyfuDA+NW97yEfbvxZD6Af0A/QD9AP0A/QD9AP0A/SD1Q+qH1A+pH1I/pH5I/ZD6IfVD6gffA74HfA/4HvA94HvA94DvgdQPqf/spf6/2//8+P5/k1CSsw+yOpxBgB7w3IUoX0ciuIw6XtJpWv+HIReLF6IUW1mxgv17QE4epNH3oIGxqXbVVWXtLWjvDetvTLqDzdzu5N2E0MRkWHq1r57TC5UeqA2oDagNqA2oDagNqA2oDSo9VHqo9FDpodJDpYdKD5UeKj1UevA94HvA94DvAd8Dvgd8z/nwPVDpodK/QZV+ZryN4AH9K/5tUOZ/86jIIuuYBheUcRlP1eqvrGsEuR5yPeAb4BvgG+Ab4BvgG+Ab4Bvkesj1kOsh10Ouh1wPuR5yPeR6yPXge8D3gO8B3wO+B3wP+J4z4nsg10Ouf4tyvXEygnL9Nf82SK43jwrtYTzKlxDrr60/9ObE+pdI+j9sJ7kptNmIjGOuWz96M3HF1K1dpVOkLkkbsWe4FADhC4CzgLOAs4CzgLOAs4CzgLPj4CzCFxC+gPAFhC8gfAHhCwhfQPgCwhcQvgC+B3wP+B7wPeB7wPeA73lbfA/CFxC+8BbDFx7KmXEdLqyzFg5l0A9Fdoehh302zTykvYusfcN9ZErv+KKmsFPjGT7Prz236K1FNkDHB64DrgOuA64DrgOuA64DroOODx0fOj50fOj40PGh40PHh44PHR98D/ge8D3ge8D3gO8B3wO+Bzo+dPzz0vGVUDPtRwTl+wX9FLElPJyHoP1gyyCu8zK0sk5V7hdXi4V1eqDYQ7EHggOCA4IDggOCA4IDggOCg2IPxR6KPRR7KPZQ7KHYQ7GHYg/FHnwP+B7wPeB7wPeA7wHfcz58DxR7KPZvVbG3vsPBI/cDVPvOwXvG0T1L6czwVlTxRirfBp8s5Ju6IeVDyge0A7QDtAO0A7QDtAO0A7SDlA8pH1I+pHxI+ZDyIeVDyoeUDykffA/4HvA94HvA94DvAd9zXnwPpHxI+a9Iyk+ydU6v3smeMj+XVZnIRxkZsoof7E/RuazqMlM0RadRkYpqnZfbqXllGslsVeQJMVCJ0r79NLohuXzKE/mbXC7y+F5W5DkJZxLZYTK+wXWa0BK4+vTRFNoV8S0D1lXx72T1Ube2pdYPErv31Wp7/4/RvUM16F95Imcy5iG4qauirsznPn2C8Z//A/yO5V4I0AQA" + SPEC_TMPFILE="$(mktemp)" + trap 'rm -f "$SPEC_TMPFILE"' EXIT + echo "$EMBEDDED_SPEC" | base64 --decode | gunzip > "$SPEC_TMPFILE" + URL="$SPEC_TMPFILE" fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stdy/cli@0.22.1 -- steady --version - # Wait for server to come online + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=0 + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Steady server to start" + cat .stdy.log + exit 1 + fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 4b777e0..bef4dad 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=repeat --validator-form-array-format=repeat --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi diff --git a/src/APIError.php b/src/APIError.php new file mode 100644 index 0000000..1440a81 --- /dev/null +++ b/src/APIError.php @@ -0,0 +1,100 @@ +|null + * } + */ +final class APIError implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + #[Required] + public string $code; + + #[Required] + public string $message; + + /** @var array|null $details */ + #[Optional(type: new MapOf('mixed', nullable: true))] + public ?array $details; + + /** + * `new APIError()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * APIError::with(code: ..., message: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new APIError)->withCode(...)->withMessage(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array|null $details + */ + public static function with( + string $code, + string $message, + ?array $details = null + ): self { + $self = new self; + + $self['code'] = $code; + $self['message'] = $message; + + null !== $details && $self['details'] = $details; + + return $self; + } + + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + public function withMessage(string $message): self + { + $self = clone $this; + $self['message'] = $message; + + return $self; + } + + /** + * @param array $details + */ + public function withDetails(array $details): self + { + $self = clone $this; + $self['details'] = $details; + + return $self; + } +} diff --git a/src/Accounts/Account.php b/src/Accounts/Account.php index 270cb3e..cb93122 100644 --- a/src/Accounts/Account.php +++ b/src/Accounts/Account.php @@ -4,17 +4,30 @@ namespace BeeperDesktop\Accounts; +use BeeperDesktop\Accounts\Account\Status; +use BeeperDesktop\Core\Attributes\Optional; use BeeperDesktop\Core\Attributes\Required; use BeeperDesktop\Core\Concerns\SdkModel; use BeeperDesktop\Core\Contracts\BaseModel; +use BeeperDesktop\Core\Conversion\MapOf; use BeeperDesktop\User; /** * A chat account added to Beeper. * + * @phpstan-import-type AccountBridgeShape from \BeeperDesktop\Accounts\AccountBridge * @phpstan-import-type UserShape from \BeeperDesktop\User * - * @phpstan-type AccountShape = array{accountID: string, user: User|UserShape} + * @phpstan-type AccountShape = array{ + * accountID: string, + * bridge: AccountBridge|AccountBridgeShape, + * status: Status|value-of, + * user: User|UserShape, + * capabilities?: array|null, + * loginID?: string|null, + * network?: string|null, + * statusText?: string|null, + * } */ final class Account implements BaseModel { @@ -22,29 +35,73 @@ final class Account implements BaseModel use SdkModel; /** - * Chat account added to Beeper. Use this to route account-scoped actions. + * Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. */ #[Required] public string $accountID; + /** + * Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. + */ + #[Required] + public AccountBridge $bridge; + + /** + * Current connection status for this account. + * + * @var value-of $status + */ + #[Required(enum: Status::class)] + public string $status; + /** * User the account belongs to. */ #[Required] public User $user; + /** + * Runtime chat/message capabilities for this connected account, when available. + * + * @var array|null $capabilities + */ + #[Optional(type: new MapOf('mixed', nullable: true))] + public ?array $capabilities; + + /** + * Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. + */ + #[Optional] + public ?string $loginID; + + /** + * Human-friendly network name for the account. Omitted when the network is unknown. + */ + #[Optional] + public ?string $network; + + /** + * Human-friendly account status text. + */ + #[Optional] + public ?string $statusText; + /** * `new Account()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Account::with(accountID: ..., user: ...) + * Account::with(accountID: ..., bridge: ..., status: ..., user: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new Account)->withAccountID(...)->withUser(...) + * (new Account) + * ->withAccountID(...) + * ->withBridge(...) + * ->withStatus(...) + * ->withUser(...) * ``` */ public function __construct() @@ -57,20 +114,38 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param AccountBridge|AccountBridgeShape $bridge + * @param Status|value-of $status * @param User|UserShape $user + * @param array|null $capabilities */ - public static function with(string $accountID, User|array $user): self - { + public static function with( + string $accountID, + AccountBridge|array $bridge, + Status|string $status, + User|array $user, + ?array $capabilities = null, + ?string $loginID = null, + ?string $network = null, + ?string $statusText = null, + ): self { $self = new self; $self['accountID'] = $accountID; + $self['bridge'] = $bridge; + $self['status'] = $status; $self['user'] = $user; + null !== $capabilities && $self['capabilities'] = $capabilities; + null !== $loginID && $self['loginID'] = $loginID; + null !== $network && $self['network'] = $network; + null !== $statusText && $self['statusText'] = $statusText; + return $self; } /** - * Chat account added to Beeper. Use this to route account-scoped actions. + * Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. */ public function withAccountID(string $accountID): self { @@ -80,6 +155,32 @@ public function withAccountID(string $accountID): self return $self; } + /** + * Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. + * + * @param AccountBridge|AccountBridgeShape $bridge + */ + public function withBridge(AccountBridge|array $bridge): self + { + $self = clone $this; + $self['bridge'] = $bridge; + + return $self; + } + + /** + * Current connection status for this account. + * + * @param Status|value-of $status + */ + public function withStatus(Status|string $status): self + { + $self = clone $this; + $self['status'] = $status; + + return $self; + } + /** * User the account belongs to. * @@ -92,4 +193,50 @@ public function withUser(User|array $user): self return $self; } + + /** + * Runtime chat/message capabilities for this connected account, when available. + * + * @param array $capabilities + */ + public function withCapabilities(array $capabilities): self + { + $self = clone $this; + $self['capabilities'] = $capabilities; + + return $self; + } + + /** + * Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. + */ + public function withLoginID(string $loginID): self + { + $self = clone $this; + $self['loginID'] = $loginID; + + return $self; + } + + /** + * Human-friendly network name for the account. Omitted when the network is unknown. + */ + public function withNetwork(string $network): self + { + $self = clone $this; + $self['network'] = $network; + + return $self; + } + + /** + * Human-friendly account status text. + */ + public function withStatusText(string $statusText): self + { + $self = clone $this; + $self['statusText'] = $statusText; + + return $self; + } } diff --git a/src/Accounts/Account/Status.php b/src/Accounts/Account/Status.php new file mode 100644 index 0000000..4fd318d --- /dev/null +++ b/src/Accounts/Account/Status.php @@ -0,0 +1,27 @@ +, type: string + * } + */ +final class AccountBridge implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. + */ + #[Required] + public string $id; + + /** + * Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. + * + * @var value-of $provider + */ + #[Required(enum: Provider::class)] + public string $provider; + + /** + * Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. + */ + #[Required] + public string $type; + + /** + * `new AccountBridge()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AccountBridge::with(id: ..., provider: ..., type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AccountBridge)->withID(...)->withProvider(...)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Provider|value-of $provider + */ + public static function with( + string $id, + Provider|string $provider, + string $type + ): self { + $self = new self; + + $self['id'] = $id; + $self['provider'] = $provider; + $self['type'] = $type; + + return $self; + } + + /** + * Bridge identifier. Beeper Cloud accounts often use the network type (for example matrix or discordgo); on-device accounts use a local bridge ID (for example local-whatsapp). Available in Beeper Desktop v4.2.785+. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Where this account runs: on this device or in Beeper Cloud. Available in Beeper Desktop v4.2.785+. + * + * @param Provider|value-of $provider + */ + public function withProvider(Provider|string $provider): self + { + $self = clone $this; + $self['provider'] = $provider; + + return $self; + } + + /** + * Bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. Available in Beeper Desktop v4.2.785+. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } +} diff --git a/src/Accounts/AccountBridge/Provider.php b/src/Accounts/AccountBridge/Provider.php new file mode 100644 index 0000000..0278bab --- /dev/null +++ b/src/Accounts/AccountBridge/Provider.php @@ -0,0 +1,19 @@ +, + * user: User|UserShape, + * capabilities?: array|null, + * loginID?: string|null, + * network?: string|null, + * statusText?: string|null, + * } + */ +final class AccountGetResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. + */ + #[Required] + public string $accountID; + + /** + * Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. + */ + #[Required] + public AccountBridge $bridge; + + /** + * Current connection status for this account. + * + * @var value-of $status + */ + #[Required(enum: Status::class)] + public string $status; + + /** + * User the account belongs to. + */ + #[Required] + public User $user; + + /** + * Runtime chat/message capabilities for this connected account, when available. + * + * @var array|null $capabilities + */ + #[Optional(type: new MapOf('mixed', nullable: true))] + public ?array $capabilities; + + /** + * Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. + */ + #[Optional] + public ?string $loginID; + + /** + * Human-friendly network name for the account. Omitted when the network is unknown. + */ + #[Optional] + public ?string $network; + + /** + * Human-friendly account status text. + */ + #[Optional] + public ?string $statusText; + + /** + * `new AccountGetResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AccountGetResponse::with(accountID: ..., bridge: ..., status: ..., user: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AccountGetResponse) + * ->withAccountID(...) + * ->withBridge(...) + * ->withStatus(...) + * ->withUser(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AccountBridge|AccountBridgeShape $bridge + * @param Status|value-of $status + * @param User|UserShape $user + * @param array|null $capabilities + */ + public static function with( + string $accountID, + AccountBridge|array $bridge, + Status|string $status, + User|array $user, + ?array $capabilities = null, + ?string $loginID = null, + ?string $network = null, + ?string $statusText = null, + ): self { + $self = new self; + + $self['accountID'] = $accountID; + $self['bridge'] = $bridge; + $self['status'] = $status; + $self['user'] = $user; + + null !== $capabilities && $self['capabilities'] = $capabilities; + null !== $loginID && $self['loginID'] = $loginID; + null !== $network && $self['network'] = $network; + null !== $statusText && $self['statusText'] = $statusText; + + return $self; + } + + /** + * Chat account added to Beeper. Use this to route account-scoped actions. Examples include matrix for Beeper/Matrix, discordgo for a cloud bridge, slackgo.TEAM-USER for workspace-scoped cloud bridges, and local-whatsapp_ba_... for local bridges. + */ + public function withAccountID(string $accountID): self + { + $self = clone $this; + $self['accountID'] = $accountID; + + return $self; + } + + /** + * Bridge metadata for the account. Available in Beeper Desktop v4.2.785+. + * + * @param AccountBridge|AccountBridgeShape $bridge + */ + public function withBridge(AccountBridge|array $bridge): self + { + $self = clone $this; + $self['bridge'] = $bridge; + + return $self; + } + + /** + * Current connection status for this account. + * + * @param Status|value-of $status + */ + public function withStatus(Status|string $status): self + { + $self = clone $this; + $self['status'] = $status; + + return $self; + } + + /** + * User the account belongs to. + * + * @param User|UserShape $user + */ + public function withUser(User|array $user): self + { + $self = clone $this; + $self['user'] = $user; + + return $self; + } + + /** + * Runtime chat/message capabilities for this connected account, when available. + * + * @param array $capabilities + */ + public function withCapabilities(array $capabilities): self + { + $self = clone $this; + $self['capabilities'] = $capabilities; + + return $self; + } + + /** + * Bridge login ID for this account, when known. One bridge login can contain multiple chat accounts. + */ + public function withLoginID(string $loginID): self + { + $self = clone $this; + $self['loginID'] = $loginID; + + return $self; + } + + /** + * Human-friendly network name for the account. Omitted when the network is unknown. + */ + public function withNetwork(string $network): self + { + $self = clone $this; + $self['network'] = $network; + + return $self; + } + + /** + * Human-friendly account status text. + */ + public function withStatusText(string $statusText): self + { + $self = clone $this; + $self['statusText'] = $statusText; + + return $self; + } +} diff --git a/src/Accounts/AccountGetResponse/Status.php b/src/Accounts/AccountGetResponse/Status.php new file mode 100644 index 0000000..62190c3 --- /dev/null +++ b/src/Accounts/AccountGetResponse/Status.php @@ -0,0 +1,27 @@ + */ + use SdkModel; + + /** + * New recovery key. Show it once and ask the user to save it. + */ + #[Required] + public string $recoveryKey; + + /** + * Current app sign-in and encrypted messaging setup state after creating the new recovery key. + */ + #[Required] + public Session $session; + + /** + * `new RecoveryKeyResetResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * RecoveryKeyResetResponse::with(recoveryKey: ..., session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new RecoveryKeyResetResponse)->withRecoveryKey(...)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + */ + public static function with( + string $recoveryKey, + Session|array $session + ): self { + $self = new self; + + $self['recoveryKey'] = $recoveryKey; + $self['session'] = $session; + + return $self; + } + + /** + * New recovery key. Show it once and ask the user to save it. + */ + public function withRecoveryKey(string $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state after creating the new recovery key. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session.php b/src/App/RecoveryKeyResetResponse/Session.php new file mode 100644 index 0000000..15f4319 --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session.php @@ -0,0 +1,158 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/E2EE.php b/src/App/RecoveryKeyResetResponse/Session/E2EE.php new file mode 100644 index 0000000..b6dcf32 --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/E2EE/Secrets.php b/src/App/RecoveryKeyResetResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..0b9dddf --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/Matrix.php b/src/App/RecoveryKeyResetResponse/Session/Matrix.php new file mode 100644 index 0000000..d8317dd --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/State.php b/src/App/RecoveryKeyResetResponse/Session/State.php new file mode 100644 index 0000000..1de614f --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\RecoveryKeyResetResponse\Session\Verification\State|value-of<\BeeperDesktop\App\RecoveryKeyResetResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/Verification/AvailableAction.php b/src/App/RecoveryKeyResetResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..ba3b68d --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/Verification/Method.php b/src/App/RecoveryKeyResetResponse/Session/Verification/Method.php new file mode 100644 index 0000000..c74adc0 --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/Verification/Purpose.php b/src/App/RecoveryKeyResetResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..5091b75 --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/Verification/SAS.php b/src/App/RecoveryKeyResetResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..7b44bbe --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/RecoveryKeyResetResponse/Session/Verification/State.php b/src/App/RecoveryKeyResetResponse/Session/Verification/State.php new file mode 100644 index 0000000..fce40f4 --- /dev/null +++ b/src/App/RecoveryKeyResetResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Recovery key saved by the user. + */ + #[Required] + public string $recoveryKey; + + /** + * `new RecoveryKeyVerifyParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * RecoveryKeyVerifyParams::with(recoveryKey: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new RecoveryKeyVerifyParams)->withRecoveryKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $recoveryKey): self + { + $self = new self; + + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Recovery key saved by the user. + */ + public function withRecoveryKey(string $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse.php new file mode 100644 index 0000000..eeb43c2 --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse.php @@ -0,0 +1,77 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * `new RecoveryKeyVerifyResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * RecoveryKeyVerifyResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new RecoveryKeyVerifyResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + */ + public static function with(Session|array $session): self + { + $self = new self; + + $self['session'] = $session; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session.php new file mode 100644 index 0000000..73c0e88 --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session.php @@ -0,0 +1,158 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/E2EE.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/E2EE.php new file mode 100644 index 0000000..d5819aa --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/E2EE/Secrets.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..6595052 --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Matrix.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Matrix.php new file mode 100644 index 0000000..206a379 --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/State.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/State.php new file mode 100644 index 0000000..36eee0d --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\RecoveryKey\RecoveryKeyVerifyResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\RecoveryKey\RecoveryKeyVerifyResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/AvailableAction.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..2097bcc --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Method.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Method.php new file mode 100644 index 0000000..010c702 --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Purpose.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..3678610 --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/SAS.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..0899d5d --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/State.php b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/State.php new file mode 100644 index 0000000..f5678dc --- /dev/null +++ b/src/App/Setup/RecoveryKey/RecoveryKeyVerifyResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + use SdkParams; + + /** + * New recovery key returned by the reset step. + */ + #[Required] + public string $recoveryKey; + + /** + * `new ResetConfirmParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * ResetConfirmParams::with(recoveryKey: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new ResetConfirmParams)->withRecoveryKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $recoveryKey): self + { + $self = new self; + + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * New recovery key returned by the reset step. + */ + public function withRecoveryKey(string $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse.php new file mode 100644 index 0000000..8615102 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse.php @@ -0,0 +1,75 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * `new ResetConfirmResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * ResetConfirmResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new ResetConfirmResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + */ + public static function with(Session|array $session): self + { + $self = new self; + + $self['session'] = $session; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session.php new file mode 100644 index 0000000..1f386f7 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session.php @@ -0,0 +1,158 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/E2EE.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/E2EE.php new file mode 100644 index 0000000..63e9616 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/E2EE/Secrets.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..d08a12e --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Matrix.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Matrix.php new file mode 100644 index 0000000..aaec737 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/State.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/State.php new file mode 100644 index 0000000..90e7aa0 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\RecoveryKey\Reset\ResetConfirmResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\RecoveryKey\Reset\ResetConfirmResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/AvailableAction.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..38f5109 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Method.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Method.php new file mode 100644 index 0000000..bf18379 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Purpose.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..0e479a3 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/SAS.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..6e9d57d --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/State.php b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/State.php new file mode 100644 index 0000000..8ed4f50 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetConfirmResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Existing recovery key, if the user has it. + */ + #[Optional] + public ?string $existingRecoveryKey; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $existingRecoveryKey = null): self + { + $self = new self; + + null !== $existingRecoveryKey && $self['existingRecoveryKey'] = $existingRecoveryKey; + + return $self; + } + + /** + * Existing recovery key, if the user has it. + */ + public function withExistingRecoveryKey(string $existingRecoveryKey): self + { + $self = clone $this; + $self['existingRecoveryKey'] = $existingRecoveryKey; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse.php new file mode 100644 index 0000000..72d1d14 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse.php @@ -0,0 +1,97 @@ + */ + use SdkModel; + + /** + * New recovery key. Show it once and ask the user to save it. + */ + #[Required] + public string $recoveryKey; + + /** + * Current app sign-in and encrypted messaging setup state after creating the new recovery key. + */ + #[Required] + public Session $session; + + /** + * `new ResetNewResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * ResetNewResponse::with(recoveryKey: ..., session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new ResetNewResponse)->withRecoveryKey(...)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + */ + public static function with( + string $recoveryKey, + Session|array $session + ): self { + $self = new self; + + $self['recoveryKey'] = $recoveryKey; + $self['session'] = $session; + + return $self; + } + + /** + * New recovery key. Show it once and ask the user to save it. + */ + public function withRecoveryKey(string $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state after creating the new recovery key. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session.php new file mode 100644 index 0000000..a688974 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session.php @@ -0,0 +1,158 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/E2EE.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/E2EE.php new file mode 100644 index 0000000..34aa29e --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/E2EE/Secrets.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..f672f47 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Matrix.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Matrix.php new file mode 100644 index 0000000..4393e77 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/State.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/State.php new file mode 100644 index 0000000..941d473 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\RecoveryKey\Reset\ResetNewResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\RecoveryKey\Reset\ResetNewResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/AvailableAction.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..ce5cbf3 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Method.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Method.php new file mode 100644 index 0000000..b4e3a53 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Purpose.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..b694c82 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/SAS.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..f46185d --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/State.php b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/State.php new file mode 100644 index 0000000..e37dcb1 --- /dev/null +++ b/src/App/Setup/RecoveryKey/Reset/ResetNewResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Email address to send the sign-in code to. + */ + #[Required] + public string $email; + + /** + * Setup request ID returned by the start step. + */ + #[Required] + public string $setupRequestID; + + /** + * `new SetupEmailParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupEmailParams::with(email: ..., setupRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupEmailParams)->withEmail(...)->withSetupRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $email, string $setupRequestID): self + { + $self = new self; + + $self['email'] = $email; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } + + /** + * Email address to send the sign-in code to. + */ + public function withEmail(string $email): self + { + $self = clone $this; + $self['email'] = $email; + + return $self; + } + + /** + * Setup request ID returned by the start step. + */ + public function withSetupRequestID(string $setupRequestID): self + { + $self = clone $this; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse.php b/src/App/Setup/SetupGetResponse.php new file mode 100644 index 0000000..bd6549d --- /dev/null +++ b/src/App/Setup/SetupGetResponse.php @@ -0,0 +1,156 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class SetupGetResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new SetupGetResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupGetResponse::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupGetResponse)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/E2EE.php b/src/App/Setup/SetupGetResponse/E2EE.php new file mode 100644 index 0000000..70f083b --- /dev/null +++ b/src/App/Setup/SetupGetResponse/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/E2EE/Secrets.php b/src/App/Setup/SetupGetResponse/E2EE/Secrets.php new file mode 100644 index 0000000..0fd6530 --- /dev/null +++ b/src/App/Setup/SetupGetResponse/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/Matrix.php b/src/App/Setup/SetupGetResponse/Matrix.php new file mode 100644 index 0000000..48378ee --- /dev/null +++ b/src/App/Setup/SetupGetResponse/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/State.php b/src/App/Setup/SetupGetResponse/State.php new file mode 100644 index 0000000..43b769c --- /dev/null +++ b/src/App/Setup/SetupGetResponse/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\SetupGetResponse\Verification\State|value-of<\BeeperDesktop\App\Setup\SetupGetResponse\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/Verification/AvailableAction.php b/src/App/Setup/SetupGetResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..e973466 --- /dev/null +++ b/src/App/Setup/SetupGetResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/Verification/Method.php b/src/App/Setup/SetupGetResponse/Verification/Method.php new file mode 100644 index 0000000..8e11200 --- /dev/null +++ b/src/App/Setup/SetupGetResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/Verification/Purpose.php b/src/App/Setup/SetupGetResponse/Verification/Purpose.php new file mode 100644 index 0000000..6910f32 --- /dev/null +++ b/src/App/Setup/SetupGetResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/Verification/SAS.php b/src/App/Setup/SetupGetResponse/Verification/SAS.php new file mode 100644 index 0000000..4dbbb68 --- /dev/null +++ b/src/App/Setup/SetupGetResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/SetupGetResponse/Verification/State.php b/src/App/Setup/SetupGetResponse/Verification/State.php new file mode 100644 index 0000000..75e22f5 --- /dev/null +++ b/src/App/Setup/SetupGetResponse/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Confirms that the user agreed to our [terms of use](https://www.beeper.com/terms-onboarding) and has read our [privacy policy](https://www.beeper.com/privacy). + */ + #[Required] + public bool $acceptTerms = true; + + /** + * Registration token returned by Beeper. + */ + #[Required] + public string $leadToken; + + /** + * Setup request ID returned by the start step. + */ + #[Required] + public string $setupRequestID; + + /** + * Username selected by the user. + */ + #[Required] + public string $username; + + /** + * `new SetupRegisterParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupRegisterParams::with(leadToken: ..., setupRequestID: ..., username: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupRegisterParams) + * ->withLeadToken(...) + * ->withSetupRequestID(...) + * ->withUsername(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $leadToken, + string $setupRequestID, + string $username + ): self { + $self = new self; + + $self['leadToken'] = $leadToken; + $self['setupRequestID'] = $setupRequestID; + $self['username'] = $username; + + return $self; + } + + /** + * Confirms that the user agreed to our [terms of use](https://www.beeper.com/terms-onboarding) and has read our [privacy policy](https://www.beeper.com/privacy). + */ + public function withAcceptTerms(bool $acceptTerms): self + { + $self = clone $this; + $self['acceptTerms'] = $acceptTerms; + + return $self; + } + + /** + * Registration token returned by Beeper. + */ + public function withLeadToken(string $leadToken): self + { + $self = clone $this; + $self['leadToken'] = $leadToken; + + return $self; + } + + /** + * Setup request ID returned by the start step. + */ + public function withSetupRequestID(string $setupRequestID): self + { + $self = clone $this; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } + + /** + * Username selected by the user. + */ + public function withUsername(string $username): self + { + $self = clone $this; + $self['username'] = $username; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse.php b/src/App/Setup/SetupRegisterResponse.php new file mode 100644 index 0000000..e37b0f7 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse.php @@ -0,0 +1,102 @@ + */ + use SdkModel; + + /** + * Account credentials for first-party app setup. + */ + #[Required] + public Matrix $matrix; + + /** + * Current app sign-in and encrypted messaging setup state after sign-in. + */ + #[Required] + public Session $session; + + /** + * `new SetupRegisterResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupRegisterResponse::with(matrix: ..., session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupRegisterResponse)->withMatrix(...)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Matrix|MatrixShape $matrix + * @param Session|SessionShape $session + */ + public static function with( + Matrix|array $matrix, + Session|array $session + ): self { + $self = new self; + + $self['matrix'] = $matrix; + $self['session'] = $session; + + return $self; + } + + /** + * Account credentials for first-party app setup. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state after sign-in. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Matrix.php b/src/App/Setup/SetupRegisterResponse/Matrix.php new file mode 100644 index 0000000..c04cfda --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Matrix.php @@ -0,0 +1,134 @@ + */ + use SdkModel; + + /** + * Beeper account access token. Returned once for first-party app setup. + */ + #[Required] + public string $accessToken; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(accessToken: ..., deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix) + * ->withAccessToken(...) + * ->withDeviceID(...) + * ->withHomeserver(...) + * ->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $accessToken, + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['accessToken'] = $accessToken; + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Beeper account access token. Returned once for first-party app setup. + */ + public function withAccessToken(string $accessToken): self + { + $self = clone $this; + $self['accessToken'] = $accessToken; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session.php b/src/App/Setup/SetupRegisterResponse/Session.php new file mode 100644 index 0000000..6958aa0 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|\BeeperDesktop\App\Setup\SetupRegisterResponse\Session\Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix( + Matrix|array $matrix + ): self { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/E2EE.php b/src/App/Setup/SetupRegisterResponse/Session/E2EE.php new file mode 100644 index 0000000..cd6e592 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/E2EE/Secrets.php b/src/App/Setup/SetupRegisterResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..a4398ce --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/Matrix.php b/src/App/Setup/SetupRegisterResponse/Session/Matrix.php new file mode 100644 index 0000000..9d342ea --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/State.php b/src/App/Setup/SetupRegisterResponse/Session/State.php new file mode 100644 index 0000000..3dce151 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\SetupRegisterResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\SetupRegisterResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/Verification/AvailableAction.php b/src/App/Setup/SetupRegisterResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..637fbf3 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/Verification/Method.php b/src/App/Setup/SetupRegisterResponse/Session/Verification/Method.php new file mode 100644 index 0000000..0747622 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/Verification/Purpose.php b/src/App/Setup/SetupRegisterResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..f7da097 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/Verification/SAS.php b/src/App/Setup/SetupRegisterResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..ef1b972 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/SetupRegisterResponse/Session/Verification/State.php b/src/App/Setup/SetupRegisterResponse/Session/Verification/State.php new file mode 100644 index 0000000..ba4f356 --- /dev/null +++ b/src/App/Setup/SetupRegisterResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Sign-in code from the user email. + */ + #[Required] + public string $response; + + /** + * Setup request ID returned by the start step. + */ + #[Required] + public string $setupRequestID; + + /** + * `new SetupResponseParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupResponseParams::with(response: ..., setupRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupResponseParams)->withResponse(...)->withSetupRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $response, string $setupRequestID): self + { + $self = new self; + + $self['response'] = $response; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } + + /** + * Sign-in code from the user email. + */ + public function withResponse(string $response): self + { + $self = clone $this; + $self['response'] = $response; + + return $self; + } + + /** + * Setup request ID returned by the start step. + */ + public function withSetupRequestID(string $setupRequestID): self + { + $self = clone $this; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse.php b/src/App/Setup/SetupResponseResponse.php new file mode 100644 index 0000000..c386d5d --- /dev/null +++ b/src/App/Setup/SetupResponseResponse.php @@ -0,0 +1,34 @@ +|array + */ + public static function variants(): array + { + return [ + AppSetupCompleteResponse::class, + AppSetupRegistrationRequiredResponse::class, + ]; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse.php new file mode 100644 index 0000000..bed4f34 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse.php @@ -0,0 +1,102 @@ + */ + use SdkModel; + + /** + * Account credentials for first-party app setup. + */ + #[Required] + public Matrix $matrix; + + /** + * Current app sign-in and encrypted messaging setup state after sign-in. + */ + #[Required] + public Session $session; + + /** + * `new AppSetupCompleteResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AppSetupCompleteResponse::with(matrix: ..., session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AppSetupCompleteResponse)->withMatrix(...)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Matrix|MatrixShape $matrix + * @param Session|SessionShape $session + */ + public static function with( + Matrix|array $matrix, + Session|array $session + ): self { + $self = new self; + + $self['matrix'] = $matrix; + $self['session'] = $session; + + return $self; + } + + /** + * Account credentials for first-party app setup. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state after sign-in. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Matrix.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Matrix.php new file mode 100644 index 0000000..9d1ecfa --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Matrix.php @@ -0,0 +1,134 @@ + */ + use SdkModel; + + /** + * Beeper account access token. Returned once for first-party app setup. + */ + #[Required] + public string $accessToken; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(accessToken: ..., deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix) + * ->withAccessToken(...) + * ->withDeviceID(...) + * ->withHomeserver(...) + * ->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $accessToken, + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['accessToken'] = $accessToken; + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Beeper account access token. Returned once for first-party app setup. + */ + public function withAccessToken(string $accessToken): self + { + $self = clone $this; + $self['accessToken'] = $accessToken; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session.php new file mode 100644 index 0000000..0638fb3 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|\BeeperDesktop\App\Setup\SetupResponseResponse\AppSetupCompleteResponse\Session\Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix( + Matrix|array $matrix, + ): self { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/E2EE.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/E2EE.php new file mode 100644 index 0000000..55783c0 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/E2EE/Secrets.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..6c488b0 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Matrix.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Matrix.php new file mode 100644 index 0000000..e423584 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/State.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/State.php new file mode 100644 index 0000000..d83d209 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\SetupResponseResponse\AppSetupCompleteResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\SetupResponseResponse\AppSetupCompleteResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/AvailableAction.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..2cd7450 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Method.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Method.php new file mode 100644 index 0000000..c838252 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Purpose.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..6500dd2 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/SAS.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..e430aa8 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/State.php b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/State.php new file mode 100644 index 0000000..7ef0b63 --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupCompleteResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +|null, + * } + */ +final class AppSetupRegistrationRequiredResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Indicates that the user needs to create a Beeper account. + */ + #[Required] + public bool $registrationRequired = true; + + /** + * Copy to display during account creation. + */ + #[Required] + public Copy $copy; + + /** + * Registration token returned by Beeper. + */ + #[Required] + public string $leadToken; + + /** + * Setup request ID to use when creating the account. + */ + #[Required] + public string $setupRequestID; + + /** + * Suggested usernames for the new account. + * + * @var list|null $usernameSuggestions + */ + #[Optional(list: 'string')] + public ?array $usernameSuggestions; + + /** + * `new AppSetupRegistrationRequiredResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AppSetupRegistrationRequiredResponse::with( + * copy: ..., leadToken: ..., setupRequestID: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AppSetupRegistrationRequiredResponse) + * ->withCopy(...) + * ->withLeadToken(...) + * ->withSetupRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Copy|CopyShape $copy + * @param list|null $usernameSuggestions + */ + public static function with( + Copy|array $copy, + string $leadToken, + string $setupRequestID, + ?array $usernameSuggestions = null, + ): self { + $self = new self; + + $self['copy'] = $copy; + $self['leadToken'] = $leadToken; + $self['setupRequestID'] = $setupRequestID; + + null !== $usernameSuggestions && $self['usernameSuggestions'] = $usernameSuggestions; + + return $self; + } + + /** + * Copy to display during account creation. + * + * @param Copy|CopyShape $copy + */ + public function withCopy(Copy|array $copy): self + { + $self = clone $this; + $self['copy'] = $copy; + + return $self; + } + + /** + * Registration token returned by Beeper. + */ + public function withLeadToken(string $leadToken): self + { + $self = clone $this; + $self['leadToken'] = $leadToken; + + return $self; + } + + /** + * Indicates that the user needs to create a Beeper account. + */ + public function withRegistrationRequired(bool $registrationRequired): self + { + $self = clone $this; + $self['registrationRequired'] = $registrationRequired; + + return $self; + } + + /** + * Setup request ID to use when creating the account. + */ + public function withSetupRequestID(string $setupRequestID): self + { + $self = clone $this; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } + + /** + * Suggested usernames for the new account. + * + * @param list $usernameSuggestions + */ + public function withUsernameSuggestions(array $usernameSuggestions): self + { + $self = clone $this; + $self['usernameSuggestions'] = $usernameSuggestions; + + return $self; + } +} diff --git a/src/App/Setup/SetupResponseResponse/AppSetupRegistrationRequiredResponse/Copy.php b/src/App/Setup/SetupResponseResponse/AppSetupRegistrationRequiredResponse/Copy.php new file mode 100644 index 0000000..9f2c8ad --- /dev/null +++ b/src/App/Setup/SetupResponseResponse/AppSetupRegistrationRequiredResponse/Copy.php @@ -0,0 +1,124 @@ + */ + use SdkModel; + + /** + * Submit button label. + * + * @var 'Continue' $submit + */ + #[Required] + public string $submit = 'Continue'; + + /** + * Terms and privacy notice to show before account creation. + * + * @var 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.' $terms + */ + #[Required] + public string $terms = 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.'; + + /** + * Title for the username step. + * + * @var 'Choose your username' $title + */ + #[Required] + public string $title = 'Choose your username'; + + /** + * Placeholder for the username field. + * + * @var 'Username' $usernamePlaceholder + */ + #[Required] + public string $usernamePlaceholder = 'Username'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } + + /** + * Submit button label. + * + * @param 'Continue' $submit + */ + public function withSubmit(string $submit): self + { + $self = clone $this; + $self['submit'] = $submit; + + return $self; + } + + /** + * Terms and privacy notice to show before account creation. + * + * @param 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.' $terms + */ + public function withTerms(string $terms): self + { + $self = clone $this; + $self['terms'] = $terms; + + return $self; + } + + /** + * Title for the username step. + * + * @param 'Choose your username' $title + */ + public function withTitle(string $title): self + { + $self = clone $this; + $self['title'] = $title; + + return $self; + } + + /** + * Placeholder for the username field. + * + * @param 'Username' $usernamePlaceholder + */ + public function withUsernamePlaceholder(string $usernamePlaceholder): self + { + $self = clone $this; + $self['usernamePlaceholder'] = $usernamePlaceholder; + + return $self; + } +} diff --git a/src/App/Setup/SetupStartResponse.php b/src/App/Setup/SetupStartResponse.php new file mode 100644 index 0000000..9d7d51e --- /dev/null +++ b/src/App/Setup/SetupStartResponse.php @@ -0,0 +1,96 @@ + + * } + */ +final class SetupStartResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Setup request ID to use in the next sign-in step. + */ + #[Required] + public string $setupRequestID; + + /** + * Available sign-in methods for this setup request. + * + * @var list $signInMethods + */ + #[Required(list: 'string')] + public array $signInMethods; + + /** + * `new SetupStartResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupStartResponse::with(setupRequestID: ..., signInMethods: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupStartResponse)->withSetupRequestID(...)->withSignInMethods(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $signInMethods + */ + public static function with( + string $setupRequestID, + array $signInMethods + ): self { + $self = new self; + + $self['setupRequestID'] = $setupRequestID; + $self['signInMethods'] = $signInMethods; + + return $self; + } + + /** + * Setup request ID to use in the next sign-in step. + */ + public function withSetupRequestID(string $setupRequestID): self + { + $self = clone $this; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } + + /** + * Available sign-in methods for this setup request. + * + * @param list $signInMethods + */ + public function withSignInMethods(array $signInMethods): self + { + $self = clone $this; + $self['signInMethods'] = $signInMethods; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse.php new file mode 100644 index 0000000..8138263 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse.php @@ -0,0 +1,105 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new QRConfirmScannedResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QRConfirmScannedResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QRConfirmScannedResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session.php new file mode 100644 index 0000000..1619b3c --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\Setup\Verifications\QR\QRConfirmScannedResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/E2EE.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/E2EE.php new file mode 100644 index 0000000..ec36aab --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/E2EE/Secrets.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..81f640c --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Matrix.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Matrix.php new file mode 100644 index 0000000..5d64a27 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/State.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/State.php new file mode 100644 index 0000000..8c818a7 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\Verifications\QR\QRConfirmScannedResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\Verifications\QR\QRConfirmScannedResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/AvailableAction.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..318f191 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Method.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Method.php new file mode 100644 index 0000000..3628437 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Purpose.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..8c5ee96 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/SAS.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..96b9dfa --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/State.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/State.php new file mode 100644 index 0000000..ea39a18 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/AvailableAction.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..c32db13 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Method.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Method.php new file mode 100644 index 0000000..5847074 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Purpose.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Purpose.php new file mode 100644 index 0000000..e2ecdea --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/SAS.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/SAS.php new file mode 100644 index 0000000..f606f4c --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/State.php b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/State.php new file mode 100644 index 0000000..c48cf37 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRConfirmScannedResponse/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + use SdkParams; + + /** + * QR code payload scanned from the other device. + */ + #[Required] + public string $data; + + /** + * `new QRScanParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QRScanParams::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QRScanParams)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload scanned from the other device. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse.php b/src/App/Setup/Verifications/QR/QRScanResponse.php new file mode 100644 index 0000000..c28d705 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse.php @@ -0,0 +1,105 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new QRScanResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QRScanResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QRScanResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session.php new file mode 100644 index 0000000..ddde79f --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\Setup\Verifications\QR\QRScanResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/E2EE.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/E2EE.php new file mode 100644 index 0000000..bb839e9 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/E2EE/Secrets.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..34167c8 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/Matrix.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Matrix.php new file mode 100644 index 0000000..b1da266 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/State.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/State.php new file mode 100644 index 0000000..e0a955f --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\Verifications\QR\QRScanResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\Verifications\QR\QRScanResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/AvailableAction.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..46ac541 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Method.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Method.php new file mode 100644 index 0000000..f38e4f8 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Purpose.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..e147be4 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/SAS.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..1bbf3c6 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/State.php b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/State.php new file mode 100644 index 0000000..020f85b --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Verification/AvailableAction.php b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..059fcab --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Verification/Method.php b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/Method.php new file mode 100644 index 0000000..24bf530 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Verification/Purpose.php b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/Purpose.php new file mode 100644 index 0000000..c4a9343 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Verification/SAS.php b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/SAS.php new file mode 100644 index 0000000..326b7d1 --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/QR/QRScanResponse/Verification/State.php b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/State.php new file mode 100644 index 0000000..512ba4b --- /dev/null +++ b/src/App/Setup/Verifications/QR/QRScanResponse/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new SASConfirmResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SASConfirmResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SASConfirmResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session.php new file mode 100644 index 0000000..bdc0aa7 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\Setup\Verifications\SAS\SASConfirmResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/E2EE.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/E2EE.php new file mode 100644 index 0000000..e50826b --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/E2EE/Secrets.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..efda97c --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Matrix.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Matrix.php new file mode 100644 index 0000000..e459126 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/State.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/State.php new file mode 100644 index 0000000..acb07d5 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\Verifications\SAS\SASConfirmResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\Verifications\SAS\SASConfirmResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/AvailableAction.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..5dc474f --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Method.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Method.php new file mode 100644 index 0000000..21c4a38 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Purpose.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..5c6e3d1 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/SAS.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..82ff7be --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/State.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/State.php new file mode 100644 index 0000000..291e9ca --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/AvailableAction.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..632d235 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Method.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Method.php new file mode 100644 index 0000000..87d35e7 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Purpose.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Purpose.php new file mode 100644 index 0000000..2b5a873 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/SAS.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/SAS.php new file mode 100644 index 0000000..8267cb9 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/State.php b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/State.php new file mode 100644 index 0000000..92b3028 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASConfirmResponse/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new SASStartResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SASStartResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SASStartResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session.php new file mode 100644 index 0000000..eb34cc3 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\Setup\Verifications\SAS\SASStartResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/E2EE.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/E2EE.php new file mode 100644 index 0000000..69fd1d6 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/E2EE/Secrets.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..b7efd31 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Matrix.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Matrix.php new file mode 100644 index 0000000..d890e11 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/State.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/State.php new file mode 100644 index 0000000..a3aea0d --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\Verifications\SAS\SASStartResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\Verifications\SAS\SASStartResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/AvailableAction.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..5d32d2c --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Method.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Method.php new file mode 100644 index 0000000..bd00d0f --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Purpose.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..b46a036 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/SAS.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..770fdc8 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/State.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/State.php new file mode 100644 index 0000000..c3e0a1c --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/AvailableAction.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..d69e3db --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Method.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Method.php new file mode 100644 index 0000000..d54b130 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Purpose.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Purpose.php new file mode 100644 index 0000000..d5fb8e9 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/SAS.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/SAS.php new file mode 100644 index 0000000..4b36b62 --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/State.php b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/State.php new file mode 100644 index 0000000..36178ee --- /dev/null +++ b/src/App/Setup/Verifications/SAS/SASStartResponse/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new VerificationAcceptResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VerificationAcceptResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VerificationAcceptResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session.php new file mode 100644 index 0000000..31a8b28 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\Setup\Verifications\VerificationAcceptResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/E2EE.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/E2EE.php new file mode 100644 index 0000000..2185b66 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/E2EE/Secrets.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..13346d5 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Matrix.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Matrix.php new file mode 100644 index 0000000..45eb836 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/State.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/State.php new file mode 100644 index 0000000..d04f947 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\Verifications\VerificationAcceptResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\Verifications\VerificationAcceptResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/AvailableAction.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..90b7388 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Method.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Method.php new file mode 100644 index 0000000..ba1f709 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Purpose.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..a4239d2 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/SAS.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..8e972dc --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/State.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/State.php new file mode 100644 index 0000000..7d14a45 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/AvailableAction.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..09369dd --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Method.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Method.php new file mode 100644 index 0000000..9ff1653 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Purpose.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Purpose.php new file mode 100644 index 0000000..b0de2cc --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/SAS.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/SAS.php new file mode 100644 index 0000000..3bd4f09 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/State.php b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/State.php new file mode 100644 index 0000000..bb9f4b6 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationAcceptResponse/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Optional cancellation code. + */ + #[Optional] + public ?string $code; + + /** + * Optional user-facing cancellation reason. + */ + #[Optional] + public ?string $reason; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?string $code = null, + ?string $reason = null + ): self { + $self = new self; + + null !== $code && $self['code'] = $code; + null !== $reason && $self['reason'] = $reason; + + return $self; + } + + /** + * Optional cancellation code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * Optional user-facing cancellation reason. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse.php b/src/App/Setup/Verifications/VerificationCancelResponse.php new file mode 100644 index 0000000..3af8265 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse.php @@ -0,0 +1,105 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new VerificationCancelResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VerificationCancelResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VerificationCancelResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session.php new file mode 100644 index 0000000..f3958df --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\Setup\Verifications\VerificationCancelResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/E2EE.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/E2EE.php new file mode 100644 index 0000000..21da28a --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/E2EE/Secrets.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..9836526 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/Matrix.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Matrix.php new file mode 100644 index 0000000..15b8321 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/State.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/State.php new file mode 100644 index 0000000..6eddb31 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\Verifications\VerificationCancelResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\Verifications\VerificationCancelResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/AvailableAction.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..f27f27b --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Method.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Method.php new file mode 100644 index 0000000..a77a2fb --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Purpose.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..dead24a --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/SAS.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..699e93b --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/State.php b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/State.php new file mode 100644 index 0000000..fe3e72f --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Verification/AvailableAction.php b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..bae0293 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Verification/Method.php b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/Method.php new file mode 100644 index 0000000..efa2e32 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Verification/Purpose.php b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/Purpose.php new file mode 100644 index 0000000..926f4c3 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Verification/SAS.php b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/SAS.php new file mode 100644 index 0000000..dacac17 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCancelResponse/Verification/State.php b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/State.php new file mode 100644 index 0000000..856cc25 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCancelResponse/Verification/State.php @@ -0,0 +1,25 @@ +, userID?: string|null + * } + */ +final class VerificationCreateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Why this verification is being started. + * + * @var value-of|null $purpose + */ + #[Optional(enum: Purpose::class)] + public ?string $purpose; + + /** + * Beeper user ID to verify. Defaults to the signed-in user. + */ + #[Optional] + public ?string $userID; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Purpose|value-of|null $purpose + */ + public static function with( + Purpose|string|null $purpose = null, + ?string $userID = null + ): self { + $self = new self; + + null !== $purpose && $self['purpose'] = $purpose; + null !== $userID && $self['userID'] = $userID; + + return $self; + } + + /** + * Why this verification is being started. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Beeper user ID to verify. Defaults to the signed-in user. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationCreateParams/Purpose.php b/src/App/Setup/Verifications/VerificationCreateParams/Purpose.php new file mode 100644 index 0000000..9a296cf --- /dev/null +++ b/src/App/Setup/Verifications/VerificationCreateParams/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new VerificationGetResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VerificationGetResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VerificationGetResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session.php b/src/App/Setup/Verifications/VerificationGetResponse/Session.php new file mode 100644 index 0000000..bb8d2f6 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\Setup\Verifications\VerificationGetResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/E2EE.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/E2EE.php new file mode 100644 index 0000000..a2dfbc0 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/E2EE/Secrets.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..ff7cca3 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/Matrix.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/Matrix.php new file mode 100644 index 0000000..c2c1b91 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/State.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/State.php new file mode 100644 index 0000000..217e3e1 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\Verifications\VerificationGetResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\Verifications\VerificationGetResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/AvailableAction.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..957431a --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Method.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Method.php new file mode 100644 index 0000000..cb1ea04 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Purpose.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..aa749ad --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/SAS.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..b3b4656 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/State.php b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/State.php new file mode 100644 index 0000000..c296acd --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Verification/AvailableAction.php b/src/App/Setup/Verifications/VerificationGetResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..7a40e1a --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Verification/Method.php b/src/App/Setup/Verifications/VerificationGetResponse/Verification/Method.php new file mode 100644 index 0000000..d60fbe1 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Verification/Purpose.php b/src/App/Setup/Verifications/VerificationGetResponse/Verification/Purpose.php new file mode 100644 index 0000000..392dd4f --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Verification/SAS.php b/src/App/Setup/Verifications/VerificationGetResponse/Verification/SAS.php new file mode 100644 index 0000000..1b67fc3 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationGetResponse/Verification/State.php b/src/App/Setup/Verifications/VerificationGetResponse/Verification/State.php new file mode 100644 index 0000000..c5547ec --- /dev/null +++ b/src/App/Setup/Verifications/VerificationGetResponse/Verification/State.php @@ -0,0 +1,25 @@ +} + */ +final class VerificationListResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var list $items */ + #[Required(list: Item::class)] + public array $items; + + /** + * `new VerificationListResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VerificationListResponse::with(items: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VerificationListResponse)->withItems(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $items + */ + public static function with(array $items): self + { + $self = new self; + + $self['items'] = $items; + + return $self; + } + + /** + * @param list $items + */ + public function withItems(array $items): self + { + $self = clone $this; + $self['items'] = $items; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationListResponse/Item.php b/src/App/Setup/Verifications/VerificationListResponse/Item.php new file mode 100644 index 0000000..9e88541 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationListResponse/Item.php @@ -0,0 +1,340 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Item implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Item()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Item::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Item) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationListResponse/Item/AvailableAction.php b/src/App/Setup/Verifications/VerificationListResponse/Item/AvailableAction.php new file mode 100644 index 0000000..9ac52b3 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationListResponse/Item/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationListResponse/Item/Method.php b/src/App/Setup/Verifications/VerificationListResponse/Item/Method.php new file mode 100644 index 0000000..09a1668 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationListResponse/Item/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationListResponse/Item/Purpose.php b/src/App/Setup/Verifications/VerificationListResponse/Item/Purpose.php new file mode 100644 index 0000000..67b256e --- /dev/null +++ b/src/App/Setup/Verifications/VerificationListResponse/Item/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationListResponse/Item/SAS.php b/src/App/Setup/Verifications/VerificationListResponse/Item/SAS.php new file mode 100644 index 0000000..48e5310 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationListResponse/Item/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationListResponse/Item/State.php b/src/App/Setup/Verifications/VerificationListResponse/Item/State.php new file mode 100644 index 0000000..9842c45 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationListResponse/Item/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new VerificationNewResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VerificationNewResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VerificationNewResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session.php b/src/App/Setup/Verifications/VerificationNewResponse/Session.php new file mode 100644 index 0000000..71c2da2 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\Setup\Verifications\VerificationNewResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/E2EE.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/E2EE.php new file mode 100644 index 0000000..ca4116f --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/E2EE/Secrets.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..7e4a1aa --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/Matrix.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/Matrix.php new file mode 100644 index 0000000..758122b --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/State.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/State.php new file mode 100644 index 0000000..88764b7 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\Setup\Verifications\VerificationNewResponse\Session\Verification\State|value-of<\BeeperDesktop\App\Setup\Verifications\VerificationNewResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/AvailableAction.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..e673b37 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Method.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Method.php new file mode 100644 index 0000000..eef1467 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Purpose.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..782ba2d --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/SAS.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..96750e6 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/State.php b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/State.php new file mode 100644 index 0000000..6ff131a --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Verification/AvailableAction.php b/src/App/Setup/Verifications/VerificationNewResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..e03af2b --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Verification/Method.php b/src/App/Setup/Verifications/VerificationNewResponse/Verification/Method.php new file mode 100644 index 0000000..f766a09 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Verification/Purpose.php b/src/App/Setup/Verifications/VerificationNewResponse/Verification/Purpose.php new file mode 100644 index 0000000..7c05d77 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Verification/SAS.php b/src/App/Setup/Verifications/VerificationNewResponse/Verification/SAS.php new file mode 100644 index 0000000..b68be48 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Setup/Verifications/VerificationNewResponse/Verification/State.php b/src/App/Setup/Verifications/VerificationNewResponse/Verification/State.php new file mode 100644 index 0000000..7356884 --- /dev/null +++ b/src/App/Setup/Verifications/VerificationNewResponse/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Account credentials for first-party app setup. + */ + #[Required] + public Matrix $matrix; + + /** + * Current app sign-in and encrypted messaging setup state after sign-in. + */ + #[Required] + public Session $session; + + /** + * `new SetupCompleteResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupCompleteResponse::with(matrix: ..., session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupCompleteResponse)->withMatrix(...)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Matrix|MatrixShape $matrix + * @param Session|SessionShape $session + */ + public static function with( + Matrix|array $matrix, + Session|array $session + ): self { + $self = new self; + + $self['matrix'] = $matrix; + $self['session'] = $session; + + return $self; + } + + /** + * Account credentials for first-party app setup. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state after sign-in. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Matrix.php b/src/App/SetupCompleteResponse/Matrix.php new file mode 100644 index 0000000..ac02fe1 --- /dev/null +++ b/src/App/SetupCompleteResponse/Matrix.php @@ -0,0 +1,134 @@ + */ + use SdkModel; + + /** + * Beeper account access token. Returned once for first-party app setup. + */ + #[Required] + public string $accessToken; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(accessToken: ..., deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix) + * ->withAccessToken(...) + * ->withDeviceID(...) + * ->withHomeserver(...) + * ->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $accessToken, + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['accessToken'] = $accessToken; + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Beeper account access token. Returned once for first-party app setup. + */ + public function withAccessToken(string $accessToken): self + { + $self = clone $this; + $self['accessToken'] = $accessToken; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session.php b/src/App/SetupCompleteResponse/Session.php new file mode 100644 index 0000000..6e0b23b --- /dev/null +++ b/src/App/SetupCompleteResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|\BeeperDesktop\App\SetupCompleteResponse\Session\Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix( + Matrix|array $matrix + ): self { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/E2EE.php b/src/App/SetupCompleteResponse/Session/E2EE.php new file mode 100644 index 0000000..3830ace --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/E2EE/Secrets.php b/src/App/SetupCompleteResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..f5eeb49 --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/Matrix.php b/src/App/SetupCompleteResponse/Session/Matrix.php new file mode 100644 index 0000000..9346b63 --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/State.php b/src/App/SetupCompleteResponse/Session/State.php new file mode 100644 index 0000000..27c72fb --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\SetupCompleteResponse\Session\Verification\State|value-of<\BeeperDesktop\App\SetupCompleteResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/Verification/AvailableAction.php b/src/App/SetupCompleteResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..1e0b7b8 --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/Verification/Method.php b/src/App/SetupCompleteResponse/Session/Verification/Method.php new file mode 100644 index 0000000..a1b9e51 --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/Verification/Purpose.php b/src/App/SetupCompleteResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..542fa30 --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/Verification/SAS.php b/src/App/SetupCompleteResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..367af33 --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/SetupCompleteResponse/Session/Verification/State.php b/src/App/SetupCompleteResponse/Session/Verification/State.php new file mode 100644 index 0000000..d46208c --- /dev/null +++ b/src/App/SetupCompleteResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +|null, + * } + */ +final class SetupRegistrationRequiredResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Indicates that the user needs to create a Beeper account. + */ + #[Required] + public bool $registrationRequired = true; + + /** + * Copy to display during account creation. + */ + #[Required] + public Copy $copy; + + /** + * Registration token returned by Beeper. + */ + #[Required] + public string $leadToken; + + /** + * Setup request ID to use when creating the account. + */ + #[Required] + public string $setupRequestID; + + /** + * Suggested usernames for the new account. + * + * @var list|null $usernameSuggestions + */ + #[Optional(list: 'string')] + public ?array $usernameSuggestions; + + /** + * `new SetupRegistrationRequiredResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupRegistrationRequiredResponse::with( + * copy: ..., leadToken: ..., setupRequestID: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupRegistrationRequiredResponse) + * ->withCopy(...) + * ->withLeadToken(...) + * ->withSetupRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Copy|CopyShape $copy + * @param list|null $usernameSuggestions + */ + public static function with( + Copy|array $copy, + string $leadToken, + string $setupRequestID, + ?array $usernameSuggestions = null, + ): self { + $self = new self; + + $self['copy'] = $copy; + $self['leadToken'] = $leadToken; + $self['setupRequestID'] = $setupRequestID; + + null !== $usernameSuggestions && $self['usernameSuggestions'] = $usernameSuggestions; + + return $self; + } + + /** + * Copy to display during account creation. + * + * @param Copy|CopyShape $copy + */ + public function withCopy(Copy|array $copy): self + { + $self = clone $this; + $self['copy'] = $copy; + + return $self; + } + + /** + * Registration token returned by Beeper. + */ + public function withLeadToken(string $leadToken): self + { + $self = clone $this; + $self['leadToken'] = $leadToken; + + return $self; + } + + /** + * Indicates that the user needs to create a Beeper account. + */ + public function withRegistrationRequired(bool $registrationRequired): self + { + $self = clone $this; + $self['registrationRequired'] = $registrationRequired; + + return $self; + } + + /** + * Setup request ID to use when creating the account. + */ + public function withSetupRequestID(string $setupRequestID): self + { + $self = clone $this; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } + + /** + * Suggested usernames for the new account. + * + * @param list $usernameSuggestions + */ + public function withUsernameSuggestions(array $usernameSuggestions): self + { + $self = clone $this; + $self['usernameSuggestions'] = $usernameSuggestions; + + return $self; + } +} diff --git a/src/App/SetupRegistrationRequiredResponse/Copy.php b/src/App/SetupRegistrationRequiredResponse/Copy.php new file mode 100644 index 0000000..82c131e --- /dev/null +++ b/src/App/SetupRegistrationRequiredResponse/Copy.php @@ -0,0 +1,124 @@ + */ + use SdkModel; + + /** + * Submit button label. + * + * @var 'Continue' $submit + */ + #[Required] + public string $submit = 'Continue'; + + /** + * Terms and privacy notice to show before account creation. + * + * @var 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.' $terms + */ + #[Required] + public string $terms = 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.'; + + /** + * Title for the username step. + * + * @var 'Choose your username' $title + */ + #[Required] + public string $title = 'Choose your username'; + + /** + * Placeholder for the username field. + * + * @var 'Username' $usernamePlaceholder + */ + #[Required] + public string $usernamePlaceholder = 'Username'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } + + /** + * Submit button label. + * + * @param 'Continue' $submit + */ + public function withSubmit(string $submit): self + { + $self = clone $this; + $self['submit'] = $submit; + + return $self; + } + + /** + * Terms and privacy notice to show before account creation. + * + * @param 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.' $terms + */ + public function withTerms(string $terms): self + { + $self = clone $this; + $self['terms'] = $terms; + + return $self; + } + + /** + * Title for the username step. + * + * @param 'Choose your username' $title + */ + public function withTitle(string $title): self + { + $self = clone $this; + $self['title'] = $title; + + return $self; + } + + /** + * Placeholder for the username field. + * + * @param 'Username' $usernamePlaceholder + */ + public function withUsernamePlaceholder(string $usernamePlaceholder): self + { + $self = clone $this; + $self['usernamePlaceholder'] = $usernamePlaceholder; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput.php b/src/App/SetupResponseOutput.php new file mode 100644 index 0000000..f8bf3b3 --- /dev/null +++ b/src/App/SetupResponseOutput.php @@ -0,0 +1,34 @@ +|array + */ + public static function variants(): array + { + return [ + AppSetupCompleteResponse::class, + AppSetupRegistrationRequiredResponse::class, + ]; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse.php new file mode 100644 index 0000000..cbadc77 --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse.php @@ -0,0 +1,102 @@ + */ + use SdkModel; + + /** + * Account credentials for first-party app setup. + */ + #[Required] + public Matrix $matrix; + + /** + * Current app sign-in and encrypted messaging setup state after sign-in. + */ + #[Required] + public Session $session; + + /** + * `new AppSetupCompleteResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AppSetupCompleteResponse::with(matrix: ..., session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AppSetupCompleteResponse)->withMatrix(...)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Matrix|MatrixShape $matrix + * @param Session|SessionShape $session + */ + public static function with( + Matrix|array $matrix, + Session|array $session + ): self { + $self = new self; + + $self['matrix'] = $matrix; + $self['session'] = $session; + + return $self; + } + + /** + * Account credentials for first-party app setup. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state after sign-in. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Matrix.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Matrix.php new file mode 100644 index 0000000..3a13e6b --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Matrix.php @@ -0,0 +1,134 @@ + */ + use SdkModel; + + /** + * Beeper account access token. Returned once for first-party app setup. + */ + #[Required] + public string $accessToken; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(accessToken: ..., deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix) + * ->withAccessToken(...) + * ->withDeviceID(...) + * ->withHomeserver(...) + * ->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $accessToken, + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['accessToken'] = $accessToken; + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Beeper account access token. Returned once for first-party app setup. + */ + public function withAccessToken(string $accessToken): self + { + $self = clone $this; + $self['accessToken'] = $accessToken; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session.php new file mode 100644 index 0000000..d4767a9 --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|\BeeperDesktop\App\SetupResponseOutput\AppSetupCompleteResponse\Session\Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix( + Matrix|array $matrix, + ): self { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/E2EE.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/E2EE.php new file mode 100644 index 0000000..a252406 --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/E2EE/Secrets.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..ab6c635 --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Matrix.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Matrix.php new file mode 100644 index 0000000..622c9ac --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/State.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/State.php new file mode 100644 index 0000000..f37a55e --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\SetupResponseOutput\AppSetupCompleteResponse\Session\Verification\State|value-of<\BeeperDesktop\App\SetupResponseOutput\AppSetupCompleteResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/AvailableAction.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..c5187f9 --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Method.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Method.php new file mode 100644 index 0000000..706acea --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Purpose.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..4810e28 --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/SAS.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..1ad372f --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/State.php b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/State.php new file mode 100644 index 0000000..628ecac --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupCompleteResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +|null, + * } + */ +final class AppSetupRegistrationRequiredResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Indicates that the user needs to create a Beeper account. + */ + #[Required] + public bool $registrationRequired = true; + + /** + * Copy to display during account creation. + */ + #[Required] + public Copy $copy; + + /** + * Registration token returned by Beeper. + */ + #[Required] + public string $leadToken; + + /** + * Setup request ID to use when creating the account. + */ + #[Required] + public string $setupRequestID; + + /** + * Suggested usernames for the new account. + * + * @var list|null $usernameSuggestions + */ + #[Optional(list: 'string')] + public ?array $usernameSuggestions; + + /** + * `new AppSetupRegistrationRequiredResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AppSetupRegistrationRequiredResponse::with( + * copy: ..., leadToken: ..., setupRequestID: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AppSetupRegistrationRequiredResponse) + * ->withCopy(...) + * ->withLeadToken(...) + * ->withSetupRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Copy|CopyShape $copy + * @param list|null $usernameSuggestions + */ + public static function with( + Copy|array $copy, + string $leadToken, + string $setupRequestID, + ?array $usernameSuggestions = null, + ): self { + $self = new self; + + $self['copy'] = $copy; + $self['leadToken'] = $leadToken; + $self['setupRequestID'] = $setupRequestID; + + null !== $usernameSuggestions && $self['usernameSuggestions'] = $usernameSuggestions; + + return $self; + } + + /** + * Copy to display during account creation. + * + * @param Copy|CopyShape $copy + */ + public function withCopy(Copy|array $copy): self + { + $self = clone $this; + $self['copy'] = $copy; + + return $self; + } + + /** + * Registration token returned by Beeper. + */ + public function withLeadToken(string $leadToken): self + { + $self = clone $this; + $self['leadToken'] = $leadToken; + + return $self; + } + + /** + * Indicates that the user needs to create a Beeper account. + */ + public function withRegistrationRequired(bool $registrationRequired): self + { + $self = clone $this; + $self['registrationRequired'] = $registrationRequired; + + return $self; + } + + /** + * Setup request ID to use when creating the account. + */ + public function withSetupRequestID(string $setupRequestID): self + { + $self = clone $this; + $self['setupRequestID'] = $setupRequestID; + + return $self; + } + + /** + * Suggested usernames for the new account. + * + * @param list $usernameSuggestions + */ + public function withUsernameSuggestions(array $usernameSuggestions): self + { + $self = clone $this; + $self['usernameSuggestions'] = $usernameSuggestions; + + return $self; + } +} diff --git a/src/App/SetupResponseOutput/AppSetupRegistrationRequiredResponse/Copy.php b/src/App/SetupResponseOutput/AppSetupRegistrationRequiredResponse/Copy.php new file mode 100644 index 0000000..0fa3449 --- /dev/null +++ b/src/App/SetupResponseOutput/AppSetupRegistrationRequiredResponse/Copy.php @@ -0,0 +1,124 @@ + */ + use SdkModel; + + /** + * Submit button label. + * + * @var 'Continue' $submit + */ + #[Required] + public string $submit = 'Continue'; + + /** + * Terms and privacy notice to show before account creation. + * + * @var 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.' $terms + */ + #[Required] + public string $terms = 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.'; + + /** + * Title for the username step. + * + * @var 'Choose your username' $title + */ + #[Required] + public string $title = 'Choose your username'; + + /** + * Placeholder for the username field. + * + * @var 'Username' $usernamePlaceholder + */ + #[Required] + public string $usernamePlaceholder = 'Username'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } + + /** + * Submit button label. + * + * @param 'Continue' $submit + */ + public function withSubmit(string $submit): self + { + $self = clone $this; + $self['submit'] = $submit; + + return $self; + } + + /** + * Terms and privacy notice to show before account creation. + * + * @param 'By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy.' $terms + */ + public function withTerms(string $terms): self + { + $self = clone $this; + $self['terms'] = $terms; + + return $self; + } + + /** + * Title for the username step. + * + * @param 'Choose your username' $title + */ + public function withTitle(string $title): self + { + $self = clone $this; + $self['title'] = $title; + + return $self; + } + + /** + * Placeholder for the username field. + * + * @param 'Username' $usernamePlaceholder + */ + public function withUsernamePlaceholder(string $usernamePlaceholder): self + { + $self = clone $this; + $self['usernamePlaceholder'] = $usernamePlaceholder; + + return $self; + } +} diff --git a/src/App/SetupStateResponse.php b/src/App/SetupStateResponse.php new file mode 100644 index 0000000..8375e0b --- /dev/null +++ b/src/App/SetupStateResponse.php @@ -0,0 +1,75 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * `new SetupStateResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetupStateResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetupStateResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + */ + public static function with(Session|array $session): self + { + $self = new self; + + $self['session'] = $session; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session.php b/src/App/SetupStateResponse/Session.php new file mode 100644 index 0000000..e1332a0 --- /dev/null +++ b/src/App/SetupStateResponse/Session.php @@ -0,0 +1,158 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/E2EE.php b/src/App/SetupStateResponse/Session/E2EE.php new file mode 100644 index 0000000..71a8c7b --- /dev/null +++ b/src/App/SetupStateResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/E2EE/Secrets.php b/src/App/SetupStateResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..f5ebdba --- /dev/null +++ b/src/App/SetupStateResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/Matrix.php b/src/App/SetupStateResponse/Session/Matrix.php new file mode 100644 index 0000000..f1dea71 --- /dev/null +++ b/src/App/SetupStateResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/State.php b/src/App/SetupStateResponse/Session/State.php new file mode 100644 index 0000000..95cdad1 --- /dev/null +++ b/src/App/SetupStateResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\SetupStateResponse\Session\Verification\State|value-of<\BeeperDesktop\App\SetupStateResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/Verification/AvailableAction.php b/src/App/SetupStateResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..3878627 --- /dev/null +++ b/src/App/SetupStateResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/Verification/Method.php b/src/App/SetupStateResponse/Session/Verification/Method.php new file mode 100644 index 0000000..8030239 --- /dev/null +++ b/src/App/SetupStateResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/Verification/Purpose.php b/src/App/SetupStateResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..b3c432e --- /dev/null +++ b/src/App/SetupStateResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/Verification/SAS.php b/src/App/SetupStateResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..ce770d7 --- /dev/null +++ b/src/App/SetupStateResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/SetupStateResponse/Session/Verification/State.php b/src/App/SetupStateResponse/Session/Verification/State.php new file mode 100644 index 0000000..8111e5b --- /dev/null +++ b/src/App/SetupStateResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/Verification/AvailableAction.php b/src/App/Verification/AvailableAction.php new file mode 100644 index 0000000..09f942b --- /dev/null +++ b/src/App/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/Verification/Method.php b/src/App/Verification/Method.php new file mode 100644 index 0000000..58f6c20 --- /dev/null +++ b/src/App/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/Verification/Purpose.php b/src/App/Verification/Purpose.php new file mode 100644 index 0000000..01390a8 --- /dev/null +++ b/src/App/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/Verification/SAS.php b/src/App/Verification/SAS.php new file mode 100644 index 0000000..0cb13d1 --- /dev/null +++ b/src/App/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/Verification/State.php b/src/App/Verification/State.php new file mode 100644 index 0000000..af33e54 --- /dev/null +++ b/src/App/Verification/State.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Current app sign-in and encrypted messaging setup state. + */ + #[Required] + public Session $session; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new VerificationResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VerificationResponse::with(session: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VerificationResponse)->withSession(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Session|SessionShape $session + * @param Verification|VerificationShape|null $verification + */ + public static function with( + Session|array $session, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['session'] = $session; + + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Current app sign-in and encrypted messaging setup state. + * + * @param Session|SessionShape $session + */ + public function withSession(Session|array $session): self + { + $self = clone $this; + $self['session'] = $session; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session.php b/src/App/VerificationResponse/Session.php new file mode 100644 index 0000000..b6de58c --- /dev/null +++ b/src/App/VerificationResponse/Session.php @@ -0,0 +1,159 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|\BeeperDesktop\App\VerificationResponse\Session\Verification|VerificationShape, + * } + */ +final class Session implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new Session()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Session::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Session)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification( + Verification|array $verification, + ): self { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/E2EE.php b/src/App/VerificationResponse/Session/E2EE.php new file mode 100644 index 0000000..6090247 --- /dev/null +++ b/src/App/VerificationResponse/Session/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/E2EE/Secrets.php b/src/App/VerificationResponse/Session/E2EE/Secrets.php new file mode 100644 index 0000000..678c04f --- /dev/null +++ b/src/App/VerificationResponse/Session/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/Matrix.php b/src/App/VerificationResponse/Session/Matrix.php new file mode 100644 index 0000000..1c63e6c --- /dev/null +++ b/src/App/VerificationResponse/Session/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/State.php b/src/App/VerificationResponse/Session/State.php new file mode 100644 index 0000000..939d9b9 --- /dev/null +++ b/src/App/VerificationResponse/Session/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\App\VerificationResponse\Session\Verification\State|value-of<\BeeperDesktop\App\VerificationResponse\Session\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required( + enum: State::class, + )] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state, + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/Verification/AvailableAction.php b/src/App/VerificationResponse/Session/Verification/AvailableAction.php new file mode 100644 index 0000000..05d477c --- /dev/null +++ b/src/App/VerificationResponse/Session/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/Verification/Method.php b/src/App/VerificationResponse/Session/Verification/Method.php new file mode 100644 index 0000000..5d03181 --- /dev/null +++ b/src/App/VerificationResponse/Session/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/Verification/Purpose.php b/src/App/VerificationResponse/Session/Verification/Purpose.php new file mode 100644 index 0000000..40974ad --- /dev/null +++ b/src/App/VerificationResponse/Session/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/Verification/SAS.php b/src/App/VerificationResponse/Session/Verification/SAS.php new file mode 100644 index 0000000..77bc55a --- /dev/null +++ b/src/App/VerificationResponse/Session/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Session/Verification/State.php b/src/App/VerificationResponse/Session/Verification/State.php new file mode 100644 index 0000000..e679549 --- /dev/null +++ b/src/App/VerificationResponse/Session/Verification/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: State|value-of, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Verification/AvailableAction.php b/src/App/VerificationResponse/Verification/AvailableAction.php new file mode 100644 index 0000000..a3e3b2a --- /dev/null +++ b/src/App/VerificationResponse/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Verification/Method.php b/src/App/VerificationResponse/Verification/Method.php new file mode 100644 index 0000000..76fbae0 --- /dev/null +++ b/src/App/VerificationResponse/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Verification/Purpose.php b/src/App/VerificationResponse/Verification/Purpose.php new file mode 100644 index 0000000..b4626e3 --- /dev/null +++ b/src/App/VerificationResponse/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Verification/SAS.php b/src/App/VerificationResponse/Verification/SAS.php new file mode 100644 index 0000000..db90324 --- /dev/null +++ b/src/App/VerificationResponse/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/App/VerificationResponse/Verification/State.php b/src/App/VerificationResponse/Verification/State.php new file mode 100644 index 0000000..754ceaa --- /dev/null +++ b/src/App/VerificationResponse/Verification/State.php @@ -0,0 +1,25 @@ +, + * matrix?: null|Matrix|MatrixShape, + * verification?: null|Verification|VerificationShape, + * } + */ +final class AppStateSnapshot implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Encrypted messaging setup status. + */ + #[Required] + public E2EE $e2ee; + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Signed-in account details. Omitted until sign-in is complete. + */ + #[Optional] + public ?Matrix $matrix; + + /** + * Trusted device verification progress. + */ + #[Optional] + public ?Verification $verification; + + /** + * `new AppStateSnapshot()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AppStateSnapshot::with(e2ee: ..., state: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AppStateSnapshot)->withE2EE(...)->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param E2EE|E2EEShape $e2ee + * @param State|value-of $state + * @param Matrix|MatrixShape|null $matrix + * @param Verification|VerificationShape|null $verification + */ + public static function with( + E2EE|array $e2ee, + State|string $state, + Matrix|array|null $matrix = null, + Verification|array|null $verification = null, + ): self { + $self = new self; + + $self['e2ee'] = $e2ee; + $self['state'] = $state; + + null !== $matrix && $self['matrix'] = $matrix; + null !== $verification && $self['verification'] = $verification; + + return $self; + } + + /** + * Encrypted messaging setup status. + * + * @param E2EE|E2EEShape $e2ee + */ + public function withE2EE(E2EE|array $e2ee): self + { + $self = clone $this; + $self['e2ee'] = $e2ee; + + return $self; + } + + /** + * Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. + * + * @param State|value-of $state + */ + public function withState(State|string $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Signed-in account details. Omitted until sign-in is complete. + * + * @param Matrix|MatrixShape $matrix + */ + public function withMatrix(Matrix|array $matrix): self + { + $self = clone $this; + $self['matrix'] = $matrix; + + return $self; + } + + /** + * Trusted device verification progress. + * + * @param Verification|VerificationShape $verification + */ + public function withVerification(Verification|array $verification): self + { + $self = clone $this; + $self['verification'] = $verification; + + return $self; + } +} diff --git a/src/AppStateSnapshot/E2EE.php b/src/AppStateSnapshot/E2EE.php new file mode 100644 index 0000000..7f96cce --- /dev/null +++ b/src/AppStateSnapshot/E2EE.php @@ -0,0 +1,261 @@ + */ + use SdkModel; + + /** + * Whether this account can verify trusted devices. + */ + #[Required] + public bool $crossSigning; + + /** + * Whether the first encrypted message sync is complete. + */ + #[Required] + public bool $firstSyncDone; + + /** + * Whether the user confirmed that they saved their recovery key. + */ + #[Required] + public bool $hasBackedUpRecoveryKey; + + /** + * Whether encrypted messaging setup has started. + */ + #[Required] + public bool $initialized; + + /** + * Whether encrypted message backup is available. + */ + #[Required] + public bool $keyBackup; + + /** + * Encrypted messaging keys available on this device. + */ + #[Required] + public Secrets $secrets; + + /** + * Whether secure key storage is available. + */ + #[Required] + public bool $secretStorage; + + /** + * Whether this device is trusted for encrypted messages. + */ + #[Required] + public bool $verified; + + /** + * Unix timestamp for when the recovery key was created. + */ + #[Optional] + public ?float $recoveryKeyGeneratedAt; + + /** + * `new E2EE()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * E2EE::with( + * crossSigning: ..., + * firstSyncDone: ..., + * hasBackedUpRecoveryKey: ..., + * initialized: ..., + * keyBackup: ..., + * secrets: ..., + * secretStorage: ..., + * verified: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new E2EE) + * ->withCrossSigning(...) + * ->withFirstSyncDone(...) + * ->withHasBackedUpRecoveryKey(...) + * ->withInitialized(...) + * ->withKeyBackup(...) + * ->withSecrets(...) + * ->withSecretStorage(...) + * ->withVerified(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Secrets|SecretsShape $secrets + */ + public static function with( + bool $crossSigning, + bool $firstSyncDone, + bool $hasBackedUpRecoveryKey, + bool $initialized, + bool $keyBackup, + Secrets|array $secrets, + bool $secretStorage, + bool $verified, + ?float $recoveryKeyGeneratedAt = null, + ): self { + $self = new self; + + $self['crossSigning'] = $crossSigning; + $self['firstSyncDone'] = $firstSyncDone; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + $self['initialized'] = $initialized; + $self['keyBackup'] = $keyBackup; + $self['secrets'] = $secrets; + $self['secretStorage'] = $secretStorage; + $self['verified'] = $verified; + + null !== $recoveryKeyGeneratedAt && $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } + + /** + * Whether this account can verify trusted devices. + */ + public function withCrossSigning(bool $crossSigning): self + { + $self = clone $this; + $self['crossSigning'] = $crossSigning; + + return $self; + } + + /** + * Whether the first encrypted message sync is complete. + */ + public function withFirstSyncDone(bool $firstSyncDone): self + { + $self = clone $this; + $self['firstSyncDone'] = $firstSyncDone; + + return $self; + } + + /** + * Whether the user confirmed that they saved their recovery key. + */ + public function withHasBackedUpRecoveryKey( + bool $hasBackedUpRecoveryKey + ): self { + $self = clone $this; + $self['hasBackedUpRecoveryKey'] = $hasBackedUpRecoveryKey; + + return $self; + } + + /** + * Whether encrypted messaging setup has started. + */ + public function withInitialized(bool $initialized): self + { + $self = clone $this; + $self['initialized'] = $initialized; + + return $self; + } + + /** + * Whether encrypted message backup is available. + */ + public function withKeyBackup(bool $keyBackup): self + { + $self = clone $this; + $self['keyBackup'] = $keyBackup; + + return $self; + } + + /** + * Encrypted messaging keys available on this device. + * + * @param Secrets|SecretsShape $secrets + */ + public function withSecrets(Secrets|array $secrets): self + { + $self = clone $this; + $self['secrets'] = $secrets; + + return $self; + } + + /** + * Whether secure key storage is available. + */ + public function withSecretStorage(bool $secretStorage): self + { + $self = clone $this; + $self['secretStorage'] = $secretStorage; + + return $self; + } + + /** + * Whether this device is trusted for encrypted messages. + */ + public function withVerified(bool $verified): self + { + $self = clone $this; + $self['verified'] = $verified; + + return $self; + } + + /** + * Unix timestamp for when the recovery key was created. + */ + public function withRecoveryKeyGeneratedAt( + float $recoveryKeyGeneratedAt + ): self { + $self = clone $this; + $self['recoveryKeyGeneratedAt'] = $recoveryKeyGeneratedAt; + + return $self; + } +} diff --git a/src/AppStateSnapshot/E2EE/Secrets.php b/src/AppStateSnapshot/E2EE/Secrets.php new file mode 100644 index 0000000..cdc4449 --- /dev/null +++ b/src/AppStateSnapshot/E2EE/Secrets.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Whether the account identity key is available. + */ + #[Required] + public bool $masterKey; + + /** + * Whether the encrypted message backup key is available. + */ + #[Required] + public bool $megolmBackupKey; + + /** + * Whether a recovery key is available. + */ + #[Required] + public bool $recoveryKey; + + /** + * Whether the device trust key is available. + */ + #[Required] + public bool $selfSigningKey; + + /** + * Whether the user trust key is available. + */ + #[Required] + public bool $userSigningKey; + + /** + * `new Secrets()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Secrets::with( + * masterKey: ..., + * megolmBackupKey: ..., + * recoveryKey: ..., + * selfSigningKey: ..., + * userSigningKey: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Secrets) + * ->withMasterKey(...) + * ->withMegolmBackupKey(...) + * ->withRecoveryKey(...) + * ->withSelfSigningKey(...) + * ->withUserSigningKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $masterKey, + bool $megolmBackupKey, + bool $recoveryKey, + bool $selfSigningKey, + bool $userSigningKey, + ): self { + $self = new self; + + $self['masterKey'] = $masterKey; + $self['megolmBackupKey'] = $megolmBackupKey; + $self['recoveryKey'] = $recoveryKey; + $self['selfSigningKey'] = $selfSigningKey; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } + + /** + * Whether the account identity key is available. + */ + public function withMasterKey(bool $masterKey): self + { + $self = clone $this; + $self['masterKey'] = $masterKey; + + return $self; + } + + /** + * Whether the encrypted message backup key is available. + */ + public function withMegolmBackupKey(bool $megolmBackupKey): self + { + $self = clone $this; + $self['megolmBackupKey'] = $megolmBackupKey; + + return $self; + } + + /** + * Whether a recovery key is available. + */ + public function withRecoveryKey(bool $recoveryKey): self + { + $self = clone $this; + $self['recoveryKey'] = $recoveryKey; + + return $self; + } + + /** + * Whether the device trust key is available. + */ + public function withSelfSigningKey(bool $selfSigningKey): self + { + $self = clone $this; + $self['selfSigningKey'] = $selfSigningKey; + + return $self; + } + + /** + * Whether the user trust key is available. + */ + public function withUserSigningKey(bool $userSigningKey): self + { + $self = clone $this; + $self['userSigningKey'] = $userSigningKey; + + return $self; + } +} diff --git a/src/AppStateSnapshot/Matrix.php b/src/AppStateSnapshot/Matrix.php new file mode 100644 index 0000000..d44383b --- /dev/null +++ b/src/AppStateSnapshot/Matrix.php @@ -0,0 +1,111 @@ + */ + use SdkModel; + + /** + * Current device ID. + */ + #[Required] + public string $deviceID; + + /** + * Beeper homeserver URL for this account. + */ + #[Required] + public string $homeserver; + + /** + * Signed-in Beeper user ID. + */ + #[Required] + public string $userID; + + /** + * `new Matrix()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Matrix::with(deviceID: ..., homeserver: ..., userID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Matrix)->withDeviceID(...)->withHomeserver(...)->withUserID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $deviceID, + string $homeserver, + string $userID + ): self { + $self = new self; + + $self['deviceID'] = $deviceID; + $self['homeserver'] = $homeserver; + $self['userID'] = $userID; + + return $self; + } + + /** + * Current device ID. + */ + public function withDeviceID(string $deviceID): self + { + $self = clone $this; + $self['deviceID'] = $deviceID; + + return $self; + } + + /** + * Beeper homeserver URL for this account. + */ + public function withHomeserver(string $homeserver): self + { + $self = clone $this; + $self['homeserver'] = $homeserver; + + return $self; + } + + /** + * Signed-in Beeper user ID. + */ + public function withUserID(string $userID): self + { + $self = clone $this; + $self['userID'] = $userID; + + return $self; + } +} diff --git a/src/AppStateSnapshot/State.php b/src/AppStateSnapshot/State.php new file mode 100644 index 0000000..0785f2f --- /dev/null +++ b/src/AppStateSnapshot/State.php @@ -0,0 +1,25 @@ +>, + * direction: Direction|value-of, + * methods: list>, + * purpose: Purpose|value-of, + * state: \BeeperDesktop\AppStateSnapshot\Verification\State|value-of<\BeeperDesktop\AppStateSnapshot\Verification\State>, + * error?: null|Error|ErrorShape, + * otherDevice?: null|OtherDevice|OtherDeviceShape, + * otherUserID?: string|null, + * qr?: null|QR|QRShape, + * sas?: null|SAS|SASShape, + * } + */ +final class Verification implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Verification ID to pass in verification action paths. + */ + #[Required] + public string $id; + + /** + * Verification actions that are valid for the current state. + * + * @var list> $availableActions + */ + #[Required(list: AvailableAction::class)] + public array $availableActions; + + /** + * Whether this device started or received the verification. + * + * @var value-of $direction + */ + #[Required(enum: Direction::class)] + public string $direction; + + /** + * Verification methods supported for this transaction. + * + * @var list> $methods + */ + #[Required(list: Method::class)] + public array $methods; + + /** + * Why this verification exists. + * + * @var value-of $purpose + */ + #[Required(enum: Purpose::class)] + public string $purpose; + + /** + * Current trusted-device verification state. + * + * @var value-of $state + */ + #[Required(enum: State::class)] + public string $state; + + /** + * Verification error details, if verification stopped. + */ + #[Optional] + public ?Error $error; + + /** + * Other device participating in verification. + */ + #[Optional] + public ?OtherDevice $otherDevice; + + /** + * Other Beeper user participating in verification. + */ + #[Optional] + public ?string $otherUserID; + + /** + * QR verification data. + */ + #[Optional] + public ?QR $qr; + + /** + * Emoji or number comparison data for verification. + */ + #[Optional] + public ?SAS $sas; + + /** + * `new Verification()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Verification::with( + * id: ..., + * availableActions: ..., + * direction: ..., + * methods: ..., + * purpose: ..., + * state: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Verification) + * ->withID(...) + * ->withAvailableActions(...) + * ->withDirection(...) + * ->withMethods(...) + * ->withPurpose(...) + * ->withState(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $availableActions + * @param Direction|value-of $direction + * @param list> $methods + * @param Purpose|value-of $purpose + * @param State|value-of $state + * @param Error|ErrorShape|null $error + * @param OtherDevice|OtherDeviceShape|null $otherDevice + * @param QR|QRShape|null $qr + * @param SAS|SASShape|null $sas + */ + public static function with( + string $id, + array $availableActions, + Direction|string $direction, + array $methods, + Purpose|string $purpose, + State|string $state, + Error|array|null $error = null, + OtherDevice|array|null $otherDevice = null, + ?string $otherUserID = null, + QR|array|null $qr = null, + SAS|array|null $sas = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['availableActions'] = $availableActions; + $self['direction'] = $direction; + $self['methods'] = $methods; + $self['purpose'] = $purpose; + $self['state'] = $state; + + null !== $error && $self['error'] = $error; + null !== $otherDevice && $self['otherDevice'] = $otherDevice; + null !== $otherUserID && $self['otherUserID'] = $otherUserID; + null !== $qr && $self['qr'] = $qr; + null !== $sas && $self['sas'] = $sas; + + return $self; + } + + /** + * Verification ID to pass in verification action paths. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Verification actions that are valid for the current state. + * + * @param list> $availableActions + */ + public function withAvailableActions(array $availableActions): self + { + $self = clone $this; + $self['availableActions'] = $availableActions; + + return $self; + } + + /** + * Whether this device started or received the verification. + * + * @param Direction|value-of $direction + */ + public function withDirection(Direction|string $direction): self + { + $self = clone $this; + $self['direction'] = $direction; + + return $self; + } + + /** + * Verification methods supported for this transaction. + * + * @param list> $methods + */ + public function withMethods(array $methods): self + { + $self = clone $this; + $self['methods'] = $methods; + + return $self; + } + + /** + * Why this verification exists. + * + * @param Purpose|value-of $purpose + */ + public function withPurpose(Purpose|string $purpose): self + { + $self = clone $this; + $self['purpose'] = $purpose; + + return $self; + } + + /** + * Current trusted-device verification state. + * + * @param State|value-of $state + */ + public function withState( + State|string $state + ): self { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * Verification error details, if verification stopped. + * + * @param Error|ErrorShape $error + */ + public function withError(Error|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Other device participating in verification. + * + * @param OtherDevice|OtherDeviceShape $otherDevice + */ + public function withOtherDevice(OtherDevice|array $otherDevice): self + { + $self = clone $this; + $self['otherDevice'] = $otherDevice; + + return $self; + } + + /** + * Other Beeper user participating in verification. + */ + public function withOtherUserID(string $otherUserID): self + { + $self = clone $this; + $self['otherUserID'] = $otherUserID; + + return $self; + } + + /** + * QR verification data. + * + * @param QR|QRShape $qr + */ + public function withQR(QR|array $qr): self + { + $self = clone $this; + $self['qr'] = $qr; + + return $self; + } + + /** + * Emoji or number comparison data for verification. + * + * @param SAS|SASShape $sas + */ + public function withSAS(SAS|array $sas): self + { + $self = clone $this; + $self['sas'] = $sas; + + return $self; + } +} diff --git a/src/AppStateSnapshot/Verification/AvailableAction.php b/src/AppStateSnapshot/Verification/AvailableAction.php new file mode 100644 index 0000000..0479fae --- /dev/null +++ b/src/AppStateSnapshot/Verification/AvailableAction.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * Verification error code. + */ + #[Required] + public string $code; + + /** + * User-facing verification error message. + */ + #[Required] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(code: ..., reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withCode(...)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $code, string $reason): self + { + $self = new self; + + $self['code'] = $code; + $self['reason'] = $reason; + + return $self; + } + + /** + * Verification error code. + */ + public function withCode(string $code): self + { + $self = clone $this; + $self['code'] = $code; + + return $self; + } + + /** + * User-facing verification error message. + */ + public function withReason(string $reason): self + { + $self = clone $this; + $self['reason'] = $reason; + + return $self; + } +} diff --git a/src/AppStateSnapshot/Verification/Method.php b/src/AppStateSnapshot/Verification/Method.php new file mode 100644 index 0000000..fb6b4ed --- /dev/null +++ b/src/AppStateSnapshot/Verification/Method.php @@ -0,0 +1,12 @@ + */ + use SdkModel; + + /** + * Other device ID. + */ + #[Required] + public string $id; + + /** + * Other device display name, if known. + */ + #[Optional] + public ?string $name; + + /** + * `new OtherDevice()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OtherDevice::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OtherDevice)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, ?string $name = null): self + { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Other device ID. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Other device display name, if known. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/AppStateSnapshot/Verification/Purpose.php b/src/AppStateSnapshot/Verification/Purpose.php new file mode 100644 index 0000000..86d37bf --- /dev/null +++ b/src/AppStateSnapshot/Verification/Purpose.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * QR code payload to display for verification. + */ + #[Required] + public string $data; + + /** + * `new QR()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QR::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QR)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + /** + * QR code payload to display for verification. + */ + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/AppStateSnapshot/Verification/SAS.php b/src/AppStateSnapshot/Verification/SAS.php new file mode 100644 index 0000000..51edc58 --- /dev/null +++ b/src/AppStateSnapshot/Verification/SAS.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Emoji sequence to compare on both devices. + */ + #[Required] + public string $emojis; + + /** + * Number sequence to compare on both devices. + */ + #[Optional] + public ?string $decimals; + + /** + * `new SAS()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SAS::with(emojis: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SAS)->withEmojis(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $emojis, ?string $decimals = null): self + { + $self = new self; + + $self['emojis'] = $emojis; + + null !== $decimals && $self['decimals'] = $decimals; + + return $self; + } + + /** + * Emoji sequence to compare on both devices. + */ + public function withEmojis(string $emojis): self + { + $self = clone $this; + $self['emojis'] = $emojis; + + return $self; + } + + /** + * Number sequence to compare on both devices. + */ + public function withDecimals(string $decimals): self + { + $self = clone $this; + $self['decimals'] = $decimals; + + return $self; + } +} diff --git a/src/AppStateSnapshot/Verification/State.php b/src/AppStateSnapshot/Verification/State.php new file mode 100644 index 0000000..4b2108b --- /dev/null +++ b/src/AppStateSnapshot/Verification/State.php @@ -0,0 +1,25 @@ +, @@ -27,6 +29,7 @@ * posterImg?: string|null, * size?: null|Size|SizeShape, * srcURL?: string|null, + * transcription?: null|Transcription|TranscriptionShape, * } */ final class Attachment implements BaseModel @@ -43,7 +46,7 @@ final class Attachment implements BaseModel public string $type; /** - * Attachment identifier (typically an mxc:// URL). Use with /v1/assets/download to get a local file path. + * Attachment identifier, typically an mxc:// URL. Use the download file endpoint to get a local file path. */ #[Optional] public ?string $id; @@ -91,7 +94,7 @@ final class Attachment implements BaseModel public ?string $mimeType; /** - * Preview image URL for video attachments (poster frame). May be temporary or local-only to this device; download promptly if durable access is needed. + * Preview image URL for video attachments (poster frame). May be temporary or available only on this device; download promptly if durable access is needed. */ #[Optional] public ?string $posterImg; @@ -103,11 +106,17 @@ final class Attachment implements BaseModel public ?Size $size; /** - * Public URL or local file path to fetch the asset. May be temporary or local-only to this device; download promptly if durable access is needed. + * Public URL or local file path to fetch the file. May be temporary or available only on this device; download promptly if durable access is needed. */ #[Optional] public ?string $srcURL; + /** + * Attachment transcription if available. + */ + #[Optional] + public ?Transcription $transcription; + /** * `new Attachment()` is missing required properties by the API. * @@ -134,6 +143,7 @@ public function __construct() * * @param Type|value-of $type * @param Size|SizeShape|null $size + * @param Transcription|TranscriptionShape|null $transcription */ public static function with( Type|string $type, @@ -148,6 +158,7 @@ public static function with( ?string $posterImg = null, Size|array|null $size = null, ?string $srcURL = null, + Transcription|array|null $transcription = null, ): self { $self = new self; @@ -164,6 +175,7 @@ public static function with( null !== $posterImg && $self['posterImg'] = $posterImg; null !== $size && $self['size'] = $size; null !== $srcURL && $self['srcURL'] = $srcURL; + null !== $transcription && $self['transcription'] = $transcription; return $self; } @@ -182,7 +194,7 @@ public function withType(Type|string $type): self } /** - * Attachment identifier (typically an mxc:// URL). Use with /v1/assets/download to get a local file path. + * Attachment identifier, typically an mxc:// URL. Use the download file endpoint to get a local file path. */ public function withID(string $id): self { @@ -270,7 +282,7 @@ public function withMimeType(string $mimeType): self } /** - * Preview image URL for video attachments (poster frame). May be temporary or local-only to this device; download promptly if durable access is needed. + * Preview image URL for video attachments (poster frame). May be temporary or available only on this device; download promptly if durable access is needed. */ public function withPosterImg(string $posterImg): self { @@ -294,7 +306,7 @@ public function withSize(Size|array $size): self } /** - * Public URL or local file path to fetch the asset. May be temporary or local-only to this device; download promptly if durable access is needed. + * Public URL or local file path to fetch the file. May be temporary or available only on this device; download promptly if durable access is needed. */ public function withSrcURL(string $srcURL): self { @@ -303,4 +315,17 @@ public function withSrcURL(string $srcURL): self return $self; } + + /** + * Attachment transcription if available. + * + * @param Transcription|TranscriptionShape $transcription + */ + public function withTranscription(Transcription|array $transcription): self + { + $self = clone $this; + $self['transcription'] = $transcription; + + return $self; + } } diff --git a/src/Attachment/Transcription.php b/src/Attachment/Transcription.php new file mode 100644 index 0000000..957c2d5 --- /dev/null +++ b/src/Attachment/Transcription.php @@ -0,0 +1,113 @@ + */ + use SdkModel; + + /** + * Transcription engine. + */ + #[Required] + public string $engine; + + /** + * Transcribed text. + */ + #[Required] + public string $transcription; + + /** + * Detected or selected language. + */ + #[Optional] + public ?string $language; + + /** + * `new Transcription()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transcription::with(engine: ..., transcription: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transcription)->withEngine(...)->withTranscription(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $engine, + string $transcription, + ?string $language = null + ): self { + $self = new self; + + $self['engine'] = $engine; + $self['transcription'] = $transcription; + + null !== $language && $self['language'] = $language; + + return $self; + } + + /** + * Transcription engine. + */ + public function withEngine(string $engine): self + { + $self = clone $this; + $self['engine'] = $engine; + + return $self; + } + + /** + * Transcribed text. + */ + public function withTranscription(string $transcription): self + { + $self = clone $this; + $self['transcription'] = $transcription; + + return $self; + } + + /** + * Detected or selected language. + */ + public function withLanguage(string $language): self + { + $self = clone $this; + $self['language'] = $language; + + return $self; + } +} diff --git a/src/AttachmentCapabilities.php b/src/AttachmentCapabilities.php new file mode 100644 index 0000000..087a721 --- /dev/null +++ b/src/AttachmentCapabilities.php @@ -0,0 +1,228 @@ +>, + * caption?: null|Caption|value-of, + * maxCaptionLength?: int|null, + * maxDuration?: int|null, + * maxHeight?: int|null, + * maxSize?: int|null, + * maxWidth?: int|null, + * viewOnce?: bool|null, + * } + */ +final class AttachmentCapabilities implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Supported MIME types or MIME patterns for this file message type. Missing MIME types should be treated as rejected. + * + * @var array> $mimeTypes + */ + #[Required(map: MimeType::class)] + public array $mimeTypes; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $caption + */ + #[Optional(enum: Caption::class)] + public ?int $caption; + + /** + * Maximum caption length when captions are supported. + */ + #[Optional] + public ?int $maxCaptionLength; + + /** + * Maximum audio or video duration in seconds. + */ + #[Optional] + public ?int $maxDuration; + + /** + * Maximum image or video height in pixels. + */ + #[Optional] + public ?int $maxHeight; + + /** + * Maximum file size in bytes. + */ + #[Optional] + public ?int $maxSize; + + /** + * Maximum image or video width in pixels. + */ + #[Optional] + public ?int $maxWidth; + + /** + * True if this file type can be sent as view-once media. + */ + #[Optional] + public ?bool $viewOnce; + + /** + * `new AttachmentCapabilities()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AttachmentCapabilities::with(mimeTypes: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AttachmentCapabilities)->withMimeTypes(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array> $mimeTypes + * @param Caption|value-of|null $caption + */ + public static function with( + array $mimeTypes, + Caption|int|null $caption = null, + ?int $maxCaptionLength = null, + ?int $maxDuration = null, + ?int $maxHeight = null, + ?int $maxSize = null, + ?int $maxWidth = null, + ?bool $viewOnce = null, + ): self { + $self = new self; + + $self['mimeTypes'] = $mimeTypes; + + null !== $caption && $self['caption'] = $caption; + null !== $maxCaptionLength && $self['maxCaptionLength'] = $maxCaptionLength; + null !== $maxDuration && $self['maxDuration'] = $maxDuration; + null !== $maxHeight && $self['maxHeight'] = $maxHeight; + null !== $maxSize && $self['maxSize'] = $maxSize; + null !== $maxWidth && $self['maxWidth'] = $maxWidth; + null !== $viewOnce && $self['viewOnce'] = $viewOnce; + + return $self; + } + + /** + * Supported MIME types or MIME patterns for this file message type. Missing MIME types should be treated as rejected. + * + * @param array> $mimeTypes + */ + public function withMimeTypes(array $mimeTypes): self + { + $self = clone $this; + $self['mimeTypes'] = $mimeTypes; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Caption|value-of $caption + */ + public function withCaption(Caption|int $caption): self + { + $self = clone $this; + $self['caption'] = $caption; + + return $self; + } + + /** + * Maximum caption length when captions are supported. + */ + public function withMaxCaptionLength(int $maxCaptionLength): self + { + $self = clone $this; + $self['maxCaptionLength'] = $maxCaptionLength; + + return $self; + } + + /** + * Maximum audio or video duration in seconds. + */ + public function withMaxDuration(int $maxDuration): self + { + $self = clone $this; + $self['maxDuration'] = $maxDuration; + + return $self; + } + + /** + * Maximum image or video height in pixels. + */ + public function withMaxHeight(int $maxHeight): self + { + $self = clone $this; + $self['maxHeight'] = $maxHeight; + + return $self; + } + + /** + * Maximum file size in bytes. + */ + public function withMaxSize(int $maxSize): self + { + $self = clone $this; + $self['maxSize'] = $maxSize; + + return $self; + } + + /** + * Maximum image or video width in pixels. + */ + public function withMaxWidth(int $maxWidth): self + { + $self = clone $this; + $self['maxWidth'] = $maxWidth; + + return $self; + } + + /** + * True if this file type can be sent as view-once media. + */ + public function withViewOnce(bool $viewOnce): self + { + $self = clone $this; + $self['viewOnce'] = $viewOnce; + + return $self; + } +} diff --git a/src/AttachmentCapabilities/Caption.php b/src/AttachmentCapabilities/Caption.php new file mode 100644 index 0000000..7a3436e --- /dev/null +++ b/src/AttachmentCapabilities/Caption.php @@ -0,0 +1,21 @@ +, + * activeAccountCount: int, + * displayName: string, + * provider: Provider|value-of, + * status: Status|value-of, + * supportsMultipleAccounts: bool, + * type: string, + * network?: string|null, + * statusText?: string|null, + * } + */ +final class Bridge implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Bridge ID. Use with bridge endpoints. + */ + #[Required] + public string $id; + + /** + * Connected accounts for this bridge. Uses the same Account schema as GET /v1/accounts. + * + * @var list $accounts + */ + #[Required(list: Account::class)] + public array $accounts; + + /** + * Number of active accounts for this network on this device. + */ + #[Required] + public int $activeAccountCount; + + /** + * Human-friendly bridge name shown in Beeper. + */ + #[Required] + public string $displayName; + + /** + * Where accounts for this bridge run: on this device or in Beeper Cloud. + * + * @var value-of $provider + */ + #[Required(enum: Provider::class)] + public string $provider; + + /** + * Whether this bridge can currently be used to connect new accounts. + * + * @var value-of $status + */ + #[Required(enum: Status::class)] + public string $status; + + /** + * Whether this bridge can have multiple active accounts for the same network. + */ + #[Required] + public bool $supportsMultipleAccounts; + + /** + * Underlying bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. + */ + #[Required] + public string $type; + + /** + * Network grouping used for account counts and limits. + */ + #[Optional] + public ?string $network; + + /** + * Human-friendly status text matching Beeper account management language. + */ + #[Optional] + public ?string $statusText; + + /** + * `new Bridge()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Bridge::with( + * id: ..., + * accounts: ..., + * activeAccountCount: ..., + * displayName: ..., + * provider: ..., + * status: ..., + * supportsMultipleAccounts: ..., + * type: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Bridge) + * ->withID(...) + * ->withAccounts(...) + * ->withActiveAccountCount(...) + * ->withDisplayName(...) + * ->withProvider(...) + * ->withStatus(...) + * ->withSupportsMultipleAccounts(...) + * ->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $accounts + * @param Provider|value-of $provider + * @param Status|value-of $status + */ + public static function with( + string $id, + array $accounts, + int $activeAccountCount, + string $displayName, + Provider|string $provider, + Status|string $status, + bool $supportsMultipleAccounts, + string $type, + ?string $network = null, + ?string $statusText = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['accounts'] = $accounts; + $self['activeAccountCount'] = $activeAccountCount; + $self['displayName'] = $displayName; + $self['provider'] = $provider; + $self['status'] = $status; + $self['supportsMultipleAccounts'] = $supportsMultipleAccounts; + $self['type'] = $type; + + null !== $network && $self['network'] = $network; + null !== $statusText && $self['statusText'] = $statusText; + + return $self; + } + + /** + * Bridge ID. Use with bridge endpoints. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Connected accounts for this bridge. Uses the same Account schema as GET /v1/accounts. + * + * @param list $accounts + */ + public function withAccounts(array $accounts): self + { + $self = clone $this; + $self['accounts'] = $accounts; + + return $self; + } + + /** + * Number of active accounts for this network on this device. + */ + public function withActiveAccountCount(int $activeAccountCount): self + { + $self = clone $this; + $self['activeAccountCount'] = $activeAccountCount; + + return $self; + } + + /** + * Human-friendly bridge name shown in Beeper. + */ + public function withDisplayName(string $displayName): self + { + $self = clone $this; + $self['displayName'] = $displayName; + + return $self; + } + + /** + * Where accounts for this bridge run: on this device or in Beeper Cloud. + * + * @param Provider|value-of $provider + */ + public function withProvider(Provider|string $provider): self + { + $self = clone $this; + $self['provider'] = $provider; + + return $self; + } + + /** + * Whether this bridge can currently be used to connect new accounts. + * + * @param Status|value-of $status + */ + public function withStatus(Status|string $status): self + { + $self = clone $this; + $self['status'] = $status; + + return $self; + } + + /** + * Whether this bridge can have multiple active accounts for the same network. + */ + public function withSupportsMultipleAccounts( + bool $supportsMultipleAccounts + ): self { + $self = clone $this; + $self['supportsMultipleAccounts'] = $supportsMultipleAccounts; + + return $self; + } + + /** + * Underlying bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * Network grouping used for account counts and limits. + */ + public function withNetwork(string $network): self + { + $self = clone $this; + $self['network'] = $network; + + return $self; + } + + /** + * Human-friendly status text matching Beeper account management language. + */ + public function withStatusText(string $statusText): self + { + $self = clone $this; + $self['statusText'] = $statusText; + + return $self; + } +} diff --git a/src/Bridges/Bridge/Provider.php b/src/Bridges/Bridge/Provider.php new file mode 100644 index 0000000..8b0bd01 --- /dev/null +++ b/src/Bridges/Bridge/Provider.php @@ -0,0 +1,19 @@ +, + * activeAccountCount: int, + * displayName: string, + * provider: Provider|value-of, + * status: Status|value-of, + * supportsMultipleAccounts: bool, + * type: string, + * network?: string|null, + * statusText?: string|null, + * } + */ +final class BridgeGetResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Bridge ID. Use with bridge endpoints. + */ + #[Required] + public string $id; + + /** + * Connected accounts for this bridge. Uses the same Account schema as GET /v1/accounts. + * + * @var list $accounts + */ + #[Required(list: Account::class)] + public array $accounts; + + /** + * Number of active accounts for this network on this device. + */ + #[Required] + public int $activeAccountCount; + + /** + * Human-friendly bridge name shown in Beeper. + */ + #[Required] + public string $displayName; + + /** + * Where accounts for this bridge run: on this device or in Beeper Cloud. + * + * @var value-of $provider + */ + #[Required(enum: Provider::class)] + public string $provider; + + /** + * Whether this bridge can currently be used to connect new accounts. + * + * @var value-of $status + */ + #[Required(enum: Status::class)] + public string $status; + + /** + * Whether this bridge can have multiple active accounts for the same network. + */ + #[Required] + public bool $supportsMultipleAccounts; + + /** + * Underlying bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. + */ + #[Required] + public string $type; + + /** + * Network grouping used for account counts and limits. + */ + #[Optional] + public ?string $network; + + /** + * Human-friendly status text matching Beeper account management language. + */ + #[Optional] + public ?string $statusText; + + /** + * `new BridgeGetResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * BridgeGetResponse::with( + * id: ..., + * accounts: ..., + * activeAccountCount: ..., + * displayName: ..., + * provider: ..., + * status: ..., + * supportsMultipleAccounts: ..., + * type: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new BridgeGetResponse) + * ->withID(...) + * ->withAccounts(...) + * ->withActiveAccountCount(...) + * ->withDisplayName(...) + * ->withProvider(...) + * ->withStatus(...) + * ->withSupportsMultipleAccounts(...) + * ->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $accounts + * @param Provider|value-of $provider + * @param Status|value-of $status + */ + public static function with( + string $id, + array $accounts, + int $activeAccountCount, + string $displayName, + Provider|string $provider, + Status|string $status, + bool $supportsMultipleAccounts, + string $type, + ?string $network = null, + ?string $statusText = null, + ): self { + $self = new self; + + $self['id'] = $id; + $self['accounts'] = $accounts; + $self['activeAccountCount'] = $activeAccountCount; + $self['displayName'] = $displayName; + $self['provider'] = $provider; + $self['status'] = $status; + $self['supportsMultipleAccounts'] = $supportsMultipleAccounts; + $self['type'] = $type; + + null !== $network && $self['network'] = $network; + null !== $statusText && $self['statusText'] = $statusText; + + return $self; + } + + /** + * Bridge ID. Use with bridge endpoints. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Connected accounts for this bridge. Uses the same Account schema as GET /v1/accounts. + * + * @param list $accounts + */ + public function withAccounts(array $accounts): self + { + $self = clone $this; + $self['accounts'] = $accounts; + + return $self; + } + + /** + * Number of active accounts for this network on this device. + */ + public function withActiveAccountCount(int $activeAccountCount): self + { + $self = clone $this; + $self['activeAccountCount'] = $activeAccountCount; + + return $self; + } + + /** + * Human-friendly bridge name shown in Beeper. + */ + public function withDisplayName(string $displayName): self + { + $self = clone $this; + $self['displayName'] = $displayName; + + return $self; + } + + /** + * Where accounts for this bridge run: on this device or in Beeper Cloud. + * + * @param Provider|value-of $provider + */ + public function withProvider(Provider|string $provider): self + { + $self = clone $this; + $self['provider'] = $provider; + + return $self; + } + + /** + * Whether this bridge can currently be used to connect new accounts. + * + * @param Status|value-of $status + */ + public function withStatus(Status|string $status): self + { + $self = clone $this; + $self['status'] = $status; + + return $self; + } + + /** + * Whether this bridge can have multiple active accounts for the same network. + */ + public function withSupportsMultipleAccounts( + bool $supportsMultipleAccounts + ): self { + $self = clone $this; + $self['supportsMultipleAccounts'] = $supportsMultipleAccounts; + + return $self; + } + + /** + * Underlying bridge type, such as matrix, discordgo, slackgo, whatsapp, telegram, or twitter. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * Network grouping used for account counts and limits. + */ + public function withNetwork(string $network): self + { + $self = clone $this; + $self['network'] = $network; + + return $self; + } + + /** + * Human-friendly status text matching Beeper account management language. + */ + public function withStatusText(string $statusText): self + { + $self = clone $this; + $self['statusText'] = $statusText; + + return $self; + } +} diff --git a/src/Bridges/BridgeGetResponse/Provider.php b/src/Bridges/BridgeGetResponse/Provider.php new file mode 100644 index 0000000..c240f4f --- /dev/null +++ b/src/Bridges/BridgeGetResponse/Provider.php @@ -0,0 +1,19 @@ +} + */ +final class BridgeListResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var list $items */ + #[Required(list: Bridge::class)] + public array $items; + + /** + * `new BridgeListResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * BridgeListResponse::with(items: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new BridgeListResponse)->withItems(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $items + */ + public static function with(array $items): self + { + $self = new self; + + $self['items'] = $items; + + return $self; + } + + /** + * @param list $items + */ + public function withItems(array $items): self + { + $self = clone $this; + $self['items'] = $items; + + return $self; + } +} diff --git a/src/Bridges/BridgeLogin.php b/src/Bridges/BridgeLogin.php new file mode 100644 index 0000000..20f0dcb --- /dev/null +++ b/src/Bridges/BridgeLogin.php @@ -0,0 +1,211 @@ +>, + * status: Status|value-of, + * accountIDs?: list|null, + * statusText?: string|null, + * user?: null|User|UserShape, + * } + */ +final class BridgeLogin implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Bridge ID. + */ + #[Required] + public string $bridgeID; + + /** + * Bridge login ID. + */ + #[Required] + public string $loginID; + + /** @var list> $removeScopes */ + #[Required(list: RemoveScope::class)] + public array $removeScopes; + + /** @var value-of $status */ + #[Required(enum: Status::class)] + public string $status; + + /** + * Chat accounts that belong to this bridge login, when known. + * + * @var list|null $accountIDs + */ + #[Optional(list: 'string')] + public ?array $accountIDs; + + /** + * Human-friendly bridge login status text. + */ + #[Optional] + public ?string $statusText; + + /** + * User the account belongs to. + */ + #[Optional] + public ?User $user; + + /** + * `new BridgeLogin()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * BridgeLogin::with(bridgeID: ..., loginID: ..., removeScopes: ..., status: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new BridgeLogin) + * ->withBridgeID(...) + * ->withLoginID(...) + * ->withRemoveScopes(...) + * ->withStatus(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $removeScopes + * @param Status|value-of $status + * @param list|null $accountIDs + * @param User|UserShape|null $user + */ + public static function with( + string $bridgeID, + string $loginID, + array $removeScopes, + Status|string $status, + ?array $accountIDs = null, + ?string $statusText = null, + User|array|null $user = null, + ): self { + $self = new self; + + $self['bridgeID'] = $bridgeID; + $self['loginID'] = $loginID; + $self['removeScopes'] = $removeScopes; + $self['status'] = $status; + + null !== $accountIDs && $self['accountIDs'] = $accountIDs; + null !== $statusText && $self['statusText'] = $statusText; + null !== $user && $self['user'] = $user; + + return $self; + } + + /** + * Bridge ID. + */ + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } + + /** + * Bridge login ID. + */ + public function withLoginID(string $loginID): self + { + $self = clone $this; + $self['loginID'] = $loginID; + + return $self; + } + + /** + * @param list> $removeScopes + */ + public function withRemoveScopes(array $removeScopes): self + { + $self = clone $this; + $self['removeScopes'] = $removeScopes; + + return $self; + } + + /** + * @param Status|value-of $status + */ + public function withStatus(Status|string $status): self + { + $self = clone $this; + $self['status'] = $status; + + return $self; + } + + /** + * Chat accounts that belong to this bridge login, when known. + * + * @param list $accountIDs + */ + public function withAccountIDs(array $accountIDs): self + { + $self = clone $this; + $self['accountIDs'] = $accountIDs; + + return $self; + } + + /** + * Human-friendly bridge login status text. + */ + public function withStatusText(string $statusText): self + { + $self = clone $this; + $self['statusText'] = $statusText; + + return $self; + } + + /** + * User the account belongs to. + * + * @param User|UserShape $user + */ + public function withUser(User|array $user): self + { + $self = clone $this; + $self['user'] = $user; + + return $self; + } +} diff --git a/src/Bridges/BridgeLogin/RemoveScope.php b/src/Bridges/BridgeLogin/RemoveScope.php new file mode 100644 index 0000000..3be8f16 --- /dev/null +++ b/src/Bridges/BridgeLogin/RemoveScope.php @@ -0,0 +1,15 @@ + + * } + */ +final class CookieField implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Field ID to send back in the fields object. + */ + #[Required] + public string $id; + + /** + * Cookie, header, or local storage key to collect. + */ + #[Optional] + public ?string $name; + + /** + * Browser storage source for this value. + * + * @var value-of|null $type + */ + #[Optional(enum: Type::class)] + public ?string $type; + + /** + * `new CookieField()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * CookieField::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new CookieField)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type|value-of|null $type + */ + public static function with( + string $id, + ?string $name = null, + Type|string|null $type = null + ): self { + $self = new self; + + $self['id'] = $id; + + null !== $name && $self['name'] = $name; + null !== $type && $self['type'] = $type; + + return $self; + } + + /** + * Field ID to send back in the fields object. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Cookie, header, or local storage key to collect. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } + + /** + * Browser storage source for this value. + * + * @param Type|value-of $type + */ + public function withType(Type|string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } +} diff --git a/src/Bridges/CookieField/Type.php b/src/Bridges/CookieField/Type.php new file mode 100644 index 0000000..958fe01 --- /dev/null +++ b/src/Bridges/CookieField/Type.php @@ -0,0 +1,17 @@ +>, + * omitEmptyTimer?: bool|null, + * timers?: list|null, + * } + */ +final class DisappearingTimerCapability implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var list> $types */ + #[Required(list: Type::class)] + public array $types; + + #[Optional('omit_empty_timer')] + public ?bool $omitEmptyTimer; + + /** @var list|null $timers */ + #[Optional(list: 'int')] + public ?array $timers; + + /** + * `new DisappearingTimerCapability()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * DisappearingTimerCapability::with(types: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new DisappearingTimerCapability)->withTypes(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list> $types + * @param list|null $timers + */ + public static function with( + array $types, + ?bool $omitEmptyTimer = null, + ?array $timers = null + ): self { + $self = new self; + + $self['types'] = $types; + + null !== $omitEmptyTimer && $self['omitEmptyTimer'] = $omitEmptyTimer; + null !== $timers && $self['timers'] = $timers; + + return $self; + } + + /** + * @param list> $types + */ + public function withTypes(array $types): self + { + $self = clone $this; + $self['types'] = $types; + + return $self; + } + + public function withOmitEmptyTimer(bool $omitEmptyTimer): self + { + $self = clone $this; + $self['omitEmptyTimer'] = $omitEmptyTimer; + + return $self; + } + + /** + * @param list $timers + */ + public function withTimers(array $timers): self + { + $self = clone $this; + $self['timers'] = $timers; + + return $self; + } +} diff --git a/src/Bridges/DisappearingTimerCapability/Type.php b/src/Bridges/DisappearingTimerCapability/Type.php new file mode 100644 index 0000000..9717731 --- /dev/null +++ b/src/Bridges/DisappearingTimerCapability/Type.php @@ -0,0 +1,16 @@ + */ + use SdkModel; + + #[Required] + public bool $allowed; + + #[Optional('max_length')] + public ?int $maxLength; + + #[Optional('min_length')] + public ?int $minLength; + + #[Optional] + public ?bool $required; + + /** + * Disappearing-message timer capability. + */ + #[Optional] + public ?DisappearingTimerCapability $settings; + + /** + * `new GroupFieldCapability()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * GroupFieldCapability::with(allowed: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new GroupFieldCapability)->withAllowed(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param DisappearingTimerCapability|DisappearingTimerCapabilityShape|null $settings + */ + public static function with( + bool $allowed, + ?int $maxLength = null, + ?int $minLength = null, + ?bool $required = null, + DisappearingTimerCapability|array|null $settings = null, + ): self { + $self = new self; + + $self['allowed'] = $allowed; + + null !== $maxLength && $self['maxLength'] = $maxLength; + null !== $minLength && $self['minLength'] = $minLength; + null !== $required && $self['required'] = $required; + null !== $settings && $self['settings'] = $settings; + + return $self; + } + + public function withAllowed(bool $allowed): self + { + $self = clone $this; + $self['allowed'] = $allowed; + + return $self; + } + + public function withMaxLength(int $maxLength): self + { + $self = clone $this; + $self['maxLength'] = $maxLength; + + return $self; + } + + public function withMinLength(int $minLength): self + { + $self = clone $this; + $self['minLength'] = $minLength; + + return $self; + } + + public function withRequired(bool $required): self + { + $self = clone $this; + $self['required'] = $required; + + return $self; + } + + /** + * Disappearing-message timer capability. + * + * @param DisappearingTimerCapability|DisappearingTimerCapabilityShape $settings + */ + public function withSettings( + DisappearingTimerCapability|array $settings + ): self { + $self = clone $this; + $self['settings'] = $settings; + + return $self; + } +} diff --git a/src/Bridges/GroupTypeCapabilities.php b/src/Bridges/GroupTypeCapabilities.php new file mode 100644 index 0000000..a6b74eb --- /dev/null +++ b/src/Bridges/GroupTypeCapabilities.php @@ -0,0 +1,234 @@ + */ + use SdkModel; + + #[Required('type_description')] + public string $typeDescription; + + /** + * Group creation field capability. + */ + #[Optional] + public ?GroupFieldCapability $avatar; + + /** + * Group creation field capability. + */ + #[Optional] + public ?GroupFieldCapability $disappear; + + /** + * Group creation field capability. + */ + #[Optional] + public ?GroupFieldCapability $name; + + /** + * Group creation field capability. + */ + #[Optional] + public ?GroupFieldCapability $parent; + + /** + * Group creation field capability. + */ + #[Optional] + public ?GroupFieldCapability $participants; + + /** + * Group creation field capability. + */ + #[Optional] + public ?GroupFieldCapability $topic; + + /** + * Group creation field capability. + */ + #[Optional] + public ?GroupFieldCapability $username; + + /** + * `new GroupTypeCapabilities()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * GroupTypeCapabilities::with(typeDescription: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new GroupTypeCapabilities)->withTypeDescription(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param GroupFieldCapability|GroupFieldCapabilityShape|null $avatar + * @param GroupFieldCapability|GroupFieldCapabilityShape|null $disappear + * @param GroupFieldCapability|GroupFieldCapabilityShape|null $name + * @param GroupFieldCapability|GroupFieldCapabilityShape|null $parent + * @param GroupFieldCapability|GroupFieldCapabilityShape|null $participants + * @param GroupFieldCapability|GroupFieldCapabilityShape|null $topic + * @param GroupFieldCapability|GroupFieldCapabilityShape|null $username + */ + public static function with( + string $typeDescription, + GroupFieldCapability|array|null $avatar = null, + GroupFieldCapability|array|null $disappear = null, + GroupFieldCapability|array|null $name = null, + GroupFieldCapability|array|null $parent = null, + GroupFieldCapability|array|null $participants = null, + GroupFieldCapability|array|null $topic = null, + GroupFieldCapability|array|null $username = null, + ): self { + $self = new self; + + $self['typeDescription'] = $typeDescription; + + null !== $avatar && $self['avatar'] = $avatar; + null !== $disappear && $self['disappear'] = $disappear; + null !== $name && $self['name'] = $name; + null !== $parent && $self['parent'] = $parent; + null !== $participants && $self['participants'] = $participants; + null !== $topic && $self['topic'] = $topic; + null !== $username && $self['username'] = $username; + + return $self; + } + + public function withTypeDescription(string $typeDescription): self + { + $self = clone $this; + $self['typeDescription'] = $typeDescription; + + return $self; + } + + /** + * Group creation field capability. + * + * @param GroupFieldCapability|GroupFieldCapabilityShape $avatar + */ + public function withAvatar(GroupFieldCapability|array $avatar): self + { + $self = clone $this; + $self['avatar'] = $avatar; + + return $self; + } + + /** + * Group creation field capability. + * + * @param GroupFieldCapability|GroupFieldCapabilityShape $disappear + */ + public function withDisappear(GroupFieldCapability|array $disappear): self + { + $self = clone $this; + $self['disappear'] = $disappear; + + return $self; + } + + /** + * Group creation field capability. + * + * @param GroupFieldCapability|GroupFieldCapabilityShape $name + */ + public function withName(GroupFieldCapability|array $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } + + /** + * Group creation field capability. + * + * @param GroupFieldCapability|GroupFieldCapabilityShape $parent + */ + public function withParent(GroupFieldCapability|array $parent): self + { + $self = clone $this; + $self['parent'] = $parent; + + return $self; + } + + /** + * Group creation field capability. + * + * @param GroupFieldCapability|GroupFieldCapabilityShape $participants + */ + public function withParticipants( + GroupFieldCapability|array $participants + ): self { + $self = clone $this; + $self['participants'] = $participants; + + return $self; + } + + /** + * Group creation field capability. + * + * @param GroupFieldCapability|GroupFieldCapabilityShape $topic + */ + public function withTopic(GroupFieldCapability|array $topic): self + { + $self = clone $this; + $self['topic'] = $topic; + + return $self; + } + + /** + * Group creation field capability. + * + * @param GroupFieldCapability|GroupFieldCapabilityShape $username + */ + public function withUsername(GroupFieldCapability|array $username): self + { + $self = clone $this; + $self['username'] = $username; + + return $self; + } +} diff --git a/src/Bridges/LoginFlow.php b/src/Bridges/LoginFlow.php new file mode 100644 index 0000000..d36b72c --- /dev/null +++ b/src/Bridges/LoginFlow.php @@ -0,0 +1,113 @@ + */ + use SdkModel; + + /** + * Flow ID to pass when creating a bridge login session. + */ + #[Required] + public string $id; + + /** + * Short explanation for when to use this flow, when provided. + */ + #[Optional] + public ?string $description; + + /** + * Display name for the flow, when provided. + */ + #[Optional] + public ?string $name; + + /** + * `new LoginFlow()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginFlow::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginFlow)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + ?string $description = null, + ?string $name = null + ): self { + $self = new self; + + $self['id'] = $id; + + null !== $description && $self['description'] = $description; + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Flow ID to pass when creating a bridge login session. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Short explanation for when to use this flow, when provided. + */ + public function withDescription(string $description): self + { + $self = clone $this; + $self['description'] = $description; + + return $self; + } + + /** + * Display name for the flow, when provided. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/Bridges/LoginFlows/LoginFlowListResponse.php b/src/Bridges/LoginFlows/LoginFlowListResponse.php new file mode 100644 index 0000000..f443de5 --- /dev/null +++ b/src/Bridges/LoginFlows/LoginFlowListResponse.php @@ -0,0 +1,73 @@ + + * } + */ +final class LoginFlowListResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var list $items */ + #[Required(list: LoginFlow::class)] + public array $items; + + /** + * `new LoginFlowListResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginFlowListResponse::with(items: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginFlowListResponse)->withItems(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $items + */ + public static function with(array $items): self + { + $self = new self; + + $self['items'] = $items; + + return $self; + } + + /** + * @param list $items + */ + public function withItems(array $items): self + { + $self = clone $this; + $self['items'] = $items; + + return $self; + } +} diff --git a/src/Bridges/LoginInputField.php b/src/Bridges/LoginInputField.php new file mode 100644 index 0000000..2c8517a --- /dev/null +++ b/src/Bridges/LoginInputField.php @@ -0,0 +1,173 @@ + */ + use SdkModel; + + /** + * Field ID to send back in the fields object. + */ + #[Required] + public string $id; + + /** + * Initial field value, when provided by the network. + */ + #[Optional] + public ?string $initialValue; + + /** + * Field label to show to the user. + */ + #[Optional] + public ?string $label; + + /** + * True if the user can leave this field empty. + */ + #[Optional] + public ?bool $optional; + + /** + * Placeholder text to show when the field is empty. + */ + #[Optional] + public ?string $placeholder; + + /** + * Suggested input type, such as text, password, or email. + */ + #[Optional] + public ?string $type; + + /** + * `new LoginInputField()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginInputField::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginInputField)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + ?string $initialValue = null, + ?string $label = null, + ?bool $optional = null, + ?string $placeholder = null, + ?string $type = null, + ): self { + $self = new self; + + $self['id'] = $id; + + null !== $initialValue && $self['initialValue'] = $initialValue; + null !== $label && $self['label'] = $label; + null !== $optional && $self['optional'] = $optional; + null !== $placeholder && $self['placeholder'] = $placeholder; + null !== $type && $self['type'] = $type; + + return $self; + } + + /** + * Field ID to send back in the fields object. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Initial field value, when provided by the network. + */ + public function withInitialValue(string $initialValue): self + { + $self = clone $this; + $self['initialValue'] = $initialValue; + + return $self; + } + + /** + * Field label to show to the user. + */ + public function withLabel(string $label): self + { + $self = clone $this; + $self['label'] = $label; + + return $self; + } + + /** + * True if the user can leave this field empty. + */ + public function withOptional(bool $optional): self + { + $self = clone $this; + $self['optional'] = $optional; + + return $self; + } + + /** + * Placeholder text to show when the field is empty. + */ + public function withPlaceholder(string $placeholder): self + { + $self = clone $this; + $self['placeholder'] = $placeholder; + + return $self; + } + + /** + * Suggested input type, such as text, password, or email. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } +} diff --git a/src/Bridges/LoginSession.php b/src/Bridges/LoginSession.php new file mode 100644 index 0000000..d0f859a --- /dev/null +++ b/src/Bridges/LoginSession.php @@ -0,0 +1,256 @@ +, + * account?: null|Account|AccountShape, + * accountID?: string|null, + * currentStep?: CurrentStepShape|null, + * error?: null|APIError|APIErrorShape, + * login?: null|BridgeLogin|BridgeLoginShape, + * loginID?: string|null, + * } + */ +final class LoginSession implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Bridge ID. + */ + #[Required] + public string $bridgeID; + + /** + * Temporary bridge login session ID. + */ + #[Required] + public string $loginSessionID; + + /** @var value-of $status */ + #[Required(enum: Status::class)] + public string $status; + + /** + * A chat account added to Beeper. + */ + #[Optional] + public ?Account $account; + + /** + * Chat account ID for reconnect flows, when known. + */ + #[Optional] + public ?string $accountID; + + /** + * Step the client should show or complete next. Omitted when the session is complete, cancelled, or failed. + * + * @var CurrentStepVariants|null $currentStep + */ + #[Optional] + public UserInputLoginStep|CookiesLoginStep|DisplayAndWaitLoginStep|CompleteLoginStep|null $currentStep; + + #[Optional] + public ?APIError $error; + + /** + * Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. + */ + #[Optional] + public ?BridgeLogin $login; + + /** + * Bridge login ID for reconnect flows, when known. + */ + #[Optional] + public ?string $loginID; + + /** + * `new LoginSession()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginSession::with(bridgeID: ..., loginSessionID: ..., status: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginSession)->withBridgeID(...)->withLoginSessionID(...)->withStatus(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Status|value-of $status + * @param Account|AccountShape|null $account + * @param CurrentStepShape|null $currentStep + * @param APIError|APIErrorShape|null $error + * @param BridgeLogin|BridgeLoginShape|null $login + */ + public static function with( + string $bridgeID, + string $loginSessionID, + Status|string $status, + Account|array|null $account = null, + ?string $accountID = null, + UserInputLoginStep|array|CookiesLoginStep|DisplayAndWaitLoginStep|CompleteLoginStep|null $currentStep = null, + APIError|array|null $error = null, + BridgeLogin|array|null $login = null, + ?string $loginID = null, + ): self { + $self = new self; + + $self['bridgeID'] = $bridgeID; + $self['loginSessionID'] = $loginSessionID; + $self['status'] = $status; + + null !== $account && $self['account'] = $account; + null !== $accountID && $self['accountID'] = $accountID; + null !== $currentStep && $self['currentStep'] = $currentStep; + null !== $error && $self['error'] = $error; + null !== $login && $self['login'] = $login; + null !== $loginID && $self['loginID'] = $loginID; + + return $self; + } + + /** + * Bridge ID. + */ + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } + + /** + * Temporary bridge login session ID. + */ + public function withLoginSessionID(string $loginSessionID): self + { + $self = clone $this; + $self['loginSessionID'] = $loginSessionID; + + return $self; + } + + /** + * @param Status|value-of $status + */ + public function withStatus(Status|string $status): self + { + $self = clone $this; + $self['status'] = $status; + + return $self; + } + + /** + * A chat account added to Beeper. + * + * @param Account|AccountShape $account + */ + public function withAccount(Account|array $account): self + { + $self = clone $this; + $self['account'] = $account; + + return $self; + } + + /** + * Chat account ID for reconnect flows, when known. + */ + public function withAccountID(string $accountID): self + { + $self = clone $this; + $self['accountID'] = $accountID; + + return $self; + } + + /** + * Step the client should show or complete next. Omitted when the session is complete, cancelled, or failed. + * + * @param CurrentStepShape $currentStep + */ + public function withCurrentStep( + UserInputLoginStep|array|CookiesLoginStep|DisplayAndWaitLoginStep|CompleteLoginStep $currentStep, + ): self { + $self = clone $this; + $self['currentStep'] = $currentStep; + + return $self; + } + + /** + * @param APIError|APIErrorShape $error + */ + public function withError(APIError|array $error): self + { + $self = clone $this; + $self['error'] = $error; + + return $self; + } + + /** + * Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. + * + * @param BridgeLogin|BridgeLoginShape $login + */ + public function withLogin(BridgeLogin|array $login): self + { + $self = clone $this; + $self['login'] = $login; + + return $self; + } + + /** + * Bridge login ID for reconnect flows, when known. + */ + public function withLoginID(string $loginID): self + { + $self = clone $this; + $self['loginID'] = $loginID; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep.php b/src/Bridges/LoginSession/CurrentStep.php new file mode 100644 index 0000000..511662d --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep.php @@ -0,0 +1,42 @@ +|array + */ + public static function variants(): array + { + return [ + UserInputLoginStep::class, + CookiesLoginStep::class, + DisplayAndWaitLoginStep::class, + CompleteLoginStep::class, + ]; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/CompleteLoginStep.php b/src/Bridges/LoginSession/CurrentStep/CompleteLoginStep.php new file mode 100644 index 0000000..48a9a73 --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/CompleteLoginStep.php @@ -0,0 +1,140 @@ + */ + use SdkModel; + + /** @var 'complete' $type */ + #[Required] + public string $type = 'complete'; + + /** + * A chat account added to Beeper. + */ + #[Optional] + public ?Account $account; + + /** + * Completion instructions, when provided. + */ + #[Optional] + public ?string $instructions; + + /** + * Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. + */ + #[Optional] + public ?BridgeLogin $login; + + #[Optional] + public ?string $stepID; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Account|AccountShape|null $account + * @param BridgeLogin|BridgeLoginShape|null $login + */ + public static function with( + Account|array|null $account = null, + ?string $instructions = null, + BridgeLogin|array|null $login = null, + ?string $stepID = null, + ): self { + $self = new self; + + null !== $account && $self['account'] = $account; + null !== $instructions && $self['instructions'] = $instructions; + null !== $login && $self['login'] = $login; + null !== $stepID && $self['stepID'] = $stepID; + + return $self; + } + + /** + * @param 'complete' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * A chat account added to Beeper. + * + * @param Account|AccountShape $account + */ + public function withAccount(Account|array $account): self + { + $self = clone $this; + $self['account'] = $account; + + return $self; + } + + /** + * Completion instructions, when provided. + */ + public function withInstructions(string $instructions): self + { + $self = clone $this; + $self['instructions'] = $instructions; + + return $self; + } + + /** + * Signed-in identity for a bridge. One bridge login can contain multiple chat accounts. + * + * @param BridgeLogin|BridgeLoginShape $login + */ + public function withLogin(BridgeLogin|array $login): self + { + $self = clone $this; + $self['login'] = $login; + + return $self; + } + + public function withStepID(string $stepID): self + { + $self = clone $this; + $self['stepID'] = $stepID; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/CookiesLoginStep.php b/src/Bridges/LoginSession/CurrentStep/CookiesLoginStep.php new file mode 100644 index 0000000..e634285 --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/CookiesLoginStep.php @@ -0,0 +1,207 @@ +, + * stepID: string, + * type: 'cookies', + * url: string, + * expectedFinalURLRegex?: string|null, + * extractJs?: string|null, + * instructions?: string|null, + * userAgent?: string|null, + * } + */ +final class CookiesLoginStep implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var 'cookies' $type */ + #[Required] + public string $type = 'cookies'; + + /** @var list $fields */ + #[Required(list: CookieField::class)] + public array $fields; + + #[Required] + public string $stepID; + + /** + * URL to open for the user. + */ + #[Required] + public string $url; + + /** + * Regular expression that identifies the final URL after sign-in. + */ + #[Optional] + public ?string $expectedFinalURLRegex; + + /** + * Optional extraction script for browser-based sign-in helpers. Treat as an opaque helper value. + */ + #[Optional('extractJS')] + public ?string $extractJs; + + /** + * User-facing instructions for this browser step. + */ + #[Optional] + public ?string $instructions; + + /** + * Suggested user agent for the browser session. + */ + #[Optional] + public ?string $userAgent; + + /** + * `new CookiesLoginStep()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * CookiesLoginStep::with(fields: ..., stepID: ..., url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new CookiesLoginStep)->withFields(...)->withStepID(...)->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $fields + */ + public static function with( + array $fields, + string $stepID, + string $url, + ?string $expectedFinalURLRegex = null, + ?string $extractJs = null, + ?string $instructions = null, + ?string $userAgent = null, + ): self { + $self = new self; + + $self['fields'] = $fields; + $self['stepID'] = $stepID; + $self['url'] = $url; + + null !== $expectedFinalURLRegex && $self['expectedFinalURLRegex'] = $expectedFinalURLRegex; + null !== $extractJs && $self['extractJs'] = $extractJs; + null !== $instructions && $self['instructions'] = $instructions; + null !== $userAgent && $self['userAgent'] = $userAgent; + + return $self; + } + + /** + * @param list $fields + */ + public function withFields(array $fields): self + { + $self = clone $this; + $self['fields'] = $fields; + + return $self; + } + + public function withStepID(string $stepID): self + { + $self = clone $this; + $self['stepID'] = $stepID; + + return $self; + } + + /** + * @param 'cookies' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * URL to open for the user. + */ + public function withURL(string $url): self + { + $self = clone $this; + $self['url'] = $url; + + return $self; + } + + /** + * Regular expression that identifies the final URL after sign-in. + */ + public function withExpectedFinalURLRegex( + string $expectedFinalURLRegex + ): self { + $self = clone $this; + $self['expectedFinalURLRegex'] = $expectedFinalURLRegex; + + return $self; + } + + /** + * Optional extraction script for browser-based sign-in helpers. Treat as an opaque helper value. + */ + public function withExtractJs(string $extractJs): self + { + $self = clone $this; + $self['extractJs'] = $extractJs; + + return $self; + } + + /** + * User-facing instructions for this browser step. + */ + public function withInstructions(string $instructions): self + { + $self = clone $this; + $self['instructions'] = $instructions; + + return $self; + } + + /** + * Suggested user agent for the browser session. + */ + public function withUserAgent(string $userAgent): self + { + $self = clone $this; + $self['userAgent'] = $userAgent; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep.php b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep.php new file mode 100644 index 0000000..d0d1d50 --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep.php @@ -0,0 +1,131 @@ + */ + use SdkModel; + + /** @var 'display_and_wait' $type */ + #[Required] + public string $type = 'display_and_wait'; + + /** @var DisplayVariants $display */ + #[Required] + public QRCodeLoginDisplay|EmojiLoginDisplay|CodeLoginDisplay|EmptyLoginDisplay $display; + + #[Required] + public string $stepID; + + /** + * User-facing instructions for this step. + */ + #[Optional] + public ?string $instructions; + + /** + * `new DisplayAndWaitLoginStep()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * DisplayAndWaitLoginStep::with(display: ..., stepID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new DisplayAndWaitLoginStep)->withDisplay(...)->withStepID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param DisplayShape $display + */ + public static function with( + QRCodeLoginDisplay|array|EmojiLoginDisplay|CodeLoginDisplay|EmptyLoginDisplay $display, + string $stepID, + ?string $instructions = null, + ): self { + $self = new self; + + $self['display'] = $display; + $self['stepID'] = $stepID; + + null !== $instructions && $self['instructions'] = $instructions; + + return $self; + } + + /** + * @param DisplayShape $display + */ + public function withDisplay( + QRCodeLoginDisplay|array|EmojiLoginDisplay|CodeLoginDisplay|EmptyLoginDisplay $display, + ): self { + $self = clone $this; + $self['display'] = $display; + + return $self; + } + + public function withStepID(string $stepID): self + { + $self = clone $this; + $self['stepID'] = $stepID; + + return $self; + } + + /** + * @param 'display_and_wait' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * User-facing instructions for this step. + */ + public function withInstructions(string $instructions): self + { + $self = clone $this; + $self['instructions'] = $instructions; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display.php b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display.php new file mode 100644 index 0000000..c1e27b7 --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display.php @@ -0,0 +1,40 @@ +|array + */ + public static function variants(): array + { + return [ + QRCodeLoginDisplay::class, + EmojiLoginDisplay::class, + CodeLoginDisplay::class, + EmptyLoginDisplay::class, + ]; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/CodeLoginDisplay.php b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/CodeLoginDisplay.php new file mode 100644 index 0000000..4a8837b --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/CodeLoginDisplay.php @@ -0,0 +1,77 @@ + */ + use SdkModel; + + /** @var 'code' $type */ + #[Required] + public string $type = 'code'; + + #[Required] + public string $data; + + /** + * `new CodeLoginDisplay()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * CodeLoginDisplay::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new CodeLoginDisplay)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } + + /** + * @param 'code' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/EmojiLoginDisplay.php b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/EmojiLoginDisplay.php new file mode 100644 index 0000000..cd2336c --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/EmojiLoginDisplay.php @@ -0,0 +1,77 @@ + */ + use SdkModel; + + /** @var 'emoji' $type */ + #[Required] + public string $type = 'emoji'; + + #[Required] + public string $imageURL; + + /** + * `new EmojiLoginDisplay()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * EmojiLoginDisplay::with(imageURL: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new EmojiLoginDisplay)->withImageURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $imageURL): self + { + $self = new self; + + $self['imageURL'] = $imageURL; + + return $self; + } + + public function withImageURL(string $imageURL): self + { + $self = clone $this; + $self['imageURL'] = $imageURL; + + return $self; + } + + /** + * @param 'emoji' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/EmptyLoginDisplay.php b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/EmptyLoginDisplay.php new file mode 100644 index 0000000..0ca40c6 --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/EmptyLoginDisplay.php @@ -0,0 +1,48 @@ + */ + use SdkModel; + + /** @var 'nothing' $type */ + #[Required] + public string $type = 'nothing'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } + + /** + * @param 'nothing' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/QRCodeLoginDisplay.php b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/QRCodeLoginDisplay.php new file mode 100644 index 0000000..b1751bc --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/DisplayAndWaitLoginStep/Display/QRCodeLoginDisplay.php @@ -0,0 +1,77 @@ + */ + use SdkModel; + + /** @var 'qr' $type */ + #[Required] + public string $type = 'qr'; + + #[Required] + public string $data; + + /** + * `new QRCodeLoginDisplay()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * QRCodeLoginDisplay::with(data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new QRCodeLoginDisplay)->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $data): self + { + $self = new self; + + $self['data'] = $data; + + return $self; + } + + public function withData(string $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } + + /** + * @param 'qr' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/CurrentStep/UserInputLoginStep.php b/src/Bridges/LoginSession/CurrentStep/UserInputLoginStep.php new file mode 100644 index 0000000..a30ddf9 --- /dev/null +++ b/src/Bridges/LoginSession/CurrentStep/UserInputLoginStep.php @@ -0,0 +1,146 @@ +, + * stepID: string, + * type: 'user_input', + * attachments?: list|null, + * instructions?: string|null, + * } + */ +final class UserInputLoginStep implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var 'user_input' $type */ + #[Required] + public string $type = 'user_input'; + + /** @var list $fields */ + #[Required(list: LoginInputField::class)] + public array $fields; + + #[Required] + public string $stepID; + + /** @var list|null $attachments */ + #[Optional(type: new ListOf('mixed', nullable: true))] + public ?array $attachments; + + /** + * User-facing instructions for this step. + */ + #[Optional] + public ?string $instructions; + + /** + * `new UserInputLoginStep()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UserInputLoginStep::with(fields: ..., stepID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UserInputLoginStep)->withFields(...)->withStepID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $fields + * @param list|null $attachments + */ + public static function with( + array $fields, + string $stepID, + ?array $attachments = null, + ?string $instructions = null, + ): self { + $self = new self; + + $self['fields'] = $fields; + $self['stepID'] = $stepID; + + null !== $attachments && $self['attachments'] = $attachments; + null !== $instructions && $self['instructions'] = $instructions; + + return $self; + } + + /** + * @param list $fields + */ + public function withFields(array $fields): self + { + $self = clone $this; + $self['fields'] = $fields; + + return $self; + } + + public function withStepID(string $stepID): self + { + $self = clone $this; + $self['stepID'] = $stepID; + + return $self; + } + + /** + * @param 'user_input' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * @param list $attachments + */ + public function withAttachments(array $attachments): self + { + $self = clone $this; + $self['attachments'] = $attachments; + + return $self; + } + + /** + * User-facing instructions for this step. + */ + public function withInstructions(string $instructions): self + { + $self = clone $this; + $self['instructions'] = $instructions; + + return $self; + } +} diff --git a/src/Bridges/LoginSession/Status.php b/src/Bridges/LoginSession/Status.php new file mode 100644 index 0000000..29c64d6 --- /dev/null +++ b/src/Bridges/LoginSession/Status.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Bridge ID. + */ + #[Required] + public string $bridgeID; + + /** + * `new LoginSessionCancelParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginSessionCancelParams::with(bridgeID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginSessionCancelParams)->withBridgeID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $bridgeID): self + { + $self = new self; + + $self['bridgeID'] = $bridgeID; + + return $self; + } + + /** + * Bridge ID. + */ + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } +} diff --git a/src/Bridges/LoginSessions/LoginSessionCancelResponse.php b/src/Bridges/LoginSessions/LoginSessionCancelResponse.php new file mode 100644 index 0000000..0cf24fa --- /dev/null +++ b/src/Bridges/LoginSessions/LoginSessionCancelResponse.php @@ -0,0 +1,91 @@ + */ + use SdkModel; + + /** @var 'cancelled' $status */ + #[Required] + public string $status = 'cancelled'; + + #[Required] + public string $bridgeID; + + #[Required] + public string $loginSessionID; + + /** + * `new LoginSessionCancelResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginSessionCancelResponse::with(bridgeID: ..., loginSessionID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginSessionCancelResponse)->withBridgeID(...)->withLoginSessionID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $bridgeID, string $loginSessionID): self + { + $self = new self; + + $self['bridgeID'] = $bridgeID; + $self['loginSessionID'] = $loginSessionID; + + return $self; + } + + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } + + public function withLoginSessionID(string $loginSessionID): self + { + $self = clone $this; + $self['loginSessionID'] = $loginSessionID; + + return $self; + } + + /** + * @param 'cancelled' $status + */ + public function withStatus(string $status): self + { + $self = clone $this; + $self['status'] = $status; + + return $self; + } +} diff --git a/src/Bridges/LoginSessions/LoginSessionCreateParams.php b/src/Bridges/LoginSessions/LoginSessionCreateParams.php new file mode 100644 index 0000000..a7c627c --- /dev/null +++ b/src/Bridges/LoginSessions/LoginSessionCreateParams.php @@ -0,0 +1,101 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Existing chat account ID to reconnect. Omit to connect a new account. + */ + #[Optional] + public ?string $accountID; + + /** + * Optional flow ID returned by the list login flows endpoint. If omitted, Beeper chooses the default flow. + */ + #[Optional] + public ?string $flowID; + + /** + * Existing bridge login ID to reconnect. Omit to connect a new account. + */ + #[Optional] + public ?string $loginID; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?string $accountID = null, + ?string $flowID = null, + ?string $loginID = null + ): self { + $self = new self; + + null !== $accountID && $self['accountID'] = $accountID; + null !== $flowID && $self['flowID'] = $flowID; + null !== $loginID && $self['loginID'] = $loginID; + + return $self; + } + + /** + * Existing chat account ID to reconnect. Omit to connect a new account. + */ + public function withAccountID(string $accountID): self + { + $self = clone $this; + $self['accountID'] = $accountID; + + return $self; + } + + /** + * Optional flow ID returned by the list login flows endpoint. If omitted, Beeper chooses the default flow. + */ + public function withFlowID(string $flowID): self + { + $self = clone $this; + $self['flowID'] = $flowID; + + return $self; + } + + /** + * Existing bridge login ID to reconnect. Omit to connect a new account. + */ + public function withLoginID(string $loginID): self + { + $self = clone $this; + $self['loginID'] = $loginID; + + return $self; + } +} diff --git a/src/Bridges/LoginSessions/LoginSessionRetrieveParams.php b/src/Bridges/LoginSessions/LoginSessionRetrieveParams.php new file mode 100644 index 0000000..f5461c8 --- /dev/null +++ b/src/Bridges/LoginSessions/LoginSessionRetrieveParams.php @@ -0,0 +1,74 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Bridge ID. + */ + #[Required] + public string $bridgeID; + + /** + * `new LoginSessionRetrieveParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginSessionRetrieveParams::with(bridgeID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginSessionRetrieveParams)->withBridgeID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $bridgeID): self + { + $self = new self; + + $self['bridgeID'] = $bridgeID; + + return $self; + } + + /** + * Bridge ID. + */ + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } +} diff --git a/src/Bridges/LoginSessions/Steps/StepSubmitParams.php b/src/Bridges/LoginSessions/Steps/StepSubmitParams.php new file mode 100644 index 0000000..1b71a9a --- /dev/null +++ b/src/Bridges/LoginSessions/Steps/StepSubmitParams.php @@ -0,0 +1,194 @@ +, + * fields?: array|null, + * lastURL?: string|null, + * source?: null|Source|value-of, + * } + */ +final class StepSubmitParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Bridge ID. + */ + #[Required] + public string $bridgeID; + + /** + * Temporary bridge login session ID. + */ + #[Required] + public string $loginSessionID; + + /** @var value-of $type */ + #[Required(enum: Type::class)] + public string $type; + + /** + * Field values keyed by the field IDs from the current step. + * + * @var array|null $fields + */ + #[Optional(map: 'string')] + public ?array $fields; + + /** + * Last browser URL reached during a cookies step, if available. + */ + #[Optional] + public ?string $lastURL; + + /** + * How the step was completed. Omit unless the client needs to distinguish an embedded webview or browser extension. + * + * @var value-of|null $source + */ + #[Optional(enum: Source::class)] + public ?string $source; + + /** + * `new StepSubmitParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * StepSubmitParams::with(bridgeID: ..., loginSessionID: ..., type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new StepSubmitParams) + * ->withBridgeID(...) + * ->withLoginSessionID(...) + * ->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type|value-of $type + * @param array|null $fields + * @param Source|value-of|null $source + */ + public static function with( + string $bridgeID, + string $loginSessionID, + Type|string $type, + ?array $fields = null, + ?string $lastURL = null, + Source|string|null $source = null, + ): self { + $self = new self; + + $self['bridgeID'] = $bridgeID; + $self['loginSessionID'] = $loginSessionID; + $self['type'] = $type; + + null !== $fields && $self['fields'] = $fields; + null !== $lastURL && $self['lastURL'] = $lastURL; + null !== $source && $self['source'] = $source; + + return $self; + } + + /** + * Bridge ID. + */ + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } + + /** + * Temporary bridge login session ID. + */ + public function withLoginSessionID(string $loginSessionID): self + { + $self = clone $this; + $self['loginSessionID'] = $loginSessionID; + + return $self; + } + + /** + * @param Type|value-of $type + */ + public function withType(Type|string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * Field values keyed by the field IDs from the current step. + * + * @param array $fields + */ + public function withFields(array $fields): self + { + $self = clone $this; + $self['fields'] = $fields; + + return $self; + } + + /** + * Last browser URL reached during a cookies step, if available. + */ + public function withLastURL(string $lastURL): self + { + $self = clone $this; + $self['lastURL'] = $lastURL; + + return $self; + } + + /** + * How the step was completed. Omit unless the client needs to distinguish an embedded webview or browser extension. + * + * @param Source|value-of $source + */ + public function withSource(Source|string $source): self + { + $self = clone $this; + $self['source'] = $source; + + return $self; + } +} diff --git a/src/Bridges/LoginSessions/Steps/StepSubmitParams/Source.php b/src/Bridges/LoginSessions/Steps/StepSubmitParams/Source.php new file mode 100644 index 0000000..87d895f --- /dev/null +++ b/src/Bridges/LoginSessions/Steps/StepSubmitParams/Source.php @@ -0,0 +1,17 @@ + + * } + */ +final class LoginListResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var list $items */ + #[Required(list: BridgeLogin::class)] + public array $items; + + /** + * `new LoginListResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginListResponse::with(items: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginListResponse)->withItems(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $items + */ + public static function with(array $items): self + { + $self = new self; + + $self['items'] = $items; + + return $self; + } + + /** + * @param list $items + */ + public function withItems(array $items): self + { + $self = clone $this; + $self['items'] = $items; + + return $self; + } +} diff --git a/src/Bridges/Logins/LoginRemoveParams.php b/src/Bridges/Logins/LoginRemoveParams.php new file mode 100644 index 0000000..0884e7f --- /dev/null +++ b/src/Bridges/Logins/LoginRemoveParams.php @@ -0,0 +1,101 @@ + + * } + */ +final class LoginRemoveParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Bridge ID. + */ + #[Required] + public string $bridgeID; + + /** + * Where this bridge login should be removed. + * + * @var value-of $scope + */ + #[Required(enum: Scope::class)] + public string $scope; + + /** + * `new LoginRemoveParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginRemoveParams::with(bridgeID: ..., scope: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginRemoveParams)->withBridgeID(...)->withScope(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Scope|value-of $scope + */ + public static function with(string $bridgeID, Scope|string $scope): self + { + $self = new self; + + $self['bridgeID'] = $bridgeID; + $self['scope'] = $scope; + + return $self; + } + + /** + * Bridge ID. + */ + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } + + /** + * Where this bridge login should be removed. + * + * @param Scope|value-of $scope + */ + public function withScope(Scope|string $scope): self + { + $self = clone $this; + $self['scope'] = $scope; + + return $self; + } +} diff --git a/src/Bridges/Logins/LoginRemoveParams/Scope.php b/src/Bridges/Logins/LoginRemoveParams/Scope.php new file mode 100644 index 0000000..530f003 --- /dev/null +++ b/src/Bridges/Logins/LoginRemoveParams/Scope.php @@ -0,0 +1,15 @@ +, + * status: 'removed', + * affectedAccountIDs?: list|null, + * } + */ +final class LoginRemoveResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var 'removed' $status */ + #[Required] + public string $status = 'removed'; + + #[Required] + public string $bridgeID; + + #[Required] + public string $loginID; + + /** + * Where this bridge login should be removed. + * + * @var value-of $scope + */ + #[Required(enum: Scope::class)] + public string $scope; + + /** @var list|null $affectedAccountIDs */ + #[Optional(list: 'string')] + public ?array $affectedAccountIDs; + + /** + * `new LoginRemoveResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginRemoveResponse::with(bridgeID: ..., loginID: ..., scope: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginRemoveResponse)->withBridgeID(...)->withLoginID(...)->withScope(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Scope|value-of $scope + * @param list|null $affectedAccountIDs + */ + public static function with( + string $bridgeID, + string $loginID, + Scope|string $scope, + ?array $affectedAccountIDs = null, + ): self { + $self = new self; + + $self['bridgeID'] = $bridgeID; + $self['loginID'] = $loginID; + $self['scope'] = $scope; + + null !== $affectedAccountIDs && $self['affectedAccountIDs'] = $affectedAccountIDs; + + return $self; + } + + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } + + public function withLoginID(string $loginID): self + { + $self = clone $this; + $self['loginID'] = $loginID; + + return $self; + } + + /** + * Where this bridge login should be removed. + * + * @param Scope|value-of $scope + */ + public function withScope(Scope|string $scope): self + { + $self = clone $this; + $self['scope'] = $scope; + + return $self; + } + + /** + * @param 'removed' $status + */ + public function withStatus(string $status): self + { + $self = clone $this; + $self['status'] = $status; + + return $self; + } + + /** + * @param list $affectedAccountIDs + */ + public function withAffectedAccountIDs(array $affectedAccountIDs): self + { + $self = clone $this; + $self['affectedAccountIDs'] = $affectedAccountIDs; + + return $self; + } +} diff --git a/src/Bridges/Logins/LoginRemoveResponse/Scope.php b/src/Bridges/Logins/LoginRemoveResponse/Scope.php new file mode 100644 index 0000000..e7543b1 --- /dev/null +++ b/src/Bridges/Logins/LoginRemoveResponse/Scope.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Bridge ID. + */ + #[Required] + public string $bridgeID; + + /** + * `new LoginRetrieveParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LoginRetrieveParams::with(bridgeID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LoginRetrieveParams)->withBridgeID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $bridgeID): self + { + $self = new self; + + $self['bridgeID'] = $bridgeID; + + return $self; + } + + /** + * Bridge ID. + */ + public function withBridgeID(string $bridgeID): self + { + $self = clone $this; + $self['bridgeID'] = $bridgeID; + + return $self; + } +} diff --git a/src/Bridges/ProvisioningCapabilities.php b/src/Bridges/ProvisioningCapabilities.php new file mode 100644 index 0000000..19a0cb2 --- /dev/null +++ b/src/Bridges/ProvisioningCapabilities.php @@ -0,0 +1,118 @@ +, + * resolveIdentifier: ResolveIdentifierCapabilities|ResolveIdentifierCapabilitiesShape, + * imagePackImport?: bool|null, + * } + */ +final class ProvisioningCapabilities implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var array $groupCreation */ + #[Required('group_creation', map: GroupTypeCapabilities::class)] + public array $groupCreation; + + /** + * Identifier lookup capabilities for this bridge. + */ + #[Required('resolve_identifier')] + public ResolveIdentifierCapabilities $resolveIdentifier; + + #[Optional('image_pack_import')] + public ?bool $imagePackImport; + + /** + * `new ProvisioningCapabilities()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * ProvisioningCapabilities::with(groupCreation: ..., resolveIdentifier: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new ProvisioningCapabilities) + * ->withGroupCreation(...) + * ->withResolveIdentifier(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array $groupCreation + * @param ResolveIdentifierCapabilities|ResolveIdentifierCapabilitiesShape $resolveIdentifier + */ + public static function with( + array $groupCreation, + ResolveIdentifierCapabilities|array $resolveIdentifier, + ?bool $imagePackImport = null, + ): self { + $self = new self; + + $self['groupCreation'] = $groupCreation; + $self['resolveIdentifier'] = $resolveIdentifier; + + null !== $imagePackImport && $self['imagePackImport'] = $imagePackImport; + + return $self; + } + + /** + * @param array $groupCreation + */ + public function withGroupCreation(array $groupCreation): self + { + $self = clone $this; + $self['groupCreation'] = $groupCreation; + + return $self; + } + + /** + * Identifier lookup capabilities for this bridge. + * + * @param ResolveIdentifierCapabilities|ResolveIdentifierCapabilitiesShape $resolveIdentifier + */ + public function withResolveIdentifier( + ResolveIdentifierCapabilities|array $resolveIdentifier + ): self { + $self = clone $this; + $self['resolveIdentifier'] = $resolveIdentifier; + + return $self; + } + + public function withImagePackImport(bool $imagePackImport): self + { + $self = clone $this; + $self['imagePackImport'] = $imagePackImport; + + return $self; + } +} diff --git a/src/Bridges/ResolveIdentifierCapabilities.php b/src/Bridges/ResolveIdentifierCapabilities.php new file mode 100644 index 0000000..49936e1 --- /dev/null +++ b/src/Bridges/ResolveIdentifierCapabilities.php @@ -0,0 +1,166 @@ + */ + use SdkModel; + + #[Required('any_phone')] + public bool $anyPhone; + + #[Required('contact_list')] + public bool $contactList; + + #[Required('create_dm')] + public bool $createDM; + + #[Required('lookup_email')] + public bool $lookupEmail; + + #[Required('lookup_phone')] + public bool $lookupPhone; + + #[Required('lookup_username')] + public bool $lookupUsername; + + #[Required] + public bool $search; + + /** + * `new ResolveIdentifierCapabilities()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * ResolveIdentifierCapabilities::with( + * anyPhone: ..., + * contactList: ..., + * createDM: ..., + * lookupEmail: ..., + * lookupPhone: ..., + * lookupUsername: ..., + * search: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new ResolveIdentifierCapabilities) + * ->withAnyPhone(...) + * ->withContactList(...) + * ->withCreateDM(...) + * ->withLookupEmail(...) + * ->withLookupPhone(...) + * ->withLookupUsername(...) + * ->withSearch(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $anyPhone, + bool $contactList, + bool $createDM, + bool $lookupEmail, + bool $lookupPhone, + bool $lookupUsername, + bool $search, + ): self { + $self = new self; + + $self['anyPhone'] = $anyPhone; + $self['contactList'] = $contactList; + $self['createDM'] = $createDM; + $self['lookupEmail'] = $lookupEmail; + $self['lookupPhone'] = $lookupPhone; + $self['lookupUsername'] = $lookupUsername; + $self['search'] = $search; + + return $self; + } + + public function withAnyPhone(bool $anyPhone): self + { + $self = clone $this; + $self['anyPhone'] = $anyPhone; + + return $self; + } + + public function withContactList(bool $contactList): self + { + $self = clone $this; + $self['contactList'] = $contactList; + + return $self; + } + + public function withCreateDM(bool $createDM): self + { + $self = clone $this; + $self['createDM'] = $createDM; + + return $self; + } + + public function withLookupEmail(bool $lookupEmail): self + { + $self = clone $this; + $self['lookupEmail'] = $lookupEmail; + + return $self; + } + + public function withLookupPhone(bool $lookupPhone): self + { + $self = clone $this; + $self['lookupPhone'] = $lookupPhone; + + return $self; + } + + public function withLookupUsername(bool $lookupUsername): self + { + $self = clone $this; + $self['lookupUsername'] = $lookupUsername; + + return $self; + } + + public function withSearch(bool $search): self + { + $self = clone $this; + $self['search'] = $search; + + return $self; + } +} diff --git a/src/ChatCapabilities.php b/src/ChatCapabilities.php new file mode 100644 index 0000000..8c42bd8 --- /dev/null +++ b/src/ChatCapabilities.php @@ -0,0 +1,664 @@ +|null, + * archive?: bool|null, + * attachments?: array|null, + * customEmojiReactions?: bool|null, + * delete?: null|Delete|value-of, + * deleteChat?: bool|null, + * deleteChatForEveryone?: bool|null, + * deleteForMe?: bool|null, + * deleteMaxAge?: int|null, + * disappearingTimer?: null|DisappearingTimer|DisappearingTimerShape, + * edit?: null|Edit|value-of, + * editMaxAge?: int|null, + * editMaxCount?: int|null, + * formatting?: array>|null, + * locationMessage?: null|LocationMessage|value-of, + * markAsUnread?: bool|null, + * maxTextLength?: int|null, + * messageRequest?: null|MessageRequest|MessageRequestShape, + * participantActions?: null|ParticipantActions|ParticipantActionsShape, + * poll?: null|Poll|value-of, + * reaction?: null|\BeeperDesktop\ChatCapabilities\Reaction|value-of<\BeeperDesktop\ChatCapabilities\Reaction>, + * reactionCount?: int|null, + * readReceipts?: bool|null, + * reply?: null|Reply|value-of, + * state?: null|ChatStateCapabilities|ChatStateCapabilitiesShape, + * thread?: null|Thread|value-of, + * typingNotifications?: bool|null, + * } + */ +final class ChatCapabilities implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Allowed Unicode reactions. Omitted means all emoji reactions are allowed. + * + * @var list|null $allowedReactions + */ + #[Optional(list: 'string')] + public ?array $allowedReactions; + + /** + * True if archive/unarchive is supported. + */ + #[Optional] + public ?bool $archive; + + /** + * Supported attachment message types and their per-type constraints, keyed by Matrix msgtype or pseudo-msgtype (for example m.image, m.video, org.matrix.msc3245.voice). Missing message types should be treated as rejected. + * + * @var array|null $attachments + */ + #[Optional(map: AttachmentCapabilities::class)] + public ?array $attachments; + + /** + * True if custom emoji reactions are supported. + */ + #[Optional] + public ?bool $customEmojiReactions; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $delete + */ + #[Optional(enum: Delete::class)] + public ?int $delete; + + /** + * True if deleting chats for the authenticated user is supported. + */ + #[Optional] + public ?bool $deleteChat; + + /** + * True if deleting chats for everyone is supported. + */ + #[Optional] + public ?bool $deleteChatForEveryone; + + /** + * True if deleting messages only for the authenticated user is supported. + */ + #[Optional] + public ?bool $deleteForMe; + + /** + * Maximum message age for delete-for-everyone, in seconds. + */ + #[Optional] + public ?int $deleteMaxAge; + + /** + * Disappearing-message timer capabilities. + */ + #[Optional] + public ?DisappearingTimer $disappearingTimer; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $edit + */ + #[Optional(enum: Edit::class)] + public ?int $edit; + + /** + * Maximum message age for edits, in seconds. + */ + #[Optional] + public ?int $editMaxAge; + + /** + * Maximum number of edits allowed for one message. + */ + #[Optional] + public ?int $editMaxCount; + + /** + * Supported rich-text formatting features keyed by feature name (for example bold, inline_code, code_block.syntax_highlighting). Omitted means no formatting support is advertised. + * + * @var array>|null $formatting + */ + #[Optional(map: Formatting::class)] + public ?array $formatting; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $locationMessage + */ + #[Optional(enum: LocationMessage::class)] + public ?int $locationMessage; + + /** + * True if marking chats unread is supported. + */ + #[Optional] + public ?bool $markAsUnread; + + /** + * Maximum length of normal text messages. + */ + #[Optional] + public ?int $maxTextLength; + + /** + * Message request capabilities. + */ + #[Optional] + public ?MessageRequest $messageRequest; + + /** + * Participant management capabilities. + */ + #[Optional] + public ?ParticipantActions $participantActions; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $poll + */ + #[Optional(enum: Poll::class)] + public ?int $poll; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $reaction + */ + #[Optional(enum: Reaction::class)] + public ?int $reaction; + + /** + * Maximum number of reactions allowed on a single message. + */ + #[Optional] + public ?int $reactionCount; + + /** + * True if read receipts are supported. + */ + #[Optional] + public ?bool $readReceipts; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $reply + */ + #[Optional(enum: Reply::class)] + public ?int $reply; + + /** + * Chat state update capabilities. + */ + #[Optional] + public ?ChatStateCapabilities $state; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $thread + */ + #[Optional(enum: Thread::class)] + public ?int $thread; + + /** + * True if typing notifications are supported. + */ + #[Optional] + public ?bool $typingNotifications; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $allowedReactions + * @param array|null $attachments + * @param Delete|value-of|null $delete + * @param DisappearingTimer|DisappearingTimerShape|null $disappearingTimer + * @param Edit|value-of|null $edit + * @param array>|null $formatting + * @param LocationMessage|value-of|null $locationMessage + * @param MessageRequest|MessageRequestShape|null $messageRequest + * @param ParticipantActions|ParticipantActionsShape|null $participantActions + * @param Poll|value-of|null $poll + * @param Reaction|value-of|null $reaction + * @param Reply|value-of|null $reply + * @param ChatStateCapabilities|ChatStateCapabilitiesShape|null $state + * @param Thread|value-of|null $thread + */ + public static function with( + ?array $allowedReactions = null, + ?bool $archive = null, + ?array $attachments = null, + ?bool $customEmojiReactions = null, + Delete|int|null $delete = null, + ?bool $deleteChat = null, + ?bool $deleteChatForEveryone = null, + ?bool $deleteForMe = null, + ?int $deleteMaxAge = null, + DisappearingTimer|array|null $disappearingTimer = null, + Edit|int|null $edit = null, + ?int $editMaxAge = null, + ?int $editMaxCount = null, + ?array $formatting = null, + LocationMessage|int|null $locationMessage = null, + ?bool $markAsUnread = null, + ?int $maxTextLength = null, + MessageRequest|array|null $messageRequest = null, + ParticipantActions|array|null $participantActions = null, + Poll|int|null $poll = null, + Reaction|int|null $reaction = null, + ?int $reactionCount = null, + ?bool $readReceipts = null, + Reply|int|null $reply = null, + ChatStateCapabilities|array|null $state = null, + Thread|int|null $thread = null, + ?bool $typingNotifications = null, + ): self { + $self = new self; + + null !== $allowedReactions && $self['allowedReactions'] = $allowedReactions; + null !== $archive && $self['archive'] = $archive; + null !== $attachments && $self['attachments'] = $attachments; + null !== $customEmojiReactions && $self['customEmojiReactions'] = $customEmojiReactions; + null !== $delete && $self['delete'] = $delete; + null !== $deleteChat && $self['deleteChat'] = $deleteChat; + null !== $deleteChatForEveryone && $self['deleteChatForEveryone'] = $deleteChatForEveryone; + null !== $deleteForMe && $self['deleteForMe'] = $deleteForMe; + null !== $deleteMaxAge && $self['deleteMaxAge'] = $deleteMaxAge; + null !== $disappearingTimer && $self['disappearingTimer'] = $disappearingTimer; + null !== $edit && $self['edit'] = $edit; + null !== $editMaxAge && $self['editMaxAge'] = $editMaxAge; + null !== $editMaxCount && $self['editMaxCount'] = $editMaxCount; + null !== $formatting && $self['formatting'] = $formatting; + null !== $locationMessage && $self['locationMessage'] = $locationMessage; + null !== $markAsUnread && $self['markAsUnread'] = $markAsUnread; + null !== $maxTextLength && $self['maxTextLength'] = $maxTextLength; + null !== $messageRequest && $self['messageRequest'] = $messageRequest; + null !== $participantActions && $self['participantActions'] = $participantActions; + null !== $poll && $self['poll'] = $poll; + null !== $reaction && $self['reaction'] = $reaction; + null !== $reactionCount && $self['reactionCount'] = $reactionCount; + null !== $readReceipts && $self['readReceipts'] = $readReceipts; + null !== $reply && $self['reply'] = $reply; + null !== $state && $self['state'] = $state; + null !== $thread && $self['thread'] = $thread; + null !== $typingNotifications && $self['typingNotifications'] = $typingNotifications; + + return $self; + } + + /** + * Allowed Unicode reactions. Omitted means all emoji reactions are allowed. + * + * @param list $allowedReactions + */ + public function withAllowedReactions(array $allowedReactions): self + { + $self = clone $this; + $self['allowedReactions'] = $allowedReactions; + + return $self; + } + + /** + * True if archive/unarchive is supported. + */ + public function withArchive(bool $archive): self + { + $self = clone $this; + $self['archive'] = $archive; + + return $self; + } + + /** + * Supported attachment message types and their per-type constraints, keyed by Matrix msgtype or pseudo-msgtype (for example m.image, m.video, org.matrix.msc3245.voice). Missing message types should be treated as rejected. + * + * @param array $attachments + */ + public function withAttachments(array $attachments): self + { + $self = clone $this; + $self['attachments'] = $attachments; + + return $self; + } + + /** + * True if custom emoji reactions are supported. + */ + public function withCustomEmojiReactions(bool $customEmojiReactions): self + { + $self = clone $this; + $self['customEmojiReactions'] = $customEmojiReactions; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Delete|value-of $delete + */ + public function withDelete(Delete|int $delete): self + { + $self = clone $this; + $self['delete'] = $delete; + + return $self; + } + + /** + * True if deleting chats for the authenticated user is supported. + */ + public function withDeleteChat(bool $deleteChat): self + { + $self = clone $this; + $self['deleteChat'] = $deleteChat; + + return $self; + } + + /** + * True if deleting chats for everyone is supported. + */ + public function withDeleteChatForEveryone(bool $deleteChatForEveryone): self + { + $self = clone $this; + $self['deleteChatForEveryone'] = $deleteChatForEveryone; + + return $self; + } + + /** + * True if deleting messages only for the authenticated user is supported. + */ + public function withDeleteForMe(bool $deleteForMe): self + { + $self = clone $this; + $self['deleteForMe'] = $deleteForMe; + + return $self; + } + + /** + * Maximum message age for delete-for-everyone, in seconds. + */ + public function withDeleteMaxAge(int $deleteMaxAge): self + { + $self = clone $this; + $self['deleteMaxAge'] = $deleteMaxAge; + + return $self; + } + + /** + * Disappearing-message timer capabilities. + * + * @param DisappearingTimer|DisappearingTimerShape $disappearingTimer + */ + public function withDisappearingTimer( + DisappearingTimer|array $disappearingTimer + ): self { + $self = clone $this; + $self['disappearingTimer'] = $disappearingTimer; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Edit|value-of $edit + */ + public function withEdit(Edit|int $edit): self + { + $self = clone $this; + $self['edit'] = $edit; + + return $self; + } + + /** + * Maximum message age for edits, in seconds. + */ + public function withEditMaxAge(int $editMaxAge): self + { + $self = clone $this; + $self['editMaxAge'] = $editMaxAge; + + return $self; + } + + /** + * Maximum number of edits allowed for one message. + */ + public function withEditMaxCount(int $editMaxCount): self + { + $self = clone $this; + $self['editMaxCount'] = $editMaxCount; + + return $self; + } + + /** + * Supported rich-text formatting features keyed by feature name (for example bold, inline_code, code_block.syntax_highlighting). Omitted means no formatting support is advertised. + * + * @param array> $formatting + */ + public function withFormatting(array $formatting): self + { + $self = clone $this; + $self['formatting'] = $formatting; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param LocationMessage|value-of $locationMessage + */ + public function withLocationMessage( + LocationMessage|int $locationMessage + ): self { + $self = clone $this; + $self['locationMessage'] = $locationMessage; + + return $self; + } + + /** + * True if marking chats unread is supported. + */ + public function withMarkAsUnread(bool $markAsUnread): self + { + $self = clone $this; + $self['markAsUnread'] = $markAsUnread; + + return $self; + } + + /** + * Maximum length of normal text messages. + */ + public function withMaxTextLength(int $maxTextLength): self + { + $self = clone $this; + $self['maxTextLength'] = $maxTextLength; + + return $self; + } + + /** + * Message request capabilities. + * + * @param MessageRequest|MessageRequestShape $messageRequest + */ + public function withMessageRequest( + MessageRequest|array $messageRequest + ): self { + $self = clone $this; + $self['messageRequest'] = $messageRequest; + + return $self; + } + + /** + * Participant management capabilities. + * + * @param ParticipantActions|ParticipantActionsShape $participantActions + */ + public function withParticipantActions( + ParticipantActions|array $participantActions + ): self { + $self = clone $this; + $self['participantActions'] = $participantActions; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Poll|value-of $poll + */ + public function withPoll(Poll|int $poll): self + { + $self = clone $this; + $self['poll'] = $poll; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Reaction|value-of $reaction + */ + public function withReaction( + Reaction|int $reaction + ): self { + $self = clone $this; + $self['reaction'] = $reaction; + + return $self; + } + + /** + * Maximum number of reactions allowed on a single message. + */ + public function withReactionCount(int $reactionCount): self + { + $self = clone $this; + $self['reactionCount'] = $reactionCount; + + return $self; + } + + /** + * True if read receipts are supported. + */ + public function withReadReceipts(bool $readReceipts): self + { + $self = clone $this; + $self['readReceipts'] = $readReceipts; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Reply|value-of $reply + */ + public function withReply(Reply|int $reply): self + { + $self = clone $this; + $self['reply'] = $reply; + + return $self; + } + + /** + * Chat state update capabilities. + * + * @param ChatStateCapabilities|ChatStateCapabilitiesShape $state + */ + public function withState(ChatStateCapabilities|array $state): self + { + $self = clone $this; + $self['state'] = $state; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Thread|value-of $thread + */ + public function withThread(Thread|int $thread): self + { + $self = clone $this; + $self['thread'] = $thread; + + return $self; + } + + /** + * True if typing notifications are supported. + */ + public function withTypingNotifications(bool $typingNotifications): self + { + $self = clone $this; + $self['typingNotifications'] = $typingNotifications; + + return $self; + } +} diff --git a/src/ChatCapabilities/Delete.php b/src/ChatCapabilities/Delete.php new file mode 100644 index 0000000..bfa3ed5 --- /dev/null +++ b/src/ChatCapabilities/Delete.php @@ -0,0 +1,21 @@ +|null, + * types?: list>|null, + * } + */ +final class DisappearingTimer implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * True if empty timer objects should be omitted from message content. + */ + #[Optional] + public ?bool $omitEmptyTimer; + + /** + * Allowed disappearing timer values in milliseconds. Omitted means any timer is allowed. + * + * @var list|null $timers + */ + #[Optional(list: 'int')] + public ?array $timers; + + /** + * Supported disappearing timer types. + * + * @var list>|null $types + */ + #[Optional(list: Type::class)] + public ?array $types; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $timers + * @param list>|null $types + */ + public static function with( + ?bool $omitEmptyTimer = null, + ?array $timers = null, + ?array $types = null + ): self { + $self = new self; + + null !== $omitEmptyTimer && $self['omitEmptyTimer'] = $omitEmptyTimer; + null !== $timers && $self['timers'] = $timers; + null !== $types && $self['types'] = $types; + + return $self; + } + + /** + * True if empty timer objects should be omitted from message content. + */ + public function withOmitEmptyTimer(bool $omitEmptyTimer): self + { + $self = clone $this; + $self['omitEmptyTimer'] = $omitEmptyTimer; + + return $self; + } + + /** + * Allowed disappearing timer values in milliseconds. Omitted means any timer is allowed. + * + * @param list $timers + */ + public function withTimers(array $timers): self + { + $self = clone $this; + $self['timers'] = $timers; + + return $self; + } + + /** + * Supported disappearing timer types. + * + * @param list> $types + */ + public function withTypes(array $types): self + { + $self = clone $this; + $self['types'] = $types; + + return $self; + } +} diff --git a/src/ChatCapabilities/DisappearingTimer/Type.php b/src/ChatCapabilities/DisappearingTimer/Type.php new file mode 100644 index 0000000..7c82ddd --- /dev/null +++ b/src/ChatCapabilities/DisappearingTimer/Type.php @@ -0,0 +1,14 @@ +, + * acceptWithMessage?: null|AcceptWithMessage|value-of, + * } + */ +final class MessageRequest implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $acceptWithButton + */ + #[Optional(enum: AcceptWithButton::class)] + public ?int $acceptWithButton; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $acceptWithMessage + */ + #[Optional(enum: AcceptWithMessage::class)] + public ?int $acceptWithMessage; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AcceptWithButton|value-of|null $acceptWithButton + * @param AcceptWithMessage|value-of|null $acceptWithMessage + */ + public static function with( + AcceptWithButton|int|null $acceptWithButton = null, + AcceptWithMessage|int|null $acceptWithMessage = null, + ): self { + $self = new self; + + null !== $acceptWithButton && $self['acceptWithButton'] = $acceptWithButton; + null !== $acceptWithMessage && $self['acceptWithMessage'] = $acceptWithMessage; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param AcceptWithButton|value-of $acceptWithButton + */ + public function withAcceptWithButton( + AcceptWithButton|int $acceptWithButton + ): self { + $self = clone $this; + $self['acceptWithButton'] = $acceptWithButton; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param AcceptWithMessage|value-of $acceptWithMessage + */ + public function withAcceptWithMessage( + AcceptWithMessage|int $acceptWithMessage + ): self { + $self = clone $this; + $self['acceptWithMessage'] = $acceptWithMessage; + + return $self; + } +} diff --git a/src/ChatCapabilities/MessageRequest/AcceptWithButton.php b/src/ChatCapabilities/MessageRequest/AcceptWithButton.php new file mode 100644 index 0000000..87e6aab --- /dev/null +++ b/src/ChatCapabilities/MessageRequest/AcceptWithButton.php @@ -0,0 +1,21 @@ +, + * invite?: null|Invite|value-of, + * kick?: null|Kick|value-of, + * leave?: null|Leave|value-of, + * revokeInvite?: null|RevokeInvite|value-of, + * } + */ +final class ParticipantActions implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $ban + */ + #[Optional(enum: Ban::class)] + public ?int $ban; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $invite + */ + #[Optional(enum: Invite::class)] + public ?int $invite; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $kick + */ + #[Optional(enum: Kick::class)] + public ?int $kick; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $leave + */ + #[Optional(enum: Leave::class)] + public ?int $leave; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of|null $revokeInvite + */ + #[Optional(enum: RevokeInvite::class)] + public ?int $revokeInvite; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Ban|value-of|null $ban + * @param Invite|value-of|null $invite + * @param Kick|value-of|null $kick + * @param Leave|value-of|null $leave + * @param RevokeInvite|value-of|null $revokeInvite + */ + public static function with( + Ban|int|null $ban = null, + Invite|int|null $invite = null, + Kick|int|null $kick = null, + Leave|int|null $leave = null, + RevokeInvite|int|null $revokeInvite = null, + ): self { + $self = new self; + + null !== $ban && $self['ban'] = $ban; + null !== $invite && $self['invite'] = $invite; + null !== $kick && $self['kick'] = $kick; + null !== $leave && $self['leave'] = $leave; + null !== $revokeInvite && $self['revokeInvite'] = $revokeInvite; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Ban|value-of $ban + */ + public function withBan(Ban|int $ban): self + { + $self = clone $this; + $self['ban'] = $ban; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Invite|value-of $invite + */ + public function withInvite(Invite|int $invite): self + { + $self = clone $this; + $self['invite'] = $invite; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Kick|value-of $kick + */ + public function withKick(Kick|int $kick): self + { + $self = clone $this; + $self['kick'] = $kick; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Leave|value-of $leave + */ + public function withLeave(Leave|int $leave): self + { + $self = clone $this; + $self['leave'] = $leave; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param RevokeInvite|value-of $revokeInvite + */ + public function withRevokeInvite(RevokeInvite|int $revokeInvite): self + { + $self = clone $this; + $self['revokeInvite'] = $revokeInvite; + + return $self; + } +} diff --git a/src/ChatCapabilities/ParticipantActions/Ban.php b/src/ChatCapabilities/ParticipantActions/Ban.php new file mode 100644 index 0000000..5e80cad --- /dev/null +++ b/src/ChatCapabilities/ParticipantActions/Ban.php @@ -0,0 +1,21 @@ +|null, + * } + */ +final class ChatDraft implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Rich-text draft body as returned by Beeper. + */ + #[Required] + public string $text; + + /** + * Draft attachments keyed by attachment ID. + * + * @var array|null $attachments + */ + #[Optional(map: DraftAttachment::class)] + public ?array $attachments; + + /** + * `new ChatDraft()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * ChatDraft::with(text: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new ChatDraft)->withText(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array|null $attachments + */ + public static function with(string $text, ?array $attachments = null): self + { + $self = new self; + + $self['text'] = $text; + + null !== $attachments && $self['attachments'] = $attachments; + + return $self; + } + + /** + * Rich-text draft body as returned by Beeper. + */ + public function withText(string $text): self + { + $self = clone $this; + $self['text'] = $text; + + return $self; + } + + /** + * Draft attachments keyed by attachment ID. + * + * @param array $attachments + */ + public function withAttachments(array $attachments): self + { + $self = clone $this; + $self['attachments'] = $attachments; + + return $self; + } +} diff --git a/src/ChatStateCapabilities.php b/src/ChatStateCapabilities.php new file mode 100644 index 0000000..ff634e6 --- /dev/null +++ b/src/ChatStateCapabilities.php @@ -0,0 +1,142 @@ + */ + use SdkModel; + + /** + * Chat avatar state capability. + */ + #[Optional] + public ?Avatar $avatar; + + /** + * Chat description/topic state capability. + */ + #[Optional] + public ?Description $description; + + /** + * Disappearing-message timer state capability. + */ + #[Optional] + public ?DisappearingTimer $disappearingTimer; + + /** + * Chat title state capability. + */ + #[Optional] + public ?Title $title; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Avatar|AvatarShape|null $avatar + * @param Description|DescriptionShape|null $description + * @param DisappearingTimer|DisappearingTimerShape|null $disappearingTimer + * @param Title|TitleShape|null $title + */ + public static function with( + Avatar|array|null $avatar = null, + Description|array|null $description = null, + DisappearingTimer|array|null $disappearingTimer = null, + Title|array|null $title = null, + ): self { + $self = new self; + + null !== $avatar && $self['avatar'] = $avatar; + null !== $description && $self['description'] = $description; + null !== $disappearingTimer && $self['disappearingTimer'] = $disappearingTimer; + null !== $title && $self['title'] = $title; + + return $self; + } + + /** + * Chat avatar state capability. + * + * @param Avatar|AvatarShape $avatar + */ + public function withAvatar(Avatar|array $avatar): self + { + $self = clone $this; + $self['avatar'] = $avatar; + + return $self; + } + + /** + * Chat description/topic state capability. + * + * @param Description|DescriptionShape $description + */ + public function withDescription(Description|array $description): self + { + $self = clone $this; + $self['description'] = $description; + + return $self; + } + + /** + * Disappearing-message timer state capability. + * + * @param DisappearingTimer|DisappearingTimerShape $disappearingTimer + */ + public function withDisappearingTimer( + DisappearingTimer|array $disappearingTimer + ): self { + $self = clone $this; + $self['disappearingTimer'] = $disappearingTimer; + + return $self; + } + + /** + * Chat title state capability. + * + * @param Title|TitleShape $title + */ + public function withTitle(Title|array $title): self + { + $self = clone $this; + $self['title'] = $title; + + return $self; + } +} diff --git a/src/ChatStateCapabilities/Avatar.php b/src/ChatStateCapabilities/Avatar.php new file mode 100644 index 0000000..e6662b8 --- /dev/null +++ b/src/ChatStateCapabilities/Avatar.php @@ -0,0 +1,77 @@ +} + */ +final class Avatar implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of $level + */ + #[Required(enum: Level::class)] + public int $level; + + /** + * `new Avatar()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Avatar::with(level: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Avatar)->withLevel(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Level|value-of $level + */ + public static function with(Level|int $level): self + { + $self = new self; + + $self['level'] = $level; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Level|value-of $level + */ + public function withLevel(Level|int $level): self + { + $self = clone $this; + $self['level'] = $level; + + return $self; + } +} diff --git a/src/ChatStateCapabilities/Avatar/Level.php b/src/ChatStateCapabilities/Avatar/Level.php new file mode 100644 index 0000000..f993be0 --- /dev/null +++ b/src/ChatStateCapabilities/Avatar/Level.php @@ -0,0 +1,21 @@ +} + */ +final class Description implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of $level + */ + #[Required(enum: Level::class)] + public int $level; + + /** + * `new Description()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Description::with(level: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Description)->withLevel(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Level|value-of $level + */ + public static function with(Level|int $level): self + { + $self = new self; + + $self['level'] = $level; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Level|value-of $level + */ + public function withLevel(Level|int $level): self + { + $self = clone $this; + $self['level'] = $level; + + return $self; + } +} diff --git a/src/ChatStateCapabilities/Description/Level.php b/src/ChatStateCapabilities/Description/Level.php new file mode 100644 index 0000000..ad443ef --- /dev/null +++ b/src/ChatStateCapabilities/Description/Level.php @@ -0,0 +1,21 @@ +} + */ +final class DisappearingTimer implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of $level + */ + #[Required(enum: Level::class)] + public int $level; + + /** + * `new DisappearingTimer()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * DisappearingTimer::with(level: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new DisappearingTimer)->withLevel(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Level|value-of $level + */ + public static function with(Level|int $level): self + { + $self = new self; + + $self['level'] = $level; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Level|value-of $level + */ + public function withLevel(Level|int $level): self + { + $self = clone $this; + $self['level'] = $level; + + return $self; + } +} diff --git a/src/ChatStateCapabilities/DisappearingTimer/Level.php b/src/ChatStateCapabilities/DisappearingTimer/Level.php new file mode 100644 index 0000000..9b4f722 --- /dev/null +++ b/src/ChatStateCapabilities/DisappearingTimer/Level.php @@ -0,0 +1,21 @@ +} + */ +final class Title implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @var value-of $level + */ + #[Required(enum: Level::class)] + public int $level; + + /** + * `new Title()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Title::with(level: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Title)->withLevel(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Level|value-of $level + */ + public static function with(Level|int $level): self + { + $self = new self; + + $self['level'] = $level; + + return $self; + } + + /** + * -2: rejected, -1: dropped, 0: unsupported, 1: partially supported, 2: fully supported. + * + * @param Level|value-of $level + */ + public function withLevel(Level|int $level): self + { + $self = clone $this; + $self['level'] = $level; + + return $self; + } +} diff --git a/src/ChatStateCapabilities/Title/Level.php b/src/ChatStateCapabilities/Title/Level.php new file mode 100644 index 0000000..9866f9e --- /dev/null +++ b/src/ChatStateCapabilities/Title/Level.php @@ -0,0 +1,21 @@ +, * unreadCount: int, + * capabilities?: null|ChatCapabilities|ChatCapabilitiesShape, + * description?: string|null, + * draft?: null|ChatDraft|ChatDraftShape, + * imgURL?: string|null, * isArchived?: bool|null, + * isLowPriority?: bool|null, + * isMarkedUnread?: bool|null, * isMuted?: bool|null, * isPinned?: bool|null, + * isReadOnly?: bool|null, + * labels?: list|null, * lastActivity?: \DateTimeInterface|null, * lastReadMessageSortKey?: string|null, * localChatID?: string|null, + * merge?: null|Merge|MergeShape, + * mergedIntoChatID?: string|null, + * messageExpirySeconds?: int|null, + * reminder?: null|Reminder|ReminderShape, + * snooze?: null|Snooze|SnoozeShape, + * unreadMentionsCount?: int|null, * } */ final class Chat implements BaseModel @@ -46,6 +73,12 @@ final class Chat implements BaseModel #[Required] public string $accountID; + /** + * Display-only human-readable account/network name. + */ + #[Required] + public string $network; + /** * Chat participants information. */ @@ -72,12 +105,48 @@ final class Chat implements BaseModel #[Required] public int $unreadCount; + /** + * Chat capabilities reported by the platform. + */ + #[Optional] + public ?ChatCapabilities $capabilities; + + /** + * Group chat description/topic when available. + */ + #[Optional(nullable: true)] + public ?string $description; + + /** + * Current draft object for this chat, or null when no draft is set. + */ + #[Optional(nullable: true)] + public ?ChatDraft $draft; + + /** + * Local filesystem path to the chat avatar image when available. + */ + #[Optional(nullable: true)] + public ?string $imgURL; + /** * True if chat is archived. */ #[Optional] public ?bool $isArchived; + /** + * True if chat is marked low priority. + */ + #[Optional] + public ?bool $isLowPriority; + + /** + * True if the chat was explicitly marked unread by the authenticated user. + */ + #[Optional] + public ?bool $isMarkedUnread; + /** * True if chat notifications are muted. */ @@ -90,6 +159,20 @@ final class Chat implements BaseModel #[Optional] public ?bool $isPinned; + /** + * True if messages cannot be sent in this chat. + */ + #[Optional] + public ?bool $isReadOnly; + + /** + * Labels applied to this chat. Absent when the chat has none, or when labels are not enabled for this user. + * + * @var list