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