{-# 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.ServiceCatalogAppRegistry.ListAssociatedResources
(
ListAssociatedResources (..),
newListAssociatedResources,
listAssociatedResources_maxResults,
listAssociatedResources_nextToken,
listAssociatedResources_application,
ListAssociatedResourcesResponse (..),
newListAssociatedResourcesResponse,
listAssociatedResourcesResponse_nextToken,
listAssociatedResourcesResponse_resources,
listAssociatedResourcesResponse_httpStatus,
)
where
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
import Amazonka.ServiceCatalogAppRegistry.Types
data ListAssociatedResources = ListAssociatedResources'
{
ListAssociatedResources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAssociatedResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAssociatedResources -> Text
application :: Prelude.Text
}
deriving (ListAssociatedResources -> ListAssociatedResources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociatedResources -> ListAssociatedResources -> Bool
$c/= :: ListAssociatedResources -> ListAssociatedResources -> Bool
== :: ListAssociatedResources -> ListAssociatedResources -> Bool
$c== :: ListAssociatedResources -> ListAssociatedResources -> Bool
Prelude.Eq, ReadPrec [ListAssociatedResources]
ReadPrec ListAssociatedResources
Int -> ReadS ListAssociatedResources
ReadS [ListAssociatedResources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociatedResources]
$creadListPrec :: ReadPrec [ListAssociatedResources]
readPrec :: ReadPrec ListAssociatedResources
$creadPrec :: ReadPrec ListAssociatedResources
readList :: ReadS [ListAssociatedResources]
$creadList :: ReadS [ListAssociatedResources]
readsPrec :: Int -> ReadS ListAssociatedResources
$creadsPrec :: Int -> ReadS ListAssociatedResources
Prelude.Read, Int -> ListAssociatedResources -> ShowS
[ListAssociatedResources] -> ShowS
ListAssociatedResources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociatedResources] -> ShowS
$cshowList :: [ListAssociatedResources] -> ShowS
show :: ListAssociatedResources -> String
$cshow :: ListAssociatedResources -> String
showsPrec :: Int -> ListAssociatedResources -> ShowS
$cshowsPrec :: Int -> ListAssociatedResources -> ShowS
Prelude.Show, forall x. Rep ListAssociatedResources x -> ListAssociatedResources
forall x. ListAssociatedResources -> Rep ListAssociatedResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssociatedResources x -> ListAssociatedResources
$cfrom :: forall x. ListAssociatedResources -> Rep ListAssociatedResources x
Prelude.Generic)
newListAssociatedResources ::
Prelude.Text ->
ListAssociatedResources
newListAssociatedResources :: Text -> ListAssociatedResources
newListAssociatedResources Text
pApplication_ =
ListAssociatedResources'
{ $sel:maxResults:ListAssociatedResources' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAssociatedResources' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:application:ListAssociatedResources' :: Text
application = Text
pApplication_
}
listAssociatedResources_maxResults :: Lens.Lens' ListAssociatedResources (Prelude.Maybe Prelude.Natural)
listAssociatedResources_maxResults :: Lens' ListAssociatedResources (Maybe Natural)
listAssociatedResources_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedResources' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAssociatedResources' :: ListAssociatedResources -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAssociatedResources
s@ListAssociatedResources' {} Maybe Natural
a -> ListAssociatedResources
s {$sel:maxResults:ListAssociatedResources' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAssociatedResources)
listAssociatedResources_nextToken :: Lens.Lens' ListAssociatedResources (Prelude.Maybe Prelude.Text)
listAssociatedResources_nextToken :: Lens' ListAssociatedResources (Maybe Text)
listAssociatedResources_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedResources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociatedResources' :: ListAssociatedResources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociatedResources
s@ListAssociatedResources' {} Maybe Text
a -> ListAssociatedResources
s {$sel:nextToken:ListAssociatedResources' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociatedResources)
listAssociatedResources_application :: Lens.Lens' ListAssociatedResources Prelude.Text
listAssociatedResources_application :: Lens' ListAssociatedResources Text
listAssociatedResources_application = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedResources' {Text
application :: Text
$sel:application:ListAssociatedResources' :: ListAssociatedResources -> Text
application} -> Text
application) (\s :: ListAssociatedResources
s@ListAssociatedResources' {} Text
a -> ListAssociatedResources
s {$sel:application:ListAssociatedResources' :: Text
application = Text
a} :: ListAssociatedResources)
instance Core.AWSPager ListAssociatedResources where
page :: ListAssociatedResources
-> AWSResponse ListAssociatedResources
-> Maybe ListAssociatedResources
page ListAssociatedResources
rq AWSResponse ListAssociatedResources
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAssociatedResources
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAssociatedResourcesResponse (Maybe Text)
listAssociatedResourcesResponse_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 ListAssociatedResources
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAssociatedResourcesResponse (Maybe [ResourceInfo])
listAssociatedResourcesResponse_resources
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.$ ListAssociatedResources
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAssociatedResources (Maybe Text)
listAssociatedResources_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssociatedResources
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAssociatedResourcesResponse (Maybe Text)
listAssociatedResourcesResponse_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 ListAssociatedResources where
type
AWSResponse ListAssociatedResources =
ListAssociatedResourcesResponse
request :: (Service -> Service)
-> ListAssociatedResources -> Request ListAssociatedResources
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 ListAssociatedResources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListAssociatedResources)))
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
-> Maybe [ResourceInfo] -> Int -> ListAssociatedResourcesResponse
ListAssociatedResourcesResponse'
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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"resources" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListAssociatedResources where
hashWithSalt :: Int -> ListAssociatedResources -> Int
hashWithSalt Int
_salt ListAssociatedResources' {Maybe Natural
Maybe Text
Text
application :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:application:ListAssociatedResources' :: ListAssociatedResources -> Text
$sel:nextToken:ListAssociatedResources' :: ListAssociatedResources -> Maybe Text
$sel:maxResults:ListAssociatedResources' :: ListAssociatedResources -> 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
application
instance Prelude.NFData ListAssociatedResources where
rnf :: ListAssociatedResources -> ()
rnf ListAssociatedResources' {Maybe Natural
Maybe Text
Text
application :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:application:ListAssociatedResources' :: ListAssociatedResources -> Text
$sel:nextToken:ListAssociatedResources' :: ListAssociatedResources -> Maybe Text
$sel:maxResults:ListAssociatedResources' :: ListAssociatedResources -> 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
application
instance Data.ToHeaders ListAssociatedResources where
toHeaders :: ListAssociatedResources -> 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 ListAssociatedResources where
toPath :: ListAssociatedResources -> ByteString
toPath ListAssociatedResources' {Maybe Natural
Maybe Text
Text
application :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:application:ListAssociatedResources' :: ListAssociatedResources -> Text
$sel:nextToken:ListAssociatedResources' :: ListAssociatedResources -> Maybe Text
$sel:maxResults:ListAssociatedResources' :: ListAssociatedResources -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/applications/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
application,
ByteString
"/resources"
]
instance Data.ToQuery ListAssociatedResources where
toQuery :: ListAssociatedResources -> QueryString
toQuery ListAssociatedResources' {Maybe Natural
Maybe Text
Text
application :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:application:ListAssociatedResources' :: ListAssociatedResources -> Text
$sel:nextToken:ListAssociatedResources' :: ListAssociatedResources -> Maybe Text
$sel:maxResults:ListAssociatedResources' :: ListAssociatedResources -> 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 ListAssociatedResourcesResponse = ListAssociatedResourcesResponse'
{
ListAssociatedResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAssociatedResourcesResponse -> Maybe [ResourceInfo]
resources :: Prelude.Maybe [ResourceInfo],
ListAssociatedResourcesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAssociatedResourcesResponse
-> ListAssociatedResourcesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociatedResourcesResponse
-> ListAssociatedResourcesResponse -> Bool
$c/= :: ListAssociatedResourcesResponse
-> ListAssociatedResourcesResponse -> Bool
== :: ListAssociatedResourcesResponse
-> ListAssociatedResourcesResponse -> Bool
$c== :: ListAssociatedResourcesResponse
-> ListAssociatedResourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListAssociatedResourcesResponse]
ReadPrec ListAssociatedResourcesResponse
Int -> ReadS ListAssociatedResourcesResponse
ReadS [ListAssociatedResourcesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociatedResourcesResponse]
$creadListPrec :: ReadPrec [ListAssociatedResourcesResponse]
readPrec :: ReadPrec ListAssociatedResourcesResponse
$creadPrec :: ReadPrec ListAssociatedResourcesResponse
readList :: ReadS [ListAssociatedResourcesResponse]
$creadList :: ReadS [ListAssociatedResourcesResponse]
readsPrec :: Int -> ReadS ListAssociatedResourcesResponse
$creadsPrec :: Int -> ReadS ListAssociatedResourcesResponse
Prelude.Read, Int -> ListAssociatedResourcesResponse -> ShowS
[ListAssociatedResourcesResponse] -> ShowS
ListAssociatedResourcesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociatedResourcesResponse] -> ShowS
$cshowList :: [ListAssociatedResourcesResponse] -> ShowS
show :: ListAssociatedResourcesResponse -> String
$cshow :: ListAssociatedResourcesResponse -> String
showsPrec :: Int -> ListAssociatedResourcesResponse -> ShowS
$cshowsPrec :: Int -> ListAssociatedResourcesResponse -> ShowS
Prelude.Show, forall x.
Rep ListAssociatedResourcesResponse x
-> ListAssociatedResourcesResponse
forall x.
ListAssociatedResourcesResponse
-> Rep ListAssociatedResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssociatedResourcesResponse x
-> ListAssociatedResourcesResponse
$cfrom :: forall x.
ListAssociatedResourcesResponse
-> Rep ListAssociatedResourcesResponse x
Prelude.Generic)
newListAssociatedResourcesResponse ::
Prelude.Int ->
ListAssociatedResourcesResponse
newListAssociatedResourcesResponse :: Int -> ListAssociatedResourcesResponse
newListAssociatedResourcesResponse Int
pHttpStatus_ =
ListAssociatedResourcesResponse'
{ $sel:nextToken:ListAssociatedResourcesResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:resources:ListAssociatedResourcesResponse' :: Maybe [ResourceInfo]
resources = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAssociatedResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAssociatedResourcesResponse_nextToken :: Lens.Lens' ListAssociatedResourcesResponse (Prelude.Maybe Prelude.Text)
listAssociatedResourcesResponse_nextToken :: Lens' ListAssociatedResourcesResponse (Maybe Text)
listAssociatedResourcesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociatedResourcesResponse' :: ListAssociatedResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociatedResourcesResponse
s@ListAssociatedResourcesResponse' {} Maybe Text
a -> ListAssociatedResourcesResponse
s {$sel:nextToken:ListAssociatedResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociatedResourcesResponse)
listAssociatedResourcesResponse_resources :: Lens.Lens' ListAssociatedResourcesResponse (Prelude.Maybe [ResourceInfo])
listAssociatedResourcesResponse_resources :: Lens' ListAssociatedResourcesResponse (Maybe [ResourceInfo])
listAssociatedResourcesResponse_resources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedResourcesResponse' {Maybe [ResourceInfo]
resources :: Maybe [ResourceInfo]
$sel:resources:ListAssociatedResourcesResponse' :: ListAssociatedResourcesResponse -> Maybe [ResourceInfo]
resources} -> Maybe [ResourceInfo]
resources) (\s :: ListAssociatedResourcesResponse
s@ListAssociatedResourcesResponse' {} Maybe [ResourceInfo]
a -> ListAssociatedResourcesResponse
s {$sel:resources:ListAssociatedResourcesResponse' :: Maybe [ResourceInfo]
resources = Maybe [ResourceInfo]
a} :: ListAssociatedResourcesResponse) 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
listAssociatedResourcesResponse_httpStatus :: Lens.Lens' ListAssociatedResourcesResponse Prelude.Int
listAssociatedResourcesResponse_httpStatus :: Lens' ListAssociatedResourcesResponse Int
listAssociatedResourcesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedResourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAssociatedResourcesResponse' :: ListAssociatedResourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAssociatedResourcesResponse
s@ListAssociatedResourcesResponse' {} Int
a -> ListAssociatedResourcesResponse
s {$sel:httpStatus:ListAssociatedResourcesResponse' :: Int
httpStatus = Int
a} :: ListAssociatedResourcesResponse)
instance
Prelude.NFData
ListAssociatedResourcesResponse
where
rnf :: ListAssociatedResourcesResponse -> ()
rnf ListAssociatedResourcesResponse' {Int
Maybe [ResourceInfo]
Maybe Text
httpStatus :: Int
resources :: Maybe [ResourceInfo]
nextToken :: Maybe Text
$sel:httpStatus:ListAssociatedResourcesResponse' :: ListAssociatedResourcesResponse -> Int
$sel:resources:ListAssociatedResourcesResponse' :: ListAssociatedResourcesResponse -> Maybe [ResourceInfo]
$sel:nextToken:ListAssociatedResourcesResponse' :: ListAssociatedResourcesResponse -> 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 Maybe [ResourceInfo]
resources
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus