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