{-# 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.PutFunctionEventInvokeConfig
(
PutFunctionEventInvokeConfig (..),
newPutFunctionEventInvokeConfig,
putFunctionEventInvokeConfig_maximumEventAgeInSeconds,
putFunctionEventInvokeConfig_maximumRetryAttempts,
putFunctionEventInvokeConfig_qualifier,
putFunctionEventInvokeConfig_destinationConfig,
putFunctionEventInvokeConfig_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 PutFunctionEventInvokeConfig = PutFunctionEventInvokeConfig'
{
PutFunctionEventInvokeConfig -> Maybe Natural
maximumEventAgeInSeconds :: Prelude.Maybe Prelude.Natural,
PutFunctionEventInvokeConfig -> Maybe Natural
maximumRetryAttempts :: Prelude.Maybe Prelude.Natural,
PutFunctionEventInvokeConfig -> Maybe Text
qualifier :: Prelude.Maybe Prelude.Text,
PutFunctionEventInvokeConfig -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
PutFunctionEventInvokeConfig -> Text
functionName :: Prelude.Text
}
deriving (PutFunctionEventInvokeConfig
-> PutFunctionEventInvokeConfig -> Bool
(PutFunctionEventInvokeConfig
-> PutFunctionEventInvokeConfig -> Bool)
-> (PutFunctionEventInvokeConfig
-> PutFunctionEventInvokeConfig -> Bool)
-> Eq PutFunctionEventInvokeConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutFunctionEventInvokeConfig
-> PutFunctionEventInvokeConfig -> Bool
$c/= :: PutFunctionEventInvokeConfig
-> PutFunctionEventInvokeConfig -> Bool
== :: PutFunctionEventInvokeConfig
-> PutFunctionEventInvokeConfig -> Bool
$c== :: PutFunctionEventInvokeConfig
-> PutFunctionEventInvokeConfig -> Bool
Prelude.Eq, ReadPrec [PutFunctionEventInvokeConfig]
ReadPrec PutFunctionEventInvokeConfig
Int -> ReadS PutFunctionEventInvokeConfig
ReadS [PutFunctionEventInvokeConfig]
(Int -> ReadS PutFunctionEventInvokeConfig)
-> ReadS [PutFunctionEventInvokeConfig]
-> ReadPrec PutFunctionEventInvokeConfig
-> ReadPrec [PutFunctionEventInvokeConfig]
-> Read PutFunctionEventInvokeConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutFunctionEventInvokeConfig]
$creadListPrec :: ReadPrec [PutFunctionEventInvokeConfig]
readPrec :: ReadPrec PutFunctionEventInvokeConfig
$creadPrec :: ReadPrec PutFunctionEventInvokeConfig
readList :: ReadS [PutFunctionEventInvokeConfig]
$creadList :: ReadS [PutFunctionEventInvokeConfig]
readsPrec :: Int -> ReadS PutFunctionEventInvokeConfig
$creadsPrec :: Int -> ReadS PutFunctionEventInvokeConfig
Prelude.Read, Int -> PutFunctionEventInvokeConfig -> ShowS
[PutFunctionEventInvokeConfig] -> ShowS
PutFunctionEventInvokeConfig -> String
(Int -> PutFunctionEventInvokeConfig -> ShowS)
-> (PutFunctionEventInvokeConfig -> String)
-> ([PutFunctionEventInvokeConfig] -> ShowS)
-> Show PutFunctionEventInvokeConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutFunctionEventInvokeConfig] -> ShowS
$cshowList :: [PutFunctionEventInvokeConfig] -> ShowS
show :: PutFunctionEventInvokeConfig -> String
$cshow :: PutFunctionEventInvokeConfig -> String
showsPrec :: Int -> PutFunctionEventInvokeConfig -> ShowS
$cshowsPrec :: Int -> PutFunctionEventInvokeConfig -> ShowS
Prelude.Show, (forall x.
PutFunctionEventInvokeConfig -> Rep PutFunctionEventInvokeConfig x)
-> (forall x.
Rep PutFunctionEventInvokeConfig x -> PutFunctionEventInvokeConfig)
-> Generic PutFunctionEventInvokeConfig
forall x.
Rep PutFunctionEventInvokeConfig x -> PutFunctionEventInvokeConfig
forall x.
PutFunctionEventInvokeConfig -> Rep PutFunctionEventInvokeConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutFunctionEventInvokeConfig x -> PutFunctionEventInvokeConfig
$cfrom :: forall x.
PutFunctionEventInvokeConfig -> Rep PutFunctionEventInvokeConfig x
Prelude.Generic)
newPutFunctionEventInvokeConfig ::
Prelude.Text ->
PutFunctionEventInvokeConfig
newPutFunctionEventInvokeConfig :: Text -> PutFunctionEventInvokeConfig
newPutFunctionEventInvokeConfig Text
pFunctionName_ =
PutFunctionEventInvokeConfig' :: Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe DestinationConfig
-> Text
-> PutFunctionEventInvokeConfig
PutFunctionEventInvokeConfig'
{ $sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: Maybe Natural
maximumEventAgeInSeconds =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: Maybe Natural
maximumRetryAttempts = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:qualifier:PutFunctionEventInvokeConfig' :: Maybe Text
qualifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: Maybe DestinationConfig
destinationConfig = Maybe DestinationConfig
forall a. Maybe a
Prelude.Nothing,
$sel:functionName:PutFunctionEventInvokeConfig' :: Text
functionName = Text
pFunctionName_
}
putFunctionEventInvokeConfig_maximumEventAgeInSeconds :: Lens.Lens' PutFunctionEventInvokeConfig (Prelude.Maybe Prelude.Natural)
putFunctionEventInvokeConfig_maximumEventAgeInSeconds :: (Maybe Natural -> f (Maybe Natural))
-> PutFunctionEventInvokeConfig -> f PutFunctionEventInvokeConfig
putFunctionEventInvokeConfig_maximumEventAgeInSeconds = (PutFunctionEventInvokeConfig -> Maybe Natural)
-> (PutFunctionEventInvokeConfig
-> Maybe Natural -> PutFunctionEventInvokeConfig)
-> Lens
PutFunctionEventInvokeConfig
PutFunctionEventInvokeConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionEventInvokeConfig' {Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
maximumEventAgeInSeconds} -> Maybe Natural
maximumEventAgeInSeconds) (\s :: PutFunctionEventInvokeConfig
s@PutFunctionEventInvokeConfig' {} Maybe Natural
a -> PutFunctionEventInvokeConfig
s {$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: Maybe Natural
maximumEventAgeInSeconds = Maybe Natural
a} :: PutFunctionEventInvokeConfig)
putFunctionEventInvokeConfig_maximumRetryAttempts :: Lens.Lens' PutFunctionEventInvokeConfig (Prelude.Maybe Prelude.Natural)
putFunctionEventInvokeConfig_maximumRetryAttempts :: (Maybe Natural -> f (Maybe Natural))
-> PutFunctionEventInvokeConfig -> f PutFunctionEventInvokeConfig
putFunctionEventInvokeConfig_maximumRetryAttempts = (PutFunctionEventInvokeConfig -> Maybe Natural)
-> (PutFunctionEventInvokeConfig
-> Maybe Natural -> PutFunctionEventInvokeConfig)
-> Lens
PutFunctionEventInvokeConfig
PutFunctionEventInvokeConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionEventInvokeConfig' {Maybe Natural
maximumRetryAttempts :: Maybe Natural
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
maximumRetryAttempts} -> Maybe Natural
maximumRetryAttempts) (\s :: PutFunctionEventInvokeConfig
s@PutFunctionEventInvokeConfig' {} Maybe Natural
a -> PutFunctionEventInvokeConfig
s {$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: Maybe Natural
maximumRetryAttempts = Maybe Natural
a} :: PutFunctionEventInvokeConfig)
putFunctionEventInvokeConfig_qualifier :: Lens.Lens' PutFunctionEventInvokeConfig (Prelude.Maybe Prelude.Text)
putFunctionEventInvokeConfig_qualifier :: (Maybe Text -> f (Maybe Text))
-> PutFunctionEventInvokeConfig -> f PutFunctionEventInvokeConfig
putFunctionEventInvokeConfig_qualifier = (PutFunctionEventInvokeConfig -> Maybe Text)
-> (PutFunctionEventInvokeConfig
-> Maybe Text -> PutFunctionEventInvokeConfig)
-> Lens
PutFunctionEventInvokeConfig
PutFunctionEventInvokeConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionEventInvokeConfig' {Maybe Text
qualifier :: Maybe Text
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
qualifier} -> Maybe Text
qualifier) (\s :: PutFunctionEventInvokeConfig
s@PutFunctionEventInvokeConfig' {} Maybe Text
a -> PutFunctionEventInvokeConfig
s {$sel:qualifier:PutFunctionEventInvokeConfig' :: Maybe Text
qualifier = Maybe Text
a} :: PutFunctionEventInvokeConfig)
putFunctionEventInvokeConfig_destinationConfig :: Lens.Lens' PutFunctionEventInvokeConfig (Prelude.Maybe DestinationConfig)
putFunctionEventInvokeConfig_destinationConfig :: (Maybe DestinationConfig -> f (Maybe DestinationConfig))
-> PutFunctionEventInvokeConfig -> f PutFunctionEventInvokeConfig
putFunctionEventInvokeConfig_destinationConfig = (PutFunctionEventInvokeConfig -> Maybe DestinationConfig)
-> (PutFunctionEventInvokeConfig
-> Maybe DestinationConfig -> PutFunctionEventInvokeConfig)
-> Lens
PutFunctionEventInvokeConfig
PutFunctionEventInvokeConfig
(Maybe DestinationConfig)
(Maybe DestinationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionEventInvokeConfig' {Maybe DestinationConfig
destinationConfig :: Maybe DestinationConfig
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe DestinationConfig
destinationConfig} -> Maybe DestinationConfig
destinationConfig) (\s :: PutFunctionEventInvokeConfig
s@PutFunctionEventInvokeConfig' {} Maybe DestinationConfig
a -> PutFunctionEventInvokeConfig
s {$sel:destinationConfig:PutFunctionEventInvokeConfig' :: Maybe DestinationConfig
destinationConfig = Maybe DestinationConfig
a} :: PutFunctionEventInvokeConfig)
putFunctionEventInvokeConfig_functionName :: Lens.Lens' PutFunctionEventInvokeConfig Prelude.Text
putFunctionEventInvokeConfig_functionName :: (Text -> f Text)
-> PutFunctionEventInvokeConfig -> f PutFunctionEventInvokeConfig
putFunctionEventInvokeConfig_functionName = (PutFunctionEventInvokeConfig -> Text)
-> (PutFunctionEventInvokeConfig
-> Text -> PutFunctionEventInvokeConfig)
-> Lens
PutFunctionEventInvokeConfig PutFunctionEventInvokeConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFunctionEventInvokeConfig' {Text
functionName :: Text
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
functionName} -> Text
functionName) (\s :: PutFunctionEventInvokeConfig
s@PutFunctionEventInvokeConfig' {} Text
a -> PutFunctionEventInvokeConfig
s {$sel:functionName:PutFunctionEventInvokeConfig' :: Text
functionName = Text
a} :: PutFunctionEventInvokeConfig)
instance Core.AWSRequest PutFunctionEventInvokeConfig where
type
AWSResponse PutFunctionEventInvokeConfig =
FunctionEventInvokeConfig
request :: PutFunctionEventInvokeConfig
-> Request PutFunctionEventInvokeConfig
request = Service
-> PutFunctionEventInvokeConfig
-> Request PutFunctionEventInvokeConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutFunctionEventInvokeConfig)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutFunctionEventInvokeConfig))
-> Logger
-> Service
-> Proxy PutFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutFunctionEventInvokeConfig)))
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
PutFunctionEventInvokeConfig
instance Prelude.NFData PutFunctionEventInvokeConfig
instance Core.ToHeaders PutFunctionEventInvokeConfig where
toHeaders :: PutFunctionEventInvokeConfig -> ResponseHeaders
toHeaders = ResponseHeaders -> PutFunctionEventInvokeConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON PutFunctionEventInvokeConfig where
toJSON :: PutFunctionEventInvokeConfig -> Value
toJSON PutFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
destinationConfig :: Maybe DestinationConfig
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe DestinationConfig
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> 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 PutFunctionEventInvokeConfig where
toPath :: PutFunctionEventInvokeConfig -> ByteString
toPath PutFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
destinationConfig :: Maybe DestinationConfig
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe DestinationConfig
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> 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 PutFunctionEventInvokeConfig where
toQuery :: PutFunctionEventInvokeConfig -> QueryString
toQuery PutFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
destinationConfig :: Maybe DestinationConfig
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe DestinationConfig
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> 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]