{-# 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.BatchGetAssetPropertyAggregates
-- 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 aggregated values (for example, average, minimum, and maximum) for
-- one or more asset properties. 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/.
module Amazonka.IoTSiteWise.BatchGetAssetPropertyAggregates
  ( -- * Creating a Request
    BatchGetAssetPropertyAggregates (..),
    newBatchGetAssetPropertyAggregates,

    -- * Request Lenses
    batchGetAssetPropertyAggregates_maxResults,
    batchGetAssetPropertyAggregates_nextToken,
    batchGetAssetPropertyAggregates_entries,

    -- * Destructuring the Response
    BatchGetAssetPropertyAggregatesResponse (..),
    newBatchGetAssetPropertyAggregatesResponse,

    -- * Response Lenses
    batchGetAssetPropertyAggregatesResponse_nextToken,
    batchGetAssetPropertyAggregatesResponse_httpStatus,
    batchGetAssetPropertyAggregatesResponse_errorEntries,
    batchGetAssetPropertyAggregatesResponse_successEntries,
    batchGetAssetPropertyAggregatesResponse_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:/ 'newBatchGetAssetPropertyAggregates' smart constructor.
data BatchGetAssetPropertyAggregates = BatchGetAssetPropertyAggregates'
  { -- | 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.
    BatchGetAssetPropertyAggregates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to be used for the next set of paginated results.
    BatchGetAssetPropertyAggregates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of asset property aggregate entries for the batch get request.
    -- You can specify up to 16 entries per request.
    BatchGetAssetPropertyAggregates
-> [BatchGetAssetPropertyAggregatesEntry]
entries :: [BatchGetAssetPropertyAggregatesEntry]
  }
  deriving (BatchGetAssetPropertyAggregates
-> BatchGetAssetPropertyAggregates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyAggregates
-> BatchGetAssetPropertyAggregates -> Bool
$c/= :: BatchGetAssetPropertyAggregates
-> BatchGetAssetPropertyAggregates -> Bool
== :: BatchGetAssetPropertyAggregates
-> BatchGetAssetPropertyAggregates -> Bool
$c== :: BatchGetAssetPropertyAggregates
-> BatchGetAssetPropertyAggregates -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyAggregates]
ReadPrec BatchGetAssetPropertyAggregates
Int -> ReadS BatchGetAssetPropertyAggregates
ReadS [BatchGetAssetPropertyAggregates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyAggregates]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyAggregates]
readPrec :: ReadPrec BatchGetAssetPropertyAggregates
$creadPrec :: ReadPrec BatchGetAssetPropertyAggregates
readList :: ReadS [BatchGetAssetPropertyAggregates]
$creadList :: ReadS [BatchGetAssetPropertyAggregates]
readsPrec :: Int -> ReadS BatchGetAssetPropertyAggregates
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyAggregates
Prelude.Read, Int -> BatchGetAssetPropertyAggregates -> ShowS
[BatchGetAssetPropertyAggregates] -> ShowS
BatchGetAssetPropertyAggregates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyAggregates] -> ShowS
$cshowList :: [BatchGetAssetPropertyAggregates] -> ShowS
show :: BatchGetAssetPropertyAggregates -> String
$cshow :: BatchGetAssetPropertyAggregates -> String
showsPrec :: Int -> BatchGetAssetPropertyAggregates -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyAggregates -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyAggregates x
-> BatchGetAssetPropertyAggregates
forall x.
BatchGetAssetPropertyAggregates
-> Rep BatchGetAssetPropertyAggregates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyAggregates x
-> BatchGetAssetPropertyAggregates
$cfrom :: forall x.
BatchGetAssetPropertyAggregates
-> Rep BatchGetAssetPropertyAggregates x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyAggregates' 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', 'batchGetAssetPropertyAggregates_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', 'batchGetAssetPropertyAggregates_nextToken' - The token to be used for the next set of paginated results.
--
-- 'entries', 'batchGetAssetPropertyAggregates_entries' - The list of asset property aggregate entries for the batch get request.
-- You can specify up to 16 entries per request.
newBatchGetAssetPropertyAggregates ::
  BatchGetAssetPropertyAggregates
