{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.RDS.DescribeDBSnapshots
(
DescribeDBSnapshots (..),
newDescribeDBSnapshots,
describeDBSnapshots_includeShared,
describeDBSnapshots_filters,
describeDBSnapshots_dbSnapshotIdentifier,
describeDBSnapshots_snapshotType,
describeDBSnapshots_dbInstanceIdentifier,
describeDBSnapshots_marker,
describeDBSnapshots_maxRecords,
describeDBSnapshots_includePublic,
describeDBSnapshots_dbiResourceId,
DescribeDBSnapshotsResponse (..),
newDescribeDBSnapshotsResponse,
describeDBSnapshotsResponse_marker,
describeDBSnapshotsResponse_dbSnapshots,
describeDBSnapshotsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeDBSnapshots = DescribeDBSnapshots'
{
DescribeDBSnapshots -> Maybe Bool
includeShared :: Prelude.Maybe Prelude.Bool,
DescribeDBSnapshots -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
DescribeDBSnapshots -> Maybe Text
dbSnapshotIdentifier :: Prelude.Maybe Prelude.Text,
DescribeDBSnapshots -> Maybe Text
snapshotType :: Prelude.Maybe Prelude.Text,
DescribeDBSnapshots -> Maybe Text
dbInstanceIdentifier :: Prelude.Maybe Prelude.Text,
DescribeDBSnapshots -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
DescribeDBSnapshots -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
DescribeDBSnapshots -> Maybe Bool
includePublic :: Prelude.Maybe Prelude.Bool,
DescribeDBSnapshots -> Maybe Text
dbiResourceId :: Prelude.Maybe Prelude.Text
}
deriving (DescribeDBSnapshots -> DescribeDBSnapshots -> Bool
(DescribeDBSnapshots -> DescribeDBSnapshots -> Bool)
-> (DescribeDBSnapshots -> DescribeDBSnapshots -> Bool)
-> Eq DescribeDBSnapshots
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBSnapshots -> DescribeDBSnapshots -> Bool
$c/= :: DescribeDBSnapshots -> DescribeDBSnapshots -> Bool
== :: DescribeDBSnapshots -> DescribeDBSnapshots -> Bool
$c== :: DescribeDBSnapshots -> DescribeDBSnapshots -> Bool
Prelude.Eq, ReadPrec [DescribeDBSnapshots]
ReadPrec DescribeDBSnapshots
Int -> ReadS DescribeDBSnapshots
ReadS [DescribeDBSnapshots]
(Int -> ReadS DescribeDBSnapshots)
-> ReadS [DescribeDBSnapshots]
-> ReadPrec DescribeDBSnapshots
-> ReadPrec [DescribeDBSnapshots]
-> Read DescribeDBSnapshots
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBSnapshots]
$creadListPrec :: ReadPrec [DescribeDBSnapshots]
readPrec :: ReadPrec DescribeDBSnapshots
$creadPrec :: ReadPrec DescribeDBSnapshots
readList :: ReadS [DescribeDBSnapshots]
$creadList :: ReadS [DescribeDBSnapshots]
readsPrec :: Int -> ReadS DescribeDBSnapshots
$creadsPrec :: Int -> ReadS DescribeDBSnapshots
Prelude.Read, Int -> DescribeDBSnapshots -> ShowS
[DescribeDBSnapshots] -> ShowS
DescribeDBSnapshots -> String
(Int -> DescribeDBSnapshots -> ShowS)
-> (DescribeDBSnapshots -> String)
-> ([DescribeDBSnapshots] -> ShowS)
-> Show DescribeDBSnapshots
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBSnapshots] -> ShowS
$cshowList :: [DescribeDBSnapshots] -> ShowS
show :: DescribeDBSnapshots -> String
$cshow :: DescribeDBSnapshots -> String
showsPrec :: Int -> DescribeDBSnapshots -> ShowS
$cshowsPrec :: Int -> DescribeDBSnapshots -> ShowS
Prelude.Show, (forall x. DescribeDBSnapshots -> Rep DescribeDBSnapshots x)
-> (forall x. Rep DescribeDBSnapshots x -> DescribeDBSnapshots)
-> Generic DescribeDBSnapshots
forall x. Rep DescribeDBSnapshots x -> DescribeDBSnapshots
forall x. DescribeDBSnapshots -> Rep DescribeDBSnapshots x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDBSnapshots x -> DescribeDBSnapshots
$cfrom :: forall x. DescribeDBSnapshots -> Rep DescribeDBSnapshots x
Prelude.Generic)
newDescribeDBSnapshots ::
DescribeDBSnapshots
newDescribeDBSnapshots :: DescribeDBSnapshots
newDescribeDBSnapshots =
DescribeDBSnapshots' :: Maybe Bool
-> Maybe [Filter]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> DescribeDBSnapshots
DescribeDBSnapshots'
{ $sel:includeShared:DescribeDBSnapshots' :: Maybe Bool
includeShared =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:filters:DescribeDBSnapshots' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
$sel:dbSnapshotIdentifier:DescribeDBSnapshots' :: Maybe Text
dbSnapshotIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotType:DescribeDBSnapshots' :: Maybe Text
snapshotType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dbInstanceIdentifier:DescribeDBSnapshots' :: Maybe Text
dbInstanceIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:marker:DescribeDBSnapshots' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxRecords:DescribeDBSnapshots' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:includePublic:DescribeDBSnapshots' :: Maybe Bool
includePublic = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:dbiResourceId:DescribeDBSnapshots' :: Maybe Text
dbiResourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
describeDBSnapshots_includeShared :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe Prelude.Bool)
describeDBSnapshots_includeShared :: (Maybe Bool -> f (Maybe Bool))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_includeShared = (DescribeDBSnapshots -> Maybe Bool)
-> (DescribeDBSnapshots -> Maybe Bool -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe Bool
includeShared :: Maybe Bool
$sel:includeShared:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Bool
includeShared} -> Maybe Bool
includeShared) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe Bool
a -> DescribeDBSnapshots
s {$sel:includeShared:DescribeDBSnapshots' :: Maybe Bool
includeShared = Maybe Bool
a} :: DescribeDBSnapshots)
describeDBSnapshots_filters :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe [Filter])
describeDBSnapshots_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_filters = (DescribeDBSnapshots -> Maybe [Filter])
-> (DescribeDBSnapshots -> Maybe [Filter] -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots
DescribeDBSnapshots
(Maybe [Filter])
(Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe [Filter]
a -> DescribeDBSnapshots
s {$sel:filters:DescribeDBSnapshots' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeDBSnapshots) ((Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBSnapshots -> f DescribeDBSnapshots)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
-> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeDBSnapshots
-> f DescribeDBSnapshots
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
(Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeDBSnapshots_dbSnapshotIdentifier :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe Prelude.Text)
describeDBSnapshots_dbSnapshotIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_dbSnapshotIdentifier = (DescribeDBSnapshots -> Maybe Text)
-> (DescribeDBSnapshots -> Maybe Text -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe Text
dbSnapshotIdentifier :: Maybe Text
$sel:dbSnapshotIdentifier:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
dbSnapshotIdentifier} -> Maybe Text
dbSnapshotIdentifier) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe Text
a -> DescribeDBSnapshots
s {$sel:dbSnapshotIdentifier:DescribeDBSnapshots' :: Maybe Text
dbSnapshotIdentifier = Maybe Text
a} :: DescribeDBSnapshots)
describeDBSnapshots_snapshotType :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe Prelude.Text)
describeDBSnapshots_snapshotType :: (Maybe Text -> f (Maybe Text))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_snapshotType = (DescribeDBSnapshots -> Maybe Text)
-> (DescribeDBSnapshots -> Maybe Text -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe Text
snapshotType :: Maybe Text
$sel:snapshotType:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
snapshotType} -> Maybe Text
snapshotType) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe Text
a -> DescribeDBSnapshots
s {$sel:snapshotType:DescribeDBSnapshots' :: Maybe Text
snapshotType = Maybe Text
a} :: DescribeDBSnapshots)
describeDBSnapshots_dbInstanceIdentifier :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe Prelude.Text)
describeDBSnapshots_dbInstanceIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_dbInstanceIdentifier = (DescribeDBSnapshots -> Maybe Text)
-> (DescribeDBSnapshots -> Maybe Text -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe Text
dbInstanceIdentifier :: Maybe Text
$sel:dbInstanceIdentifier:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
dbInstanceIdentifier} -> Maybe Text
dbInstanceIdentifier) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe Text
a -> DescribeDBSnapshots
s {$sel:dbInstanceIdentifier:DescribeDBSnapshots' :: Maybe Text
dbInstanceIdentifier = Maybe Text
a} :: DescribeDBSnapshots)
describeDBSnapshots_marker :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe Prelude.Text)
describeDBSnapshots_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_marker = (DescribeDBSnapshots -> Maybe Text)
-> (DescribeDBSnapshots -> Maybe Text -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe Text
a -> DescribeDBSnapshots
s {$sel:marker:DescribeDBSnapshots' :: Maybe Text
marker = Maybe Text
a} :: DescribeDBSnapshots)
describeDBSnapshots_maxRecords :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe Prelude.Int)
describeDBSnapshots_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_maxRecords = (DescribeDBSnapshots -> Maybe Int)
-> (DescribeDBSnapshots -> Maybe Int -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe Int
a -> DescribeDBSnapshots
s {$sel:maxRecords:DescribeDBSnapshots' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeDBSnapshots)
describeDBSnapshots_includePublic :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe Prelude.Bool)
describeDBSnapshots_includePublic :: (Maybe Bool -> f (Maybe Bool))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_includePublic = (DescribeDBSnapshots -> Maybe Bool)
-> (DescribeDBSnapshots -> Maybe Bool -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe Bool
includePublic :: Maybe Bool
$sel:includePublic:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Bool
includePublic} -> Maybe Bool
includePublic) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe Bool
a -> DescribeDBSnapshots
s {$sel:includePublic:DescribeDBSnapshots' :: Maybe Bool
includePublic = Maybe Bool
a} :: DescribeDBSnapshots)
describeDBSnapshots_dbiResourceId :: Lens.Lens' DescribeDBSnapshots (Prelude.Maybe Prelude.Text)
describeDBSnapshots_dbiResourceId :: (Maybe Text -> f (Maybe Text))
-> DescribeDBSnapshots -> f DescribeDBSnapshots
describeDBSnapshots_dbiResourceId = (DescribeDBSnapshots -> Maybe Text)
-> (DescribeDBSnapshots -> Maybe Text -> DescribeDBSnapshots)
-> Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshots' {Maybe Text
dbiResourceId :: Maybe Text
$sel:dbiResourceId:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
dbiResourceId} -> Maybe Text
dbiResourceId) (\s :: DescribeDBSnapshots
s@DescribeDBSnapshots' {} Maybe Text
a -> DescribeDBSnapshots
s {$sel:dbiResourceId:DescribeDBSnapshots' :: Maybe Text
dbiResourceId = Maybe Text
a} :: DescribeDBSnapshots)
instance Core.AWSPager DescribeDBSnapshots where
page :: DescribeDBSnapshots
-> AWSResponse DescribeDBSnapshots -> Maybe DescribeDBSnapshots
page DescribeDBSnapshots
rq AWSResponse DescribeDBSnapshots
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeDBSnapshots
DescribeDBSnapshotsResponse
rs
DescribeDBSnapshotsResponse
-> Getting (First Text) DescribeDBSnapshotsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDBSnapshotsResponse
-> Const (First Text) DescribeDBSnapshotsResponse
Lens' DescribeDBSnapshotsResponse (Maybe Text)
describeDBSnapshotsResponse_marker
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDBSnapshotsResponse
-> Const (First Text) DescribeDBSnapshotsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDBSnapshotsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeDBSnapshots
forall a. Maybe a
Prelude.Nothing
| Maybe [DBSnapshot] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeDBSnapshots
DescribeDBSnapshotsResponse
rs
DescribeDBSnapshotsResponse
-> Getting
(First [DBSnapshot]) DescribeDBSnapshotsResponse [DBSnapshot]
-> Maybe [DBSnapshot]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DBSnapshot]
-> Const (First [DBSnapshot]) (Maybe [DBSnapshot]))
-> DescribeDBSnapshotsResponse
-> Const (First [DBSnapshot]) DescribeDBSnapshotsResponse
Lens' DescribeDBSnapshotsResponse (Maybe [DBSnapshot])
describeDBSnapshotsResponse_dbSnapshots
((Maybe [DBSnapshot]
-> Const (First [DBSnapshot]) (Maybe [DBSnapshot]))
-> DescribeDBSnapshotsResponse
-> Const (First [DBSnapshot]) DescribeDBSnapshotsResponse)
-> (([DBSnapshot] -> Const (First [DBSnapshot]) [DBSnapshot])
-> Maybe [DBSnapshot]
-> Const (First [DBSnapshot]) (Maybe [DBSnapshot]))
-> Getting
(First [DBSnapshot]) DescribeDBSnapshotsResponse [DBSnapshot]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DBSnapshot] -> Const (First [DBSnapshot]) [DBSnapshot])
-> Maybe [DBSnapshot]
-> Const (First [DBSnapshot]) (Maybe [DBSnapshot])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeDBSnapshots
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
DescribeDBSnapshots -> Maybe DescribeDBSnapshots
forall a. a -> Maybe a
Prelude.Just (DescribeDBSnapshots -> Maybe DescribeDBSnapshots)
-> DescribeDBSnapshots -> Maybe DescribeDBSnapshots
forall a b. (a -> b) -> a -> b
Prelude.$
DescribeDBSnapshots
rq
DescribeDBSnapshots
-> (DescribeDBSnapshots -> DescribeDBSnapshots)
-> DescribeDBSnapshots
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeDBSnapshots -> Identity DescribeDBSnapshots
Lens
DescribeDBSnapshots DescribeDBSnapshots (Maybe Text) (Maybe Text)
describeDBSnapshots_marker
((Maybe Text -> Identity (Maybe Text))
-> DescribeDBSnapshots -> Identity DescribeDBSnapshots)
-> Maybe Text -> DescribeDBSnapshots -> DescribeDBSnapshots
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDBSnapshots
DescribeDBSnapshotsResponse
rs
DescribeDBSnapshotsResponse
-> Getting (First Text) DescribeDBSnapshotsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDBSnapshotsResponse
-> Const (First Text) DescribeDBSnapshotsResponse
Lens' DescribeDBSnapshotsResponse (Maybe Text)
describeDBSnapshotsResponse_marker
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDBSnapshotsResponse
-> Const (First Text) DescribeDBSnapshotsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDBSnapshotsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest DescribeDBSnapshots where
type
AWSResponse DescribeDBSnapshots =
DescribeDBSnapshotsResponse
request :: DescribeDBSnapshots -> Request DescribeDBSnapshots
request = Service -> DescribeDBSnapshots -> Request DescribeDBSnapshots
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeDBSnapshots
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDBSnapshots)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeDBSnapshots))
-> Logger
-> Service
-> Proxy DescribeDBSnapshots
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDBSnapshots)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DescribeDBSnapshotsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe [DBSnapshot] -> Int -> DescribeDBSnapshotsResponse
DescribeDBSnapshotsResponse'
(Maybe Text
-> Maybe [DBSnapshot] -> Int -> DescribeDBSnapshotsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [DBSnapshot] -> Int -> DescribeDBSnapshotsResponse)
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
"Marker")
Either
String (Maybe [DBSnapshot] -> Int -> DescribeDBSnapshotsResponse)
-> Either String (Maybe [DBSnapshot])
-> Either String (Int -> DescribeDBSnapshotsResponse)
forall (f :: * -> *) a b. Applicative f => 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
"DBSnapshots" 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 [DBSnapshot]))
-> Either String (Maybe [DBSnapshot])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [DBSnapshot])
-> [Node] -> Either String (Maybe [DBSnapshot])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [DBSnapshot]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"DBSnapshot")
)
Either String (Int -> DescribeDBSnapshotsResponse)
-> Either String Int -> Either String DescribeDBSnapshotsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeDBSnapshots
instance Prelude.NFData DescribeDBSnapshots
instance Core.ToHeaders DescribeDBSnapshots where
toHeaders :: DescribeDBSnapshots -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeDBSnapshots -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeDBSnapshots where
toPath :: DescribeDBSnapshots -> ByteString
toPath = ByteString -> DescribeDBSnapshots -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeDBSnapshots where
toQuery :: DescribeDBSnapshots -> QueryString
toQuery DescribeDBSnapshots' {Maybe Bool
Maybe Int
Maybe [Filter]
Maybe Text
dbiResourceId :: Maybe Text
includePublic :: Maybe Bool
maxRecords :: Maybe Int
marker :: Maybe Text
dbInstanceIdentifier :: Maybe Text
snapshotType :: Maybe Text
dbSnapshotIdentifier :: Maybe Text
filters :: Maybe [Filter]
includeShared :: Maybe Bool
$sel:dbiResourceId:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
$sel:includePublic:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Bool
$sel:maxRecords:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Int
$sel:marker:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
$sel:dbInstanceIdentifier:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
$sel:snapshotType:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
$sel:dbSnapshotIdentifier:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Text
$sel:filters:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe [Filter]
$sel:includeShared:DescribeDBSnapshots' :: DescribeDBSnapshots -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeDBSnapshots" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"IncludeShared" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
includeShared,
ByteString
"Filters"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Filter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Filter" ([Filter] -> QueryString) -> Maybe [Filter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
ByteString
"DBSnapshotIdentifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbSnapshotIdentifier,
ByteString
"SnapshotType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
snapshotType,
ByteString
"DBInstanceIdentifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbInstanceIdentifier,
ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords,
ByteString
"IncludePublic" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
includePublic,
ByteString
"DbiResourceId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbiResourceId
]
data DescribeDBSnapshotsResponse = DescribeDBSnapshotsResponse'
{
DescribeDBSnapshotsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
DescribeDBSnapshotsResponse -> Maybe [DBSnapshot]
dbSnapshots :: Prelude.Maybe [DBSnapshot],
DescribeDBSnapshotsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeDBSnapshotsResponse -> DescribeDBSnapshotsResponse -> Bool
(DescribeDBSnapshotsResponse
-> DescribeDBSnapshotsResponse -> Bool)
-> (DescribeDBSnapshotsResponse
-> DescribeDBSnapshotsResponse -> Bool)
-> Eq DescribeDBSnapshotsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDBSnapshotsResponse -> DescribeDBSnapshotsResponse -> Bool
$c/= :: DescribeDBSnapshotsResponse -> DescribeDBSnapshotsResponse -> Bool
== :: DescribeDBSnapshotsResponse -> DescribeDBSnapshotsResponse -> Bool
$c== :: DescribeDBSnapshotsResponse -> DescribeDBSnapshotsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDBSnapshotsResponse]
ReadPrec DescribeDBSnapshotsResponse
Int -> ReadS DescribeDBSnapshotsResponse
ReadS [DescribeDBSnapshotsResponse]
(Int -> ReadS DescribeDBSnapshotsResponse)
-> ReadS [DescribeDBSnapshotsResponse]
-> ReadPrec DescribeDBSnapshotsResponse
-> ReadPrec [DescribeDBSnapshotsResponse]
-> Read DescribeDBSnapshotsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDBSnapshotsResponse]
$creadListPrec :: ReadPrec [DescribeDBSnapshotsResponse]
readPrec :: ReadPrec DescribeDBSnapshotsResponse
$creadPrec :: ReadPrec DescribeDBSnapshotsResponse
readList :: ReadS [DescribeDBSnapshotsResponse]
$creadList :: ReadS [DescribeDBSnapshotsResponse]
readsPrec :: Int -> ReadS DescribeDBSnapshotsResponse
$creadsPrec :: Int -> ReadS DescribeDBSnapshotsResponse
Prelude.Read, Int -> DescribeDBSnapshotsResponse -> ShowS
[DescribeDBSnapshotsResponse] -> ShowS
DescribeDBSnapshotsResponse -> String
(Int -> DescribeDBSnapshotsResponse -> ShowS)
-> (DescribeDBSnapshotsResponse -> String)
-> ([DescribeDBSnapshotsResponse] -> ShowS)
-> Show DescribeDBSnapshotsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDBSnapshotsResponse] -> ShowS
$cshowList :: [DescribeDBSnapshotsResponse] -> ShowS
show :: DescribeDBSnapshotsResponse -> String
$cshow :: DescribeDBSnapshotsResponse -> String
showsPrec :: Int -> DescribeDBSnapshotsResponse -> ShowS
$cshowsPrec :: Int -> DescribeDBSnapshotsResponse -> ShowS
Prelude.Show, (forall x.
DescribeDBSnapshotsResponse -> Rep DescribeDBSnapshotsResponse x)
-> (forall x.
Rep DescribeDBSnapshotsResponse x -> DescribeDBSnapshotsResponse)
-> Generic DescribeDBSnapshotsResponse
forall x.
Rep DescribeDBSnapshotsResponse x -> DescribeDBSnapshotsResponse
forall x.
DescribeDBSnapshotsResponse -> Rep DescribeDBSnapshotsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDBSnapshotsResponse x -> DescribeDBSnapshotsResponse
$cfrom :: forall x.
DescribeDBSnapshotsResponse -> Rep DescribeDBSnapshotsResponse x
Prelude.Generic)
newDescribeDBSnapshotsResponse ::
Prelude.Int ->
DescribeDBSnapshotsResponse
newDescribeDBSnapshotsResponse :: Int -> DescribeDBSnapshotsResponse
newDescribeDBSnapshotsResponse Int
pHttpStatus_ =
DescribeDBSnapshotsResponse' :: Maybe Text
-> Maybe [DBSnapshot] -> Int -> DescribeDBSnapshotsResponse
DescribeDBSnapshotsResponse'
{ $sel:marker:DescribeDBSnapshotsResponse' :: Maybe Text
marker =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dbSnapshots:DescribeDBSnapshotsResponse' :: Maybe [DBSnapshot]
dbSnapshots = Maybe [DBSnapshot]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeDBSnapshotsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeDBSnapshotsResponse_marker :: Lens.Lens' DescribeDBSnapshotsResponse (Prelude.Maybe Prelude.Text)
describeDBSnapshotsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeDBSnapshotsResponse -> f DescribeDBSnapshotsResponse
describeDBSnapshotsResponse_marker = (DescribeDBSnapshotsResponse -> Maybe Text)
-> (DescribeDBSnapshotsResponse
-> Maybe Text -> DescribeDBSnapshotsResponse)
-> Lens' DescribeDBSnapshotsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshotsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeDBSnapshotsResponse' :: DescribeDBSnapshotsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeDBSnapshotsResponse
s@DescribeDBSnapshotsResponse' {} Maybe Text
a -> DescribeDBSnapshotsResponse
s {$sel:marker:DescribeDBSnapshotsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeDBSnapshotsResponse)
describeDBSnapshotsResponse_dbSnapshots :: Lens.Lens' DescribeDBSnapshotsResponse (Prelude.Maybe [DBSnapshot])
describeDBSnapshotsResponse_dbSnapshots :: (Maybe [DBSnapshot] -> f (Maybe [DBSnapshot]))
-> DescribeDBSnapshotsResponse -> f DescribeDBSnapshotsResponse
describeDBSnapshotsResponse_dbSnapshots = (DescribeDBSnapshotsResponse -> Maybe [DBSnapshot])
-> (DescribeDBSnapshotsResponse
-> Maybe [DBSnapshot] -> DescribeDBSnapshotsResponse)
-> Lens' DescribeDBSnapshotsResponse (Maybe [DBSnapshot])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshotsResponse' {Maybe [DBSnapshot]
dbSnapshots :: Maybe [DBSnapshot]
$sel:dbSnapshots:DescribeDBSnapshotsResponse' :: DescribeDBSnapshotsResponse -> Maybe [DBSnapshot]
dbSnapshots} -> Maybe [DBSnapshot]
dbSnapshots) (\s :: DescribeDBSnapshotsResponse
s@DescribeDBSnapshotsResponse' {} Maybe [DBSnapshot]
a -> DescribeDBSnapshotsResponse
s {$sel:dbSnapshots:DescribeDBSnapshotsResponse' :: Maybe [DBSnapshot]
dbSnapshots = Maybe [DBSnapshot]
a} :: DescribeDBSnapshotsResponse) ((Maybe [DBSnapshot] -> f (Maybe [DBSnapshot]))
-> DescribeDBSnapshotsResponse -> f DescribeDBSnapshotsResponse)
-> ((Maybe [DBSnapshot] -> f (Maybe [DBSnapshot]))
-> Maybe [DBSnapshot] -> f (Maybe [DBSnapshot]))
-> (Maybe [DBSnapshot] -> f (Maybe [DBSnapshot]))
-> DescribeDBSnapshotsResponse
-> f DescribeDBSnapshotsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DBSnapshot] [DBSnapshot] [DBSnapshot] [DBSnapshot]
-> Iso
(Maybe [DBSnapshot])
(Maybe [DBSnapshot])
(Maybe [DBSnapshot])
(Maybe [DBSnapshot])
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 [DBSnapshot] [DBSnapshot] [DBSnapshot] [DBSnapshot]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeDBSnapshotsResponse_httpStatus :: Lens.Lens' DescribeDBSnapshotsResponse Prelude.Int
describeDBSnapshotsResponse_httpStatus :: (Int -> f Int)
-> DescribeDBSnapshotsResponse -> f DescribeDBSnapshotsResponse
describeDBSnapshotsResponse_httpStatus = (DescribeDBSnapshotsResponse -> Int)
-> (DescribeDBSnapshotsResponse
-> Int -> DescribeDBSnapshotsResponse)
-> Lens
DescribeDBSnapshotsResponse DescribeDBSnapshotsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDBSnapshotsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeDBSnapshotsResponse' :: DescribeDBSnapshotsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeDBSnapshotsResponse
s@DescribeDBSnapshotsResponse' {} Int
a -> DescribeDBSnapshotsResponse
s {$sel:httpStatus:DescribeDBSnapshotsResponse' :: Int
httpStatus = Int
a} :: DescribeDBSnapshotsResponse)
instance Prelude.NFData DescribeDBSnapshotsResponse