{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SageMaker.Types.OidcConfigForResponse
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.OidcConfigForResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Your OIDC IdP workforce configuration.
--
-- /See:/ 'newOidcConfigForResponse' smart constructor.
data OidcConfigForResponse = OidcConfigForResponse'
  { -- | The OIDC IdP client ID used to configure your private workforce.
    OidcConfigForResponse -> Maybe Text
clientId :: Prelude.Maybe Prelude.Text,
    -- | The OIDC IdP JSON Web Key Set (Jwks) URI used to configure your private
    -- workforce.
    OidcConfigForResponse -> Maybe Text
jwksUri :: Prelude.Maybe Prelude.Text,
    -- | The OIDC IdP user information endpoint used to configure your private
    -- workforce.
    OidcConfigForResponse -> Maybe Text
userInfoEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The OIDC IdP authorization endpoint used to configure your private
    -- workforce.
    OidcConfigForResponse -> Maybe Text
authorizationEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The OIDC IdP token endpoint used to configure your private workforce.
    OidcConfigForResponse -> Maybe Text
tokenEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The OIDC IdP issuer used to configure your private workforce.
    OidcConfigForResponse -> Maybe Text
issuer :: Prelude.Maybe Prelude.Text,
    -- | The OIDC IdP logout endpoint used to configure your private workforce.
    OidcConfigForResponse -> Maybe Text
logoutEndpoint :: Prelude.Maybe Prelude.Text
  }
  deriving (OidcConfigForResponse -> OidcConfigForResponse -> Bool
(OidcConfigForResponse -> OidcConfigForResponse -> Bool)
-> (OidcConfigForResponse -> OidcConfigForResponse -> Bool)
-> Eq OidcConfigForResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OidcConfigForResponse -> OidcConfigForResponse -> Bool
$c/= :: OidcConfigForResponse -> OidcConfigForResponse -> Bool
== :: OidcConfigForResponse -> OidcConfigForResponse -> Bool
$c== :: OidcConfigForResponse -> OidcConfigForResponse -> Bool
Prelude.Eq, ReadPrec [OidcConfigForResponse]
ReadPrec OidcConfigForResponse
Int -> ReadS OidcConfigForResponse
ReadS [OidcConfigForResponse]
(Int -> ReadS OidcConfigForResponse)
-> ReadS [OidcConfigForResponse]
-> ReadPrec OidcConfigForResponse
-> ReadPrec [OidcConfigForResponse]
-> Read OidcConfigForResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OidcConfigForResponse]
$creadListPrec :: ReadPrec [OidcConfigForResponse]
readPrec :: ReadPrec OidcConfigForResponse
$creadPrec :: ReadPrec OidcConfigForResponse
readList :: ReadS [OidcConfigForResponse]
$creadList :: ReadS [OidcConfigForResponse]
readsPrec :: Int -> ReadS OidcConfigForResponse
$creadsPrec :: Int -> ReadS OidcConfigForResponse
Prelude.Read, Int -> OidcConfigForResponse -> ShowS
[OidcConfigForResponse] -> ShowS
OidcConfigForResponse -> String
(Int -> OidcConfigForResponse -> ShowS)
-> (OidcConfigForResponse -> String)
-> ([OidcConfigForResponse] -> ShowS)
-> Show OidcConfigForResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OidcConfigForResponse] -> ShowS
$cshowList :: [OidcConfigForResponse] -> ShowS
show :: OidcConfigForResponse -> String
$cshow :: OidcConfigForResponse -> String
showsPrec :: Int -> OidcConfigForResponse -> ShowS
$cshowsPrec :: Int -> OidcConfigForResponse -> ShowS
Prelude.Show, (forall x. OidcConfigForResponse -> Rep OidcConfigForResponse x)
-> (forall x. Rep OidcConfigForResponse x -> OidcConfigForResponse)
-> Generic OidcConfigForResponse
forall x. Rep OidcConfigForResponse x -> OidcConfigForResponse
forall x. OidcConfigForResponse -> Rep OidcConfigForResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OidcConfigForResponse x -> OidcConfigForResponse
$cfrom :: forall x. OidcConfigForResponse -> Rep OidcConfigForResponse x
Prelude.Generic)

-- |
-- Create a value of 'OidcConfigForResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientId', 'oidcConfigForResponse_clientId' - The OIDC IdP client ID used to configure your private workforce.
--
-- 'jwksUri', 'oidcConfigForResponse_jwksUri' - The OIDC IdP JSON Web Key Set (Jwks) URI used to configure your private
-- workforce.
--
-- 'userInfoEndpoint', 'oidcConfigForResponse_userInfoEndpoint' - The OIDC IdP user information endpoint used to configure your private
-- workforce.
--
-- 'authorizationEndpoint', 'oidcConfigForResponse_authorizationEndpoint' - The OIDC IdP authorization endpoint used to configure your private
-- workforce.
--
-- 'tokenEndpoint', 'oidcConfigForResponse_tokenEndpoint' - The OIDC IdP token endpoint used to configure your private workforce.
--
-- 'issuer', 'oidcConfigForResponse_issuer' - The OIDC IdP issuer used to configure your private workforce.
--
-- 'logoutEndpoint', 'oidcConfigForResponse_logoutEndpoint' - The OIDC IdP logout endpoint used to configure your private workforce.
newOidcConfigForResponse ::
  OidcConfigForResponse
newOidcConfigForResponse :: OidcConfigForResponse
newOidcConfigForResponse =
  OidcConfigForResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OidcConfigForResponse
OidcConfigForResponse'
    { $sel:clientId:OidcConfigForResponse' :: Maybe Text
clientId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jwksUri:OidcConfigForResponse' :: Maybe Text
jwksUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userInfoEndpoint:OidcConfigForResponse' :: Maybe Text
userInfoEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationEndpoint:OidcConfigForResponse' :: Maybe Text
authorizationEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tokenEndpoint:OidcConfigForResponse' :: Maybe Text
tokenEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:issuer:OidcConfigForResponse' :: Maybe Text
issuer = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:logoutEndpoint:OidcConfigForResponse' :: Maybe Text
logoutEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The OIDC IdP client ID used to configure your private workforce.
oidcConfigForResponse_clientId :: Lens.Lens' OidcConfigForResponse (Prelude.Maybe Prelude.Text)
oidcConfigForResponse_clientId :: (Maybe Text -> f (Maybe Text))
-> OidcConfigForResponse -> f OidcConfigForResponse
oidcConfigForResponse_clientId = (OidcConfigForResponse -> Maybe Text)
-> (OidcConfigForResponse -> Maybe Text -> OidcConfigForResponse)
-> Lens
     OidcConfigForResponse
     OidcConfigForResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfigForResponse' {Maybe Text
clientId :: Maybe Text
$sel:clientId:OidcConfigForResponse' :: OidcConfigForResponse -> Maybe Text
clientId} -> Maybe Text
clientId) (\s :: OidcConfigForResponse
s@OidcConfigForResponse' {} Maybe Text
a -> OidcConfigForResponse
s {$sel:clientId:OidcConfigForResponse' :: Maybe Text
clientId = Maybe Text
a} :: OidcConfigForResponse)

-- | The OIDC IdP JSON Web Key Set (Jwks) URI used to configure your private
-- workforce.
oidcConfigForResponse_jwksUri :: Lens.Lens' OidcConfigForResponse (Prelude.Maybe Prelude.Text)
oidcConfigForResponse_jwksUri :: (Maybe Text -> f (Maybe Text))
-> OidcConfigForResponse -> f OidcConfigForResponse
oidcConfigForResponse_jwksUri = (OidcConfigForResponse -> Maybe Text)
-> (OidcConfigForResponse -> Maybe Text -> OidcConfigForResponse)
-> Lens
     OidcConfigForResponse
     OidcConfigForResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfigForResponse' {Maybe Text
