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