{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetAssetPropertyAggregates
-- 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)
--
-- Gets aggregated values for an asset property. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#aggregates Querying aggregates>
-- in the /IoT SiteWise User Guide/.
--
-- 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>.
--
-- This operation returns paginated results.
module Amazonka.IoTSiteWise.GetAssetPropertyAggregates
  ( -- * Creating a Request
    GetAssetPropertyAggregates (..),
    newGetAssetPropertyAggregates,

    -- * Request Lenses
    getAssetPropertyAggregates_qualities,
    getAssetPropertyAggregates_timeOrdering,
    getAssetPropertyAggregates_propertyAlias,
    getAssetPropertyAggregates_nextToken,
    getAssetPropertyAggregates_propertyId,
    getAssetPropertyAggregates_assetId,
    getAssetPropertyAggregates_maxResults,
    getAssetPropertyAggregates_aggregateTypes,
    getAssetPropertyAggregates_resolution,
    getAssetPropertyAggregates_startDate,
    getAssetPropertyAggregates_endDate,

    -- * Destructuring the Response
    GetAssetPropertyAggregatesResponse (..),
    newGetAssetPropertyAggregatesResponse,

    -- * Response Lenses
    getAssetPropertyAggregatesResponse_nextToken,
    getAssetPropertyAggregatesResponse_httpStatus,
    getAssetPropertyAggregatesResponse_aggregatedValues,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetAssetPropertyAggregates' smart constructor.
data GetAssetPropertyAggregates = GetAssetPropertyAggregates'
  { -- | The quality by which to filter asset data.
    GetAssetPropertyAggregates -> Maybe (NonEmpty Quality)
qualities :: Prelude.Maybe (Prelude.NonEmpty Quality),
    -- | The chronological sorting order of the requested information.
    --
    -- Default: @ASCENDING@
    GetAssetPropertyAggregates -> Maybe TimeOrdering
timeOrdering :: Prelude.Maybe TimeOrdering,
    -- | 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/.
    GetAssetPropertyAggregates -> Maybe Text
propertyAlias :: Prelude.Maybe Prelude.Text,
    -- | The token to be used for the next set of paginated results.
    GetAssetPropertyAggregates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the asset property.
    GetAssetPropertyAggregates -> Maybe Text
propertyId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the asset.
    GetAssetPropertyAggregates -> Maybe Text
assetId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return for each paginated request.
    --
    -- Default: 100
    GetAssetPropertyAggregates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The data aggregating function.
    GetAssetPropertyAggregates -> NonEmpty AggregateType
aggregateTypes :: Prelude.NonEmpty AggregateType,
    -- | The time interval over which to aggregate data.
    GetAssetPropertyAggregates -> Text
resolution :: Prelude.Text,
    -- | The exclusive start of the range from which to query historical data,
    -- expressed in seconds in Unix epoch time.
    GetAssetPropertyAggregates -> POSIX
startDate :: Core.POSIX,
    -- | The inclusive end of the range from which to query historical data,
    -- expressed in seconds in Unix epoch time.
    GetAssetPropertyAggregates -> POSIX
endDate :: Core.POSIX
  }
  deriving (GetAssetPropertyAggregates -> GetAssetPropertyAggregates -> Bool
(GetAssetPropertyAggregates -> GetAssetPropertyAggregates -> Bool)
-> (GetAssetPropertyAggregates
    -> GetAssetPropertyAggregates -> Bool)
-> Eq GetAssetPropertyAggregates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAssetPropertyAggregates -> GetAssetPropertyAggregates -> Bool
$c/= :: GetAssetPropertyAggregates -> GetAssetPropertyAggregates -> Bool
== :: GetAssetPropertyAggregates -> GetAssetPropertyAggregates -> Bool
$c== :: GetAssetPropertyAggregates -> GetAssetPropertyAggregates -> Bool
Prelude.Eq, ReadPrec [GetAssetPropertyAggregates]
ReadPrec GetAssetPropertyAggregates
Int -> ReadS GetAssetPropertyAggregates
ReadS [GetAssetPropertyAggregates]
(Int -> ReadS GetAssetPropertyAggregates)
-> ReadS [GetAssetPropertyAggregates]
-> ReadPrec GetAssetPropertyAggregates
-> ReadPrec [GetAssetPropertyAggregates]
-> Read GetAssetPropertyAggregates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAssetPropertyAggregates]
$creadListPrec :: ReadPrec [GetAssetPropertyAggregates]
readPrec :: ReadPrec GetAssetPropertyAggregates
$creadPrec :: ReadPrec GetAssetPropertyAggregates
readList :: ReadS [GetAssetPropertyAggregates]
$creadList :: ReadS [GetAssetPropertyAggregates]
readsPrec :: Int -> ReadS GetAssetPropertyAggregates
$creadsPrec :: Int -> ReadS GetAssetPropertyAggregates
Prelude.Read, Int -> GetAssetPropertyAggregates -> ShowS
[GetAssetPropertyAggregates] -> ShowS
GetAssetPropertyAggregates -> String
(Int -> GetAssetPropertyAggregates -> ShowS)
-> (GetAssetPropertyAggregates -> String)
-> ([GetAssetPropertyAggregates] -> ShowS)
-> Show GetAssetPropertyAggregates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAssetPropertyAggregates] -> ShowS
$cshowList :: [GetAssetPropertyAggregates] -> ShowS
show :: GetAssetPropertyAggregates -> String
$cshow :: GetAssetPropertyAggregates -> String
showsPrec :: Int -> GetAssetPropertyAggregates -> ShowS
$cshowsPrec :: Int -> GetAssetPropertyAggregates -> ShowS
Prelude.Show, (forall x.
 GetAssetPropertyAggregates -> Rep GetAssetPropertyAggregates x)
