{-# 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_destinationConfig,
updateFunctionEventInvokeConfig_maximumEventAgeInSeconds,
updateFunctionEventInvokeConfig_maximumRetryAttempts,
updateFunctionEventInvokeConfig_qualifier,
updateFunctionEventInvokeConfig_functionName,
FunctionEventInvokeConfig (..),
newFunctionEventInvokeConfig,
functionEventInvokeConfig_destinationConfig,
functionEventInvokeConfig_functionArn,
functionEventInvokeConfig_lastModified,
functionEventInvokeConfig_maximumEventAgeInSeconds,
functionEventInvokeConfig_maximumRetryAttempts,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateFunctionEventInvokeConfig = UpdateFunctionEventInvokeConfig'
{
UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
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 -> Text
functionName :: Prelude.Text
}
deriving (UpdateFunctionEventInvokeConfig
-> UpdateFunctionEventInvokeConfig -> Bool
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]
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
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.
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'
{ $sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: Maybe DestinationConfig
destinationConfig =
forall a. Maybe a
Prelude.Nothing,
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: Maybe Natural
maximumEventAgeInSeconds = forall a. Maybe a
Prelude.Nothing,
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: Maybe Natural
maximumRetryAttempts = forall a. Maybe a
Prelude.Nothing,
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: Maybe Text
qualifier = forall a. Maybe a
Prelude.Nothing,
$sel:functionName:UpdateFunctionEventInvokeConfig' :: Text
functionName = Text
pFunctionName_
}
updateFunctionEventInvokeConfig_destinationConfig :: Lens.Lens' UpdateFunctionEventInvokeConfig (Prelude.Maybe DestinationConfig)
updateFunctionEventInvokeConfig_destinationConfig :: Lens' UpdateFunctionEventInvokeConfig (Maybe DestinationConfig)
updateFunctionEventInvokeConfig_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_maximumEventAgeInSeconds :: Lens.Lens' UpdateFunctionEventInvokeConfig (Prelude.Maybe Prelude.Natural)
updateFunctionEventInvokeConfig_maximumEventAgeInSeconds :: Lens' UpdateFunctionEventInvokeConfig (Maybe Natural)
updateFunctionEventInvokeConfig_maximumEventAgeInSeconds = 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 :: Lens' UpdateFunctionEventInvokeConfig (Maybe Natural)
updateFunctionEventInvokeConfig_maximumRetryAttempts = 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 :: Lens' UpdateFunctionEventInvokeConfig (Maybe Text)
updateFunctionEventInvokeConfig_qualifier = 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_functionName :: Lens.Lens' UpdateFunctionEventInvokeConfig Prelude.Text
updateFunctionEventInvokeConfig_functionName :: Lens' UpdateFunctionEventInvokeConfig Text
updateFunctionEventInvokeConfig_functionName = 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 :: (Service -> Service)
-> UpdateFunctionEventInvokeConfig
-> Request UpdateFunctionEventInvokeConfig
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateFunctionEventInvokeConfig)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance
Prelude.Hashable
UpdateFunctionEventInvokeConfig
where
hashWithSalt :: Int -> UpdateFunctionEventInvokeConfig -> Int
hashWithSalt
Int
_salt
UpdateFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DestinationConfig
destinationConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maximumEventAgeInSeconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maximumRetryAttempts
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
qualifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
functionName
instance
Prelude.NFData
UpdateFunctionEventInvokeConfig
where
rnf :: UpdateFunctionEventInvokeConfig -> ()
rnf UpdateFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DestinationConfig
destinationConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maximumEventAgeInSeconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maximumRetryAttempts
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
qualifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
functionName
instance
Data.ToHeaders
UpdateFunctionEventInvokeConfig
where
toHeaders :: UpdateFunctionEventInvokeConfig -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON UpdateFunctionEventInvokeConfig where
toJSON :: UpdateFunctionEventInvokeConfig -> Value
toJSON UpdateFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DestinationConfig" 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 DestinationConfig
destinationConfig,
(Key
"MaximumEventAgeInSeconds" 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 Natural
maximumEventAgeInSeconds,
(Key
"MaximumRetryAttempts" 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 Natural
maximumRetryAttempts
]
)
instance Data.ToPath UpdateFunctionEventInvokeConfig where
toPath :: UpdateFunctionEventInvokeConfig -> ByteString
toPath UpdateFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2019-09-25/functions/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
functionName,
ByteString
"/event-invoke-config"
]
instance Data.ToQuery UpdateFunctionEventInvokeConfig where
toQuery :: UpdateFunctionEventInvokeConfig -> QueryString
toQuery UpdateFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Text
$sel:qualifier:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:UpdateFunctionEventInvokeConfig' :: UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
qualifier]