{-# 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.BatchGetAssetPropertyValueErrorInfo
-- 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.BatchGetAssetPropertyValueErrorInfo 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

-- | The error information, such as the error code and the timestamp.
--
-- /See:/ 'newBatchGetAssetPropertyValueErrorInfo' smart constructor.
data BatchGetAssetPropertyValueErrorInfo = BatchGetAssetPropertyValueErrorInfo'
  { -- | The error code.
    BatchGetAssetPropertyValueErrorInfo
-> BatchGetAssetPropertyValueErrorCode
errorCode :: BatchGetAssetPropertyValueErrorCode,
    -- | The date the error occurred, in Unix epoch time.
    BatchGetAssetPropertyValueErrorInfo -> POSIX
errorTimestamp :: Data.POSIX
  }
  deriving (BatchGetAssetPropertyValueErrorInfo
-> BatchGetAssetPropertyValueErrorInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetAssetPropertyValueErrorInfo
-> BatchGetAssetPropertyValueErrorInfo -> Bool
$c/= :: BatchGetAssetPropertyValueErrorInfo
-> BatchGetAssetPropertyValueErrorInfo -> Bool
== :: BatchGetAssetPropertyValueErrorInfo
-> BatchGetAssetPropertyValueErrorInfo -> Bool
$c== :: BatchGetAssetPropertyValueErrorInfo
-> BatchGetAssetPropertyValueErrorInfo -> Bool
Prelude.Eq, ReadPrec [BatchGetAssetPropertyValueErrorInfo]
ReadPrec BatchGetAssetPropertyValueErrorInfo
Int -> ReadS BatchGetAssetPropertyValueErrorInfo
ReadS [BatchGetAssetPropertyValueErrorInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetAssetPropertyValueErrorInfo]
$creadListPrec :: ReadPrec [BatchGetAssetPropertyValueErrorInfo]
readPrec :: ReadPrec BatchGetAssetPropertyValueErrorInfo
$creadPrec :: ReadPrec BatchGetAssetPropertyValueErrorInfo
readList :: ReadS [BatchGetAssetPropertyValueErrorInfo]
$creadList :: ReadS [BatchGetAssetPropertyValueErrorInfo]
readsPrec :: Int -> ReadS BatchGetAssetPropertyValueErrorInfo
$creadsPrec :: Int -> ReadS BatchGetAssetPropertyValueErrorInfo
Prelude.Read, Int -> BatchGetAssetPropertyValueErrorInfo -> ShowS
[BatchGetAssetPropertyValueErrorInfo] -> ShowS
BatchGetAssetPropertyValueErrorInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetAssetPropertyValueErrorInfo] -> ShowS
$cshowList :: [BatchGetAssetPropertyValueErrorInfo] -> ShowS
show :: BatchGetAssetPropertyValueErrorInfo -> String
$cshow :: BatchGetAssetPropertyValueErrorInfo -> String
showsPrec :: Int -> BatchGetAssetPropertyValueErrorInfo -> ShowS
$cshowsPrec :: Int -> BatchGetAssetPropertyValueErrorInfo -> ShowS
Prelude.Show, forall x.
Rep BatchGetAssetPropertyValueErrorInfo x
-> BatchGetAssetPropertyValueErrorInfo
forall x.
BatchGetAssetPropertyValueErrorInfo
-> Rep BatchGetAssetPropertyValueErrorInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetAssetPropertyValueErrorInfo x
-> BatchGetAssetPropertyValueErrorInfo
$cfrom :: forall x.
BatchGetAssetPropertyValueErrorInfo
-> Rep BatchGetAssetPropertyValueErrorInfo x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetAssetPropertyValueErrorInfo' 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', 'batchGetAssetPropertyValueErrorInfo_errorCode' - The error code.
--
-- 'errorTimestamp', 'batchGetAssetPropertyValueErrorInfo_errorTimestamp' - The date the error occurred, in Unix epoch time.
newBatchGetAssetPropertyValueErrorInfo ::
  -- | 'errorCode'
  BatchGetAssetPropertyValueErrorCode ->
  -- | 'errorTimestamp'
  Prelude.UTCTime ->
  BatchGetAssetPropertyValueErrorInfo
newBatchGetAssetPropertyValueErrorInfo :: BatchGetAssetPropertyValueErrorCode
-> UTCTime -> BatchGetAssetPropertyValueErrorInfo
newBatchGetAssetPropertyValueErrorInfo
  BatchGetAssetPropertyValueErrorCode
pErrorCode_
  UTCTime
pErrorTimestamp_ =
    BatchGetAssetPropertyValueErrorInfo'
      { $sel:errorCode:BatchGetAssetPropertyValueErrorInfo' :: BatchGetAssetPropertyValueErrorCode
errorCode =
          BatchGetAssetPropertyValueErrorCode
pErrorCode_,
        $sel:errorTimestamp:BatchGetAssetPropertyValueErrorInfo' :: POSIX
errorTimestamp =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pErrorTimestamp_
      }

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

-- | The date the error occurred, in Unix epoch time.
batchGetAssetPropertyValueErrorInfo_errorTimestamp :: Lens.Lens' BatchGetAssetPropertyValueErrorInfo Prelude.UTCTime
batchGetAssetPropertyValueErrorInfo_errorTimestamp :: Lens' BatchGetAssetPropertyValueErrorInfo UTCTime
batchGetAssetPropertyValueErrorInfo_errorTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetAssetPropertyValueErrorInfo' {POSIX
errorTimestamp :: POSIX
$sel:errorTimestamp:BatchGetAssetPropertyValueErrorInfo' :: BatchGetAssetPropertyValueErrorInfo -> POSIX
errorTimestamp} -> POSIX
errorTimestamp) (\s :: BatchGetAssetPropertyValueErrorInfo
s@BatchGetAssetPropertyValueErrorInfo' {} POSIX
a -> BatchGetAssetPropertyValueErrorInfo
s {$sel:errorTimestamp:BatchGetAssetPropertyValueErrorInfo' :: POSIX
errorTimestamp = POSIX
a} :: BatchGetAssetPropertyValueErrorInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance
  Data.FromJSON
    BatchGetAssetPropertyValueErrorInfo
  where
  parseJSON :: Value -> Parser BatchGetAssetPropertyValueErrorInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchGetAssetPropertyValueErrorInfo"
      ( \Object
x ->
          BatchGetAssetPropertyValueErrorCode
-> POSIX -> BatchGetAssetPropertyValueErrorInfo
BatchGetAssetPropertyValueErrorInfo'
            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
"errorTimestamp")
      )

