{-# 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.IoTSiteWise.Types.BatchGetAssetPropertyValueEntry
-- 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.IoTSiteWise.Types.BatchGetAssetPropertyValueEntry 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

-- | Contains information for an asset property value entry that is
-- associated with the
-- <https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html BatchGetAssetPropertyValue>
-- API.
--
-- To identify an asset property, you must specify one of the following:
--
-- -   The @assetId@ and @propertyId@ of an asset property.
--
-- -   A @propertyAlias@, which is a data stream alias (for example,
--     @\/company\/windfarm\/3\/turbine\/7\/temperature@). To define an
--     asset property\'s alias, see
--     <https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html UpdateAssetProperty>.
--
-- /See:/ 'newBatchGetAssetPropertyValueEntry' smart constructor.
data BatchGetAssetPropertyValueEntry = BatchGetAssetPropertyValueEntry'
  { -- | The ID of the asset in which the asset property was created.
    BatchGetAssetPropertyValueEntry -> Maybe Text
assetId :: Prelude.Maybe Prelude.Text,
    -- | The alias that identifies the property, such as an OPC-UA server data
    -- stream path (for example,
    -- @\/company\/windfarm\/3\/turbine\/7\/temperature@). For more
    -- information, see
    -- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html Mapping industrial data streams to asset properties>
    -- in the /IoT SiteWise User Guide/.
    BatchGetAssetPropertyValueEntry -> Maybe Text
propertyAlias :: Prelude.Maybe Prelude.Text,
    -- | The ID of the asset property.
    BatchGetAssetPropertyValueEntry -> Maybe Text
propertyId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the entry.
    BatchGetAssetPropertyValueEntry -> Text
entryId :: Prelude.Text
  }
  deriving (BatchGetAssetPropertyValueEntry
-> BatchGetAssetPropertyValueEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyValueEntry
-> BatchGetAssetPropertyValueEntry -> Bool
$c/= :: BatchGetAssetPropertyValueEntry
-> BatchGetAssetPropertyValueEntry -> Bool
== :: BatchGetAssetPropertyValueEntry
-> BatchGetAssetPropertyValueEntry -> Bool
$c== :: BatchGetAssetPropertyValueEntry
-> BatchGetAssetPropertyValueEntry -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyValueEntry]
ReadPrec BatchGetAssetPropertyValueEntry
Int -> ReadS BatchGetAssetPropertyValueEntry
ReadS [BatchGetAssetPropertyValueEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyValueEntry]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyValueEntry]
readPrec :: ReadPrec BatchGetAssetPropertyValueEntry
$creadPrec :: ReadPrec BatchGetAssetPropertyValueEntry
readList :: ReadS [BatchGetAssetPropertyValueEntry]
$creadList :: ReadS [BatchGetAssetPropertyValueEntry]
readsPrec :: Int -> ReadS BatchGetAssetPropertyValueEntry
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyValueEntry
Prelude.Read, Int -> BatchGetAssetPropertyValueEntry -> ShowS
[BatchGetAssetPropertyValueEntry] -> ShowS
BatchGetAssetPropertyValueEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyValueEntry] -> ShowS
$cshowList :: [BatchGetAssetPropertyValueEntry] -> ShowS
show :: BatchGetAssetPropertyValueEntry -> String
$cshow :: BatchGetAssetPropertyValueEntry -> String
showsPrec :: Int -> BatchGetAssetPropertyValueEntry -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyValueEntry -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyValueEntry x
-> BatchGetAssetPropertyValueEntry
forall x.
BatchGetAssetPropertyValueEntry
-> Rep BatchGetAssetPropertyValueEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyValueEntry x
-> BatchGetAssetPropertyValueEntry
$cfrom :: forall x.
BatchGetAssetPropertyValueEntry
-> Rep BatchGetAssetPropertyValueEntry x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyValueEntry' 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:
--
-- 'assetId', 'batchGetAssetPropertyValueEntry_assetId' - The ID of the asset in which the asset property was created.
--
-- 'propertyAlias', 'batchGetAssetPropertyValueEntry_propertyAlias' - The alias that identifies the property, such as an OPC-UA server data
-- stream path (for example,
-- @\/company\/windfarm\/3\/turbine\/7\/temperature@). For more
-- information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html Mapping industrial data streams to asset properties>
-- in the /IoT SiteWise User Guide/.
--
-- 'propertyId', 'batchGetAssetPropertyValueEntry_propertyId' - The ID of the asset property.
--
-- 'entryId', 'batchGetAssetPropertyValueEntry_entryId' - The ID of the entry.
newBatchGetAssetPropertyValueEntry ::
  -- | 'entryId'
  Prelude.Text ->
  BatchGetAssetPropertyValueEntry
newBatchGetAssetPropertyValueEntry :: Text -> BatchGetAssetPropertyValueEntry
newBatchGetAssetPropertyValueEntry Text
pEntryId_ =
  BatchGetAssetPropertyValueEntry'
    { $sel:assetId:BatchGetAssetPropertyValueEntry' :: Maybe Text
assetId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:propertyAlias:BatchGetAssetPropertyValueEntry' :: Maybe Text
propertyAlias = forall a. Maybe a
Prelude.Nothing,
      $sel:propertyId:BatchGetAssetPropertyValueEntry' :: Maybe Text
propertyId = forall a. Maybe a
Prelude.Nothing,
      $sel:entryId:BatchGetAssetPropertyValueEntry' :: Text
entryId = Text
pEntryId_
    }

