{-# 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.BatchGetAssetPropertyValueHistory
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the historical values for one or more asset properties. 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/.
module Amazonka.IoTSiteWise.BatchGetAssetPropertyValueHistory
  ( -- * Creating a Request
    BatchGetAssetPropertyValueHistory (..),
    newBatchGetAssetPropertyValueHistory,

    -- * Request Lenses
    batchGetAssetPropertyValueHistory_maxResults,
    batchGetAssetPropertyValueHistory_nextToken,
    batchGetAssetPropertyValueHistory_entries,

    -- * Destructuring the Response
    BatchGetAssetPropertyValueHistoryResponse (..),
    newBatchGetAssetPropertyValueHistoryResponse,

    -- * Response Lenses
    batchGetAssetPropertyValueHistoryResponse_nextToken,
    batchGetAssetPropertyValueHistoryResponse_httpStatus,
    batchGetAssetPropertyValueHistoryResponse_errorEntries,
    batchGetAssetPropertyValueHistoryResponse_successEntries,
    batchGetAssetPropertyValueHistoryResponse_skippedEntries,
  )
where

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

-- | /See:/ 'newBatchGetAssetPropertyValueHistory' smart constructor.
data BatchGetAssetPropertyValueHistory = BatchGetAssetPropertyValueHistory'
  { -- | The maximum number of results to return for each paginated request. A
    -- result set is returned in the two cases, whichever occurs first.
    --
    -- -   The size of the result set is less than 1 MB.
    --
    -- -   The number of data points in the result set is less than the value
    --     of @maxResults@. The maximum value of @maxResults@ is 4000.
    BatchGetAssetPropertyValueHistory -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to be used for the next set of paginated results.
    BatchGetAssetPropertyValueHistory -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of asset property historical value entries for the batch get
    -- request. You can specify up to 16 entries per request.
    BatchGetAssetPropertyValueHistory
-> [BatchGetAssetPropertyValueHistoryEntry]
entries :: [BatchGetAssetPropertyValueHistoryEntry]
  }
  deriving (BatchGetAssetPropertyValueHistory
-> BatchGetAssetPropertyValueHistory -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyValueHistory
-> BatchGetAssetPropertyValueHistory -> Bool
$c/= :: BatchGetAssetPropertyValueHistory
-> BatchGetAssetPropertyValueHistory -> Bool
== :: BatchGetAssetPropertyValueHistory
-> BatchGetAssetPropertyValueHistory -> Bool
$c== :: BatchGetAssetPropertyValueHistory
-> BatchGetAssetPropertyValueHistory -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyValueHistory]
ReadPrec BatchGetAssetPropertyValueHistory
Int -> ReadS BatchGetAssetPropertyValueHistory
ReadS [BatchGetAssetPropertyValueHistory]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyValueHistory]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyValueHistory]
readPrec :: ReadPrec BatchGetAssetPropertyValueHistory
$creadPrec :: ReadPrec BatchGetAssetPropertyValueHistory
readList :: ReadS [BatchGetAssetPropertyValueHistory]
$creadList :: ReadS [BatchGetAssetPropertyValueHistory]
readsPrec :: Int -> ReadS BatchGetAssetPropertyValueHistory
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyValueHistory
Prelude.Read, Int -> BatchGetAssetPropertyValueHistory -> ShowS
[BatchGetAssetPropertyValueHistory] -> ShowS
BatchGetAssetPropertyValueHistory -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyValueHistory] -> ShowS
$cshowList :: [BatchGetAssetPropertyValueHistory] -> ShowS
show :: BatchGetAssetPropertyValueHistory -> String
$cshow :: BatchGetAssetPropertyValueHistory -> String
showsPrec :: Int -> BatchGetAssetPropertyValueHistory -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyValueHistory -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyValueHistory x
-> BatchGetAssetPropertyValueHistory
forall x.
BatchGetAssetPropertyValueHistory
-> Rep BatchGetAssetPropertyValueHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyValueHistory x
-> BatchGetAssetPropertyValueHistory
$cfrom :: forall x.
BatchGetAssetPropertyValueHistory
-> Rep BatchGetAssetPropertyValueHistory x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyValueHistory' 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:
--
-- 'maxResults', 'batchGetAssetPropertyValueHistory_maxResults' - The maximum number of results to return for each paginated request. A
-- result set is returned in the two cases, whichever occurs first.
--
-- -   The size of the result set is less than 1 MB.
--
-- -   The number of data points in the result set is less than the value
--     of @maxResults@. The maximum value of @maxResults@ is 4000.
--
-- 'nextToken', 'batchGetAssetPropertyValueHistory_nextToken' - The token to be used for the next set of paginated results.
--
-- 'entries', 'batchGetAssetPropertyValueHistory_entries' - The list of asset property historical value entries for the batch get
-- request. You can specify up to 16 entries per request.
newBatchGetAssetPropertyValueHistory ::
  BatchGetAssetPropertyValueHistory