newBatchGetAssetPropertyAggregates :: BatchGetAssetPropertyAggregates
newBatchGetAssetPropertyAggregates =
  BatchGetAssetPropertyAggregates'
    { $sel:maxResults:BatchGetAssetPropertyAggregates' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchGetAssetPropertyAggregates' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:entries:BatchGetAssetPropertyAggregates' :: [BatchGetAssetPropertyAggregatesEntry]
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.
batchGetAssetPropertyAggregates_maxResults :: Lens.Lens' BatchGetAssetPropertyAggregates (Prelude.Maybe Prelude.Natural)
batchGetAssetPropertyAggregates_maxResults :: Lens' BatchGetAssetPropertyAggregates (Maybe Natural)
batchGetAssetPropertyAggregates_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: BatchGetAssetPropertyAggregates
s@BatchGetAssetPropertyAggregates' {} Maybe Natural
a -> BatchGetAssetPropertyAggregates
s {$sel:maxResults:BatchGetAssetPropertyAggregates' :: Maybe Natural
maxResults = Maybe Natural
a} :: BatchGetAssetPropertyAggregates)

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

-- | The list of asset property aggregate entries for the batch get request.
-- You can specify up to 16 entries per request.
batchGetAssetPropertyAggregates_entries :: Lens.Lens' BatchGetAssetPropertyAggregates [BatchGetAssetPropertyAggregatesEntry]
batchGetAssetPropertyAggregates_entries :: Lens'
  BatchGetAssetPropertyAggregates
  [BatchGetAssetPropertyAggregatesEntry]
batchGetAssetPropertyAggregates_entries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregates' {[BatchGetAssetPropertyAggregatesEntry]
entries :: [BatchGetAssetPropertyAggregatesEntry]
$sel:entries:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates
-> [BatchGetAssetPropertyAggregatesEntry]
entries} -> [BatchGetAssetPropertyAggregatesEntry]
entries) (\s :: BatchGetAssetPropertyAggregates
s@BatchGetAssetPropertyAggregates' {} [BatchGetAssetPropertyAggregatesEntry]
a -> BatchGetAssetPropertyAggregates
s {$sel:entries:BatchGetAssetPropertyAggregates' :: [BatchGetAssetPropertyAggregatesEntry]
entries = [BatchGetAssetPropertyAggregatesEntry]
a} :: BatchGetAssetPropertyAggregates) 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
    BatchGetAssetPropertyAggregates
  where
  type
    AWSResponse BatchGetAssetPropertyAggregates =
      BatchGetAssetPropertyAggregatesResponse
  request :: (Service -> Service)
-> BatchGetAssetPropertyAggregates
-> Request BatchGetAssetPropertyAggregates
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 BatchGetAssetPropertyAggregates
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse BatchGetAssetPropertyAggregates)))
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
-> [BatchGetAssetPropertyAggregatesErrorEntry]
-> [BatchGetAssetPropertyAggregatesSuccessEntry]
-> [BatchGetAssetPropertyAggregatesSkippedEntry]
-> BatchGetAssetPropertyAggregatesResponse
BatchGetAssetPropertyAggregatesResponse'
            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
    BatchGetAssetPropertyAggregates
  where
  hashWithSalt :: Int -> BatchGetAssetPropertyAggregates -> Int
hashWithSalt
    Int
_salt
    BatchGetAssetPropertyAggregates' {[BatchGetAssetPropertyAggregatesEntry]
