{-# 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.UpdateFunctionEventInvokeConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the configuration for asynchronous invocation for a function,
-- version, or alias.
--
-- To configure options for asynchronous invocation, use
-- PutFunctionEventInvokeConfig.
module Amazonka.Lambda.UpdateFunctionEventInvokeConfig
  ( -- * Creating a Request
    UpdateFunctionEventInvokeConfig (..),
    newUpdateFunctionEventInvokeConfig,

    -- * Request Lenses
    updateFunctionEventInvokeConfig_maximumEventAgeInSeconds,
    updateFunctionEventInvokeConfig_maximumRetryAttempts,
    updateFunctionEventInvokeConfig_qualifier,
    updateFunctionEventInvokeConfig_destinationConfig,
    updateFunctionEventInvokeConfig_functionName,

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

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

-- | /See:/ 'newUpdateFunctionEventInvokeConfig' smart constructor.
data UpdateFunctionEventInvokeConfig = UpdateFunctionEventInvokeConfig'
  { -- | The maximum age of a request that Lambda sends to a function for
    -- processing.
    UpdateFunctionEventInvokeConfig -> Maybe Natural
maximumEventAgeInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The maximum number of times to retry when the function returns an error.
    UpdateFunctionEventInvokeConfig -> Maybe Natural
maximumRetryAttempts :: Prelude.Maybe Prelude.Natural,
    -- | A version number or alias name.
    UpdateFunctionEventInvokeConfig -> Maybe Text
qualifier :: Prelude.Maybe Prelude.Text,
    -- | 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.
    UpdateFunctionEventInvokeConfig -> Maybe DestinationConfig
destinationConfig :: Prelude.Maybe DestinationConfig,
    -- | 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.
    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)

-- |
-- Create a value of 'UpdateFunctionEventInvokeConfig' 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:
--
-- 'maximumEventAgeInSeconds', 'updateFunctionEventInvokeConfig_maximumEventAgeInSeconds' - The maximum age of a request that Lambda sends to a function for
-- processing.
--
-- 'maximumRetryAttempts', 'updateFunctionEventInvokeConfig_maximumRetryAttempts' - The maximum number of times to retry when the function returns an error.
--
-- 'qualifier', 'updateFunctionEventInvokeConfig_qualifier' - A version number or alias name.
--
-- 'destinationConfig', 'updateFunctionEventInvokeConfig_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.
--
-- 'functionName', 'updateFunctionEventInvokeConfig_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.
newUpdateFunctionEventInvokeConfig ::
  -- | 'functionName'
  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_
    }

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

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

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

-- | 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.
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)

-- | 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.
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]