-> (forall x.
    Rep GetAssetPropertyAggregates x -> GetAssetPropertyAggregates)
-> Generic GetAssetPropertyAggregates
forall x.
Rep GetAssetPropertyAggregates x -> GetAssetPropertyAggregates
forall x.
GetAssetPropertyAggregates -> Rep GetAssetPropertyAggregates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAssetPropertyAggregates x -> GetAssetPropertyAggregates
$cfrom :: forall x.
GetAssetPropertyAggregates -> Rep GetAssetPropertyAggregates x
Prelude.Generic)

-- |
-- Create a value of 'GetAssetPropertyAggregates' 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:
--
-- 'qualities', 'getAssetPropertyAggregates_qualities' - The quality by which to filter asset data.
--
-- 'timeOrdering', 'getAssetPropertyAggregates_timeOrdering' - The chronological sorting order of the requested information.
--
-- Default: @ASCENDING@
--
-- 'propertyAlias', 'getAssetPropertyAggregates_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/.
--
-- 'nextToken', 'getAssetPropertyAggregates_nextToken' - The token to be used for the next set of paginated results.
--
-- 'propertyId', 'getAssetPropertyAggregates_propertyId' - The ID of the asset property.
--
-- 'assetId', 'getAssetPropertyAggregates_assetId' - The ID of the asset.
--
-- 'maxResults', 'getAssetPropertyAggregates_maxResults' - The maximum number of results to return for each paginated request.
--
-- Default: 100
--
-- 'aggregateTypes', 'getAssetPropertyAggregates_aggregateTypes' - The data aggregating function.
--
-- 'resolution', 'getAssetPropertyAggregates_resolution' - The time interval over which to aggregate data.
--
-- 'startDate', 'getAssetPropertyAggregates_startDate' - The exclusive start of the range from which to query historical data,
-- expressed in seconds in Unix epoch time.
--
-- 'endDate', 'getAssetPropertyAggregates_endDate' - The inclusive end of the range from which to query historical data,
-- expressed in seconds in Unix epoch time.
newGetAssetPropertyAggregates ::
  -- | 'aggregateTypes'
  Prelude.NonEmpty AggregateType ->
  -- | 'resolution'
  Prelude.Text ->
  -- | 'startDate'
  Prelude.UTCTime ->
  -- | 'endDate'
  Prelude.UTCTime ->
  GetAssetPropertyAggregates
newGetAssetPropertyAggregates :: NonEmpty AggregateType
-> Text -> UTCTime -> UTCTime -> GetAssetPropertyAggregates
newGetAssetPropertyAggregates
  NonEmpty AggregateType
pAggregateTypes_
  Text
pResolution_
  UTCTime
pStartDate_
  UTCTime
pEndDate_ =
    GetAssetPropertyAggregates' :: Maybe (NonEmpty Quality)
