{-# 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_destinationConfig,
putFunctionEventInvokeConfig_maximumEventAgeInSeconds,
putFunctionEventInvokeConfig_maximumRetryAttempts,
putFunctionEventInvokeConfig_qualifier,
putFunctionEventInvokeConfig_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 PutFunctionEventInvokeConfig = PutFunctionEventInvokeConfig'
{
PutFunctionEventInvokeConfig -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
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 -> Text
functionName :: Prelude.Text
}
deriving (PutFunctionEventInvokeConfig
-> PutFunctionEventInvokeConfig -> Bool
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]
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
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.
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'
{ $sel:destinationConfig:PutFunctionEventInvokeConfig' :: Maybe DestinationConfig
destinationConfig =
forall a. Maybe a
Prelude.Nothing,
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: Maybe Natural
maximumEventAgeInSeconds = forall a. Maybe a
Prelude.Nothing,
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: Maybe Natural
maximumRetryAttempts = forall a. Maybe a
Prelude.Nothing,
$sel:qualifier:PutFunctionEventInvokeConfig' :: Maybe Text
qualifier = forall a. Maybe a
Prelude.Nothing,
$sel:functionName:PutFunctionEventInvokeConfig' :: Text
functionName = Text
pFunctionName_
}
putFunctionEventInvokeConfig_destinationConfig :: Lens.Lens' PutFunctionEventInvokeConfig (Prelude.Maybe DestinationConfig)
putFunctionEventInvokeConfig_destinationConfig :: Lens' PutFunctionEventInvokeConfig (Maybe DestinationConfig)
putFunctionEventInvokeConfig_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_maximumEventAgeInSeconds :: Lens.Lens' PutFunctionEventInvokeConfig (Prelude.Maybe Prelude.Natural)
putFunctionEventInvokeConfig_maximumEventAgeInSeconds :: Lens' PutFunctionEventInvokeConfig (Maybe Natural)
putFunctionEventInvokeConfig_maximumEventAgeInSeconds = 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 :: Lens' PutFunctionEventInvokeConfig (Maybe Natural)
putFunctionEventInvokeConfig_maximumRetryAttempts = 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 :: Lens' PutFunctionEventInvokeConfig (Maybe Text)
putFunctionEventInvokeConfig_qualifier = 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_functionName :: Lens.Lens' PutFunctionEventInvokeConfig Prelude.Text
putFunctionEventInvokeConfig_functionName :: Lens' PutFunctionEventInvokeConfig Text
putFunctionEventInvokeConfig_functionName = 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 :: (Service -> Service)
-> PutFunctionEventInvokeConfig
-> Request PutFunctionEventInvokeConfig
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutFunctionEventInvokeConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutFunctionEventInvokeConfig)))
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
PutFunctionEventInvokeConfig
where
hashWithSalt :: Int -> PutFunctionEventInvokeConfig -> Int
hashWithSalt Int
_salt PutFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> 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 PutFunctionEventInvokeConfig where
rnf :: PutFunctionEventInvokeConfig -> ()
rnf PutFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> 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 PutFunctionEventInvokeConfig where
toHeaders :: PutFunctionEventInvokeConfig -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON PutFunctionEventInvokeConfig where
toJSON :: PutFunctionEventInvokeConfig -> Value
toJSON PutFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> 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 PutFunctionEventInvokeConfig where
toPath :: PutFunctionEventInvokeConfig -> ByteString
toPath PutFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> 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 PutFunctionEventInvokeConfig where
toQuery :: PutFunctionEventInvokeConfig -> QueryString
toQuery PutFunctionEventInvokeConfig' {Maybe Natural
Maybe Text
Maybe DestinationConfig
Text
functionName :: Text
qualifier :: Maybe Text
maximumRetryAttempts :: Maybe Natural
maximumEventAgeInSeconds :: Maybe Natural
destinationConfig :: Maybe DestinationConfig
$sel:functionName:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Text
$sel:qualifier:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Text
$sel:maximumRetryAttempts:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:maximumEventAgeInSeconds:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe Natural
$sel:destinationConfig:PutFunctionEventInvokeConfig' :: PutFunctionEventInvokeConfig -> Maybe DestinationConfig
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Qualifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
qualifier]