newBatchGetAssetPropertyValueHistory :: BatchGetAssetPropertyValueHistory
newBatchGetAssetPropertyValueHistory =
  BatchGetAssetPropertyValueHistory'
    { $sel:maxResults:BatchGetAssetPropertyValueHistory' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchGetAssetPropertyValueHistory' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:entries:BatchGetAssetPropertyValueHistory' :: [BatchGetAssetPropertyValueHistoryEntry]
entries = forall a. Monoid a => a
Prelude.mempty
    }

-- | The maximum number of results to return for each paginated request. A
-- result set is returned in the two cases, whichever occurs first.
--
-- -   The size of the result set is less than 1 MB.
--
-- -   The number of data points in the result set is less than the value
--     of @maxResults@. The maximum value of @maxResults@ is 4000.
batchGetAssetPropertyValueHistory_maxResults :: Lens.Lens' BatchGetAssetPropertyValueHistory (Prelude.Maybe Prelude.Natural)
batchGetAssetPropertyValueHistory_maxResults :: Lens' BatchGetAssetPropertyValueHistory (Maybe Natural)
batchGetAssetPropertyValueHistory_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueHistory' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: BatchGetAssetPropertyValueHistory
s@BatchGetAssetPropertyValueHistory' {} Maybe Natural
a -> BatchGetAssetPropertyValueHistory
s {$sel:maxResults:BatchGetAssetPropertyValueHistory' :: Maybe Natural
maxResults = Maybe Natural
a} :: BatchGetAssetPropertyValueHistory)

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

-- | The list of asset property historical value entries for the batch get
-- request. You can specify up to 16 entries per request.
batchGetAssetPropertyValueHistory_entries :: Lens.Lens' BatchGetAssetPropertyValueHistory [BatchGetAssetPropertyValueHistoryEntry]
batchGetAssetPropertyValueHistory_entries :: Lens'
  BatchGetAssetPropertyValueHistory
  [BatchGetAssetPropertyValueHistoryEntry]
batchGetAssetPropertyValueHistory_entries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueHistory' {[BatchGetAssetPropertyValueHistoryEntry]
entries :: [BatchGetAssetPropertyValueHistoryEntry]
$sel:entries:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory
-> [BatchGetAssetPropertyValueHistoryEntry]
entries} -> [BatchGetAssetPropertyValueHistoryEntry]
entries) (\s :: BatchGetAssetPropertyValueHistory
s@BatchGetAssetPropertyValueHistory' {} [BatchGetAssetPropertyValueHistoryEntry]
a -> BatchGetAssetPropertyValueHistory
s {$sel:entries:BatchGetAssetPropertyValueHistory' :: [BatchGetAssetPropertyValueHistoryEntry]
entries = [BatchGetAssetPropertyValueHistoryEntry]
a} :: BatchGetAssetPropertyValueHistory) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    BatchGetAssetPropertyValueHistory
  where
  type
    AWSResponse BatchGetAssetPropertyValueHistory =
      BatchGetAssetPropertyValueHistoryResponse
  request :: (Service -> Service)
