{-# 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.BatchGetAssetPropertyAggregatesEntry
-- 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.BatchGetAssetPropertyAggregatesEntry 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.AggregateType
import Amazonka.IoTSiteWise.Types.Quality
import Amazonka.IoTSiteWise.Types.TimeOrdering
import qualified Amazonka.Prelude as Prelude

-- | Contains information for an asset property aggregate entry that is
-- associated with the
-- <https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html BatchGetAssetPropertyAggregates>
-- 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:/ 'newBatchGetAssetPropertyAggregatesEntry' smart constructor.
data BatchGetAssetPropertyAggregatesEntry = BatchGetAssetPropertyAggregatesEntry'
  { -- | The ID of the asset in which the asset property was created.
    BatchGetAssetPropertyAggregatesEntry -> 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/.
    BatchGetAssetPropertyAggregatesEntry -> Maybe Text
propertyAlias :: Prelude.Maybe Prelude.Text,
    -- | The ID of the asset property.
    BatchGetAssetPropertyAggregatesEntry -> Maybe Text
propertyId :: Prelude.Maybe Prelude.Text,
    -- | The quality by which to filter asset data.
    BatchGetAssetPropertyAggregatesEntry -> Maybe (NonEmpty Quality)
qualities :: Prelude.Maybe (Prelude.NonEmpty Quality),
    -- | The chronological sorting order of the requested information.
    --
    -- Default: @ASCENDING@
    BatchGetAssetPropertyAggregatesEntry -> Maybe TimeOrdering
timeOrdering :: Prelude.Maybe TimeOrdering,
    -- | The ID of the entry.
    BatchGetAssetPropertyAggregatesEntry -> Text
entryId :: Prelude.Text,
    -- | The data aggregating function.
    BatchGetAssetPropertyAggregatesEntry -> NonEmpty AggregateType
aggregateTypes :: Prelude.NonEmpty AggregateType,
    -- | The time interval over which to aggregate data.
    BatchGetAssetPropertyAggregatesEntry -> Text
resolution :: Prelude.Text,
    -- | The exclusive start of the range from which to query historical data,
    -- expressed in seconds in Unix epoch time.
    BatchGetAssetPropertyAggregatesEntry -> POSIX
startDate :: Data.POSIX,
    -- | The inclusive end of the range from which to query historical data,
    -- expressed in seconds in Unix epoch time.
    BatchGetAssetPropertyAggregatesEntry -> POSIX
endDate :: Data.POSIX
  }
  deriving (BatchGetAssetPropertyAggregatesEntry
-> BatchGetAssetPropertyAggregatesEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyAggregatesEntry
-> BatchGetAssetPropertyAggregatesEntry -> Bool
$c/= :: BatchGetAssetPropertyAggregatesEntry
-> BatchGetAssetPropertyAggregatesEntry -> Bool
== :: BatchGetAssetPropertyAggregatesEntry
-> BatchGetAssetPropertyAggregatesEntry -> Bool
$c== :: BatchGetAssetPropertyAggregatesEntry
-> BatchGetAssetPropertyAggregatesEntry -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyAggregatesEntry]
ReadPrec BatchGetAssetPropertyAggregatesEntry
Int -> ReadS BatchGetAssetPropertyAggregatesEntry
ReadS [BatchGetAssetPropertyAggregatesEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyAggregatesEntry]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyAggregatesEntry]
readPrec :: ReadPrec BatchGetAssetPropertyAggregatesEntry
$creadPrec :: ReadPrec BatchGetAssetPropertyAggregatesEntry
readList :: ReadS [BatchGetAssetPropertyAggregatesEntry]
$creadList :: ReadS [BatchGetAssetPropertyAggregatesEntry]
readsPrec :: Int -> ReadS BatchGetAssetPropertyAggregatesEntry
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyAggregatesEntry
Prelude.Read, Int -> BatchGetAssetPropertyAggregatesEntry -> ShowS
[BatchGetAssetPropertyAggregatesEntry] -> ShowS
BatchGetAssetPropertyAggregatesEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyAggregatesEntry] -> ShowS
$cshowList :: [BatchGetAssetPropertyAggregatesEntry] -> ShowS
show :: BatchGetAssetPropertyAggregatesEntry -> String
$cshow :: BatchGetAssetPropertyAggregatesEntry -> String
showsPrec :: Int -> BatchGetAssetPropertyAggregatesEntry -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyAggregatesEntry -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyAggregatesEntry x
-> BatchGetAssetPropertyAggregatesEntry
forall x.
BatchGetAssetPropertyAggregatesEntry
-> Rep BatchGetAssetPropertyAggregatesEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyAggregatesEntry x
-> BatchGetAssetPropertyAggregatesEntry
$cfrom :: forall x.
BatchGetAssetPropertyAggregatesEntry
-> Rep BatchGetAssetPropertyAggregatesEntry x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyAggregatesEntry' 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', 'batchGetAssetPropertyAggregatesEntry_assetId' - The ID of the asset in which the asset property was created.
--
-- 'propertyAlias', 'batchGetAssetPropertyAggregatesEntry_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', 'batchGetAssetPropertyAggregatesEntry_propertyId' - The ID of the asset property.
--
-- 'qualities', 'batchGetAssetPropertyAggregatesEntry_qualities' - The quality by which to filter asset data.
--
-- 'timeOrdering', 'batchGetAssetPropertyAggregatesEntry_timeOrdering' - The chronological sorting order of the requested information.
--
-- Default: @ASCENDING@
--
-- 'entryId', 'batchGetAssetPropertyAggregatesEntry_entryId' - The ID of the entry.
--
-- 'aggregateTypes', 'batchGetAssetPropertyAggregatesEntry_aggregateTypes' - The data aggregating function.
--
-- 'resolution', 'batchGetAssetPropertyAggregatesEntry_resolution' - The time interval over which to aggregate data.
--
-- 'startDate', 'batchGetAssetPropertyAggregatesEntry_startDate' - The exclusive start of the range from which to query historical data,
-- expressed in seconds in Unix epoch time.
--
-- 'endDate', 'batchGetAssetPropertyAggregatesEntry_endDate' - The inclusive end of the range from which to query historical data,
-- expressed in seconds in Unix epoch time.
newBatchGetAssetPropertyAggregatesEntry ::
  -- | 'entryId'
  Prelude.Text ->
  -- | 'aggregateTypes'
  Prelude.NonEmpty AggregateType ->
  -- | 'resolution'
  Prelude.Text ->
  -- | 'startDate'
  Prelude.UTCTime ->
  -- | 'endDate'
  Prelude.UTCTime ->
  BatchGetAssetPropertyAggregatesEntry