jwksUri :: Maybe Text
$sel:jwksUri:OidcConfigForResponse' :: OidcConfigForResponse -> Maybe Text
jwksUri} -> Maybe Text
jwksUri) (\s :: OidcConfigForResponse
s@OidcConfigForResponse' {} Maybe Text
a -> OidcConfigForResponse
s {$sel:jwksUri:OidcConfigForResponse' :: Maybe Text
jwksUri = Maybe Text
a} :: OidcConfigForResponse)

-- | The OIDC IdP user information endpoint used to configure your private
-- workforce.
oidcConfigForResponse_userInfoEndpoint :: Lens.Lens' OidcConfigForResponse (Prelude.Maybe Prelude.Text)
oidcConfigForResponse_userInfoEndpoint :: (Maybe Text -> f (Maybe Text))
-> OidcConfigForResponse -> f OidcConfigForResponse
oidcConfigForResponse_userInfoEndpoint = (OidcConfigForResponse -> Maybe Text)
-> (OidcConfigForResponse -> Maybe Text -> OidcConfigForResponse)
-> Lens
     OidcConfigForResponse
     OidcConfigForResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfigForResponse' {Maybe Text
userInfoEndpoint :: Maybe Text
$sel:userInfoEndpoint:OidcConfigForResponse' :: OidcConfigForResponse -> Maybe Text
userInfoEndpoint} -> Maybe Text
userInfoEndpoint) (\s :: OidcConfigForResponse
s@OidcConfigForResponse' {} Maybe Text
a -> OidcConfigForResponse
s {$sel:userInfoEndpoint:OidcConfigForResponse' :: Maybe Text
userInfoEndpoint = Maybe Text
a} :: OidcConfigForResponse)

-- | The OIDC IdP authorization endpoint used to configure your private
-- workforce.
oidcConfigForResponse_authorizationEndpoint :: Lens.Lens' OidcConfigForResponse (Prelude.Maybe Prelude.Text)
oidcConfigForResponse_authorizationEndpoint :: (Maybe Text -> f (Maybe Text))
-> OidcConfigForResponse -> f OidcConfigForResponse
oidcConfigForResponse_authorizationEndpoint = (OidcConfigForResponse -> Maybe Text)
-> (OidcConfigForResponse -> Maybe Text -> OidcConfigForResponse)
-> Lens
     OidcConfigForResponse
     OidcConfigForResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfigForResponse' {Maybe Text
authorizationEndpoint :: Maybe Text
$sel:authorizationEndpoint:OidcConfigForResponse' :: OidcConfigForResponse -> Maybe Text
authorizationEndpoint} -> Maybe Text
authorizationEndpoint) (\s :: OidcConfigForResponse
s@OidcConfigForResponse' {} Maybe Text
a -> OidcConfigForResponse
s {$sel:authorizationEndpoint:OidcConfigForResponse' :: Maybe Text
authorizationEndpoint = Maybe Text
a} :: OidcConfigForResponse)

-- | The OIDC IdP token endpoint used to configure your private workforce.
oidcConfigForResponse_tokenEndpoint :: Lens.Lens' OidcConfigForResponse (Prelude.Maybe Prelude.Text)
oidcConfigForResponse_tokenEndpoint :: (Maybe Text -> f (Maybe Text))
-> OidcConfigForResponse -> f OidcConfigForResponse
oidcConfigForResponse_tokenEndpoint = (OidcConfigForResponse -> Maybe Text)
-> (OidcConfigForResponse -> Maybe Text -> OidcConfigForResponse)
-> Lens
     OidcConfigForResponse
     OidcConfigForResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfigForResponse' {Maybe Text