-> BatchGetAssetPropertyValueHistory
-> Request BatchGetAssetPropertyValueHistory
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy BatchGetAssetPropertyValueHistory
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse BatchGetAssetPropertyValueHistory)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Int
-> [BatchGetAssetPropertyValueHistoryErrorEntry]
-> [BatchGetAssetPropertyValueHistorySuccessEntry]
-> [BatchGetAssetPropertyValueHistorySkippedEntry]
-> BatchGetAssetPropertyValueHistoryResponse
BatchGetAssetPropertyValueHistoryResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"errorEntries" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"successEntries" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"skippedEntries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    BatchGetAssetPropertyValueHistory
  where
  hashWithSalt :: Int -> BatchGetAssetPropertyValueHistory -> Int
hashWithSalt
    Int
_salt
    BatchGetAssetPropertyValueHistory' {[BatchGetAssetPropertyValueHistoryEntry]
Maybe Natural
Maybe Text
entries :: [BatchGetAssetPropertyValueHistoryEntry]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:entries:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory
-> [BatchGetAssetPropertyValueHistoryEntry]
$sel:nextToken:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory -> Maybe Text
$sel:maxResults:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [BatchGetAssetPropertyValueHistoryEntry]
entries

instance
  Prelude.NFData
    BatchGetAssetPropertyValueHistory
  where
  rnf :: BatchGetAssetPropertyValueHistory -> ()
rnf BatchGetAssetPropertyValueHistory' {[BatchGetAssetPropertyValueHistoryEntry]
Maybe Natural
Maybe Text
entries :: [BatchGetAssetPropertyValueHistoryEntry]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:entries:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory
-> [BatchGetAssetPropertyValueHistoryEntry]
$sel:nextToken:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory -> Maybe Text
$sel:maxResults:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BatchGetAssetPropertyValueHistoryEntry]
entries

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

instance
  Data.ToJSON
    BatchGetAssetPropertyValueHistory
  where
  toJSON :: BatchGetAssetPropertyValueHistory -> Value
toJSON BatchGetAssetPropertyValueHistory' {[BatchGetAssetPropertyValueHistoryEntry]
Maybe Natural
Maybe Text
entries :: [BatchGetAssetPropertyValueHistoryEntry]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:entries:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory
-> [BatchGetAssetPropertyValueHistoryEntry]
$sel:nextToken:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory -> Maybe Text
$sel:maxResults:BatchGetAssetPropertyValueHistory' :: BatchGetAssetPropertyValueHistory -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"entries" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [BatchGetAssetPropertyValueHistoryEntry]
entries)
          ]
      )

instance
  Data.ToPath
    BatchGetAssetPropertyValueHistory
  where
  toPath :: BatchGetAssetPropertyValueHistory -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/properties/batch/history"

instance
  Data.ToQuery
    BatchGetAssetPropertyValueHistory
  where
  toQuery :: BatchGetAssetPropertyValueHistory -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchGetAssetPropertyValueHistoryResponse' smart constructor.
data BatchGetAssetPropertyValueHistoryResponse = BatchGetAssetPropertyValueHistoryResponse'
  { -- | The token for the next set of results, or null if there are no
    -- additional results.
    BatchGetAssetPropertyValueHistoryResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    BatchGetAssetPropertyValueHistoryResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of the errors (if any) associated with the batch request. Each
    -- error entry contains the @entryId@ of the entry that failed.
    BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistoryErrorEntry]
errorEntries :: [BatchGetAssetPropertyValueHistoryErrorEntry],
    -- | A list of entries that were processed successfully by this batch
    -- request. Each success entry contains the @entryId@ of the entry that
    -- succeeded and the latest query result.
    BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistorySuccessEntry]
