{-# 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.DBSnapshotAttribute where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DBSnapshotAttribute = DBSnapshotAttribute'
{
DBSnapshotAttribute -> Maybe [Text]
attributeValues :: Prelude.Maybe [Prelude.Text],
DBSnapshotAttribute -> Maybe Text
attributeName :: Prelude.Maybe Prelude.Text
}
deriving (DBSnapshotAttribute -> DBSnapshotAttribute -> Bool
(DBSnapshotAttribute -> DBSnapshotAttribute -> Bool)
-> (DBSnapshotAttribute -> DBSnapshotAttribute -> Bool)
-> Eq DBSnapshotAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBSnapshotAttribute -> DBSnapshotAttribute -> Bool
$c/= :: DBSnapshotAttribute -> DBSnapshotAttribute -> Bool
== :: DBSnapshotAttribute -> DBSnapshotAttribute -> Bool
$c== :: DBSnapshotAttribute -> DBSnapshotAttribute -> Bool
Prelude.Eq, ReadPrec [DBSnapshotAttribute]
ReadPrec DBSnapshotAttribute
Int -> ReadS DBSnapshotAttribute
ReadS [DBSnapshotAttribute]
(Int -> ReadS DBSnapshotAttribute)
-> ReadS [DBSnapshotAttribute]
-> ReadPrec DBSnapshotAttribute
-> ReadPrec [DBSnapshotAttribute]
-> Read DBSnapshotAttribute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DBSnapshotAttribute]
$creadListPrec :: ReadPrec [DBSnapshotAttribute]
readPrec :: ReadPrec DBSnapshotAttribute
$creadPrec :: ReadPrec DBSnapshotAttribute
readList :: ReadS [DBSnapshotAttribute]
$creadList :: ReadS [DBSnapshotAttribute]
readsPrec :: Int -> ReadS DBSnapshotAttribute
$creadsPrec :: Int -> ReadS DBSnapshotAttribute
Prelude.Read, Int -> DBSnapshotAttribute -> ShowS
[DBSnapshotAttribute] -> ShowS
DBSnapshotAttribute -> String
(Int -> DBSnapshotAttribute -> ShowS)
-> (DBSnapshotAttribute -> String)
-> ([DBSnapshotAttribute] -> ShowS)
-> Show DBSnapshotAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DBSnapshotAttribute] -> ShowS
$cshowList :: [DBSnapshotAttribute] -> ShowS
show :: DBSnapshotAttribute -> String
$cshow :: DBSnapshotAttribute -> String
showsPrec :: Int -> DBSnapshotAttribute -> ShowS
$cshowsPrec :: Int -> DBSnapshotAttribute -> ShowS
Prelude.Show, (forall x. DBSnapshotAttribute -> Rep DBSnapshotAttribute x)
-> (forall x. Rep DBSnapshotAttribute x -> DBSnapshotAttribute)
-> Generic DBSnapshotAttribute
forall x. Rep DBSnapshotAttribute x -> DBSnapshotAttribute
forall x. DBSnapshotAttribute -> Rep DBSnapshotAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DBSnapshotAttribute x -> DBSnapshotAttribute
$cfrom :: forall x. DBSnapshotAttribute -> Rep DBSnapshotAttribute x
Prelude.Generic)
newDBSnapshotAttribute ::
DBSnapshotAttribute
newDBSnapshotAttribute :: DBSnapshotAttribute
newDBSnapshotAttribute =
DBSnapshotAttribute' :: Maybe [Text] -> Maybe Text -> DBSnapshotAttribute
DBSnapshotAttribute'
{ $sel:attributeValues:DBSnapshotAttribute' :: Maybe [Text]
attributeValues =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:attributeName:DBSnapshotAttribute' :: Maybe Text
attributeName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
dbSnapshotAttribute_attributeValues :: Lens.Lens' DBSnapshotAttribute (Prelude.Maybe [Prelude.Text])
dbSnapshotAttribute_attributeValues :: (Maybe [Text] -> f (Maybe [Text]))
-> DBSnapshotAttribute -> f DBSnapshotAttribute
dbSnapshotAttribute_attributeValues = (DBSnapshotAttribute -> Maybe [Text])
-> (DBSnapshotAttribute -> Maybe [Text] -> DBSnapshotAttribute)
-> Lens
DBSnapshotAttribute
DBSnapshotAttribute
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSnapshotAttribute' {Maybe [Text]
attributeValues :: Maybe [Text]
$sel:attributeValues:DBSnapshotAttribute' :: DBSnapshotAttribute -> Maybe [Text]
attributeValues} -> Maybe [Text]
attributeValues) (\s :: DBSnapshotAttribute
s@DBSnapshotAttribute' {} Maybe [Text]
a -> DBSnapshotAttribute
s {$sel:attributeValues:DBSnapshotAttribute' :: Maybe [Text]
attributeValues = Maybe [Text]
a} :: DBSnapshotAttribute) ((Maybe [Text] -> f (Maybe [Text]))
-> DBSnapshotAttribute -> f DBSnapshotAttribute)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DBSnapshotAttribute
-> f DBSnapshotAttribute
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
dbSnapshotAttribute_attributeName :: Lens.Lens' DBSnapshotAttribute (Prelude.Maybe Prelude.Text)
dbSnapshotAttribute_attributeName :: (Maybe Text -> f (Maybe Text))
-> DBSnapshotAttribute -> f DBSnapshotAttribute
dbSnapshotAttribute_attributeName = (DBSnapshotAttribute -> Maybe Text)
-> (DBSnapshotAttribute -> Maybe Text -> DBSnapshotAttribute)
-> Lens
DBSnapshotAttribute DBSnapshotAttribute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBSnapshotAttribute' {Maybe Text
attributeName :: Maybe Text
$sel:attributeName:DBSnapshotAttribute' :: DBSnapshotAttribute -> Maybe Text
attributeName} -> Maybe Text
attributeName) (\s :: DBSnapshotAttribute
s@DBSnapshotAttribute' {} Maybe Text
a -> DBSnapshotAttribute
s {$sel:attributeName:DBSnapshotAttribute' :: Maybe Text
attributeName = Maybe Text
a} :: DBSnapshotAttribute)
instance Core.FromXML DBSnapshotAttribute where
parseXML :: [Node] -> Either String DBSnapshotAttribute
parseXML [Node]
x =
Maybe [Text] -> Maybe Text -> DBSnapshotAttribute
DBSnapshotAttribute'
(Maybe [Text] -> Maybe Text -> DBSnapshotAttribute)
-> Either String (Maybe [Text])
-> Either String (Maybe Text -> DBSnapshotAttribute)
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 -> DBSnapshotAttribute)
-> Either String (Maybe Text) -> Either String DBSnapshotAttribute
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 DBSnapshotAttribute
instance Prelude.NFData DBSnapshotAttribute