{-# 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.ListBuildBatches
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the identifiers of your build batches in the current region.
--
-- This operation returns paginated results.
module Amazonka.CodeBuild.ListBuildBatches
  ( -- * Creating a Request
    ListBuildBatches (..),
    newListBuildBatches,

    -- * Request Lenses
    listBuildBatches_filter,
    listBuildBatches_maxResults,
    listBuildBatches_nextToken,
    listBuildBatches_sortOrder,

    -- * Destructuring the Response
    ListBuildBatchesResponse (..),
    newListBuildBatchesResponse,

    -- * Response Lenses
    listBuildBatchesResponse_ids,
    listBuildBatchesResponse_nextToken,
    listBuildBatchesResponse_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:/ 'newListBuildBatches' smart constructor.
data ListBuildBatches = ListBuildBatches'
  { -- | A @BuildBatchFilter@ object that specifies the filters for the search.
    ListBuildBatches -> Maybe BuildBatchFilter
filter' :: Prelude.Maybe BuildBatchFilter,
    -- | The maximum number of results to return.
    ListBuildBatches -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The @nextToken@ value returned from a previous call to
    -- @ListBuildBatches@. This specifies the next item to return. To return
    -- the beginning of the list, exclude this parameter.
    ListBuildBatches -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the sort order of the returned items. Valid values include:
    --
    -- -   @ASCENDING@: List the batch build identifiers in ascending order by
    --     identifier.
    --
    -- -   @DESCENDING@: List the batch build identifiers in descending order
    --     by identifier.
    ListBuildBatches -> Maybe SortOrderType
sortOrder :: Prelude.Maybe SortOrderType
  }
  deriving (ListBuildBatches -> ListBuildBatches -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBuildBatches -> ListBuildBatches -> Bool
$c/= :: ListBuildBatches -> ListBuildBatches -> Bool
== :: ListBuildBatches -> ListBuildBatches -> Bool
$c== :: ListBuildBatches -> ListBuildBatches -> Bool
Prelude.Eq, ReadPrec [ListBuildBatches]
ReadPrec ListBuildBatches
Int -> ReadS ListBuildBatches
ReadS [ListBuildBatches]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBuildBatches]
$creadListPrec :: ReadPrec [ListBuildBatches]
readPrec :: ReadPrec ListBuildBatches
$creadPrec :: ReadPrec ListBuildBatches
readList :: ReadS [ListBuildBatches]
$creadList :: ReadS [ListBuildBatches]
readsPrec :: Int -> ReadS ListBuildBatches
$creadsPrec :: Int -> ReadS ListBuildBatches
Prelude.Read, Int -> ListBuildBatches -> ShowS
[ListBuildBatches] -> ShowS
ListBuildBatches -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBuildBatches] -> ShowS
$cshowList :: [ListBuildBatches] -> ShowS
show :: ListBuildBatches -> String
$cshow :: ListBuildBatches -> String
showsPrec :: Int -> ListBuildBatches -> ShowS
$cshowsPrec :: Int -> ListBuildBatches -> ShowS
Prelude.Show, forall x. Rep ListBuildBatches x -> ListBuildBatches
forall x. ListBuildBatches -> Rep ListBuildBatches x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBuildBatches x -> ListBuildBatches
$cfrom :: forall x. ListBuildBatches -> Rep ListBuildBatches x
Prelude.Generic)

-- |
-- Create a value of 'ListBuildBatches' 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:
--
-- 'filter'', 'listBuildBatches_filter' - A @BuildBatchFilter@ object that specifies the filters for the search.
--
-- 'maxResults', 'listBuildBatches_maxResults' - The maximum number of results to return.
--
-- 'nextToken', 'listBuildBatches_nextToken' - The @nextToken@ value returned from a previous call to
-- @ListBuildBatches@. This specifies the next item to return. To return
-- the beginning of the list, exclude this parameter.
--
-- 'sortOrder', 'listBuildBatches_sortOrder' - Specifies the sort order of the returned items. Valid values include:
--
-- -   @ASCENDING@: List the batch build identifiers in ascending order by
--     identifier.
--
-- -   @DESCENDING@: List the batch build identifiers in descending order
--     by identifier.
newListBuildBatches ::
  ListBuildBatches