successEntries :: [BatchGetAssetPropertyValueHistorySuccessEntry],
    -- | A list of entries that were not processed by this batch request. because
    -- these entries had been completely processed by previous paginated
    -- requests. Each skipped entry contains the @entryId@ of the entry that
    -- skipped.
    BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistorySkippedEntry]
skippedEntries :: [BatchGetAssetPropertyValueHistorySkippedEntry]
  }
  deriving (BatchGetAssetPropertyValueHistoryResponse
-> BatchGetAssetPropertyValueHistoryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyValueHistoryResponse
-> BatchGetAssetPropertyValueHistoryResponse -> Bool
$c/= :: BatchGetAssetPropertyValueHistoryResponse
-> BatchGetAssetPropertyValueHistoryResponse -> Bool
== :: BatchGetAssetPropertyValueHistoryResponse
-> BatchGetAssetPropertyValueHistoryResponse -> Bool
$c== :: BatchGetAssetPropertyValueHistoryResponse
-> BatchGetAssetPropertyValueHistoryResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyValueHistoryResponse]
ReadPrec BatchGetAssetPropertyValueHistoryResponse
Int -> ReadS BatchGetAssetPropertyValueHistoryResponse
ReadS [BatchGetAssetPropertyValueHistoryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyValueHistoryResponse]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyValueHistoryResponse]
readPrec :: ReadPrec BatchGetAssetPropertyValueHistoryResponse
$creadPrec :: ReadPrec BatchGetAssetPropertyValueHistoryResponse
readList :: ReadS [BatchGetAssetPropertyValueHistoryResponse]
$creadList :: ReadS [BatchGetAssetPropertyValueHistoryResponse]
readsPrec :: Int -> ReadS BatchGetAssetPropertyValueHistoryResponse
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyValueHistoryResponse
Prelude.Read, Int -> BatchGetAssetPropertyValueHistoryResponse -> ShowS
[BatchGetAssetPropertyValueHistoryResponse] -> ShowS
BatchGetAssetPropertyValueHistoryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyValueHistoryResponse] -> ShowS
$cshowList :: [BatchGetAssetPropertyValueHistoryResponse] -> ShowS
show :: BatchGetAssetPropertyValueHistoryResponse -> String
$cshow :: BatchGetAssetPropertyValueHistoryResponse -> String
showsPrec :: Int -> BatchGetAssetPropertyValueHistoryResponse -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyValueHistoryResponse -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyValueHistoryResponse x
-> BatchGetAssetPropertyValueHistoryResponse
forall x.
BatchGetAssetPropertyValueHistoryResponse
-> Rep BatchGetAssetPropertyValueHistoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyValueHistoryResponse x
-> BatchGetAssetPropertyValueHistoryResponse
$cfrom :: forall x.
BatchGetAssetPropertyValueHistoryResponse
-> Rep BatchGetAssetPropertyValueHistoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyValueHistoryResponse' 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', 'batchGetAssetPropertyValueHistoryResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'httpStatus', 'batchGetAssetPropertyValueHistoryResponse_httpStatus' - The response's http status code.
--
-- 'errorEntries', 'batchGetAssetPropertyValueHistoryResponse_errorEntries' - A list of the errors (if any) associated with the batch request. Each
-- error entry contains the @entryId@ of the entry that failed.
--
-- 'successEntries', 'batchGetAssetPropertyValueHistoryResponse_successEntries' - A list of entries that were processed successfully by this batch
-- request. Each success entry contains the @entryId@ of the entry that
-- succeeded and the latest query result.
--
-- 'skippedEntries', 'batchGetAssetPropertyValueHistoryResponse_skippedEntries' - A list of entries that were not processed by this batch request. because
-- these entries had been completely processed by previous paginated
-- requests. Each skipped entry contains the @entryId@ of the entry that
-- skipped.
newBatchGetAssetPropertyValueHistoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchGetAssetPropertyValueHistoryResponse
newBatchGetAssetPropertyValueHistoryResponse :: Int -> BatchGetAssetPropertyValueHistoryResponse
newBatchGetAssetPropertyValueHistoryResponse
  Int