newBatchGetAssetPropertyAggregatesEntry :: Text
-> NonEmpty AggregateType
-> Text
-> UTCTime
-> UTCTime
-> BatchGetAssetPropertyAggregatesEntry
newBatchGetAssetPropertyAggregatesEntry
  Text
pEntryId_
  NonEmpty AggregateType
pAggregateTypes_
  Text
pResolution_
  UTCTime
pStartDate_
  UTCTime
pEndDate_ =
    BatchGetAssetPropertyAggregatesEntry'
      { $sel:assetId:BatchGetAssetPropertyAggregatesEntry' :: Maybe Text
assetId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:propertyAlias:BatchGetAssetPropertyAggregatesEntry' :: Maybe Text
propertyAlias = forall a. Maybe a
Prelude.Nothing,
        $sel:propertyId:BatchGetAssetPropertyAggregatesEntry' :: Maybe Text
propertyId = forall a. Maybe a
Prelude.Nothing,
        $sel:qualities:BatchGetAssetPropertyAggregatesEntry' :: Maybe (NonEmpty Quality)
qualities = forall a. Maybe a
Prelude.Nothing,
        $sel:timeOrdering:BatchGetAssetPropertyAggregatesEntry' :: Maybe TimeOrdering
timeOrdering = forall a. Maybe a
Prelude.Nothing,
        $sel:entryId:BatchGetAssetPropertyAggregatesEntry' :: Text
entryId = Text
pEntryId_,
        $sel:aggregateTypes:BatchGetAssetPropertyAggregatesEntry' :: NonEmpty AggregateType
aggregateTypes =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            forall t b. AReview t b -> b -> t
Lens.# NonEmpty AggregateType
pAggregateTypes_,
        $sel:resolution:BatchGetAssetPropertyAggregatesEntry' :: Text
resolution = Text
pResolution_,
        $sel:startDate:BatchGetAssetPropertyAggregatesEntry' :: POSIX
startDate =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartDate_,
        $sel:endDate:BatchGetAssetPropertyAggregatesEntry' :: POSIX
endDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndDate_
      }

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

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

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

