{-# 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.CertificateManagerPCA.Types.OcspConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data OcspConfiguration = OcspConfiguration'
{
OcspConfiguration -> Maybe Text
ocspCustomCname :: Prelude.Maybe Prelude.Text,
OcspConfiguration -> Bool
enabled :: Prelude.Bool
}
deriving (OcspConfiguration -> OcspConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OcspConfiguration -> OcspConfiguration -> Bool
$c/= :: OcspConfiguration -> OcspConfiguration -> Bool
== :: OcspConfiguration -> OcspConfiguration -> Bool
$c== :: OcspConfiguration -> OcspConfiguration -> Bool
Prelude.Eq, ReadPrec [OcspConfiguration]
ReadPrec OcspConfiguration
Int -> ReadS OcspConfiguration
ReadS [OcspConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OcspConfiguration]
$creadListPrec :: ReadPrec [OcspConfiguration]
readPrec :: ReadPrec OcspConfiguration
$creadPrec :: ReadPrec OcspConfiguration
readList :: ReadS [OcspConfiguration]
$creadList :: ReadS [OcspConfiguration]
readsPrec :: Int -> ReadS OcspConfiguration
$creadsPrec :: Int -> ReadS OcspConfiguration
Prelude.Read, Int -> OcspConfiguration -> ShowS
[OcspConfiguration] -> ShowS
OcspConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OcspConfiguration] -> ShowS
$cshowList :: [OcspConfiguration] -> ShowS
show :: OcspConfiguration -> String
$cshow :: OcspConfiguration -> String
showsPrec :: Int -> OcspConfiguration -> ShowS
$cshowsPrec :: Int -> OcspConfiguration -> ShowS
Prelude.Show, forall x. Rep OcspConfiguration x -> OcspConfiguration
forall x. OcspConfiguration -> Rep OcspConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OcspConfiguration x -> OcspConfiguration
$cfrom :: forall x. OcspConfiguration -> Rep OcspConfiguration x
Prelude.Generic)
newOcspConfiguration ::
Prelude.Bool ->
OcspConfiguration
newOcspConfiguration :: Bool -> OcspConfiguration
newOcspConfiguration Bool
pEnabled_ =
OcspConfiguration'
{ $sel:ocspCustomCname:OcspConfiguration' :: Maybe Text
ocspCustomCname =
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:OcspConfiguration' :: Bool
enabled = Bool
pEnabled_
}
ocspConfiguration_ocspCustomCname :: Lens.Lens' OcspConfiguration (Prelude.Maybe Prelude.Text)
ocspConfiguration_ocspCustomCname :: Lens' OcspConfiguration (Maybe Text)
ocspConfiguration_ocspCustomCname = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OcspConfiguration' {Maybe Text
ocspCustomCname :: Maybe Text
$sel:ocspCustomCname:OcspConfiguration' :: OcspConfiguration -> Maybe Text
ocspCustomCname} -> Maybe Text
ocspCustomCname) (\s :: OcspConfiguration
s@OcspConfiguration' {} Maybe Text
a -> OcspConfiguration
s {$sel:ocspCustomCname:OcspConfiguration' :: Maybe Text
ocspCustomCname = Maybe Text
a} :: OcspConfiguration)
ocspConfiguration_enabled :: Lens.Lens' OcspConfiguration Prelude.Bool
ocspConfiguration_enabled :: Lens' OcspConfiguration Bool
ocspConfiguration_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OcspConfiguration' {Bool
enabled :: Bool
$sel:enabled:OcspConfiguration' :: OcspConfiguration -> Bool
enabled} -> Bool
enabled) (\s :: OcspConfiguration
s@OcspConfiguration' {} Bool
a -> OcspConfiguration
s {$sel:enabled:OcspConfiguration' :: Bool
enabled = Bool
a} :: OcspConfiguration)
instance Data.FromJSON OcspConfiguration where
parseJSON :: Value -> Parser OcspConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OcspConfiguration"
( \Object
x ->
Maybe Text -> Bool -> OcspConfiguration
OcspConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OcspCustomCname")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Enabled")
)
instance Prelude.Hashable OcspConfiguration where
hashWithSalt :: Int -> OcspConfiguration -> Int
hashWithSalt Int
_salt OcspConfiguration' {Bool
Maybe Text
enabled :: Bool
ocspCustomCname :: Maybe Text
$sel:enabled:OcspConfiguration' :: OcspConfiguration -> Bool
$sel:ocspCustomCname:OcspConfiguration' :: OcspConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ocspCustomCname
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled
instance Prelude.NFData OcspConfiguration where
rnf :: OcspConfiguration -> ()
rnf OcspConfiguration' {Bool
Maybe Text
enabled :: Bool
ocspCustomCname :: Maybe Text
$sel:enabled:OcspConfiguration' :: OcspConfiguration -> Bool
$sel:ocspCustomCname:OcspConfiguration' :: OcspConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ocspCustomCname
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled
instance Data.ToJSON OcspConfiguration where
toJSON :: OcspConfiguration -> Value
toJSON OcspConfiguration' {Bool
Maybe Text
enabled :: Bool
ocspCustomCname :: Maybe Text
$sel:enabled:OcspConfiguration' :: OcspConfiguration -> Bool
$sel:ocspCustomCname:OcspConfiguration' :: OcspConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"OcspCustomCname" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ocspCustomCname,
forall a. a -> Maybe a
Prelude.Just (Key
"Enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enabled)
]
)