Skip to content

Commit

Permalink
intents: add new intent names and codes to switches
Browse files Browse the repository at this point in the history
  • Loading branch information
patrislav committed May 24, 2024
1 parent ebab5fa commit 26c972d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions intents/intent_response_typed.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
func IntentResponseTypeToCode[T any](t *T) IntentResponseCode {
var data any = t
switch data.(type) {
case *IntentResponseAuthInitiated:
return IntentResponseCode_authInitiated
case *IntentResponseSessionOpened:
return IntentResponseCode_sessionOpened
case *IntentResponseValidationStarted:
Expand All @@ -32,6 +34,8 @@ func IntentResponseTypeToCode[T any](t *T) IntentResponseCode {
return IntentResponseCode_accountFederated
case *IntentResponseAccountRemoved:
return IntentResponseCode_accountRemoved
case *IntentResponseIdToken:
return IntentResponseCode_idToken
default:
return ""
}
Expand Down
4 changes: 4 additions & 0 deletions intents/intent_typed.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
func IntentDataTypeToName[T any](t *T) IntentName {
var data any = t
switch data.(type) {
case *IntentDataInitiateAuth:
return IntentName_initiateAuth
case *IntentDataOpenSession:
return IntentName_openSession
case *IntentDataCloseSession:
Expand Down Expand Up @@ -37,6 +39,8 @@ func IntentDataTypeToName[T any](t *T) IntentName {
return IntentName_federateAccount
case *IntentDataRemoveAccount:
return IntentName_removeAccount
case *IntentDataGetIdToken:
return IntentName_getIdToken
default:
return ""
}
Expand Down

0 comments on commit 26c972d

Please sign in to comment.