-> Maybe TimeOrdering
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> NonEmpty AggregateType
-> Text
-> POSIX
-> POSIX
-> GetAssetPropertyAggregates
GetAssetPropertyAggregates'
      { $sel:qualities:GetAssetPropertyAggregates' :: Maybe (NonEmpty Quality)
qualities =
          Maybe (NonEmpty Quality)
forall a. Maybe a
Prelude.Nothing,
        $sel:timeOrdering:GetAssetPropertyAggregates' :: Maybe TimeOrdering
timeOrdering = Maybe TimeOrdering
forall a. Maybe a
Prelude.Nothing,
        $sel:propertyAlias:GetAssetPropertyAggregates' :: Maybe Text
propertyAlias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetAssetPropertyAggregates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:propertyId:GetAssetPropertyAggregates' :: Maybe Text
propertyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:assetId:GetAssetPropertyAggregates' :: Maybe Text
assetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:GetAssetPropertyAggregates' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:aggregateTypes:GetAssetPropertyAggregates' :: NonEmpty AggregateType
aggregateTypes =
          Tagged (NonEmpty AggregateType) (Identity (NonEmpty AggregateType))
-> Tagged
     (NonEmpty AggregateType) (Identity (NonEmpty AggregateType))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty AggregateType) (Identity (NonEmpty AggregateType))
 -> Tagged
      (NonEmpty AggregateType) (Identity (NonEmpty AggregateType)))
-> NonEmpty AggregateType -> NonEmpty AggregateType
forall t b. AReview t b -> b -> t
Lens.# NonEmpty AggregateType
pAggregateTypes_,
        $sel:resolution:GetAssetPropertyAggregates' :: Text
resolution = Text
pResolution_,
        $sel:startDate:GetAssetPropertyAggregates' :: POSIX
startDate = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartDate_,
        $sel:endDate:GetAssetPropertyAggregates' :: POSIX
endDate = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndDate_
      }

-- | The quality by which to filter asset data.
getAssetPropertyAggregates_qualities :: Lens.Lens' GetAssetPropertyAggregates (Prelude.Maybe (Prelude.NonEmpty Quality))
getAssetPropertyAggregates_qualities :: (Maybe (NonEmpty Quality) -> f (Maybe (NonEmpty Quality)))
-> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates
getAssetPropertyAggregates_qualities = (GetAssetPropertyAggregates -> Maybe (NonEmpty Quality))
-> (GetAssetPropertyAggregates
    -> Maybe (NonEmpty Quality) -> GetAssetPropertyAggregates)
-> Lens
     GetAssetPropertyAggregates
     GetAssetPropertyAggregates
     (Maybe (NonEmpty Quality))
     (Maybe (NonEmpty Quality))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregates' {Maybe (NonEmpty Quality)
qualities :: Maybe (NonEmpty Quality)
$sel:qualities:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe (NonEmpty Quality)
qualities} -> Maybe (NonEmpty Quality)
qualities) (\s :: GetAssetPropertyAggregates
s@GetAssetPropertyAggregates' {} Maybe (NonEmpty Quality)
a -> GetAssetPropertyAggregates
s {$sel:qualities:GetAssetPropertyAggregates' :: Maybe (NonEmpty Quality)
qualities = Maybe (NonEmpty Quality)
a} :: GetAssetPropertyAggregates) ((Maybe (NonEmpty Quality) -> f (Maybe (NonEmpty Quality)))
 -> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates)
-> ((Maybe (NonEmpty Quality) -> f (Maybe (NonEmpty Quality)))
    -> Maybe (NonEmpty Quality) -> f (Maybe (NonEmpty Quality)))
-> (Maybe (NonEmpty Quality) -> f (Maybe (NonEmpty Quality)))
-> GetAssetPropertyAggregates
-> f GetAssetPropertyAggregates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Quality)
  (NonEmpty Quality)
  (NonEmpty Quality)
  (NonEmpty Quality)
-> Iso
     (Maybe (NonEmpty Quality))
     (Maybe (NonEmpty Quality))
     (Maybe (NonEmpty Quality))
     (Maybe (NonEmpty Quality))
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 AnIso
  (NonEmpty Quality)
  (NonEmpty Quality)
  (NonEmpty Quality)
  (NonEmpty Quality)
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@
getAssetPropertyAggregates_timeOrdering :: Lens.Lens' GetAssetPropertyAggregates (Prelude.Maybe TimeOrdering)
getAssetPropertyAggregates_timeOrdering :: (Maybe TimeOrdering -> f (Maybe TimeOrdering))
-> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates
getAssetPropertyAggregates_timeOrdering = (GetAssetPropertyAggregates -> Maybe TimeOrdering)
-> (GetAssetPropertyAggregates
    -> Maybe TimeOrdering -> GetAssetPropertyAggregates)
-> Lens
     GetAssetPropertyAggregates
     GetAssetPropertyAggregates
     (Maybe TimeOrdering)
     (Maybe TimeOrdering)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregates' {Maybe TimeOrdering
