{-# 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.CodeBuild.ListReportGroups
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets a list ARNs for the report groups in the current Amazon Web
-- Services account.
--
-- This operation returns paginated results.
module Amazonka.CodeBuild.ListReportGroups
  ( -- * Creating a Request
    ListReportGroups (..),
    newListReportGroups,

    -- * Request Lenses
    listReportGroups_maxResults,
    listReportGroups_nextToken,
    listReportGroups_sortBy,
    listReportGroups_sortOrder,

    -- * Destructuring the Response
    ListReportGroupsResponse (..),
    newListReportGroupsResponse,

    -- * Response Lenses
    listReportGroupsResponse_nextToken,
    listReportGroupsResponse_reportGroups,
    listReportGroupsResponse_httpStatus,
  )
where

import Amazonka.CodeBuild.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListReportGroups' smart constructor.
data ListReportGroups = ListReportGroups'
  { -- | The maximum number of paginated report groups returned per response. Use
    -- @nextToken@ to iterate pages in the list of returned @ReportGroup@
    -- objects. The default value is 100.
    ListReportGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | During a previous call, the maximum number of items that can be returned
    -- is the value specified in @maxResults@. If there more items in the list,
    -- then a unique string called a /nextToken/ is returned. To get the next
    -- batch of items in the list, call this operation again, adding the next
    -- token to the call. To get all of the items in the list, keep calling
    -- this operation with each subsequent next token that is returned, until
    -- no more next tokens are returned.
    ListReportGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The criterion to be used to list build report groups. Valid values
    -- include:
    --
    -- -   @CREATED_TIME@: List based on when each report group was created.
    --
    -- -   @LAST_MODIFIED_TIME@: List based on when each report group was last
    --     changed.
    --
    -- -   @NAME@: List based on each report group\'s name.
    ListReportGroups -> Maybe ReportGroupSortByType
sortBy :: Prelude.Maybe ReportGroupSortByType,
    -- | Used to specify the order to sort the list of returned report groups.
    -- Valid values are @ASCENDING@ and @DESCENDING@.
    ListReportGroups -> Maybe SortOrderType
sortOrder :: Prelude.Maybe SortOrderType
  }
  deriving (ListReportGroups -> ListReportGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReportGroups -> ListReportGroups -> Bool
$c/= :: ListReportGroups -> ListReportGroups -> Bool
== :: ListReportGroups -> ListReportGroups -> Bool
$c== :: ListReportGroups -> ListReportGroups -> Bool
Prelude.Eq, ReadPrec [ListReportGroups]
ReadPrec ListReportGroups
Int -> ReadS ListReportGroups
ReadS [ListReportGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReportGroups]
$creadListPrec :: ReadPrec [ListReportGroups]
readPrec :: ReadPrec ListReportGroups
$creadPrec :: ReadPrec ListReportGroups
readList :: ReadS [ListReportGroups]
$creadList :: ReadS [ListReportGroups]
readsPrec :: Int -> ReadS ListReportGroups
$creadsPrec :: Int -> ReadS ListReportGroups
Prelude.Read, Int -> ListReportGroups -> ShowS
[ListReportGroups] -> ShowS
ListReportGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReportGroups] -> ShowS
$cshowList :: [ListReportGroups] -> ShowS
show :: ListReportGroups -> String
$cshow :: ListReportGroups -> String
showsPrec :: Int -> ListReportGroups -> ShowS
$cshowsPrec :: Int -> ListReportGroups -> ShowS
Prelude.Show, forall x. Rep ListReportGroups x -> ListReportGroups
forall x. ListReportGroups -> Rep ListReportGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListReportGroups x -> ListReportGroups
$cfrom :: forall x. ListReportGroups -> Rep ListReportGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListReportGroups' 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:
--
-- 'maxResults', 'listReportGroups_maxResults' - The maximum number of paginated report groups returned per response. Use
-- @nextToken@ to iterate pages in the list of returned @ReportGroup@
-- objects. The default value is 100.
--
-- 'nextToken', 'listReportGroups_nextToken' - During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
--
-- 'sortBy', 'listReportGroups_sortBy' - The criterion to be used to list build report groups. Valid values
-- include:
--
-- -   @CREATED_TIME@: List based on when each report group was created.
--
-- -   @LAST_MODIFIED_TIME@: List based on when each report group was last
--     changed.
--
-- -   @NAME@: List based on each report group\'s name.
--
-- 'sortOrder', 'listReportGroups_sortOrder' - Used to specify the order to sort the list of returned report groups.
-- Valid values are @ASCENDING@ and @DESCENDING@.
newListReportGroups ::
  ListReportGroups
newListReportGroups :: ListReportGroups
newListReportGroups =
  ListReportGroups'
    { $sel:maxResults:ListReportGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListReportGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListReportGroups' :: Maybe ReportGroupSortByType
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListReportGroups' :: Maybe SortOrderType
sortOrder = forall a. Maybe a
Prelude.Nothing
    }

-- | The maximum number of paginated report groups returned per response. Use
-- @nextToken@ to iterate pages in the list of returned @ReportGroup@
-- objects. The default value is 100.
listReportGroups_maxResults :: Lens.Lens' ListReportGroups (Prelude.Maybe Prelude.Natural)
listReportGroups_maxResults :: Lens' ListReportGroups (Maybe Natural)
listReportGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListReportGroups' :: ListReportGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListReportGroups
s@ListReportGroups' {} Maybe Natural
a -> ListReportGroups
s {$sel:maxResults:ListReportGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListReportGroups)

-- | During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
listReportGroups_nextToken :: Lens.Lens' ListReportGroups (Prelude.Maybe Prelude.Text)
listReportGroups_nextToken :: Lens' ListReportGroups (Maybe Text)
listReportGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReportGroups' :: ListReportGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReportGroups
s@ListReportGroups' {} Maybe Text
a -> ListReportGroups
s {$sel:nextToken:ListReportGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListReportGroups)

-- | The criterion to be used to list build report groups. Valid values
-- include:
--
-- -   @CREATED_TIME@: List based on when each report group was created.
--
-- -   @LAST_MODIFIED_TIME@: List based on when each report group was last
--     changed.
--
-- -   @NAME@: List based on each report group\'s name.
listReportGroups_sortBy :: Lens.Lens' ListReportGroups (Prelude.Maybe ReportGroupSortByType)
listReportGroups_sortBy :: Lens' ListReportGroups (Maybe ReportGroupSortByType)
listReportGroups_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportGroups' {Maybe ReportGroupSortByType
sortBy :: Maybe ReportGroupSortByType
$sel:sortBy:ListReportGroups' :: ListReportGroups -> Maybe ReportGroupSortByType
sortBy} -> Maybe ReportGroupSortByType
sortBy) (\s :: ListReportGroups
s@ListReportGroups' {} Maybe ReportGroupSortByType
a -> ListReportGroups
s {$sel:sortBy:ListReportGroups' :: Maybe ReportGroupSortByType
sortBy = Maybe ReportGroupSortByType
a} :: ListReportGroups)

