{-# 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-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)
--
-- 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_sortOrder,
    listBuildBatches_nextToken,
    listBuildBatches_filter,
    listBuildBatches_maxResults,

    -- * 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.Lens as Lens
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'
  { -- | 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,
    -- | 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,
    -- | 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
  }
  deriving (ListBuildBatches -> ListBuildBatches -> Bool
(ListBuildBatches -> ListBuildBatches -> Bool)
-> (ListBuildBatches -> ListBuildBatches -> Bool)
-> Eq ListBuildBatches
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]
(Int -> ReadS ListBuildBatches)
-> ReadS [ListBuildBatches]
-> ReadPrec ListBuildBatches
-> ReadPrec [ListBuildBatches]
-> Read 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
(Int -> ListBuildBatches -> ShowS)
-> (ListBuildBatches -> String)
-> ([ListBuildBatches] -> ShowS)
-> Show ListBuildBatches
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. ListBuildBatches -> Rep ListBuildBatches x)
-> (forall x. Rep ListBuildBatches x -> ListBuildBatches)
-> Generic ListBuildBatches
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:
--
-- '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.
--
-- '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.
--
-- 'filter'', 'listBuildBatches_filter' - A @BuildBatchFilter@ object that specifies the filters for the search.
--
-- 'maxResults', 'listBuildBatches_maxResults' - The maximum number of results to return.
newListBuildBatches ::
  ListBuildBatches
newListBuildBatches :: ListBuildBatches
newListBuildBatches =
  ListBuildBatches' :: Maybe SortOrderType
-> Maybe Text
-> Maybe BuildBatchFilter
-> Maybe Natural
-> ListBuildBatches
ListBuildBatches'
    { $sel:sortOrder:ListBuildBatches' :: Maybe SortOrderType
sortOrder = Maybe SortOrderType
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBuildBatches' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListBuildBatches' :: Maybe BuildBatchFilter
filter' = Maybe BuildBatchFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListBuildBatches' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe SortOrderType -> f (Maybe SortOrderType))
-> ListBuildBatches -> f ListBuildBatches
listBuildBatches_sortOrder = (ListBuildBatches -> Maybe SortOrderType)
-> (ListBuildBatches -> Maybe SortOrderType -> ListBuildBatches)
-> Lens
     ListBuildBatches
     ListBuildBatches
     (Maybe SortOrderType)
     (Maybe SortOrderType)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListBuildBatches -> f ListBuildBatches
listBuildBatches_nextToken = (ListBuildBatches -> Maybe Text)
-> (ListBuildBatches -> Maybe Text -> ListBuildBatches)
-> Lens ListBuildBatches ListBuildBatches (Maybe Text) (Maybe Text)
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)

-- | A @BuildBatchFilter@ object that specifies the filters for the search.
listBuildBatches_filter :: Lens.Lens' ListBuildBatches (Prelude.Maybe BuildBatchFilter)
listBuildBatches_filter :: (Maybe BuildBatchFilter -> f (Maybe BuildBatchFilter))
-> ListBuildBatches -> f ListBuildBatches
listBuildBatches_filter = (ListBuildBatches -> Maybe BuildBatchFilter)
-> (ListBuildBatches -> Maybe BuildBatchFilter -> ListBuildBatches)
-> Lens
     ListBuildBatches
     ListBuildBatches
     (Maybe BuildBatchFilter)
     (Maybe BuildBatchFilter)
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 :: (Maybe Natural -> f (Maybe Natural))
-> ListBuildBatches -> f ListBuildBatches
listBuildBatches_maxResults = (ListBuildBatches -> Maybe Natural)
-> (ListBuildBatches -> Maybe Natural -> ListBuildBatches)
-> Lens
     ListBuildBatches ListBuildBatches (Maybe Natural) (Maybe Natural)
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)

instance Core.AWSPager ListBuildBatches where
  page :: ListBuildBatches
-> AWSResponse ListBuildBatches -> Maybe ListBuildBatches
page ListBuildBatches
rq AWSResponse ListBuildBatches
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBuildBatches
ListBuildBatchesResponse
rs
            ListBuildBatchesResponse
-> Getting (First Text) ListBuildBatchesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListBuildBatchesResponse
-> Const (First Text) ListBuildBatchesResponse
Lens' ListBuildBatchesResponse (Maybe Text)
listBuildBatchesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListBuildBatchesResponse
 -> Const (First Text) ListBuildBatchesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListBuildBatchesResponse 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 ListBuildBatches
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBuildBatches
ListBuildBatchesResponse
rs
            ListBuildBatchesResponse
-> Getting (First [Text]) ListBuildBatchesResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListBuildBatchesResponse
-> Const (First [Text]) ListBuildBatchesResponse
Lens' ListBuildBatchesResponse (Maybe [Text])
listBuildBatchesResponse_ids ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListBuildBatchesResponse
 -> Const (First [Text]) ListBuildBatchesResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListBuildBatchesResponse [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 ListBuildBatches
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListBuildBatches -> Maybe ListBuildBatches
forall a. a -> Maybe a
Prelude.Just (ListBuildBatches -> Maybe ListBuildBatches)
-> ListBuildBatches -> Maybe ListBuildBatches
forall a b. (a -> b) -> a -> b
Prelude.$
        ListBuildBatches
rq
          ListBuildBatches
-> (ListBuildBatches -> ListBuildBatches) -> ListBuildBatches
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListBuildBatches -> Identity ListBuildBatches
Lens ListBuildBatches ListBuildBatches (Maybe Text) (Maybe Text)
listBuildBatches_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListBuildBatches -> Identity ListBuildBatches)
-> Maybe Text -> ListBuildBatches -> ListBuildBatches
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListBuildBatches
ListBuildBatchesResponse
rs
          ListBuildBatchesResponse
