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

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

-- | Represents an update to the
-- <https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputLambdaProcessor.html InputLambdaProcessor>
-- that is used to preprocess the records in the stream.
--
-- /See:/ 'newInputLambdaProcessorUpdate' smart constructor.
data InputLambdaProcessorUpdate = InputLambdaProcessorUpdate'
  { -- | The ARN of the new IAM role that is used to access the AWS Lambda
    -- function.
    InputLambdaProcessorUpdate -> Maybe Text
roleARNUpdate :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the new
    -- <https://docs.aws.amazon.com/lambda/ AWS 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
    -- </general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda Example ARNs: AWS Lambda>
    InputLambdaProcessorUpdate -> Maybe Text
resourceARNUpdate :: Prelude.Maybe 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:
--
-- 'roleARNUpdate', 'inputLambdaProcessorUpdate_roleARNUpdate' - The ARN of the new IAM role that is used to access the AWS Lambda
-- function.
--
-- 'resourceARNUpdate', 'inputLambdaProcessorUpdate_resourceARNUpdate' - The Amazon Resource Name (ARN) of the new
-- <https://docs.aws.amazon.com/lambda/ AWS 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
-- </general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda Example ARNs: AWS Lambda>
newInputLambdaProcessorUpdate ::
  InputLambdaProcessorUpdate
newInputLambdaProcessorUpdate :: InputLambdaProcessorUpdate
newInputLambdaProcessorUpdate =
  InputLambdaProcessorUpdate' :: Maybe Text -> Maybe Text -> InputLambdaProcessorUpdate
InputLambdaProcessorUpdate'
    { $sel:roleARNUpdate:InputLambdaProcessorUpdate' :: Maybe Text
roleARNUpdate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: Maybe Text
resourceARNUpdate = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the new IAM role that is used to access the AWS Lambda
-- function.
inputLambdaProcessorUpdate_roleARNUpdate :: Lens.Lens' InputLambdaProcessorUpdate (Prelude.Maybe Prelude.Text)
inputLambdaProcessorUpdate_roleARNUpdate :: (Maybe Text -> f (Maybe Text))
-> InputLambdaProcessorUpdate -> f InputLambdaProcessorUpdate
inputLambdaProcessorUpdate_roleARNUpdate = (InputLambdaProcessorUpdate -> Maybe Text)
-> (InputLambdaProcessorUpdate
    -> Maybe Text -> InputLambdaProcessorUpdate)
-> Lens
     InputLambdaProcessorUpdate
     InputLambdaProcessorUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputLambdaProcessorUpdate' {Maybe Text
roleARNUpdate :: Maybe Text
$sel:roleARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
roleARNUpdate} -> Maybe Text
roleARNUpdate) (\s :: InputLambdaProcessorUpdate
s@InputLambdaProcessorUpdate' {} Maybe Text
a -> InputLambdaProcessorUpdate
s {$sel:roleARNUpdate:InputLambdaProcessorUpdate' :: Maybe Text
roleARNUpdate = Maybe Text
a} :: InputLambdaProcessorUpdate)

-- | The Amazon Resource Name (ARN) of the new
-- <https://docs.aws.amazon.com/lambda/ AWS 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
-- </general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-lambda Example ARNs: AWS Lambda>
inputLambdaProcessorUpdate_resourceARNUpdate :: Lens.Lens' InputLambdaProcessorUpdate (Prelude.Maybe Prelude.Text)
inputLambdaProcessorUpdate_resourceARNUpdate :: (Maybe Text -> f (Maybe Text))
-> InputLambdaProcessorUpdate -> f InputLambdaProcessorUpdate
inputLambdaProcessorUpdate_resourceARNUpdate = (InputLambdaProcessorUpdate -> Maybe Text)
-> (InputLambdaProcessorUpdate
    -> Maybe Text -> InputLambdaProcessorUpdate)
-> Lens
     InputLambdaProcessorUpdate
     InputLambdaProcessorUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputLambdaProcessorUpdate' {Maybe Text
resourceARNUpdate :: Maybe Text
$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
resourceARNUpdate} -> Maybe Text
resourceARNUpdate) (\s :: InputLambdaProcessorUpdate
s@InputLambdaProcessorUpdate' {} Maybe Text
a -> InputLambdaProcessorUpdate
s {$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: Maybe Text
resourceARNUpdate = Maybe Text
a} :: InputLambdaProcessorUpdate)

instance Prelude.Hashable InputLambdaProcessorUpdate

instance Prelude.NFData InputLambdaProcessorUpdate

instance Core.ToJSON InputLambdaProcessorUpdate where
  toJSON :: InputLambdaProcessorUpdate -> Value
toJSON InputLambdaProcessorUpdate' {Maybe Text
resourceARNUpdate :: Maybe Text
roleARNUpdate :: Maybe Text
$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
$sel:roleARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RoleARNUpdate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleARNUpdate,
            (Text
"ResourceARNUpdate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceARNUpdate
          ]
      )