{-# 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.AmplifyUiBuilder.ListThemes
(
ListThemes (..),
newListThemes,
listThemes_maxResults,
listThemes_nextToken,
listThemes_appId,
listThemes_environmentName,
ListThemesResponse (..),
newListThemesResponse,
listThemesResponse_nextToken,
listThemesResponse_httpStatus,
listThemesResponse_entities,
)
where
import Amazonka.AmplifyUiBuilder.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 ListThemes = ListThemes'
{
ListThemes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListThemes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListThemes -> Text
appId :: Prelude.Text,
ListThemes -> Text
environmentName :: Prelude.Text
}
deriving (ListThemes -> ListThemes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThemes -> ListThemes -> Bool
$c/= :: ListThemes -> ListThemes -> Bool
== :: ListThemes -> ListThemes -> Bool
$c== :: ListThemes -> ListThemes -> Bool
Prelude.Eq, ReadPrec [ListThemes]
ReadPrec ListThemes
Int -> ReadS ListThemes
ReadS [ListThemes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThemes]
$creadListPrec :: ReadPrec [ListThemes]
readPrec :: ReadPrec ListThemes
$creadPrec :: ReadPrec ListThemes
readList :: ReadS [ListThemes]
$creadList :: ReadS [ListThemes]
readsPrec :: Int -> ReadS ListThemes
$creadsPrec :: Int -> ReadS ListThemes
Prelude.Read, Int -> ListThemes -> ShowS
[ListThemes] -> ShowS
ListThemes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThemes] -> ShowS
$cshowList :: [ListThemes] -> ShowS
show :: ListThemes -> String
$cshow :: ListThemes -> String
showsPrec :: Int -> ListThemes -> ShowS
$cshowsPrec :: Int -> ListThemes -> ShowS
Prelude.Show, forall x. Rep ListThemes x -> ListThemes
forall x. ListThemes -> Rep ListThemes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListThemes x -> ListThemes
$cfrom :: forall x. ListThemes -> Rep ListThemes x
Prelude.Generic)
newListThemes ::
Prelude.Text ->
Prelude.Text ->
ListThemes
newListThemes :: Text -> Text -> ListThemes
newListThemes Text
pAppId_ Text
pEnvironmentName_ =
ListThemes'
{ $sel:maxResults:ListThemes' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListThemes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:appId:ListThemes' :: Text
appId = Text
pAppId_,
$sel:environmentName:ListThemes' :: Text
environmentName = Text
pEnvironmentName_
}
listThemes_maxResults :: Lens.Lens' ListThemes (Prelude.Maybe Prelude.Natural)
listThemes_maxResults :: Lens' ListThemes (Maybe Natural)
listThemes_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThemes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListThemes' :: ListThemes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListThemes
s@ListThemes' {} Maybe Natural
a -> ListThemes
s {$sel:maxResults:ListThemes' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListThemes)
listThemes_nextToken :: Lens.Lens' ListThemes (Prelude.Maybe Prelude.Text)
listThemes_nextToken :: Lens' ListThemes (Maybe Text)
listThemes_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThemes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThemes' :: ListThemes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThemes
s@ListThemes' {} Maybe Text
a -> ListThemes
s {$sel:nextToken:ListThemes' :: Maybe Text
nextToken = Maybe Text
a} :: ListThemes)
listThemes_appId :: Lens.Lens' ListThemes Prelude.Text
listThemes_appId :: Lens' ListThemes Text
listThemes_appId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThemes' {Text
appId :: Text
$sel:appId:ListThemes' :: ListThemes -> Text
appId} -> Text
appId) (\s :: ListThemes
s@ListThemes' {} Text
a -> ListThemes
s {$sel:appId:ListThemes' :: Text
appId = Text
a} :: ListThemes)
listThemes_environmentName :: Lens.Lens' ListThemes Prelude.Text
listThemes_environmentName :: Lens' ListThemes Text
listThemes_environmentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThemes' {Text
environmentName :: Text
$sel:environmentName:ListThemes' :: ListThemes -> Text
environmentName} -> Text
environmentName) (\s :: ListThemes
s@ListThemes' {} Text
a -> ListThemes
s {$sel:environmentName:ListThemes' :: Text
environmentName = Text
a} :: ListThemes)
instance Core.AWSPager ListThemes where
page :: ListThemes -> AWSResponse ListThemes -> Maybe ListThemes
page ListThemes
rq AWSResponse ListThemes
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListThemes
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListThemesResponse (Maybe Text)
listThemesResponse_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 ListThemes
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListThemesResponse [ThemeSummary]
listThemesResponse_entities) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListThemes
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListThemes (Maybe Text)
listThemes_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListThemes
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListThemesResponse (Maybe Text)
listThemesResponse_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 ListThemes where
type AWSResponse ListThemes = ListThemesResponse
request :: (Service -> Service) -> ListThemes -> Request ListThemes
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 ListThemes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListThemes)))
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 -> [ThemeSummary] -> ListThemesResponse
ListThemesResponse'
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
"entities" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListThemes where
hashWithSalt :: Int -> ListThemes -> Int
hashWithSalt Int
_salt ListThemes' {Maybe Natural
Maybe Text
Text
environmentName :: Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:environmentName:ListThemes' :: ListThemes -> Text
$sel:appId:ListThemes' :: ListThemes -> Text
$sel:nextToken:ListThemes' :: ListThemes -> Maybe Text
$sel:maxResults:ListThemes' :: ListThemes -> 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
appId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
environmentName
instance Prelude.NFData ListThemes where
rnf :: ListThemes -> ()
rnf ListThemes' {Maybe Natural
Maybe Text
Text
environmentName :: Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:environmentName:ListThemes' :: ListThemes -> Text
$sel:appId:ListThemes' :: ListThemes -> Text
$sel:nextToken:ListThemes' :: ListThemes -> Maybe Text
$sel:maxResults:ListThemes' :: ListThemes -> 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
appId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
environmentName
instance Data.ToHeaders ListThemes where
toHeaders :: ListThemes -> 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 ListThemes where
toPath :: ListThemes -> ByteString
toPath ListThemes' {Maybe Natural
Maybe Text
Text
environmentName :: Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:environmentName:ListThemes' :: ListThemes -> Text
$sel:appId:ListThemes' :: ListThemes -> Text
$sel:nextToken:ListThemes' :: ListThemes -> Maybe Text
$sel:maxResults:ListThemes' :: ListThemes -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/app/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
appId,
ByteString
"/environment/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
environmentName,
ByteString
"/themes"
]
instance Data.ToQuery ListThemes where
toQuery :: ListThemes -> QueryString
toQuery ListThemes' {Maybe Natural
Maybe Text
Text
environmentName :: Text
appId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:environmentName:ListThemes' :: ListThemes -> Text
$sel:appId:ListThemes' :: ListThemes -> Text
$sel:nextToken:ListThemes' :: ListThemes -> Maybe Text
$sel:maxResults:ListThemes' :: ListThemes -> 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 ListThemesResponse = ListThemesResponse'
{
ListThemesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListThemesResponse -> Int
httpStatus :: Prelude.Int,
ListThemesResponse -> [ThemeSummary]
entities :: [ThemeSummary]
}
deriving (ListThemesResponse -> ListThemesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThemesResponse -> ListThemesResponse -> Bool
$c/= :: ListThemesResponse -> ListThemesResponse -> Bool
== :: ListThemesResponse -> ListThemesResponse -> Bool
$c== :: ListThemesResponse -> ListThemesResponse -> Bool
Prelude.Eq, ReadPrec [ListThemesResponse]
ReadPrec ListThemesResponse
Int -> ReadS ListThemesResponse
ReadS [ListThemesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThemesResponse]
$creadListPrec :: ReadPrec [ListThemesResponse]
readPrec :: ReadPrec ListThemesResponse
$creadPrec :: ReadPrec ListThemesResponse
readList :: ReadS [ListThemesResponse]
$creadList :: ReadS [ListThemesResponse]
readsPrec :: Int -> ReadS ListThemesResponse
$creadsPrec :: Int -> ReadS ListThemesResponse
Prelude.Read, Int -> ListThemesResponse -> ShowS
[ListThemesResponse] -> ShowS
ListThemesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThemesResponse] -> ShowS
$cshowList :: [ListThemesResponse] -> ShowS
show :: ListThemesResponse -> String
$cshow :: ListThemesResponse -> String
showsPrec :: Int -> ListThemesResponse -> ShowS
$cshowsPrec :: Int -> ListThemesResponse -> ShowS
Prelude.Show, forall x. Rep ListThemesResponse x -> ListThemesResponse
forall x. ListThemesResponse -> Rep ListThemesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListThemesResponse x -> ListThemesResponse
$cfrom :: forall x. ListThemesResponse -> Rep ListThemesResponse x
Prelude.Generic)
newListThemesResponse ::
Prelude.Int ->
ListThemesResponse
newListThemesResponse :: Int -> ListThemesResponse
newListThemesResponse Int
pHttpStatus_ =
ListThemesResponse'
{ $sel:nextToken:ListThemesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListThemesResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:entities:ListThemesResponse' :: [ThemeSummary]
entities = forall a. Monoid a => a
Prelude.mempty
}
listThemesResponse_nextToken :: Lens.Lens' ListThemesResponse (Prelude.Maybe Prelude.Text)
listThemesResponse_nextToken :: Lens' ListThemesResponse (Maybe Text)
listThemesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThemesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThemesResponse' :: ListThemesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThemesResponse
s@ListThemesResponse' {} Maybe Text
a -> ListThemesResponse
s {$sel:nextToken:ListThemesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListThemesResponse)
listThemesResponse_httpStatus :: Lens.Lens' ListThemesResponse Prelude.Int
listThemesResponse_httpStatus :: Lens' ListThemesResponse Int
listThemesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThemesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListThemesResponse' :: ListThemesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListThemesResponse
s@ListThemesResponse' {} Int
a -> ListThemesResponse
s {$sel:httpStatus:ListThemesResponse' :: Int
httpStatus = Int
a} :: ListThemesResponse)
listThemesResponse_entities :: Lens.Lens' ListThemesResponse [ThemeSummary]
listThemesResponse_entities :: Lens' ListThemesResponse [ThemeSummary]
listThemesResponse_entities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThemesResponse' {[ThemeSummary]
entities :: [ThemeSummary]
$sel:entities:ListThemesResponse' :: ListThemesResponse -> [ThemeSummary]
entities} -> [ThemeSummary]
entities) (\s :: ListThemesResponse
s@ListThemesResponse' {} [ThemeSummary]
a -> ListThemesResponse
s {$sel:entities:ListThemesResponse' :: [ThemeSummary]
entities = [ThemeSummary]
a} :: ListThemesResponse) 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 ListThemesResponse where
rnf :: ListThemesResponse -> ()
rnf ListThemesResponse' {Int
[ThemeSummary]
Maybe Text
entities :: [ThemeSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:entities:ListThemesResponse' :: ListThemesResponse -> [ThemeSummary]
$sel:httpStatus:ListThemesResponse' :: ListThemesResponse -> Int
$sel:nextToken:ListThemesResponse' :: ListThemesResponse -> 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 [ThemeSummary]
entities