{-# 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.AppStream.ListEntitledApplications
(
ListEntitledApplications (..),
newListEntitledApplications,
listEntitledApplications_maxResults,
listEntitledApplications_nextToken,
listEntitledApplications_stackName,
listEntitledApplications_entitlementName,
ListEntitledApplicationsResponse (..),
newListEntitledApplicationsResponse,
listEntitledApplicationsResponse_entitledApplications,
listEntitledApplicationsResponse_nextToken,
listEntitledApplicationsResponse_httpStatus,
)
where
import Amazonka.AppStream.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 ListEntitledApplications = ListEntitledApplications'
{
ListEntitledApplications -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
ListEntitledApplications -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListEntitledApplications -> Text
stackName :: Prelude.Text,
ListEntitledApplications -> Text
entitlementName :: Prelude.Text
}
deriving (ListEntitledApplications -> ListEntitledApplications -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEntitledApplications -> ListEntitledApplications -> Bool
$c/= :: ListEntitledApplications -> ListEntitledApplications -> Bool
== :: ListEntitledApplications -> ListEntitledApplications -> Bool
$c== :: ListEntitledApplications -> ListEntitledApplications -> Bool
Prelude.Eq, ReadPrec [ListEntitledApplications]
ReadPrec ListEntitledApplications
Int -> ReadS ListEntitledApplications
ReadS [ListEntitledApplications]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEntitledApplications]
$creadListPrec :: ReadPrec [ListEntitledApplications]
readPrec :: ReadPrec ListEntitledApplications
$creadPrec :: ReadPrec ListEntitledApplications
readList :: ReadS [ListEntitledApplications]
$creadList :: ReadS [ListEntitledApplications]
readsPrec :: Int -> ReadS ListEntitledApplications
$creadsPrec :: Int -> ReadS ListEntitledApplications
Prelude.Read, Int -> ListEntitledApplications -> ShowS
[ListEntitledApplications] -> ShowS
ListEntitledApplications -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEntitledApplications] -> ShowS
$cshowList :: [ListEntitledApplications] -> ShowS
show :: ListEntitledApplications -> String
$cshow :: ListEntitledApplications -> String
showsPrec :: Int -> ListEntitledApplications -> ShowS
$cshowsPrec :: Int -> ListEntitledApplications -> ShowS
Prelude.Show, forall x.
Rep ListEntitledApplications x -> ListEntitledApplications
forall x.
ListEntitledApplications -> Rep ListEntitledApplications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEntitledApplications x -> ListEntitledApplications
$cfrom :: forall x.
ListEntitledApplications -> Rep ListEntitledApplications x
Prelude.Generic)
newListEntitledApplications ::
Prelude.Text ->
Prelude.Text ->
ListEntitledApplications
newListEntitledApplications :: Text -> Text -> ListEntitledApplications
newListEntitledApplications
Text
pStackName_
Text
pEntitlementName_ =
ListEntitledApplications'
{ $sel:maxResults:ListEntitledApplications' :: Maybe Int
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListEntitledApplications' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:stackName:ListEntitledApplications' :: Text
stackName = Text
pStackName_,
$sel:entitlementName:ListEntitledApplications' :: Text
entitlementName = Text
pEntitlementName_
}
listEntitledApplications_maxResults :: Lens.Lens' ListEntitledApplications (Prelude.Maybe Prelude.Int)
listEntitledApplications_maxResults :: Lens' ListEntitledApplications (Maybe Int)
listEntitledApplications_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitledApplications' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListEntitledApplications' :: ListEntitledApplications -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListEntitledApplications
s@ListEntitledApplications' {} Maybe Int
a -> ListEntitledApplications
s {$sel:maxResults:ListEntitledApplications' :: Maybe Int
maxResults = Maybe Int
a} :: ListEntitledApplications)
listEntitledApplications_nextToken :: Lens.Lens' ListEntitledApplications (Prelude.Maybe Prelude.Text)
listEntitledApplications_nextToken :: Lens' ListEntitledApplications (Maybe Text)
listEntitledApplications_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitledApplications' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEntitledApplications' :: ListEntitledApplications -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEntitledApplications
s@ListEntitledApplications' {} Maybe Text
a -> ListEntitledApplications
s {$sel:nextToken:ListEntitledApplications' :: Maybe Text
nextToken = Maybe Text
a} :: ListEntitledApplications)
listEntitledApplications_stackName :: Lens.Lens' ListEntitledApplications Prelude.Text
listEntitledApplications_stackName :: Lens' ListEntitledApplications Text
listEntitledApplications_stackName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitledApplications' {Text
stackName :: Text
$sel:stackName:ListEntitledApplications' :: ListEntitledApplications -> Text
stackName} -> Text
stackName) (\s :: ListEntitledApplications
s@ListEntitledApplications' {} Text
a -> ListEntitledApplications
s {$sel:stackName:ListEntitledApplications' :: Text
stackName = Text
a} :: ListEntitledApplications)
listEntitledApplications_entitlementName :: Lens.Lens' ListEntitledApplications Prelude.Text
listEntitledApplications_entitlementName :: Lens' ListEntitledApplications Text
listEntitledApplications_entitlementName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitledApplications' {Text
entitlementName :: Text
$sel:entitlementName:ListEntitledApplications' :: ListEntitledApplications -> Text
entitlementName} -> Text
entitlementName) (\s :: ListEntitledApplications
s@ListEntitledApplications' {} Text
a -> ListEntitledApplications
s {$sel:entitlementName:ListEntitledApplications' :: Text
entitlementName = Text
a} :: ListEntitledApplications)
instance Core.AWSRequest ListEntitledApplications where
type
AWSResponse ListEntitledApplications =
ListEntitledApplicationsResponse
request :: (Service -> Service)
-> ListEntitledApplications -> Request ListEntitledApplications
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 ListEntitledApplications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListEntitledApplications)))
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 [EntitledApplication]
-> Maybe Text -> Int -> ListEntitledApplicationsResponse
ListEntitledApplicationsResponse'
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
"EntitledApplications"
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 ListEntitledApplications where
hashWithSalt :: Int -> ListEntitledApplications -> Int
hashWithSalt Int
_salt ListEntitledApplications' {Maybe Int
Maybe Text
Text
entitlementName :: Text
stackName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:entitlementName:ListEntitledApplications' :: ListEntitledApplications -> Text
$sel:stackName:ListEntitledApplications' :: ListEntitledApplications -> Text
$sel:nextToken:ListEntitledApplications' :: ListEntitledApplications -> Maybe Text
$sel:maxResults:ListEntitledApplications' :: ListEntitledApplications -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stackName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
entitlementName
instance Prelude.NFData ListEntitledApplications where
rnf :: ListEntitledApplications -> ()
rnf ListEntitledApplications' {Maybe Int
Maybe Text
Text
entitlementName :: Text
stackName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:entitlementName:ListEntitledApplications' :: ListEntitledApplications -> Text
$sel:stackName:ListEntitledApplications' :: ListEntitledApplications -> Text
$sel:nextToken:ListEntitledApplications' :: ListEntitledApplications -> Maybe Text
$sel:maxResults:ListEntitledApplications' :: ListEntitledApplications -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
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
stackName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
entitlementName
instance Data.ToHeaders ListEntitledApplications where
toHeaders :: ListEntitledApplications -> 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
"PhotonAdminProxyService.ListEntitledApplications" ::
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 ListEntitledApplications where
toJSON :: ListEntitledApplications -> Value
toJSON ListEntitledApplications' {Maybe Int
Maybe Text
Text
entitlementName :: Text
stackName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:entitlementName:ListEntitledApplications' :: ListEntitledApplications -> Text
$sel:stackName:ListEntitledApplications' :: ListEntitledApplications -> Text
$sel:nextToken:ListEntitledApplications' :: ListEntitledApplications -> Maybe Text
$sel:maxResults:ListEntitledApplications' :: ListEntitledApplications -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" 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 Int
maxResults,
(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
"StackName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
stackName),
forall a. a -> Maybe a
Prelude.Just
(Key
"EntitlementName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
entitlementName)
]
)
instance Data.ToPath ListEntitledApplications where
toPath :: ListEntitledApplications -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListEntitledApplications where
toQuery :: ListEntitledApplications -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListEntitledApplicationsResponse = ListEntitledApplicationsResponse'
{
ListEntitledApplicationsResponse -> Maybe [EntitledApplication]
entitledApplications :: Prelude.Maybe [EntitledApplication],
ListEntitledApplicationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListEntitledApplicationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListEntitledApplicationsResponse
-> ListEntitledApplicationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEntitledApplicationsResponse
-> ListEntitledApplicationsResponse -> Bool
$c/= :: ListEntitledApplicationsResponse
-> ListEntitledApplicationsResponse -> Bool
== :: ListEntitledApplicationsResponse
-> ListEntitledApplicationsResponse -> Bool
$c== :: ListEntitledApplicationsResponse
-> ListEntitledApplicationsResponse -> Bool
Prelude.Eq, ReadPrec [ListEntitledApplicationsResponse]
ReadPrec ListEntitledApplicationsResponse
Int -> ReadS ListEntitledApplicationsResponse
ReadS [ListEntitledApplicationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEntitledApplicationsResponse]
$creadListPrec :: ReadPrec [ListEntitledApplicationsResponse]
readPrec :: ReadPrec ListEntitledApplicationsResponse
$creadPrec :: ReadPrec ListEntitledApplicationsResponse
readList :: ReadS [ListEntitledApplicationsResponse]
$creadList :: ReadS [ListEntitledApplicationsResponse]
readsPrec :: Int -> ReadS ListEntitledApplicationsResponse
$creadsPrec :: Int -> ReadS ListEntitledApplicationsResponse
Prelude.Read, Int -> ListEntitledApplicationsResponse -> ShowS
[ListEntitledApplicationsResponse] -> ShowS
ListEntitledApplicationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEntitledApplicationsResponse] -> ShowS
$cshowList :: [ListEntitledApplicationsResponse] -> ShowS
show :: ListEntitledApplicationsResponse -> String
$cshow :: ListEntitledApplicationsResponse -> String
showsPrec :: Int -> ListEntitledApplicationsResponse -> ShowS
$cshowsPrec :: Int -> ListEntitledApplicationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListEntitledApplicationsResponse x
-> ListEntitledApplicationsResponse
forall x.
ListEntitledApplicationsResponse
-> Rep ListEntitledApplicationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListEntitledApplicationsResponse x
-> ListEntitledApplicationsResponse
$cfrom :: forall x.
ListEntitledApplicationsResponse
-> Rep ListEntitledApplicationsResponse x
Prelude.Generic)
newListEntitledApplicationsResponse ::
Prelude.Int ->
ListEntitledApplicationsResponse
newListEntitledApplicationsResponse :: Int -> ListEntitledApplicationsResponse
newListEntitledApplicationsResponse Int
pHttpStatus_ =
ListEntitledApplicationsResponse'
{ $sel:entitledApplications:ListEntitledApplicationsResponse' :: Maybe [EntitledApplication]
entitledApplications =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListEntitledApplicationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListEntitledApplicationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listEntitledApplicationsResponse_entitledApplications :: Lens.Lens' ListEntitledApplicationsResponse (Prelude.Maybe [EntitledApplication])
listEntitledApplicationsResponse_entitledApplications :: Lens'
ListEntitledApplicationsResponse (Maybe [EntitledApplication])
listEntitledApplicationsResponse_entitledApplications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitledApplicationsResponse' {Maybe [EntitledApplication]
entitledApplications :: Maybe [EntitledApplication]
$sel:entitledApplications:ListEntitledApplicationsResponse' :: ListEntitledApplicationsResponse -> Maybe [EntitledApplication]
entitledApplications} -> Maybe [EntitledApplication]
entitledApplications) (\s :: ListEntitledApplicationsResponse
s@ListEntitledApplicationsResponse' {} Maybe [EntitledApplication]
a -> ListEntitledApplicationsResponse
s {$sel:entitledApplications:ListEntitledApplicationsResponse' :: Maybe [EntitledApplication]
entitledApplications = Maybe [EntitledApplication]
a} :: ListEntitledApplicationsResponse) 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
listEntitledApplicationsResponse_nextToken :: Lens.Lens' ListEntitledApplicationsResponse (Prelude.Maybe Prelude.Text)
listEntitledApplicationsResponse_nextToken :: Lens' ListEntitledApplicationsResponse (Maybe Text)
listEntitledApplicationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitledApplicationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEntitledApplicationsResponse' :: ListEntitledApplicationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEntitledApplicationsResponse
s@ListEntitledApplicationsResponse' {} Maybe Text
a -> ListEntitledApplicationsResponse
s {$sel:nextToken:ListEntitledApplicationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEntitledApplicationsResponse)
listEntitledApplicationsResponse_httpStatus :: Lens.Lens' ListEntitledApplicationsResponse Prelude.Int
listEntitledApplicationsResponse_httpStatus :: Lens' ListEntitledApplicationsResponse Int
listEntitledApplicationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitledApplicationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListEntitledApplicationsResponse' :: ListEntitledApplicationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListEntitledApplicationsResponse
s@ListEntitledApplicationsResponse' {} Int
a -> ListEntitledApplicationsResponse
s {$sel:httpStatus:ListEntitledApplicationsResponse' :: Int
httpStatus = Int
a} :: ListEntitledApplicationsResponse)
instance
Prelude.NFData
ListEntitledApplicationsResponse
where
rnf :: ListEntitledApplicationsResponse -> ()
rnf ListEntitledApplicationsResponse' {Int
Maybe [EntitledApplication]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
entitledApplications :: Maybe [EntitledApplication]
$sel:httpStatus:ListEntitledApplicationsResponse' :: ListEntitledApplicationsResponse -> Int
$sel:nextToken:ListEntitledApplicationsResponse' :: ListEntitledApplicationsResponse -> Maybe Text
$sel:entitledApplications:ListEntitledApplicationsResponse' :: ListEntitledApplicationsResponse -> Maybe [EntitledApplication]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [EntitledApplication]
entitledApplications
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