{-# 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.ResourceGroups.ListGroupResources
-- 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)
--
-- Returns a list of ARNs of the resources that are members of a specified
-- resource group.
--
-- __Minimum permissions__
--
-- To run this command, you must have the following permissions:
--
-- -   @resource-groups:ListGroupResources@
--
-- -   @cloudformation:DescribeStacks@
--
-- -   @cloudformation:ListStackResources@
--
-- -   @tag:GetResources@
--
-- This operation returns paginated results.
module Amazonka.ResourceGroups.ListGroupResources
  ( -- * Creating a Request
    ListGroupResources (..),
    newListGroupResources,

    -- * Request Lenses
    listGroupResources_group,
    listGroupResources_filters,
    listGroupResources_nextToken,
    listGroupResources_groupName,
    listGroupResources_maxResults,

    -- * Destructuring the Response
    ListGroupResourcesResponse (..),
    newListGroupResourcesResponse,

    -- * Response Lenses
    listGroupResourcesResponse_resources,
    listGroupResourcesResponse_queryErrors,
    listGroupResourcesResponse_nextToken,
    listGroupResourcesResponse_resourceIdentifiers,
    listGroupResourcesResponse_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 Amazonka.ResourceGroups.Types
import qualified Amazonka.Response as Response

-- | /See:/ 'newListGroupResources' smart constructor.
data ListGroupResources = ListGroupResources'
  { -- | The name or the ARN of the resource group
    ListGroupResources -> Maybe Text
group' :: Prelude.Maybe Prelude.Text,
    -- | Filters, formatted as ResourceFilter objects, that you want to apply to
    -- a @ListGroupResources@ operation. Filters the results to include only
    -- those of the specified resource types.
    --
    -- -   @resource-type@ - Filter resources by their type. Specify up to five
    --     resource types in the format @AWS::ServiceCode::ResourceType@. For
    --     example, @AWS::EC2::Instance@, or @AWS::S3::Bucket@.
    --
    -- When you specify a @resource-type@ filter for @ListGroupResources@, AWS
    -- Resource Groups validates your filter resource types against the types
    -- that are defined in the query associated with the group. For example, if
    -- a group contains only S3 buckets because its query specifies only that
    -- resource type, but your @resource-type@ filter includes EC2 instances,
    -- AWS Resource Groups does not filter for EC2 instances. In this case, a
    -- @ListGroupResources@ request returns a @BadRequestException@ error with
    -- a message similar to the following:
    --
    -- @The resource types specified as filters in the request are not valid.@
    --
    -- The error includes a list of resource types that failed the validation
    -- because they are not part of the query associated with the group. This
    -- validation doesn\'t occur when the group query specifies
    -- @AWS::AllSupported@, because a group based on such a query can contain
    -- any of the allowed resource types for the query type (tag-based or AWS
    -- CloudFormation stack-based queries).
    ListGroupResources -> Maybe [ResourceFilter]
filters :: Prelude.Maybe [ResourceFilter],
    -- | The parameter for receiving additional results if you receive a
    -- @NextToken@ response in a previous request. A @NextToken@ response
    -- indicates that more output is available. Set this parameter to the value
    -- provided by a previous call\'s @NextToken@ response to indicate where
    -- the output should continue from.
    ListGroupResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | /__Deprecated - don\'t use this parameter. Use the @Group@ request field
    -- instead.__/
    ListGroupResources -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | The total number of results that you want included on each page of the
    -- response. If you do not include this parameter, it defaults to a value
    -- that is specific to the operation. If additional items exist beyond the
    -- maximum you specify, the @NextToken@ response element is present and has
    -- a value (is not null). Include that value as the @NextToken@ request
    -- parameter in the next call to the operation to get the next part of the
    -- results. Note that the service might return fewer results than the
    -- maximum even when there are more results available. You should check
    -- @NextToken@ after every operation to ensure that you receive all of the
    -- results.
    ListGroupResources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListGroupResources -> ListGroupResources -> Bool
(ListGroupResources -> ListGroupResources -> Bool)
-> (ListGroupResources -> ListGroupResources -> Bool)
-> Eq ListGroupResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroupResources -> ListGroupResources -> Bool
$c/= :: ListGroupResources -> ListGroupResources -> Bool
== :: ListGroupResources -> ListGroupResources -> Bool
$c== :: ListGroupResources -> ListGroupResources -> Bool
Prelude.Eq, ReadPrec [ListGroupResources]
ReadPrec ListGroupResources
Int -> ReadS ListGroupResources
ReadS [ListGroupResources]
(Int -> ReadS ListGroupResources)
-> ReadS [ListGroupResources]
-> ReadPrec ListGroupResources
-> ReadPrec [ListGroupResources]
-> Read ListGroupResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroupResources]
$creadListPrec :: ReadPrec [ListGroupResources]
readPrec :: ReadPrec ListGroupResources
$creadPrec :: ReadPrec ListGroupResources
readList :: ReadS [ListGroupResources]
$creadList :: ReadS [ListGroupResources]
readsPrec :: Int -> ReadS ListGroupResources
$creadsPrec :: Int -> ReadS ListGroupResources
Prelude.Read, Int -> ListGroupResources -> ShowS
[ListGroupResources] -> ShowS
ListGroupResources -> String
(Int -> ListGroupResources -> ShowS)
-> (ListGroupResources -> String)
-> ([ListGroupResources] -> ShowS)
-> Show ListGroupResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroupResources] -> ShowS
$cshowList :: [ListGroupResources] -> ShowS
show :: ListGroupResources -> String
$cshow :: ListGroupResources -> String
showsPrec :: Int -> ListGroupResources -> ShowS
$cshowsPrec :: Int -> ListGroupResources -> ShowS
Prelude.Show, (forall x. ListGroupResources -> Rep ListGroupResources x)
-> (forall x. Rep ListGroupResources x -> ListGroupResources)
-> Generic ListGroupResources
forall x. Rep ListGroupResources x -> ListGroupResources
forall x. ListGroupResources -> Rep ListGroupResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGroupResources x -> ListGroupResources
$cfrom :: forall x. ListGroupResources -> Rep ListGroupResources x
Prelude.Generic)

-- |
-- Create a value of 'ListGroupResources' 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:
--
-- 'group'', 'listGroupResources_group' - The name or the ARN of the resource group
--
-- 'filters', 'listGroupResources_filters' - Filters, formatted as ResourceFilter objects, that you want to apply to
-- a @ListGroupResources@ operation. Filters the results to include only
-- those of the specified resource types.
--
-- -   @resource-type@ - Filter resources by their type. Specify up to five
--     resource types in the format @AWS::ServiceCode::ResourceType@. For
--     example, @AWS::EC2::Instance@, or @AWS::S3::Bucket@.
--
-- When you specify a @resource-type@ filter for @ListGroupResources@, AWS
-- Resource Groups validates your filter resource types against the types
-- that are defined in the query associated with the group. For example, if
-- a group contains only S3 buckets because its query specifies only that
-- resource type, but your @resource-type@ filter includes EC2 instances,
-- AWS Resource Groups does not filter for EC2 instances. In this case, a
-- @ListGroupResources@ request returns a @BadRequestException@ error with
-- a message similar to the following:
--
-- @The resource types specified as filters in the request are not valid.@
--
-- The error includes a list of resource types that failed the validation
-- because they are not part of the query associated with the group. This
-- validation doesn\'t occur when the group query specifies
-- @AWS::AllSupported@, because a group based on such a query can contain
-- any of the allowed resource types for the query type (tag-based or AWS
-- CloudFormation stack-based queries).
--
-- 'nextToken', 'listGroupResources_nextToken' - The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- provided by a previous call\'s @NextToken@ response to indicate where
-- the output should continue from.
--
-- 'groupName', 'listGroupResources_groupName' - /__Deprecated - don\'t use this parameter. Use the @Group@ request field
-- instead.__/
--
-- 'maxResults', 'listGroupResources_maxResults' - The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that the service might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
newListGroupResources ::
  ListGroupResources
newListGroupResources :: ListGroupResources
newListGroupResources =
  ListGroupResources' :: Maybe Text
