{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ServiceCatalogAppRegistry.ListAssociatedResources
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all resources that are associated with specified application.
-- Results are paginated.
--
-- This operation returns paginated results.
module Amazonka.ServiceCatalogAppRegistry.ListAssociatedResources
  ( -- * Creating a Request
    ListAssociatedResources (..),
    newListAssociatedResources,

    -- * Request Lenses
    listAssociatedResources_nextToken,
    listAssociatedResources_maxResults,
    listAssociatedResources_application,

    -- * Destructuring the Response
    ListAssociatedResourcesResponse (..),
    newListAssociatedResourcesResponse,

    -- * Response Lenses
    listAssociatedResourcesResponse_resources,
    listAssociatedResourcesResponse_nextToken,
    listAssociatedResourcesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.ServiceCatalogAppRegistry.Types

-- | /See:/ 'newListAssociatedResources' smart constructor.
data ListAssociatedResources = ListAssociatedResources'
  { -- | The token to use to get the next page of results after a previous API
    -- call.
    ListAssociatedResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The upper bound of the number of results to return (cannot exceed 25).
    -- If this parameter is omitted, it defaults to 25. This value is optional.
    ListAssociatedResources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name or ID of the application.
    ListAssociatedResources -> Text
application :: Prelude.Text
  }
  deriving (ListAssociatedResources -> ListAssociatedResources -> Bool
(ListAssociatedResources -> ListAssociatedResources -> Bool)
-> (ListAssociatedResources -> ListAssociatedResources -> Bool)
-> Eq ListAssociatedResources
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]
(Int -> ReadS ListAssociatedResources)
-> ReadS [ListAssociatedResources]
-> ReadPrec ListAssociatedResources
-> ReadPrec [ListAssociatedResources]
-> Read 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
(Int -> ListAssociatedResources -> ShowS)
-> (ListAssociatedResources -> String)
-> ([ListAssociatedResources] -> ShowS)
-> Show ListAssociatedResources
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.
 ListAssociatedResources -> Rep ListAssociatedResources x)
-> (forall x.
    Rep ListAssociatedResources x -> ListAssociatedResources)
-> Generic ListAssociatedResources
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)

-- |
-- Create a value of 'ListAssociatedResources' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listAssociatedResources_nextToken' - The token to use to get the next page of results after a previous API
-- call.
--
-- 'maxResults', 'listAssociatedResources_maxResults' - The upper bound of the number of results to return (cannot exceed 25).
-- If this parameter is omitted, it defaults to 25. This value is optional.
--
-- 'application', 'listAssociatedResources_application' - The name or ID of the application.
newListAssociatedResources ::
  -- | 'application'
  Prelude.Text ->
  ListAssociatedResources
newListAssociatedResources :: Text -> ListAssociatedResources
newListAssociatedResources Text
pApplication_ =
  ListAssociatedResources' :: Maybe Text -> Maybe Natural -> Text -> ListAssociatedResources
ListAssociatedResources'
    { $sel:nextToken:ListAssociatedResources' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAssociatedResources' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:application:ListAssociatedResources' :: Text
application = Text
pApplication_
    }

-- | The token to use to get the next page of results after a previous API
-- call.
listAssociatedResources_nextToken :: Lens.Lens' ListAssociatedResources (Prelude.Maybe Prelude.Text)
listAssociatedResources_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssociatedResources -> f ListAssociatedResources
listAssociatedResources_nextToken = (ListAssociatedResources -> Maybe Text)
-> (ListAssociatedResources
    -> Maybe Text -> ListAssociatedResources)
-> Lens
     ListAssociatedResources
     ListAssociatedResources
     (Maybe Text)
     (Maybe Text)
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)