pHttpStatus_ =
    BatchGetAssetPropertyValueHistoryResponse'
      { $sel:nextToken:BatchGetAssetPropertyValueHistoryResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchGetAssetPropertyValueHistoryResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:errorEntries:BatchGetAssetPropertyValueHistoryResponse' :: [BatchGetAssetPropertyValueHistoryErrorEntry]
errorEntries = forall a. Monoid a => a
Prelude.mempty,
        $sel:successEntries:BatchGetAssetPropertyValueHistoryResponse' :: [BatchGetAssetPropertyValueHistorySuccessEntry]
successEntries = forall a. Monoid a => a
Prelude.mempty,
        $sel:skippedEntries:BatchGetAssetPropertyValueHistoryResponse' :: [BatchGetAssetPropertyValueHistorySkippedEntry]
skippedEntries = forall a. Monoid a => a
Prelude.mempty
      }

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

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

-- | A list of the errors (if any) associated with the batch request. Each
-- error entry contains the @entryId@ of the entry that failed.
batchGetAssetPropertyValueHistoryResponse_errorEntries :: Lens.Lens' BatchGetAssetPropertyValueHistoryResponse [BatchGetAssetPropertyValueHistoryErrorEntry]
batchGetAssetPropertyValueHistoryResponse_errorEntries :: Lens'
  BatchGetAssetPropertyValueHistoryResponse
  [BatchGetAssetPropertyValueHistoryErrorEntry]
