{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTSiteWise.Types.BatchGetAssetPropertyAggregatesErrorEntry
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoTSiteWise.Types.BatchGetAssetPropertyAggregatesErrorEntry 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.BatchGetAssetPropertyAggregatesErrorCode
import qualified Amazonka.Prelude as Prelude

-- | Contains error information for an asset property aggregate entry that is
-- associated with the
-- <https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html BatchGetAssetPropertyAggregates>
-- API.
--
-- /See:/ 'newBatchGetAssetPropertyAggregatesErrorEntry' smart constructor.
data BatchGetAssetPropertyAggregatesErrorEntry = BatchGetAssetPropertyAggregatesErrorEntry'
  { -- | The error code.
    BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorCode
errorCode :: BatchGetAssetPropertyAggregatesErrorCode,
    -- | The associated error message.
    BatchGetAssetPropertyAggregatesErrorEntry -> Text
errorMessage :: Prelude.Text,
    -- | The ID of the entry.
    BatchGetAssetPropertyAggregatesErrorEntry -> Text
entryId :: Prelude.Text
  }
  deriving (BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorEntry -> Bool
$c/= :: BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorEntry -> Bool
== :: BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorEntry -> Bool
$c== :: BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorEntry -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyAggregatesErrorEntry]
ReadPrec BatchGetAssetPropertyAggregatesErrorEntry
Int -> ReadS BatchGetAssetPropertyAggregatesErrorEntry
ReadS [BatchGetAssetPropertyAggregatesErrorEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyAggregatesErrorEntry]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyAggregatesErrorEntry]
readPrec :: ReadPrec BatchGetAssetPropertyAggregatesErrorEntry
$creadPrec :: ReadPrec BatchGetAssetPropertyAggregatesErrorEntry
readList :: ReadS [BatchGetAssetPropertyAggregatesErrorEntry]
$creadList :: ReadS [BatchGetAssetPropertyAggregatesErrorEntry]
readsPrec :: Int -> ReadS BatchGetAssetPropertyAggregatesErrorEntry
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyAggregatesErrorEntry
Prelude.Read, Int -> BatchGetAssetPropertyAggregatesErrorEntry -> ShowS
[BatchGetAssetPropertyAggregatesErrorEntry] -> ShowS
BatchGetAssetPropertyAggregatesErrorEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyAggregatesErrorEntry] -> ShowS
$cshowList :: [BatchGetAssetPropertyAggregatesErrorEntry] -> ShowS
show :: BatchGetAssetPropertyAggregatesErrorEntry -> String
$cshow :: BatchGetAssetPropertyAggregatesErrorEntry -> String
showsPrec :: Int -> BatchGetAssetPropertyAggregatesErrorEntry -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyAggregatesErrorEntry -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyAggregatesErrorEntry x
-> BatchGetAssetPropertyAggregatesErrorEntry
forall x.
BatchGetAssetPropertyAggregatesErrorEntry
-> Rep BatchGetAssetPropertyAggregatesErrorEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyAggregatesErrorEntry x
-> BatchGetAssetPropertyAggregatesErrorEntry
$cfrom :: forall x.
BatchGetAssetPropertyAggregatesErrorEntry
-> Rep BatchGetAssetPropertyAggregatesErrorEntry x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyAggregatesErrorEntry' 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:
--
-- 'errorCode', 'batchGetAssetPropertyAggregatesErrorEntry_errorCode' - The error code.
--
-- 'errorMessage', 'batchGetAssetPropertyAggregatesErrorEntry_errorMessage' - The associated error message.
--
-- 'entryId', 'batchGetAssetPropertyAggregatesErrorEntry_entryId' - The ID of the entry.
newBatchGetAssetPropertyAggregatesErrorEntry ::
  -- | 'errorCode'
  BatchGetAssetPropertyAggregatesErrorCode ->
  -- | 'errorMessage'
  Prelude.Text ->
  -- | 'entryId'
  Prelude.Text ->
  BatchGetAssetPropertyAggregatesErrorEntry
newBatchGetAssetPropertyAggregatesErrorEntry :: BatchGetAssetPropertyAggregatesErrorCode
-> Text -> Text -> BatchGetAssetPropertyAggregatesErrorEntry
newBatchGetAssetPropertyAggregatesErrorEntry
  BatchGetAssetPropertyAggregatesErrorCode
pErrorCode_
  Text
pErrorMessage_
  Text
