{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FunctionCode = FunctionCode'
{
FunctionCode -> Maybe Text
s3ObjectVersion :: Prelude.Maybe Prelude.Text,
FunctionCode -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
FunctionCode -> Maybe (Sensitive Base64)
zipFile :: Prelude.Maybe (Core.Sensitive Core.Base64),
FunctionCode -> Maybe Text
imageUri :: Prelude.Maybe Prelude.Text,
FunctionCode -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text
}
deriving (FunctionCode -> FunctionCode -> Bool
(FunctionCode -> FunctionCode -> Bool)
-> (FunctionCode -> FunctionCode -> Bool) -> Eq FunctionCode
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
(Int -> FunctionCode -> ShowS)
-> (FunctionCode -> String)
-> ([FunctionCode] -> ShowS)
-> Show FunctionCode
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. FunctionCode -> Rep FunctionCode x)
-> (forall x. Rep FunctionCode x -> FunctionCode)
-> Generic FunctionCode
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' :: Maybe Text
-> Maybe Text
-> Maybe (Sensitive Base64)
-> Maybe Text
-> Maybe Text
-> FunctionCode
FunctionCode'
{ $sel:s3ObjectVersion:FunctionCode' :: Maybe Text
s3ObjectVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Key:FunctionCode' :: Maybe Text
s3Key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:zipFile:FunctionCode' :: Maybe (Sensitive Base64)
zipFile = Maybe (Sensitive Base64)
forall a. Maybe a
Prelude.Nothing,
$sel:imageUri:FunctionCode' :: Maybe Text
imageUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:FunctionCode' :: Maybe Text
s3Bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
functionCode_s3ObjectVersion :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.Text)
functionCode_s3ObjectVersion :: (Maybe Text -> f (Maybe Text)) -> FunctionCode -> f FunctionCode
functionCode_s3ObjectVersion = (FunctionCode -> Maybe Text)
-> (FunctionCode -> Maybe Text -> FunctionCode)
-> Lens FunctionCode FunctionCode (Maybe Text) (Maybe Text)
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_s3Key :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.Text)
functionCode_s3Key :: (Maybe Text -> f (Maybe Text)) -> FunctionCode -> f FunctionCode
functionCode_s3Key = (FunctionCode -> Maybe Text)
-> (FunctionCode -> Maybe Text -> FunctionCode)
-> Lens FunctionCode FunctionCode (Maybe Text) (Maybe Text)
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_zipFile :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.ByteString)
functionCode_zipFile :: (Maybe ByteString -> f (Maybe ByteString))
-> FunctionCode -> f FunctionCode
functionCode_zipFile = (FunctionCode -> Maybe (Sensitive Base64))
-> (FunctionCode -> Maybe (Sensitive Base64) -> FunctionCode)
-> Lens
FunctionCode
FunctionCode
(Maybe (Sensitive Base64))
(Maybe (Sensitive Base64))
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) ((Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> FunctionCode -> f FunctionCode)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe (Sensitive Base64) -> f (Maybe (Sensitive Base64)))
-> (Maybe ByteString -> f (Maybe ByteString))
-> FunctionCode
-> f FunctionCode
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Base64) (Sensitive Base64) ByteString ByteString
-> Iso
(Maybe (Sensitive Base64))
(Maybe (Sensitive Base64))
(Maybe ByteString)
(Maybe ByteString)
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 (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
ByteString
ByteString
(Sensitive Base64)
(Identity (Sensitive Base64))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange ByteString ByteString Base64 (Identity Base64)
-> Exchange
ByteString
ByteString
(Sensitive Base64)
(Identity (Sensitive Base64)))
-> (Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64))
-> AnIso
(Sensitive Base64) (Sensitive Base64) ByteString ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange ByteString ByteString ByteString (Identity ByteString)
-> Exchange ByteString ByteString Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64)
functionCode_imageUri :: Lens.Lens' FunctionCode (Prelude.Maybe Prelude.Text)
functionCode_imageUri :: (Maybe Text -> f (Maybe Text)) -> FunctionCode -> f FunctionCode
functionCode_imageUri = (FunctionCode -> Maybe Text)
-> (FunctionCode -> Maybe Text -> FunctionCode)
-> Lens FunctionCode FunctionCode (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> FunctionCode -> f FunctionCode
functionCode_s3Bucket = (FunctionCode -> Maybe Text)
-> (FunctionCode -> Maybe Text -> FunctionCode)
-> Lens FunctionCode FunctionCode (Maybe Text) (Maybe Text)
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)
instance Prelude.Hashable FunctionCode
instance Prelude.NFData FunctionCode
instance Core.ToJSON FunctionCode where
toJSON :: FunctionCode -> Value
toJSON FunctionCode' {Maybe Text
Maybe (Sensitive Base64)
s3Bucket :: Maybe Text
imageUri :: Maybe Text
zipFile :: Maybe (Sensitive Base64)
s3Key :: Maybe Text
s3ObjectVersion :: Maybe Text
$sel:s3Bucket:FunctionCode' :: FunctionCode -> Maybe Text
$sel:imageUri:FunctionCode' :: FunctionCode -> Maybe Text
$sel:zipFile:FunctionCode' :: FunctionCode -> Maybe (Sensitive Base64)
$sel:s3Key:FunctionCode' :: FunctionCode -> Maybe Text
$sel:s3ObjectVersion:FunctionCode' :: FunctionCode -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"S3ObjectVersion" 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
s3ObjectVersion,
(Text
"S3Key" 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
s3Key,
(Text
"ZipFile" Text -> Sensitive Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Base64 -> Pair)
-> Maybe (Sensitive Base64) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Base64)
zipFile,
(Text
"ImageUri" 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
imageUri,
(Text
"S3Bucket" 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
s3Bucket
]
)