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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types.PropertyNotification
import qualified Amazonka.Prelude as Prelude

-- | Contains a summary of a property associated with an asset.
--
-- /See:/ 'newAssetPropertySummary' smart constructor.
data AssetPropertySummary = AssetPropertySummary'
  { -- | 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/.
    AssetPropertySummary -> Maybe Text
alias :: Prelude.Maybe Prelude.Text,
    -- | The ID of the composite model that contains the asset property.
    AssetPropertySummary -> Maybe Text
assetCompositeModelId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the property.
    AssetPropertySummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    AssetPropertySummary -> Maybe PropertyNotification
notification :: Prelude.Maybe PropertyNotification,
    -- | The unit of measure (such as Newtons or RPM) of the asset property.
    AssetPropertySummary -> Maybe Text
unit :: Prelude.Maybe Prelude.Text
  }
  deriving (AssetPropertySummary -> AssetPropertySummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetPropertySummary -> AssetPropertySummary -> Bool
$c/= :: AssetPropertySummary -> AssetPropertySummary -> Bool
== :: AssetPropertySummary -> AssetPropertySummary -> Bool
$c== :: AssetPropertySummary -> AssetPropertySummary -> Bool
Prelude.Eq, ReadPrec [AssetPropertySummary]
ReadPrec AssetPropertySummary
Int -> ReadS AssetPropertySummary
ReadS [AssetPropertySummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetPropertySummary]
$creadListPrec :: ReadPrec [AssetPropertySummary]
readPrec :: ReadPrec AssetPropertySummary
$creadPrec :: ReadPrec AssetPropertySummary
readList :: ReadS [AssetPropertySummary]
$creadList :: ReadS [AssetPropertySummary]
readsPrec :: Int -> ReadS AssetPropertySummary
$creadsPrec :: Int -> ReadS AssetPropertySummary
Prelude.Read, Int -> AssetPropertySummary -> ShowS
[AssetPropertySummary] -> ShowS
AssetPropertySummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetPropertySummary] -> ShowS
$cshowList :: [AssetPropertySummary] -> ShowS
show :: AssetPropertySummary -> String
$cshow :: AssetPropertySummary -> String
showsPrec :: Int -> AssetPropertySummary -> ShowS
$cshowsPrec :: Int -> AssetPropertySummary -> ShowS
Prelude.Show, forall x. Rep AssetPropertySummary x -> AssetPropertySummary
forall x. AssetPropertySummary -> Rep AssetPropertySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetPropertySummary x -> AssetPropertySummary
$cfrom :: forall x. AssetPropertySummary -> Rep AssetPropertySummary x
Prelude.Generic)

-- |
-- Create a value of 'AssetPropertySummary' 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:
--
-- 'alias', 'assetPropertySummary_alias' - 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/.
--
-- 'assetCompositeModelId', 'assetPropertySummary_assetCompositeModelId' - The ID of the composite model that contains the asset property.
--
-- 'id', 'assetPropertySummary_id' - The ID of the property.
--
-- 'notification', 'assetPropertySummary_notification' - Undocumented member.
--
-- 'unit', 'assetPropertySummary_unit' - The unit of measure (such as Newtons or RPM) of the asset property.
newAssetPropertySummary ::
  AssetPropertySummary
newAssetPropertySummary :: AssetPropertySummary
newAssetPropertySummary =
  AssetPropertySummary'
    { $sel:alias:AssetPropertySummary' :: Maybe Text
alias = forall a. Maybe a
Prelude.Nothing,
      $sel:assetCompositeModelId:AssetPropertySummary' :: Maybe Text
assetCompositeModelId = forall a. Maybe a
Prelude.Nothing,
      $sel:id:AssetPropertySummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:notification:AssetPropertySummary' :: Maybe PropertyNotification
notification = forall a. Maybe a
Prelude.Nothing,
      $sel:unit:AssetPropertySummary' :: Maybe Text
unit = forall a. Maybe a
Prelude.Nothing
    }

-- | 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/.
assetPropertySummary_alias :: Lens.Lens' AssetPropertySummary (Prelude.Maybe Prelude.Text)
assetPropertySummary_alias :: Lens' AssetPropertySummary (Maybe Text)
assetPropertySummary_alias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetPropertySummary' {Maybe Text
alias :: Maybe Text
$sel:alias:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
alias} -> Maybe Text
alias) (\s :: AssetPropertySummary
s@AssetPropertySummary' {} Maybe Text
a -> AssetPropertySummary
s {$sel:alias:AssetPropertySummary' :: Maybe Text
alias = Maybe Text
a} :: AssetPropertySummary)