-> Maybe [ResourceFilter]
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> ListGroupResources
ListGroupResources'
    { $sel:group':ListGroupResources' :: Maybe Text
group' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:ListGroupResources' :: Maybe [ResourceFilter]
filters = Maybe [ResourceFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListGroupResources' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:ListGroupResources' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListGroupResources' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The name or the ARN of the resource group
listGroupResources_group :: Lens.Lens' ListGroupResources (Prelude.Maybe Prelude.Text)
listGroupResources_group :: (Maybe Text -> f (Maybe Text))
-> ListGroupResources -> f ListGroupResources
listGroupResources_group = (ListGroupResources -> Maybe Text)
-> (ListGroupResources -> Maybe Text -> ListGroupResources)
-> Lens
     ListGroupResources ListGroupResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe Text
group' :: Maybe Text
$sel:group':ListGroupResources' :: ListGroupResources -> Maybe Text
group'} -> Maybe Text
group') (\s :: ListGroupResources
s@ListGroupResources' {} Maybe Text
a -> ListGroupResources
s {$sel:group':ListGroupResources' :: Maybe Text
group' = Maybe Text
a} :: ListGroupResources)

-- | Filters, formatted as ResourceFilter objects, that you want to apply to
-- a @ListGroupResources@ operation. Filters the results to include only
-- those of the specified resource types.
--
-- -   @resource-type@ - Filter resources by their type. Specify up to five
--     resource types in the format @AWS::ServiceCode::ResourceType@. For
--     example, @AWS::EC2::Instance@, or @AWS::S3::Bucket@.
--
-- When you specify a @resource-type@ filter for @ListGroupResources@, AWS
-- Resource Groups validates your filter resource types against the types
-- that are defined in the query associated with the group. For example, if
-- a group contains only S3 buckets because its query specifies only that
-- resource type, but your @resource-type@ filter includes EC2 instances,
-- AWS Resource Groups does not filter for EC2 instances. In this case, a
-- @ListGroupResources@ request returns a @BadRequestException@ error with
-- a message similar to the following:
--
-- @The resource types specified as filters in the request are not valid.@
--
-- The error includes a list of resource types that failed the validation
-- because they are not part of the query associated with the group. This
-- validation doesn\'t occur when the group query specifies
-- @AWS::AllSupported@, because a group based on such a query can contain
-- any of the allowed resource types for the query type (tag-based or AWS
-- CloudFormation stack-based queries).
listGroupResources_filters :: Lens.Lens' ListGroupResources (Prelude.Maybe [ResourceFilter])
listGroupResources_filters :: (Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
-> ListGroupResources -> f ListGroupResources
listGroupResources_filters = (ListGroupResources -> Maybe [ResourceFilter])
-> (ListGroupResources
    -> Maybe [ResourceFilter] -> ListGroupResources)
-> Lens
     ListGroupResources
     ListGroupResources
     (Maybe [ResourceFilter])
     (Maybe [ResourceFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe [ResourceFilter]
filters :: Maybe [ResourceFilter]
$sel:filters:ListGroupResources' :: ListGroupResources -> Maybe [ResourceFilter]
filters} -> Maybe [ResourceFilter]
filters) (\s :: ListGroupResources
s@ListGroupResources' {} Maybe [ResourceFilter]
a -> ListGroupResources
s {$sel:filters:ListGroupResources' :: Maybe [ResourceFilter]
filters = Maybe [ResourceFilter]
a} :: ListGroupResources) ((Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
 -> ListGroupResources -> f ListGroupResources)
-> ((Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
    -> Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
-> (Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
-> ListGroupResources
-> f ListGroupResources
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourceFilter] [ResourceFilter] [ResourceFilter] [ResourceFilter]
-> Iso
     (Maybe [ResourceFilter])
     (Maybe [ResourceFilter])
     (Maybe [ResourceFilter])
     (Maybe [ResourceFilter])
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
  [ResourceFilter] [ResourceFilter] [ResourceFilter] [ResourceFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- provided by a previous call\'s @NextToken@ response to indicate where
-- the output should continue from.
listGroupResources_nextToken :: Lens.Lens' ListGroupResources (Prelude.Maybe Prelude.Text)
listGroupResources_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGroupResources -> f ListGroupResources
listGroupResources_nextToken = (ListGroupResources -> Maybe Text)
-> (ListGroupResources -> Maybe Text -> ListGroupResources)
-> Lens
     ListGroupResources ListGroupResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroupResources' :: ListGroupResources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroupResources
s@ListGroupResources' {} Maybe Text
a -> ListGroupResources
s {$sel:nextToken:ListGroupResources' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroupResources)

-- | /__Deprecated - don\'t use this parameter. Use the @Group@ request field
-- instead.__/
listGroupResources_groupName :: Lens.Lens' ListGroupResources (Prelude.Maybe Prelude.Text)
listGroupResources_groupName :: (Maybe Text -> f (Maybe Text))
-> ListGroupResources -> f ListGroupResources
listGroupResources_groupName = (ListGroupResources -> Maybe Text)
-> (ListGroupResources -> Maybe Text -> ListGroupResources)
-> Lens
     ListGroupResources ListGroupResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe Text
groupName :: Maybe Text
$sel:groupName:ListGroupResources' :: ListGroupResources -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: ListGroupResources
s@ListGroupResources' {} Maybe Text
a -> ListGroupResources
s {$sel:groupName:ListGroupResources' :: Maybe Text
groupName = Maybe Text
a} :: ListGroupResources)

-- | The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that the service might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
listGroupResources_maxResults :: Lens.Lens' ListGroupResources (Prelude.Maybe Prelude.Natural)
listGroupResources_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListGroupResources -> f ListGroupResources
listGroupResources_maxResults = (ListGroupResources -> Maybe Natural)
-> (ListGroupResources -> Maybe Natural -> ListGroupResources)
-> Lens
     ListGroupResources
     ListGroupResources
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListGroupResources' :: ListGroupResources -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListGroupResources
s@ListGroupResources' {} Maybe Natural
a -> ListGroupResources
s {$sel:maxResults:ListGroupResources' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListGroupResources)

instance Core.AWSPager ListGroupResources where
  page :: ListGroupResources
-> AWSResponse ListGroupResources -> Maybe ListGroupResources
page ListGroupResources
rq AWSResponse ListGroupResources
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListGroupResources
ListGroupResourcesResponse
rs
            ListGroupResourcesResponse
-> Getting (First Text) ListGroupResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGroupResourcesResponse
-> Const (First Text) ListGroupResourcesResponse
Lens' ListGroupResourcesResponse (Maybe Text)
listGroupResourcesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListGroupResourcesResponse
 -> Const (First Text) ListGroupResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGroupResourcesResponse 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 ListGroupResources
forall a. Maybe a
Prelude.Nothing
    | Maybe [ResourceIdentifier] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListGroupResources
ListGroupResourcesResponse
rs
            ListGroupResourcesResponse
-> Getting
     (First [ResourceIdentifier])
     ListGroupResourcesResponse
     [ResourceIdentifier]
-> Maybe [ResourceIdentifier]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ResourceIdentifier]
 -> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
-> ListGroupResourcesResponse
-> Const (First [ResourceIdentifier]) ListGroupResourcesResponse
Lens' ListGroupResourcesResponse (Maybe [ResourceIdentifier])
listGroupResourcesResponse_resourceIdentifiers
              ((Maybe [ResourceIdentifier]
  -> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
 -> ListGroupResourcesResponse
 -> Const (First [ResourceIdentifier]) ListGroupResourcesResponse)
-> (([ResourceIdentifier]
     -> Const (First [ResourceIdentifier]) [ResourceIdentifier])
    -> Maybe [ResourceIdentifier]
    -> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
-> Getting
     (First [ResourceIdentifier])
     ListGroupResourcesResponse
     [ResourceIdentifier]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResourceIdentifier]
 -> Const (First [ResourceIdentifier]) [ResourceIdentifier])
-> Maybe [ResourceIdentifier]
-> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListGroupResources
forall a. Maybe a
Prelude.Nothing
    | Maybe [ListGroupResourcesItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListGroupResources
ListGroupResourcesResponse
rs
            ListGroupResourcesResponse
-> Getting
     (First [ListGroupResourcesItem])
     ListGroupResourcesResponse
     [ListGroupResourcesItem]
-> Maybe [ListGroupResourcesItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ListGroupResourcesItem]
 -> Const
      (First [ListGroupResourcesItem]) (Maybe [ListGroupResourcesItem]))
-> ListGroupResourcesResponse
-> Const
     (First [ListGroupResourcesItem]) ListGroupResourcesResponse
Lens' ListGroupResourcesResponse (Maybe [ListGroupResourcesItem])
listGroupResourcesResponse_resources
              ((Maybe [ListGroupResourcesItem]
  -> Const
       (First [ListGroupResourcesItem]) (Maybe [ListGroupResourcesItem]))
 -> ListGroupResourcesResponse
 -> Const
      (First [ListGroupResourcesItem]) ListGroupResourcesResponse)
-> (([ListGroupResourcesItem]
     -> Const (First [ListGroupResourcesItem]) [ListGroupResourcesItem])
    -> Maybe [ListGroupResourcesItem]
    -> Const
         (First [ListGroupResourcesItem]) (Maybe [ListGroupResourcesItem]))
-> Getting
     (First [ListGroupResourcesItem])
     ListGroupResourcesResponse
     [ListGroupResourcesItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ListGroupResourcesItem]
 -> Const (First [ListGroupResourcesItem]) [ListGroupResourcesItem])
-> Maybe [ListGroupResourcesItem]
-> Const
     (First [ListGroupResourcesItem]) (Maybe [ListGroupResourcesItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListGroupResources
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListGroupResources -> Maybe ListGroupResources
forall a. a -> Maybe a
Prelude.Just (ListGroupResources -> Maybe ListGroupResources)
-> ListGroupResources -> Maybe ListGroupResources
forall a b. (a -> b) -> a -> b
Prelude.$
        ListGroupResources
rq
          ListGroupResources
-> (ListGroupResources -> ListGroupResources) -> ListGroupResources
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListGroupResources -> Identity ListGroupResources
Lens
  ListGroupResources ListGroupResources (Maybe Text) (Maybe Text)
listGroupResources_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListGroupResources -> Identity ListGroupResources)
-> Maybe Text -> ListGroupResources -> ListGroupResources
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGroupResources
ListGroupResourcesResponse
rs
          ListGroupResourcesResponse
-> Getting (First Text) ListGroupResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGroupResourcesResponse
-> Const (First Text) ListGroupResourcesResponse
Lens' ListGroupResourcesResponse (Maybe Text)
listGroupResourcesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListGroupResourcesResponse
 -> Const (First Text) ListGroupResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGroupResourcesResponse 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 ListGroupResources where
  type
    AWSResponse ListGroupResources =
      ListGroupResourcesResponse
  request :: ListGroupResources -> Request ListGroupResources
request = Service -> ListGroupResources -> Request ListGroupResources
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListGroupResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGroupResources)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListGroupResources))
-> Logger
-> Service
-> Proxy ListGroupResources
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGroupResources)))
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 [ListGroupResourcesItem]
-> Maybe [QueryError]
-> Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListGroupResourcesResponse
ListGroupResourcesResponse'
            (Maybe [ListGroupResourcesItem]
 -> Maybe [QueryError]
 -> Maybe Text
 -> Maybe [ResourceIdentifier]
 -> Int
 -> ListGroupResourcesResponse)
