{-# 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.DirectoryService.Types.ClientCertAuthSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ClientCertAuthSettings = ClientCertAuthSettings'
{
ClientCertAuthSettings -> Maybe Text
oCSPUrl :: Prelude.Maybe Prelude.Text
}
deriving (ClientCertAuthSettings -> ClientCertAuthSettings -> Bool
(ClientCertAuthSettings -> ClientCertAuthSettings -> Bool)
-> (ClientCertAuthSettings -> ClientCertAuthSettings -> Bool)
-> Eq ClientCertAuthSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientCertAuthSettings -> ClientCertAuthSettings -> Bool
$c/= :: ClientCertAuthSettings -> ClientCertAuthSettings -> Bool
== :: ClientCertAuthSettings -> ClientCertAuthSettings -> Bool
$c== :: ClientCertAuthSettings -> ClientCertAuthSettings -> Bool
Prelude.Eq, ReadPrec [ClientCertAuthSettings]
ReadPrec ClientCertAuthSettings
Int -> ReadS ClientCertAuthSettings
ReadS [ClientCertAuthSettings]
(Int -> ReadS ClientCertAuthSettings)
-> ReadS [ClientCertAuthSettings]
-> ReadPrec ClientCertAuthSettings
-> ReadPrec [ClientCertAuthSettings]
-> Read ClientCertAuthSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClientCertAuthSettings]
$creadListPrec :: ReadPrec [ClientCertAuthSettings]
readPrec :: ReadPrec ClientCertAuthSettings
$creadPrec :: ReadPrec ClientCertAuthSettings
readList :: ReadS [ClientCertAuthSettings]
$creadList :: ReadS [ClientCertAuthSettings]
readsPrec :: Int -> ReadS ClientCertAuthSettings
$creadsPrec :: Int -> ReadS ClientCertAuthSettings
Prelude.Read, Int -> ClientCertAuthSettings -> ShowS
[ClientCertAuthSettings] -> ShowS
ClientCertAuthSettings -> String
(Int -> ClientCertAuthSettings -> ShowS)
-> (ClientCertAuthSettings -> String)
-> ([ClientCertAuthSettings] -> ShowS)
-> Show ClientCertAuthSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClientCertAuthSettings] -> ShowS
$cshowList :: [ClientCertAuthSettings] -> ShowS
show :: ClientCertAuthSettings -> String
$cshow :: ClientCertAuthSettings -> String
showsPrec :: Int -> ClientCertAuthSettings -> ShowS
$cshowsPrec :: Int -> ClientCertAuthSettings -> ShowS
Prelude.Show, (forall x. ClientCertAuthSettings -> Rep ClientCertAuthSettings x)
-> (forall x.
Rep ClientCertAuthSettings x -> ClientCertAuthSettings)
-> Generic ClientCertAuthSettings
forall x. Rep ClientCertAuthSettings x -> ClientCertAuthSettings
forall x. ClientCertAuthSettings -> Rep ClientCertAuthSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClientCertAuthSettings x -> ClientCertAuthSettings
$cfrom :: forall x. ClientCertAuthSettings -> Rep ClientCertAuthSettings x
Prelude.Generic)
newClientCertAuthSettings ::
ClientCertAuthSettings
newClientCertAuthSettings :: ClientCertAuthSettings
newClientCertAuthSettings =
ClientCertAuthSettings' :: Maybe Text -> ClientCertAuthSettings
ClientCertAuthSettings' {$sel:oCSPUrl:ClientCertAuthSettings' :: Maybe Text
oCSPUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing}
clientCertAuthSettings_oCSPUrl :: Lens.Lens' ClientCertAuthSettings (Prelude.Maybe Prelude.Text)
clientCertAuthSettings_oCSPUrl :: (Maybe Text -> f (Maybe Text))
-> ClientCertAuthSettings -> f ClientCertAuthSettings
clientCertAuthSettings_oCSPUrl = (ClientCertAuthSettings -> Maybe Text)
-> (ClientCertAuthSettings -> Maybe Text -> ClientCertAuthSettings)
-> Lens
ClientCertAuthSettings
ClientCertAuthSettings
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientCertAuthSettings' {Maybe Text
oCSPUrl :: Maybe Text
$sel:oCSPUrl:ClientCertAuthSettings' :: ClientCertAuthSettings -> Maybe Text
oCSPUrl} -> Maybe Text
oCSPUrl) (\s :: ClientCertAuthSettings
s@ClientCertAuthSettings' {} Maybe Text
a -> ClientCertAuthSettings
s {$sel:oCSPUrl:ClientCertAuthSettings' :: Maybe Text
oCSPUrl = Maybe Text
a} :: ClientCertAuthSettings)
instance Core.FromJSON ClientCertAuthSettings where
parseJSON :: Value -> Parser ClientCertAuthSettings
parseJSON =
String
-> (Object -> Parser ClientCertAuthSettings)
-> Value
-> Parser ClientCertAuthSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClientCertAuthSettings"
( \Object
x ->
Maybe Text -> ClientCertAuthSettings
ClientCertAuthSettings'
(Maybe Text -> ClientCertAuthSettings)
-> Parser (Maybe Text) -> Parser ClientCertAuthSettings
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
"OCSPUrl")
)
instance Prelude.Hashable ClientCertAuthSettings
instance Prelude.NFData ClientCertAuthSettings
instance Core.ToJSON ClientCertAuthSettings where
toJSON :: ClientCertAuthSettings -> Value
toJSON ClientCertAuthSettings' {Maybe Text
oCSPUrl :: Maybe Text
$sel:oCSPUrl:ClientCertAuthSettings' :: ClientCertAuthSettings -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"OCSPUrl" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
oCSPUrl]
)