-- | The quality by which to filter asset data.
batchGetAssetPropertyAggregatesEntry_qualities :: Lens.Lens' BatchGetAssetPropertyAggregatesEntry (Prelude.Maybe (Prelude.NonEmpty Quality))
batchGetAssetPropertyAggregatesEntry_qualities :: Lens'
  BatchGetAssetPropertyAggregatesEntry (Maybe (NonEmpty Quality))
batchGetAssetPropertyAggregatesEntry_qualities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesEntry' {Maybe (NonEmpty Quality)
qualities :: Maybe (NonEmpty Quality)
$sel:qualities:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe (NonEmpty Quality)
qualities} -> Maybe (NonEmpty Quality)
qualities) (\s :: BatchGetAssetPropertyAggregatesEntry
s@BatchGetAssetPropertyAggregatesEntry' {} Maybe (NonEmpty Quality)
a -> BatchGetAssetPropertyAggregatesEntry
s {$sel:qualities:BatchGetAssetPropertyAggregatesEntry' :: Maybe (NonEmpty Quality)
qualities = Maybe (NonEmpty Quality)
a} :: BatchGetAssetPropertyAggregatesEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The chronological sorting order of the requested information.
--
-- Default: @ASCENDING@
batchGetAssetPropertyAggregatesEntry_timeOrdering :: Lens.Lens' BatchGetAssetPropertyAggregatesEntry (Prelude.Maybe TimeOrdering)
batchGetAssetPropertyAggregatesEntry_timeOrdering :: Lens' BatchGetAssetPropertyAggregatesEntry (Maybe TimeOrdering)
batchGetAssetPropertyAggregatesEntry_timeOrdering = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesEntry' {Maybe TimeOrdering
timeOrdering :: Maybe TimeOrdering
$sel:timeOrdering:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe TimeOrdering
timeOrdering} -> Maybe TimeOrdering
timeOrdering) (\s :: BatchGetAssetPropertyAggregatesEntry
s@BatchGetAssetPropertyAggregatesEntry' {} Maybe TimeOrdering
a -> BatchGetAssetPropertyAggregatesEntry
s {$sel:timeOrdering:BatchGetAssetPropertyAggregatesEntry' :: Maybe TimeOrdering
timeOrdering = Maybe TimeOrdering
a} :: BatchGetAssetPropertyAggregatesEntry)

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

