{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.KinesisAnalyticsV2.Types.LambdaOutputUpdate
-- 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)
module Amazonka.KinesisAnalyticsV2.Types.LambdaOutputUpdate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | When you update an SQL-based Kinesis Data Analytics application\'s
-- output configuration using the UpdateApplication operation, provides
-- information about an Amazon Lambda function that is configured as the
-- destination.
--
-- /See:/ 'newLambdaOutputUpdate' smart constructor.
data LambdaOutputUpdate = LambdaOutputUpdate'
  { -- | The Amazon Resource Name (ARN) of the destination Amazon Lambda
    -- function.
    --
    -- To specify an earlier version of the Lambda function than the latest,
    -- include the Lambda function version in the Lambda function ARN. For more
    -- information about Lambda ARNs, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda Example ARNs: Amazon Lambda>
    LambdaOutputUpdate -> Text
resourceARNUpdate :: Prelude.Text
  }
  deriving (LambdaOutputUpdate -> LambdaOutputUpdate -> Bool
(LambdaOutputUpdate -> LambdaOutputUpdate -> Bool)
-> (LambdaOutputUpdate -> LambdaOutputUpdate -> Bool)
-> Eq LambdaOutputUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaOutputUpdate -> LambdaOutputUpdate -> Bool
$c/= :: LambdaOutputUpdate -> LambdaOutputUpdate -> Bool
== :: LambdaOutputUpdate -> LambdaOutputUpdate -> Bool
$c== :: LambdaOutputUpdate -> LambdaOutputUpdate -> Bool
Prelude.Eq, ReadPrec [LambdaOutputUpdate]
ReadPrec LambdaOutputUpdate
Int -> ReadS LambdaOutputUpdate
ReadS [LambdaOutputUpdate]
(Int -> ReadS LambdaOutputUpdate)
-> ReadS [LambdaOutputUpdate]
-> ReadPrec LambdaOutputUpdate
-> ReadPrec [LambdaOutputUpdate]
-> Read LambdaOutputUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaOutputUpdate]
$creadListPrec :: ReadPrec [LambdaOutputUpdate]
readPrec :: ReadPrec LambdaOutputUpdate
$creadPrec :: ReadPrec LambdaOutputUpdate
readList :: ReadS [LambdaOutputUpdate]
$creadList :: ReadS [LambdaOutputUpdate]
readsPrec :: Int -> ReadS LambdaOutputUpdate
$creadsPrec :: Int -> ReadS LambdaOutputUpdate
Prelude.Read, Int -> LambdaOutputUpdate -> ShowS
[LambdaOutputUpdate] -> ShowS
LambdaOutputUpdate -> String
(Int -> LambdaOutputUpdate -> ShowS)
-> (LambdaOutputUpdate -> String)
-> ([LambdaOutputUpdate] -> ShowS)
-> Show LambdaOutputUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaOutputUpdate] -> ShowS
$cshowList :: [LambdaOutputUpdate] -> ShowS
show :: LambdaOutputUpdate -> String
$cshow :: LambdaOutputUpdate -> String
showsPrec :: Int -> LambdaOutputUpdate -> ShowS
$cshowsPrec :: Int -> LambdaOutputUpdate -> ShowS
Prelude.Show, (forall x. LambdaOutputUpdate -> Rep LambdaOutputUpdate x)
-> (forall x. Rep LambdaOutputUpdate x -> LambdaOutputUpdate)
-> Generic LambdaOutputUpdate
forall x. Rep LambdaOutputUpdate x -> LambdaOutputUpdate
forall x. LambdaOutputUpdate -> Rep LambdaOutputUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaOutputUpdate x -> LambdaOutputUpdate
$cfrom :: forall x. LambdaOutputUpdate -> Rep LambdaOutputUpdate x
Prelude.Generic)

-- |
-- Create a value of 'LambdaOutputUpdate' 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:
--
-- 'resourceARNUpdate', 'lambdaOutputUpdate_resourceARNUpdate' - The Amazon Resource Name (ARN) of the destination Amazon Lambda
-- function.
--
-- To specify an earlier version of the Lambda function than the latest,
-- include the Lambda function version in the Lambda function ARN. For more
-- information about Lambda ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda Example ARNs: Amazon Lambda>
newLambdaOutputUpdate ::
  -- | 'resourceARNUpdate'
  Prelude.Text ->
  LambdaOutputUpdate
newLambdaOutputUpdate :: Text -> LambdaOutputUpdate
newLambdaOutputUpdate Text
pResourceARNUpdate_ =
  LambdaOutputUpdate' :: Text -> LambdaOutputUpdate
LambdaOutputUpdate'
    { $sel:resourceARNUpdate:LambdaOutputUpdate' :: Text
resourceARNUpdate =
        Text
pResourceARNUpdate_
    }

-- | The Amazon Resource Name (ARN) of the destination Amazon Lambda
-- function.
--
-- To specify an earlier version of the Lambda function than the latest,
-- include the Lambda function version in the Lambda function ARN. For more
-- information about Lambda ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda Example ARNs: Amazon Lambda>
lambdaOutputUpdate_resourceARNUpdate :: Lens.Lens' LambdaOutputUpdate Prelude.Text
lambdaOutputUpdate_resourceARNUpdate :: (Text -> f Text) -> LambdaOutputUpdate -> f LambdaOutputUpdate
lambdaOutputUpdate_resourceARNUpdate = (LambdaOutputUpdate -> Text)
-> (LambdaOutputUpdate -> Text -> LambdaOutputUpdate)
-> Lens LambdaOutputUpdate LambdaOutputUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaOutputUpdate' {Text
resourceARNUpdate :: Text
$sel:resourceARNUpdate:LambdaOutputUpdate' :: LambdaOutputUpdate -> Text
resourceARNUpdate} -> Text
resourceARNUpdate) (\s :: LambdaOutputUpdate
s@LambdaOutputUpdate' {} Text
a -> LambdaOutputUpdate
s {$sel:resourceARNUpdate:LambdaOutputUpdate' :: Text
resourceARNUpdate = Text
a} :: LambdaOutputUpdate)

instance Prelude.Hashable LambdaOutputUpdate

instance Prelude.NFData LambdaOutputUpdate

instance Core.ToJSON LambdaOutputUpdate where
  toJSON :: LambdaOutputUpdate -> Value
toJSON LambdaOutputUpdate' {Text
resourceARNUpdate :: Text
$sel:resourceARNUpdate:LambdaOutputUpdate' :: LambdaOutputUpdate -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ResourceARNUpdate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceARNUpdate)
          ]
      )