{-# 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.DocDbElastic.ListClusterSnapshots
(
ListClusterSnapshots (..),
newListClusterSnapshots,
listClusterSnapshots_clusterArn,
listClusterSnapshots_maxResults,
listClusterSnapshots_nextToken,
ListClusterSnapshotsResponse (..),
newListClusterSnapshotsResponse,
listClusterSnapshotsResponse_nextToken,
listClusterSnapshotsResponse_snapshots,
listClusterSnapshotsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DocDbElastic.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListClusterSnapshots = ListClusterSnapshots'
{
ListClusterSnapshots -> Maybe Text
clusterArn :: Prelude.Maybe Prelude.Text,
ListClusterSnapshots -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListClusterSnapshots -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListClusterSnapshots -> ListClusterSnapshots -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListClusterSnapshots -> ListClusterSnapshots -> Bool
$c/= :: ListClusterSnapshots -> ListClusterSnapshots -> Bool
== :: ListClusterSnapshots -> ListClusterSnapshots -> Bool
$c== :: ListClusterSnapshots -> ListClusterSnapshots -> Bool
Prelude.Eq, ReadPrec [ListClusterSnapshots]
ReadPrec ListClusterSnapshots
Int -> ReadS ListClusterSnapshots
ReadS [ListClusterSnapshots]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListClusterSnapshots]
$creadListPrec :: ReadPrec [ListClusterSnapshots]
readPrec :: ReadPrec ListClusterSnapshots
$creadPrec :: ReadPrec ListClusterSnapshots
readList :: ReadS [ListClusterSnapshots]
$creadList :: ReadS [ListClusterSnapshots]
readsPrec :: Int -> ReadS ListClusterSnapshots
$creadsPrec :: Int -> ReadS ListClusterSnapshots
Prelude.Read, Int -> ListClusterSnapshots -> ShowS
[ListClusterSnapshots] -> ShowS
ListClusterSnapshots -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListClusterSnapshots] -> ShowS
$cshowList :: [ListClusterSnapshots] -> ShowS
show :: ListClusterSnapshots -> String
$cshow :: ListClusterSnapshots -> String
showsPrec :: Int -> ListClusterSnapshots -> ShowS
$cshowsPrec :: Int -> ListClusterSnapshots -> ShowS
Prelude.Show, forall x. Rep ListClusterSnapshots x -> ListClusterSnapshots
forall x. ListClusterSnapshots -> Rep ListClusterSnapshots x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListClusterSnapshots x -> ListClusterSnapshots
$cfrom :: forall x. ListClusterSnapshots -> Rep ListClusterSnapshots x
Prelude.Generic)
newListClusterSnapshots ::
ListClusterSnapshots
newListClusterSnapshots :: ListClusterSnapshots
newListClusterSnapshots =
ListClusterSnapshots'
{ $sel:clusterArn:ListClusterSnapshots' :: Maybe Text
clusterArn = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListClusterSnapshots' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListClusterSnapshots' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listClusterSnapshots_clusterArn :: Lens.Lens' ListClusterSnapshots (Prelude.Maybe Prelude.Text)
listClusterSnapshots_clusterArn :: Lens' ListClusterSnapshots (Maybe Text)
listClusterSnapshots_clusterArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterSnapshots' {Maybe Text
clusterArn :: Maybe Text
$sel:clusterArn:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Text
clusterArn} -> Maybe Text
clusterArn) (\s :: ListClusterSnapshots
s@ListClusterSnapshots' {} Maybe Text
a -> ListClusterSnapshots
s {$sel:clusterArn:ListClusterSnapshots' :: Maybe Text
clusterArn = Maybe Text
a} :: ListClusterSnapshots)
listClusterSnapshots_maxResults :: Lens.Lens' ListClusterSnapshots (Prelude.Maybe Prelude.Natural)
listClusterSnapshots_maxResults :: Lens' ListClusterSnapshots (Maybe Natural)
listClusterSnapshots_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterSnapshots' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListClusterSnapshots
s@ListClusterSnapshots' {} Maybe Natural
a -> ListClusterSnapshots
s {$sel:maxResults:ListClusterSnapshots' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListClusterSnapshots)
listClusterSnapshots_nextToken :: Lens.Lens' ListClusterSnapshots (Prelude.Maybe Prelude.Text)
listClusterSnapshots_nextToken :: Lens' ListClusterSnapshots (Maybe Text)
listClusterSnapshots_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterSnapshots' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListClusterSnapshots
s@ListClusterSnapshots' {} Maybe Text
a -> ListClusterSnapshots
s {$sel:nextToken:ListClusterSnapshots' :: Maybe Text
nextToken = Maybe Text
a} :: ListClusterSnapshots)
instance Core.AWSPager ListClusterSnapshots where
page :: ListClusterSnapshots
-> AWSResponse ListClusterSnapshots -> Maybe ListClusterSnapshots
page ListClusterSnapshots
rq AWSResponse ListClusterSnapshots
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListClusterSnapshots
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListClusterSnapshotsResponse (Maybe Text)
listClusterSnapshotsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListClusterSnapshots
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListClusterSnapshotsResponse (Maybe [ClusterSnapshotInList])
listClusterSnapshotsResponse_snapshots
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListClusterSnapshots
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListClusterSnapshots (Maybe Text)
listClusterSnapshots_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListClusterSnapshots
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListClusterSnapshotsResponse (Maybe Text)
listClusterSnapshotsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListClusterSnapshots where
type
AWSResponse ListClusterSnapshots =
ListClusterSnapshotsResponse
request :: (Service -> Service)
-> ListClusterSnapshots -> Request ListClusterSnapshots
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListClusterSnapshots
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListClusterSnapshots)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [ClusterSnapshotInList]
-> Int
-> ListClusterSnapshotsResponse
ListClusterSnapshotsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"snapshots" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListClusterSnapshots where
hashWithSalt :: Int -> ListClusterSnapshots -> Int
hashWithSalt Int
_salt ListClusterSnapshots' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
clusterArn :: Maybe Text
$sel:nextToken:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Text
$sel:maxResults:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Natural
$sel:clusterArn:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListClusterSnapshots where
rnf :: ListClusterSnapshots -> ()
rnf ListClusterSnapshots' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
clusterArn :: Maybe Text
$sel:nextToken:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Text
$sel:maxResults:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Natural
$sel:clusterArn:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListClusterSnapshots where
toHeaders :: ListClusterSnapshots -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListClusterSnapshots where
toPath :: ListClusterSnapshots -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/cluster-snapshots"
instance Data.ToQuery ListClusterSnapshots where
toQuery :: ListClusterSnapshots -> QueryString
toQuery ListClusterSnapshots' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
clusterArn :: Maybe Text
$sel:nextToken:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Text
$sel:maxResults:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Natural
$sel:clusterArn:ListClusterSnapshots' :: ListClusterSnapshots -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"clusterArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clusterArn,
ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListClusterSnapshotsResponse = ListClusterSnapshotsResponse'
{
ListClusterSnapshotsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListClusterSnapshotsResponse -> Maybe [ClusterSnapshotInList]
snapshots :: Prelude.Maybe [ClusterSnapshotInList],
ListClusterSnapshotsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListClusterSnapshotsResponse
-> ListClusterSnapshotsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListClusterSnapshotsResponse
-> ListClusterSnapshotsResponse -> Bool
$c/= :: ListClusterSnapshotsResponse
-> ListClusterSnapshotsResponse -> Bool
== :: ListClusterSnapshotsResponse
-> ListClusterSnapshotsResponse -> Bool
$c== :: ListClusterSnapshotsResponse
-> ListClusterSnapshotsResponse -> Bool
Prelude.Eq, ReadPrec [ListClusterSnapshotsResponse]
ReadPrec ListClusterSnapshotsResponse
Int -> ReadS ListClusterSnapshotsResponse
ReadS [ListClusterSnapshotsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListClusterSnapshotsResponse]
$creadListPrec :: ReadPrec [ListClusterSnapshotsResponse]
readPrec :: ReadPrec ListClusterSnapshotsResponse
$creadPrec :: ReadPrec ListClusterSnapshotsResponse
readList :: ReadS [ListClusterSnapshotsResponse]
$creadList :: ReadS [ListClusterSnapshotsResponse]
readsPrec :: Int -> ReadS ListClusterSnapshotsResponse
$creadsPrec :: Int -> ReadS ListClusterSnapshotsResponse
Prelude.Read, Int -> ListClusterSnapshotsResponse -> ShowS
[ListClusterSnapshotsResponse] -> ShowS
ListClusterSnapshotsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListClusterSnapshotsResponse] -> ShowS
$cshowList :: [ListClusterSnapshotsResponse] -> ShowS
show :: ListClusterSnapshotsResponse -> String
$cshow :: ListClusterSnapshotsResponse -> String
showsPrec :: Int -> ListClusterSnapshotsResponse -> ShowS
$cshowsPrec :: Int -> ListClusterSnapshotsResponse -> ShowS
Prelude.Show, forall x.
Rep ListClusterSnapshotsResponse x -> ListClusterSnapshotsResponse
forall x.
ListClusterSnapshotsResponse -> Rep ListClusterSnapshotsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListClusterSnapshotsResponse x -> ListClusterSnapshotsResponse
$cfrom :: forall x.
ListClusterSnapshotsResponse -> Rep ListClusterSnapshotsResponse x
Prelude.Generic)
newListClusterSnapshotsResponse ::
Prelude.Int ->
ListClusterSnapshotsResponse
newListClusterSnapshotsResponse :: Int -> ListClusterSnapshotsResponse
newListClusterSnapshotsResponse Int
pHttpStatus_ =
ListClusterSnapshotsResponse'
{ $sel:nextToken:ListClusterSnapshotsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:snapshots:ListClusterSnapshotsResponse' :: Maybe [ClusterSnapshotInList]
snapshots = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListClusterSnapshotsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listClusterSnapshotsResponse_nextToken :: Lens.Lens' ListClusterSnapshotsResponse (Prelude.Maybe Prelude.Text)
listClusterSnapshotsResponse_nextToken :: Lens' ListClusterSnapshotsResponse (Maybe Text)
listClusterSnapshotsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterSnapshotsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListClusterSnapshotsResponse' :: ListClusterSnapshotsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListClusterSnapshotsResponse
s@ListClusterSnapshotsResponse' {} Maybe Text
a -> ListClusterSnapshotsResponse
s {$sel:nextToken:ListClusterSnapshotsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListClusterSnapshotsResponse)
listClusterSnapshotsResponse_snapshots :: Lens.Lens' ListClusterSnapshotsResponse (Prelude.Maybe [ClusterSnapshotInList])
listClusterSnapshotsResponse_snapshots :: Lens' ListClusterSnapshotsResponse (Maybe [ClusterSnapshotInList])
listClusterSnapshotsResponse_snapshots = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterSnapshotsResponse' {Maybe [ClusterSnapshotInList]
snapshots :: Maybe [ClusterSnapshotInList]
$sel:snapshots:ListClusterSnapshotsResponse' :: ListClusterSnapshotsResponse -> Maybe [ClusterSnapshotInList]
snapshots} -> Maybe [ClusterSnapshotInList]
snapshots) (\s :: ListClusterSnapshotsResponse
s@ListClusterSnapshotsResponse' {} Maybe [ClusterSnapshotInList]
a -> ListClusterSnapshotsResponse
s {$sel:snapshots:ListClusterSnapshotsResponse' :: Maybe [ClusterSnapshotInList]
snapshots = Maybe [ClusterSnapshotInList]
a} :: ListClusterSnapshotsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listClusterSnapshotsResponse_httpStatus :: Lens.Lens' ListClusterSnapshotsResponse Prelude.Int
listClusterSnapshotsResponse_httpStatus :: Lens' ListClusterSnapshotsResponse Int
listClusterSnapshotsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListClusterSnapshotsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListClusterSnapshotsResponse' :: ListClusterSnapshotsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListClusterSnapshotsResponse
s@ListClusterSnapshotsResponse' {} Int
a -> ListClusterSnapshotsResponse
s {$sel:httpStatus:ListClusterSnapshotsResponse' :: Int
httpStatus = Int
a} :: ListClusterSnapshotsResponse)
instance Prelude.NFData ListClusterSnapshotsResponse where
rnf :: ListClusterSnapshotsResponse -> ()
rnf ListClusterSnapshotsResponse' {Int
Maybe [ClusterSnapshotInList]
Maybe Text
httpStatus :: Int
snapshots :: Maybe [ClusterSnapshotInList]
nextToken :: Maybe Text
$sel:httpStatus:ListClusterSnapshotsResponse' :: ListClusterSnapshotsResponse -> Int
$sel:snapshots:ListClusterSnapshotsResponse' :: ListClusterSnapshotsResponse -> Maybe [ClusterSnapshotInList]
$sel:nextToken:ListClusterSnapshotsResponse' :: ListClusterSnapshotsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ClusterSnapshotInList]
snapshots
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus