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