-> Either String (Maybe [ListGroupResourcesItem])
-> Either
     String
     (Maybe [QueryError]
      -> Maybe Text
      -> Maybe [ResourceIdentifier]
      -> Int
      -> ListGroupResourcesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [ListGroupResourcesItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Resources" Either String (Maybe (Maybe [ListGroupResourcesItem]))
-> Maybe [ListGroupResourcesItem]
-> Either String (Maybe [ListGroupResourcesItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ListGroupResourcesItem]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [QueryError]
   -> Maybe Text
   -> Maybe [ResourceIdentifier]
   -> Int
   -> ListGroupResourcesResponse)
-> Either String (Maybe [QueryError])
-> Either
     String
     (Maybe Text
      -> Maybe [ResourceIdentifier] -> Int -> ListGroupResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [QueryError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"QueryErrors" Either String (Maybe (Maybe [QueryError]))
-> Maybe [QueryError] -> Either String (Maybe [QueryError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [QueryError]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe [ResourceIdentifier] -> Int -> ListGroupResourcesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ResourceIdentifier] -> Int -> ListGroupResourcesResponse)
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
  (Maybe [ResourceIdentifier] -> Int -> ListGroupResourcesResponse)
-> Either String (Maybe [ResourceIdentifier])
-> Either String (Int -> ListGroupResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ResourceIdentifier]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResourceIdentifiers"
                            Either String (Maybe (Maybe [ResourceIdentifier]))
-> Maybe [ResourceIdentifier]
-> Either String (Maybe [ResourceIdentifier])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ResourceIdentifier]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListGroupResourcesResponse)
-> Either String Int -> Either String ListGroupResourcesResponse
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 ListGroupResources

instance Prelude.NFData ListGroupResources

instance Core.ToHeaders ListGroupResources where
  toHeaders :: ListGroupResources -> ResponseHeaders
toHeaders = ResponseHeaders -> ListGroupResources -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON ListGroupResources where
  toJSON :: ListGroupResources -> Value
toJSON ListGroupResources' {Maybe Natural
Maybe [ResourceFilter]
Maybe Text
maxResults :: Maybe Natural
groupName :: Maybe Text
nextToken :: Maybe Text
filters :: Maybe [ResourceFilter]
group' :: Maybe Text
$sel:maxResults:ListGroupResources' :: ListGroupResources -> Maybe Natural
$sel:groupName:ListGroupResources' :: ListGroupResources -> Maybe Text
$sel:nextToken:ListGroupResources' :: ListGroupResources -> Maybe Text
$sel:filters:ListGroupResources' :: ListGroupResources -> Maybe [ResourceFilter]
$sel:group':ListGroupResources' :: ListGroupResources -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Group" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
group',
            (Text
"Filters" Text -> [ResourceFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ResourceFilter] -> Pair) -> Maybe [ResourceFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResourceFilter]
filters,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"GroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupName,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

instance Core.ToPath ListGroupResources where
  toPath :: ListGroupResources -> ByteString
toPath = ByteString -> ListGroupResources -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/list-group-resources"

instance Core.ToQuery ListGroupResources where
  toQuery :: ListGroupResources -> QueryString
toQuery = QueryString -> ListGroupResources -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListGroupResourcesResponse' smart constructor.
data ListGroupResourcesResponse = ListGroupResourcesResponse'
  { -- | An array of resources from which you can determine each resource\'s
    -- identity, type, and group membership status.
    ListGroupResourcesResponse -> Maybe [ListGroupResourcesItem]
resources :: Prelude.Maybe [ListGroupResourcesItem],
    -- | A list of @QueryError@ objects. Each error is an object that contains
    -- @ErrorCode@ and @Message@ structures. Possible values for @ErrorCode@
    -- are @CLOUDFORMATION_STACK_INACTIVE@ and
    -- @CLOUDFORMATION_STACK_NOT_EXISTING@.
    ListGroupResourcesResponse -> Maybe [QueryError]
queryErrors :: Prelude.Maybe [QueryError],
    -- | If present, indicates that more output is available than is included in
    -- the current response. Use this value in the @NextToken@ request
    -- parameter in a subsequent call to the operation to get the next part of
    -- the output. You should repeat this until the @NextToken@ response
    -- element comes back as @null@.
    ListGroupResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | __/Deprecated - don\'t use this parameter. Use the @Resources@ response
    -- field instead./__
    ListGroupResourcesResponse -> Maybe [ResourceIdentifier]
resourceIdentifiers :: Prelude.Maybe [ResourceIdentifier],
    -- | The response's http status code.
    ListGroupResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
(ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool)
-> (ListGroupResourcesResponse
    -> ListGroupResourcesResponse -> Bool)
-> Eq ListGroupResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
$c/= :: ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
== :: ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
$c== :: ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListGroupResourcesResponse]
ReadPrec ListGroupResourcesResponse
Int -> ReadS ListGroupResourcesResponse
ReadS [ListGroupResourcesResponse]
(Int -> ReadS ListGroupResourcesResponse)
-> ReadS [ListGroupResourcesResponse]
-> ReadPrec ListGroupResourcesResponse
-> ReadPrec [ListGroupResourcesResponse]
-> Read ListGroupResourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroupResourcesResponse]
$creadListPrec :: ReadPrec [ListGroupResourcesResponse]
readPrec :: ReadPrec ListGroupResourcesResponse
$creadPrec :: ReadPrec ListGroupResourcesResponse
readList :: ReadS [ListGroupResourcesResponse]
$creadList :: ReadS [ListGroupResourcesResponse]
readsPrec :: Int -> ReadS ListGroupResourcesResponse
$creadsPrec :: Int -> ReadS ListGroupResourcesResponse
Prelude.Read, Int -> ListGroupResourcesResponse -> ShowS
[ListGroupResourcesResponse] -> ShowS
ListGroupResourcesResponse -> String
(Int -> ListGroupResourcesResponse -> ShowS)
-> (ListGroupResourcesResponse -> String)
-> ([ListGroupResourcesResponse] -> ShowS)
-> Show ListGroupResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroupResourcesResponse] -> ShowS
$cshowList :: [ListGroupResourcesResponse] -> ShowS
show :: ListGroupResourcesResponse -> String
$cshow :: ListGroupResourcesResponse -> String
showsPrec :: Int -> ListGroupResourcesResponse -> ShowS
$cshowsPrec :: Int -> ListGroupResourcesResponse -> ShowS
Prelude.Show, (forall x.
 ListGroupResourcesResponse -> Rep ListGroupResourcesResponse x)