-- | Used to specify the order to sort the list of returned report groups.
-- Valid values are @ASCENDING@ and @DESCENDING@.
listReportGroups_sortOrder :: Lens.Lens' ListReportGroups (Prelude.Maybe SortOrderType)
listReportGroups_sortOrder :: Lens' ListReportGroups (Maybe SortOrderType)
listReportGroups_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportGroups' {Maybe SortOrderType
sortOrder :: Maybe SortOrderType
$sel:sortOrder:ListReportGroups' :: ListReportGroups -> Maybe SortOrderType
sortOrder} -> Maybe SortOrderType
sortOrder) (\s :: ListReportGroups
s@ListReportGroups' {} Maybe SortOrderType
a -> ListReportGroups
s {$sel:sortOrder:ListReportGroups' :: Maybe SortOrderType
sortOrder = Maybe SortOrderType
a} :: ListReportGroups)

instance Core.AWSPager ListReportGroups where
  page :: ListReportGroups
-> AWSResponse ListReportGroups -> Maybe ListReportGroups
page ListReportGroups
rq AWSResponse ListReportGroups
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListReportGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListReportGroupsResponse (Maybe Text)
listReportGroupsResponse_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 ListReportGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListReportGroupsResponse (Maybe (NonEmpty Text))
listReportGroupsResponse_reportGroups
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to forall l. IsList l => l -> [Item l]
Prelude.toList
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListReportGroups
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListReportGroups (Maybe Text)
listReportGroups_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListReportGroups
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListReportGroupsResponse (Maybe Text)
listReportGroupsResponse_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 ListReportGroups where
  type
    AWSResponse ListReportGroups =
      ListReportGroupsResponse
  request :: (Service -> Service)
