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