{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SageMaker.Types.OidcConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OidcConfig = OidcConfig'
{
OidcConfig -> Text
clientId :: Prelude.Text,
OidcConfig -> Sensitive Text
clientSecret :: Core.Sensitive Prelude.Text,
OidcConfig -> Text
issuer :: Prelude.Text,
OidcConfig -> Text
authorizationEndpoint :: Prelude.Text,
OidcConfig -> Text
tokenEndpoint :: Prelude.Text,
OidcConfig -> Text
userInfoEndpoint :: Prelude.Text,
OidcConfig -> Text
logoutEndpoint :: Prelude.Text,
OidcConfig -> Text
jwksUri :: Prelude.Text
}
deriving (OidcConfig -> OidcConfig -> Bool
(OidcConfig -> OidcConfig -> Bool)
-> (OidcConfig -> OidcConfig -> Bool) -> Eq OidcConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OidcConfig -> OidcConfig -> Bool
$c/= :: OidcConfig -> OidcConfig -> Bool
== :: OidcConfig -> OidcConfig -> Bool
$c== :: OidcConfig -> OidcConfig -> Bool
Prelude.Eq, Int -> OidcConfig -> ShowS
[OidcConfig] -> ShowS
OidcConfig -> String
(Int -> OidcConfig -> ShowS)
-> (OidcConfig -> String)
-> ([OidcConfig] -> ShowS)
-> Show OidcConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OidcConfig] -> ShowS
$cshowList :: [OidcConfig] -> ShowS
show :: OidcConfig -> String
$cshow :: OidcConfig -> String
showsPrec :: Int -> OidcConfig -> ShowS
$cshowsPrec :: Int -> OidcConfig -> ShowS
Prelude.Show, (forall x. OidcConfig -> Rep OidcConfig x)
-> (forall x. Rep OidcConfig x -> OidcConfig) -> Generic OidcConfig
forall x. Rep OidcConfig x -> OidcConfig
forall x. OidcConfig -> Rep OidcConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OidcConfig x -> OidcConfig
$cfrom :: forall x. OidcConfig -> Rep OidcConfig x
Prelude.Generic)
newOidcConfig ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
OidcConfig
newOidcConfig :: Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> OidcConfig
newOidcConfig
Text
pClientId_
Text
pClientSecret_
Text
pIssuer_
Text
pAuthorizationEndpoint_
Text
pTokenEndpoint_
Text
pUserInfoEndpoint_
Text
pLogoutEndpoint_
Text
pJwksUri_ =
OidcConfig' :: Text
-> Sensitive Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> OidcConfig
OidcConfig'
{ $sel:clientId:OidcConfig' :: Text
clientId = Text
pClientId_,
$sel:clientSecret:OidcConfig' :: Sensitive Text
clientSecret = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pClientSecret_,
$sel:issuer:OidcConfig' :: Text
issuer = Text
pIssuer_,
$sel:authorizationEndpoint:OidcConfig' :: Text
authorizationEndpoint = Text
pAuthorizationEndpoint_,
$sel:tokenEndpoint:OidcConfig' :: Text
tokenEndpoint = Text
pTokenEndpoint_,
$sel:userInfoEndpoint:OidcConfig' :: Text
userInfoEndpoint = Text
pUserInfoEndpoint_,
$sel:logoutEndpoint:OidcConfig' :: Text
logoutEndpoint = Text
pLogoutEndpoint_,
$sel:jwksUri:OidcConfig' :: Text
jwksUri = Text
pJwksUri_
}
oidcConfig_clientId :: Lens.Lens' OidcConfig Prelude.Text
oidcConfig_clientId :: (Text -> f Text) -> OidcConfig -> f OidcConfig
oidcConfig_clientId = (OidcConfig -> Text)
-> (OidcConfig -> Text -> OidcConfig)
-> Lens OidcConfig OidcConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfig' {Text
clientId :: Text
$sel:clientId:OidcConfig' :: OidcConfig -> Text
clientId} -> Text
clientId) (\s :: OidcConfig
s@OidcConfig' {} Text
a -> OidcConfig
s {$sel:clientId:OidcConfig' :: Text
clientId = Text
a} :: OidcConfig)
oidcConfig_clientSecret :: Lens.Lens' OidcConfig Prelude.Text
oidcConfig_clientSecret :: (Text -> f Text) -> OidcConfig -> f OidcConfig
oidcConfig_clientSecret = (OidcConfig -> Sensitive Text)
-> (OidcConfig -> Sensitive Text -> OidcConfig)
-> Lens OidcConfig OidcConfig (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfig' {Sensitive Text
clientSecret :: Sensitive Text
$sel:clientSecret:OidcConfig' :: OidcConfig -> Sensitive Text
clientSecret} -> Sensitive Text
clientSecret) (\s :: OidcConfig
s@OidcConfig' {} Sensitive Text
a -> OidcConfig
s {$sel:clientSecret:OidcConfig' :: Sensitive Text
clientSecret = Sensitive Text
a} :: OidcConfig) ((Sensitive Text -> f (Sensitive Text))
-> OidcConfig -> f OidcConfig)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> OidcConfig
-> f OidcConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
oidcConfig_issuer :: Lens.Lens' OidcConfig Prelude.Text
oidcConfig_issuer :: (Text -> f Text) -> OidcConfig -> f OidcConfig
oidcConfig_issuer = (OidcConfig -> Text)
-> (OidcConfig -> Text -> OidcConfig)
-> Lens OidcConfig OidcConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfig' {Text
issuer :: Text
$sel:issuer:OidcConfig' :: OidcConfig -> Text
issuer} -> Text
issuer) (\s :: OidcConfig
s@OidcConfig' {} Text
a -> OidcConfig
s {$sel:issuer:OidcConfig' :: Text
issuer = Text
a} :: OidcConfig)
oidcConfig_authorizationEndpoint :: Lens.Lens' OidcConfig Prelude.Text
oidcConfig_authorizationEndpoint :: (Text -> f Text) -> OidcConfig -> f OidcConfig
oidcConfig_authorizationEndpoint = (OidcConfig -> Text)
-> (OidcConfig -> Text -> OidcConfig)
-> Lens OidcConfig OidcConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfig' {Text
authorizationEndpoint :: Text
$sel:authorizationEndpoint:OidcConfig' :: OidcConfig -> Text
authorizationEndpoint} -> Text
authorizationEndpoint) (\s :: OidcConfig
s@OidcConfig' {} Text
a -> OidcConfig
s {$sel:authorizationEndpoint:OidcConfig' :: Text
authorizationEndpoint = Text
a} :: OidcConfig)
oidcConfig_tokenEndpoint :: Lens.Lens' OidcConfig Prelude.Text
oidcConfig_tokenEndpoint :: (Text -> f Text) -> OidcConfig -> f OidcConfig
oidcConfig_tokenEndpoint = (OidcConfig -> Text)
-> (OidcConfig -> Text -> OidcConfig)
-> Lens OidcConfig OidcConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfig' {Text
tokenEndpoint :: Text
$sel:tokenEndpoint:OidcConfig' :: OidcConfig -> Text
tokenEndpoint} -> Text
tokenEndpoint) (\s :: OidcConfig
s@OidcConfig' {} Text
a -> OidcConfig
s {$sel:tokenEndpoint:OidcConfig' :: Text
tokenEndpoint = Text
a} :: OidcConfig)
oidcConfig_userInfoEndpoint :: Lens.Lens' OidcConfig Prelude.Text
oidcConfig_userInfoEndpoint :: (Text -> f Text) -> OidcConfig -> f OidcConfig
oidcConfig_userInfoEndpoint = (OidcConfig -> Text)
-> (OidcConfig -> Text -> OidcConfig)
-> Lens OidcConfig OidcConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfig' {Text
userInfoEndpoint :: Text
$sel:userInfoEndpoint:OidcConfig' :: OidcConfig -> Text
userInfoEndpoint} -> Text
userInfoEndpoint) (\s :: OidcConfig
s@OidcConfig' {} Text
a -> OidcConfig
s {$sel:userInfoEndpoint:OidcConfig' :: Text
userInfoEndpoint = Text
a} :: OidcConfig)
oidcConfig_logoutEndpoint :: Lens.Lens' OidcConfig Prelude.Text
oidcConfig_logoutEndpoint :: (Text -> f Text) -> OidcConfig -> f OidcConfig
oidcConfig_logoutEndpoint = (OidcConfig -> Text)
-> (OidcConfig -> Text -> OidcConfig)
-> Lens OidcConfig OidcConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfig' {Text
logoutEndpoint :: Text
$sel:logoutEndpoint:OidcConfig' :: OidcConfig -> Text
logoutEndpoint} -> Text
logoutEndpoint) (\s :: OidcConfig
s@OidcConfig' {} Text
a -> OidcConfig
s {$sel:logoutEndpoint:OidcConfig' :: Text
logoutEndpoint = Text
a} :: OidcConfig)
oidcConfig_jwksUri :: Lens.Lens' OidcConfig Prelude.Text
oidcConfig_jwksUri :: (Text -> f Text) -> OidcConfig -> f OidcConfig
oidcConfig_jwksUri = (OidcConfig -> Text)
-> (OidcConfig -> Text -> OidcConfig)
-> Lens OidcConfig OidcConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfig' {Text
jwksUri :: Text
$sel:jwksUri:OidcConfig' :: OidcConfig -> Text
jwksUri} -> Text
jwksUri) (\s :: OidcConfig
s@OidcConfig' {} Text
a -> OidcConfig
s {$sel:jwksUri:OidcConfig' :: Text
jwksUri = Text
a} :: OidcConfig)
instance Prelude.Hashable OidcConfig
instance Prelude.NFData OidcConfig
instance Core.ToJSON OidcConfig where
toJSON :: OidcConfig -> Value
toJSON OidcConfig' {Text
Sensitive Text
jwksUri :: Text
logoutEndpoint :: Text
userInfoEndpoint :: Text
tokenEndpoint :: Text
authorizationEndpoint :: Text
issuer :: Text
clientSecret :: Sensitive Text
clientId :: Text
$sel:jwksUri:OidcConfig' :: OidcConfig -> Text
$sel:logoutEndpoint:OidcConfig' :: OidcConfig -> Text
$sel:userInfoEndpoint:OidcConfig' :: OidcConfig -> Text
$sel:tokenEndpoint:OidcConfig' :: OidcConfig -> Text
$sel:authorizationEndpoint:OidcConfig' :: OidcConfig -> Text
$sel:issuer:OidcConfig' :: OidcConfig -> Text
$sel:clientSecret:OidcConfig' :: OidcConfig -> Sensitive Text
$sel:clientId:OidcConfig' :: OidcConfig -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientSecret" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
clientSecret),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Issuer" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
issuer),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"AuthorizationEndpoint"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
authorizationEndpoint
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TokenEndpoint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tokenEndpoint),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"UserInfoEndpoint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userInfoEndpoint),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"LogoutEndpoint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
logoutEndpoint),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"JwksUri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jwksUri)
]
)