{-# 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.IotSiteWiseInputIdentifier
-- 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.IotSiteWiseInputIdentifier where

import qualified Amazonka.Core as Core
import Amazonka.IoTEvents.Types.IotSiteWiseAssetModelPropertyIdentifier
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The identifer of the input routed from AWS IoT SiteWise.
--
-- /See:/ 'newIotSiteWiseInputIdentifier' smart constructor.
data IotSiteWiseInputIdentifier = IotSiteWiseInputIdentifier'
  { -- | The identifier of the AWS IoT SiteWise asset model property.
    IotSiteWiseInputIdentifier
-> Maybe IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier :: Prelude.Maybe IotSiteWiseAssetModelPropertyIdentifier
  }
  deriving (IotSiteWiseInputIdentifier -> IotSiteWiseInputIdentifier -> Bool
(IotSiteWiseInputIdentifier -> IotSiteWiseInputIdentifier -> Bool)
-> (IotSiteWiseInputIdentifier
    -> IotSiteWiseInputIdentifier -> Bool)
-> Eq IotSiteWiseInputIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IotSiteWiseInputIdentifier -> IotSiteWiseInputIdentifier -> Bool
$c/= :: IotSiteWiseInputIdentifier -> IotSiteWiseInputIdentifier -> Bool
== :: IotSiteWiseInputIdentifier -> IotSiteWiseInputIdentifier -> Bool
$c== :: IotSiteWiseInputIdentifier -> IotSiteWiseInputIdentifier -> Bool
Prelude.Eq, ReadPrec [IotSiteWiseInputIdentifier]
ReadPrec IotSiteWiseInputIdentifier
Int -> ReadS IotSiteWiseInputIdentifier
ReadS [IotSiteWiseInputIdentifier]
(Int -> ReadS IotSiteWiseInputIdentifier)
-> ReadS [IotSiteWiseInputIdentifier]
-> ReadPrec IotSiteWiseInputIdentifier
-> ReadPrec [IotSiteWiseInputIdentifier]
-> Read IotSiteWiseInputIdentifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IotSiteWiseInputIdentifier]
$creadListPrec :: ReadPrec [IotSiteWiseInputIdentifier]
readPrec :: ReadPrec IotSiteWiseInputIdentifier
$creadPrec :: ReadPrec IotSiteWiseInputIdentifier
readList :: ReadS [IotSiteWiseInputIdentifier]
$creadList :: ReadS [IotSiteWiseInputIdentifier]
readsPrec :: Int -> ReadS IotSiteWiseInputIdentifier
$creadsPrec :: Int -> ReadS IotSiteWiseInputIdentifier
Prelude.Read, Int -> IotSiteWiseInputIdentifier -> ShowS
[IotSiteWiseInputIdentifier] -> ShowS
IotSiteWiseInputIdentifier -> String
(Int -> IotSiteWiseInputIdentifier -> ShowS)
-> (IotSiteWiseInputIdentifier -> String)
-> ([IotSiteWiseInputIdentifier] -> ShowS)
-> Show IotSiteWiseInputIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IotSiteWiseInputIdentifier] -> ShowS
$cshowList :: [IotSiteWiseInputIdentifier] -> ShowS
show :: IotSiteWiseInputIdentifier -> String
$cshow :: IotSiteWiseInputIdentifier -> String
showsPrec :: Int -> IotSiteWiseInputIdentifier -> ShowS
$cshowsPrec :: Int -> IotSiteWiseInputIdentifier -> ShowS
Prelude.Show, (forall x.
 IotSiteWiseInputIdentifier -> Rep IotSiteWiseInputIdentifier x)
-> (forall x.
    Rep IotSiteWiseInputIdentifier x -> IotSiteWiseInputIdentifier)
