{-# 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.RDS.Types.DBClusterSnapshotAttribute where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DBClusterSnapshotAttribute = DBClusterSnapshotAttribute'
{
DBClusterSnapshotAttribute -> Maybe [Text]
attributeValues :: Prelude.Maybe [Prelude.Text],
DBClusterSnapshotAttribute -> Maybe Text
attributeName :: Prelude.Maybe Prelude.Text
}
deriving (DBClusterSnapshotAttribute -> DBClusterSnapshotAttribute -> Bool
(DBClusterSnapshotAttribute -> DBClusterSnapshotAttribute -> Bool)
-> (DBClusterSnapshotAttribute
-> DBClusterSnapshotAttribute -> Bool)
-> Eq DBClusterSnapshotAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBClusterSnapshotAttribute -> DBClusterSnapshotAttribute -> Bool
$c/= :: DBClusterSnapshotAttribute -> DBClusterSnapshotAttribute -> Bool
== :: DBClusterSnapshotAttribute -> DBClusterSnapshotAttribute -> Bool
$c== :: DBClusterSnapshotAttribute -> DBClusterSnapshotAttribute -> Bool
Prelude.Eq, ReadPrec [DBClusterSnapshotAttribute]
ReadPrec DBClusterSnapshotAttribute
Int -> ReadS DBClusterSnapshotAttribute
ReadS [DBClusterSnapshotAttribute]
(Int -> ReadS DBClusterSnapshotAttribute)
-> ReadS [DBClusterSnapshotAttribute]
-> ReadPrec DBClusterSnapshotAttribute
-> ReadPrec [DBClusterSnapshotAttribute]
-> Read DBClusterSnapshotAttribute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DBClusterSnapshotAttribute]
$creadListPrec :: ReadPrec [DBClusterSnapshotAttribute]
readPrec :: ReadPrec DBClusterSnapshotAttribute
$creadPrec :: ReadPrec DBClusterSnapshotAttribute
readList :: ReadS [DBClusterSnapshotAttribute]
$creadList :: ReadS [DBClusterSnapshotAttribute]
readsPrec :: Int -> ReadS DBClusterSnapshotAttribute
$creadsPrec :: Int -> ReadS DBClusterSnapshotAttribute
Prelude.Read, Int -> DBClusterSnapshotAttribute -> ShowS
[DBClusterSnapshotAttribute] -> ShowS
DBClusterSnapshotAttribute -> String
(Int -> DBClusterSnapshotAttribute -> ShowS)
-> (DBClusterSnapshotAttribute -> String)
-> ([DBClusterSnapshotAttribute] -> ShowS)
-> Show DBClusterSnapshotAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DBClusterSnapshotAttribute] -> ShowS
$cshowList :: [DBClusterSnapshotAttribute] -> ShowS
show :: DBClusterSnapshotAttribute -> String
$cshow :: DBClusterSnapshotAttribute -> String
showsPrec :: Int -> DBClusterSnapshotAttribute -> ShowS
$cshowsPrec :: Int -> DBClusterSnapshotAttribute -> ShowS
Prelude.Show, (forall x.
DBClusterSnapshotAttribute -> Rep DBClusterSnapshotAttribute x)
-> (forall x.
Rep DBClusterSnapshotAttribute x -> DBClusterSnapshotAttribute)
-> Generic DBClusterSnapshotAttribute
forall x.
Rep DBClusterSnapshotAttribute x -> DBClusterSnapshotAttribute
forall x.
DBClusterSnapshotAttribute -> Rep DBClusterSnapshotAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DBClusterSnapshotAttribute x -> DBClusterSnapshotAttribute
$cfrom :: forall x.
DBClusterSnapshotAttribute -> Rep DBClusterSnapshotAttribute x
Prelude.Generic)
newDBClusterSnapshotAttribute ::
DBClusterSnapshotAttribute
newDBClusterSnapshotAttribute :: DBClusterSnapshotAttribute
newDBClusterSnapshotAttribute =
DBClusterSnapshotAttribute' :: Maybe [Text] -> Maybe Text -> DBClusterSnapshotAttribute
DBClusterSnapshotAttribute'
{ $sel:attributeValues:DBClusterSnapshotAttribute' :: Maybe [Text]
attributeValues =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:attributeName:DBClusterSnapshotAttribute' :: Maybe Text
attributeName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
dbClusterSnapshotAttribute_attributeValues :: Lens.Lens' DBClusterSnapshotAttribute (Prelude.Maybe [Prelude.Text])
dbClusterSnapshotAttribute_attributeValues :: (Maybe [Text] -> f (Maybe [Text]))
-> DBClusterSnapshotAttribute -> f DBClusterSnapshotAttribute
dbClusterSnapshotAttribute_attributeValues = (DBClusterSnapshotAttribute -> Maybe [Text])
-> (DBClusterSnapshotAttribute
-> Maybe [Text] -> DBClusterSnapshotAttribute)
-> Lens
DBClusterSnapshotAttribute
DBClusterSnapshotAttribute
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBClusterSnapshotAttribute' {Maybe [Text]
attributeValues :: Maybe [Text]
$sel:attributeValues:DBClusterSnapshotAttribute' :: DBClusterSnapshotAttribute -> Maybe [Text]
attributeValues} -> Maybe [Text]
attributeValues) (\s :: DBClusterSnapshotAttribute
s@DBClusterSnapshotAttribute' {} Maybe [Text]
a -> DBClusterSnapshotAttribute
s {$sel:attributeValues:DBClusterSnapshotAttribute' :: Maybe [Text]
attributeValues = Maybe [Text]
a} :: DBClusterSnapshotAttribute) ((Maybe [Text] -> f (Maybe [Text]))
-> DBClusterSnapshotAttribute -> f DBClusterSnapshotAttribute)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DBClusterSnapshotAttribute
-> f DBClusterSnapshotAttribute
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dbClusterSnapshotAttribute_attributeName :: Lens.Lens' DBClusterSnapshotAttribute (Prelude.Maybe Prelude.Text)
dbClusterSnapshotAttribute_attributeName :: (Maybe Text -> f (Maybe Text))
-> DBClusterSnapshotAttribute -> f DBClusterSnapshotAttribute
dbClusterSnapshotAttribute_attributeName = (DBClusterSnapshotAttribute -> Maybe Text)
-> (DBClusterSnapshotAttribute
-> Maybe Text -> DBClusterSnapshotAttribute)
-> Lens
DBClusterSnapshotAttribute
DBClusterSnapshotAttribute
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBClusterSnapshotAttribute' {Maybe Text
attributeName :: Maybe Text
$sel:attributeName:DBClusterSnapshotAttribute' :: DBClusterSnapshotAttribute -> Maybe Text
attributeName} -> Maybe Text
attributeName) (\s :: DBClusterSnapshotAttribute
s@DBClusterSnapshotAttribute' {} Maybe Text
a -> DBClusterSnapshotAttribute
s {$sel:attributeName:DBClusterSnapshotAttribute' :: Maybe Text
attributeName = Maybe Text
a} :: DBClusterSnapshotAttribute)
instance Core.FromXML DBClusterSnapshotAttribute where
parseXML :: [Node] -> Either String DBClusterSnapshotAttribute
parseXML [Node]
x =
Maybe [Text] -> Maybe Text -> DBClusterSnapshotAttribute
DBClusterSnapshotAttribute'
(Maybe [Text] -> Maybe Text -> DBClusterSnapshotAttribute)
-> Either String (Maybe [Text])
-> Either String (Maybe Text -> DBClusterSnapshotAttribute)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AttributeValues" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"AttributeValue")
)
Either String (Maybe Text -> DBClusterSnapshotAttribute)
-> Either String (Maybe Text)
-> Either String DBClusterSnapshotAttribute
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
"AttributeName")
instance Prelude.Hashable DBClusterSnapshotAttribute
instance Prelude.NFData DBClusterSnapshotAttribute