{-# 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.IoTEvents.Types.IotEventsInputIdentifier
-- 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.IoTEvents.Types.IotEventsInputIdentifier 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 identifier of the input routed to AWS IoT Events.
--
-- /See:/ 'newIotEventsInputIdentifier' smart constructor.
data IotEventsInputIdentifier = IotEventsInputIdentifier'
  { -- | The name of the input routed to AWS IoT Events.
    IotEventsInputIdentifier -> Text
inputName :: Prelude.Text
  }
  deriving (IotEventsInputIdentifier -> IotEventsInputIdentifier -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IotEventsInputIdentifier -> IotEventsInputIdentifier -> Bool
$c/= :: IotEventsInputIdentifier -> IotEventsInputIdentifier -> Bool
== :: IotEventsInputIdentifier -> IotEventsInputIdentifier -> Bool
$c== :: IotEventsInputIdentifier -> IotEventsInputIdentifier -> Bool
Prelude.Eq, ReadPrec [IotEventsInputIdentifier]
ReadPrec IotEventsInputIdentifier
Int -> ReadS IotEventsInputIdentifier
ReadS [IotEventsInputIdentifier]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IotEventsInputIdentifier]
$creadListPrec :: ReadPrec [IotEventsInputIdentifier]
readPrec :: ReadPrec IotEventsInputIdentifier
$creadPrec :: ReadPrec IotEventsInputIdentifier
readList :: ReadS [IotEventsInputIdentifier]
$creadList :: ReadS [IotEventsInputIdentifier]
readsPrec :: Int -> ReadS IotEventsInputIdentifier
$creadsPrec :: Int -> ReadS IotEventsInputIdentifier
Prelude.Read, Int -> IotEventsInputIdentifier -> ShowS
[IotEventsInputIdentifier] -> ShowS
IotEventsInputIdentifier -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IotEventsInputIdentifier] -> ShowS
$cshowList :: [IotEventsInputIdentifier] -> ShowS
show :: IotEventsInputIdentifier -> String
$cshow :: IotEventsInputIdentifier -> String
showsPrec :: Int -> IotEventsInputIdentifier -> ShowS
$cshowsPrec :: Int -> IotEventsInputIdentifier -> ShowS
Prelude.Show, forall x.
Rep IotEventsInputIdentifier x -> IotEventsInputIdentifier
forall x.
IotEventsInputIdentifier -> Rep IotEventsInputIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep IotEventsInputIdentifier x -> IotEventsInputIdentifier
$cfrom :: forall x.
IotEventsInputIdentifier -> Rep IotEventsInputIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'IotEventsInputIdentifier' 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:
--
-- 'inputName', 'iotEventsInputIdentifier_inputName' - The name of the input routed to AWS IoT Events.
newIotEventsInputIdentifier ::
  -- | 'inputName'
  Prelude.Text ->
  IotEventsInputIdentifier
newIotEventsInputIdentifier :: Text -> IotEventsInputIdentifier
newIotEventsInputIdentifier Text
pInputName_ =
  IotEventsInputIdentifier' {$sel:inputName:IotEventsInputIdentifier' :: Text
inputName = Text
pInputName_}

-- | The name of the input routed to AWS IoT Events.
iotEventsInputIdentifier_inputName :: Lens.Lens' IotEventsInputIdentifier Prelude.Text
iotEventsInputIdentifier_inputName :: Lens' IotEventsInputIdentifier Text
iotEventsInputIdentifier_inputName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotEventsInputIdentifier' {Text
inputName :: Text
$sel:inputName:IotEventsInputIdentifier' :: IotEventsInputIdentifier -> Text
inputName} -> Text
inputName) (\s :: IotEventsInputIdentifier
s@IotEventsInputIdentifier' {} Text
a -> IotEventsInputIdentifier
s {$sel:inputName:IotEventsInputIdentifier' :: Text
inputName = Text
a} :: IotEventsInputIdentifier)

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

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

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