{-# 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.MigrationHubOrchestrator.ListTemplateStepGroups
(
ListTemplateStepGroups (..),
newListTemplateStepGroups,
listTemplateStepGroups_maxResults,
listTemplateStepGroups_nextToken,
listTemplateStepGroups_templateId,
ListTemplateStepGroupsResponse (..),
newListTemplateStepGroupsResponse,
listTemplateStepGroupsResponse_nextToken,
listTemplateStepGroupsResponse_httpStatus,
listTemplateStepGroupsResponse_templateStepGroupSummary,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubOrchestrator.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListTemplateStepGroups = ListTemplateStepGroups'
{
ListTemplateStepGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListTemplateStepGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTemplateStepGroups -> Text
templateId :: Prelude.Text
}
deriving (ListTemplateStepGroups -> ListTemplateStepGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTemplateStepGroups -> ListTemplateStepGroups -> Bool
$c/= :: ListTemplateStepGroups -> ListTemplateStepGroups -> Bool
== :: ListTemplateStepGroups -> ListTemplateStepGroups -> Bool
$c== :: ListTemplateStepGroups -> ListTemplateStepGroups -> Bool
Prelude.Eq, ReadPrec [ListTemplateStepGroups]
ReadPrec ListTemplateStepGroups
Int -> ReadS ListTemplateStepGroups
ReadS [ListTemplateStepGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTemplateStepGroups]
$creadListPrec :: ReadPrec [ListTemplateStepGroups]
readPrec :: ReadPrec ListTemplateStepGroups
$creadPrec :: ReadPrec ListTemplateStepGroups
readList :: ReadS [ListTemplateStepGroups]
$creadList :: ReadS [ListTemplateStepGroups]
readsPrec :: Int -> ReadS ListTemplateStepGroups
$creadsPrec :: Int -> ReadS ListTemplateStepGroups
Prelude.Read, Int -> ListTemplateStepGroups -> ShowS
[ListTemplateStepGroups] -> ShowS
ListTemplateStepGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTemplateStepGroups] -> ShowS
$cshowList :: [ListTemplateStepGroups] -> ShowS
show :: ListTemplateStepGroups -> String
$cshow :: ListTemplateStepGroups -> String
showsPrec :: Int -> ListTemplateStepGroups -> ShowS
$cshowsPrec :: Int -> ListTemplateStepGroups -> ShowS
Prelude.Show, forall x. Rep ListTemplateStepGroups x -> ListTemplateStepGroups
forall x. ListTemplateStepGroups -> Rep ListTemplateStepGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTemplateStepGroups x -> ListTemplateStepGroups
$cfrom :: forall x. ListTemplateStepGroups -> Rep ListTemplateStepGroups x
Prelude.Generic)
newListTemplateStepGroups ::
Prelude.Text ->
ListTemplateStepGroups
newListTemplateStepGroups :: Text -> ListTemplateStepGroups
newListTemplateStepGroups Text
pTemplateId_ =
ListTemplateStepGroups'
{ $sel:maxResults:ListTemplateStepGroups' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListTemplateStepGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:templateId:ListTemplateStepGroups' :: Text
templateId = Text
pTemplateId_
}
listTemplateStepGroups_maxResults :: Lens.Lens' ListTemplateStepGroups (Prelude.Maybe Prelude.Natural)
listTemplateStepGroups_maxResults :: Lens' ListTemplateStepGroups (Maybe Natural)
listTemplateStepGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateStepGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTemplateStepGroups' :: ListTemplateStepGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTemplateStepGroups
s@ListTemplateStepGroups' {} Maybe Natural
a -> ListTemplateStepGroups
s {$sel:maxResults:ListTemplateStepGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTemplateStepGroups)
listTemplateStepGroups_nextToken :: Lens.Lens' ListTemplateStepGroups (Prelude.Maybe Prelude.Text)
listTemplateStepGroups_nextToken :: Lens' ListTemplateStepGroups (Maybe Text)
listTemplateStepGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateStepGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTemplateStepGroups' :: ListTemplateStepGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTemplateStepGroups
s@ListTemplateStepGroups' {} Maybe Text
a -> ListTemplateStepGroups
s {$sel:nextToken:ListTemplateStepGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListTemplateStepGroups)
listTemplateStepGroups_templateId :: Lens.Lens' ListTemplateStepGroups Prelude.Text
listTemplateStepGroups_templateId :: Lens' ListTemplateStepGroups Text
listTemplateStepGroups_templateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateStepGroups' {Text
templateId :: Text
$sel:templateId:ListTemplateStepGroups' :: ListTemplateStepGroups -> Text
templateId} -> Text
templateId) (\s :: ListTemplateStepGroups
s@ListTemplateStepGroups' {} Text
a -> ListTemplateStepGroups
s {$sel:templateId:ListTemplateStepGroups' :: Text
templateId = Text
a} :: ListTemplateStepGroups)
instance Core.AWSPager ListTemplateStepGroups where
page :: ListTemplateStepGroups
-> AWSResponse ListTemplateStepGroups
-> Maybe ListTemplateStepGroups
page ListTemplateStepGroups
rq AWSResponse ListTemplateStepGroups
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListTemplateStepGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTemplateStepGroupsResponse (Maybe Text)
listTemplateStepGroupsResponse_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 ListTemplateStepGroups
rs
forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListTemplateStepGroupsResponse [TemplateStepGroupSummary]
listTemplateStepGroupsResponse_templateStepGroupSummary
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListTemplateStepGroups
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListTemplateStepGroups (Maybe Text)
listTemplateStepGroups_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTemplateStepGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTemplateStepGroupsResponse (Maybe Text)
listTemplateStepGroupsResponse_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 ListTemplateStepGroups where
type
AWSResponse ListTemplateStepGroups =
ListTemplateStepGroupsResponse
request :: (Service -> Service)
-> ListTemplateStepGroups -> Request ListTemplateStepGroups
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 ListTemplateStepGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTemplateStepGroups)))
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
-> Int
-> [TemplateStepGroupSummary]
-> ListTemplateStepGroupsResponse
ListTemplateStepGroupsResponse'
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
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
"templateStepGroupSummary"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListTemplateStepGroups where
hashWithSalt :: Int -> ListTemplateStepGroups -> Int
hashWithSalt Int
_salt ListTemplateStepGroups' {Maybe Natural
Maybe Text
Text
templateId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:templateId:ListTemplateStepGroups' :: ListTemplateStepGroups -> Text
$sel:nextToken:ListTemplateStepGroups' :: ListTemplateStepGroups -> Maybe Text
$sel:maxResults:ListTemplateStepGroups' :: ListTemplateStepGroups -> 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateId
instance Prelude.NFData ListTemplateStepGroups where
rnf :: ListTemplateStepGroups -> ()
rnf ListTemplateStepGroups' {Maybe Natural
Maybe Text
Text
templateId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:templateId:ListTemplateStepGroups' :: ListTemplateStepGroups -> Text
$sel:nextToken:ListTemplateStepGroups' :: ListTemplateStepGroups -> Maybe Text
$sel:maxResults:ListTemplateStepGroups' :: ListTemplateStepGroups -> 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateId
instance Data.ToHeaders ListTemplateStepGroups where
toHeaders :: ListTemplateStepGroups -> 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 ListTemplateStepGroups where
toPath :: ListTemplateStepGroups -> ByteString
toPath ListTemplateStepGroups' {Maybe Natural
Maybe Text
Text
templateId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:templateId:ListTemplateStepGroups' :: ListTemplateStepGroups -> Text
$sel:nextToken:ListTemplateStepGroups' :: ListTemplateStepGroups -> Maybe Text
$sel:maxResults:ListTemplateStepGroups' :: ListTemplateStepGroups -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/templatestepgroups/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
templateId]
instance Data.ToQuery ListTemplateStepGroups where
toQuery :: ListTemplateStepGroups -> QueryString
toQuery ListTemplateStepGroups' {Maybe Natural
Maybe Text
Text
templateId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:templateId:ListTemplateStepGroups' :: ListTemplateStepGroups -> Text
$sel:nextToken:ListTemplateStepGroups' :: ListTemplateStepGroups -> Maybe Text
$sel:maxResults:ListTemplateStepGroups' :: ListTemplateStepGroups -> 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 ListTemplateStepGroupsResponse = ListTemplateStepGroupsResponse'
{
ListTemplateStepGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTemplateStepGroupsResponse -> Int
httpStatus :: Prelude.Int,
ListTemplateStepGroupsResponse -> [TemplateStepGroupSummary]
templateStepGroupSummary :: [TemplateStepGroupSummary]
}
deriving (ListTemplateStepGroupsResponse
-> ListTemplateStepGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTemplateStepGroupsResponse
-> ListTemplateStepGroupsResponse -> Bool
$c/= :: ListTemplateStepGroupsResponse
-> ListTemplateStepGroupsResponse -> Bool
== :: ListTemplateStepGroupsResponse
-> ListTemplateStepGroupsResponse -> Bool
$c== :: ListTemplateStepGroupsResponse
-> ListTemplateStepGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListTemplateStepGroupsResponse]
ReadPrec ListTemplateStepGroupsResponse
Int -> ReadS ListTemplateStepGroupsResponse
ReadS [ListTemplateStepGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTemplateStepGroupsResponse]
$creadListPrec :: ReadPrec [ListTemplateStepGroupsResponse]
readPrec :: ReadPrec ListTemplateStepGroupsResponse
$creadPrec :: ReadPrec ListTemplateStepGroupsResponse
readList :: ReadS [ListTemplateStepGroupsResponse]
$creadList :: ReadS [ListTemplateStepGroupsResponse]
readsPrec :: Int -> ReadS ListTemplateStepGroupsResponse
$creadsPrec :: Int -> ReadS ListTemplateStepGroupsResponse
Prelude.Read, Int -> ListTemplateStepGroupsResponse -> ShowS
[ListTemplateStepGroupsResponse] -> ShowS
ListTemplateStepGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTemplateStepGroupsResponse] -> ShowS
$cshowList :: [ListTemplateStepGroupsResponse] -> ShowS
show :: ListTemplateStepGroupsResponse -> String
$cshow :: ListTemplateStepGroupsResponse -> String
showsPrec :: Int -> ListTemplateStepGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListTemplateStepGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListTemplateStepGroupsResponse x
-> ListTemplateStepGroupsResponse
forall x.
ListTemplateStepGroupsResponse
-> Rep ListTemplateStepGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTemplateStepGroupsResponse x
-> ListTemplateStepGroupsResponse
$cfrom :: forall x.
ListTemplateStepGroupsResponse
-> Rep ListTemplateStepGroupsResponse x
Prelude.Generic)
newListTemplateStepGroupsResponse ::
Prelude.Int ->
ListTemplateStepGroupsResponse
newListTemplateStepGroupsResponse :: Int -> ListTemplateStepGroupsResponse
newListTemplateStepGroupsResponse Int
pHttpStatus_ =
ListTemplateStepGroupsResponse'
{ $sel:nextToken:ListTemplateStepGroupsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTemplateStepGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:templateStepGroupSummary:ListTemplateStepGroupsResponse' :: [TemplateStepGroupSummary]
templateStepGroupSummary = forall a. Monoid a => a
Prelude.mempty
}
listTemplateStepGroupsResponse_nextToken :: Lens.Lens' ListTemplateStepGroupsResponse (Prelude.Maybe Prelude.Text)
listTemplateStepGroupsResponse_nextToken :: Lens' ListTemplateStepGroupsResponse (Maybe Text)
listTemplateStepGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateStepGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTemplateStepGroupsResponse' :: ListTemplateStepGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTemplateStepGroupsResponse
s@ListTemplateStepGroupsResponse' {} Maybe Text
a -> ListTemplateStepGroupsResponse
s {$sel:nextToken:ListTemplateStepGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTemplateStepGroupsResponse)
listTemplateStepGroupsResponse_httpStatus :: Lens.Lens' ListTemplateStepGroupsResponse Prelude.Int
listTemplateStepGroupsResponse_httpStatus :: Lens' ListTemplateStepGroupsResponse Int
listTemplateStepGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateStepGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTemplateStepGroupsResponse' :: ListTemplateStepGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTemplateStepGroupsResponse
s@ListTemplateStepGroupsResponse' {} Int
a -> ListTemplateStepGroupsResponse
s {$sel:httpStatus:ListTemplateStepGroupsResponse' :: Int
httpStatus = Int
a} :: ListTemplateStepGroupsResponse)
listTemplateStepGroupsResponse_templateStepGroupSummary :: Lens.Lens' ListTemplateStepGroupsResponse [TemplateStepGroupSummary]
listTemplateStepGroupsResponse_templateStepGroupSummary :: Lens' ListTemplateStepGroupsResponse [TemplateStepGroupSummary]
listTemplateStepGroupsResponse_templateStepGroupSummary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplateStepGroupsResponse' {[TemplateStepGroupSummary]
templateStepGroupSummary :: [TemplateStepGroupSummary]
$sel:templateStepGroupSummary:ListTemplateStepGroupsResponse' :: ListTemplateStepGroupsResponse -> [TemplateStepGroupSummary]
templateStepGroupSummary} -> [TemplateStepGroupSummary]
templateStepGroupSummary) (\s :: ListTemplateStepGroupsResponse
s@ListTemplateStepGroupsResponse' {} [TemplateStepGroupSummary]
a -> ListTemplateStepGroupsResponse
s {$sel:templateStepGroupSummary:ListTemplateStepGroupsResponse' :: [TemplateStepGroupSummary]
templateStepGroupSummary = [TemplateStepGroupSummary]
a} :: ListTemplateStepGroupsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
ListTemplateStepGroupsResponse
where
rnf :: ListTemplateStepGroupsResponse -> ()
rnf ListTemplateStepGroupsResponse' {Int
[TemplateStepGroupSummary]
Maybe Text
templateStepGroupSummary :: [TemplateStepGroupSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:templateStepGroupSummary:ListTemplateStepGroupsResponse' :: ListTemplateStepGroupsResponse -> [TemplateStepGroupSummary]
$sel:httpStatus:ListTemplateStepGroupsResponse' :: ListTemplateStepGroupsResponse -> Int
$sel:nextToken:ListTemplateStepGroupsResponse' :: ListTemplateStepGroupsResponse -> 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 Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [TemplateStepGroupSummary]
templateStepGroupSummary