{-# 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.InputLambdaProcessorUpdate
-- 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.InputLambdaProcessorUpdate where

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

-- | For a SQL-based Kinesis Data Analytics application, represents an update
-- to the InputLambdaProcessor that is used to preprocess the records in
-- the stream.
--
-- /See:/ 'newInputLambdaProcessorUpdate' smart constructor.
data InputLambdaProcessorUpdate = InputLambdaProcessorUpdate'
  { -- | The Amazon Resource Name (ARN) of the new Amazon Lambda function that is
    -- used to preprocess the records in the stream.
    --
    -- 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>
    InputLambdaProcessorUpdate -> Text
resourceARNUpdate :: Prelude.Text
  }
  deriving (InputLambdaProcessorUpdate -> InputLambdaProcessorUpdate -> Bool
(InputLambdaProcessorUpdate -> InputLambdaProcessorUpdate -> Bool)
-> (InputLambdaProcessorUpdate
    -> InputLambdaProcessorUpdate -> Bool)
-> Eq InputLambdaProcessorUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputLambdaProcessorUpdate -> InputLambdaProcessorUpdate -> Bool
$c/= :: InputLambdaProcessorUpdate -> InputLambdaProcessorUpdate -> Bool
== :: InputLambdaProcessorUpdate -> InputLambdaProcessorUpdate -> Bool
$c== :: InputLambdaProcessorUpdate -> InputLambdaProcessorUpdate -> Bool
Prelude.Eq, ReadPrec [InputLambdaProcessorUpdate]
ReadPrec InputLambdaProcessorUpdate
Int -> ReadS InputLambdaProcessorUpdate
ReadS [InputLambdaProcessorUpdate]
(Int -> ReadS InputLambdaProcessorUpdate)
-> ReadS [InputLambdaProcessorUpdate]
-> ReadPrec InputLambdaProcessorUpdate
-> ReadPrec [InputLambdaProcessorUpdate]
-> Read InputLambdaProcessorUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputLambdaProcessorUpdate]
$creadListPrec :: ReadPrec [InputLambdaProcessorUpdate]
readPrec :: ReadPrec InputLambdaProcessorUpdate
$creadPrec :: ReadPrec InputLambdaProcessorUpdate
readList :: ReadS [InputLambdaProcessorUpdate]
$creadList :: ReadS [InputLambdaProcessorUpdate]
readsPrec :: Int -> ReadS InputLambdaProcessorUpdate
$creadsPrec :: Int -> ReadS InputLambdaProcessorUpdate
Prelude.Read, Int -> InputLambdaProcessorUpdate -> ShowS
[InputLambdaProcessorUpdate] -> ShowS
InputLambdaProcessorUpdate -> String
(Int -> InputLambdaProcessorUpdate -> ShowS)
-> (InputLambdaProcessorUpdate -> String)
-> ([InputLambdaProcessorUpdate] -> ShowS)
-> Show InputLambdaProcessorUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputLambdaProcessorUpdate] -> ShowS
$cshowList :: [InputLambdaProcessorUpdate] -> ShowS
show :: InputLambdaProcessorUpdate -> String
$cshow :: InputLambdaProcessorUpdate -> String
showsPrec :: Int -> InputLambdaProcessorUpdate -> ShowS
$cshowsPrec :: Int -> InputLambdaProcessorUpdate -> ShowS
Prelude.Show, (forall x.
 InputLambdaProcessorUpdate -> Rep InputLambdaProcessorUpdate x)
-> (forall x.
    Rep InputLambdaProcessorUpdate x -> InputLambdaProcessorUpdate)
-> Generic InputLambdaProcessorUpdate
forall x.
Rep InputLambdaProcessorUpdate x -> InputLambdaProcessorUpdate
forall x.
InputLambdaProcessorUpdate -> Rep InputLambdaProcessorUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InputLambdaProcessorUpdate x -> InputLambdaProcessorUpdate
$cfrom :: forall x.
InputLambdaProcessorUpdate -> Rep InputLambdaProcessorUpdate x
Prelude.Generic)

-- |
-- Create a value of 'InputLambdaProcessorUpdate' 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', 'inputLambdaProcessorUpdate_resourceARNUpdate' - The Amazon Resource Name (ARN) of the new Amazon Lambda function that is
-- used to preprocess the records in the stream.
--
-- 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>
newInputLambdaProcessorUpdate ::
  -- | 'resourceARNUpdate'
  Prelude.Text ->
  InputLambdaProcessorUpdate
newInputLambdaProcessorUpdate :: Text -> InputLambdaProcessorUpdate
newInputLambdaProcessorUpdate Text
pResourceARNUpdate_ =
  InputLambdaProcessorUpdate' :: Text -> InputLambdaProcessorUpdate
InputLambdaProcessorUpdate'
    { $sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: Text
resourceARNUpdate =
        Text
pResourceARNUpdate_
    }

-- | The Amazon Resource Name (ARN) of the new Amazon Lambda function that is
-- used to preprocess the records in the stream.
--
-- 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>
inputLambdaProcessorUpdate_resourceARNUpdate :: Lens.Lens' InputLambdaProcessorUpdate Prelude.Text
inputLambdaProcessorUpdate_resourceARNUpdate :: (Text -> f Text)
-> InputLambdaProcessorUpdate -> f InputLambdaProcessorUpdate
inputLambdaProcessorUpdate_resourceARNUpdate = (InputLambdaProcessorUpdate -> Text)
-> (InputLambdaProcessorUpdate
    -> Text -> InputLambdaProcessorUpdate)
-> Lens
     InputLambdaProcessorUpdate InputLambdaProcessorUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputLambdaProcessorUpdate' {Text
resourceARNUpdate :: Text
$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Text
resourceARNUpdate} -> Text
resourceARNUpdate) (\s :: InputLambdaProcessorUpdate
s@InputLambdaProcessorUpdate' {} Text
a -> InputLambdaProcessorUpdate
s {$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: Text
resourceARNUpdate = Text
a} :: InputLambdaProcessorUpdate)

instance Prelude.Hashable InputLambdaProcessorUpdate

instance Prelude.NFData InputLambdaProcessorUpdate

instance Core.ToJSON InputLambdaProcessorUpdate where
  toJSON :: InputLambdaProcessorUpdate -> Value
toJSON InputLambdaProcessorUpdate' {Text
resourceARNUpdate :: Text
$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> 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)
          ]
      )