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