-> Generic IotSiteWiseInputIdentifier
forall x.
Rep IotSiteWiseInputIdentifier x -> IotSiteWiseInputIdentifier
forall x.
IotSiteWiseInputIdentifier -> Rep IotSiteWiseInputIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep IotSiteWiseInputIdentifier x -> IotSiteWiseInputIdentifier
$cfrom :: forall x.
IotSiteWiseInputIdentifier -> Rep IotSiteWiseInputIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'IotSiteWiseInputIdentifier' 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:
--
-- 'iotSiteWiseAssetModelPropertyIdentifier', 'iotSiteWiseInputIdentifier_iotSiteWiseAssetModelPropertyIdentifier' - The identifier of the AWS IoT SiteWise asset model property.
newIotSiteWiseInputIdentifier ::
  IotSiteWiseInputIdentifier
newIotSiteWiseInputIdentifier :: IotSiteWiseInputIdentifier
newIotSiteWiseInputIdentifier =
  IotSiteWiseInputIdentifier' :: Maybe IotSiteWiseAssetModelPropertyIdentifier
-> IotSiteWiseInputIdentifier
IotSiteWiseInputIdentifier'
    { $sel:iotSiteWiseAssetModelPropertyIdentifier:IotSiteWiseInputIdentifier' :: Maybe IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier =
        Maybe IotSiteWiseAssetModelPropertyIdentifier
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the AWS IoT SiteWise asset model property.
iotSiteWiseInputIdentifier_iotSiteWiseAssetModelPropertyIdentifier :: Lens.Lens' IotSiteWiseInputIdentifier (Prelude.Maybe IotSiteWiseAssetModelPropertyIdentifier)
iotSiteWiseInputIdentifier_iotSiteWiseAssetModelPropertyIdentifier :: (Maybe IotSiteWiseAssetModelPropertyIdentifier
 -> f (Maybe IotSiteWiseAssetModelPropertyIdentifier))
-> IotSiteWiseInputIdentifier -> f IotSiteWiseInputIdentifier
iotSiteWiseInputIdentifier_iotSiteWiseAssetModelPropertyIdentifier = (IotSiteWiseInputIdentifier
 -> Maybe IotSiteWiseAssetModelPropertyIdentifier)
-> (IotSiteWiseInputIdentifier
    -> Maybe IotSiteWiseAssetModelPropertyIdentifier
    -> IotSiteWiseInputIdentifier)
-> Lens
     IotSiteWiseInputIdentifier
     IotSiteWiseInputIdentifier
     (Maybe IotSiteWiseAssetModelPropertyIdentifier)
     (Maybe IotSiteWiseAssetModelPropertyIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseInputIdentifier' {Maybe IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier :: Maybe IotSiteWiseAssetModelPropertyIdentifier
$sel:iotSiteWiseAssetModelPropertyIdentifier:IotSiteWiseInputIdentifier' :: IotSiteWiseInputIdentifier
-> Maybe IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier} -> Maybe IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier) (\s :: IotSiteWiseInputIdentifier
s@IotSiteWiseInputIdentifier' {} Maybe IotSiteWiseAssetModelPropertyIdentifier
a -> IotSiteWiseInputIdentifier
s {$sel:iotSiteWiseAssetModelPropertyIdentifier:IotSiteWiseInputIdentifier' :: Maybe IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier = Maybe IotSiteWiseAssetModelPropertyIdentifier
a} :: IotSiteWiseInputIdentifier)

instance Prelude.Hashable IotSiteWiseInputIdentifier

instance Prelude.NFData IotSiteWiseInputIdentifier

instance Core.ToJSON IotSiteWiseInputIdentifier where
  toJSON :: IotSiteWiseInputIdentifier -> Value
toJSON IotSiteWiseInputIdentifier' {Maybe IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier :: Maybe IotSiteWiseAssetModelPropertyIdentifier
$sel:iotSiteWiseAssetModelPropertyIdentifier:IotSiteWiseInputIdentifier' :: IotSiteWiseInputIdentifier
-> Maybe IotSiteWiseAssetModelPropertyIdentifier
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"iotSiteWiseAssetModelPropertyIdentifier" Text -> IotSiteWiseAssetModelPropertyIdentifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (IotSiteWiseAssetModelPropertyIdentifier -> Pair)
-> Maybe IotSiteWiseAssetModelPropertyIdentifier -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier
          ]
      )