{-# 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-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.IoTEvents.Types.IotEventsInputIdentifier where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(IotEventsInputIdentifier -> IotEventsInputIdentifier -> Bool)
-> (IotEventsInputIdentifier -> IotEventsInputIdentifier -> Bool)
-> Eq IotEventsInputIdentifier
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]
(Int -> ReadS IotEventsInputIdentifier)
-> ReadS [IotEventsInputIdentifier]
-> ReadPrec IotEventsInputIdentifier
-> ReadPrec [IotEventsInputIdentifier]
-> Read 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
(Int -> IotEventsInputIdentifier -> ShowS)
-> (IotEventsInputIdentifier -> String)
-> ([IotEventsInputIdentifier] -> ShowS)
-> Show IotEventsInputIdentifier
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.
 IotEventsInputIdentifier -> Rep IotEventsInputIdentifier x)
-> (forall x.
    Rep IotEventsInputIdentifier x -> IotEventsInputIdentifier)
-> Generic IotEventsInputIdentifier
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' :: Text -> IotEventsInputIdentifier
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 :: (Text -> f Text)
-> IotEventsInputIdentifier -> f IotEventsInputIdentifier
iotEventsInputIdentifier_inputName = (IotEventsInputIdentifier -> Text)
-> (IotEventsInputIdentifier -> Text -> IotEventsInputIdentifier)
-> Lens IotEventsInputIdentifier IotEventsInputIdentifier Text Text
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

instance Prelude.NFData IotEventsInputIdentifier

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