-- | The upper bound of the number of results to return (cannot exceed 25).
-- If this parameter is omitted, it defaults to 25. This value is optional.
listAssociatedResources_maxResults :: Lens.Lens' ListAssociatedResources (Prelude.Maybe Prelude.Natural)
listAssociatedResources_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAssociatedResources -> f ListAssociatedResources
listAssociatedResources_maxResults = (ListAssociatedResources -> Maybe Natural)
-> (ListAssociatedResources
    -> Maybe Natural -> ListAssociatedResources)
-> Lens
     ListAssociatedResources
     ListAssociatedResources
     (Maybe Natural)
     (Maybe Natural)
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)

-- | The name or ID of the application.
listAssociatedResources_application :: Lens.Lens' ListAssociatedResources Prelude.Text
listAssociatedResources_application :: (Text -> f Text)
-> ListAssociatedResources -> f ListAssociatedResources
listAssociatedResources_application = (ListAssociatedResources -> Text)
-> (ListAssociatedResources -> Text -> ListAssociatedResources)
-> Lens ListAssociatedResources ListAssociatedResources Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssociatedResources
ListAssociatedResourcesResponse
rs
            ListAssociatedResourcesResponse
-> Getting (First Text) ListAssociatedResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociatedResourcesResponse
-> Const (First Text) ListAssociatedResourcesResponse
Lens' ListAssociatedResourcesResponse (Maybe Text)
listAssociatedResourcesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssociatedResourcesResponse
 -> Const (First Text) ListAssociatedResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssociatedResourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAssociatedResources
forall a. Maybe a
Prelude.Nothing
    | Maybe [ResourceInfo] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssociatedResources
ListAssociatedResourcesResponse
rs
            ListAssociatedResourcesResponse
-> Getting
     (First [ResourceInfo])
     ListAssociatedResourcesResponse
     [ResourceInfo]
-> Maybe [ResourceInfo]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ResourceInfo]
 -> Const (First [ResourceInfo]) (Maybe [ResourceInfo]))
-> ListAssociatedResourcesResponse
-> Const (First [ResourceInfo]) ListAssociatedResourcesResponse
Lens' ListAssociatedResourcesResponse (Maybe [ResourceInfo])
listAssociatedResourcesResponse_resources
              ((Maybe [ResourceInfo]
  -> Const (First [ResourceInfo]) (Maybe [ResourceInfo]))
 -> ListAssociatedResourcesResponse
 -> Const (First [ResourceInfo]) ListAssociatedResourcesResponse)
-> (([ResourceInfo] -> Const (First [ResourceInfo]) [ResourceInfo])
    -> Maybe [ResourceInfo]
    -> Const (First [ResourceInfo]) (Maybe [ResourceInfo]))
-> Getting
     (First [ResourceInfo])
     ListAssociatedResourcesResponse
     [ResourceInfo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResourceInfo] -> Const (First [ResourceInfo]) [ResourceInfo])
-> Maybe [ResourceInfo]
-> Const (First [ResourceInfo]) (Maybe [ResourceInfo])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAssociatedResources
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAssociatedResources -> Maybe ListAssociatedResources
forall a. a -> Maybe a
Prelude.Just (ListAssociatedResources -> Maybe ListAssociatedResources)
-> ListAssociatedResources -> Maybe ListAssociatedResources
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAssociatedResources
rq
          ListAssociatedResources
-> (ListAssociatedResources -> ListAssociatedResources)
-> ListAssociatedResources
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAssociatedResources -> Identity ListAssociatedResources
Lens
  ListAssociatedResources
  ListAssociatedResources
  (Maybe Text)
  (Maybe Text)
listAssociatedResources_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAssociatedResources -> Identity ListAssociatedResources)
-> Maybe Text -> ListAssociatedResources -> ListAssociatedResources
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssociatedResources
ListAssociatedResourcesResponse
rs
          ListAssociatedResourcesResponse
