@@ -408,6 +408,7 @@ type CtxKeyConfigRepresentation struct {
408408 Onboarding CtxKeyOnboardingRepresentation `json:"onboarding"`
409409 Accreditation CtxKeyAccreditationRepresentation `json:"accreditation"`
410410 AutoVoucher CtxKeyAutoVoucherRepresentation `json:"autovoucher"`
411+ IDNow CtxKeyIDNowRepresentation `json:"idnow"`
411412}
412413
413414// CtxKeyOnboardingRepresentation struct
@@ -430,6 +431,11 @@ type CtxKeyAutoVoucherRepresentation struct {
430431 BilledRealm * string `json:"billedRealm"`
431432}
432433
434+ // CtxKeyIDNowRepresentation struct
435+ type CtxKeyIDNowRepresentation struct {
436+ DesktopRedirectURI * string `json:"desktopRedirectUri"`
437+ }
438+
433439// RequiredAction type
434440type RequiredAction string
435441
@@ -1472,6 +1478,7 @@ func ConvertToAPIContextKeyConfig(config configuration.ContextKeyConfiguration)
14721478 Onboarding : ConvertToAPIContextKeyOnboarding (config .Onboarding ),
14731479 Accreditation : ConvertToAPIContextKeyAccreditation (config .Accreditation ),
14741480 AutoVoucher : ConvertToAPIContextKeyAutovoucher (config .AutoVoucher ),
1481+ IDNow : ConvertToAPIContextKeyIDNow (config .IDNow ),
14751482 }
14761483}
14771484
@@ -1480,12 +1487,14 @@ func (c *CtxKeyConfigRepresentation) ToDatabaseModel() configuration.ContextKeyC
14801487 onboarding := c .Onboarding .ToDatabaseModel ()
14811488 accreditation := c .Accreditation .ToDatabaseModel ()
14821489 autovoucher := c .AutoVoucher .ToDatabaseModel ()
1490+ idnow := c .IDNow .ToDatabaseModel ()
14831491
14841492 return configuration.ContextKeyConfiguration {
14851493 IdentificationURI : c .IdentificationURI ,
14861494 Onboarding : onboarding ,
14871495 Accreditation : accreditation ,
14881496 AutoVoucher : autovoucher ,
1497+ IDNow : idnow ,
14891498 }
14901499}
14911500
@@ -1585,3 +1594,27 @@ func (c *CtxKeyAutoVoucherRepresentation) Validate() error {
15851594 ValidateParameterRegExp ("billedRealm" , c .BilledRealm , constants .RegExpRealmName , false ).
15861595 Status ()
15871596}
1597+
1598+ // ConvertToAPIContextKeyIDNow converts context key idnow configuration from database model to API model
1599+ func ConvertToAPIContextKeyIDNow (idnowCfg * configuration.ContextKeyConfIDNow ) CtxKeyIDNowRepresentation {
1600+ if idnowCfg == nil {
1601+ return CtxKeyIDNowRepresentation {}
1602+ }
1603+ return CtxKeyIDNowRepresentation {
1604+ DesktopRedirectURI : idnowCfg .DesktopRedirectURI ,
1605+ }
1606+ }
1607+
1608+ // ToDatabaseModel converts a context key autovoucher configuration to the database model
1609+ func (c * CtxKeyIDNowRepresentation ) ToDatabaseModel () * configuration.ContextKeyConfIDNow {
1610+ return & configuration.ContextKeyConfIDNow {
1611+ DesktopRedirectURI : c .DesktopRedirectURI ,
1612+ }
1613+ }
1614+
1615+ // Validate is a validator for CtxKeyAutoVoucherRepresentation
1616+ func (c * CtxKeyIDNowRepresentation ) Validate () error {
1617+ return validation .NewParameterValidator ().
1618+ ValidateParameterRegExp ("desktopRedirectUri" , c .DesktopRedirectURI , constants .RegExpRedirectURI , false ).
1619+ Status ()
1620+ }
0 commit comments