batchGetAssetPropertyValueHistoryResponse_errorEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueHistoryResponse' {[BatchGetAssetPropertyValueHistoryErrorEntry]
errorEntries :: [BatchGetAssetPropertyValueHistoryErrorEntry]
$sel:errorEntries:BatchGetAssetPropertyValueHistoryResponse' :: BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistoryErrorEntry]
errorEntries} -> [BatchGetAssetPropertyValueHistoryErrorEntry]
errorEntries) (\s :: BatchGetAssetPropertyValueHistoryResponse
s@BatchGetAssetPropertyValueHistoryResponse' {} [BatchGetAssetPropertyValueHistoryErrorEntry]
a -> BatchGetAssetPropertyValueHistoryResponse
s {$sel:errorEntries:BatchGetAssetPropertyValueHistoryResponse' :: [BatchGetAssetPropertyValueHistoryErrorEntry]
errorEntries = [BatchGetAssetPropertyValueHistoryErrorEntry]
a} :: BatchGetAssetPropertyValueHistoryResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of entries that were processed successfully by this batch
-- request. Each success entry contains the @entryId@ of the entry that
-- succeeded and the latest query result.
batchGetAssetPropertyValueHistoryResponse_successEntries :: Lens.Lens' BatchGetAssetPropertyValueHistoryResponse [BatchGetAssetPropertyValueHistorySuccessEntry]
batchGetAssetPropertyValueHistoryResponse_successEntries :: Lens'
  BatchGetAssetPropertyValueHistoryResponse
  [BatchGetAssetPropertyValueHistorySuccessEntry]
batchGetAssetPropertyValueHistoryResponse_successEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueHistoryResponse' {[BatchGetAssetPropertyValueHistorySuccessEntry]
successEntries :: [BatchGetAssetPropertyValueHistorySuccessEntry]
$sel:successEntries:BatchGetAssetPropertyValueHistoryResponse' :: BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistorySuccessEntry]
successEntries} -> [BatchGetAssetPropertyValueHistorySuccessEntry]
successEntries) (\s :: BatchGetAssetPropertyValueHistoryResponse
s@BatchGetAssetPropertyValueHistoryResponse' {} [BatchGetAssetPropertyValueHistorySuccessEntry]
a -> BatchGetAssetPropertyValueHistoryResponse
s {$sel:successEntries:BatchGetAssetPropertyValueHistoryResponse' :: [BatchGetAssetPropertyValueHistorySuccessEntry]
successEntries = [BatchGetAssetPropertyValueHistorySuccessEntry]
a} :: BatchGetAssetPropertyValueHistoryResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of entries that were not processed by this batch request. because
-- these entries had been completely processed by previous paginated
-- requests. Each skipped entry contains the @entryId@ of the entry that
-- skipped.
batchGetAssetPropertyValueHistoryResponse_skippedEntries :: Lens.Lens' BatchGetAssetPropertyValueHistoryResponse [BatchGetAssetPropertyValueHistorySkippedEntry]
batchGetAssetPropertyValueHistoryResponse_skippedEntries :: Lens'
  BatchGetAssetPropertyValueHistoryResponse
  [BatchGetAssetPropertyValueHistorySkippedEntry]
batchGetAssetPropertyValueHistoryResponse_skippedEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueHistoryResponse' {[BatchGetAssetPropertyValueHistorySkippedEntry]
skippedEntries :: [BatchGetAssetPropertyValueHistorySkippedEntry]
$sel:skippedEntries:BatchGetAssetPropertyValueHistoryResponse' :: BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistorySkippedEntry]
skippedEntries} -> [BatchGetAssetPropertyValueHistorySkippedEntry]
skippedEntries) (\s :: BatchGetAssetPropertyValueHistoryResponse
s@BatchGetAssetPropertyValueHistoryResponse' {} [BatchGetAssetPropertyValueHistorySkippedEntry]
a -> BatchGetAssetPropertyValueHistoryResponse
s {$sel:skippedEntries:BatchGetAssetPropertyValueHistoryResponse' :: [BatchGetAssetPropertyValueHistorySkippedEntry]
skippedEntries = [BatchGetAssetPropertyValueHistorySkippedEntry]
a} :: BatchGetAssetPropertyValueHistoryResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    BatchGetAssetPropertyValueHistoryResponse
  where
  rnf :: BatchGetAssetPropertyValueHistoryResponse -> ()
rnf BatchGetAssetPropertyValueHistoryResponse' {Int
[BatchGetAssetPropertyValueHistoryErrorEntry]
[BatchGetAssetPropertyValueHistorySkippedEntry]
[BatchGetAssetPropertyValueHistorySuccessEntry]
Maybe Text
skippedEntries :: [BatchGetAssetPropertyValueHistorySkippedEntry]
successEntries :: [BatchGetAssetPropertyValueHistorySuccessEntry]
errorEntries :: [BatchGetAssetPropertyValueHistoryErrorEntry]
httpStatus :: Int
nextToken :: Maybe Text
$sel:skippedEntries:BatchGetAssetPropertyValueHistoryResponse' :: BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistorySkippedEntry]
$sel:successEntries:BatchGetAssetPropertyValueHistoryResponse' :: BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistorySuccessEntry]
$sel:errorEntries:BatchGetAssetPropertyValueHistoryResponse' :: BatchGetAssetPropertyValueHistoryResponse
-> [BatchGetAssetPropertyValueHistoryErrorEntry]
$sel:httpStatus:BatchGetAssetPropertyValueHistoryResponse' :: BatchGetAssetPropertyValueHistoryResponse -> Int
$sel:nextToken:BatchGetAssetPropertyValueHistoryResponse' :: BatchGetAssetPropertyValueHistoryResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BatchGetAssetPropertyValueHistoryErrorEntry]
errorEntries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BatchGetAssetPropertyValueHistorySuccessEntry]
successEntries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BatchGetAssetPropertyValueHistorySkippedEntry]
skippedEntries