{-# 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.QuickSight.Types.TemplateError where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.TemplateErrorType
data TemplateError = TemplateError'
{
TemplateError -> Maybe TemplateErrorType
type' :: Prelude.Maybe TemplateErrorType,
TemplateError -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (TemplateError -> TemplateError -> Bool
(TemplateError -> TemplateError -> Bool)
-> (TemplateError -> TemplateError -> Bool) -> Eq TemplateError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemplateError -> TemplateError -> Bool
$c/= :: TemplateError -> TemplateError -> Bool
== :: TemplateError -> TemplateError -> Bool
$c== :: TemplateError -> TemplateError -> Bool
Prelude.Eq, ReadPrec [TemplateError]
ReadPrec TemplateError
Int -> ReadS TemplateError
ReadS [TemplateError]
(Int -> ReadS TemplateError)
-> ReadS [TemplateError]
-> ReadPrec TemplateError
-> ReadPrec [TemplateError]
-> Read TemplateError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemplateError]
$creadListPrec :: ReadPrec [TemplateError]
readPrec :: ReadPrec TemplateError
$creadPrec :: ReadPrec TemplateError
readList :: ReadS [TemplateError]
$creadList :: ReadS [TemplateError]
readsPrec :: Int -> ReadS TemplateError
$creadsPrec :: Int -> ReadS TemplateError
Prelude.Read, Int -> TemplateError -> ShowS
[TemplateError] -> ShowS
TemplateError -> String
(Int -> TemplateError -> ShowS)
-> (TemplateError -> String)
-> ([TemplateError] -> ShowS)
-> Show TemplateError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateError] -> ShowS
$cshowList :: [TemplateError] -> ShowS
show :: TemplateError -> String
$cshow :: TemplateError -> String
showsPrec :: Int -> TemplateError -> ShowS
$cshowsPrec :: Int -> TemplateError -> ShowS
Prelude.Show, (forall x. TemplateError -> Rep TemplateError x)
-> (forall x. Rep TemplateError x -> TemplateError)
-> Generic TemplateError
forall x. Rep TemplateError x -> TemplateError
forall x. TemplateError -> Rep TemplateError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemplateError x -> TemplateError
$cfrom :: forall x. TemplateError -> Rep TemplateError x
Prelude.Generic)
newTemplateError ::
TemplateError
newTemplateError :: TemplateError
newTemplateError =
TemplateError' :: Maybe TemplateErrorType -> Maybe Text -> TemplateError
TemplateError'
{ $sel:type':TemplateError' :: Maybe TemplateErrorType
type' = Maybe TemplateErrorType
forall a. Maybe a
Prelude.Nothing,
$sel:message:TemplateError' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
templateError_type :: Lens.Lens' TemplateError (Prelude.Maybe TemplateErrorType)
templateError_type :: (Maybe TemplateErrorType -> f (Maybe TemplateErrorType))
-> TemplateError -> f TemplateError
templateError_type = (TemplateError -> Maybe TemplateErrorType)
-> (TemplateError -> Maybe TemplateErrorType -> TemplateError)
-> Lens
TemplateError
TemplateError
(Maybe TemplateErrorType)
(Maybe TemplateErrorType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateError' {Maybe TemplateErrorType
type' :: Maybe TemplateErrorType
$sel:type':TemplateError' :: TemplateError -> Maybe TemplateErrorType
type'} -> Maybe TemplateErrorType
type') (\s :: TemplateError
s@TemplateError' {} Maybe TemplateErrorType
a -> TemplateError
s {$sel:type':TemplateError' :: Maybe TemplateErrorType
type' = Maybe TemplateErrorType
a} :: TemplateError)
templateError_message :: Lens.Lens' TemplateError (Prelude.Maybe Prelude.Text)
templateError_message :: (Maybe Text -> f (Maybe Text)) -> TemplateError -> f TemplateError
templateError_message = (TemplateError -> Maybe Text)
-> (TemplateError -> Maybe Text -> TemplateError)
-> Lens TemplateError TemplateError (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateError' {Maybe Text
message :: Maybe Text
$sel:message:TemplateError' :: TemplateError -> Maybe Text
message} -> Maybe Text
message) (\s :: TemplateError
s@TemplateError' {} Maybe Text
a -> TemplateError
s {$sel:message:TemplateError' :: Maybe Text
message = Maybe Text
a} :: TemplateError)
instance Core.FromJSON TemplateError where
parseJSON :: Value -> Parser TemplateError
parseJSON =
String
-> (Object -> Parser TemplateError)
-> Value
-> Parser TemplateError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TemplateError"
( \Object
x ->
Maybe TemplateErrorType -> Maybe Text -> TemplateError
TemplateError'
(Maybe TemplateErrorType -> Maybe Text -> TemplateError)
-> Parser (Maybe TemplateErrorType)
-> Parser (Maybe Text -> TemplateError)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TemplateErrorType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Text -> TemplateError)
-> Parser (Maybe Text) -> Parser TemplateError
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Message")
)
instance Prelude.Hashable TemplateError
instance Prelude.NFData TemplateError