-> Getting (First Text) ListAssociatedResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociatedResourcesResponse
-> Const (First Text) ListAssociatedResourcesResponse
Lens' ListAssociatedResourcesResponse (Maybe Text)
listAssociatedResourcesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssociatedResourcesResponse
 -> Const (First Text) ListAssociatedResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssociatedResourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListAssociatedResources where
  type
    AWSResponse ListAssociatedResources =
      ListAssociatedResourcesResponse
  request :: ListAssociatedResources -> Request ListAssociatedResources
request = Service
-> ListAssociatedResources -> Request ListAssociatedResources
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAssociatedResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAssociatedResources)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAssociatedResources))
-> Logger
-> Service
-> Proxy ListAssociatedResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAssociatedResources)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [ResourceInfo]
-> Maybe Text -> Int -> ListAssociatedResourcesResponse
ListAssociatedResourcesResponse'
            (Maybe [ResourceInfo]
 -> Maybe Text -> Int -> ListAssociatedResourcesResponse)
-> Either String (Maybe [ResourceInfo])
-> Either
     String (Maybe Text -> Int -> ListAssociatedResourcesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ResourceInfo]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"resources" Either String (Maybe (Maybe [ResourceInfo]))
-> Maybe [ResourceInfo] -> Either String (Maybe [ResourceInfo])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ResourceInfo]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Int -> ListAssociatedResourcesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListAssociatedResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either String (Int -> ListAssociatedResourcesResponse)
-> Either String Int
-> Either String ListAssociatedResourcesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListAssociatedResources

instance Prelude.NFData ListAssociatedResources

instance Core.ToHeaders ListAssociatedResources where
  toHeaders :: ListAssociatedResources -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAssociatedResources -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListAssociatedResources where
  toPath :: ListAssociatedResources -> ByteString
toPath ListAssociatedResources' {Maybe Natural
Maybe Text
Text
application :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:application:ListAssociatedResources' :: ListAssociatedResources -> Text
$sel:maxResults:ListAssociatedResources' :: ListAssociatedResources -> Maybe Natural
$sel:nextToken:ListAssociatedResources' :: ListAssociatedResources -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/applications/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
application,
        ByteString
"/resources"
      ]

instance Core.ToQuery ListAssociatedResources where
  toQuery :: ListAssociatedResources -> QueryString
toQuery ListAssociatedResources' {Maybe Natural
Maybe Text
Text
application :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:application:ListAssociatedResources' :: ListAssociatedResources -> Text
$sel:maxResults:ListAssociatedResources' :: ListAssociatedResources -> Maybe Natural
$sel:nextToken:ListAssociatedResources' :: ListAssociatedResources -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListAssociatedResourcesResponse' smart constructor.
data ListAssociatedResourcesResponse = ListAssociatedResourcesResponse'
  { -- | Information about the resources.
    ListAssociatedResourcesResponse -> Maybe [ResourceInfo]
resources :: Prelude.Maybe [ResourceInfo],
    -- | The token to use to get the next page of results after a previous API
    -- call.
    ListAssociatedResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAssociatedResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAssociatedResourcesResponse
-> ListAssociatedResourcesResponse -> Bool
(ListAssociatedResourcesResponse
 -> ListAssociatedResourcesResponse -> Bool)
-> (ListAssociatedResourcesResponse
    -> ListAssociatedResourcesResponse -> Bool)
-> Eq ListAssociatedResourcesResponse
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]
(Int -> ReadS ListAssociatedResourcesResponse)
-> ReadS [ListAssociatedResourcesResponse]
-> ReadPrec ListAssociatedResourcesResponse
-> ReadPrec [ListAssociatedResourcesResponse]
-> Read 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
(Int -> ListAssociatedResourcesResponse -> ShowS)
-> (ListAssociatedResourcesResponse -> String)
-> ([ListAssociatedResourcesResponse] -> ShowS)
-> Show ListAssociatedResourcesResponse
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.
 ListAssociatedResourcesResponse
 -> Rep ListAssociatedResourcesResponse x)
-> (forall x.
    Rep ListAssociatedResourcesResponse x
    -> ListAssociatedResourcesResponse)