-- | The data aggregating function.
batchGetAssetPropertyAggregatesEntry_aggregateTypes :: Lens.Lens' BatchGetAssetPropertyAggregatesEntry (Prelude.NonEmpty AggregateType)
batchGetAssetPropertyAggregatesEntry_aggregateTypes :: Lens' BatchGetAssetPropertyAggregatesEntry (NonEmpty AggregateType)
batchGetAssetPropertyAggregatesEntry_aggregateTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesEntry' {NonEmpty AggregateType
aggregateTypes :: NonEmpty AggregateType
$sel:aggregateTypes:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> NonEmpty AggregateType
aggregateTypes} -> NonEmpty AggregateType
aggregateTypes) (\s :: BatchGetAssetPropertyAggregatesEntry
s@BatchGetAssetPropertyAggregatesEntry' {} NonEmpty AggregateType
a -> BatchGetAssetPropertyAggregatesEntry
s {$sel:aggregateTypes:BatchGetAssetPropertyAggregatesEntry' :: NonEmpty AggregateType
aggregateTypes = NonEmpty AggregateType
a} :: BatchGetAssetPropertyAggregatesEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time interval over which to aggregate data.
batchGetAssetPropertyAggregatesEntry_resolution :: Lens.Lens' BatchGetAssetPropertyAggregatesEntry Prelude.Text
batchGetAssetPropertyAggregatesEntry_resolution :: Lens' BatchGetAssetPropertyAggregatesEntry Text
batchGetAssetPropertyAggregatesEntry_resolution = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesEntry' {Text
resolution :: Text
$sel:resolution:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Text
resolution} -> Text
resolution) (\s :: BatchGetAssetPropertyAggregatesEntry
s@BatchGetAssetPropertyAggregatesEntry' {} Text
a -> BatchGetAssetPropertyAggregatesEntry
s {$sel:resolution:BatchGetAssetPropertyAggregatesEntry' :: Text
resolution = Text
a} :: BatchGetAssetPropertyAggregatesEntry)

-- | The exclusive start of the range from which to query historical data,
-- expressed in seconds in Unix epoch time.
batchGetAssetPropertyAggregatesEntry_startDate :: Lens.Lens' BatchGetAssetPropertyAggregatesEntry Prelude.UTCTime
batchGetAssetPropertyAggregatesEntry_startDate :: Lens' BatchGetAssetPropertyAggregatesEntry UTCTime
batchGetAssetPropertyAggregatesEntry_startDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesEntry' {POSIX
startDate :: POSIX
$sel:startDate:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> POSIX
startDate} -> POSIX
startDate) (\s :: BatchGetAssetPropertyAggregatesEntry
s@BatchGetAssetPropertyAggregatesEntry' {} POSIX
a -> BatchGetAssetPropertyAggregatesEntry
s {$sel:startDate:BatchGetAssetPropertyAggregatesEntry' :: POSIX
startDate = POSIX
a} :: BatchGetAssetPropertyAggregatesEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The inclusive end of the range from which to query historical data,
-- expressed in seconds in Unix epoch time.
batchGetAssetPropertyAggregatesEntry_endDate :: Lens.Lens' BatchGetAssetPropertyAggregatesEntry Prelude.UTCTime
batchGetAssetPropertyAggregatesEntry_endDate :: Lens' BatchGetAssetPropertyAggregatesEntry UTCTime
batchGetAssetPropertyAggregatesEntry_endDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesEntry' {POSIX
endDate :: POSIX
$sel:endDate:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> POSIX
endDate} -> POSIX
endDate) (\s :: BatchGetAssetPropertyAggregatesEntry
s@BatchGetAssetPropertyAggregatesEntry' {} POSIX
a -> BatchGetAssetPropertyAggregatesEntry
s {$sel:endDate:BatchGetAssetPropertyAggregatesEntry' :: POSIX
endDate = POSIX
a} :: BatchGetAssetPropertyAggregatesEntry) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance
  Prelude.Hashable
    BatchGetAssetPropertyAggregatesEntry
  where
  hashWithSalt :: Int -> BatchGetAssetPropertyAggregatesEntry -> Int
hashWithSalt
    Int
_salt
    BatchGetAssetPropertyAggregatesEntry' {Maybe (NonEmpty Quality)