-> (forall x.
    Rep ListGroupResourcesResponse x -> ListGroupResourcesResponse)
-> Generic ListGroupResourcesResponse
forall x.
Rep ListGroupResourcesResponse x -> ListGroupResourcesResponse
forall x.
ListGroupResourcesResponse -> Rep ListGroupResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGroupResourcesResponse x -> ListGroupResourcesResponse
$cfrom :: forall x.
ListGroupResourcesResponse -> Rep ListGroupResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListGroupResourcesResponse' 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', 'listGroupResourcesResponse_resources' - An array of resources from which you can determine each resource\'s
-- identity, type, and group membership status.
--
-- 'queryErrors', 'listGroupResourcesResponse_queryErrors' - A list of @QueryError@ objects. Each error is an object that contains
-- @ErrorCode@ and @Message@ structures. Possible values for @ErrorCode@
-- are @CLOUDFORMATION_STACK_INACTIVE@ and
-- @CLOUDFORMATION_STACK_NOT_EXISTING@.
--
-- 'nextToken', 'listGroupResourcesResponse_nextToken' - If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
--
-- 'resourceIdentifiers', 'listGroupResourcesResponse_resourceIdentifiers' - __/Deprecated - don\'t use this parameter. Use the @Resources@ response
-- field instead./__
--
-- 'httpStatus', 'listGroupResourcesResponse_httpStatus' - The response's http status code.
newListGroupResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListGroupResourcesResponse
newListGroupResourcesResponse :: Int -> ListGroupResourcesResponse
newListGroupResourcesResponse Int
pHttpStatus_ =
  ListGroupResourcesResponse' :: Maybe [ListGroupResourcesItem]