-- | The ID of the asset in which the asset property was created.
batchGetAssetPropertyValueEntry_assetId :: Lens.Lens' BatchGetAssetPropertyValueEntry (Prelude.Maybe Prelude.Text)
batchGetAssetPropertyValueEntry_assetId :: Lens' BatchGetAssetPropertyValueEntry (Maybe Text)
batchGetAssetPropertyValueEntry_assetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueEntry' {Maybe Text
assetId :: Maybe Text
$sel:assetId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
assetId} -> Maybe Text
assetId) (\s :: BatchGetAssetPropertyValueEntry
s@BatchGetAssetPropertyValueEntry' {} Maybe Text
a -> BatchGetAssetPropertyValueEntry
s {$sel:assetId:BatchGetAssetPropertyValueEntry' :: Maybe Text
assetId = Maybe Text
a} :: BatchGetAssetPropertyValueEntry)

-- | The alias that identifies the property, such as an OPC-UA server data
-- stream path (for example,
-- @\/company\/windfarm\/3\/turbine\/7\/temperature@). For more
-- information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html Mapping industrial data streams to asset properties>
-- in the /IoT SiteWise User Guide/.
batchGetAssetPropertyValueEntry_propertyAlias :: Lens.Lens' BatchGetAssetPropertyValueEntry (Prelude.Maybe Prelude.Text)
batchGetAssetPropertyValueEntry_propertyAlias :: Lens' BatchGetAssetPropertyValueEntry (Maybe Text)
batchGetAssetPropertyValueEntry_propertyAlias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueEntry' {Maybe Text
propertyAlias :: Maybe Text
$sel:propertyAlias:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
propertyAlias} -> Maybe Text
propertyAlias) (\s :: BatchGetAssetPropertyValueEntry
s@BatchGetAssetPropertyValueEntry' {} Maybe Text
a -> BatchGetAssetPropertyValueEntry
s {$sel:propertyAlias:BatchGetAssetPropertyValueEntry' :: Maybe Text
propertyAlias = Maybe Text
a} :: BatchGetAssetPropertyValueEntry)

-- | The ID of the asset property.
batchGetAssetPropertyValueEntry_propertyId :: Lens.Lens' BatchGetAssetPropertyValueEntry (Prelude.Maybe Prelude.Text)
batchGetAssetPropertyValueEntry_propertyId :: Lens' BatchGetAssetPropertyValueEntry (Maybe Text)
batchGetAssetPropertyValueEntry_propertyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueEntry' {Maybe Text
propertyId :: Maybe Text
$sel:propertyId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
propertyId} -> Maybe Text
propertyId) (\s :: BatchGetAssetPropertyValueEntry
s@BatchGetAssetPropertyValueEntry' {} Maybe Text
a -> BatchGetAssetPropertyValueEntry
s {$sel:propertyId:BatchGetAssetPropertyValueEntry' :: Maybe Text
propertyId = Maybe Text
a} :: BatchGetAssetPropertyValueEntry)

-- | The ID of the entry.
batchGetAssetPropertyValueEntry_entryId :: Lens.Lens' BatchGetAssetPropertyValueEntry Prelude.Text
batchGetAssetPropertyValueEntry_entryId :: Lens' BatchGetAssetPropertyValueEntry Text
batchGetAssetPropertyValueEntry_entryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueEntry' {Text
entryId :: Text
$sel:entryId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Text
entryId} -> Text
entryId) (\s :: BatchGetAssetPropertyValueEntry
s@BatchGetAssetPropertyValueEntry' {} Text
a -> BatchGetAssetPropertyValueEntry
s {$sel:entryId:BatchGetAssetPropertyValueEntry' :: Text
entryId = Text
a} :: BatchGetAssetPropertyValueEntry)

instance
  Prelude.Hashable
    BatchGetAssetPropertyValueEntry
  where
  hashWithSalt :: Int -> BatchGetAssetPropertyValueEntry -> Int
hashWithSalt
    Int
_salt
    BatchGetAssetPropertyValueEntry' {Maybe Text
Text
entryId :: Text
propertyId :: Maybe Text
propertyAlias :: Maybe Text
assetId :: Maybe Text
$sel:entryId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Text
$sel:propertyId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
$sel:propertyAlias:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
$sel:assetId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
assetId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
propertyAlias
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
propertyId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
entryId

instance
  Prelude.NFData
    BatchGetAssetPropertyValueEntry
  where
  rnf :: BatchGetAssetPropertyValueEntry -> ()
rnf BatchGetAssetPropertyValueEntry' {Maybe Text
Text
entryId :: Text
propertyId :: Maybe Text
propertyAlias :: Maybe Text
assetId :: Maybe Text
$sel:entryId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Text
$sel:propertyId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
$sel:propertyAlias:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
$sel:assetId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
assetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
propertyAlias
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
propertyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
entryId

instance Data.ToJSON BatchGetAssetPropertyValueEntry where
  toJSON :: BatchGetAssetPropertyValueEntry -> Value
toJSON BatchGetAssetPropertyValueEntry' {Maybe Text
Text
entryId :: Text
propertyId :: Maybe Text
propertyAlias :: Maybe Text
assetId :: Maybe Text
$sel:entryId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Text
$sel:propertyId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
$sel:propertyAlias:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
$sel:assetId:BatchGetAssetPropertyValueEntry' :: BatchGetAssetPropertyValueEntry -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"assetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
assetId,
            (Key
"propertyAlias" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
propertyAlias,
            (Key
"propertyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
propertyId,
            forall a. a -> Maybe a
Prelude.Just (Key
"entryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
entryId)
          ]
      )