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