{-# 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.RevocationConfiguration where
import Amazonka.CertificateManagerPCA.Types.CrlConfiguration
import Amazonka.CertificateManagerPCA.Types.OcspConfiguration
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 RevocationConfiguration = RevocationConfiguration'
{
RevocationConfiguration -> Maybe CrlConfiguration
crlConfiguration :: Prelude.Maybe CrlConfiguration,
RevocationConfiguration -> Maybe OcspConfiguration
ocspConfiguration :: Prelude.Maybe OcspConfiguration
}
deriving (RevocationConfiguration -> RevocationConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RevocationConfiguration -> RevocationConfiguration -> Bool
$c/= :: RevocationConfiguration -> RevocationConfiguration -> Bool
== :: RevocationConfiguration -> RevocationConfiguration -> Bool
$c== :: RevocationConfiguration -> RevocationConfiguration -> Bool
Prelude.Eq, ReadPrec [RevocationConfiguration]
ReadPrec RevocationConfiguration
Int -> ReadS RevocationConfiguration
ReadS [RevocationConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RevocationConfiguration]
$creadListPrec :: ReadPrec [RevocationConfiguration]
readPrec :: ReadPrec RevocationConfiguration
$creadPrec :: ReadPrec RevocationConfiguration
readList :: ReadS [RevocationConfiguration]
$creadList :: ReadS [RevocationConfiguration]
readsPrec :: Int -> ReadS RevocationConfiguration
$creadsPrec :: Int -> ReadS RevocationConfiguration
Prelude.Read, Int -> RevocationConfiguration -> ShowS
[RevocationConfiguration] -> ShowS
RevocationConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevocationConfiguration] -> ShowS
$cshowList :: [RevocationConfiguration] -> ShowS
show :: RevocationConfiguration -> String
$cshow :: RevocationConfiguration -> String
showsPrec :: Int -> RevocationConfiguration -> ShowS
$cshowsPrec :: Int -> RevocationConfiguration -> ShowS
Prelude.Show, forall x. Rep RevocationConfiguration x -> RevocationConfiguration
forall x. RevocationConfiguration -> Rep RevocationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RevocationConfiguration x -> RevocationConfiguration
$cfrom :: forall x. RevocationConfiguration -> Rep RevocationConfiguration x
Prelude.Generic)
newRevocationConfiguration ::
RevocationConfiguration
newRevocationConfiguration :: RevocationConfiguration
newRevocationConfiguration =
RevocationConfiguration'
{ $sel:crlConfiguration:RevocationConfiguration' :: Maybe CrlConfiguration
crlConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:ocspConfiguration:RevocationConfiguration' :: Maybe OcspConfiguration
ocspConfiguration = forall a. Maybe a
Prelude.Nothing
}
revocationConfiguration_crlConfiguration :: Lens.Lens' RevocationConfiguration (Prelude.Maybe CrlConfiguration)
revocationConfiguration_crlConfiguration :: Lens' RevocationConfiguration (Maybe CrlConfiguration)
revocationConfiguration_crlConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevocationConfiguration' {Maybe CrlConfiguration
crlConfiguration :: Maybe CrlConfiguration
$sel:crlConfiguration:RevocationConfiguration' :: RevocationConfiguration -> Maybe CrlConfiguration
crlConfiguration} -> Maybe CrlConfiguration
crlConfiguration) (\s :: RevocationConfiguration
s@RevocationConfiguration' {} Maybe CrlConfiguration
a -> RevocationConfiguration
s {$sel:crlConfiguration:RevocationConfiguration' :: Maybe CrlConfiguration
crlConfiguration = Maybe CrlConfiguration
a} :: RevocationConfiguration)
revocationConfiguration_ocspConfiguration :: Lens.Lens' RevocationConfiguration (Prelude.Maybe OcspConfiguration)
revocationConfiguration_ocspConfiguration :: Lens' RevocationConfiguration (Maybe OcspConfiguration)
revocationConfiguration_ocspConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevocationConfiguration' {Maybe OcspConfiguration
ocspConfiguration :: Maybe OcspConfiguration
$sel:ocspConfiguration:RevocationConfiguration' :: RevocationConfiguration -> Maybe OcspConfiguration
ocspConfiguration} -> Maybe OcspConfiguration
ocspConfiguration) (\s :: RevocationConfiguration
s@RevocationConfiguration' {} Maybe OcspConfiguration
a -> RevocationConfiguration
s {$sel:ocspConfiguration:RevocationConfiguration' :: Maybe OcspConfiguration
ocspConfiguration = Maybe OcspConfiguration
a} :: RevocationConfiguration)
instance Data.FromJSON RevocationConfiguration where
parseJSON :: Value -> Parser RevocationConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RevocationConfiguration"
( \Object
x ->
Maybe CrlConfiguration
-> Maybe OcspConfiguration -> RevocationConfiguration
RevocationConfiguration'
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
"CrlConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OcspConfiguration")
)
instance Prelude.Hashable RevocationConfiguration where
hashWithSalt :: Int -> RevocationConfiguration -> Int
hashWithSalt Int
_salt RevocationConfiguration' {Maybe OcspConfiguration
Maybe CrlConfiguration
ocspConfiguration :: Maybe OcspConfiguration
crlConfiguration :: Maybe CrlConfiguration
$sel:ocspConfiguration:RevocationConfiguration' :: RevocationConfiguration -> Maybe OcspConfiguration
$sel:crlConfiguration:RevocationConfiguration' :: RevocationConfiguration -> Maybe CrlConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CrlConfiguration
crlConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OcspConfiguration
ocspConfiguration
instance Prelude.NFData RevocationConfiguration where
rnf :: RevocationConfiguration -> ()
rnf RevocationConfiguration' {Maybe OcspConfiguration
Maybe CrlConfiguration
ocspConfiguration :: Maybe OcspConfiguration
crlConfiguration :: Maybe CrlConfiguration
$sel:ocspConfiguration:RevocationConfiguration' :: RevocationConfiguration -> Maybe OcspConfiguration
$sel:crlConfiguration:RevocationConfiguration' :: RevocationConfiguration -> Maybe CrlConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CrlConfiguration
crlConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OcspConfiguration
ocspConfiguration
instance Data.ToJSON RevocationConfiguration where
toJSON :: RevocationConfiguration -> Value
toJSON RevocationConfiguration' {Maybe OcspConfiguration
Maybe CrlConfiguration
ocspConfiguration :: Maybe OcspConfiguration
crlConfiguration :: Maybe CrlConfiguration
$sel:ocspConfiguration:RevocationConfiguration' :: RevocationConfiguration -> Maybe OcspConfiguration
$sel:crlConfiguration:RevocationConfiguration' :: RevocationConfiguration -> Maybe CrlConfiguration
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CrlConfiguration" 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 CrlConfiguration
crlConfiguration,
(Key
"OcspConfiguration" 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 OcspConfiguration
ocspConfiguration
]
)