-> ListReportGroups -> Request ListReportGroups
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListReportGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListReportGroups)))
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 (NonEmpty Text) -> Int -> ListReportGroupsResponse
ListReportGroupsResponse'
            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
"reportGroups")
            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 ListReportGroups where
  hashWithSalt :: Int -> ListReportGroups -> Int
hashWithSalt Int
_salt ListReportGroups' {Maybe Natural
Maybe Text
Maybe ReportGroupSortByType
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
sortBy :: Maybe ReportGroupSortByType
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sortOrder:ListReportGroups' :: ListReportGroups -> Maybe SortOrderType
$sel:sortBy:ListReportGroups' :: ListReportGroups -> Maybe ReportGroupSortByType
$sel:nextToken:ListReportGroups' :: ListReportGroups -> Maybe Text
$sel:maxResults:ListReportGroups' :: ListReportGroups -> 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` Maybe ReportGroupSortByType
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrderType
sortOrder

instance Prelude.NFData ListReportGroups where
  rnf :: ListReportGroups -> ()
rnf ListReportGroups' {Maybe Natural
Maybe Text
Maybe ReportGroupSortByType
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
sortBy :: Maybe ReportGroupSortByType
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sortOrder:ListReportGroups' :: ListReportGroups -> Maybe SortOrderType
$sel:sortBy:ListReportGroups' :: ListReportGroups -> Maybe ReportGroupSortByType
$sel:nextToken:ListReportGroups' :: ListReportGroups -> Maybe Text
$sel:maxResults:ListReportGroups' :: ListReportGroups -> 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 Maybe ReportGroupSortByType
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrderType
sortOrder

instance Data.ToHeaders ListReportGroups where
  toHeaders :: ListReportGroups -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeBuild_20161006.ListReportGroups" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListReportGroups where
  toJSON :: ListReportGroups -> Value
toJSON ListReportGroups' {Maybe Natural
Maybe Text
Maybe ReportGroupSortByType
Maybe SortOrderType
sortOrder :: Maybe SortOrderType
sortBy :: Maybe ReportGroupSortByType
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sortOrder:ListReportGroups' :: ListReportGroups -> Maybe SortOrderType
$sel:sortBy:ListReportGroups' :: ListReportGroups -> Maybe ReportGroupSortByType
$sel:nextToken:ListReportGroups' :: ListReportGroups -> Maybe Text
$sel:maxResults:ListReportGroups' :: ListReportGroups -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"sortBy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReportGroupSortByType
sortBy,
            (Key
"sortOrder" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrderType
sortOrder
          ]
      )

instance Data.ToPath ListReportGroups where
  toPath :: ListReportGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListReportGroupsResponse' smart constructor.
