{-# 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.MigrationHubReFactorSpaces.Types.LambdaEndpointInput
-- 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.MigrationHubReFactorSpaces.Types.LambdaEndpointInput 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

-- | The input for the Lambda endpoint type.
--
-- /See:/ 'newLambdaEndpointInput' smart constructor.
data LambdaEndpointInput = LambdaEndpointInput'
  { -- | The Amazon Resource Name (ARN) of the Lambda function or alias.
    LambdaEndpointInput -> Text
arn :: Prelude.Text
  }
  deriving (LambdaEndpointInput -> LambdaEndpointInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LambdaEndpointInput -> LambdaEndpointInput -> Bool
$c/= :: LambdaEndpointInput -> LambdaEndpointInput -> Bool
== :: LambdaEndpointInput -> LambdaEndpointInput -> Bool
$c== :: LambdaEndpointInput -> LambdaEndpointInput -> Bool
Prelude.Eq, ReadPrec [LambdaEndpointInput]
ReadPrec LambdaEndpointInput
Int -> ReadS LambdaEndpointInput
ReadS [LambdaEndpointInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LambdaEndpointInput]
$creadListPrec :: ReadPrec [LambdaEndpointInput]
readPrec :: ReadPrec LambdaEndpointInput
$creadPrec :: ReadPrec LambdaEndpointInput
readList :: ReadS [LambdaEndpointInput]
$creadList :: ReadS [LambdaEndpointInput]
readsPrec :: Int -> ReadS LambdaEndpointInput
$creadsPrec :: Int -> ReadS LambdaEndpointInput
Prelude.Read, Int -> LambdaEndpointInput -> ShowS
[LambdaEndpointInput] -> ShowS
LambdaEndpointInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LambdaEndpointInput] -> ShowS
$cshowList :: [LambdaEndpointInput] -> ShowS
show :: LambdaEndpointInput -> String
$cshow :: LambdaEndpointInput -> String
showsPrec :: Int -> LambdaEndpointInput -> ShowS
$cshowsPrec :: Int -> LambdaEndpointInput -> ShowS
Prelude.Show, forall x. Rep LambdaEndpointInput x -> LambdaEndpointInput
forall x. LambdaEndpointInput -> Rep LambdaEndpointInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LambdaEndpointInput x -> LambdaEndpointInput
$cfrom :: forall x. LambdaEndpointInput -> Rep LambdaEndpointInput x
Prelude.Generic)

-- |
-- Create a value of 'LambdaEndpointInput' 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:
--
-- 'arn', 'lambdaEndpointInput_arn' - The Amazon Resource Name (ARN) of the Lambda function or alias.
newLambdaEndpointInput ::
  -- | 'arn'
  Prelude.Text ->
  LambdaEndpointInput
newLambdaEndpointInput :: Text -> LambdaEndpointInput
newLambdaEndpointInput Text
pArn_ =
  LambdaEndpointInput' {$sel:arn:LambdaEndpointInput' :: Text
arn = Text
pArn_}

-- | The Amazon Resource Name (ARN) of the Lambda function or alias.
lambdaEndpointInput_arn :: Lens.Lens' LambdaEndpointInput Prelude.Text
lambdaEndpointInput_arn :: Lens' LambdaEndpointInput Text
lambdaEndpointInput_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LambdaEndpointInput' {Text
arn :: Text
$sel:arn:LambdaEndpointInput' :: LambdaEndpointInput -> Text
arn} -> Text
arn) (\s :: LambdaEndpointInput
s@LambdaEndpointInput' {} Text
a -> LambdaEndpointInput
s {$sel:arn:LambdaEndpointInput' :: Text
arn = Text
a} :: LambdaEndpointInput)

instance Data.FromJSON LambdaEndpointInput where
  parseJSON :: Value -> Parser LambdaEndpointInput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LambdaEndpointInput"
      ( \Object
x ->
          Text -> LambdaEndpointInput
LambdaEndpointInput' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Arn")
      )

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

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

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