Maybe Text
Maybe TimeOrdering
NonEmpty AggregateType
Text
POSIX
endDate :: POSIX
startDate :: POSIX
resolution :: Text
aggregateTypes :: NonEmpty AggregateType
entryId :: Text
timeOrdering :: Maybe TimeOrdering
qualities :: Maybe (NonEmpty Quality)
propertyId :: Maybe Text
propertyAlias :: Maybe Text
assetId :: Maybe Text
$sel:endDate:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> POSIX
$sel:startDate:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> POSIX
$sel:resolution:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Text
$sel:aggregateTypes:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> NonEmpty AggregateType
$sel:entryId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Text
$sel:timeOrdering:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe TimeOrdering
$sel:qualities:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe (NonEmpty Quality)
$sel:propertyId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe Text
$sel:propertyAlias:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe Text
$sel:assetId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> 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` Maybe (NonEmpty Quality)
qualities
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TimeOrdering
timeOrdering
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
entryId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty AggregateType
aggregateTypes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resolution
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
startDate
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
endDate

instance
  Prelude.NFData
    BatchGetAssetPropertyAggregatesEntry
  where
  rnf :: BatchGetAssetPropertyAggregatesEntry -> ()
rnf BatchGetAssetPropertyAggregatesEntry' {Maybe (NonEmpty Quality)
Maybe Text
Maybe TimeOrdering
NonEmpty AggregateType
Text
POSIX
endDate :: POSIX
startDate :: POSIX
resolution :: Text
aggregateTypes :: NonEmpty AggregateType
entryId :: Text
timeOrdering :: Maybe TimeOrdering
qualities :: Maybe (NonEmpty Quality)
propertyId :: Maybe Text
propertyAlias :: Maybe Text
assetId :: Maybe Text
$sel:endDate:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> POSIX
$sel:startDate:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> POSIX
$sel:resolution:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Text
$sel:aggregateTypes:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> NonEmpty AggregateType
$sel:entryId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Text
$sel:timeOrdering:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe TimeOrdering
$sel:qualities:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe (NonEmpty Quality)
$sel:propertyId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe Text
$sel:propertyAlias:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe Text
$sel:assetId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> 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 Maybe (NonEmpty Quality)
qualities
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TimeOrdering
timeOrdering
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
entryId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty AggregateType
aggregateTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resolution
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
startDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
endDate

instance
  Data.ToJSON
    BatchGetAssetPropertyAggregatesEntry
  where
  toJSON :: BatchGetAssetPropertyAggregatesEntry -> Value
toJSON BatchGetAssetPropertyAggregatesEntry' {Maybe (NonEmpty Quality)
Maybe Text
Maybe TimeOrdering
NonEmpty AggregateType
Text
POSIX
endDate :: POSIX
startDate :: POSIX
resolution :: Text
aggregateTypes :: NonEmpty AggregateType
entryId :: Text
timeOrdering :: Maybe TimeOrdering
qualities :: Maybe (NonEmpty Quality)
propertyId :: Maybe Text
propertyAlias :: Maybe Text
assetId :: Maybe Text
$sel:endDate:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> POSIX
$sel:startDate:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> POSIX
$sel:resolution:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Text
$sel:aggregateTypes:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> NonEmpty AggregateType
$sel:entryId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Text
$sel:timeOrdering:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe TimeOrdering
$sel:qualities:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe (NonEmpty Quality)
$sel:propertyId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe Text
$sel:propertyAlias:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> Maybe Text
$sel:assetId:BatchGetAssetPropertyAggregatesEntry' :: BatchGetAssetPropertyAggregatesEntry -> 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,
            (Key
"qualities" 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 (NonEmpty Quality)
qualities,
            (Key
"timeOrdering" 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 TimeOrdering
timeOrdering,
            forall a. a -> Maybe a
Prelude.Just (Key
"entryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
entryId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"aggregateTypes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty AggregateType
aggregateTypes),
            forall a. a -> Maybe a
Prelude.Just (Key
"resolution" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resolution),
            forall a. a -> Maybe a
Prelude.Just (Key
"startDate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
startDate),
            forall a. a -> Maybe a
Prelude.Just (Key
"endDate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
endDate)
          ]
      )