data ListReportGroupsResponse = ListReportGroupsResponse'
  { -- | During a previous call, the maximum number of items that can be returned
    -- is the value specified in @maxResults@. If there more items in the list,
    -- then a unique string called a /nextToken/ is returned. To get the next
    -- batch of items in the list, call this operation again, adding the next
    -- token to the call. To get all of the items in the list, keep calling
    -- this operation with each subsequent next token that is returned, until
    -- no more next tokens are returned.
    ListReportGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of ARNs for the report groups in the current Amazon Web
    -- Services account.
    ListReportGroupsResponse -> Maybe (NonEmpty Text)
reportGroups :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The response's http status code.
    ListReportGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListReportGroupsResponse -> ListReportGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReportGroupsResponse -> ListReportGroupsResponse -> Bool
$c/= :: ListReportGroupsResponse -> ListReportGroupsResponse -> Bool
== :: ListReportGroupsResponse -> ListReportGroupsResponse -> Bool
$c== :: ListReportGroupsResponse -> ListReportGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListReportGroupsResponse]
ReadPrec ListReportGroupsResponse
Int -> ReadS ListReportGroupsResponse
ReadS [ListReportGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReportGroupsResponse]
$creadListPrec :: ReadPrec [ListReportGroupsResponse]
readPrec :: ReadPrec ListReportGroupsResponse
$creadPrec :: ReadPrec ListReportGroupsResponse
readList :: ReadS [ListReportGroupsResponse]
$creadList :: ReadS [ListReportGroupsResponse]
readsPrec :: Int -> ReadS ListReportGroupsResponse
$creadsPrec :: Int -> ReadS ListReportGroupsResponse
Prelude.Read, Int -> ListReportGroupsResponse -> ShowS
[ListReportGroupsResponse] -> ShowS
ListReportGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReportGroupsResponse] -> ShowS
$cshowList :: [ListReportGroupsResponse] -> ShowS
show :: ListReportGroupsResponse -> String
$cshow :: ListReportGroupsResponse -> String
showsPrec :: Int -> ListReportGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListReportGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListReportGroupsResponse x -> ListReportGroupsResponse
forall x.
ListReportGroupsResponse -> Rep ListReportGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListReportGroupsResponse x -> ListReportGroupsResponse
$cfrom :: forall x.
ListReportGroupsResponse -> Rep ListReportGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListReportGroupsResponse' 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', 'listReportGroupsResponse_nextToken' - During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
--
-- 'reportGroups', 'listReportGroupsResponse_reportGroups' - The list of ARNs for the report groups in the current Amazon Web
-- Services account.
--
-- 'httpStatus', 'listReportGroupsResponse_httpStatus' - The response's http status code.
newListReportGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListReportGroupsResponse
newListReportGroupsResponse :: Int -> ListReportGroupsResponse
newListReportGroupsResponse Int
pHttpStatus_ =
  ListReportGroupsResponse'
    { $sel:nextToken:ListReportGroupsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:reportGroups:ListReportGroupsResponse' :: Maybe (NonEmpty Text)
reportGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListReportGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | During a previous call, the maximum number of items that can be returned
-- is the value specified in @maxResults@. If there more items in the list,
-- then a unique string called a /nextToken/ is returned. To get the next
-- batch of items in the list, call this operation again, adding the next
-- token to the call. To get all of the items in the list, keep calling
-- this operation with each subsequent next token that is returned, until
-- no more next tokens are returned.
listReportGroupsResponse_nextToken :: Lens.Lens' ListReportGroupsResponse (Prelude.Maybe Prelude.Text)
listReportGroupsResponse_nextToken :: Lens' ListReportGroupsResponse (Maybe Text)
listReportGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReportGroupsResponse' :: ListReportGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReportGroupsResponse
s@ListReportGroupsResponse' {} Maybe Text
a -> ListReportGroupsResponse
s {$sel:nextToken:ListReportGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListReportGroupsResponse)

-- | The list of ARNs for the report groups in the current Amazon Web
-- Services account.
listReportGroupsResponse_reportGroups :: Lens.Lens' ListReportGroupsResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listReportGroupsResponse_reportGroups :: Lens' ListReportGroupsResponse (Maybe (NonEmpty Text))
listReportGroupsResponse_reportGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReportGroupsResponse' {Maybe (NonEmpty Text)
reportGroups :: Maybe (NonEmpty Text)
$sel:reportGroups:ListReportGroupsResponse' :: ListReportGroupsResponse -> Maybe (NonEmpty Text)
reportGroups} -> Maybe (NonEmpty Text)
reportGroups) (\s :: ListReportGroupsResponse
s@ListReportGroupsResponse' {} Maybe (NonEmpty Text)
a -> ListReportGroupsResponse
s {$sel:reportGroups:ListReportGroupsResponse' :: Maybe (NonEmpty Text)
reportGroups = Maybe (NonEmpty Text)
a} :: ListReportGroupsResponse) 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

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

instance Prelude.NFData ListReportGroupsResponse where
  rnf :: ListReportGroupsResponse -> ()
rnf ListReportGroupsResponse' {Int
Maybe (NonEmpty Text)
Maybe Text
httpStatus :: Int
reportGroups :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
$sel:httpStatus:ListReportGroupsResponse' :: ListReportGroupsResponse -> Int
$sel:reportGroups:ListReportGroupsResponse' :: ListReportGroupsResponse -> Maybe (NonEmpty Text)
$sel:nextToken:ListReportGroupsResponse' :: ListReportGroupsResponse -> 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 (NonEmpty Text)
reportGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus