module Network.AWS.Lambda.UpdateFunctionConfiguration
(
UpdateFunctionConfiguration
, updateFunctionConfiguration
, ufcDescription
, ufcFunctionName
, ufcHandler
, ufcMemorySize
, ufcRole
, ufcTimeout
, UpdateFunctionConfigurationResponse
, updateFunctionConfigurationResponse
, ufcr1CodeSize
, ufcr1Description
, ufcr1FunctionArn
, ufcr1FunctionName
, ufcr1Handler
, ufcr1LastModified
, ufcr1MemorySize
, ufcr1Role
, ufcr1Runtime
, ufcr1Timeout
) 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 UpdateFunctionConfiguration = UpdateFunctionConfiguration
{ _ufcDescription :: Maybe Text
, _ufcFunctionName :: Text
, _ufcHandler :: Maybe Text
, _ufcMemorySize :: Maybe Nat
, _ufcRole :: Maybe Text
, _ufcTimeout :: Maybe Nat
} deriving (Eq, Ord, Read, Show)
updateFunctionConfiguration :: Text
-> UpdateFunctionConfiguration
updateFunctionConfiguration p1 = UpdateFunctionConfiguration
{ _ufcFunctionName = p1
, _ufcRole = Nothing
, _ufcHandler = Nothing
, _ufcDescription = Nothing
, _ufcTimeout = Nothing
, _ufcMemorySize = Nothing
}
ufcDescription :: Lens' UpdateFunctionConfiguration (Maybe Text)
ufcDescription = lens _ufcDescription (\s a -> s { _ufcDescription = a })
ufcFunctionName :: Lens' UpdateFunctionConfiguration Text
ufcFunctionName = lens _ufcFunctionName (\s a -> s { _ufcFunctionName = a })
ufcHandler :: Lens' UpdateFunctionConfiguration (Maybe Text)
ufcHandler = lens _ufcHandler (\s a -> s { _ufcHandler = a })
ufcMemorySize :: Lens' UpdateFunctionConfiguration (Maybe Natural)
ufcMemorySize = lens _ufcMemorySize (\s a -> s { _ufcMemorySize = a }) . mapping _Nat
ufcRole :: Lens' UpdateFunctionConfiguration (Maybe Text)
ufcRole = lens _ufcRole (\s a -> s { _ufcRole = a })
ufcTimeout :: Lens' UpdateFunctionConfiguration (Maybe Natural)
ufcTimeout = lens _ufcTimeout (\s a -> s { _ufcTimeout = a }) . mapping _Nat
data UpdateFunctionConfigurationResponse = UpdateFunctionConfigurationResponse
{ _ufcr1CodeSize :: Maybe Integer
, _ufcr1Description :: Maybe Text
, _ufcr1FunctionArn :: Maybe Text
, _ufcr1FunctionName :: Maybe Text
, _ufcr1Handler :: Maybe Text
, _ufcr1LastModified :: Maybe Text
, _ufcr1MemorySize :: Maybe Nat
, _ufcr1Role :: Maybe Text
, _ufcr1Runtime :: Maybe Runtime
, _ufcr1Timeout :: Maybe Nat
} deriving (Eq, Read, Show)
updateFunctionConfigurationResponse :: UpdateFunctionConfigurationResponse
updateFunctionConfigurationResponse = UpdateFunctionConfigurationResponse
{ _ufcr1FunctionName = Nothing
, _ufcr1FunctionArn = Nothing
, _ufcr1Runtime = Nothing
, _ufcr1Role = Nothing
, _ufcr1Handler = Nothing
, _ufcr1CodeSize = Nothing
, _ufcr1Description = Nothing
, _ufcr1Timeout = Nothing
, _ufcr1MemorySize = Nothing
, _ufcr1LastModified = Nothing
}
ufcr1CodeSize :: Lens' UpdateFunctionConfigurationResponse (Maybe Integer)
ufcr1CodeSize = lens _ufcr1CodeSize (\s a -> s { _ufcr1CodeSize = a })
ufcr1Description :: Lens' UpdateFunctionConfigurationResponse (Maybe Text)
ufcr1Description = lens _ufcr1Description (\s a -> s { _ufcr1Description = a })
ufcr1FunctionArn :: Lens' UpdateFunctionConfigurationResponse (Maybe Text)
ufcr1FunctionArn = lens _ufcr1FunctionArn (\s a -> s { _ufcr1FunctionArn = a })
ufcr1FunctionName :: Lens' UpdateFunctionConfigurationResponse (Maybe Text)
ufcr1FunctionName =
lens _ufcr1FunctionName (\s a -> s { _ufcr1FunctionName = a })
ufcr1Handler :: Lens' UpdateFunctionConfigurationResponse (Maybe Text)
ufcr1Handler = lens _ufcr1Handler (\s a -> s { _ufcr1Handler = a })
ufcr1LastModified :: Lens' UpdateFunctionConfigurationResponse (Maybe Text)
ufcr1LastModified =
lens _ufcr1LastModified (\s a -> s { _ufcr1LastModified = a })
ufcr1MemorySize :: Lens' UpdateFunctionConfigurationResponse (Maybe Natural)
ufcr1MemorySize = lens _ufcr1MemorySize (\s a -> s { _ufcr1MemorySize = a }) . mapping _Nat
ufcr1Role :: Lens' UpdateFunctionConfigurationResponse (Maybe Text)
ufcr1Role = lens _ufcr1Role (\s a -> s { _ufcr1Role = a })
ufcr1Runtime :: Lens' UpdateFunctionConfigurationResponse (Maybe Runtime)
ufcr1Runtime = lens _ufcr1Runtime (\s a -> s { _ufcr1Runtime = a })
ufcr1Timeout :: Lens' UpdateFunctionConfigurationResponse (Maybe Natural)
ufcr1Timeout = lens _ufcr1Timeout (\s a -> s { _ufcr1Timeout = a }) . mapping _Nat
instance ToPath UpdateFunctionConfiguration where
toPath UpdateFunctionConfiguration{..} = mconcat
[ "/2015-03-31/functions/"
, toText _ufcFunctionName
, "/versions/HEAD/configuration"
]
instance ToQuery UpdateFunctionConfiguration where
toQuery = const mempty
instance ToHeaders UpdateFunctionConfiguration
instance ToJSON UpdateFunctionConfiguration where
toJSON UpdateFunctionConfiguration{..} = object
[ "Role" .= _ufcRole
, "Handler" .= _ufcHandler
, "Description" .= _ufcDescription
, "Timeout" .= _ufcTimeout
, "MemorySize" .= _ufcMemorySize
]
instance AWSRequest UpdateFunctionConfiguration where
type Sv UpdateFunctionConfiguration = Lambda
type Rs UpdateFunctionConfiguration = UpdateFunctionConfigurationResponse
request = put
response = jsonResponse
instance FromJSON UpdateFunctionConfigurationResponse where
parseJSON = withObject "UpdateFunctionConfigurationResponse" $ \o -> UpdateFunctionConfigurationResponse
<$> o .:? "CodeSize"
<*> o .:? "Description"
<*> o .:? "FunctionArn"
<*> o .:? "FunctionName"
<*> o .:? "Handler"
<*> o .:? "LastModified"
<*> o .:? "MemorySize"
<*> o .:? "Role"
<*> o .:? "Runtime"
<*> o .:? "Timeout"