-- | The ID of the composite model that contains the asset property.
assetPropertySummary_assetCompositeModelId :: Lens.Lens' AssetPropertySummary (Prelude.Maybe Prelude.Text)
assetPropertySummary_assetCompositeModelId :: Lens' AssetPropertySummary (Maybe Text)
assetPropertySummary_assetCompositeModelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetPropertySummary' {Maybe Text
assetCompositeModelId :: Maybe Text
$sel:assetCompositeModelId:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
assetCompositeModelId} -> Maybe Text
assetCompositeModelId) (\s :: AssetPropertySummary
s@AssetPropertySummary' {} Maybe Text
a -> AssetPropertySummary
s {$sel:assetCompositeModelId:AssetPropertySummary' :: Maybe Text
assetCompositeModelId = Maybe Text
a} :: AssetPropertySummary)

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

-- | Undocumented member.
assetPropertySummary_notification :: Lens.Lens' AssetPropertySummary (Prelude.Maybe PropertyNotification)
assetPropertySummary_notification :: Lens' AssetPropertySummary (Maybe PropertyNotification)
assetPropertySummary_notification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetPropertySummary' {Maybe PropertyNotification
notification :: Maybe PropertyNotification
$sel:notification:AssetPropertySummary' :: AssetPropertySummary -> Maybe PropertyNotification
notification} -> Maybe PropertyNotification
notification) (\s :: AssetPropertySummary
s@AssetPropertySummary' {} Maybe PropertyNotification
a -> AssetPropertySummary
s {$sel:notification:AssetPropertySummary' :: Maybe PropertyNotification
notification = Maybe PropertyNotification
a} :: AssetPropertySummary)

-- | The unit of measure (such as Newtons or RPM) of the asset property.
assetPropertySummary_unit :: Lens.Lens' AssetPropertySummary (Prelude.Maybe Prelude.Text)
assetPropertySummary_unit :: Lens' AssetPropertySummary (Maybe Text)
assetPropertySummary_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetPropertySummary' {Maybe Text
unit :: Maybe Text
$sel:unit:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
unit} -> Maybe Text
unit) (\s :: AssetPropertySummary
s@AssetPropertySummary' {} Maybe Text
a -> AssetPropertySummary
s {$sel:unit:AssetPropertySummary' :: Maybe Text
unit = Maybe Text
a} :: AssetPropertySummary)

instance Data.FromJSON AssetPropertySummary where
  parseJSON :: Value -> Parser AssetPropertySummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AssetPropertySummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe PropertyNotification
-> Maybe Text
-> AssetPropertySummary
AssetPropertySummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"alias")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"assetCompositeModelId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"notification")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"unit")
      )

instance Prelude.Hashable AssetPropertySummary where
  hashWithSalt :: Int -> AssetPropertySummary -> Int
hashWithSalt Int
_salt AssetPropertySummary' {Maybe Text
Maybe PropertyNotification
unit :: Maybe Text
notification :: Maybe PropertyNotification
id :: Maybe Text
assetCompositeModelId :: Maybe Text
alias :: Maybe Text
$sel:unit:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
$sel:notification:AssetPropertySummary' :: AssetPropertySummary -> Maybe PropertyNotification
$sel:id:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
$sel:assetCompositeModelId:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
$sel:alias:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
alias
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
assetCompositeModelId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PropertyNotification
notification
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
unit

instance Prelude.NFData AssetPropertySummary where
  rnf :: AssetPropertySummary -> ()
rnf AssetPropertySummary' {Maybe Text
Maybe PropertyNotification
unit :: Maybe Text
notification :: Maybe PropertyNotification
id :: Maybe Text
assetCompositeModelId :: Maybe Text
alias :: Maybe Text
$sel:unit:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
$sel:notification:AssetPropertySummary' :: AssetPropertySummary -> Maybe PropertyNotification
$sel:id:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
$sel:assetCompositeModelId:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
$sel:alias:AssetPropertySummary' :: AssetPropertySummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
alias
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
assetCompositeModelId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PropertyNotification
notification
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
unit