-> Getting (First Text) ListBuildBatchesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListBuildBatchesResponse
-> Const (First Text) ListBuildBatchesResponse
Lens' ListBuildBatchesResponse (Maybe Text)
listBuildBatchesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListBuildBatchesResponse
 -> Const (First Text) ListBuildBatchesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListBuildBatchesResponse 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 ListBuildBatches where
  type
    AWSResponse ListBuildBatches =
      ListBuildBatchesResponse
  request :: ListBuildBatches -> Request ListBuildBatches
request = Service -> ListBuildBatches -> Request ListBuildBatches
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListBuildBatches
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListBuildBatches)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListBuildBatches))
-> Logger
-> Service
-> Proxy ListBuildBatches
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListBuildBatches)))
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 [Text] -> Maybe Text -> Int -> ListBuildBatchesResponse
ListBuildBatchesResponse'
            (Maybe [Text] -> Maybe Text -> Int -> ListBuildBatchesResponse)
-> Either String (Maybe [Text])
-> Either String (Maybe Text -> Int -> ListBuildBatchesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ids" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListBuildBatchesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListBuildBatchesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either String (Int -> ListBuildBatchesResponse)
-> Either String Int -> Either String ListBuildBatchesResponse
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 ListBuildBatches

instance Prelude.NFData ListBuildBatches

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

instance Core.ToJSON ListBuildBatches where
  toJSON :: ListBuildBatches -> Value
toJSON ListBuildBatches' {Maybe Natural
Maybe Text
Maybe SortOrderType
Maybe BuildBatchFilter
maxResults :: Maybe Natural
filter' :: Maybe BuildBatchFilter
nextToken :: Maybe Text
sortOrder :: Maybe SortOrderType
$sel:maxResults:ListBuildBatches' :: ListBuildBatches -> Maybe Natural
$sel:filter':ListBuildBatches' :: ListBuildBatches -> Maybe BuildBatchFilter
$sel:nextToken:ListBuildBatches' :: ListBuildBatches -> Maybe Text
$sel:sortOrder:ListBuildBatches' :: ListBuildBatches -> Maybe SortOrderType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"sortOrder" Text -> SortOrderType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortOrderType -> Pair) -> Maybe SortOrderType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrderType
sortOrder,
            (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
"filter" Text -> BuildBatchFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BuildBatchFilter -> Pair) -> Maybe BuildBatchFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BuildBatchFilter
filter',
            (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 ListBuildBatches where
  toPath :: ListBuildBatches -> ByteString
toPath = ByteString -> ListBuildBatches -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListBuildBatches where
  toQuery :: ListBuildBatches -> QueryString
toQuery = QueryString -> ListBuildBatches -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(ListBuildBatchesResponse -> ListBuildBatchesResponse -> Bool)
-> (ListBuildBatchesResponse -> ListBuildBatchesResponse -> Bool)
-> Eq ListBuildBatchesResponse
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]
(Int -> ReadS ListBuildBatchesResponse)
-> ReadS [ListBuildBatchesResponse]
-> ReadPrec ListBuildBatchesResponse
-> ReadPrec [ListBuildBatchesResponse]
-> Read 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
(Int -> ListBuildBatchesResponse -> ShowS)
-> (ListBuildBatchesResponse -> String)
-> ([ListBuildBatchesResponse] -> ShowS)
-> Show ListBuildBatchesResponse
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.
 ListBuildBatchesResponse -> Rep ListBuildBatchesResponse x)
-> (forall x.
    Rep ListBuildBatchesResponse x -> ListBuildBatchesResponse)
-> Generic ListBuildBatchesResponse
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' :: Maybe [Text] -> Maybe Text -> Int -> ListBuildBatchesResponse
ListBuildBatchesResponse'
    { $sel:ids:ListBuildBatchesResponse' :: Maybe [Text]
ids = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBuildBatchesResponse' :: Maybe Text
nextToken = Maybe Text
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 :: (Maybe [Text] -> f (Maybe [Text]))
-> ListBuildBatchesResponse -> f ListBuildBatchesResponse
listBuildBatchesResponse_ids = (ListBuildBatchesResponse -> Maybe [Text])
-> (ListBuildBatchesResponse
    -> Maybe [Text] -> ListBuildBatchesResponse)
-> Lens' ListBuildBatchesResponse (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListBuildBatchesResponse -> f ListBuildBatchesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListBuildBatchesResponse
-> f ListBuildBatchesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
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 :: (Maybe Text -> f (Maybe Text))
-> ListBuildBatchesResponse -> f ListBuildBatchesResponse
listBuildBatchesResponse_nextToken = (ListBuildBatchesResponse -> Maybe Text)
-> (ListBuildBatchesResponse
    -> Maybe Text -> ListBuildBatchesResponse)
-> Lens' ListBuildBatchesResponse (Maybe Text)
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 :: (Int -> f Int)
-> ListBuildBatchesResponse -> f ListBuildBatchesResponse
listBuildBatchesResponse_httpStatus = (ListBuildBatchesResponse -> Int)
-> (ListBuildBatchesResponse -> Int -> ListBuildBatchesResponse)
-> Lens ListBuildBatchesResponse ListBuildBatchesResponse Int Int
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