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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'IotSiteWiseAssetModelPropertyIdentifier' 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:
--
-- 'assetModelId', 'iotSiteWiseAssetModelPropertyIdentifier_assetModelId' - The ID of the AWS IoT SiteWise asset model.
--
-- 'propertyId', 'iotSiteWiseAssetModelPropertyIdentifier_propertyId' - The ID of the AWS IoT SiteWise asset property.
newIotSiteWiseAssetModelPropertyIdentifier ::
  -- | 'assetModelId'
  Prelude.Text ->
  -- | 'propertyId'
  Prelude.Text ->
  IotSiteWiseAssetModelPropertyIdentifier
newIotSiteWiseAssetModelPropertyIdentifier :: Text -> Text -> IotSiteWiseAssetModelPropertyIdentifier
newIotSiteWiseAssetModelPropertyIdentifier
  Text
pAssetModelId_
  Text
pPropertyId_ =
    IotSiteWiseAssetModelPropertyIdentifier' :: Text -> Text -> IotSiteWiseAssetModelPropertyIdentifier
IotSiteWiseAssetModelPropertyIdentifier'
      { $sel:assetModelId:IotSiteWiseAssetModelPropertyIdentifier' :: Text
assetModelId =
          Text
pAssetModelId_,
        $sel:propertyId:IotSiteWiseAssetModelPropertyIdentifier' :: Text
propertyId = Text
pPropertyId_
      }

-- | The ID of the AWS IoT SiteWise asset model.
iotSiteWiseAssetModelPropertyIdentifier_assetModelId :: Lens.Lens' IotSiteWiseAssetModelPropertyIdentifier Prelude.Text
iotSiteWiseAssetModelPropertyIdentifier_assetModelId :: (Text -> f Text)
-> IotSiteWiseAssetModelPropertyIdentifier
-> f IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier_assetModelId = (IotSiteWiseAssetModelPropertyIdentifier -> Text)
-> (IotSiteWiseAssetModelPropertyIdentifier
    -> Text -> IotSiteWiseAssetModelPropertyIdentifier)
-> Lens
     IotSiteWiseAssetModelPropertyIdentifier
     IotSiteWiseAssetModelPropertyIdentifier
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAssetModelPropertyIdentifier' {Text
assetModelId :: Text
$sel:assetModelId:IotSiteWiseAssetModelPropertyIdentifier' :: IotSiteWiseAssetModelPropertyIdentifier -> Text
assetModelId} -> Text
assetModelId) (\s :: IotSiteWiseAssetModelPropertyIdentifier
s@IotSiteWiseAssetModelPropertyIdentifier' {} Text
a -> IotSiteWiseAssetModelPropertyIdentifier
s {$sel:assetModelId:IotSiteWiseAssetModelPropertyIdentifier' :: Text
assetModelId = Text
a} :: IotSiteWiseAssetModelPropertyIdentifier)

-- | The ID of the AWS IoT SiteWise asset property.
iotSiteWiseAssetModelPropertyIdentifier_propertyId :: Lens.Lens' IotSiteWiseAssetModelPropertyIdentifier Prelude.Text
iotSiteWiseAssetModelPropertyIdentifier_propertyId :: (Text -> f Text)
-> IotSiteWiseAssetModelPropertyIdentifier
-> f IotSiteWiseAssetModelPropertyIdentifier
iotSiteWiseAssetModelPropertyIdentifier_propertyId = (IotSiteWiseAssetModelPropertyIdentifier -> Text)
-> (IotSiteWiseAssetModelPropertyIdentifier
    -> Text -> IotSiteWiseAssetModelPropertyIdentifier)
-> Lens
     IotSiteWiseAssetModelPropertyIdentifier
     IotSiteWiseAssetModelPropertyIdentifier
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseAssetModelPropertyIdentifier' {Text
propertyId :: Text
$sel:propertyId:IotSiteWiseAssetModelPropertyIdentifier' :: IotSiteWiseAssetModelPropertyIdentifier -> Text
propertyId} -> Text
propertyId) (\s :: IotSiteWiseAssetModelPropertyIdentifier
s@IotSiteWiseAssetModelPropertyIdentifier' {} Text
a -> IotSiteWiseAssetModelPropertyIdentifier
s {$sel:propertyId:IotSiteWiseAssetModelPropertyIdentifier' :: Text
propertyId = Text
a} :: IotSiteWiseAssetModelPropertyIdentifier)

instance
  Prelude.Hashable
    IotSiteWiseAssetModelPropertyIdentifier

instance
  Prelude.NFData
    IotSiteWiseAssetModelPropertyIdentifier

instance
  Core.ToJSON
    IotSiteWiseAssetModelPropertyIdentifier
  where
  toJSON :: IotSiteWiseAssetModelPropertyIdentifier -> Value
toJSON IotSiteWiseAssetModelPropertyIdentifier' {Text
propertyId :: Text
assetModelId :: Text
$sel:propertyId:IotSiteWiseAssetModelPropertyIdentifier' :: IotSiteWiseAssetModelPropertyIdentifier -> Text
$sel:assetModelId:IotSiteWiseAssetModelPropertyIdentifier' :: IotSiteWiseAssetModelPropertyIdentifier -> 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
"assetModelId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assetModelId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"propertyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
propertyId)
          ]
      )