instance
  Prelude.Hashable
    BatchGetAssetPropertyValueErrorInfo
  where
  hashWithSalt :: Int -> BatchGetAssetPropertyValueErrorInfo -> Int
hashWithSalt
    Int
_salt
    BatchGetAssetPropertyValueErrorInfo' {POSIX
BatchGetAssetPropertyValueErrorCode
errorTimestamp :: POSIX
errorCode :: BatchGetAssetPropertyValueErrorCode
$sel:errorTimestamp:BatchGetAssetPropertyValueErrorInfo' :: BatchGetAssetPropertyValueErrorInfo -> POSIX
$sel:errorCode:BatchGetAssetPropertyValueErrorInfo' :: BatchGetAssetPropertyValueErrorInfo
-> BatchGetAssetPropertyValueErrorCode
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BatchGetAssetPropertyValueErrorCode
errorCode
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
errorTimestamp

instance
  Prelude.NFData
    BatchGetAssetPropertyValueErrorInfo
  where
  rnf :: BatchGetAssetPropertyValueErrorInfo -> ()
rnf BatchGetAssetPropertyValueErrorInfo' {POSIX
BatchGetAssetPropertyValueErrorCode
errorTimestamp :: POSIX
errorCode :: BatchGetAssetPropertyValueErrorCode
$sel:errorTimestamp:BatchGetAssetPropertyValueErrorInfo' :: BatchGetAssetPropertyValueErrorInfo -> POSIX
$sel:errorCode:BatchGetAssetPropertyValueErrorInfo' :: BatchGetAssetPropertyValueErrorInfo
-> 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 POSIX
errorTimestamp