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

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

-- |
-- Create a value of 'BatchGetAssetPropertyValueErrorEntry' 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', 'batchGetAssetPropertyValueErrorEntry_errorCode' - The error code.
--
-- 'errorMessage', 'batchGetAssetPropertyValueErrorEntry_errorMessage' - The associated error message.
--
-- 'entryId', 'batchGetAssetPropertyValueErrorEntry_entryId' - The ID of the entry.
newBatchGetAssetPropertyValueErrorEntry ::
  -- | 'errorCode'
  BatchGetAssetPropertyValueErrorCode ->
  -- | 'errorMessage'
  Prelude.Text ->
  -- | 'entryId'
  Prelude.Text ->
  BatchGetAssetPropertyValueErrorEntry
newBatchGetAssetPropertyValueErrorEntry :: BatchGetAssetPropertyValueErrorCode
-> Text -> Text -> BatchGetAssetPropertyValueErrorEntry
newBatchGetAssetPropertyValueErrorEntry
  BatchGetAssetPropertyValueErrorCode
pErrorCode_
  Text
pErrorMessage_
  Text
pEntryId_ =
    BatchGetAssetPropertyValueErrorEntry'
      { $sel:errorCode:BatchGetAssetPropertyValueErrorEntry' :: BatchGetAssetPropertyValueErrorCode
errorCode =
          BatchGetAssetPropertyValueErrorCode
pErrorCode_,
        $sel:errorMessage:BatchGetAssetPropertyValueErrorEntry' :: Text
errorMessage = Text
pErrorMessage_,
        $sel:entryId:BatchGetAssetPropertyValueErrorEntry' :: Text
entryId = Text
pEntryId_
      }

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

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

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

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