timeOrdering :: Maybe TimeOrdering
$sel:timeOrdering:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe TimeOrdering
timeOrdering} -> Maybe TimeOrdering
timeOrdering) (\s :: GetAssetPropertyAggregates
s@GetAssetPropertyAggregates' {} Maybe TimeOrdering
a -> GetAssetPropertyAggregates
s {$sel:timeOrdering:GetAssetPropertyAggregates' :: Maybe TimeOrdering
timeOrdering = Maybe TimeOrdering
a} :: GetAssetPropertyAggregates)

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

-- | The token to be used for the next set of paginated results.
getAssetPropertyAggregates_nextToken :: Lens.Lens' GetAssetPropertyAggregates (Prelude.Maybe Prelude.Text)
getAssetPropertyAggregates_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates
getAssetPropertyAggregates_nextToken = (GetAssetPropertyAggregates -> Maybe Text)
-> (GetAssetPropertyAggregates
    -> Maybe Text -> GetAssetPropertyAggregates)
-> Lens
     GetAssetPropertyAggregates
     GetAssetPropertyAggregates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAssetPropertyAggregates
s@GetAssetPropertyAggregates' {} Maybe Text
a -> GetAssetPropertyAggregates
s {$sel:nextToken:GetAssetPropertyAggregates' :: Maybe Text
nextToken = Maybe Text
a} :: GetAssetPropertyAggregates)

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

-- | The ID of the asset.
getAssetPropertyAggregates_assetId :: Lens.Lens' GetAssetPropertyAggregates (Prelude.Maybe Prelude.Text)
getAssetPropertyAggregates_assetId :: (Maybe Text -> f (Maybe Text))
-> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates
getAssetPropertyAggregates_assetId = (GetAssetPropertyAggregates -> Maybe Text)
-> (GetAssetPropertyAggregates
    -> Maybe Text -> GetAssetPropertyAggregates)
-> Lens
     GetAssetPropertyAggregates
     GetAssetPropertyAggregates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregates' {Maybe Text
assetId :: Maybe Text
$sel:assetId:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe Text
assetId} -> Maybe Text
assetId) (\s :: GetAssetPropertyAggregates
s@GetAssetPropertyAggregates' {} Maybe Text
a -> GetAssetPropertyAggregates
s {$sel:assetId:GetAssetPropertyAggregates' :: Maybe Text
assetId = Maybe Text
a} :: GetAssetPropertyAggregates)

-- | The maximum number of results to return for each paginated request.
--
-- Default: 100
getAssetPropertyAggregates_maxResults :: Lens.Lens' GetAssetPropertyAggregates (Prelude.Maybe Prelude.Natural)
getAssetPropertyAggregates_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates
getAssetPropertyAggregates_maxResults = (GetAssetPropertyAggregates -> Maybe Natural)
-> (GetAssetPropertyAggregates
    -> Maybe Natural -> GetAssetPropertyAggregates)
-> Lens
     GetAssetPropertyAggregates
     GetAssetPropertyAggregates
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetAssetPropertyAggregates
s@GetAssetPropertyAggregates' {} Maybe Natural
a -> GetAssetPropertyAggregates
s {$sel:maxResults:GetAssetPropertyAggregates' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetAssetPropertyAggregates)

-- | The data aggregating function.
getAssetPropertyAggregates_aggregateTypes :: Lens.Lens' GetAssetPropertyAggregates (Prelude.NonEmpty AggregateType)
getAssetPropertyAggregates_aggregateTypes :: (NonEmpty AggregateType -> f (NonEmpty AggregateType))
-> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates
getAssetPropertyAggregates_aggregateTypes = (GetAssetPropertyAggregates -> NonEmpty AggregateType)
-> (GetAssetPropertyAggregates
    -> NonEmpty AggregateType -> GetAssetPropertyAggregates)
-> Lens
     GetAssetPropertyAggregates
     GetAssetPropertyAggregates
     (NonEmpty AggregateType)
     (NonEmpty AggregateType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregates' {NonEmpty AggregateType
aggregateTypes :: NonEmpty AggregateType
$sel:aggregateTypes:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> NonEmpty AggregateType
aggregateTypes} -> NonEmpty AggregateType
aggregateTypes) (\s :: GetAssetPropertyAggregates
s@GetAssetPropertyAggregates' {} NonEmpty AggregateType
a -> GetAssetPropertyAggregates
s {$sel:aggregateTypes:GetAssetPropertyAggregates' :: NonEmpty AggregateType
aggregateTypes = NonEmpty AggregateType
a} :: GetAssetPropertyAggregates) ((NonEmpty AggregateType -> f (NonEmpty AggregateType))
 -> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates)