tokenEndpoint :: Maybe Text
$sel:tokenEndpoint:OidcConfigForResponse' :: OidcConfigForResponse -> Maybe Text
tokenEndpoint} -> Maybe Text
tokenEndpoint) (\s :: OidcConfigForResponse
s@OidcConfigForResponse' {} Maybe Text
a -> OidcConfigForResponse
s {$sel:tokenEndpoint:OidcConfigForResponse' :: Maybe Text
tokenEndpoint = Maybe Text
a} :: OidcConfigForResponse)

-- | The OIDC IdP issuer used to configure your private workforce.
oidcConfigForResponse_issuer :: Lens.Lens' OidcConfigForResponse (Prelude.Maybe Prelude.Text)
oidcConfigForResponse_issuer :: (Maybe Text -> f (Maybe Text))
-> OidcConfigForResponse -> f OidcConfigForResponse
oidcConfigForResponse_issuer = (OidcConfigForResponse -> Maybe Text)
-> (OidcConfigForResponse -> Maybe Text -> OidcConfigForResponse)
-> Lens
     OidcConfigForResponse
     OidcConfigForResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfigForResponse' {Maybe Text
issuer :: Maybe Text
$sel:issuer:OidcConfigForResponse' :: OidcConfigForResponse -> Maybe Text
issuer} -> Maybe Text
issuer) (\s :: OidcConfigForResponse
s@OidcConfigForResponse' {} Maybe Text
a -> OidcConfigForResponse
s {$sel:issuer:OidcConfigForResponse' :: Maybe Text
issuer = Maybe Text
a} :: OidcConfigForResponse)

-- | The OIDC IdP logout endpoint used to configure your private workforce.
oidcConfigForResponse_logoutEndpoint :: Lens.Lens' OidcConfigForResponse (Prelude.Maybe Prelude.Text)
oidcConfigForResponse_logoutEndpoint :: (Maybe Text -> f (Maybe Text))
-> OidcConfigForResponse -> f OidcConfigForResponse
oidcConfigForResponse_logoutEndpoint = (OidcConfigForResponse -> Maybe Text)
-> (OidcConfigForResponse -> Maybe Text -> OidcConfigForResponse)
-> Lens
     OidcConfigForResponse
     OidcConfigForResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcConfigForResponse' {Maybe Text
logoutEndpoint :: Maybe Text
$sel:logoutEndpoint:OidcConfigForResponse' :: OidcConfigForResponse -> Maybe Text
logoutEndpoint} -> Maybe Text
logoutEndpoint) (\s :: OidcConfigForResponse
s@OidcConfigForResponse' {} Maybe Text
a -> OidcConfigForResponse
s {$sel:logoutEndpoint:OidcConfigForResponse' :: Maybe Text
logoutEndpoint = Maybe Text
a} :: OidcConfigForResponse)

instance Core.FromJSON OidcConfigForResponse where
  parseJSON :: Value -> Parser OidcConfigForResponse
parseJSON =
    String
-> (Object -> Parser OidcConfigForResponse)
-> Value
-> Parser OidcConfigForResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OidcConfigForResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OidcConfigForResponse
OidcConfigForResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> OidcConfigForResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> OidcConfigForResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClientId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> OidcConfigForResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> OidcConfigForResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JwksUri")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> OidcConfigForResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> OidcConfigForResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserInfoEndpoint")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> OidcConfigForResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> OidcConfigForResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AuthorizationEndpoint")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> OidcConfigForResponse)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> OidcConfigForResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TokenEndpoint")
            Parser (Maybe Text -> Maybe Text -> OidcConfigForResponse)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> OidcConfigForResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Issuer")
            Parser (Maybe Text -> OidcConfigForResponse)
-> Parser (Maybe Text) -> Parser OidcConfigForResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LogoutEndpoint")
      )

instance Prelude.Hashable OidcConfigForResponse

instance Prelude.NFData OidcConfigForResponse