{-# 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.LambdaOutput
-- 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.KinesisAnalyticsV2.Types.LambdaOutput 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

-- | When you configure a SQL-based Kinesis Data Analytics application\'s
-- output, identifies an Amazon Lambda function as the destination. You
-- provide the function Amazon Resource Name (ARN) of the Lambda function.
--
-- /See:/ 'newLambdaOutput' smart constructor.
data LambdaOutput = LambdaOutput'
  { -- | The Amazon Resource Name (ARN) of the destination Lambda function to
    -- write to.
    --
    -- 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>
    LambdaOutput -> Text
resourceARN :: Prelude.Text
  }
  deriving (LambdaOutput -> LambdaOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaOutput -> LambdaOutput -> Bool
$c/= :: LambdaOutput -> LambdaOutput -> Bool
== :: LambdaOutput -> LambdaOutput -> Bool
$c== :: LambdaOutput -> LambdaOutput -> Bool
Prelude.Eq, ReadPrec [LambdaOutput]
ReadPrec LambdaOutput
Int -> ReadS LambdaOutput
ReadS [LambdaOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaOutput]
$creadListPrec :: ReadPrec [LambdaOutput]
readPrec :: ReadPrec LambdaOutput
$creadPrec :: ReadPrec LambdaOutput
readList :: ReadS [LambdaOutput]
$creadList :: ReadS [LambdaOutput]
readsPrec :: Int -> ReadS LambdaOutput
$creadsPrec :: Int -> ReadS LambdaOutput
Prelude.Read, Int -> LambdaOutput -> ShowS
[LambdaOutput] -> ShowS
LambdaOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaOutput] -> ShowS
$cshowList :: [LambdaOutput] -> ShowS
show :: LambdaOutput -> String
$cshow :: LambdaOutput -> String
showsPrec :: Int -> LambdaOutput -> ShowS
$cshowsPrec :: Int -> LambdaOutput -> ShowS
Prelude.Show, forall x. Rep LambdaOutput x -> LambdaOutput
forall x. LambdaOutput -> Rep LambdaOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaOutput x -> LambdaOutput
$cfrom :: forall x. LambdaOutput -> Rep LambdaOutput x
Prelude.Generic)

-- |
-- Create a value of 'LambdaOutput' 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:
--
-- 'resourceARN', 'lambdaOutput_resourceARN' - The Amazon Resource Name (ARN) of the destination Lambda function to
-- write to.
--
-- 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>
newLambdaOutput ::
  -- | 'resourceARN'
  Prelude.Text ->
  LambdaOutput
newLambdaOutput :: Text -> LambdaOutput
newLambdaOutput Text
pResourceARN_ =
  LambdaOutput' {$sel:resourceARN:LambdaOutput' :: Text
resourceARN = Text
pResourceARN_}

-- | The Amazon Resource Name (ARN) of the destination Lambda function to
-- write to.
--
-- 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>
lambdaOutput_resourceARN :: Lens.Lens' LambdaOutput Prelude.Text
lambdaOutput_resourceARN :: Lens' LambdaOutput Text
lambdaOutput_resourceARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaOutput' {Text
resourceARN :: Text
$sel:resourceARN:LambdaOutput' :: LambdaOutput -> Text
resourceARN} -> Text
resourceARN) (\s :: LambdaOutput
s@LambdaOutput' {} Text
a -> LambdaOutput
s {$sel:resourceARN:LambdaOutput' :: Text
resourceARN = Text
a} :: LambdaOutput)

instance Prelude.Hashable LambdaOutput where
  hashWithSalt :: Int -> LambdaOutput -> Int
hashWithSalt Int
_salt LambdaOutput' {Text
resourceARN :: Text
$sel:resourceARN:LambdaOutput' :: LambdaOutput -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceARN

instance Prelude.NFData LambdaOutput where
  rnf :: LambdaOutput -> ()
rnf LambdaOutput' {Text
resourceARN :: Text
$sel:resourceARN:LambdaOutput' :: LambdaOutput -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
resourceARN

instance Data.ToJSON LambdaOutput where
  toJSON :: LambdaOutput -> Value
toJSON LambdaOutput' {Text
resourceARN :: Text
$sel:resourceARN:LambdaOutput' :: LambdaOutput -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"ResourceARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceARN)]
      )