{-# 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.FunctionCode 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 FunctionCode = FunctionCode'
{
FunctionCode -> Maybe Text
imageUri :: Prelude.Maybe Prelude.Text,
FunctionCode -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
FunctionCode -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
FunctionCode -> Maybe Text
s3ObjectVersion :: Prelude.Maybe Prelude.Text,
FunctionCode -> Maybe (Sensitive Base64)
zipFile :: Prelude.Maybe (Data.Sensitive Data.Base64)
}
deriving (FunctionCode -> FunctionCode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FunctionCode -> FunctionCode -> Bool
$c/= :: FunctionCode -> FunctionCode -> Bool
== :: FunctionCode -> FunctionCode -> Bool
$c== :: FunctionCode -> FunctionCode -> Bool
Prelude.Eq, Int -> FunctionCode -> ShowS
[FunctionCode] -> ShowS
FunctionCode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FunctionCode] -> ShowS
$cshowList :: [FunctionCode] -> ShowS
show :: FunctionCode -> String
$cshow :: FunctionCode -> String
showsPrec :: Int -> FunctionCode -> ShowS
$cshowsPrec :: Int -> FunctionCode -> ShowS
Prelude.Show, forall x. Rep FunctionCode x -> FunctionCode
forall x. FunctionCode -> Rep FunctionCode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FunctionCode x -> FunctionCode
$cfrom :: forall x. FunctionCode -> Rep FunctionCode x
Prelude.Generic)
newFunctionCode ::
FunctionCode
newFunctionCode :: FunctionCode
newFunctionCode =
FunctionCode'
{ $sel:imageUri:FunctionCode' :: Maybe Text
imageUri = forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:FunctionCode' :: Maybe Text
s3Bucket = forall a. Maybe a
Prelude.Nothing,
$sel:s3Key:FunctionCode' :: Maybe Text
s3Key = forall a. Maybe a
Prelude.Nothing,
$sel:s3ObjectVersion:FunctionCode' :: Maybe Text
s3ObjectVersion = forall a. Maybe a
Prelude.Nothing,
$sel:zipFile:FunctionCode' :: Maybe (Sensitive Base64)
zipFile = forall a. Maybe a
Prelude.Nothing
}
functionCode_imageUri :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.Text)
functionCode_imageUri :: Lens' FunctionCode (Maybe Text)
functionCode_imageUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionCode' {Maybe Text
imageUri :: Maybe Text
$sel:imageUri:FunctionCode' :: FunctionCode -> Maybe Text
imageUri} -> Maybe Text
imageUri) (\s :: FunctionCode
s@FunctionCode' {} Maybe Text
a -> FunctionCode
s {$sel:imageUri:FunctionCode' :: Maybe Text
imageUri = Maybe Text
a} :: FunctionCode)
functionCode_s3Bucket :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.Text)
functionCode_s3Bucket :: Lens' FunctionCode (Maybe Text)
functionCode_s3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionCode' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:FunctionCode' :: FunctionCode -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: FunctionCode
s@FunctionCode' {} Maybe Text
a -> FunctionCode
s {$sel:s3Bucket:FunctionCode' :: Maybe Text
s3Bucket = Maybe Text
a} :: FunctionCode)
functionCode_s3Key :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.Text)
functionCode_s3Key :: Lens' FunctionCode (Maybe Text)
functionCode_s3Key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionCode' {Maybe Text
s3Key :: Maybe Text
$sel:s3Key:FunctionCode' :: FunctionCode -> Maybe Text
s3Key} -> Maybe Text
s3Key) (\s :: FunctionCode
s@FunctionCode' {} Maybe Text
a -> FunctionCode
s {$sel:s3Key:FunctionCode' :: Maybe Text
s3Key = Maybe Text
a} :: FunctionCode)
functionCode_s3ObjectVersion :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.Text)
functionCode_s3ObjectVersion :: Lens' FunctionCode (Maybe Text)
functionCode_s3ObjectVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionCode' {Maybe Text
s3ObjectVersion :: Maybe Text
$sel:s3ObjectVersion:FunctionCode' :: FunctionCode -> Maybe Text
s3ObjectVersion} -> Maybe Text
s3ObjectVersion) (\s :: FunctionCode
s@FunctionCode' {} Maybe Text
a -> FunctionCode
s {$sel:s3ObjectVersion:FunctionCode' :: Maybe Text
s3ObjectVersion = Maybe Text
a} :: FunctionCode)
functionCode_zipFile :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.ByteString)
functionCode_zipFile :: Lens' FunctionCode (Maybe ByteString)
functionCode_zipFile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionCode' {Maybe (Sensitive Base64)
zipFile :: Maybe (Sensitive Base64)
$sel:zipFile:FunctionCode' :: FunctionCode -> Maybe (Sensitive Base64)
zipFile} -> Maybe (Sensitive Base64)
zipFile) (\s :: FunctionCode
s@FunctionCode' {} Maybe (Sensitive Base64)
a -> FunctionCode
s {$sel:zipFile:FunctionCode' :: Maybe (Sensitive Base64)
zipFile = Maybe (Sensitive Base64)
a} :: FunctionCode) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping (forall a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Iso' Base64 ByteString
Data._Base64)
instance Prelude.Hashable FunctionCode where
hashWithSalt :: Int -> FunctionCode -> Int
hashWithSalt Int
_salt FunctionCode' {Maybe Text
Maybe (Sensitive Base64)
zipFile :: Maybe (Sensitive Base64)
s3ObjectVersion :: Maybe Text
s3Key :: Maybe Text
s3Bucket :: Maybe Text
imageUri :: Maybe Text
$sel:zipFile:FunctionCode' :: FunctionCode -> Maybe (Sensitive Base64)
$sel:s3ObjectVersion:FunctionCode' :: FunctionCode -> Maybe Text
$sel:s3Key:FunctionCode' :: FunctionCode -> Maybe Text
$sel:s3Bucket:FunctionCode' :: FunctionCode -> Maybe Text
$sel:imageUri:FunctionCode' :: FunctionCode -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageUri
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Bucket
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3ObjectVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Base64)
zipFile
instance Prelude.NFData FunctionCode where
rnf :: FunctionCode -> ()
rnf FunctionCode' {Maybe Text
Maybe (Sensitive Base64)
zipFile :: Maybe (Sensitive Base64)
s3ObjectVersion :: Maybe Text
s3Key :: Maybe Text
s3Bucket :: Maybe Text
imageUri :: Maybe Text
$sel:zipFile:FunctionCode' :: FunctionCode -> Maybe (Sensitive Base64)
$sel:s3ObjectVersion:FunctionCode' :: FunctionCode -> Maybe Text
$sel:s3Key:FunctionCode' :: FunctionCode -> Maybe Text
$sel:s3Bucket:FunctionCode' :: FunctionCode -> Maybe Text
$sel:imageUri:FunctionCode' :: FunctionCode -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageUri
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Bucket
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3ObjectVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Base64)
zipFile
instance Data.ToJSON FunctionCode where
toJSON :: FunctionCode -> Value
toJSON FunctionCode' {Maybe Text
Maybe (Sensitive Base64)
zipFile :: Maybe (Sensitive Base64)
s3ObjectVersion :: Maybe Text
s3Key :: Maybe Text
s3Bucket :: Maybe Text
imageUri :: Maybe Text
$sel:zipFile:FunctionCode' :: FunctionCode -> Maybe (Sensitive Base64)
$sel:s3ObjectVersion:FunctionCode' :: FunctionCode -> Maybe Text
$sel:s3Key:FunctionCode' :: FunctionCode -> Maybe Text
$sel:s3Bucket:FunctionCode' :: FunctionCode -> Maybe Text
$sel:imageUri:FunctionCode' :: FunctionCode -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ImageUri" 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
imageUri,
(Key
"S3Bucket" 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
s3Bucket,
(Key
"S3Key" 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
s3Key,
(Key
"S3ObjectVersion" 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
s3ObjectVersion,
(Key
"ZipFile" 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 (Sensitive Base64)
zipFile
]
)