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