{-# 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 #-}
module Amazonka.IoTSiteWise.Types.AssetErrorDetails where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types.AssetErrorCode
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssetErrorDetails = AssetErrorDetails'
{
AssetErrorDetails -> Text
assetId :: Prelude.Text,
AssetErrorDetails -> AssetErrorCode
code :: AssetErrorCode,
AssetErrorDetails -> Text
message :: Prelude.Text
}
deriving (AssetErrorDetails -> AssetErrorDetails -> Bool
(AssetErrorDetails -> AssetErrorDetails -> Bool)
-> (AssetErrorDetails -> AssetErrorDetails -> Bool)
-> Eq AssetErrorDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetErrorDetails -> AssetErrorDetails -> Bool
$c/= :: AssetErrorDetails -> AssetErrorDetails -> Bool
== :: AssetErrorDetails -> AssetErrorDetails -> Bool
$c== :: AssetErrorDetails -> AssetErrorDetails -> Bool
Prelude.Eq, ReadPrec [AssetErrorDetails]
ReadPrec AssetErrorDetails
Int -> ReadS AssetErrorDetails
ReadS [AssetErrorDetails]
(Int -> ReadS AssetErrorDetails)
-> ReadS [AssetErrorDetails]
-> ReadPrec AssetErrorDetails
-> ReadPrec [AssetErrorDetails]
-> Read AssetErrorDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetErrorDetails]
$creadListPrec :: ReadPrec [AssetErrorDetails]
readPrec :: ReadPrec AssetErrorDetails
$creadPrec :: ReadPrec AssetErrorDetails
readList :: ReadS [AssetErrorDetails]
$creadList :: ReadS [AssetErrorDetails]
readsPrec :: Int -> ReadS AssetErrorDetails
$creadsPrec :: Int -> ReadS AssetErrorDetails
Prelude.Read, Int -> AssetErrorDetails -> ShowS
[AssetErrorDetails] -> ShowS
AssetErrorDetails -> String
(Int -> AssetErrorDetails -> ShowS)
-> (AssetErrorDetails -> String)
-> ([AssetErrorDetails] -> ShowS)
-> Show AssetErrorDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetErrorDetails] -> ShowS
$cshowList :: [AssetErrorDetails] -> ShowS
show :: AssetErrorDetails -> String
$cshow :: AssetErrorDetails -> String
showsPrec :: Int -> AssetErrorDetails -> ShowS
$cshowsPrec :: Int -> AssetErrorDetails -> ShowS
Prelude.Show, (forall x. AssetErrorDetails -> Rep AssetErrorDetails x)
-> (forall x. Rep AssetErrorDetails x -> AssetErrorDetails)
-> Generic AssetErrorDetails
forall x. Rep AssetErrorDetails x -> AssetErrorDetails
forall x. AssetErrorDetails -> Rep AssetErrorDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetErrorDetails x -> AssetErrorDetails
$cfrom :: forall x. AssetErrorDetails -> Rep AssetErrorDetails x
Prelude.Generic)
newAssetErrorDetails ::
Prelude.Text ->
AssetErrorCode ->
Prelude.Text ->
AssetErrorDetails
newAssetErrorDetails :: Text -> AssetErrorCode -> Text -> AssetErrorDetails
newAssetErrorDetails Text
pAssetId_ AssetErrorCode
pCode_ Text
pMessage_ =
AssetErrorDetails' :: Text -> AssetErrorCode -> Text -> AssetErrorDetails
AssetErrorDetails'
{ $sel:assetId:AssetErrorDetails' :: Text
assetId = Text
pAssetId_,
$sel:code:AssetErrorDetails' :: AssetErrorCode
code = AssetErrorCode
pCode_,
$sel:message:AssetErrorDetails' :: Text
message = Text
pMessage_
}
assetErrorDetails_assetId :: Lens.Lens' AssetErrorDetails Prelude.Text
assetErrorDetails_assetId :: (Text -> f Text) -> AssetErrorDetails -> f AssetErrorDetails
assetErrorDetails_assetId = (AssetErrorDetails -> Text)
-> (AssetErrorDetails -> Text -> AssetErrorDetails)
-> Lens AssetErrorDetails AssetErrorDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetErrorDetails' {Text
assetId :: Text
$sel:assetId:AssetErrorDetails' :: AssetErrorDetails -> Text
assetId} -> Text
assetId) (\s :: AssetErrorDetails
s@AssetErrorDetails' {} Text
a -> AssetErrorDetails
s {$sel:assetId:AssetErrorDetails' :: Text
assetId = Text
a} :: AssetErrorDetails)
assetErrorDetails_code :: Lens.Lens' AssetErrorDetails AssetErrorCode
assetErrorDetails_code :: (AssetErrorCode -> f AssetErrorCode)
-> AssetErrorDetails -> f AssetErrorDetails
assetErrorDetails_code = (AssetErrorDetails -> AssetErrorCode)
-> (AssetErrorDetails -> AssetErrorCode -> AssetErrorDetails)
-> Lens
AssetErrorDetails AssetErrorDetails AssetErrorCode AssetErrorCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetErrorDetails' {AssetErrorCode
code :: AssetErrorCode
$sel:code:AssetErrorDetails' :: AssetErrorDetails -> AssetErrorCode
code} -> AssetErrorCode
code) (\s :: AssetErrorDetails
s@AssetErrorDetails' {} AssetErrorCode
a -> AssetErrorDetails
s {$sel:code:AssetErrorDetails' :: AssetErrorCode
code = AssetErrorCode
a} :: AssetErrorDetails)
assetErrorDetails_message :: Lens.Lens' AssetErrorDetails Prelude.Text
assetErrorDetails_message :: (Text -> f Text) -> AssetErrorDetails -> f AssetErrorDetails
assetErrorDetails_message = (AssetErrorDetails -> Text)
-> (AssetErrorDetails -> Text -> AssetErrorDetails)
-> Lens AssetErrorDetails AssetErrorDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetErrorDetails' {Text
message :: Text
$sel:message:AssetErrorDetails' :: AssetErrorDetails -> Text
message} -> Text
message) (\s :: AssetErrorDetails
s@AssetErrorDetails' {} Text
a -> AssetErrorDetails
s {$sel:message:AssetErrorDetails' :: Text
message = Text
a} :: AssetErrorDetails)
instance Core.FromJSON AssetErrorDetails where
parseJSON :: Value -> Parser AssetErrorDetails
parseJSON =
String
-> (Object -> Parser AssetErrorDetails)
-> Value
-> Parser AssetErrorDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssetErrorDetails"
( \Object
x ->
Text -> AssetErrorCode -> Text -> AssetErrorDetails
AssetErrorDetails'
(Text -> AssetErrorCode -> Text -> AssetErrorDetails)
-> Parser Text
-> Parser (AssetErrorCode -> Text -> AssetErrorDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assetId")
Parser (AssetErrorCode -> Text -> AssetErrorDetails)
-> Parser AssetErrorCode -> Parser (Text -> AssetErrorDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssetErrorCode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"code")
Parser (Text -> AssetErrorDetails)
-> Parser Text -> Parser AssetErrorDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"message")
)
instance Prelude.Hashable AssetErrorDetails
instance Prelude.NFData AssetErrorDetails