-> ((NonEmpty AggregateType -> f (NonEmpty AggregateType))
    -> NonEmpty AggregateType -> f (NonEmpty AggregateType))
-> (NonEmpty AggregateType -> f (NonEmpty AggregateType))
-> GetAssetPropertyAggregates
-> f GetAssetPropertyAggregates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty AggregateType -> f (NonEmpty AggregateType))
-> NonEmpty AggregateType -> f (NonEmpty AggregateType)
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.
getAssetPropertyAggregates_resolution :: Lens.Lens' GetAssetPropertyAggregates Prelude.Text
getAssetPropertyAggregates_resolution :: (Text -> f Text)
-> GetAssetPropertyAggregates -> f GetAssetPropertyAggregates
getAssetPropertyAggregates_resolution = (GetAssetPropertyAggregates -> Text)
-> (GetAssetPropertyAggregates
    -> Text -> GetAssetPropertyAggregates)
-> Lens
     GetAssetPropertyAggregates GetAssetPropertyAggregates Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregates' {Text
resolution :: Text
$sel:resolution:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Text
resolution} -> Text
resolution) (\s :: GetAssetPropertyAggregates
s@GetAssetPropertyAggregates' {} Text
a -> GetAssetPropertyAggregates
s {$sel:resolution:GetAssetPropertyAggregates' :: Text
resolution = Text
a} :: GetAssetPropertyAggregates)

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

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

instance Core.AWSPager GetAssetPropertyAggregates where
  page :: GetAssetPropertyAggregates
-> AWSResponse GetAssetPropertyAggregates
-> Maybe GetAssetPropertyAggregates
page GetAssetPropertyAggregates
rq AWSResponse GetAssetPropertyAggregates
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAssetPropertyAggregates
GetAssetPropertyAggregatesResponse
rs
            GetAssetPropertyAggregatesResponse
-> Getting (First Text) GetAssetPropertyAggregatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAssetPropertyAggregatesResponse
-> Const (First Text) GetAssetPropertyAggregatesResponse
Lens' GetAssetPropertyAggregatesResponse (Maybe Text)
getAssetPropertyAggregatesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAssetPropertyAggregatesResponse
 -> Const (First Text) GetAssetPropertyAggregatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAssetPropertyAggregatesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetAssetPropertyAggregates
forall a. Maybe a
Prelude.Nothing
    | [AggregatedValue] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAssetPropertyAggregates
GetAssetPropertyAggregatesResponse
rs
            GetAssetPropertyAggregatesResponse
-> Getting
     [AggregatedValue]
     GetAssetPropertyAggregatesResponse
     [AggregatedValue]
-> [AggregatedValue]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [AggregatedValue]
  GetAssetPropertyAggregatesResponse
  [AggregatedValue]
Lens' GetAssetPropertyAggregatesResponse [AggregatedValue]
getAssetPropertyAggregatesResponse_aggregatedValues
        ) =
      Maybe GetAssetPropertyAggregates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetAssetPropertyAggregates -> Maybe GetAssetPropertyAggregates
forall a. a -> Maybe a
Prelude.Just (GetAssetPropertyAggregates -> Maybe GetAssetPropertyAggregates)
-> GetAssetPropertyAggregates -> Maybe GetAssetPropertyAggregates
forall a b. (a -> b) -> a -> b
Prelude.$
        GetAssetPropertyAggregates
rq
          GetAssetPropertyAggregates
-> (GetAssetPropertyAggregates -> GetAssetPropertyAggregates)
-> GetAssetPropertyAggregates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetAssetPropertyAggregates
-> Identity GetAssetPropertyAggregates
Lens
  GetAssetPropertyAggregates
  GetAssetPropertyAggregates
  (Maybe Text)
  (Maybe Text)
getAssetPropertyAggregates_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetAssetPropertyAggregates
 -> Identity GetAssetPropertyAggregates)
-> Maybe Text
-> GetAssetPropertyAggregates
-> GetAssetPropertyAggregates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetAssetPropertyAggregates
GetAssetPropertyAggregatesResponse
rs
          GetAssetPropertyAggregatesResponse
