{-# 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.Redshift.Types.SnapshotErrorMessage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
data SnapshotErrorMessage = SnapshotErrorMessage'
{
SnapshotErrorMessage -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
SnapshotErrorMessage -> Maybe Text
snapshotIdentifier :: Prelude.Maybe Prelude.Text,
SnapshotErrorMessage -> Maybe Text
snapshotClusterIdentifier :: Prelude.Maybe Prelude.Text,
SnapshotErrorMessage -> Maybe Text
failureCode :: Prelude.Maybe Prelude.Text
}
deriving (SnapshotErrorMessage -> SnapshotErrorMessage -> Bool
(SnapshotErrorMessage -> SnapshotErrorMessage -> Bool)
-> (SnapshotErrorMessage -> SnapshotErrorMessage -> Bool)
-> Eq SnapshotErrorMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnapshotErrorMessage -> SnapshotErrorMessage -> Bool
$c/= :: SnapshotErrorMessage -> SnapshotErrorMessage -> Bool
== :: SnapshotErrorMessage -> SnapshotErrorMessage -> Bool
$c== :: SnapshotErrorMessage -> SnapshotErrorMessage -> Bool
Prelude.Eq, ReadPrec [SnapshotErrorMessage]
ReadPrec SnapshotErrorMessage
Int -> ReadS SnapshotErrorMessage
ReadS [SnapshotErrorMessage]
(Int -> ReadS SnapshotErrorMessage)
-> ReadS [SnapshotErrorMessage]
-> ReadPrec SnapshotErrorMessage
-> ReadPrec [SnapshotErrorMessage]
-> Read SnapshotErrorMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnapshotErrorMessage]
$creadListPrec :: ReadPrec [SnapshotErrorMessage]
readPrec :: ReadPrec SnapshotErrorMessage
$creadPrec :: ReadPrec SnapshotErrorMessage
readList :: ReadS [SnapshotErrorMessage]
$creadList :: ReadS [SnapshotErrorMessage]
readsPrec :: Int -> ReadS SnapshotErrorMessage
$creadsPrec :: Int -> ReadS SnapshotErrorMessage
Prelude.Read, Int -> SnapshotErrorMessage -> ShowS
[SnapshotErrorMessage] -> ShowS
SnapshotErrorMessage -> String
(Int -> SnapshotErrorMessage -> ShowS)
-> (SnapshotErrorMessage -> String)
-> ([SnapshotErrorMessage] -> ShowS)
-> Show SnapshotErrorMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnapshotErrorMessage] -> ShowS
$cshowList :: [SnapshotErrorMessage] -> ShowS
show :: SnapshotErrorMessage -> String
$cshow :: SnapshotErrorMessage -> String
showsPrec :: Int -> SnapshotErrorMessage -> ShowS
$cshowsPrec :: Int -> SnapshotErrorMessage -> ShowS
Prelude.Show, (forall x. SnapshotErrorMessage -> Rep SnapshotErrorMessage x)
-> (forall x. Rep SnapshotErrorMessage x -> SnapshotErrorMessage)
-> Generic SnapshotErrorMessage
forall x. Rep SnapshotErrorMessage x -> SnapshotErrorMessage
forall x. SnapshotErrorMessage -> Rep SnapshotErrorMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SnapshotErrorMessage x -> SnapshotErrorMessage
$cfrom :: forall x. SnapshotErrorMessage -> Rep SnapshotErrorMessage x
Prelude.Generic)
newSnapshotErrorMessage ::
SnapshotErrorMessage
newSnapshotErrorMessage :: SnapshotErrorMessage
newSnapshotErrorMessage =
SnapshotErrorMessage' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SnapshotErrorMessage
SnapshotErrorMessage'
{ $sel:failureReason:SnapshotErrorMessage' :: Maybe Text
failureReason =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotIdentifier:SnapshotErrorMessage' :: Maybe Text
snapshotIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotClusterIdentifier:SnapshotErrorMessage' :: Maybe Text
snapshotClusterIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:failureCode:SnapshotErrorMessage' :: Maybe Text
failureCode = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
snapshotErrorMessage_failureReason :: Lens.Lens' SnapshotErrorMessage (Prelude.Maybe Prelude.Text)
snapshotErrorMessage_failureReason :: (Maybe Text -> f (Maybe Text))
-> SnapshotErrorMessage -> f SnapshotErrorMessage
snapshotErrorMessage_failureReason = (SnapshotErrorMessage -> Maybe Text)
-> (SnapshotErrorMessage -> Maybe Text -> SnapshotErrorMessage)
-> Lens
SnapshotErrorMessage SnapshotErrorMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotErrorMessage' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:SnapshotErrorMessage' :: SnapshotErrorMessage -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: SnapshotErrorMessage
s@SnapshotErrorMessage' {} Maybe Text
a -> SnapshotErrorMessage
s {$sel:failureReason:SnapshotErrorMessage' :: Maybe Text
failureReason = Maybe Text
a} :: SnapshotErrorMessage)
snapshotErrorMessage_snapshotIdentifier :: Lens.Lens' SnapshotErrorMessage (Prelude.Maybe Prelude.Text)
snapshotErrorMessage_snapshotIdentifier :: (Maybe Text -> f (Maybe Text))
-> SnapshotErrorMessage -> f SnapshotErrorMessage
snapshotErrorMessage_snapshotIdentifier = (SnapshotErrorMessage -> Maybe Text)
-> (SnapshotErrorMessage -> Maybe Text -> SnapshotErrorMessage)
-> Lens
SnapshotErrorMessage SnapshotErrorMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotErrorMessage' {Maybe Text
snapshotIdentifier :: Maybe Text
$sel:snapshotIdentifier:SnapshotErrorMessage' :: SnapshotErrorMessage -> Maybe Text
snapshotIdentifier} -> Maybe Text
snapshotIdentifier) (\s :: SnapshotErrorMessage
s@SnapshotErrorMessage' {} Maybe Text
a -> SnapshotErrorMessage
s {$sel:snapshotIdentifier:SnapshotErrorMessage' :: Maybe Text
snapshotIdentifier = Maybe Text
a} :: SnapshotErrorMessage)
snapshotErrorMessage_snapshotClusterIdentifier :: Lens.Lens' SnapshotErrorMessage (Prelude.Maybe Prelude.Text)
snapshotErrorMessage_snapshotClusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> SnapshotErrorMessage -> f SnapshotErrorMessage
snapshotErrorMessage_snapshotClusterIdentifier = (SnapshotErrorMessage -> Maybe Text)
-> (SnapshotErrorMessage -> Maybe Text -> SnapshotErrorMessage)
-> Lens
SnapshotErrorMessage SnapshotErrorMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotErrorMessage' {Maybe Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotClusterIdentifier:SnapshotErrorMessage' :: SnapshotErrorMessage -> Maybe Text
snapshotClusterIdentifier} -> Maybe Text
snapshotClusterIdentifier) (\s :: SnapshotErrorMessage
s@SnapshotErrorMessage' {} Maybe Text
a -> SnapshotErrorMessage
s {$sel:snapshotClusterIdentifier:SnapshotErrorMessage' :: Maybe Text
snapshotClusterIdentifier = Maybe Text
a} :: SnapshotErrorMessage)
snapshotErrorMessage_failureCode :: Lens.Lens' SnapshotErrorMessage (Prelude.Maybe Prelude.Text)
snapshotErrorMessage_failureCode :: (Maybe Text -> f (Maybe Text))
-> SnapshotErrorMessage -> f SnapshotErrorMessage
snapshotErrorMessage_failureCode = (SnapshotErrorMessage -> Maybe Text)
-> (SnapshotErrorMessage -> Maybe Text -> SnapshotErrorMessage)
-> Lens
SnapshotErrorMessage SnapshotErrorMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotErrorMessage' {Maybe Text
failureCode :: Maybe Text
$sel:failureCode:SnapshotErrorMessage' :: SnapshotErrorMessage -> Maybe Text
failureCode} -> Maybe Text
failureCode) (\s :: SnapshotErrorMessage
s@SnapshotErrorMessage' {} Maybe Text
a -> SnapshotErrorMessage
s {$sel:failureCode:SnapshotErrorMessage' :: Maybe Text
failureCode = Maybe Text
a} :: SnapshotErrorMessage)
instance Core.FromXML SnapshotErrorMessage where
parseXML :: [Node] -> Either String SnapshotErrorMessage
parseXML [Node]
x =
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SnapshotErrorMessage
SnapshotErrorMessage'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SnapshotErrorMessage)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Text -> Maybe Text -> SnapshotErrorMessage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureReason")
Either
String
(Maybe Text -> Maybe Text -> Maybe Text -> SnapshotErrorMessage)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> SnapshotErrorMessage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SnapshotIdentifier")
Either String (Maybe Text -> Maybe Text -> SnapshotErrorMessage)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> SnapshotErrorMessage)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SnapshotClusterIdentifier")
Either String (Maybe Text -> SnapshotErrorMessage)
-> Either String (Maybe Text) -> Either String SnapshotErrorMessage
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureCode")
instance Prelude.Hashable SnapshotErrorMessage
instance Prelude.NFData SnapshotErrorMessage