{-# 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.BatchGetAssetPropertyValueHistoryErrorEntry
-- 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.BatchGetAssetPropertyValueHistoryErrorEntry 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.BatchGetAssetPropertyValueHistoryErrorCode
import qualified Amazonka.Prelude as Prelude

-- | A list of the errors (if any) associated with the batch request. Each
-- error entry contains the @entryId@ of the entry that failed.
--
-- /See:/ 'newBatchGetAssetPropertyValueHistoryErrorEntry' smart constructor.
data BatchGetAssetPropertyValueHistoryErrorEntry = BatchGetAssetPropertyValueHistoryErrorEntry'
  { -- | The error code.
    BatchGetAssetPropertyValueHistoryErrorEntry
-> BatchGetAssetPropertyValueHistoryErrorCode
errorCode :: BatchGetAssetPropertyValueHistoryErrorCode,
    -- | The associated error message.
    BatchGetAssetPropertyValueHistoryErrorEntry -> Text
errorMessage :: Prelude.Text,
    -- | The ID of the entry.
    BatchGetAssetPropertyValueHistoryErrorEntry -> Text
entryId :: Prelude.Text
  }
  deriving (BatchGetAssetPropertyValueHistoryErrorEntry
-> BatchGetAssetPropertyValueHistoryErrorEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyValueHistoryErrorEntry
-> BatchGetAssetPropertyValueHistoryErrorEntry -> Bool
$c/= :: BatchGetAssetPropertyValueHistoryErrorEntry
-> BatchGetAssetPropertyValueHistoryErrorEntry -> Bool
== :: BatchGetAssetPropertyValueHistoryErrorEntry
-> BatchGetAssetPropertyValueHistoryErrorEntry -> Bool
$c== :: BatchGetAssetPropertyValueHistoryErrorEntry
-> BatchGetAssetPropertyValueHistoryErrorEntry -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyValueHistoryErrorEntry]
ReadPrec BatchGetAssetPropertyValueHistoryErrorEntry
Int -> ReadS BatchGetAssetPropertyValueHistoryErrorEntry
ReadS [BatchGetAssetPropertyValueHistoryErrorEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyValueHistoryErrorEntry]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyValueHistoryErrorEntry]
readPrec :: ReadPrec BatchGetAssetPropertyValueHistoryErrorEntry
$creadPrec :: ReadPrec BatchGetAssetPropertyValueHistoryErrorEntry
readList :: ReadS [BatchGetAssetPropertyValueHistoryErrorEntry]
$creadList :: ReadS [BatchGetAssetPropertyValueHistoryErrorEntry]
readsPrec :: Int -> ReadS BatchGetAssetPropertyValueHistoryErrorEntry
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyValueHistoryErrorEntry
Prelude.Read, Int -> BatchGetAssetPropertyValueHistoryErrorEntry -> ShowS
[BatchGetAssetPropertyValueHistoryErrorEntry] -> ShowS
BatchGetAssetPropertyValueHistoryErrorEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyValueHistoryErrorEntry] -> ShowS
$cshowList :: [BatchGetAssetPropertyValueHistoryErrorEntry] -> ShowS
show :: BatchGetAssetPropertyValueHistoryErrorEntry -> String
$cshow :: BatchGetAssetPropertyValueHistoryErrorEntry -> String
showsPrec :: Int -> BatchGetAssetPropertyValueHistoryErrorEntry -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyValueHistoryErrorEntry -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyValueHistoryErrorEntry x
-> BatchGetAssetPropertyValueHistoryErrorEntry
forall x.
BatchGetAssetPropertyValueHistoryErrorEntry
-> Rep BatchGetAssetPropertyValueHistoryErrorEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyValueHistoryErrorEntry x
-> BatchGetAssetPropertyValueHistoryErrorEntry
$cfrom :: forall x.
BatchGetAssetPropertyValueHistoryErrorEntry
-> Rep BatchGetAssetPropertyValueHistoryErrorEntry x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyValueHistoryErrorEntry' 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', 'batchGetAssetPropertyValueHistoryErrorEntry_errorCode' - The error code.
--
-- 'errorMessage', 'batchGetAssetPropertyValueHistoryErrorEntry_errorMessage' - The associated error message.
--
-- 'entryId', 'batchGetAssetPropertyValueHistoryErrorEntry_entryId' - The ID of the entry.
newBatchGetAssetPropertyValueHistoryErrorEntry ::
  -- | 'errorCode'
  BatchGetAssetPropertyValueHistoryErrorCode ->
  -- | 'errorMessage'
  Prelude.Text ->
  -- | 'entryId'
  Prelude.Text ->
  BatchGetAssetPropertyValueHistoryErrorEntry