newListBuildBatches :: ListBuildBatches
newListBuildBatches =
  ListBuildBatches'
    { $sel:filter':ListBuildBatches' :: Maybe BuildBatchFilter
filter' = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListBuildBatches' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBuildBatches' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListBuildBatches' :: Maybe SortOrderType
sortOrder = forall a. Maybe a
Prelude.Nothing
    }

-- | A @BuildBatchFilter@ object that specifies the filters for the search.
listBuildBatches_filter :: Lens.Lens' ListBuildBatches (Prelude.Maybe BuildBatchFilter)
listBuildBatches_filter :: Lens' ListBuildBatches (Maybe BuildBatchFilter)
listBuildBatches_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuildBatches' {Maybe BuildBatchFilter
filter' :: Maybe BuildBatchFilter
$sel:filter':ListBuildBatches' :: ListBuildBatches -> Maybe BuildBatchFilter
filter'} -> Maybe BuildBatchFilter
filter') (\s :: ListBuildBatches
s@ListBuildBatches' {} Maybe BuildBatchFilter
a -> ListBuildBatches
s {$sel:filter':ListBuildBatches' :: Maybe BuildBatchFilter
filter' = Maybe BuildBatchFilter
a} :: ListBuildBatches)

-- | The maximum number of results to return.
listBuildBatches_maxResults :: Lens.Lens' ListBuildBatches (Prelude.Maybe Prelude.Natural)
listBuildBatches_maxResults :: Lens' ListBuildBatches (Maybe Natural)
listBuildBatches_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuildBatches' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListBuildBatches' :: ListBuildBatches -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListBuildBatches
s@ListBuildBatches' {} Maybe Natural
a -> ListBuildBatches
s {$sel:maxResults:ListBuildBatches' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListBuildBatches)

-- | The @nextToken@ value returned from a previous call to
-- @ListBuildBatches@. This specifies the next item to return. To return
-- the beginning of the list, exclude this parameter.
listBuildBatches_nextToken :: Lens.Lens' ListBuildBatches (Prelude.Maybe Prelude.Text)
listBuildBatches_nextToken :: Lens' ListBuildBatches (Maybe Text)
listBuildBatches_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuildBatches' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBuildBatches' :: ListBuildBatches -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBuildBatches
s@ListBuildBatches' {} Maybe Text
a -> ListBuildBatches
s {$sel:nextToken:ListBuildBatches' :: Maybe Text
nextToken = Maybe Text
a} :: ListBuildBatches)

-- | Specifies the sort order of the returned items. Valid values include:
--
-- -   @ASCENDING@: List the batch build identifiers in ascending order by
--     identifier.
--
-- -   @DESCENDING@: List the batch build identifiers in descending order
--     by identifier.
listBuildBatches_sortOrder :: Lens.Lens' ListBuildBatches (Prelude.Maybe SortOrderType)
listBuildBatches_sortOrder :: Lens' ListBuildBatches (Maybe SortOrderType)
listBuildBatches_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuildBatches' {Maybe SortOrderType
sortOrder :: Maybe SortOrderType
$sel:sortOrder:ListBuildBatches' :: ListBuildBatches -> Maybe SortOrderType
sortOrder} -> Maybe SortOrderType
sortOrder) (\s :: ListBuildBatches
s@ListBuildBatches' {} Maybe SortOrderType
a -> ListBuildBatches
s {$sel:sortOrder:ListBuildBatches' :: Maybe SortOrderType
sortOrder = Maybe SortOrderType
a} :: ListBuildBatches)

instance Core.AWSPager ListBuildBatches where
  page :: ListBuildBatches
-> AWSResponse ListBuildBatches -> Maybe ListBuildBatches
page ListBuildBatches
rq AWSResponse ListBuildBatches
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBuildBatches
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBuildBatchesResponse (Maybe Text)
listBuildBatchesResponse_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 ListBuildBatches
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBuildBatchesResponse (Maybe [Text])
listBuildBatchesResponse_ids
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListBuildBatches
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListBuildBatches (Maybe Text)
listBuildBatches_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListBuildBatches
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBuildBatchesResponse (Maybe Text)
listBuildBatchesResponse_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 ListBuildBatches where
  type
    AWSResponse ListBuildBatches =
      ListBuildBatchesResponse
  request :: (Service -> Service)
-> ListBuildBatches -> Request ListBuildBatches
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 ListBuildBatches
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListBuildBatches)))
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 Text -> Int -> ListBuildBatchesResponse
ListBuildBatchesResponse'
            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
"ids" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListBuildBatches where
  hashWithSalt :: Int -> ListBuildBatches -> Int
hashWithSalt Int
_salt ListBuildBatches' {Maybe Natural
Maybe Text
Maybe SortOrderType
Maybe BuildBatchFilter
sortOrder :: Maybe SortOrderType
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe BuildBatchFilter
$sel:sortOrder:ListBuildBatches' :: ListBuildBatches -> Maybe SortOrderType
$sel:nextToken:ListBuildBatches' :: ListBuildBatches -> Maybe Text
$sel:maxResults:ListBuildBatches' :: ListBuildBatches -> Maybe Natural
$sel:filter':ListBuildBatches' :: ListBuildBatches -> Maybe BuildBatchFilter
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BuildBatchFilter
filter'
      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 SortOrderType
sortOrder

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

instance Data.ToHeaders ListBuildBatches where
  toHeaders :: ListBuildBatches -> 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.ListBuildBatches" ::
                          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 ListBuildBatches where
  toJSON :: ListBuildBatches -> Value
