{-# 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.KinesisAnalytics.ListApplications
(
ListApplications (..),
newListApplications,
listApplications_exclusiveStartApplicationName,
listApplications_limit,
ListApplicationsResponse (..),
newListApplicationsResponse,
listApplicationsResponse_httpStatus,
listApplicationsResponse_applicationSummaries,
listApplicationsResponse_hasMoreApplications,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KinesisAnalytics.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListApplications = ListApplications'
{
ListApplications -> Maybe Text
exclusiveStartApplicationName :: Prelude.Maybe Prelude.Text,
ListApplications -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
}
deriving (ListApplications -> ListApplications -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApplications -> ListApplications -> Bool
$c/= :: ListApplications -> ListApplications -> Bool
== :: ListApplications -> ListApplications -> Bool
$c== :: ListApplications -> ListApplications -> Bool
Prelude.Eq, ReadPrec [ListApplications]
ReadPrec ListApplications
Int -> ReadS ListApplications
ReadS [ListApplications]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApplications]
$creadListPrec :: ReadPrec [ListApplications]
readPrec :: ReadPrec ListApplications
$creadPrec :: ReadPrec ListApplications
readList :: ReadS [ListApplications]
$creadList :: ReadS [ListApplications]
readsPrec :: Int -> ReadS ListApplications
$creadsPrec :: Int -> ReadS ListApplications
Prelude.Read, Int -> ListApplications -> ShowS
[ListApplications] -> ShowS
ListApplications -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApplications] -> ShowS
$cshowList :: [ListApplications] -> ShowS
show :: ListApplications -> String
$cshow :: ListApplications -> String
showsPrec :: Int -> ListApplications -> ShowS
$cshowsPrec :: Int -> ListApplications -> ShowS
Prelude.Show, forall x. Rep ListApplications x -> ListApplications
forall x. ListApplications -> Rep ListApplications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListApplications x -> ListApplications
$cfrom :: forall x. ListApplications -> Rep ListApplications x
Prelude.Generic)
newListApplications ::
ListApplications
newListApplications :: ListApplications
newListApplications =
ListApplications'
{ $sel:exclusiveStartApplicationName:ListApplications' :: Maybe Text
exclusiveStartApplicationName =
forall a. Maybe a
Prelude.Nothing,
$sel:limit:ListApplications' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing
}
listApplications_exclusiveStartApplicationName :: Lens.Lens' ListApplications (Prelude.Maybe Prelude.Text)
listApplications_exclusiveStartApplicationName :: Lens' ListApplications (Maybe Text)
listApplications_exclusiveStartApplicationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplications' {Maybe Text
exclusiveStartApplicationName :: Maybe Text
$sel:exclusiveStartApplicationName:ListApplications' :: ListApplications -> Maybe Text
exclusiveStartApplicationName} -> Maybe Text
exclusiveStartApplicationName) (\s :: ListApplications
s@ListApplications' {} Maybe Text
a -> ListApplications
s {$sel:exclusiveStartApplicationName:ListApplications' :: Maybe Text
exclusiveStartApplicationName = Maybe Text
a} :: ListApplications)
listApplications_limit :: Lens.Lens' ListApplications (Prelude.Maybe Prelude.Natural)
listApplications_limit :: Lens' ListApplications (Maybe Natural)
listApplications_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplications' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListApplications' :: ListApplications -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListApplications
s@ListApplications' {} Maybe Natural
a -> ListApplications
s {$sel:limit:ListApplications' :: Maybe Natural
limit = Maybe Natural
a} :: ListApplications)
instance Core.AWSRequest ListApplications where
type
AWSResponse ListApplications =
ListApplicationsResponse
request :: (Service -> Service)
-> ListApplications -> Request ListApplications
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 ListApplications
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListApplications)))
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 ->
Int -> [ApplicationSummary] -> Bool -> ListApplicationsResponse
ListApplicationsResponse'
forall (f :: * -> *) a b. Functor 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
"ApplicationSummaries"
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 a
Data..:> Key
"HasMoreApplications")
)
instance Prelude.Hashable ListApplications where
hashWithSalt :: Int -> ListApplications -> Int
hashWithSalt Int
_salt ListApplications' {Maybe Natural
Maybe Text
limit :: Maybe Natural
exclusiveStartApplicationName :: Maybe Text
$sel:limit:ListApplications' :: ListApplications -> Maybe Natural
$sel:exclusiveStartApplicationName:ListApplications' :: ListApplications -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
exclusiveStartApplicationName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
instance Prelude.NFData ListApplications where
rnf :: ListApplications -> ()
rnf ListApplications' {Maybe Natural
Maybe Text
limit :: Maybe Natural
exclusiveStartApplicationName :: Maybe Text
$sel:limit:ListApplications' :: ListApplications -> Maybe Natural
$sel:exclusiveStartApplicationName:ListApplications' :: ListApplications -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
exclusiveStartApplicationName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
instance Data.ToHeaders ListApplications where
toHeaders :: ListApplications -> 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
"KinesisAnalytics_20150814.ListApplications" ::
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 ListApplications where
toJSON :: ListApplications -> Value
toJSON ListApplications' {Maybe Natural
Maybe Text
limit :: Maybe Natural
exclusiveStartApplicationName :: Maybe Text
$sel:limit:ListApplications' :: ListApplications -> Maybe Natural
$sel:exclusiveStartApplicationName:ListApplications' :: ListApplications -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ExclusiveStartApplicationName" 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
exclusiveStartApplicationName,
(Key
"Limit" 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 Natural
limit
]
)
instance Data.ToPath ListApplications where
toPath :: ListApplications -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListApplications where
toQuery :: ListApplications -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListApplicationsResponse = ListApplicationsResponse'
{
ListApplicationsResponse -> Int
httpStatus :: Prelude.Int,
ListApplicationsResponse -> [ApplicationSummary]
applicationSummaries :: [ApplicationSummary],
ListApplicationsResponse -> Bool
hasMoreApplications :: Prelude.Bool
}
deriving (ListApplicationsResponse -> ListApplicationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListApplicationsResponse -> ListApplicationsResponse -> Bool
$c/= :: ListApplicationsResponse -> ListApplicationsResponse -> Bool
== :: ListApplicationsResponse -> ListApplicationsResponse -> Bool
$c== :: ListApplicationsResponse -> ListApplicationsResponse -> Bool
Prelude.Eq, ReadPrec [ListApplicationsResponse]
ReadPrec ListApplicationsResponse
Int -> ReadS ListApplicationsResponse
ReadS [ListApplicationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListApplicationsResponse]
$creadListPrec :: ReadPrec [ListApplicationsResponse]
readPrec :: ReadPrec ListApplicationsResponse
$creadPrec :: ReadPrec ListApplicationsResponse
readList :: ReadS [ListApplicationsResponse]
$creadList :: ReadS [ListApplicationsResponse]
readsPrec :: Int -> ReadS ListApplicationsResponse
$creadsPrec :: Int -> ReadS ListApplicationsResponse
Prelude.Read, Int -> ListApplicationsResponse -> ShowS
[ListApplicationsResponse] -> ShowS
ListApplicationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListApplicationsResponse] -> ShowS
$cshowList :: [ListApplicationsResponse] -> ShowS
show :: ListApplicationsResponse -> String
$cshow :: ListApplicationsResponse -> String
showsPrec :: Int -> ListApplicationsResponse -> ShowS
$cshowsPrec :: Int -> ListApplicationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListApplicationsResponse x -> ListApplicationsResponse
forall x.
ListApplicationsResponse -> Rep ListApplicationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListApplicationsResponse x -> ListApplicationsResponse
$cfrom :: forall x.
ListApplicationsResponse -> Rep ListApplicationsResponse x
Prelude.Generic)
newListApplicationsResponse ::
Prelude.Int ->
Prelude.Bool ->
ListApplicationsResponse
newListApplicationsResponse :: Int -> Bool -> ListApplicationsResponse
newListApplicationsResponse
Int
pHttpStatus_
Bool
pHasMoreApplications_ =
ListApplicationsResponse'
{ $sel:httpStatus:ListApplicationsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:applicationSummaries:ListApplicationsResponse' :: [ApplicationSummary]
applicationSummaries = forall a. Monoid a => a
Prelude.mempty,
$sel:hasMoreApplications:ListApplicationsResponse' :: Bool
hasMoreApplications = Bool
pHasMoreApplications_
}
listApplicationsResponse_httpStatus :: Lens.Lens' ListApplicationsResponse Prelude.Int
listApplicationsResponse_httpStatus :: Lens' ListApplicationsResponse Int
listApplicationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListApplicationsResponse' :: ListApplicationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListApplicationsResponse
s@ListApplicationsResponse' {} Int
a -> ListApplicationsResponse
s {$sel:httpStatus:ListApplicationsResponse' :: Int
httpStatus = Int
a} :: ListApplicationsResponse)
listApplicationsResponse_applicationSummaries :: Lens.Lens' ListApplicationsResponse [ApplicationSummary]
listApplicationsResponse_applicationSummaries :: Lens' ListApplicationsResponse [ApplicationSummary]
listApplicationsResponse_applicationSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationsResponse' {[ApplicationSummary]
applicationSummaries :: [ApplicationSummary]
$sel:applicationSummaries:ListApplicationsResponse' :: ListApplicationsResponse -> [ApplicationSummary]
applicationSummaries} -> [ApplicationSummary]
applicationSummaries) (\s :: ListApplicationsResponse
s@ListApplicationsResponse' {} [ApplicationSummary]
a -> ListApplicationsResponse
s {$sel:applicationSummaries:ListApplicationsResponse' :: [ApplicationSummary]
applicationSummaries = [ApplicationSummary]
a} :: ListApplicationsResponse) 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
listApplicationsResponse_hasMoreApplications :: Lens.Lens' ListApplicationsResponse Prelude.Bool
listApplicationsResponse_hasMoreApplications :: Lens' ListApplicationsResponse Bool
listApplicationsResponse_hasMoreApplications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListApplicationsResponse' {Bool
hasMoreApplications :: Bool
$sel:hasMoreApplications:ListApplicationsResponse' :: ListApplicationsResponse -> Bool
hasMoreApplications} -> Bool
hasMoreApplications) (\s :: ListApplicationsResponse
s@ListApplicationsResponse' {} Bool
a -> ListApplicationsResponse
s {$sel:hasMoreApplications:ListApplicationsResponse' :: Bool
hasMoreApplications = Bool
a} :: ListApplicationsResponse)
instance Prelude.NFData ListApplicationsResponse where
rnf :: ListApplicationsResponse -> ()
rnf ListApplicationsResponse' {Bool
Int
[ApplicationSummary]
hasMoreApplications :: Bool
applicationSummaries :: [ApplicationSummary]
httpStatus :: Int
$sel:hasMoreApplications:ListApplicationsResponse' :: ListApplicationsResponse -> Bool
$sel:applicationSummaries:ListApplicationsResponse' :: ListApplicationsResponse -> [ApplicationSummary]
$sel:httpStatus:ListApplicationsResponse' :: ListApplicationsResponse -> Int
..} =
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 [ApplicationSummary]
applicationSummaries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
hasMoreApplications