{-# 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.FMS.ListAppsLists
(
ListAppsLists (..),
newListAppsLists,
listAppsLists_defaultLists,
listAppsLists_nextToken,
listAppsLists_maxResults,
ListAppsListsResponse (..),
newListAppsListsResponse,
listAppsListsResponse_appsLists,
listAppsListsResponse_nextToken,
listAppsListsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FMS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListAppsLists = ListAppsLists'
{
ListAppsLists -> Maybe Bool
defaultLists :: Prelude.Maybe Prelude.Bool,
ListAppsLists -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAppsLists -> Natural
maxResults :: Prelude.Natural
}
deriving (ListAppsLists -> ListAppsLists -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppsLists -> ListAppsLists -> Bool
$c/= :: ListAppsLists -> ListAppsLists -> Bool
== :: ListAppsLists -> ListAppsLists -> Bool
$c== :: ListAppsLists -> ListAppsLists -> Bool
Prelude.Eq, ReadPrec [ListAppsLists]
ReadPrec ListAppsLists
Int -> ReadS ListAppsLists
ReadS [ListAppsLists]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppsLists]
$creadListPrec :: ReadPrec [ListAppsLists]
readPrec :: ReadPrec ListAppsLists
$creadPrec :: ReadPrec ListAppsLists
readList :: ReadS [ListAppsLists]
$creadList :: ReadS [ListAppsLists]
readsPrec :: Int -> ReadS ListAppsLists
$creadsPrec :: Int -> ReadS ListAppsLists
Prelude.Read, Int -> ListAppsLists -> ShowS
[ListAppsLists] -> ShowS
ListAppsLists -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppsLists] -> ShowS
$cshowList :: [ListAppsLists] -> ShowS
show :: ListAppsLists -> String
$cshow :: ListAppsLists -> String
showsPrec :: Int -> ListAppsLists -> ShowS
$cshowsPrec :: Int -> ListAppsLists -> ShowS
Prelude.Show, forall x. Rep ListAppsLists x -> ListAppsLists
forall x. ListAppsLists -> Rep ListAppsLists x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAppsLists x -> ListAppsLists
$cfrom :: forall x. ListAppsLists -> Rep ListAppsLists x
Prelude.Generic)
newListAppsLists ::
Prelude.Natural ->
ListAppsLists
newListAppsLists :: Natural -> ListAppsLists
newListAppsLists Natural
pMaxResults_ =
ListAppsLists'
{ $sel:defaultLists:ListAppsLists' :: Maybe Bool
defaultLists = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAppsLists' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListAppsLists' :: Natural
maxResults = Natural
pMaxResults_
}
listAppsLists_defaultLists :: Lens.Lens' ListAppsLists (Prelude.Maybe Prelude.Bool)
listAppsLists_defaultLists :: Lens' ListAppsLists (Maybe Bool)
listAppsLists_defaultLists = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsLists' {Maybe Bool
defaultLists :: Maybe Bool
$sel:defaultLists:ListAppsLists' :: ListAppsLists -> Maybe Bool
defaultLists} -> Maybe Bool
defaultLists) (\s :: ListAppsLists
s@ListAppsLists' {} Maybe Bool
a -> ListAppsLists
s {$sel:defaultLists:ListAppsLists' :: Maybe Bool
defaultLists = Maybe Bool
a} :: ListAppsLists)
listAppsLists_nextToken :: Lens.Lens' ListAppsLists (Prelude.Maybe Prelude.Text)
listAppsLists_nextToken :: Lens' ListAppsLists (Maybe Text)
listAppsLists_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsLists' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppsLists' :: ListAppsLists -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppsLists
s@ListAppsLists' {} Maybe Text
a -> ListAppsLists
s {$sel:nextToken:ListAppsLists' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppsLists)
listAppsLists_maxResults :: Lens.Lens' ListAppsLists Prelude.Natural
listAppsLists_maxResults :: Lens' ListAppsLists Natural
listAppsLists_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsLists' {Natural
maxResults :: Natural
$sel:maxResults:ListAppsLists' :: ListAppsLists -> Natural
maxResults} -> Natural
maxResults) (\s :: ListAppsLists
s@ListAppsLists' {} Natural
a -> ListAppsLists
s {$sel:maxResults:ListAppsLists' :: Natural
maxResults = Natural
a} :: ListAppsLists)
instance Core.AWSPager ListAppsLists where
page :: ListAppsLists -> AWSResponse ListAppsLists -> Maybe ListAppsLists
page ListAppsLists
rq AWSResponse ListAppsLists
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAppsLists
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAppsListsResponse (Maybe Text)
listAppsListsResponse_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 ListAppsLists
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAppsListsResponse (Maybe [AppsListDataSummary])
listAppsListsResponse_appsLists
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.$ ListAppsLists
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAppsLists (Maybe Text)
listAppsLists_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAppsLists
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAppsListsResponse (Maybe Text)
listAppsListsResponse_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 ListAppsLists where
type
AWSResponse ListAppsLists =
ListAppsListsResponse
request :: (Service -> Service) -> ListAppsLists -> Request ListAppsLists
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAppsLists
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAppsLists)))
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 [AppsListDataSummary]
-> Maybe Text -> Int -> ListAppsListsResponse
ListAppsListsResponse'
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
"AppsLists" 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 ListAppsLists where
hashWithSalt :: Int -> ListAppsLists -> Int
hashWithSalt Int
_salt ListAppsLists' {Natural
Maybe Bool
Maybe Text
maxResults :: Natural
nextToken :: Maybe Text
defaultLists :: Maybe Bool
$sel:maxResults:ListAppsLists' :: ListAppsLists -> Natural
$sel:nextToken:ListAppsLists' :: ListAppsLists -> Maybe Text
$sel:defaultLists:ListAppsLists' :: ListAppsLists -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
defaultLists
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
maxResults
instance Prelude.NFData ListAppsLists where
rnf :: ListAppsLists -> ()
rnf ListAppsLists' {Natural
Maybe Bool
Maybe Text
maxResults :: Natural
nextToken :: Maybe Text
defaultLists :: Maybe Bool
$sel:maxResults:ListAppsLists' :: ListAppsLists -> Natural
$sel:nextToken:ListAppsLists' :: ListAppsLists -> Maybe Text
$sel:defaultLists:ListAppsLists' :: ListAppsLists -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
defaultLists
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 Natural
maxResults
instance Data.ToHeaders ListAppsLists where
toHeaders :: ListAppsLists -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSFMS_20180101.ListAppsLists" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListAppsLists where
toJSON :: ListAppsLists -> Value
toJSON ListAppsLists' {Natural
Maybe Bool
Maybe Text
maxResults :: Natural
nextToken :: Maybe Text
defaultLists :: Maybe Bool
$sel:maxResults:ListAppsLists' :: ListAppsLists -> Natural
$sel:nextToken:ListAppsLists' :: ListAppsLists -> Maybe Text
$sel:defaultLists:ListAppsLists' :: ListAppsLists -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DefaultLists" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
defaultLists,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
forall a. a -> Maybe a
Prelude.Just (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
maxResults)
]
)
instance Data.ToPath ListAppsLists where
toPath :: ListAppsLists -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListAppsLists where
toQuery :: ListAppsLists -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListAppsListsResponse = ListAppsListsResponse'
{
ListAppsListsResponse -> Maybe [AppsListDataSummary]
appsLists :: Prelude.Maybe [AppsListDataSummary],
ListAppsListsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAppsListsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAppsListsResponse -> ListAppsListsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAppsListsResponse -> ListAppsListsResponse -> Bool
$c/= :: ListAppsListsResponse -> ListAppsListsResponse -> Bool
== :: ListAppsListsResponse -> ListAppsListsResponse -> Bool
$c== :: ListAppsListsResponse -> ListAppsListsResponse -> Bool
Prelude.Eq, ReadPrec [ListAppsListsResponse]
ReadPrec ListAppsListsResponse
Int -> ReadS ListAppsListsResponse
ReadS [ListAppsListsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAppsListsResponse]
$creadListPrec :: ReadPrec [ListAppsListsResponse]
readPrec :: ReadPrec ListAppsListsResponse
$creadPrec :: ReadPrec ListAppsListsResponse
readList :: ReadS [ListAppsListsResponse]
$creadList :: ReadS [ListAppsListsResponse]
readsPrec :: Int -> ReadS ListAppsListsResponse
$creadsPrec :: Int -> ReadS ListAppsListsResponse
Prelude.Read, Int -> ListAppsListsResponse -> ShowS
[ListAppsListsResponse] -> ShowS
ListAppsListsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAppsListsResponse] -> ShowS
$cshowList :: [ListAppsListsResponse] -> ShowS
show :: ListAppsListsResponse -> String
$cshow :: ListAppsListsResponse -> String
showsPrec :: Int -> ListAppsListsResponse -> ShowS
$cshowsPrec :: Int -> ListAppsListsResponse -> ShowS
Prelude.Show, forall x. Rep ListAppsListsResponse x -> ListAppsListsResponse
forall x. ListAppsListsResponse -> Rep ListAppsListsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAppsListsResponse x -> ListAppsListsResponse
$cfrom :: forall x. ListAppsListsResponse -> Rep ListAppsListsResponse x
Prelude.Generic)
newListAppsListsResponse ::
Prelude.Int ->
ListAppsListsResponse
newListAppsListsResponse :: Int -> ListAppsListsResponse
newListAppsListsResponse Int
pHttpStatus_ =
ListAppsListsResponse'
{ $sel:appsLists:ListAppsListsResponse' :: Maybe [AppsListDataSummary]
appsLists = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAppsListsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAppsListsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAppsListsResponse_appsLists :: Lens.Lens' ListAppsListsResponse (Prelude.Maybe [AppsListDataSummary])
listAppsListsResponse_appsLists :: Lens' ListAppsListsResponse (Maybe [AppsListDataSummary])
listAppsListsResponse_appsLists = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsListsResponse' {Maybe [AppsListDataSummary]
appsLists :: Maybe [AppsListDataSummary]
$sel:appsLists:ListAppsListsResponse' :: ListAppsListsResponse -> Maybe [AppsListDataSummary]
appsLists} -> Maybe [AppsListDataSummary]
appsLists) (\s :: ListAppsListsResponse
s@ListAppsListsResponse' {} Maybe [AppsListDataSummary]
a -> ListAppsListsResponse
s {$sel:appsLists:ListAppsListsResponse' :: Maybe [AppsListDataSummary]
appsLists = Maybe [AppsListDataSummary]
a} :: ListAppsListsResponse) 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
listAppsListsResponse_nextToken :: Lens.Lens' ListAppsListsResponse (Prelude.Maybe Prelude.Text)
listAppsListsResponse_nextToken :: Lens' ListAppsListsResponse (Maybe Text)
listAppsListsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsListsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAppsListsResponse' :: ListAppsListsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAppsListsResponse
s@ListAppsListsResponse' {} Maybe Text
a -> ListAppsListsResponse
s {$sel:nextToken:ListAppsListsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAppsListsResponse)
listAppsListsResponse_httpStatus :: Lens.Lens' ListAppsListsResponse Prelude.Int
listAppsListsResponse_httpStatus :: Lens' ListAppsListsResponse Int
listAppsListsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAppsListsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAppsListsResponse' :: ListAppsListsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAppsListsResponse
s@ListAppsListsResponse' {} Int
a -> ListAppsListsResponse
s {$sel:httpStatus:ListAppsListsResponse' :: Int
httpStatus = Int
a} :: ListAppsListsResponse)
instance Prelude.NFData ListAppsListsResponse where
rnf :: ListAppsListsResponse -> ()
rnf ListAppsListsResponse' {Int
Maybe [AppsListDataSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
appsLists :: Maybe [AppsListDataSummary]
$sel:httpStatus:ListAppsListsResponse' :: ListAppsListsResponse -> Int
$sel:nextToken:ListAppsListsResponse' :: ListAppsListsResponse -> Maybe Text
$sel:appsLists:ListAppsListsResponse' :: ListAppsListsResponse -> Maybe [AppsListDataSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AppsListDataSummary]
appsLists
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