{-# 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.Backup.ListBackupVaults
(
ListBackupVaults (..),
newListBackupVaults,
listBackupVaults_nextToken,
listBackupVaults_maxResults,
ListBackupVaultsResponse (..),
newListBackupVaultsResponse,
listBackupVaultsResponse_nextToken,
listBackupVaultsResponse_backupVaultList,
listBackupVaultsResponse_httpStatus,
)
where
import Amazonka.Backup.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListBackupVaults = ListBackupVaults'
{
ListBackupVaults -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListBackupVaults -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListBackupVaults -> ListBackupVaults -> Bool
(ListBackupVaults -> ListBackupVaults -> Bool)
-> (ListBackupVaults -> ListBackupVaults -> Bool)
-> Eq ListBackupVaults
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBackupVaults -> ListBackupVaults -> Bool
$c/= :: ListBackupVaults -> ListBackupVaults -> Bool
== :: ListBackupVaults -> ListBackupVaults -> Bool
$c== :: ListBackupVaults -> ListBackupVaults -> Bool
Prelude.Eq, ReadPrec [ListBackupVaults]
ReadPrec ListBackupVaults
Int -> ReadS ListBackupVaults
ReadS [ListBackupVaults]
(Int -> ReadS ListBackupVaults)
-> ReadS [ListBackupVaults]
-> ReadPrec ListBackupVaults
-> ReadPrec [ListBackupVaults]
-> Read ListBackupVaults
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBackupVaults]
$creadListPrec :: ReadPrec [ListBackupVaults]
readPrec :: ReadPrec ListBackupVaults
$creadPrec :: ReadPrec ListBackupVaults
readList :: ReadS [ListBackupVaults]
$creadList :: ReadS [ListBackupVaults]
readsPrec :: Int -> ReadS ListBackupVaults
$creadsPrec :: Int -> ReadS ListBackupVaults
Prelude.Read, Int -> ListBackupVaults -> ShowS
[ListBackupVaults] -> ShowS
ListBackupVaults -> String
(Int -> ListBackupVaults -> ShowS)
-> (ListBackupVaults -> String)
-> ([ListBackupVaults] -> ShowS)
-> Show ListBackupVaults
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBackupVaults] -> ShowS
$cshowList :: [ListBackupVaults] -> ShowS
show :: ListBackupVaults -> String
$cshow :: ListBackupVaults -> String
showsPrec :: Int -> ListBackupVaults -> ShowS
$cshowsPrec :: Int -> ListBackupVaults -> ShowS
Prelude.Show, (forall x. ListBackupVaults -> Rep ListBackupVaults x)
-> (forall x. Rep ListBackupVaults x -> ListBackupVaults)
-> Generic ListBackupVaults
forall x. Rep ListBackupVaults x -> ListBackupVaults
forall x. ListBackupVaults -> Rep ListBackupVaults x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBackupVaults x -> ListBackupVaults
$cfrom :: forall x. ListBackupVaults -> Rep ListBackupVaults x
Prelude.Generic)
newListBackupVaults ::
ListBackupVaults
newListBackupVaults :: ListBackupVaults
newListBackupVaults =
ListBackupVaults' :: Maybe Text -> Maybe Natural -> ListBackupVaults
ListBackupVaults'
{ $sel:nextToken:ListBackupVaults' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListBackupVaults' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listBackupVaults_nextToken :: Lens.Lens' ListBackupVaults (Prelude.Maybe Prelude.Text)
listBackupVaults_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListBackupVaults -> f ListBackupVaults
listBackupVaults_nextToken = (ListBackupVaults -> Maybe Text)
-> (ListBackupVaults -> Maybe Text -> ListBackupVaults)
-> Lens ListBackupVaults ListBackupVaults (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupVaults' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBackupVaults' :: ListBackupVaults -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBackupVaults
s@ListBackupVaults' {} Maybe Text
a -> ListBackupVaults
s {$sel:nextToken:ListBackupVaults' :: Maybe Text
nextToken = Maybe Text
a} :: ListBackupVaults)
listBackupVaults_maxResults :: Lens.Lens' ListBackupVaults (Prelude.Maybe Prelude.Natural)
listBackupVaults_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListBackupVaults -> f ListBackupVaults
listBackupVaults_maxResults = (ListBackupVaults -> Maybe Natural)
-> (ListBackupVaults -> Maybe Natural -> ListBackupVaults)
-> Lens
ListBackupVaults ListBackupVaults (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupVaults' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListBackupVaults' :: ListBackupVaults -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListBackupVaults
s@ListBackupVaults' {} Maybe Natural
a -> ListBackupVaults
s {$sel:maxResults:ListBackupVaults' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListBackupVaults)
instance Core.AWSRequest ListBackupVaults where
type
AWSResponse ListBackupVaults =
ListBackupVaultsResponse
request :: ListBackupVaults -> Request ListBackupVaults
request = Service -> ListBackupVaults -> Request ListBackupVaults
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListBackupVaults
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListBackupVaults)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListBackupVaults))
-> Logger
-> Service
-> Proxy ListBackupVaults
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListBackupVaults)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [BackupVaultListMember] -> Int -> ListBackupVaultsResponse
ListBackupVaultsResponse'
(Maybe Text
-> Maybe [BackupVaultListMember]
-> Int
-> ListBackupVaultsResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [BackupVaultListMember] -> Int -> ListBackupVaultsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
Either
String
(Maybe [BackupVaultListMember] -> Int -> ListBackupVaultsResponse)
-> Either String (Maybe [BackupVaultListMember])
-> Either String (Int -> ListBackupVaultsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [BackupVaultListMember]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BackupVaultList"
Either String (Maybe (Maybe [BackupVaultListMember]))
-> Maybe [BackupVaultListMember]
-> Either String (Maybe [BackupVaultListMember])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [BackupVaultListMember]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ListBackupVaultsResponse)
-> Either String Int -> Either String ListBackupVaultsResponse
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 ListBackupVaults
instance Prelude.NFData ListBackupVaults
instance Core.ToHeaders ListBackupVaults where
toHeaders :: ListBackupVaults -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListBackupVaults -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath ListBackupVaults where
toPath :: ListBackupVaults -> ByteString
toPath = ByteString -> ListBackupVaults -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/backup-vaults/"
instance Core.ToQuery ListBackupVaults where
toQuery :: ListBackupVaults -> QueryString
toQuery ListBackupVaults' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListBackupVaults' :: ListBackupVaults -> Maybe Natural
$sel:nextToken:ListBackupVaults' :: ListBackupVaults -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
]
data ListBackupVaultsResponse = ListBackupVaultsResponse'
{
ListBackupVaultsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListBackupVaultsResponse -> Maybe [BackupVaultListMember]
backupVaultList :: Prelude.Maybe [BackupVaultListMember],
ListBackupVaultsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListBackupVaultsResponse -> ListBackupVaultsResponse -> Bool
(ListBackupVaultsResponse -> ListBackupVaultsResponse -> Bool)
-> (ListBackupVaultsResponse -> ListBackupVaultsResponse -> Bool)
-> Eq ListBackupVaultsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBackupVaultsResponse -> ListBackupVaultsResponse -> Bool
$c/= :: ListBackupVaultsResponse -> ListBackupVaultsResponse -> Bool
== :: ListBackupVaultsResponse -> ListBackupVaultsResponse -> Bool
$c== :: ListBackupVaultsResponse -> ListBackupVaultsResponse -> Bool
Prelude.Eq, ReadPrec [ListBackupVaultsResponse]
ReadPrec ListBackupVaultsResponse
Int -> ReadS ListBackupVaultsResponse
ReadS [ListBackupVaultsResponse]
(Int -> ReadS ListBackupVaultsResponse)
-> ReadS [ListBackupVaultsResponse]
-> ReadPrec ListBackupVaultsResponse
-> ReadPrec [ListBackupVaultsResponse]
-> Read ListBackupVaultsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBackupVaultsResponse]
$creadListPrec :: ReadPrec [ListBackupVaultsResponse]
readPrec :: ReadPrec ListBackupVaultsResponse
$creadPrec :: ReadPrec ListBackupVaultsResponse
readList :: ReadS [ListBackupVaultsResponse]
$creadList :: ReadS [ListBackupVaultsResponse]
readsPrec :: Int -> ReadS ListBackupVaultsResponse
$creadsPrec :: Int -> ReadS ListBackupVaultsResponse
Prelude.Read, Int -> ListBackupVaultsResponse -> ShowS
[ListBackupVaultsResponse] -> ShowS
ListBackupVaultsResponse -> String
(Int -> ListBackupVaultsResponse -> ShowS)
-> (ListBackupVaultsResponse -> String)
-> ([ListBackupVaultsResponse] -> ShowS)
-> Show ListBackupVaultsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBackupVaultsResponse] -> ShowS
$cshowList :: [ListBackupVaultsResponse] -> ShowS
show :: ListBackupVaultsResponse -> String
$cshow :: ListBackupVaultsResponse -> String
showsPrec :: Int -> ListBackupVaultsResponse -> ShowS
$cshowsPrec :: Int -> ListBackupVaultsResponse -> ShowS
Prelude.Show, (forall x.
ListBackupVaultsResponse -> Rep ListBackupVaultsResponse x)
-> (forall x.
Rep ListBackupVaultsResponse x -> ListBackupVaultsResponse)
-> Generic ListBackupVaultsResponse
forall x.
Rep ListBackupVaultsResponse x -> ListBackupVaultsResponse
forall x.
ListBackupVaultsResponse -> Rep ListBackupVaultsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBackupVaultsResponse x -> ListBackupVaultsResponse
$cfrom :: forall x.
ListBackupVaultsResponse -> Rep ListBackupVaultsResponse x
Prelude.Generic)
newListBackupVaultsResponse ::
Prelude.Int ->
ListBackupVaultsResponse
newListBackupVaultsResponse :: Int -> ListBackupVaultsResponse
newListBackupVaultsResponse Int
pHttpStatus_ =
ListBackupVaultsResponse' :: Maybe Text
-> Maybe [BackupVaultListMember] -> Int -> ListBackupVaultsResponse
ListBackupVaultsResponse'
{ $sel:nextToken:ListBackupVaultsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:backupVaultList:ListBackupVaultsResponse' :: Maybe [BackupVaultListMember]
backupVaultList = Maybe [BackupVaultListMember]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListBackupVaultsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listBackupVaultsResponse_nextToken :: Lens.Lens' ListBackupVaultsResponse (Prelude.Maybe Prelude.Text)
listBackupVaultsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListBackupVaultsResponse -> f ListBackupVaultsResponse
listBackupVaultsResponse_nextToken = (ListBackupVaultsResponse -> Maybe Text)
-> (ListBackupVaultsResponse
-> Maybe Text -> ListBackupVaultsResponse)
-> Lens
ListBackupVaultsResponse
ListBackupVaultsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupVaultsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBackupVaultsResponse' :: ListBackupVaultsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBackupVaultsResponse
s@ListBackupVaultsResponse' {} Maybe Text
a -> ListBackupVaultsResponse
s {$sel:nextToken:ListBackupVaultsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListBackupVaultsResponse)
listBackupVaultsResponse_backupVaultList :: Lens.Lens' ListBackupVaultsResponse (Prelude.Maybe [BackupVaultListMember])
listBackupVaultsResponse_backupVaultList :: (Maybe [BackupVaultListMember]
-> f (Maybe [BackupVaultListMember]))
-> ListBackupVaultsResponse -> f ListBackupVaultsResponse
listBackupVaultsResponse_backupVaultList = (ListBackupVaultsResponse -> Maybe [BackupVaultListMember])
-> (ListBackupVaultsResponse
-> Maybe [BackupVaultListMember] -> ListBackupVaultsResponse)
-> Lens
ListBackupVaultsResponse
ListBackupVaultsResponse
(Maybe [BackupVaultListMember])
(Maybe [BackupVaultListMember])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupVaultsResponse' {Maybe [BackupVaultListMember]
backupVaultList :: Maybe [BackupVaultListMember]
$sel:backupVaultList:ListBackupVaultsResponse' :: ListBackupVaultsResponse -> Maybe [BackupVaultListMember]
backupVaultList} -> Maybe [BackupVaultListMember]
backupVaultList) (\s :: ListBackupVaultsResponse
s@ListBackupVaultsResponse' {} Maybe [BackupVaultListMember]
a -> ListBackupVaultsResponse
s {$sel:backupVaultList:ListBackupVaultsResponse' :: Maybe [BackupVaultListMember]
backupVaultList = Maybe [BackupVaultListMember]
a} :: ListBackupVaultsResponse) ((Maybe [BackupVaultListMember]
-> f (Maybe [BackupVaultListMember]))
-> ListBackupVaultsResponse -> f ListBackupVaultsResponse)
-> ((Maybe [BackupVaultListMember]
-> f (Maybe [BackupVaultListMember]))
-> Maybe [BackupVaultListMember]
-> f (Maybe [BackupVaultListMember]))
-> (Maybe [BackupVaultListMember]
-> f (Maybe [BackupVaultListMember]))
-> ListBackupVaultsResponse
-> f ListBackupVaultsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[BackupVaultListMember]
[BackupVaultListMember]
[BackupVaultListMember]
[BackupVaultListMember]
-> Iso
(Maybe [BackupVaultListMember])
(Maybe [BackupVaultListMember])
(Maybe [BackupVaultListMember])
(Maybe [BackupVaultListMember])
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
[BackupVaultListMember]
[BackupVaultListMember]
[BackupVaultListMember]
[BackupVaultListMember]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listBackupVaultsResponse_httpStatus :: Lens.Lens' ListBackupVaultsResponse Prelude.Int
listBackupVaultsResponse_httpStatus :: (Int -> f Int)
-> ListBackupVaultsResponse -> f ListBackupVaultsResponse
listBackupVaultsResponse_httpStatus = (ListBackupVaultsResponse -> Int)
-> (ListBackupVaultsResponse -> Int -> ListBackupVaultsResponse)
-> Lens ListBackupVaultsResponse ListBackupVaultsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupVaultsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListBackupVaultsResponse' :: ListBackupVaultsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListBackupVaultsResponse
s@ListBackupVaultsResponse' {} Int
a -> ListBackupVaultsResponse
s {$sel:httpStatus:ListBackupVaultsResponse' :: Int
httpStatus = Int
a} :: ListBackupVaultsResponse)
instance Prelude.NFData ListBackupVaultsResponse