toJSON ListBuildBatches' {Maybe Natural
Maybe Text
Maybe SortOrderType
Maybe BuildBatchFilter
sortOrder :: Maybe SortOrderType
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe BuildBatchFilter
$sel:sortOrder:ListBuildBatches' :: ListBuildBatches -> Maybe SortOrderType
$sel:nextToken:ListBuildBatches' :: ListBuildBatches -> Maybe Text
$sel:maxResults:ListBuildBatches' :: ListBuildBatches -> Maybe Natural
$sel:filter':ListBuildBatches' :: ListBuildBatches -> Maybe BuildBatchFilter
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"filter" 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 BuildBatchFilter
filter',
            (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
"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 ListBuildBatches where
  toPath :: ListBuildBatches -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListBuildBatchesResponse' smart constructor.
data ListBuildBatchesResponse = ListBuildBatchesResponse'
  { -- | An array of strings that contains the batch build identifiers.
    ListBuildBatchesResponse -> Maybe [Text]
ids :: Prelude.Maybe [Prelude.Text],
    -- | If there are more items to return, this contains a token that is passed
    -- to a subsequent call to @ListBuildBatches@ to retrieve the next set of
    -- items.
    ListBuildBatchesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListBuildBatchesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBuildBatchesResponse -> ListBuildBatchesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBuildBatchesResponse -> ListBuildBatchesResponse -> Bool
$c/= :: ListBuildBatchesResponse -> ListBuildBatchesResponse -> Bool
== :: ListBuildBatchesResponse -> ListBuildBatchesResponse -> Bool
$c== :: ListBuildBatchesResponse -> ListBuildBatchesResponse -> Bool
Prelude.Eq, ReadPrec [ListBuildBatchesResponse]
ReadPrec ListBuildBatchesResponse
Int -> ReadS ListBuildBatchesResponse
ReadS [ListBuildBatchesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBuildBatchesResponse]
$creadListPrec :: ReadPrec [ListBuildBatchesResponse]
readPrec :: ReadPrec ListBuildBatchesResponse
$creadPrec :: ReadPrec ListBuildBatchesResponse
readList :: ReadS [ListBuildBatchesResponse]
$creadList :: ReadS [ListBuildBatchesResponse]
readsPrec :: Int -> ReadS ListBuildBatchesResponse
$creadsPrec :: Int -> ReadS ListBuildBatchesResponse
Prelude.Read, Int -> ListBuildBatchesResponse -> ShowS
[ListBuildBatchesResponse] -> ShowS
ListBuildBatchesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBuildBatchesResponse] -> ShowS
$cshowList :: [ListBuildBatchesResponse] -> ShowS
show :: ListBuildBatchesResponse -> String
$cshow :: ListBuildBatchesResponse -> String
showsPrec :: Int -> ListBuildBatchesResponse -> ShowS
$cshowsPrec :: Int -> ListBuildBatchesResponse -> ShowS
Prelude.Show, forall x.
Rep ListBuildBatchesResponse x -> ListBuildBatchesResponse
forall x.
ListBuildBatchesResponse -> Rep ListBuildBatchesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBuildBatchesResponse x -> ListBuildBatchesResponse
$cfrom :: forall x.
ListBuildBatchesResponse -> Rep ListBuildBatchesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBuildBatchesResponse' 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:
--
-- 'ids', 'listBuildBatchesResponse_ids' - An array of strings that contains the batch build identifiers.
--
-- 'nextToken', 'listBuildBatchesResponse_nextToken' - If there are more items to return, this contains a token that is passed
-- to a subsequent call to @ListBuildBatches@ to retrieve the next set of
-- items.
--
-- 'httpStatus', 'listBuildBatchesResponse_httpStatus' - The response's http status code.
newListBuildBatchesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBuildBatchesResponse
newListBuildBatchesResponse :: Int -> ListBuildBatchesResponse
newListBuildBatchesResponse Int
pHttpStatus_ =
  ListBuildBatchesResponse'
    { $sel:ids:ListBuildBatchesResponse' :: Maybe [Text]
ids = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBuildBatchesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListBuildBatchesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of strings that contains the batch build identifiers.
listBuildBatchesResponse_ids :: Lens.Lens' ListBuildBatchesResponse (Prelude.Maybe [Prelude.Text])
listBuildBatchesResponse_ids :: Lens' ListBuildBatchesResponse (Maybe [Text])
listBuildBatchesResponse_ids = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuildBatchesResponse' {Maybe [Text]
ids :: Maybe [Text]
$sel:ids:ListBuildBatchesResponse' :: ListBuildBatchesResponse -> Maybe [Text]
ids} -> Maybe [Text]
ids) (\s :: ListBuildBatchesResponse
s@ListBuildBatchesResponse' {} Maybe [Text]
a -> ListBuildBatchesResponse
s {$sel:ids:ListBuildBatchesResponse' :: Maybe [Text]
ids = Maybe [Text]
a} :: ListBuildBatchesResponse) 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

-- | If there are more items to return, this contains a token that is passed
-- to a subsequent call to @ListBuildBatches@ to retrieve the next set of
-- items.
listBuildBatchesResponse_nextToken :: Lens.Lens' ListBuildBatchesResponse (Prelude.Maybe Prelude.Text)
listBuildBatchesResponse_nextToken :: Lens' ListBuildBatchesResponse (Maybe Text)
listBuildBatchesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuildBatchesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBuildBatchesResponse' :: ListBuildBatchesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBuildBatchesResponse
s@ListBuildBatchesResponse' {} Maybe Text
a -> ListBuildBatchesResponse
s {$sel:nextToken:ListBuildBatchesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListBuildBatchesResponse)

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

instance Prelude.NFData ListBuildBatchesResponse where
  rnf :: ListBuildBatchesResponse -> ()
rnf ListBuildBatchesResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
ids :: Maybe [Text]
$sel:httpStatus:ListBuildBatchesResponse' :: ListBuildBatchesResponse -> Int
$sel:nextToken:ListBuildBatchesResponse' :: ListBuildBatchesResponse -> Maybe Text
$sel:ids:ListBuildBatchesResponse' :: ListBuildBatchesResponse -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
ids
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus