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