-> Maybe [QueryError]
-> Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListGroupResourcesResponse
ListGroupResourcesResponse'
    { $sel:resources:ListGroupResourcesResponse' :: Maybe [ListGroupResourcesItem]
resources =
        Maybe [ListGroupResourcesItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:queryErrors:ListGroupResourcesResponse' :: Maybe [QueryError]
queryErrors = Maybe [QueryError]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListGroupResourcesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceIdentifiers:ListGroupResourcesResponse' :: Maybe [ResourceIdentifier]
resourceIdentifiers = Maybe [ResourceIdentifier]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListGroupResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of resources from which you can determine each resource\'s
-- identity, type, and group membership status.
listGroupResourcesResponse_resources :: Lens.Lens' ListGroupResourcesResponse (Prelude.Maybe [ListGroupResourcesItem])
listGroupResourcesResponse_resources :: (Maybe [ListGroupResourcesItem]
 -> f (Maybe [ListGroupResourcesItem]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_resources = (ListGroupResourcesResponse -> Maybe [ListGroupResourcesItem])
-> (ListGroupResourcesResponse
    -> Maybe [ListGroupResourcesItem] -> ListGroupResourcesResponse)
-> Lens'
     ListGroupResourcesResponse (Maybe [ListGroupResourcesItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Maybe [ListGroupResourcesItem]
resources :: Maybe [ListGroupResourcesItem]
$sel:resources:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Maybe [ListGroupResourcesItem]
resources} -> Maybe [ListGroupResourcesItem]
resources) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Maybe [ListGroupResourcesItem]
a -> ListGroupResourcesResponse
s {$sel:resources:ListGroupResourcesResponse' :: Maybe [ListGroupResourcesItem]
resources = Maybe [ListGroupResourcesItem]
a} :: ListGroupResourcesResponse) ((Maybe [ListGroupResourcesItem]
  -> f (Maybe [ListGroupResourcesItem]))
 -> ListGroupResourcesResponse -> f ListGroupResourcesResponse)
-> ((Maybe [ListGroupResourcesItem]
     -> f (Maybe [ListGroupResourcesItem]))
    -> Maybe [ListGroupResourcesItem]
    -> f (Maybe [ListGroupResourcesItem]))
-> (Maybe [ListGroupResourcesItem]
    -> f (Maybe [ListGroupResourcesItem]))
-> ListGroupResourcesResponse
-> f ListGroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ListGroupResourcesItem]
  [ListGroupResourcesItem]
  [ListGroupResourcesItem]
  [ListGroupResourcesItem]
-> Iso
     (Maybe [ListGroupResourcesItem])
     (Maybe [ListGroupResourcesItem])
     (Maybe [ListGroupResourcesItem])
     (Maybe [ListGroupResourcesItem])
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
  [ListGroupResourcesItem]
  [ListGroupResourcesItem]
  [ListGroupResourcesItem]
  [ListGroupResourcesItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of @QueryError@ objects. Each error is an object that contains
-- @ErrorCode@ and @Message@ structures. Possible values for @ErrorCode@
-- are @CLOUDFORMATION_STACK_INACTIVE@ and
-- @CLOUDFORMATION_STACK_NOT_EXISTING@.
listGroupResourcesResponse_queryErrors :: Lens.Lens' ListGroupResourcesResponse (Prelude.Maybe [QueryError])
listGroupResourcesResponse_queryErrors :: (Maybe [QueryError] -> f (Maybe [QueryError]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_queryErrors = (ListGroupResourcesResponse -> Maybe [QueryError])
-> (ListGroupResourcesResponse
    -> Maybe [QueryError] -> ListGroupResourcesResponse)
-> Lens
     ListGroupResourcesResponse
     ListGroupResourcesResponse
     (Maybe [QueryError])
     (Maybe [QueryError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Maybe [QueryError]
queryErrors :: Maybe [QueryError]
$sel:queryErrors:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Maybe [QueryError]
queryErrors} -> Maybe [QueryError]
queryErrors) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Maybe [QueryError]
a -> ListGroupResourcesResponse
s {$sel:queryErrors:ListGroupResourcesResponse' :: Maybe [QueryError]
queryErrors = Maybe [QueryError]
a} :: ListGroupResourcesResponse) ((Maybe [QueryError] -> f (Maybe [QueryError]))
 -> ListGroupResourcesResponse -> f ListGroupResourcesResponse)
-> ((Maybe [QueryError] -> f (Maybe [QueryError]))
    -> Maybe [QueryError] -> f (Maybe [QueryError]))
-> (Maybe [QueryError] -> f (Maybe [QueryError]))
-> ListGroupResourcesResponse
-> f ListGroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [QueryError] [QueryError] [QueryError] [QueryError]
-> Iso
     (Maybe [QueryError])
     (Maybe [QueryError])
     (Maybe [QueryError])
     (Maybe [QueryError])
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 [QueryError] [QueryError] [QueryError] [QueryError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
listGroupResourcesResponse_nextToken :: Lens.Lens' ListGroupResourcesResponse (Prelude.Maybe Prelude.Text)
listGroupResourcesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_nextToken = (ListGroupResourcesResponse -> Maybe Text)
-> (ListGroupResourcesResponse
    -> Maybe Text -> ListGroupResourcesResponse)
-> Lens' ListGroupResourcesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Maybe Text
a -> ListGroupResourcesResponse
s {$sel:nextToken:ListGroupResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroupResourcesResponse)

-- | __/Deprecated - don\'t use this parameter. Use the @Resources@ response
-- field instead./__
listGroupResourcesResponse_resourceIdentifiers :: Lens.Lens' ListGroupResourcesResponse (Prelude.Maybe [ResourceIdentifier])
listGroupResourcesResponse_resourceIdentifiers :: (Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_resourceIdentifiers = (ListGroupResourcesResponse -> Maybe [ResourceIdentifier])
-> (ListGroupResourcesResponse
    -> Maybe [ResourceIdentifier] -> ListGroupResourcesResponse)
-> Lens' ListGroupResourcesResponse (Maybe [ResourceIdentifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Maybe [ResourceIdentifier]
resourceIdentifiers :: Maybe [ResourceIdentifier]
$sel:resourceIdentifiers:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Maybe [ResourceIdentifier]
resourceIdentifiers} -> Maybe [ResourceIdentifier]
resourceIdentifiers) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Maybe [ResourceIdentifier]
a -> ListGroupResourcesResponse
s {$sel:resourceIdentifiers:ListGroupResourcesResponse' :: Maybe [ResourceIdentifier]
resourceIdentifiers = Maybe [ResourceIdentifier]
a} :: ListGroupResourcesResponse) ((Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
 -> ListGroupResourcesResponse -> f ListGroupResourcesResponse)
-> ((Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
    -> Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> (Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> ListGroupResourcesResponse
-> f ListGroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourceIdentifier]
  [ResourceIdentifier]
  [ResourceIdentifier]
  [ResourceIdentifier]
-> Iso
     (Maybe [ResourceIdentifier])
     (Maybe [ResourceIdentifier])
     (Maybe [ResourceIdentifier])
     (Maybe [ResourceIdentifier])
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
  [ResourceIdentifier]
  [ResourceIdentifier]
  [ResourceIdentifier]
  [ResourceIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listGroupResourcesResponse_httpStatus :: Lens.Lens' ListGroupResourcesResponse Prelude.Int
listGroupResourcesResponse_httpStatus :: (Int -> f Int)
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_httpStatus = (ListGroupResourcesResponse -> Int)
-> (ListGroupResourcesResponse
    -> Int -> ListGroupResourcesResponse)
-> Lens
     ListGroupResourcesResponse ListGroupResourcesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Int
a -> ListGroupResourcesResponse
s {$sel:httpStatus:ListGroupResourcesResponse' :: Int
httpStatus = Int
a} :: ListGroupResourcesResponse)

instance Prelude.NFData ListGroupResourcesResponse