-> Getting (First Text) GetAssetPropertyAggregatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAssetPropertyAggregatesResponse
-> Const (First Text) GetAssetPropertyAggregatesResponse
Lens' GetAssetPropertyAggregatesResponse (Maybe Text)
getAssetPropertyAggregatesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAssetPropertyAggregatesResponse
 -> Const (First Text) GetAssetPropertyAggregatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAssetPropertyAggregatesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetAssetPropertyAggregates where
  type
    AWSResponse GetAssetPropertyAggregates =
      GetAssetPropertyAggregatesResponse
  request :: GetAssetPropertyAggregates -> Request GetAssetPropertyAggregates
request = Service
-> GetAssetPropertyAggregates -> Request GetAssetPropertyAggregates
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAssetPropertyAggregates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAssetPropertyAggregates)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAssetPropertyAggregates))
-> Logger
-> Service
-> Proxy GetAssetPropertyAggregates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAssetPropertyAggregates)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Int -> [AggregatedValue] -> GetAssetPropertyAggregatesResponse
GetAssetPropertyAggregatesResponse'
            (Maybe Text
 -> Int -> [AggregatedValue] -> GetAssetPropertyAggregatesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> [AggregatedValue] -> GetAssetPropertyAggregatesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String
  (Int -> [AggregatedValue] -> GetAssetPropertyAggregatesResponse)
-> Either String Int
-> Either
     String ([AggregatedValue] -> GetAssetPropertyAggregatesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String ([AggregatedValue] -> GetAssetPropertyAggregatesResponse)
-> Either String [AggregatedValue]
-> Either String GetAssetPropertyAggregatesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [AggregatedValue])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"aggregatedValues"
                            Either String (Maybe [AggregatedValue])
-> [AggregatedValue] -> Either String [AggregatedValue]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AggregatedValue]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable GetAssetPropertyAggregates

instance Prelude.NFData GetAssetPropertyAggregates

instance Core.ToHeaders GetAssetPropertyAggregates where
  toHeaders :: GetAssetPropertyAggregates -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAssetPropertyAggregates -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath GetAssetPropertyAggregates where
  toPath :: GetAssetPropertyAggregates -> ByteString
toPath = ByteString -> GetAssetPropertyAggregates -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/properties/aggregates"

instance Core.ToQuery GetAssetPropertyAggregates where
  toQuery :: GetAssetPropertyAggregates -> QueryString
toQuery GetAssetPropertyAggregates' {Maybe Natural
Maybe (NonEmpty Quality)
Maybe Text
Maybe TimeOrdering
NonEmpty AggregateType
Text
POSIX
endDate :: POSIX
startDate :: POSIX
resolution :: Text
aggregateTypes :: NonEmpty AggregateType
maxResults :: Maybe Natural
assetId :: Maybe Text
propertyId :: Maybe Text
nextToken :: Maybe Text
propertyAlias :: Maybe Text
timeOrdering :: Maybe TimeOrdering
qualities :: Maybe (NonEmpty Quality)
$sel:endDate:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> POSIX
$sel:startDate:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> POSIX
$sel:resolution:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Text
$sel:aggregateTypes:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> NonEmpty AggregateType
$sel:maxResults:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe Natural
$sel:assetId:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe Text
$sel:propertyId:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe Text
$sel:nextToken:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe Text
$sel:propertyAlias:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe Text
$sel:timeOrdering:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe TimeOrdering
$sel:qualities:GetAssetPropertyAggregates' :: GetAssetPropertyAggregates -> Maybe (NonEmpty Quality)
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"qualities"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> NonEmpty Quality -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" (NonEmpty Quality -> QueryString)
-> Maybe (NonEmpty Quality) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Quality)
qualities),
        ByteString
"timeOrdering" ByteString -> Maybe TimeOrdering -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TimeOrdering
timeOrdering,
        ByteString
"propertyAlias" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
propertyAlias,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"propertyId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
propertyId,
        ByteString
"assetId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
assetId,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults,
        ByteString
"aggregateTypes"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> NonEmpty AggregateType -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" NonEmpty AggregateType
aggregateTypes,
        ByteString
"resolution" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
resolution,
        ByteString
"startDate" ByteString -> POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: POSIX
startDate,
        ByteString
"endDate" ByteString -> POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: POSIX
endDate
      ]

