-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TypedDict implementations of API responses.
- Loading branch information
1 parent
806ccc7
commit dee2188
Showing
4 changed files
with
116 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
from typing_extensions import Literal, NotRequired, TypedDict | ||
|
||
class SignResponse(TypedDict): | ||
orderRef: str | ||
autoStartToken: str | ||
qrStartToken: str | ||
qrStartSecret: str | ||
|
||
|
||
class PhoneSignResponse(TypedDict): | ||
orderRef: str | ||
|
||
|
||
class AuthenticateResponse(TypedDict): | ||
orderRef: str | ||
autoStartToken: str | ||
qrStartToken: str | ||
qrStartSecret: str | ||
|
||
|
||
class PhoneAuthenticateResponse(TypedDict): | ||
orderRef: str | ||
|
||
|
||
class Device(TypedDict): | ||
ipAddress: str | ||
uhi: str | ||
|
||
|
||
class StepUp(TypedDict): | ||
mrtd: bool | ||
|
||
|
||
class User(TypedDict): | ||
personalNumber: str | ||
name: str | ||
givenName: str | ||
surname: str | ||
|
||
|
||
class CompletionData(TypedDict): | ||
user: User | ||
device: Device | ||
stepUp: StepUp | ||
bankIdIssueDate: str | ||
signature: str | ||
ocspResponse: str | ||
risk: NotRequired[str] | ||
|
||
|
||
class _CollectResponse(TypedDict): | ||
orderRef: str | ||
|
||
|
||
class CollectPendingResponse(_CollectResponse): | ||
status: Literal["pending"] | ||
hintCode: str | ||
|
||
|
||
class CollectCompleteResponse(_CollectResponse): | ||
status: Literal["complete"] | ||
completionData: CompletionData | ||
|
||
|
||
class CollectFailedResponse(_CollectResponse): | ||
status: Literal["failed"] | ||
hintCode: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters