{-# 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.GetAssetPropertyValueHistory
-- 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 the history of an asset property\'s values. For more information,
-- see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#historical-values Querying historical values>
-- 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.GetAssetPropertyValueHistory
  ( -- * Creating a Request
    GetAssetPropertyValueHistory (..),
    newGetAssetPropertyValueHistory,

    -- * Request Lenses
    getAssetPropertyValueHistory_endDate,
    getAssetPropertyValueHistory_qualities,
    getAssetPropertyValueHistory_timeOrdering,
    getAssetPropertyValueHistory_propertyAlias,
    getAssetPropertyValueHistory_startDate,
    getAssetPropertyValueHistory_nextToken,
    getAssetPropertyValueHistory_propertyId,
    getAssetPropertyValueHistory_assetId,
    getAssetPropertyValueHistory_maxResults,

    -- * Destructuring the Response
    GetAssetPropertyValueHistoryResponse (..),
    newGetAssetPropertyValueHistoryResponse,

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

-- |
-- Create a value of 'GetAssetPropertyValueHistory' 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:
--
-- 'endDate', 'getAssetPropertyValueHistory_endDate' - The inclusive end of the range from which to query historical data,
-- expressed in seconds in Unix epoch time.
--
-- 'qualities', 'getAssetPropertyValueHistory_qualities' - The quality by which to filter asset data.
--
-- 'timeOrdering', 'getAssetPropertyValueHistory_timeOrdering' - The chronological sorting order of the requested information.
--
-- Default: @ASCENDING@
--
-- 'propertyAlias', 'getAssetPropertyValueHistory_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/.
--
-- 'startDate', 'getAssetPropertyValueHistory_startDate' - The exclusive start of the range from which to query historical data,
-- expressed in seconds in Unix epoch time.
--
-- 'nextToken', 'getAssetPropertyValueHistory_nextToken' - The token to be used for the next set of paginated results.
--
-- 'propertyId', 'getAssetPropertyValueHistory_propertyId' - The ID of the asset property.
--
-- 'assetId', 'getAssetPropertyValueHistory_assetId' - The ID of the asset.
--
-- 'maxResults', 'getAssetPropertyValueHistory_maxResults' - The maximum number of results to return for each paginated request.
--
-- Default: 100
newGetAssetPropertyValueHistory ::
  GetAssetPropertyValueHistory
newGetAssetPropertyValueHistory :: GetAssetPropertyValueHistory
newGetAssetPropertyValueHistory =
  GetAssetPropertyValueHistory' :: Maybe POSIX
-> Maybe (NonEmpty Quality)
-> Maybe TimeOrdering
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> GetAssetPropertyValueHistory
GetAssetPropertyValueHistory'
    { $sel:endDate:GetAssetPropertyValueHistory' :: Maybe POSIX
endDate =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:qualities:GetAssetPropertyValueHistory' :: Maybe (NonEmpty Quality)
qualities = Maybe (NonEmpty Quality)
forall a. Maybe a
Prelude.Nothing,
      $sel:timeOrdering:GetAssetPropertyValueHistory' :: Maybe TimeOrdering
timeOrdering = Maybe TimeOrdering
forall a. Maybe a
Prelude.Nothing,
      $sel:propertyAlias:GetAssetPropertyValueHistory' :: Maybe Text
propertyAlias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:GetAssetPropertyValueHistory' :: Maybe POSIX
startDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetAssetPropertyValueHistory' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:propertyId:GetAssetPropertyValueHistory' :: Maybe Text
propertyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:assetId:GetAssetPropertyValueHistory' :: Maybe Text
assetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetAssetPropertyValueHistory' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

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

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

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

instance Core.AWSPager GetAssetPropertyValueHistory where
  page :: GetAssetPropertyValueHistory
-> AWSResponse GetAssetPropertyValueHistory
-> Maybe GetAssetPropertyValueHistory
page GetAssetPropertyValueHistory
rq AWSResponse GetAssetPropertyValueHistory
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAssetPropertyValueHistory
GetAssetPropertyValueHistoryResponse
rs
            GetAssetPropertyValueHistoryResponse
-> Getting (First Text) GetAssetPropertyValueHistoryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAssetPropertyValueHistoryResponse
-> Const (First Text) GetAssetPropertyValueHistoryResponse
Lens' GetAssetPropertyValueHistoryResponse (Maybe Text)
getAssetPropertyValueHistoryResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAssetPropertyValueHistoryResponse
 -> Const (First Text) GetAssetPropertyValueHistoryResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAssetPropertyValueHistoryResponse 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 GetAssetPropertyValueHistory
forall a. Maybe a
Prelude.Nothing
    | [AssetPropertyValue] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAssetPropertyValueHistory
GetAssetPropertyValueHistoryResponse
rs
            GetAssetPropertyValueHistoryResponse
-> Getting
     [AssetPropertyValue]
     GetAssetPropertyValueHistoryResponse
     [AssetPropertyValue]
-> [AssetPropertyValue]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [AssetPropertyValue]
  GetAssetPropertyValueHistoryResponse
  [AssetPropertyValue]
Lens' GetAssetPropertyValueHistoryResponse [AssetPropertyValue]
getAssetPropertyValueHistoryResponse_assetPropertyValueHistory
        ) =
      Maybe GetAssetPropertyValueHistory
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetAssetPropertyValueHistory -> Maybe GetAssetPropertyValueHistory
forall a. a -> Maybe a
Prelude.Just (GetAssetPropertyValueHistory
 -> Maybe GetAssetPropertyValueHistory)
-> GetAssetPropertyValueHistory
-> Maybe GetAssetPropertyValueHistory
forall a b. (a -> b) -> a -> b
Prelude.$
        GetAssetPropertyValueHistory
rq
          GetAssetPropertyValueHistory
-> (GetAssetPropertyValueHistory -> GetAssetPropertyValueHistory)
-> GetAssetPropertyValueHistory
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetAssetPropertyValueHistory
-> Identity GetAssetPropertyValueHistory
Lens
  GetAssetPropertyValueHistory
  GetAssetPropertyValueHistory
  (Maybe Text)
  (Maybe Text)
getAssetPropertyValueHistory_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetAssetPropertyValueHistory
 -> Identity GetAssetPropertyValueHistory)
-> Maybe Text
-> GetAssetPropertyValueHistory
-> GetAssetPropertyValueHistory
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetAssetPropertyValueHistory
GetAssetPropertyValueHistoryResponse
rs
          GetAssetPropertyValueHistoryResponse
-> Getting (First Text) GetAssetPropertyValueHistoryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAssetPropertyValueHistoryResponse
-> Const (First Text) GetAssetPropertyValueHistoryResponse
Lens' GetAssetPropertyValueHistoryResponse (Maybe Text)
getAssetPropertyValueHistoryResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAssetPropertyValueHistoryResponse
 -> Const (First Text) GetAssetPropertyValueHistoryResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAssetPropertyValueHistoryResponse 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 GetAssetPropertyValueHistory where
  type
    AWSResponse GetAssetPropertyValueHistory =
      GetAssetPropertyValueHistoryResponse
  request :: GetAssetPropertyValueHistory
-> Request GetAssetPropertyValueHistory
request = Service
-> GetAssetPropertyValueHistory
-> Request GetAssetPropertyValueHistory
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAssetPropertyValueHistory
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAssetPropertyValueHistory)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAssetPropertyValueHistory))
-> Logger
-> Service
-> Proxy GetAssetPropertyValueHistory
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAssetPropertyValueHistory)))
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
-> [AssetPropertyValue]
-> GetAssetPropertyValueHistoryResponse
GetAssetPropertyValueHistoryResponse'
            (Maybe Text
 -> Int
 -> [AssetPropertyValue]
 -> GetAssetPropertyValueHistoryResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [AssetPropertyValue] -> GetAssetPropertyValueHistoryResponse)
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
   -> [AssetPropertyValue] -> GetAssetPropertyValueHistoryResponse)
-> Either String Int
-> Either
     String
     ([AssetPropertyValue] -> GetAssetPropertyValueHistoryResponse)
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
  ([AssetPropertyValue] -> GetAssetPropertyValueHistoryResponse)
-> Either String [AssetPropertyValue]
-> Either String GetAssetPropertyValueHistoryResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [AssetPropertyValue])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"assetPropertyValueHistory"
                            Either String (Maybe [AssetPropertyValue])
-> [AssetPropertyValue] -> Either String [AssetPropertyValue]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AssetPropertyValue]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    GetAssetPropertyValueHistory

instance Prelude.NFData GetAssetPropertyValueHistory

instance Core.ToHeaders GetAssetPropertyValueHistory where
  toHeaders :: GetAssetPropertyValueHistory -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAssetPropertyValueHistory -> 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 GetAssetPropertyValueHistory where
  toPath :: GetAssetPropertyValueHistory -> ByteString
toPath = ByteString -> GetAssetPropertyValueHistory -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/properties/history"

instance Core.ToQuery GetAssetPropertyValueHistory where
  toQuery :: GetAssetPropertyValueHistory -> QueryString
toQuery GetAssetPropertyValueHistory' {Maybe Natural
Maybe (NonEmpty Quality)
Maybe Text
Maybe POSIX
Maybe TimeOrdering
maxResults :: Maybe Natural
assetId :: Maybe Text
propertyId :: Maybe Text
nextToken :: Maybe Text
startDate :: Maybe POSIX
propertyAlias :: Maybe Text
timeOrdering :: Maybe TimeOrdering
qualities :: Maybe (NonEmpty Quality)
endDate :: Maybe POSIX
$sel:maxResults:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe Natural
$sel:assetId:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe Text
$sel:propertyId:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe Text
$sel:nextToken:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe Text
$sel:startDate:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe POSIX
$sel:propertyAlias:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe Text
$sel:timeOrdering:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe TimeOrdering
$sel:qualities:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe (NonEmpty Quality)
$sel:endDate:GetAssetPropertyValueHistory' :: GetAssetPropertyValueHistory -> Maybe POSIX
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"endDate" ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
endDate,
        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
"startDate" ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
startDate,
        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
      ]

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

-- |
-- Create a value of 'GetAssetPropertyValueHistoryResponse' 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', 'getAssetPropertyValueHistoryResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'httpStatus', 'getAssetPropertyValueHistoryResponse_httpStatus' - The response's http status code.
--
-- 'assetPropertyValueHistory', 'getAssetPropertyValueHistoryResponse_assetPropertyValueHistory' - The asset property\'s value history.
newGetAssetPropertyValueHistoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAssetPropertyValueHistoryResponse
newGetAssetPropertyValueHistoryResponse :: Int -> GetAssetPropertyValueHistoryResponse
newGetAssetPropertyValueHistoryResponse Int
pHttpStatus_ =
  GetAssetPropertyValueHistoryResponse' :: Maybe Text
-> Int
-> [AssetPropertyValue]
-> GetAssetPropertyValueHistoryResponse
GetAssetPropertyValueHistoryResponse'
    { $sel:nextToken:GetAssetPropertyValueHistoryResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAssetPropertyValueHistoryResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:assetPropertyValueHistory:GetAssetPropertyValueHistoryResponse' :: [AssetPropertyValue]
assetPropertyValueHistory =
        [AssetPropertyValue]
forall a. Monoid a => a
Prelude.mempty
    }

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

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

-- | The asset property\'s value history.
getAssetPropertyValueHistoryResponse_assetPropertyValueHistory :: Lens.Lens' GetAssetPropertyValueHistoryResponse [AssetPropertyValue]
getAssetPropertyValueHistoryResponse_assetPropertyValueHistory :: ([AssetPropertyValue] -> f [AssetPropertyValue])
-> GetAssetPropertyValueHistoryResponse
-> f GetAssetPropertyValueHistoryResponse
getAssetPropertyValueHistoryResponse_assetPropertyValueHistory = (GetAssetPropertyValueHistoryResponse -> [AssetPropertyValue])
-> (GetAssetPropertyValueHistoryResponse
    -> [AssetPropertyValue] -> GetAssetPropertyValueHistoryResponse)
-> Lens' GetAssetPropertyValueHistoryResponse [AssetPropertyValue]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyValueHistoryResponse' {[AssetPropertyValue]
assetPropertyValueHistory :: [AssetPropertyValue]
$sel:assetPropertyValueHistory:GetAssetPropertyValueHistoryResponse' :: GetAssetPropertyValueHistoryResponse -> [AssetPropertyValue]
assetPropertyValueHistory} -> [AssetPropertyValue]
assetPropertyValueHistory) (\s :: GetAssetPropertyValueHistoryResponse
s@GetAssetPropertyValueHistoryResponse' {} [AssetPropertyValue]
a -> GetAssetPropertyValueHistoryResponse
s {$sel:assetPropertyValueHistory:GetAssetPropertyValueHistoryResponse' :: [AssetPropertyValue]
assetPropertyValueHistory = [AssetPropertyValue]
a} :: GetAssetPropertyValueHistoryResponse) (([AssetPropertyValue] -> f [AssetPropertyValue])
 -> GetAssetPropertyValueHistoryResponse
 -> f GetAssetPropertyValueHistoryResponse)
-> (([AssetPropertyValue] -> f [AssetPropertyValue])
    -> [AssetPropertyValue] -> f [AssetPropertyValue])
-> ([AssetPropertyValue] -> f [AssetPropertyValue])
-> GetAssetPropertyValueHistoryResponse
-> f GetAssetPropertyValueHistoryResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetPropertyValue] -> f [AssetPropertyValue])
-> [AssetPropertyValue] -> f [AssetPropertyValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    GetAssetPropertyValueHistoryResponse