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