-- | /See:/ 'newGetAssetPropertyAggregatesResponse' smart constructor.
data GetAssetPropertyAggregatesResponse = GetAssetPropertyAggregatesResponse'
  { -- | The token for the next set of results, or null if there are no
    -- additional results.
    GetAssetPropertyAggregatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetAssetPropertyAggregatesResponse -> Int
httpStatus :: Prelude.Int,
    -- | The requested aggregated values.
    GetAssetPropertyAggregatesResponse -> [AggregatedValue]
aggregatedValues :: [AggregatedValue]
  }
  deriving (GetAssetPropertyAggregatesResponse
-> GetAssetPropertyAggregatesResponse -> Bool
(GetAssetPropertyAggregatesResponse
 -> GetAssetPropertyAggregatesResponse -> Bool)
-> (GetAssetPropertyAggregatesResponse
    -> GetAssetPropertyAggregatesResponse -> Bool)
-> Eq GetAssetPropertyAggregatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAssetPropertyAggregatesResponse
-> GetAssetPropertyAggregatesResponse -> Bool
$c/= :: GetAssetPropertyAggregatesResponse
-> GetAssetPropertyAggregatesResponse -> Bool
== :: GetAssetPropertyAggregatesResponse
-> GetAssetPropertyAggregatesResponse -> Bool
$c== :: GetAssetPropertyAggregatesResponse
-> GetAssetPropertyAggregatesResponse -> Bool
Prelude.Eq, ReadPrec [GetAssetPropertyAggregatesResponse]
ReadPrec GetAssetPropertyAggregatesResponse
Int -> ReadS GetAssetPropertyAggregatesResponse
ReadS [GetAssetPropertyAggregatesResponse]
(Int -> ReadS GetAssetPropertyAggregatesResponse)
-> ReadS [GetAssetPropertyAggregatesResponse]
-> ReadPrec GetAssetPropertyAggregatesResponse
-> ReadPrec [GetAssetPropertyAggregatesResponse]
-> Read GetAssetPropertyAggregatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAssetPropertyAggregatesResponse]
$creadListPrec :: ReadPrec [GetAssetPropertyAggregatesResponse]
readPrec :: ReadPrec GetAssetPropertyAggregatesResponse
$creadPrec :: ReadPrec GetAssetPropertyAggregatesResponse
readList :: ReadS [GetAssetPropertyAggregatesResponse]
$creadList :: ReadS [GetAssetPropertyAggregatesResponse]
readsPrec :: Int -> ReadS GetAssetPropertyAggregatesResponse
$creadsPrec :: Int -> ReadS GetAssetPropertyAggregatesResponse
Prelude.Read, Int -> GetAssetPropertyAggregatesResponse -> ShowS
[GetAssetPropertyAggregatesResponse] -> ShowS
GetAssetPropertyAggregatesResponse -> String
(Int -> GetAssetPropertyAggregatesResponse -> ShowS)
-> (GetAssetPropertyAggregatesResponse -> String)
-> ([GetAssetPropertyAggregatesResponse] -> ShowS)
-> Show GetAssetPropertyAggregatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAssetPropertyAggregatesResponse] -> ShowS
$cshowList :: [GetAssetPropertyAggregatesResponse] -> ShowS
show :: GetAssetPropertyAggregatesResponse -> String
$cshow :: GetAssetPropertyAggregatesResponse -> String
showsPrec :: Int -> GetAssetPropertyAggregatesResponse -> ShowS
$cshowsPrec :: Int -> GetAssetPropertyAggregatesResponse -> ShowS
Prelude.Show, (forall x.
 GetAssetPropertyAggregatesResponse
 -> Rep GetAssetPropertyAggregatesResponse x)
-> (forall x.
    Rep GetAssetPropertyAggregatesResponse x
    -> GetAssetPropertyAggregatesResponse)
-> Generic GetAssetPropertyAggregatesResponse
forall x.
Rep GetAssetPropertyAggregatesResponse x
-> GetAssetPropertyAggregatesResponse
forall x.
GetAssetPropertyAggregatesResponse
-> Rep GetAssetPropertyAggregatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAssetPropertyAggregatesResponse x
-> GetAssetPropertyAggregatesResponse
$cfrom :: forall x.
GetAssetPropertyAggregatesResponse
-> Rep GetAssetPropertyAggregatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAssetPropertyAggregatesResponse' 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:
--
-- 'nextToken', 'getAssetPropertyAggregatesResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'httpStatus', 'getAssetPropertyAggregatesResponse_httpStatus' - The response's http status code.
--
-- 'aggregatedValues', 'getAssetPropertyAggregatesResponse_aggregatedValues' - The requested aggregated values.
newGetAssetPropertyAggregatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAssetPropertyAggregatesResponse
newGetAssetPropertyAggregatesResponse :: Int -> GetAssetPropertyAggregatesResponse
newGetAssetPropertyAggregatesResponse Int
pHttpStatus_ =
  GetAssetPropertyAggregatesResponse' :: Maybe Text