Maybe Natural
Maybe Text
entries :: [BatchGetAssetPropertyAggregatesEntry]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:entries:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates
-> [BatchGetAssetPropertyAggregatesEntry]
$sel:nextToken:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates -> Maybe Text
$sel:maxResults:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates -> 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` [BatchGetAssetPropertyAggregatesEntry]
entries

instance
  Prelude.NFData
    BatchGetAssetPropertyAggregates
  where
  rnf :: BatchGetAssetPropertyAggregates -> ()
rnf BatchGetAssetPropertyAggregates' {[BatchGetAssetPropertyAggregatesEntry]
Maybe Natural
Maybe Text
entries :: [BatchGetAssetPropertyAggregatesEntry]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:entries:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates
-> [BatchGetAssetPropertyAggregatesEntry]
$sel:nextToken:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates -> Maybe Text
$sel:maxResults:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates -> 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 [BatchGetAssetPropertyAggregatesEntry]
entries

instance
  Data.ToHeaders
    BatchGetAssetPropertyAggregates
  where
  toHeaders :: BatchGetAssetPropertyAggregates -> 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 BatchGetAssetPropertyAggregates where
  toJSON :: BatchGetAssetPropertyAggregates -> Value
toJSON BatchGetAssetPropertyAggregates' {[BatchGetAssetPropertyAggregatesEntry]
Maybe Natural
Maybe Text
entries :: [BatchGetAssetPropertyAggregatesEntry]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:entries:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates
-> [BatchGetAssetPropertyAggregatesEntry]
$sel:nextToken:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates -> Maybe Text
$sel:maxResults:BatchGetAssetPropertyAggregates' :: BatchGetAssetPropertyAggregates -> 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..= [BatchGetAssetPropertyAggregatesEntry]
entries)
          ]
      )

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

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

-- | /See:/ 'newBatchGetAssetPropertyAggregatesResponse' smart constructor.
data BatchGetAssetPropertyAggregatesResponse = BatchGetAssetPropertyAggregatesResponse'
  { -- | The token for the next set of results, or null if there are no
    -- additional results.
    BatchGetAssetPropertyAggregatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    BatchGetAssetPropertyAggregatesResponse -> 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.
    BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesErrorEntry]
errorEntries :: [BatchGetAssetPropertyAggregatesErrorEntry],
    -- | 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.
    BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesSuccessEntry]
successEntries :: [BatchGetAssetPropertyAggregatesSuccessEntry],
    -- | 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.
    BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesSkippedEntry]
skippedEntries :: [BatchGetAssetPropertyAggregatesSkippedEntry]
  }
  deriving (BatchGetAssetPropertyAggregatesResponse
-> BatchGetAssetPropertyAggregatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyAggregatesResponse
-> BatchGetAssetPropertyAggregatesResponse -> Bool
$c/= :: BatchGetAssetPropertyAggregatesResponse
-> BatchGetAssetPropertyAggregatesResponse -> Bool
== :: BatchGetAssetPropertyAggregatesResponse
-> BatchGetAssetPropertyAggregatesResponse -> Bool
$c== :: BatchGetAssetPropertyAggregatesResponse
-> BatchGetAssetPropertyAggregatesResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyAggregatesResponse]
ReadPrec BatchGetAssetPropertyAggregatesResponse
Int -> ReadS BatchGetAssetPropertyAggregatesResponse
ReadS [BatchGetAssetPropertyAggregatesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyAggregatesResponse]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyAggregatesResponse]
readPrec :: ReadPrec BatchGetAssetPropertyAggregatesResponse
$creadPrec :: ReadPrec BatchGetAssetPropertyAggregatesResponse
readList :: ReadS [BatchGetAssetPropertyAggregatesResponse]
$creadList :: ReadS [BatchGetAssetPropertyAggregatesResponse]
readsPrec :: Int -> ReadS BatchGetAssetPropertyAggregatesResponse
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyAggregatesResponse
Prelude.Read, Int -> BatchGetAssetPropertyAggregatesResponse -> ShowS
[BatchGetAssetPropertyAggregatesResponse] -> ShowS
BatchGetAssetPropertyAggregatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyAggregatesResponse] -> ShowS
$cshowList :: [BatchGetAssetPropertyAggregatesResponse] -> ShowS
show :: BatchGetAssetPropertyAggregatesResponse -> String
$cshow :: BatchGetAssetPropertyAggregatesResponse -> String
showsPrec :: Int -> BatchGetAssetPropertyAggregatesResponse -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyAggregatesResponse -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyAggregatesResponse x
-> BatchGetAssetPropertyAggregatesResponse
forall x.
BatchGetAssetPropertyAggregatesResponse
-> Rep BatchGetAssetPropertyAggregatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyAggregatesResponse x
-> BatchGetAssetPropertyAggregatesResponse
$cfrom :: forall x.
BatchGetAssetPropertyAggregatesResponse
-> Rep BatchGetAssetPropertyAggregatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyAggregatesResponse' 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', 'batchGetAssetPropertyAggregatesResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'httpStatus', 'batchGetAssetPropertyAggregatesResponse_httpStatus' - The response's http status code.
--
-- 'errorEntries', 'batchGetAssetPropertyAggregatesResponse_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', 'batchGetAssetPropertyAggregatesResponse_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', 'batchGetAssetPropertyAggregatesResponse_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.
newBatchGetAssetPropertyAggregatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchGetAssetPropertyAggregatesResponse
newBatchGetAssetPropertyAggregatesResponse :: Int -> BatchGetAssetPropertyAggregatesResponse
newBatchGetAssetPropertyAggregatesResponse
  Int
pHttpStatus_ =
    BatchGetAssetPropertyAggregatesResponse'
      { $sel:nextToken:BatchGetAssetPropertyAggregatesResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:BatchGetAssetPropertyAggregatesResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:errorEntries:BatchGetAssetPropertyAggregatesResponse' :: [BatchGetAssetPropertyAggregatesErrorEntry]
errorEntries = forall a. Monoid a => a
Prelude.mempty,
        $sel:successEntries:BatchGetAssetPropertyAggregatesResponse' :: [BatchGetAssetPropertyAggregatesSuccessEntry]
successEntries = forall a. Monoid a => a
Prelude.mempty,
        $sel:skippedEntries:BatchGetAssetPropertyAggregatesResponse' :: [BatchGetAssetPropertyAggregatesSkippedEntry]
skippedEntries = forall a. Monoid a => a
Prelude.mempty
      }

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

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

-- | A list of the errors (if any) associated with the batch request. Each
-- error entry contains the @entryId@ of the entry that failed.
batchGetAssetPropertyAggregatesResponse_errorEntries :: Lens.Lens' BatchGetAssetPropertyAggregatesResponse [BatchGetAssetPropertyAggregatesErrorEntry]
batchGetAssetPropertyAggregatesResponse_errorEntries :: Lens'
  BatchGetAssetPropertyAggregatesResponse
  [BatchGetAssetPropertyAggregatesErrorEntry]
batchGetAssetPropertyAggregatesResponse_errorEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesResponse' {[BatchGetAssetPropertyAggregatesErrorEntry]
errorEntries :: [BatchGetAssetPropertyAggregatesErrorEntry]
$sel:errorEntries:BatchGetAssetPropertyAggregatesResponse' :: BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesErrorEntry]
errorEntries} -> [BatchGetAssetPropertyAggregatesErrorEntry]
errorEntries) (\s :: BatchGetAssetPropertyAggregatesResponse
s@BatchGetAssetPropertyAggregatesResponse' {} [BatchGetAssetPropertyAggregatesErrorEntry]
a -> BatchGetAssetPropertyAggregatesResponse
s {$sel:errorEntries:BatchGetAssetPropertyAggregatesResponse' :: [BatchGetAssetPropertyAggregatesErrorEntry]
errorEntries = [BatchGetAssetPropertyAggregatesErrorEntry]
a} :: BatchGetAssetPropertyAggregatesResponse) 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.
batchGetAssetPropertyAggregatesResponse_successEntries :: Lens.Lens' BatchGetAssetPropertyAggregatesResponse [BatchGetAssetPropertyAggregatesSuccessEntry]
batchGetAssetPropertyAggregatesResponse_successEntries :: Lens'
  BatchGetAssetPropertyAggregatesResponse
  [BatchGetAssetPropertyAggregatesSuccessEntry]
batchGetAssetPropertyAggregatesResponse_successEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesResponse' {[BatchGetAssetPropertyAggregatesSuccessEntry]
successEntries :: [BatchGetAssetPropertyAggregatesSuccessEntry]
$sel:successEntries:BatchGetAssetPropertyAggregatesResponse' :: BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesSuccessEntry]
successEntries} -> [BatchGetAssetPropertyAggregatesSuccessEntry]
successEntries) (\s :: BatchGetAssetPropertyAggregatesResponse
s@BatchGetAssetPropertyAggregatesResponse' {} [BatchGetAssetPropertyAggregatesSuccessEntry]
a -> BatchGetAssetPropertyAggregatesResponse
s {$sel:successEntries:BatchGetAssetPropertyAggregatesResponse' :: [BatchGetAssetPropertyAggregatesSuccessEntry]
successEntries = [BatchGetAssetPropertyAggregatesSuccessEntry]
a} :: BatchGetAssetPropertyAggregatesResponse) 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.
batchGetAssetPropertyAggregatesResponse_skippedEntries :: Lens.Lens' BatchGetAssetPropertyAggregatesResponse [BatchGetAssetPropertyAggregatesSkippedEntry]
batchGetAssetPropertyAggregatesResponse_skippedEntries :: Lens'
  BatchGetAssetPropertyAggregatesResponse
  [BatchGetAssetPropertyAggregatesSkippedEntry]
batchGetAssetPropertyAggregatesResponse_skippedEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesResponse' {[BatchGetAssetPropertyAggregatesSkippedEntry]
skippedEntries :: [BatchGetAssetPropertyAggregatesSkippedEntry]
$sel:skippedEntries:BatchGetAssetPropertyAggregatesResponse' :: BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesSkippedEntry]
skippedEntries} -> [BatchGetAssetPropertyAggregatesSkippedEntry]
skippedEntries) (\s :: BatchGetAssetPropertyAggregatesResponse
s@BatchGetAssetPropertyAggregatesResponse' {} [BatchGetAssetPropertyAggregatesSkippedEntry]
a -> BatchGetAssetPropertyAggregatesResponse
s {$sel:skippedEntries:BatchGetAssetPropertyAggregatesResponse' :: [BatchGetAssetPropertyAggregatesSkippedEntry]
skippedEntries = [BatchGetAssetPropertyAggregatesSkippedEntry]
a} :: BatchGetAssetPropertyAggregatesResponse) 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
    BatchGetAssetPropertyAggregatesResponse
  where
  rnf :: BatchGetAssetPropertyAggregatesResponse -> ()
rnf BatchGetAssetPropertyAggregatesResponse' {Int
[BatchGetAssetPropertyAggregatesErrorEntry]
[BatchGetAssetPropertyAggregatesSkippedEntry]
[BatchGetAssetPropertyAggregatesSuccessEntry]
Maybe Text
skippedEntries :: [BatchGetAssetPropertyAggregatesSkippedEntry]
successEntries :: [BatchGetAssetPropertyAggregatesSuccessEntry]
errorEntries :: [BatchGetAssetPropertyAggregatesErrorEntry]
httpStatus :: Int
nextToken :: Maybe Text
$sel:skippedEntries:BatchGetAssetPropertyAggregatesResponse' :: BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesSkippedEntry]
$sel:successEntries:BatchGetAssetPropertyAggregatesResponse' :: BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesSuccessEntry]
$sel:errorEntries:BatchGetAssetPropertyAggregatesResponse' :: BatchGetAssetPropertyAggregatesResponse
-> [BatchGetAssetPropertyAggregatesErrorEntry]
$sel:httpStatus:BatchGetAssetPropertyAggregatesResponse' :: BatchGetAssetPropertyAggregatesResponse -> Int
$sel:nextToken:BatchGetAssetPropertyAggregatesResponse' :: BatchGetAssetPropertyAggregatesResponse -> 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 [BatchGetAssetPropertyAggregatesErrorEntry]
errorEntries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BatchGetAssetPropertyAggregatesSuccessEntry]
successEntries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BatchGetAssetPropertyAggregatesSkippedEntry]
skippedEntries