newBatchGetAssetPropertyValueHistoryErrorEntry :: BatchGetAssetPropertyValueHistoryErrorCode
-> Text -> Text -> BatchGetAssetPropertyValueHistoryErrorEntry
newBatchGetAssetPropertyValueHistoryErrorEntry
  BatchGetAssetPropertyValueHistoryErrorCode
pErrorCode_
  Text
pErrorMessage_
  Text
pEntryId_ =
    BatchGetAssetPropertyValueHistoryErrorEntry'
      { $sel:errorCode:BatchGetAssetPropertyValueHistoryErrorEntry' :: BatchGetAssetPropertyValueHistoryErrorCode
errorCode =
          BatchGetAssetPropertyValueHistoryErrorCode
pErrorCode_,
        $sel:errorMessage:BatchGetAssetPropertyValueHistoryErrorEntry' :: Text
errorMessage = Text
pErrorMessage_,
        $sel:entryId:BatchGetAssetPropertyValueHistoryErrorEntry' :: Text
entryId = Text
pEntryId_
      }

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

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

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

instance
  Data.FromJSON
    BatchGetAssetPropertyValueHistoryErrorEntry
  where
  parseJSON :: Value -> Parser BatchGetAssetPropertyValueHistoryErrorEntry
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchGetAssetPropertyValueHistoryErrorEntry"
      ( \Object
x ->
          BatchGetAssetPropertyValueHistoryErrorCode
-> Text -> Text -> BatchGetAssetPropertyValueHistoryErrorEntry
BatchGetAssetPropertyValueHistoryErrorEntry'
            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
    BatchGetAssetPropertyValueHistoryErrorEntry
  where
  hashWithSalt :: Int -> BatchGetAssetPropertyValueHistoryErrorEntry -> Int
hashWithSalt
    Int
_salt
    BatchGetAssetPropertyValueHistoryErrorEntry' {Text
BatchGetAssetPropertyValueHistoryErrorCode
entryId :: Text
errorMessage :: Text
errorCode :: BatchGetAssetPropertyValueHistoryErrorCode
$sel:entryId:BatchGetAssetPropertyValueHistoryErrorEntry' :: BatchGetAssetPropertyValueHistoryErrorEntry -> Text
$sel:errorMessage:BatchGetAssetPropertyValueHistoryErrorEntry' :: BatchGetAssetPropertyValueHistoryErrorEntry -> Text
$sel:errorCode:BatchGetAssetPropertyValueHistoryErrorEntry' :: BatchGetAssetPropertyValueHistoryErrorEntry
-> BatchGetAssetPropertyValueHistoryErrorCode
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BatchGetAssetPropertyValueHistoryErrorCode
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
    BatchGetAssetPropertyValueHistoryErrorEntry
  where
  rnf :: BatchGetAssetPropertyValueHistoryErrorEntry -> ()
rnf BatchGetAssetPropertyValueHistoryErrorEntry' {Text
BatchGetAssetPropertyValueHistoryErrorCode
entryId :: Text
errorMessage :: Text
errorCode :: BatchGetAssetPropertyValueHistoryErrorCode
$sel:entryId:BatchGetAssetPropertyValueHistoryErrorEntry' :: BatchGetAssetPropertyValueHistoryErrorEntry -> Text
$sel:errorMessage:BatchGetAssetPropertyValueHistoryErrorEntry' :: BatchGetAssetPropertyValueHistoryErrorEntry -> Text
$sel:errorCode:BatchGetAssetPropertyValueHistoryErrorEntry' :: BatchGetAssetPropertyValueHistoryErrorEntry
-> BatchGetAssetPropertyValueHistoryErrorCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf BatchGetAssetPropertyValueHistoryErrorCode
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