{-# 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.ListBackupPlanTemplates
(
ListBackupPlanTemplates (..),
newListBackupPlanTemplates,
listBackupPlanTemplates_maxResults,
listBackupPlanTemplates_nextToken,
ListBackupPlanTemplatesResponse (..),
newListBackupPlanTemplatesResponse,
listBackupPlanTemplatesResponse_backupPlanTemplatesList,
listBackupPlanTemplatesResponse_nextToken,
listBackupPlanTemplatesResponse_httpStatus,
)
where
import Amazonka.Backup.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListBackupPlanTemplates = ListBackupPlanTemplates'
{
ListBackupPlanTemplates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListBackupPlanTemplates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListBackupPlanTemplates -> ListBackupPlanTemplates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBackupPlanTemplates -> ListBackupPlanTemplates -> Bool
$c/= :: ListBackupPlanTemplates -> ListBackupPlanTemplates -> Bool
== :: ListBackupPlanTemplates -> ListBackupPlanTemplates -> Bool
$c== :: ListBackupPlanTemplates -> ListBackupPlanTemplates -> Bool
Prelude.Eq, ReadPrec [ListBackupPlanTemplates]
ReadPrec ListBackupPlanTemplates
Int -> ReadS ListBackupPlanTemplates
ReadS [ListBackupPlanTemplates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBackupPlanTemplates]
$creadListPrec :: ReadPrec [ListBackupPlanTemplates]
readPrec :: ReadPrec ListBackupPlanTemplates
$creadPrec :: ReadPrec ListBackupPlanTemplates
readList :: ReadS [ListBackupPlanTemplates]
$creadList :: ReadS [ListBackupPlanTemplates]
readsPrec :: Int -> ReadS ListBackupPlanTemplates
$creadsPrec :: Int -> ReadS ListBackupPlanTemplates
Prelude.Read, Int -> ListBackupPlanTemplates -> ShowS
[ListBackupPlanTemplates] -> ShowS
ListBackupPlanTemplates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBackupPlanTemplates] -> ShowS
$cshowList :: [ListBackupPlanTemplates] -> ShowS
show :: ListBackupPlanTemplates -> String
$cshow :: ListBackupPlanTemplates -> String
showsPrec :: Int -> ListBackupPlanTemplates -> ShowS
$cshowsPrec :: Int -> ListBackupPlanTemplates -> ShowS
Prelude.Show, forall x. Rep ListBackupPlanTemplates x -> ListBackupPlanTemplates
forall x. ListBackupPlanTemplates -> Rep ListBackupPlanTemplates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBackupPlanTemplates x -> ListBackupPlanTemplates
$cfrom :: forall x. ListBackupPlanTemplates -> Rep ListBackupPlanTemplates x
Prelude.Generic)
newListBackupPlanTemplates ::
ListBackupPlanTemplates
newListBackupPlanTemplates :: ListBackupPlanTemplates
newListBackupPlanTemplates =
ListBackupPlanTemplates'
{ $sel:maxResults:ListBackupPlanTemplates' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListBackupPlanTemplates' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listBackupPlanTemplates_maxResults :: Lens.Lens' ListBackupPlanTemplates (Prelude.Maybe Prelude.Natural)
listBackupPlanTemplates_maxResults :: Lens' ListBackupPlanTemplates (Maybe Natural)
listBackupPlanTemplates_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupPlanTemplates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListBackupPlanTemplates' :: ListBackupPlanTemplates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListBackupPlanTemplates
s@ListBackupPlanTemplates' {} Maybe Natural
a -> ListBackupPlanTemplates
s {$sel:maxResults:ListBackupPlanTemplates' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListBackupPlanTemplates)
listBackupPlanTemplates_nextToken :: Lens.Lens' ListBackupPlanTemplates (Prelude.Maybe Prelude.Text)
listBackupPlanTemplates_nextToken :: Lens' ListBackupPlanTemplates (Maybe Text)
listBackupPlanTemplates_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupPlanTemplates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBackupPlanTemplates' :: ListBackupPlanTemplates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBackupPlanTemplates
s@ListBackupPlanTemplates' {} Maybe Text
a -> ListBackupPlanTemplates
s {$sel:nextToken:ListBackupPlanTemplates' :: Maybe Text
nextToken = Maybe Text
a} :: ListBackupPlanTemplates)
instance Core.AWSPager ListBackupPlanTemplates where
page :: ListBackupPlanTemplates
-> AWSResponse ListBackupPlanTemplates
-> Maybe ListBackupPlanTemplates
page ListBackupPlanTemplates
rq AWSResponse ListBackupPlanTemplates
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListBackupPlanTemplates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBackupPlanTemplatesResponse (Maybe Text)
listBackupPlanTemplatesResponse_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 ListBackupPlanTemplates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListBackupPlanTemplatesResponse
(Maybe [BackupPlanTemplatesListMember])
listBackupPlanTemplatesResponse_backupPlanTemplatesList
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.$ ListBackupPlanTemplates
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListBackupPlanTemplates (Maybe Text)
listBackupPlanTemplates_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListBackupPlanTemplates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBackupPlanTemplatesResponse (Maybe Text)
listBackupPlanTemplatesResponse_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 ListBackupPlanTemplates where
type
AWSResponse ListBackupPlanTemplates =
ListBackupPlanTemplatesResponse
request :: (Service -> Service)
-> ListBackupPlanTemplates -> Request ListBackupPlanTemplates
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 ListBackupPlanTemplates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListBackupPlanTemplates)))
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 [BackupPlanTemplatesListMember]
-> Maybe Text -> Int -> ListBackupPlanTemplatesResponse
ListBackupPlanTemplatesResponse'
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
"BackupPlanTemplatesList"
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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListBackupPlanTemplates where
hashWithSalt :: Int -> ListBackupPlanTemplates -> Int
hashWithSalt Int
_salt ListBackupPlanTemplates' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListBackupPlanTemplates' :: ListBackupPlanTemplates -> Maybe Text
$sel:maxResults:ListBackupPlanTemplates' :: ListBackupPlanTemplates -> Maybe Natural
..} =
Int
_salt
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 ListBackupPlanTemplates where
rnf :: ListBackupPlanTemplates -> ()
rnf ListBackupPlanTemplates' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListBackupPlanTemplates' :: ListBackupPlanTemplates -> Maybe Text
$sel:maxResults:ListBackupPlanTemplates' :: ListBackupPlanTemplates -> Maybe Natural
..} =
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 ListBackupPlanTemplates where
toHeaders :: ListBackupPlanTemplates -> 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 ListBackupPlanTemplates where
toPath :: ListBackupPlanTemplates -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/backup/template/plans"
instance Data.ToQuery ListBackupPlanTemplates where
toQuery :: ListBackupPlanTemplates -> QueryString
toQuery ListBackupPlanTemplates' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListBackupPlanTemplates' :: ListBackupPlanTemplates -> Maybe Text
$sel:maxResults:ListBackupPlanTemplates' :: ListBackupPlanTemplates -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 ListBackupPlanTemplatesResponse = ListBackupPlanTemplatesResponse'
{
ListBackupPlanTemplatesResponse
-> Maybe [BackupPlanTemplatesListMember]
backupPlanTemplatesList :: Prelude.Maybe [BackupPlanTemplatesListMember],
ListBackupPlanTemplatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListBackupPlanTemplatesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListBackupPlanTemplatesResponse
-> ListBackupPlanTemplatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBackupPlanTemplatesResponse
-> ListBackupPlanTemplatesResponse -> Bool
$c/= :: ListBackupPlanTemplatesResponse
-> ListBackupPlanTemplatesResponse -> Bool
== :: ListBackupPlanTemplatesResponse
-> ListBackupPlanTemplatesResponse -> Bool
$c== :: ListBackupPlanTemplatesResponse
-> ListBackupPlanTemplatesResponse -> Bool
Prelude.Eq, ReadPrec [ListBackupPlanTemplatesResponse]
ReadPrec ListBackupPlanTemplatesResponse
Int -> ReadS ListBackupPlanTemplatesResponse
ReadS [ListBackupPlanTemplatesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBackupPlanTemplatesResponse]
$creadListPrec :: ReadPrec [ListBackupPlanTemplatesResponse]
readPrec :: ReadPrec ListBackupPlanTemplatesResponse
$creadPrec :: ReadPrec ListBackupPlanTemplatesResponse
readList :: ReadS [ListBackupPlanTemplatesResponse]
$creadList :: ReadS [ListBackupPlanTemplatesResponse]
readsPrec :: Int -> ReadS ListBackupPlanTemplatesResponse
$creadsPrec :: Int -> ReadS ListBackupPlanTemplatesResponse
Prelude.Read, Int -> ListBackupPlanTemplatesResponse -> ShowS
[ListBackupPlanTemplatesResponse] -> ShowS
ListBackupPlanTemplatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBackupPlanTemplatesResponse] -> ShowS
$cshowList :: [ListBackupPlanTemplatesResponse] -> ShowS
show :: ListBackupPlanTemplatesResponse -> String
$cshow :: ListBackupPlanTemplatesResponse -> String
showsPrec :: Int -> ListBackupPlanTemplatesResponse -> ShowS
$cshowsPrec :: Int -> ListBackupPlanTemplatesResponse -> ShowS
Prelude.Show, forall x.
Rep ListBackupPlanTemplatesResponse x
-> ListBackupPlanTemplatesResponse
forall x.
ListBackupPlanTemplatesResponse
-> Rep ListBackupPlanTemplatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBackupPlanTemplatesResponse x
-> ListBackupPlanTemplatesResponse
$cfrom :: forall x.
ListBackupPlanTemplatesResponse
-> Rep ListBackupPlanTemplatesResponse x
Prelude.Generic)
newListBackupPlanTemplatesResponse ::
Prelude.Int ->
ListBackupPlanTemplatesResponse
newListBackupPlanTemplatesResponse :: Int -> ListBackupPlanTemplatesResponse
newListBackupPlanTemplatesResponse Int
pHttpStatus_ =
ListBackupPlanTemplatesResponse'
{ $sel:backupPlanTemplatesList:ListBackupPlanTemplatesResponse' :: Maybe [BackupPlanTemplatesListMember]
backupPlanTemplatesList =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListBackupPlanTemplatesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListBackupPlanTemplatesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listBackupPlanTemplatesResponse_backupPlanTemplatesList :: Lens.Lens' ListBackupPlanTemplatesResponse (Prelude.Maybe [BackupPlanTemplatesListMember])
listBackupPlanTemplatesResponse_backupPlanTemplatesList :: Lens'
ListBackupPlanTemplatesResponse
(Maybe [BackupPlanTemplatesListMember])
listBackupPlanTemplatesResponse_backupPlanTemplatesList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupPlanTemplatesResponse' {Maybe [BackupPlanTemplatesListMember]
backupPlanTemplatesList :: Maybe [BackupPlanTemplatesListMember]
$sel:backupPlanTemplatesList:ListBackupPlanTemplatesResponse' :: ListBackupPlanTemplatesResponse
-> Maybe [BackupPlanTemplatesListMember]
backupPlanTemplatesList} -> Maybe [BackupPlanTemplatesListMember]
backupPlanTemplatesList) (\s :: ListBackupPlanTemplatesResponse
s@ListBackupPlanTemplatesResponse' {} Maybe [BackupPlanTemplatesListMember]
a -> ListBackupPlanTemplatesResponse
s {$sel:backupPlanTemplatesList:ListBackupPlanTemplatesResponse' :: Maybe [BackupPlanTemplatesListMember]
backupPlanTemplatesList = Maybe [BackupPlanTemplatesListMember]
a} :: ListBackupPlanTemplatesResponse) 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
listBackupPlanTemplatesResponse_nextToken :: Lens.Lens' ListBackupPlanTemplatesResponse (Prelude.Maybe Prelude.Text)
listBackupPlanTemplatesResponse_nextToken :: Lens' ListBackupPlanTemplatesResponse (Maybe Text)
listBackupPlanTemplatesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupPlanTemplatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBackupPlanTemplatesResponse' :: ListBackupPlanTemplatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBackupPlanTemplatesResponse
s@ListBackupPlanTemplatesResponse' {} Maybe Text
a -> ListBackupPlanTemplatesResponse
s {$sel:nextToken:ListBackupPlanTemplatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListBackupPlanTemplatesResponse)
listBackupPlanTemplatesResponse_httpStatus :: Lens.Lens' ListBackupPlanTemplatesResponse Prelude.Int
listBackupPlanTemplatesResponse_httpStatus :: Lens' ListBackupPlanTemplatesResponse Int
listBackupPlanTemplatesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBackupPlanTemplatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListBackupPlanTemplatesResponse' :: ListBackupPlanTemplatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListBackupPlanTemplatesResponse
s@ListBackupPlanTemplatesResponse' {} Int
a -> ListBackupPlanTemplatesResponse
s {$sel:httpStatus:ListBackupPlanTemplatesResponse' :: Int
httpStatus = Int
a} :: ListBackupPlanTemplatesResponse)
instance
Prelude.NFData
ListBackupPlanTemplatesResponse
where
rnf :: ListBackupPlanTemplatesResponse -> ()
rnf ListBackupPlanTemplatesResponse' {Int
Maybe [BackupPlanTemplatesListMember]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
backupPlanTemplatesList :: Maybe [BackupPlanTemplatesListMember]
$sel:httpStatus:ListBackupPlanTemplatesResponse' :: ListBackupPlanTemplatesResponse -> Int
$sel:nextToken:ListBackupPlanTemplatesResponse' :: ListBackupPlanTemplatesResponse -> Maybe Text
$sel:backupPlanTemplatesList:ListBackupPlanTemplatesResponse' :: ListBackupPlanTemplatesResponse
-> Maybe [BackupPlanTemplatesListMember]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [BackupPlanTemplatesListMember]
backupPlanTemplatesList
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Int
httpStatus