{-# 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.CustomExtension 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 CustomExtension = CustomExtension'
{
CustomExtension -> Maybe Bool
critical :: Prelude.Maybe Prelude.Bool,
CustomExtension -> Text
objectIdentifier :: Prelude.Text,
CustomExtension -> Text
value :: Prelude.Text
}
deriving (CustomExtension -> CustomExtension -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomExtension -> CustomExtension -> Bool
$c/= :: CustomExtension -> CustomExtension -> Bool
== :: CustomExtension -> CustomExtension -> Bool
$c== :: CustomExtension -> CustomExtension -> Bool
Prelude.Eq, ReadPrec [CustomExtension]
ReadPrec CustomExtension
Int -> ReadS CustomExtension
ReadS [CustomExtension]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomExtension]
$creadListPrec :: ReadPrec [CustomExtension]
readPrec :: ReadPrec CustomExtension
$creadPrec :: ReadPrec CustomExtension
readList :: ReadS [CustomExtension]
$creadList :: ReadS [CustomExtension]
readsPrec :: Int -> ReadS CustomExtension
$creadsPrec :: Int -> ReadS CustomExtension
Prelude.Read, Int -> CustomExtension -> ShowS
[CustomExtension] -> ShowS
CustomExtension -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomExtension] -> ShowS
$cshowList :: [CustomExtension] -> ShowS
show :: CustomExtension -> String
$cshow :: CustomExtension -> String
showsPrec :: Int -> CustomExtension -> ShowS
$cshowsPrec :: Int -> CustomExtension -> ShowS
Prelude.Show, forall x. Rep CustomExtension x -> CustomExtension
forall x. CustomExtension -> Rep CustomExtension x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CustomExtension x -> CustomExtension
$cfrom :: forall x. CustomExtension -> Rep CustomExtension x
Prelude.Generic)
newCustomExtension ::
Prelude.Text ->
Prelude.Text ->
CustomExtension
newCustomExtension :: Text -> Text -> CustomExtension
newCustomExtension Text
pObjectIdentifier_ Text
pValue_ =
CustomExtension'
{ $sel:critical:CustomExtension' :: Maybe Bool
critical = forall a. Maybe a
Prelude.Nothing,
$sel:objectIdentifier:CustomExtension' :: Text
objectIdentifier = Text
pObjectIdentifier_,
$sel:value:CustomExtension' :: Text
value = Text
pValue_
}
customExtension_critical :: Lens.Lens' CustomExtension (Prelude.Maybe Prelude.Bool)
customExtension_critical :: Lens' CustomExtension (Maybe Bool)
customExtension_critical = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomExtension' {Maybe Bool
critical :: Maybe Bool
$sel:critical:CustomExtension' :: CustomExtension -> Maybe Bool
critical} -> Maybe Bool
critical) (\s :: CustomExtension
s@CustomExtension' {} Maybe Bool
a -> CustomExtension
s {$sel:critical:CustomExtension' :: Maybe Bool
critical = Maybe Bool
a} :: CustomExtension)
customExtension_objectIdentifier :: Lens.Lens' CustomExtension Prelude.Text
customExtension_objectIdentifier :: Lens' CustomExtension Text
customExtension_objectIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomExtension' {Text
objectIdentifier :: Text
$sel:objectIdentifier:CustomExtension' :: CustomExtension -> Text
objectIdentifier} -> Text
objectIdentifier) (\s :: CustomExtension
s@CustomExtension' {} Text
a -> CustomExtension
s {$sel:objectIdentifier:CustomExtension' :: Text
objectIdentifier = Text
a} :: CustomExtension)
customExtension_value :: Lens.Lens' CustomExtension Prelude.Text
customExtension_value :: Lens' CustomExtension Text
customExtension_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomExtension' {Text
value :: Text
$sel:value:CustomExtension' :: CustomExtension -> Text
value} -> Text
value) (\s :: CustomExtension
s@CustomExtension' {} Text
a -> CustomExtension
s {$sel:value:CustomExtension' :: Text
value = Text
a} :: CustomExtension)
instance Prelude.Hashable CustomExtension where
hashWithSalt :: Int -> CustomExtension -> Int
hashWithSalt Int
_salt CustomExtension' {Maybe Bool
Text
value :: Text
objectIdentifier :: Text
critical :: Maybe Bool
$sel:value:CustomExtension' :: CustomExtension -> Text
$sel:objectIdentifier:CustomExtension' :: CustomExtension -> Text
$sel:critical:CustomExtension' :: CustomExtension -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
critical
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
objectIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value
instance Prelude.NFData CustomExtension where
rnf :: CustomExtension -> ()
rnf CustomExtension' {Maybe Bool
Text
value :: Text
objectIdentifier :: Text
critical :: Maybe Bool
$sel:value:CustomExtension' :: CustomExtension -> Text
$sel:objectIdentifier:CustomExtension' :: CustomExtension -> Text
$sel:critical:CustomExtension' :: CustomExtension -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
critical
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
objectIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
value
instance Data.ToJSON CustomExtension where
toJSON :: CustomExtension -> Value
toJSON CustomExtension' {Maybe Bool
Text
value :: Text
objectIdentifier :: Text
critical :: Maybe Bool
$sel:value:CustomExtension' :: CustomExtension -> Text
$sel:objectIdentifier:CustomExtension' :: CustomExtension -> Text
$sel:critical:CustomExtension' :: CustomExtension -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Critical" 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 Bool
critical,
forall a. a -> Maybe a
Prelude.Just
(Key
"ObjectIdentifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
objectIdentifier),
forall a. a -> Maybe a
Prelude.Just (Key
"Value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
value)
]
)