pEntryId_ =
    BatchGetAssetPropertyAggregatesErrorEntry'
      { $sel:errorCode:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorCode
errorCode =
          BatchGetAssetPropertyAggregatesErrorCode
pErrorCode_,
        $sel:errorMessage:BatchGetAssetPropertyAggregatesErrorEntry' :: Text
errorMessage = Text
pErrorMessage_,
        $sel:entryId:BatchGetAssetPropertyAggregatesErrorEntry' :: Text
entryId = Text
pEntryId_
      }

-- | The error code.
batchGetAssetPropertyAggregatesErrorEntry_errorCode :: Lens.Lens' BatchGetAssetPropertyAggregatesErrorEntry BatchGetAssetPropertyAggregatesErrorCode
batchGetAssetPropertyAggregatesErrorEntry_errorCode :: Lens'
  BatchGetAssetPropertyAggregatesErrorEntry
  BatchGetAssetPropertyAggregatesErrorCode
batchGetAssetPropertyAggregatesErrorEntry_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesErrorEntry' {BatchGetAssetPropertyAggregatesErrorCode
errorCode :: BatchGetAssetPropertyAggregatesErrorCode
$sel:errorCode:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorCode
errorCode} -> BatchGetAssetPropertyAggregatesErrorCode
errorCode) (\s :: BatchGetAssetPropertyAggregatesErrorEntry
s@BatchGetAssetPropertyAggregatesErrorEntry' {} BatchGetAssetPropertyAggregatesErrorCode
a -> BatchGetAssetPropertyAggregatesErrorEntry
s {$sel:errorCode:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorCode
errorCode = BatchGetAssetPropertyAggregatesErrorCode
a} :: BatchGetAssetPropertyAggregatesErrorEntry)

-- | The associated error message.
batchGetAssetPropertyAggregatesErrorEntry_errorMessage :: Lens.Lens' BatchGetAssetPropertyAggregatesErrorEntry Prelude.Text
batchGetAssetPropertyAggregatesErrorEntry_errorMessage :: Lens' BatchGetAssetPropertyAggregatesErrorEntry Text
batchGetAssetPropertyAggregatesErrorEntry_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyAggregatesErrorEntry' {Text
errorMessage :: Text
$sel:errorMessage:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorEntry -> Text
errorMessage} -> Text
errorMessage) (\s :: BatchGetAssetPropertyAggregatesErrorEntry
s@BatchGetAssetPropertyAggregatesErrorEntry' {} Text
a -> BatchGetAssetPropertyAggregatesErrorEntry
s {$sel:errorMessage:BatchGetAssetPropertyAggregatesErrorEntry' :: Text
errorMessage = Text
a} :: BatchGetAssetPropertyAggregatesErrorEntry)

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

instance
  Data.FromJSON
    BatchGetAssetPropertyAggregatesErrorEntry
  where
  parseJSON :: Value -> Parser BatchGetAssetPropertyAggregatesErrorEntry
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchGetAssetPropertyAggregatesErrorEntry"
      ( \Object
x ->
          BatchGetAssetPropertyAggregatesErrorCode
-> Text -> Text -> BatchGetAssetPropertyAggregatesErrorEntry
BatchGetAssetPropertyAggregatesErrorEntry'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"errorCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"errorMessage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"entryId")
      )

instance
  Prelude.Hashable
    BatchGetAssetPropertyAggregatesErrorEntry
  where
  hashWithSalt :: Int -> BatchGetAssetPropertyAggregatesErrorEntry -> Int
hashWithSalt
    Int
_salt
    BatchGetAssetPropertyAggregatesErrorEntry' {Text
BatchGetAssetPropertyAggregatesErrorCode
entryId :: Text
errorMessage :: Text
errorCode :: BatchGetAssetPropertyAggregatesErrorCode
$sel:entryId:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorEntry -> Text
$sel:errorMessage:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorEntry -> Text
$sel:errorCode:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorCode
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BatchGetAssetPropertyAggregatesErrorCode
errorCode
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
errorMessage
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
entryId

instance
  Prelude.NFData
    BatchGetAssetPropertyAggregatesErrorEntry
  where
  rnf :: BatchGetAssetPropertyAggregatesErrorEntry -> ()
rnf BatchGetAssetPropertyAggregatesErrorEntry' {Text
BatchGetAssetPropertyAggregatesErrorCode
entryId :: Text
errorMessage :: Text
errorCode :: BatchGetAssetPropertyAggregatesErrorCode
$sel:entryId:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorEntry -> Text
$sel:errorMessage:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorEntry -> Text
$sel:errorCode:BatchGetAssetPropertyAggregatesErrorEntry' :: BatchGetAssetPropertyAggregatesErrorEntry
-> BatchGetAssetPropertyAggregatesErrorCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf BatchGetAssetPropertyAggregatesErrorCode
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
entryId