{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.KinesisAnalytics.Types.InputLambdaProcessorUpdate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 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,
    -- | The ARN of the new IAM role that is used to access the AWS Lambda
    -- function.
    InputLambdaProcessorUpdate -> Maybe Text
roleARNUpdate :: Prelude.Maybe Prelude.Text
  }
  deriving (InputLambdaProcessorUpdate -> InputLambdaProcessorUpdate -> Bool
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]
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
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.
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
-- <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>
--
-- 'roleARNUpdate', 'inputLambdaProcessorUpdate_roleARNUpdate' - The ARN of the new IAM role that is used to access the AWS Lambda
-- function.
newInputLambdaProcessorUpdate ::
  InputLambdaProcessorUpdate
newInputLambdaProcessorUpdate :: InputLambdaProcessorUpdate
newInputLambdaProcessorUpdate =
  InputLambdaProcessorUpdate'
    { $sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: Maybe Text
resourceARNUpdate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:roleARNUpdate:InputLambdaProcessorUpdate' :: Maybe Text
roleARNUpdate = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' InputLambdaProcessorUpdate (Maybe Text)
inputLambdaProcessorUpdate_resourceARNUpdate = 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)

-- | 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 :: Lens' InputLambdaProcessorUpdate (Maybe Text)
inputLambdaProcessorUpdate_roleARNUpdate = 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)

instance Prelude.Hashable InputLambdaProcessorUpdate where
  hashWithSalt :: Int -> InputLambdaProcessorUpdate -> Int
hashWithSalt Int
_salt InputLambdaProcessorUpdate' {Maybe Text
roleARNUpdate :: Maybe Text
resourceARNUpdate :: Maybe Text
$sel:roleARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceARNUpdate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleARNUpdate

instance Prelude.NFData InputLambdaProcessorUpdate where
  rnf :: InputLambdaProcessorUpdate -> ()
rnf InputLambdaProcessorUpdate' {Maybe Text
roleARNUpdate :: Maybe Text
resourceARNUpdate :: Maybe Text
$sel:roleARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceARNUpdate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleARNUpdate

instance Data.ToJSON InputLambdaProcessorUpdate where
  toJSON :: InputLambdaProcessorUpdate -> Value
toJSON InputLambdaProcessorUpdate' {Maybe Text
roleARNUpdate :: Maybe Text
resourceARNUpdate :: Maybe Text
$sel:roleARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
$sel:resourceARNUpdate:InputLambdaProcessorUpdate' :: InputLambdaProcessorUpdate -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ResourceARNUpdate" 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 Text
resourceARNUpdate,
            (Key
"RoleARNUpdate" 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 Text
roleARNUpdate
          ]
      )