module Network.AWS.Lambda.UpdateFunctionCode
(
UpdateFunctionCode
, updateFunctionCode
, ufc1FunctionName
, ufc1S3Bucket
, ufc1S3Key
, ufc1S3ObjectVersion
, ufc1ZipFile
, UpdateFunctionCodeResponse
, updateFunctionCodeResponse
, ufcrCodeSize
, ufcrDescription
, ufcrFunctionArn
, ufcrFunctionName
, ufcrHandler
, ufcrLastModified
, ufcrMemorySize
, ufcrRole
, ufcrRuntime
, ufcrTimeout
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.RestJSON
import Network.AWS.Lambda.Types
import qualified GHC.Exts
data UpdateFunctionCode = UpdateFunctionCode
{ _ufc1FunctionName :: Text
, _ufc1S3Bucket :: Maybe Text
, _ufc1S3Key :: Maybe Text
, _ufc1S3ObjectVersion :: Maybe Text
, _ufc1ZipFile :: Maybe Base64
} deriving (Eq, Read, Show)
updateFunctionCode :: Text
-> UpdateFunctionCode
updateFunctionCode p1 = UpdateFunctionCode
{ _ufc1FunctionName = p1
, _ufc1ZipFile = Nothing
, _ufc1S3Bucket = Nothing
, _ufc1S3Key = Nothing
, _ufc1S3ObjectVersion = Nothing
}
ufc1FunctionName :: Lens' UpdateFunctionCode Text
ufc1FunctionName = lens _ufc1FunctionName (\s a -> s { _ufc1FunctionName = a })
ufc1S3Bucket :: Lens' UpdateFunctionCode (Maybe Text)
ufc1S3Bucket = lens _ufc1S3Bucket (\s a -> s { _ufc1S3Bucket = a })
ufc1S3Key :: Lens' UpdateFunctionCode (Maybe Text)
ufc1S3Key = lens _ufc1S3Key (\s a -> s { _ufc1S3Key = a })
ufc1S3ObjectVersion :: Lens' UpdateFunctionCode (Maybe Text)
ufc1S3ObjectVersion =
lens _ufc1S3ObjectVersion (\s a -> s { _ufc1S3ObjectVersion = a })
ufc1ZipFile :: Lens' UpdateFunctionCode (Maybe Base64)
ufc1ZipFile = lens _ufc1ZipFile (\s a -> s { _ufc1ZipFile = a })
data UpdateFunctionCodeResponse = UpdateFunctionCodeResponse
{ _ufcrCodeSize :: Maybe Integer
, _ufcrDescription :: Maybe Text
, _ufcrFunctionArn :: Maybe Text
, _ufcrFunctionName :: Maybe Text
, _ufcrHandler :: Maybe Text
, _ufcrLastModified :: Maybe Text
, _ufcrMemorySize :: Maybe Nat
, _ufcrRole :: Maybe Text
, _ufcrRuntime :: Maybe Runtime
, _ufcrTimeout :: Maybe Nat
} deriving (Eq, Read, Show)
updateFunctionCodeResponse :: UpdateFunctionCodeResponse
updateFunctionCodeResponse = UpdateFunctionCodeResponse
{ _ufcrFunctionName = Nothing
, _ufcrFunctionArn = Nothing
, _ufcrRuntime = Nothing
, _ufcrRole = Nothing
, _ufcrHandler = Nothing
, _ufcrCodeSize = Nothing
, _ufcrDescription = Nothing
, _ufcrTimeout = Nothing
, _ufcrMemorySize = Nothing
, _ufcrLastModified = Nothing
}
ufcrCodeSize :: Lens' UpdateFunctionCodeResponse (Maybe Integer)
ufcrCodeSize = lens _ufcrCodeSize (\s a -> s { _ufcrCodeSize = a })
ufcrDescription :: Lens' UpdateFunctionCodeResponse (Maybe Text)
ufcrDescription = lens _ufcrDescription (\s a -> s { _ufcrDescription = a })
ufcrFunctionArn :: Lens' UpdateFunctionCodeResponse (Maybe Text)
ufcrFunctionArn = lens _ufcrFunctionArn (\s a -> s { _ufcrFunctionArn = a })
ufcrFunctionName :: Lens' UpdateFunctionCodeResponse (Maybe Text)
ufcrFunctionName = lens _ufcrFunctionName (\s a -> s { _ufcrFunctionName = a })
ufcrHandler :: Lens' UpdateFunctionCodeResponse (Maybe Text)
ufcrHandler = lens _ufcrHandler (\s a -> s { _ufcrHandler = a })
ufcrLastModified :: Lens' UpdateFunctionCodeResponse (Maybe Text)
ufcrLastModified = lens _ufcrLastModified (\s a -> s { _ufcrLastModified = a })
ufcrMemorySize :: Lens' UpdateFunctionCodeResponse (Maybe Natural)
ufcrMemorySize = lens _ufcrMemorySize (\s a -> s { _ufcrMemorySize = a }) . mapping _Nat
ufcrRole :: Lens' UpdateFunctionCodeResponse (Maybe Text)
ufcrRole = lens _ufcrRole (\s a -> s { _ufcrRole = a })
ufcrRuntime :: Lens' UpdateFunctionCodeResponse (Maybe Runtime)
ufcrRuntime = lens _ufcrRuntime (\s a -> s { _ufcrRuntime = a })
ufcrTimeout :: Lens' UpdateFunctionCodeResponse (Maybe Natural)
ufcrTimeout = lens _ufcrTimeout (\s a -> s { _ufcrTimeout = a }) . mapping _Nat
instance ToPath UpdateFunctionCode where
toPath UpdateFunctionCode{..} = mconcat
[ "/2015-03-31/functions/"
, toText _ufc1FunctionName
, "/versions/HEAD/code"
]
instance ToQuery UpdateFunctionCode where
toQuery = const mempty
instance ToHeaders UpdateFunctionCode
instance ToJSON UpdateFunctionCode where
toJSON UpdateFunctionCode{..} = object
[ "ZipFile" .= _ufc1ZipFile
, "S3Bucket" .= _ufc1S3Bucket
, "S3Key" .= _ufc1S3Key
, "S3ObjectVersion" .= _ufc1S3ObjectVersion
]
instance AWSRequest UpdateFunctionCode where
type Sv UpdateFunctionCode = Lambda
type Rs UpdateFunctionCode = UpdateFunctionCodeResponse
request = put
response = jsonResponse
instance FromJSON UpdateFunctionCodeResponse where
parseJSON = withObject "UpdateFunctionCodeResponse" $ \o -> UpdateFunctionCodeResponse
<$> o .:? "CodeSize"
<*> o .:? "Description"
<*> o .:? "FunctionArn"
<*> o .:? "FunctionName"
<*> o .:? "Handler"
<*> o .:? "LastModified"
<*> o .:? "MemorySize"
<*> o .:? "Role"
<*> o .:? "Runtime"
<*> o .:? "Timeout"