{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Lambda.UpdateFunctionEventInvokeConfig
(
UpdateFunctionEventInvokeConfig (..),
newUpdateFunctionEventInvokeConfig,
updateFunctionEventInvokeConfig_maximumEventAgeInSeconds,
updateFunctionEventInvokeConfig_maximumRetryAttempts,
updateFunctionEventInvokeConfig_qualifier,
updateFunctionEventInvokeConfig_destinationConfig,
updateFunctionEventInvokeConfig_functionName,
FunctionEventInvokeConfig (..),
newFunctionEventInvokeConfig,
functionEventInvokeConfig_functionArn,
functionEventInvokeConfig_maximumEventAgeInSeconds,
functionEventInvokeConfig_maximumRetryAttempts,
functionEventInvokeConfig_lastModified,
functionEventInvokeConfig_destinationConfig,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Lambda.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateFunctionEventInvokeConfig = UpdateFunctionEventInvokeConfig'
{
UpdateFunctionEventInvokeConfig -> Maybe Natural
maximumEventAgeInSeconds :: Prelude.Maybe Prelude.Natural,
UpdateFunctionEventInvokeConfig -> Maybe Natural
maximumRetryAttempts :: Prelude.Maybe Prelude.Natural,
UpdateFunctionEventInvokeConfig -> Maybe Text
qualifier :: Prelude.Maybe Prelude.Text,
UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
UpdateFunctionEventInvokeConfig -> Text
functionName :: Prelude.Text
}
deriving (UpdateFunctionEventInvokeConfig
-> UpdateFunctionEventInvokeConfig -> Bool
(UpdateFunctionEventInvokeConfig
-> UpdateFunctionEventInvokeConfig -> Bool)
-> (UpdateFunctionEventInvokeConfig
-> UpdateFunctionEventInvokeConfig -> Bool)
-> Eq UpdateFunctionEventInvokeConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFunctionEventInvokeConfig
-> UpdateFunctionEventInvokeConfig -> Bool
$c/= :: UpdateFunctionEventInvokeConfig
-> UpdateFunctionEventInvokeConfig -> Bool
== :: UpdateFunctionEventInvokeConfig
-> UpdateFunctionEventInvokeConfig -> Bool
$c== :: UpdateFunctionEventInvokeConfig
-> UpdateFunctionEventInvokeConfig -> Bool
Prelude.Eq, ReadPrec [UpdateFunctionEventInvokeConfig]
ReadPrec UpdateFunctionEventInvokeConfig
Int -> ReadS UpdateFunctionEventInvokeConfig
ReadS [UpdateFunctionEventInvokeConfig]
(Int -> ReadS UpdateFunctionEventInvokeConfig)
-> ReadS [UpdateFunctionEventInvokeConfig]
-> ReadPrec UpdateFunctionEventInvokeConfig
-> ReadPrec [UpdateFunctionEventInvokeConfig]
-> Read UpdateFunctionEventInvokeConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFunctionEventInvokeConfig]
$creadListPrec :: ReadPrec [UpdateFunctionEventInvokeConfig]
readPrec :: ReadPrec UpdateFunctionEventInvokeConfig
$creadPrec :: ReadPrec UpdateFunctionEventInvokeConfig
readList :: ReadS [UpdateFunctionEventInvokeConfig]
$creadList :: ReadS [UpdateFunctionEventInvokeConfig]
readsPrec :: Int -> ReadS UpdateFunctionEventInvokeConfig
$creadsPrec :: Int -> ReadS UpdateFunctionEventInvokeConfig
Prelude.Read, Int -> UpdateFunctionEventInvokeConfig -> ShowS
[UpdateFunctionEventInvokeConfig] -> ShowS
UpdateFunctionEventInvokeConfig -> String
(Int -> UpdateFunctionEventInvokeConfig -> ShowS)
-> (UpdateFunctionEventInvokeConfig -> String)
-> ([UpdateFunctionEventInvokeConfig] -> ShowS)
-> Show UpdateFunctionEventInvokeConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFunctionEventInvokeConfig] -> ShowS
$cshowList :: [UpdateFunctionEventInvokeConfig] -> ShowS
show :: UpdateFunctionEventInvokeConfig -> String
$cshow :: UpdateFunctionEventInvokeConfig -> String
showsPrec :: Int -> UpdateFunctionEventInvokeConfig -> ShowS
$cshowsPrec :: Int -> UpdateFunctionEventInvokeConfig -> ShowS
Prelude.Show, (forall x.
UpdateFunctionEventInvokeConfig
-> Rep UpdateFunctionEventInvokeConfig x)
-> (forall x.
Rep UpdateFunctionEventInvokeConfig x
-> UpdateFunctionEventInvokeConfig)
-> Generic UpdateFunctionEventInvokeConfig
forall x.
Rep UpdateFunctionEventInvokeConfig x
-> UpdateFunctionEventInvokeConfig
forall x.
UpdateFunctionEventInvokeConfig
-> Rep UpdateFunctionEventInvokeConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFunctionEventInvokeConfig x
-> UpdateFunctionEventInvokeConfig
$cfrom :: forall x.
UpdateFunctionEventInvokeConfig
-> Rep UpdateFunctionEventInvokeConfig x
Prelude.Generic)
newUpdateFunctionEventInvokeConfig ::
Prelude.Text ->
UpdateFunctionEventInvokeConfig
newUpdateFunctionEventInvokeConfig :: Text -> UpdateFunctionEventInvokeConfig
newUpdateFunctionEventInvokeConfig Text
pFunctionName_ =
UpdateFunctionEventInvokeConfig' :: Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe DestinationConfig
-> Text
-> UpdateFunctionEventInvokeConfig
UpdateFunctionEventInvokeConfig'
{ $sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: Maybe Natural
maximumEventAgeInSeconds =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: Maybe Natural
maximumRetryAttempts = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: Maybe Text
qualifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: Maybe DestinationConfig
destinationConfig = Maybe DestinationConfig
forall a. Maybe a
Prelude.Nothing,
$sel:functionName:UpdateFunctionEventInvokeConfig' :: Text
functionName = Text
pFunctionName_
}
updateFunctionEventInvokeConfig_maximumEventAgeInSeconds :: Lens.Lens' UpdateFunctionEventInvokeConfig (Prelude.Maybe Prelude.Natural)
updateFunctionEventInvokeConfig_maximumEventAgeInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> UpdateFunctionEventInvokeConfig
-> f UpdateFunctionEventInvokeConfig
updateFunctionEventInvokeConfig_maximumEventAgeInSeconds = (UpdateFunctionEventInvokeConfig -> Maybe Natural)
-> (UpdateFunctionEventInvokeConfig
-> Maybe Natural -> UpdateFunctionEventInvokeConfig)
-> Lens
UpdateFunctionEventInvokeConfig
UpdateFunctionEventInvokeConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionEventInvokeConfig' {Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
maximumEventAgeInSeconds} -> Maybe Natural
maximumEventAgeInSeconds) (\s :: UpdateFunctionEventInvokeConfig
s@UpdateFunctionEventInvokeConfig' {} Maybe Natural
a -> UpdateFunctionEventInvokeConfig
s {$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: Maybe Natural
maximumEventAgeInSeconds = Maybe Natural
a} :: UpdateFunctionEventInvokeConfig)
updateFunctionEventInvokeConfig_maximumRetryAttempts :: Lens.Lens' UpdateFunctionEventInvokeConfig (Prelude.Maybe Prelude.Natural)
updateFunctionEventInvokeConfig_maximumRetryAttempts :: (Maybe Natural -> f (Maybe Natural))
-> UpdateFunctionEventInvokeConfig
-> f UpdateFunctionEventInvokeConfig
updateFunctionEventInvokeConfig_maximumRetryAttempts = (UpdateFunctionEventInvokeConfig -> Maybe Natural)
-> (UpdateFunctionEventInvokeConfig
-> Maybe Natural -> UpdateFunctionEventInvokeConfig)
-> Lens
UpdateFunctionEventInvokeConfig
UpdateFunctionEventInvokeConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionEventInvokeConfig' {Maybe Natural
maximumRetryAttempts :: Maybe Natural
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
maximumRetryAttempts} -> Maybe Natural
maximumRetryAttempts) (\s :: UpdateFunctionEventInvokeConfig
s@UpdateFunctionEventInvokeConfig' {} Maybe Natural
a -> UpdateFunctionEventInvokeConfig
s {$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: Maybe Natural
maximumRetryAttempts = Maybe Natural
a} :: UpdateFunctionEventInvokeConfig)
updateFunctionEventInvokeConfig_qualifier :: Lens.Lens' UpdateFunctionEventInvokeConfig (Prelude.Maybe Prelude.Text)
updateFunctionEventInvokeConfig_qualifier :: (Maybe Text -> f (Maybe Text))
-> UpdateFunctionEventInvokeConfig
-> f UpdateFunctionEventInvokeConfig
updateFunctionEventInvokeConfig_qualifier = (UpdateFunctionEventInvokeConfig -> Maybe Text)
-> (UpdateFunctionEventInvokeConfig
-> Maybe Text -> UpdateFunctionEventInvokeConfig)
-> Lens
UpdateFunctionEventInvokeConfig
UpdateFunctionEventInvokeConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionEventInvokeConfig' {Maybe Text
qualifier :: Maybe Text
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
qualifier} -> Maybe Text
qualifier) (\s :: UpdateFunctionEventInvokeConfig
s@UpdateFunctionEventInvokeConfig' {} Maybe Text
a -> UpdateFunctionEventInvokeConfig
s {$sel:qualifier:UpdateFunctionEventInvokeConfig' :: Maybe Text
qualifier = Maybe Text
a} :: UpdateFunctionEventInvokeConfig)
updateFunctionEventInvokeConfig_destinationConfig :: Lens.Lens' UpdateFunctionEventInvokeConfig (Prelude.Maybe DestinationConfig)
updateFunctionEventInvokeConfig_destinationConfig :: (Maybe DestinationConfig -> f (Maybe DestinationConfig))
-> UpdateFunctionEventInvokeConfig
-> f UpdateFunctionEventInvokeConfig
updateFunctionEventInvokeConfig_destinationConfig = (UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig)
-> (UpdateFunctionEventInvokeConfig
-> Maybe DestinationConfig -> UpdateFunctionEventInvokeConfig)
-> Lens
UpdateFunctionEventInvokeConfig
UpdateFunctionEventInvokeConfig
(Maybe DestinationConfig)
(Maybe DestinationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionEventInvokeConfig' {Maybe DestinationConfig
destinationConfig :: Maybe DestinationConfig
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
destinationConfig} -> Maybe DestinationConfig
destinationConfig) (\s :: UpdateFunctionEventInvokeConfig
s@UpdateFunctionEventInvokeConfig' {} Maybe DestinationConfig
a -> UpdateFunctionEventInvokeConfig
s {$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: Maybe DestinationConfig
destinationConfig = Maybe DestinationConfig
a} :: UpdateFunctionEventInvokeConfig)
updateFunctionEventInvokeConfig_functionName :: Lens.Lens' UpdateFunctionEventInvokeConfig Prelude.Text
updateFunctionEventInvokeConfig_functionName :: (Text -> f Text)
-> UpdateFunctionEventInvokeConfig
-> f UpdateFunctionEventInvokeConfig
updateFunctionEventInvokeConfig_functionName = (UpdateFunctionEventInvokeConfig -> Text)
-> (UpdateFunctionEventInvokeConfig
-> Text -> UpdateFunctionEventInvokeConfig)
-> Lens
UpdateFunctionEventInvokeConfig
UpdateFunctionEventInvokeConfig
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFunctionEventInvokeConfig' {Text
functionName :: Text
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
functionName} -> Text
functionName) (\s :: UpdateFunctionEventInvokeConfig
s@UpdateFunctionEventInvokeConfig' {} Text
a -> UpdateFunctionEventInvokeConfig
s {$sel:functionName:UpdateFunctionEventInvokeConfig' :: Text
functionName = Text
a} :: UpdateFunctionEventInvokeConfig)
instance
Core.AWSRequest
UpdateFunctionEventInvokeConfig
where
type
AWSResponse UpdateFunctionEventInvokeConfig =
FunctionEventInvokeConfig
request :: UpdateFunctionEventInvokeConfig
-> Request UpdateFunctionEventInvokeConfig
request = Service
-> UpdateFunctionEventInvokeConfig
-> Request UpdateFunctionEventInvokeConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateFunctionEventInvokeConfig)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateFunctionEventInvokeConfig))
-> Logger
-> Service
-> Proxy UpdateFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateFunctionEventInvokeConfig)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String FunctionEventInvokeConfig
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance
Prelude.Hashable
UpdateFunctionEventInvokeConfig
instance
Prelude.NFData
UpdateFunctionEventInvokeConfig
instance
Core.ToHeaders
UpdateFunctionEventInvokeConfig
where
toHeaders :: UpdateFunctionEventInvokeConfig -> ResponseHeaders
toHeaders = ResponseHeaders
-> UpdateFunctionEventInvokeConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdateFunctionEventInvokeConfig where
toJSON :: UpdateFunctionEventInvokeConfig -> Value
toJSON UpdateFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
destinationConfig :: Maybe DestinationConfig
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MaximumEventAgeInSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maximumEventAgeInSeconds,
(Text
"MaximumRetryAttempts" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maximumRetryAttempts,
(Text
"DestinationConfig" Text -> DestinationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DestinationConfig -> Pair)
-> Maybe DestinationConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DestinationConfig
destinationConfig
]
)
instance Core.ToPath UpdateFunctionEventInvokeConfig where
toPath :: UpdateFunctionEventInvokeConfig -> ByteString
toPath UpdateFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
destinationConfig :: Maybe DestinationConfig
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2019-09-25/functions/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
functionName,
ByteString
"/event-invoke-config"
]
instance Core.ToQuery UpdateFunctionEventInvokeConfig where
toQuery :: UpdateFunctionEventInvokeConfig -> QueryString
toQuery UpdateFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
destinationConfig :: Maybe DestinationConfig
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
qualifier]