-> Int -> [AggregatedValue] -> GetAssetPropertyAggregatesResponse
GetAssetPropertyAggregatesResponse'
    { $sel:nextToken:GetAssetPropertyAggregatesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAssetPropertyAggregatesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:aggregatedValues:GetAssetPropertyAggregatesResponse' :: [AggregatedValue]
aggregatedValues = [AggregatedValue]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The token for the next set of results, or null if there are no
-- additional results.
getAssetPropertyAggregatesResponse_nextToken :: Lens.Lens' GetAssetPropertyAggregatesResponse (Prelude.Maybe Prelude.Text)
getAssetPropertyAggregatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetAssetPropertyAggregatesResponse
-> f GetAssetPropertyAggregatesResponse
getAssetPropertyAggregatesResponse_nextToken = (GetAssetPropertyAggregatesResponse -> Maybe Text)
-> (GetAssetPropertyAggregatesResponse
    -> Maybe Text -> GetAssetPropertyAggregatesResponse)
-> Lens' GetAssetPropertyAggregatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAssetPropertyAggregatesResponse' :: GetAssetPropertyAggregatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAssetPropertyAggregatesResponse
s@GetAssetPropertyAggregatesResponse' {} Maybe Text
a -> GetAssetPropertyAggregatesResponse
s {$sel:nextToken:GetAssetPropertyAggregatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetAssetPropertyAggregatesResponse)

-- | The response's http status code.
getAssetPropertyAggregatesResponse_httpStatus :: Lens.Lens' GetAssetPropertyAggregatesResponse Prelude.Int
getAssetPropertyAggregatesResponse_httpStatus :: (Int -> f Int)
-> GetAssetPropertyAggregatesResponse
-> f GetAssetPropertyAggregatesResponse
getAssetPropertyAggregatesResponse_httpStatus = (GetAssetPropertyAggregatesResponse -> Int)
-> (GetAssetPropertyAggregatesResponse
    -> Int -> GetAssetPropertyAggregatesResponse)
-> Lens
     GetAssetPropertyAggregatesResponse
     GetAssetPropertyAggregatesResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAssetPropertyAggregatesResponse' :: GetAssetPropertyAggregatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAssetPropertyAggregatesResponse
s@GetAssetPropertyAggregatesResponse' {} Int
a -> GetAssetPropertyAggregatesResponse
s {$sel:httpStatus:GetAssetPropertyAggregatesResponse' :: Int
httpStatus = Int
a} :: GetAssetPropertyAggregatesResponse)

-- | The requested aggregated values.
getAssetPropertyAggregatesResponse_aggregatedValues :: Lens.Lens' GetAssetPropertyAggregatesResponse [AggregatedValue]
getAssetPropertyAggregatesResponse_aggregatedValues :: ([AggregatedValue] -> f [AggregatedValue])
-> GetAssetPropertyAggregatesResponse
-> f GetAssetPropertyAggregatesResponse
getAssetPropertyAggregatesResponse_aggregatedValues = (GetAssetPropertyAggregatesResponse -> [AggregatedValue])
-> (GetAssetPropertyAggregatesResponse
    -> [AggregatedValue] -> GetAssetPropertyAggregatesResponse)
-> Lens' GetAssetPropertyAggregatesResponse [AggregatedValue]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyAggregatesResponse' {[AggregatedValue]
aggregatedValues :: [AggregatedValue]
$sel:aggregatedValues:GetAssetPropertyAggregatesResponse' :: GetAssetPropertyAggregatesResponse -> [AggregatedValue]
aggregatedValues} -> [AggregatedValue]
aggregatedValues) (\s :: GetAssetPropertyAggregatesResponse
s@GetAssetPropertyAggregatesResponse' {} [AggregatedValue]
a -> GetAssetPropertyAggregatesResponse
s {$sel:aggregatedValues:GetAssetPropertyAggregatesResponse' :: [AggregatedValue]
aggregatedValues = [AggregatedValue]
a} :: GetAssetPropertyAggregatesResponse) (([AggregatedValue] -> f [AggregatedValue])
 -> GetAssetPropertyAggregatesResponse
 -> f GetAssetPropertyAggregatesResponse)
-> (([AggregatedValue] -> f [AggregatedValue])
    -> [AggregatedValue] -> f [AggregatedValue])
-> ([AggregatedValue] -> f [AggregatedValue])
-> GetAssetPropertyAggregatesResponse
-> f GetAssetPropertyAggregatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AggregatedValue] -> f [AggregatedValue])
-> [AggregatedValue] -> f [AggregatedValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    GetAssetPropertyAggregatesResponse