{-# 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.Lens as Lens
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
(RevocationConfiguration -> RevocationConfiguration -> Bool)
-> (RevocationConfiguration -> RevocationConfiguration -> Bool)
-> Eq RevocationConfiguration
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]
(Int -> ReadS RevocationConfiguration)
-> ReadS [RevocationConfiguration]
-> ReadPrec RevocationConfiguration
-> ReadPrec [RevocationConfiguration]
-> Read 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
(Int -> RevocationConfiguration -> ShowS)
-> (RevocationConfiguration -> String)
-> ([RevocationConfiguration] -> ShowS)
-> Show RevocationConfiguration
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.
RevocationConfiguration -> Rep RevocationConfiguration x)
-> (forall x.
Rep RevocationConfiguration x -> RevocationConfiguration)
-> Generic RevocationConfiguration
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' :: Maybe CrlConfiguration
-> Maybe OcspConfiguration -> RevocationConfiguration
RevocationConfiguration'
{ $sel:crlConfiguration:RevocationConfiguration' :: Maybe CrlConfiguration
crlConfiguration =
Maybe CrlConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:ocspConfiguration:RevocationConfiguration' :: Maybe OcspConfiguration
ocspConfiguration = Maybe OcspConfiguration
forall a. Maybe a
Prelude.Nothing
}
revocationConfiguration_crlConfiguration :: Lens.Lens' RevocationConfiguration (Prelude.Maybe CrlConfiguration)
revocationConfiguration_crlConfiguration :: (Maybe CrlConfiguration -> f (Maybe CrlConfiguration))
-> RevocationConfiguration -> f RevocationConfiguration
revocationConfiguration_crlConfiguration = (RevocationConfiguration -> Maybe CrlConfiguration)
-> (RevocationConfiguration
-> Maybe CrlConfiguration -> RevocationConfiguration)
-> Lens
RevocationConfiguration
RevocationConfiguration
(Maybe CrlConfiguration)
(Maybe 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 :: (Maybe OcspConfiguration -> f (Maybe OcspConfiguration))
-> RevocationConfiguration -> f RevocationConfiguration
revocationConfiguration_ocspConfiguration = (RevocationConfiguration -> Maybe OcspConfiguration)
-> (RevocationConfiguration
-> Maybe OcspConfiguration -> RevocationConfiguration)
-> Lens
RevocationConfiguration
RevocationConfiguration
(Maybe OcspConfiguration)
(Maybe 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 Core.FromJSON RevocationConfiguration where
parseJSON :: Value -> Parser RevocationConfiguration
parseJSON =
String
-> (Object -> Parser RevocationConfiguration)
-> Value
-> Parser RevocationConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RevocationConfiguration"
( \Object
x ->
Maybe CrlConfiguration
-> Maybe OcspConfiguration -> RevocationConfiguration
RevocationConfiguration'
(Maybe CrlConfiguration
-> Maybe OcspConfiguration -> RevocationConfiguration)
-> Parser (Maybe CrlConfiguration)
-> Parser (Maybe OcspConfiguration -> RevocationConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CrlConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CrlConfiguration")
Parser (Maybe OcspConfiguration -> RevocationConfiguration)
-> Parser (Maybe OcspConfiguration)
-> Parser RevocationConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OcspConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OcspConfiguration")
)
instance Prelude.Hashable RevocationConfiguration
instance Prelude.NFData RevocationConfiguration
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CrlConfiguration" Text -> CrlConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CrlConfiguration -> Pair) -> Maybe CrlConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CrlConfiguration
crlConfiguration,
(Text
"OcspConfiguration" Text -> OcspConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(OcspConfiguration -> Pair)
-> Maybe OcspConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OcspConfiguration
ocspConfiguration
]
)