{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Lambda.PutFunctionEventInvokeConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Configures options for
-- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html asynchronous invocation>
-- on a function, version, or alias. If a configuration already exists for
-- a function, version, or alias, this operation overwrites it. If you
-- exclude any settings, they are removed. To set one option without
-- affecting existing settings for other options, use
-- UpdateFunctionEventInvokeConfig.
--
-- By default, Lambda retries an asynchronous invocation twice if the
-- function returns an error. It retains events in a queue for up to six
-- hours. When an event fails all processing attempts or stays in the
-- asynchronous invocation queue for too long, Lambda discards it. To
-- retain discarded events, configure a dead-letter queue with
-- UpdateFunctionConfiguration.
--
-- To send an invocation record to a queue, topic, function, or event bus,
-- specify a
-- <https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations destination>.
-- You can configure separate destinations for successful invocations
-- (on-success) and events that fail all processing attempts (on-failure).
-- You can configure destinations in addition to or instead of a
-- dead-letter queue.
module Amazonka.Lambda.PutFunctionEventInvokeConfig
  ( -- * Creating a Request
    PutFunctionEventInvokeConfig (..),
    newPutFunctionEventInvokeConfig,

    -- * Request Lenses
    putFunctionEventInvokeConfig_destinationConfig,
    putFunctionEventInvokeConfig_maximumEventAgeInSeconds,
    putFunctionEventInvokeConfig_maximumRetryAttempts,
    putFunctionEventInvokeConfig_qualifier,
    putFunctionEventInvokeConfig_functionName,

    -- * Destructuring the Response
    FunctionEventInvokeConfig (..),
    newFunctionEventInvokeConfig,

    -- * Response Lenses
    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

-- | /See:/ 'newPutFunctionEventInvokeConfig' smart constructor.
data PutFunctionEventInvokeConfig = PutFunctionEventInvokeConfig'
  { -- | A destination for events after they have been sent to a function for
    -- processing.
    --
    -- __Destinations__
    --
    -- -   __Function__ - The Amazon Resource Name (ARN) of a Lambda function.
    --
    -- -   __Queue__ - The ARN of an SQS queue.
    --
    -- -   __Topic__ - The ARN of an SNS topic.
    --
    -- -   __Event Bus__ - The ARN of an Amazon EventBridge event bus.
    PutFunctionEventInvokeConfig -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
    -- | The maximum age of a request that Lambda sends to a function for
    -- processing.
    PutFunctionEventInvokeConfig -> Maybe Natural
maximumEventAgeInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The maximum number of times to retry when the function returns an error.
    PutFunctionEventInvokeConfig -> Maybe Natural
maximumRetryAttempts :: Prelude.Maybe Prelude.Natural,
    -- | A version number or alias name.
    PutFunctionEventInvokeConfig -> Maybe Text
qualifier :: Prelude.Maybe Prelude.Text,
    -- | The name of the Lambda function, version, or alias.
    --
    -- __Name formats__
    --
    -- -   __Function name__ - @my-function@ (name-only), @my-function:v1@
    --     (with alias).
    --
    -- -   __Function ARN__ -
    --     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
    --
    -- -   __Partial ARN__ - @123456789012:function:my-function@.
    --
    -- You can append a version number or alias to any of the formats. The
    -- length constraint applies only to the full ARN. If you specify only the
    -- function name, it is limited to 64 characters in length.
    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)

-- |
-- Create a value of 'PutFunctionEventInvokeConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'destinationConfig', 'putFunctionEventInvokeConfig_destinationConfig' - A destination for events after they have been sent to a function for
-- processing.
--
-- __Destinations__
--
-- -   __Function__ - The Amazon Resource Name (ARN) of a Lambda function.
--
-- -   __Queue__ - The ARN of an SQS queue.
--
-- -   __Topic__ - The ARN of an SNS topic.
--
-- -   __Event Bus__ - The ARN of an Amazon EventBridge event bus.
--
-- 'maximumEventAgeInSeconds', 'putFunctionEventInvokeConfig_maximumEventAgeInSeconds' - The maximum age of a request that Lambda sends to a function for
-- processing.
--
-- 'maximumRetryAttempts', 'putFunctionEventInvokeConfig_maximumRetryAttempts' - The maximum number of times to retry when the function returns an error.
--
-- 'qualifier', 'putFunctionEventInvokeConfig_qualifier' - A version number or alias name.
--
-- 'functionName', 'putFunctionEventInvokeConfig_functionName' - The name of the Lambda function, version, or alias.
--
-- __Name formats__
--
-- -   __Function name__ - @my-function@ (name-only), @my-function:v1@
--     (with alias).
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ - @123456789012:function:my-function@.
--
-- You can append a version number or alias to any of the formats. The
-- length constraint applies only to the full ARN. If you specify only the
-- function name, it is limited to 64 characters in length.
newPutFunctionEventInvokeConfig ::
  -- | 'functionName'
  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_
    }

-- | A destination for events after they have been sent to a function for
-- processing.
--
-- __Destinations__
--
-- -   __Function__ - The Amazon Resource Name (ARN) of a Lambda function.
--
-- -   __Queue__ - The ARN of an SQS queue.
--
-- -   __Topic__ - The ARN of an SNS topic.
--
-- -   __Event Bus__ - The ARN of an Amazon EventBridge event bus.
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)

-- | The maximum age of a request that Lambda sends to a function for
-- processing.
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)

-- | The maximum number of times to retry when the function returns an error.
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)

-- | A version number or alias name.
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)

-- | The name of the Lambda function, version, or alias.
--
-- __Name formats__
--
-- -   __Function name__ - @my-function@ (name-only), @my-function:v1@
--     (with alias).
--
-- -   __Function ARN__ -
--     @arn:aws:lambda:us-west-2:123456789012:function:my-function@.
--
-- -   __Partial ARN__ - @123456789012:function:my-function@.
--
-- You can append a version number or alias to any of the formats. The
-- length constraint applies only to the full ARN. If you specify only the
-- function name, it is limited to 64 characters in length.
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]