-> Generic ListAssociatedResourcesResponse
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)

-- |
-- Create a value of 'ListAssociatedResourcesResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'resources', 'listAssociatedResourcesResponse_resources' - Information about the resources.
--
-- 'nextToken', 'listAssociatedResourcesResponse_nextToken' - The token to use to get the next page of results after a previous API
-- call.
--
-- 'httpStatus', 'listAssociatedResourcesResponse_httpStatus' - The response's http status code.
newListAssociatedResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAssociatedResourcesResponse
newListAssociatedResourcesResponse :: Int -> ListAssociatedResourcesResponse
newListAssociatedResourcesResponse Int
pHttpStatus_ =
  ListAssociatedResourcesResponse' :: Maybe [ResourceInfo]
-> Maybe Text -> Int -> ListAssociatedResourcesResponse
ListAssociatedResourcesResponse'
    { $sel:resources:ListAssociatedResourcesResponse' :: Maybe [ResourceInfo]
resources =
        Maybe [ResourceInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAssociatedResourcesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAssociatedResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the resources.
listAssociatedResourcesResponse_resources :: Lens.Lens' ListAssociatedResourcesResponse (Prelude.Maybe [ResourceInfo])
listAssociatedResourcesResponse_resources :: (Maybe [ResourceInfo] -> f (Maybe [ResourceInfo]))
-> ListAssociatedResourcesResponse
-> f ListAssociatedResourcesResponse
listAssociatedResourcesResponse_resources = (ListAssociatedResourcesResponse -> Maybe [ResourceInfo])
-> (ListAssociatedResourcesResponse
    -> Maybe [ResourceInfo] -> ListAssociatedResourcesResponse)
-> Lens' ListAssociatedResourcesResponse (Maybe [ResourceInfo])
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) ((Maybe [ResourceInfo] -> f (Maybe [ResourceInfo]))
 -> ListAssociatedResourcesResponse
 -> f ListAssociatedResourcesResponse)
-> ((Maybe [ResourceInfo] -> f (Maybe [ResourceInfo]))
    -> Maybe [ResourceInfo] -> f (Maybe [ResourceInfo]))
-> (Maybe [ResourceInfo] -> f (Maybe [ResourceInfo]))
-> ListAssociatedResourcesResponse
-> f ListAssociatedResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ResourceInfo] [ResourceInfo] [ResourceInfo] [ResourceInfo]
-> Iso
     (Maybe [ResourceInfo])
     (Maybe [ResourceInfo])
     (Maybe [ResourceInfo])
     (Maybe [ResourceInfo])
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 AnIso [ResourceInfo] [ResourceInfo] [ResourceInfo] [ResourceInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to use to get the next page of results after a previous API
-- call.
listAssociatedResourcesResponse_nextToken :: Lens.Lens' ListAssociatedResourcesResponse (Prelude.Maybe Prelude.Text)
listAssociatedResourcesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssociatedResourcesResponse
-> f ListAssociatedResourcesResponse
listAssociatedResourcesResponse_nextToken = (ListAssociatedResourcesResponse -> Maybe Text)
-> (ListAssociatedResourcesResponse
    -> Maybe Text -> ListAssociatedResourcesResponse)
-> Lens' ListAssociatedResourcesResponse (Maybe Text)
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)

-- | The response's http status code.
listAssociatedResourcesResponse_httpStatus :: Lens.Lens' ListAssociatedResourcesResponse Prelude.Int
listAssociatedResourcesResponse_httpStatus :: (Int -> f Int)
-> ListAssociatedResourcesResponse
-> f ListAssociatedResourcesResponse
listAssociatedResourcesResponse_httpStatus = (ListAssociatedResourcesResponse -> Int)
-> (ListAssociatedResourcesResponse
    -> Int -> ListAssociatedResourcesResponse)
-> Lens
     ListAssociatedResourcesResponse
     ListAssociatedResourcesResponse
     Int
     Int
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