{-# 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.ListBuilds
-- 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)
--
-- Gets a list of build IDs, with each build ID representing a single
-- build.
--
-- This operation returns paginated results.
module Amazonka.CodeBuild.ListBuilds
  ( -- * Creating a Request
    ListBuilds (..),
    newListBuilds,

    -- * Request Lenses
    listBuilds_sortOrder,
    listBuilds_nextToken,

    -- * Destructuring the Response
    ListBuildsResponse (..),
    newListBuildsResponse,

    -- * Response Lenses
    listBuildsResponse_ids,
    listBuildsResponse_nextToken,
    listBuildsResponse_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:/ 'newListBuilds' smart constructor.
data ListBuilds = ListBuilds'
  { -- | The order to list build IDs. Valid values include:
    --
    -- -   @ASCENDING@: List the build IDs in ascending order by build ID.
    --
    -- -   @DESCENDING@: List the build IDs in descending order by build ID.
    ListBuilds -> Maybe SortOrderType
sortOrder :: Prelude.Maybe SortOrderType,
    -- | During a previous call, if there are more than 100 items in the list,
    -- only the first 100 items are returned, along with a unique string called
    -- a /nextToken/. 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.
    ListBuilds -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListBuilds -> ListBuilds -> Bool
(ListBuilds -> ListBuilds -> Bool)
-> (ListBuilds -> ListBuilds -> Bool) -> Eq ListBuilds
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBuilds -> ListBuilds -> Bool
$c/= :: ListBuilds -> ListBuilds -> Bool
== :: ListBuilds -> ListBuilds -> Bool
$c== :: ListBuilds -> ListBuilds -> Bool
Prelude.Eq, ReadPrec [ListBuilds]
ReadPrec ListBuilds
Int -> ReadS ListBuilds
ReadS [ListBuilds]
(Int -> ReadS ListBuilds)
-> ReadS [ListBuilds]
-> ReadPrec ListBuilds
-> ReadPrec [ListBuilds]
-> Read ListBuilds
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBuilds]
$creadListPrec :: ReadPrec [ListBuilds]
readPrec :: ReadPrec ListBuilds
$creadPrec :: ReadPrec ListBuilds
readList :: ReadS [ListBuilds]
$creadList :: ReadS [ListBuilds]
readsPrec :: Int -> ReadS ListBuilds
$creadsPrec :: Int -> ReadS ListBuilds
Prelude.Read, Int -> ListBuilds -> ShowS
[ListBuilds] -> ShowS
ListBuilds -> String
(Int -> ListBuilds -> ShowS)
-> (ListBuilds -> String)
-> ([ListBuilds] -> ShowS)
-> Show ListBuilds
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBuilds] -> ShowS
$cshowList :: [ListBuilds] -> ShowS
show :: ListBuilds -> String
$cshow :: ListBuilds -> String
showsPrec :: Int -> ListBuilds -> ShowS
$cshowsPrec :: Int -> ListBuilds -> ShowS
Prelude.Show, (forall x. ListBuilds -> Rep ListBuilds x)
-> (forall x. Rep ListBuilds x -> ListBuilds) -> Generic ListBuilds
forall x. Rep ListBuilds x -> ListBuilds
forall x. ListBuilds -> Rep ListBuilds x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBuilds x -> ListBuilds
$cfrom :: forall x. ListBuilds -> Rep ListBuilds x
Prelude.Generic)

-- |
-- Create a value of 'ListBuilds' 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', 'listBuilds_sortOrder' - The order to list build IDs. Valid values include:
--
-- -   @ASCENDING@: List the build IDs in ascending order by build ID.
--
-- -   @DESCENDING@: List the build IDs in descending order by build ID.
--
-- 'nextToken', 'listBuilds_nextToken' - During a previous call, if there are more than 100 items in the list,
-- only the first 100 items are returned, along with a unique string called
-- a /nextToken/. 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.
newListBuilds ::
  ListBuilds
newListBuilds :: ListBuilds
newListBuilds =
  ListBuilds' :: Maybe SortOrderType -> Maybe Text -> ListBuilds
ListBuilds'
    { $sel:sortOrder:ListBuilds' :: Maybe SortOrderType
sortOrder = Maybe SortOrderType
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBuilds' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The order to list build IDs. Valid values include:
--
-- -   @ASCENDING@: List the build IDs in ascending order by build ID.
--
-- -   @DESCENDING@: List the build IDs in descending order by build ID.
listBuilds_sortOrder :: Lens.Lens' ListBuilds (Prelude.Maybe SortOrderType)
listBuilds_sortOrder :: (Maybe SortOrderType -> f (Maybe SortOrderType))
-> ListBuilds -> f ListBuilds
listBuilds_sortOrder = (ListBuilds -> Maybe SortOrderType)
-> (ListBuilds -> Maybe SortOrderType -> ListBuilds)
-> Lens
     ListBuilds ListBuilds (Maybe SortOrderType) (Maybe SortOrderType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuilds' {Maybe SortOrderType
sortOrder :: Maybe SortOrderType
$sel:sortOrder:ListBuilds' :: ListBuilds -> Maybe SortOrderType
sortOrder} -> Maybe SortOrderType
sortOrder) (\s :: ListBuilds
s@ListBuilds' {} Maybe SortOrderType
a -> ListBuilds
s {$sel:sortOrder:ListBuilds' :: Maybe SortOrderType
sortOrder = Maybe SortOrderType
a} :: ListBuilds)

-- | During a previous call, if there are more than 100 items in the list,
-- only the first 100 items are returned, along with a unique string called
-- a /nextToken/. 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.
listBuilds_nextToken :: Lens.Lens' ListBuilds (Prelude.Maybe Prelude.Text)
listBuilds_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListBuilds -> f ListBuilds
listBuilds_nextToken = (ListBuilds -> Maybe Text)
-> (ListBuilds -> Maybe Text -> ListBuilds)
-> Lens ListBuilds ListBuilds (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuilds' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBuilds' :: ListBuilds -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBuilds
s@ListBuilds' {} Maybe Text
a -> ListBuilds
s {$sel:nextToken:ListBuilds' :: Maybe Text
nextToken = Maybe Text
a} :: ListBuilds)

instance Core.AWSPager ListBuilds where
  page :: ListBuilds -> AWSResponse ListBuilds -> Maybe ListBuilds
page ListBuilds
rq AWSResponse ListBuilds
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBuilds
ListBuildsResponse
rs
            ListBuildsResponse
-> Getting (First Text) ListBuildsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListBuildsResponse -> Const (First Text) ListBuildsResponse
Lens' ListBuildsResponse (Maybe Text)
listBuildsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListBuildsResponse -> Const (First Text) ListBuildsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListBuildsResponse 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 ListBuilds
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBuilds
ListBuildsResponse
rs
            ListBuildsResponse
-> Getting (First [Text]) ListBuildsResponse [Text] -> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe (NonEmpty Text)
 -> Const (First [Text]) (Maybe (NonEmpty Text)))
-> ListBuildsResponse -> Const (First [Text]) ListBuildsResponse
Lens' ListBuildsResponse (Maybe (NonEmpty Text))
listBuildsResponse_ids ((Maybe (NonEmpty Text)
  -> Const (First [Text]) (Maybe (NonEmpty Text)))
 -> ListBuildsResponse -> Const (First [Text]) ListBuildsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe (NonEmpty Text)
    -> Const (First [Text]) (Maybe (NonEmpty Text)))
-> Getting (First [Text]) ListBuildsResponse [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> Const (First [Text]) (NonEmpty Text))
-> Maybe (NonEmpty Text)
-> Const (First [Text]) (Maybe (NonEmpty Text))
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
              ((NonEmpty Text -> Const (First [Text]) (NonEmpty Text))
 -> Maybe (NonEmpty Text)
 -> Const (First [Text]) (Maybe (NonEmpty Text)))
-> (([Text] -> Const (First [Text]) [Text])
    -> NonEmpty Text -> Const (First [Text]) (NonEmpty Text))
-> ([Text] -> Const (First [Text]) [Text])
-> Maybe (NonEmpty Text)
-> Const (First [Text]) (Maybe (NonEmpty Text))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> [Text])
-> ([Text] -> Const (First [Text]) [Text])
-> NonEmpty Text
-> Const (First [Text]) (NonEmpty Text)
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NonEmpty Text -> [Text]
forall l. IsList l => l -> [Item l]
Prelude.toList
        ) =
      Maybe ListBuilds
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListBuilds -> Maybe ListBuilds
forall a. a -> Maybe a
Prelude.Just (ListBuilds -> Maybe ListBuilds) -> ListBuilds -> Maybe ListBuilds
forall a b. (a -> b) -> a -> b
Prelude.$
        ListBuilds
rq
          ListBuilds -> (ListBuilds -> ListBuilds) -> ListBuilds
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListBuilds -> Identity ListBuilds
Lens ListBuilds ListBuilds (Maybe Text) (Maybe Text)
listBuilds_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListBuilds -> Identity ListBuilds)
-> Maybe Text -> ListBuilds -> ListBuilds
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListBuilds
ListBuildsResponse
rs
          ListBuildsResponse
-> Getting (First Text) ListBuildsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListBuildsResponse -> Const (First Text) ListBuildsResponse
Lens' ListBuildsResponse (Maybe Text)
listBuildsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListBuildsResponse -> Const (First Text) ListBuildsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListBuildsResponse 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 ListBuilds where
  type AWSResponse ListBuilds = ListBuildsResponse
  request :: ListBuilds -> Request ListBuilds
request = Service -> ListBuilds -> Request ListBuilds
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListBuilds
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListBuilds)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListBuilds))
-> Logger
-> Service
-> Proxy ListBuilds
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListBuilds)))
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 (NonEmpty Text) -> Maybe Text -> Int -> ListBuildsResponse
ListBuildsResponse'
            (Maybe (NonEmpty Text) -> Maybe Text -> Int -> ListBuildsResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either String (Maybe Text -> Int -> ListBuildsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ids")
            Either String (Maybe Text -> Int -> ListBuildsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListBuildsResponse)
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 -> ListBuildsResponse)
-> Either String Int -> Either String ListBuildsResponse
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 ListBuilds

instance Prelude.NFData ListBuilds

instance Core.ToHeaders ListBuilds where
  toHeaders :: ListBuilds -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListBuilds -> 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.ListBuilds" ::
                          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 ListBuilds where
  toJSON :: ListBuilds -> Value
toJSON ListBuilds' {Maybe Text
Maybe SortOrderType
nextToken :: Maybe Text
sortOrder :: Maybe SortOrderType
$sel:nextToken:ListBuilds' :: ListBuilds -> Maybe Text
$sel:sortOrder:ListBuilds' :: ListBuilds -> 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
          ]
      )

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

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

-- | /See:/ 'newListBuildsResponse' smart constructor.
data ListBuildsResponse = ListBuildsResponse'
  { -- | A list of build IDs, with each build ID representing a single build.
    ListBuildsResponse -> Maybe (NonEmpty Text)
ids :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | If there are more than 100 items in the list, only the first 100 items
    -- are returned, along with a unique string called a /nextToken/. To get
    -- the next batch of items in the list, call this operation again, adding
    -- the next token to the call.
    ListBuildsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListBuildsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBuildsResponse -> ListBuildsResponse -> Bool
(ListBuildsResponse -> ListBuildsResponse -> Bool)
-> (ListBuildsResponse -> ListBuildsResponse -> Bool)
-> Eq ListBuildsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBuildsResponse -> ListBuildsResponse -> Bool
$c/= :: ListBuildsResponse -> ListBuildsResponse -> Bool
== :: ListBuildsResponse -> ListBuildsResponse -> Bool
$c== :: ListBuildsResponse -> ListBuildsResponse -> Bool
Prelude.Eq, ReadPrec [ListBuildsResponse]
ReadPrec ListBuildsResponse
Int -> ReadS ListBuildsResponse
ReadS [ListBuildsResponse]
(Int -> ReadS ListBuildsResponse)
-> ReadS [ListBuildsResponse]
-> ReadPrec ListBuildsResponse
-> ReadPrec [ListBuildsResponse]
-> Read ListBuildsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBuildsResponse]
$creadListPrec :: ReadPrec [ListBuildsResponse]
readPrec :: ReadPrec ListBuildsResponse
$creadPrec :: ReadPrec ListBuildsResponse
readList :: ReadS [ListBuildsResponse]
$creadList :: ReadS [ListBuildsResponse]
readsPrec :: Int -> ReadS ListBuildsResponse
$creadsPrec :: Int -> ReadS ListBuildsResponse
Prelude.Read, Int -> ListBuildsResponse -> ShowS
[ListBuildsResponse] -> ShowS
ListBuildsResponse -> String
(Int -> ListBuildsResponse -> ShowS)
-> (ListBuildsResponse -> String)
-> ([ListBuildsResponse] -> ShowS)
-> Show ListBuildsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBuildsResponse] -> ShowS
$cshowList :: [ListBuildsResponse] -> ShowS
show :: ListBuildsResponse -> String
$cshow :: ListBuildsResponse -> String
showsPrec :: Int -> ListBuildsResponse -> ShowS
$cshowsPrec :: Int -> ListBuildsResponse -> ShowS
Prelude.Show, (forall x. ListBuildsResponse -> Rep ListBuildsResponse x)
-> (forall x. Rep ListBuildsResponse x -> ListBuildsResponse)
-> Generic ListBuildsResponse
forall x. Rep ListBuildsResponse x -> ListBuildsResponse
forall x. ListBuildsResponse -> Rep ListBuildsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBuildsResponse x -> ListBuildsResponse
$cfrom :: forall x. ListBuildsResponse -> Rep ListBuildsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBuildsResponse' 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', 'listBuildsResponse_ids' - A list of build IDs, with each build ID representing a single build.
--
-- 'nextToken', 'listBuildsResponse_nextToken' - If there are more than 100 items in the list, only the first 100 items
-- are returned, along with a unique string called a /nextToken/. To get
-- the next batch of items in the list, call this operation again, adding
-- the next token to the call.
--
-- 'httpStatus', 'listBuildsResponse_httpStatus' - The response's http status code.
newListBuildsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBuildsResponse
newListBuildsResponse :: Int -> ListBuildsResponse
newListBuildsResponse Int
pHttpStatus_ =
  ListBuildsResponse' :: Maybe (NonEmpty Text) -> Maybe Text -> Int -> ListBuildsResponse
ListBuildsResponse'
    { $sel:ids:ListBuildsResponse' :: Maybe (NonEmpty Text)
ids = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBuildsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListBuildsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of build IDs, with each build ID representing a single build.
listBuildsResponse_ids :: Lens.Lens' ListBuildsResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listBuildsResponse_ids :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListBuildsResponse -> f ListBuildsResponse
listBuildsResponse_ids = (ListBuildsResponse -> Maybe (NonEmpty Text))
-> (ListBuildsResponse
    -> Maybe (NonEmpty Text) -> ListBuildsResponse)
-> Lens' ListBuildsResponse (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuildsResponse' {Maybe (NonEmpty Text)
ids :: Maybe (NonEmpty Text)
$sel:ids:ListBuildsResponse' :: ListBuildsResponse -> Maybe (NonEmpty Text)
ids} -> Maybe (NonEmpty Text)
ids) (\s :: ListBuildsResponse
s@ListBuildsResponse' {} Maybe (NonEmpty Text)
a -> ListBuildsResponse
s {$sel:ids:ListBuildsResponse' :: Maybe (NonEmpty Text)
ids = Maybe (NonEmpty Text)
a} :: ListBuildsResponse) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ListBuildsResponse -> f ListBuildsResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ListBuildsResponse
-> f ListBuildsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If there are more than 100 items in the list, only the first 100 items
-- are returned, along with a unique string called a /nextToken/. To get
-- the next batch of items in the list, call this operation again, adding
-- the next token to the call.
listBuildsResponse_nextToken :: Lens.Lens' ListBuildsResponse (Prelude.Maybe Prelude.Text)
listBuildsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListBuildsResponse -> f ListBuildsResponse
listBuildsResponse_nextToken = (ListBuildsResponse -> Maybe Text)
-> (ListBuildsResponse -> Maybe Text -> ListBuildsResponse)
-> Lens' ListBuildsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBuildsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListBuildsResponse' :: ListBuildsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListBuildsResponse
s@ListBuildsResponse' {} Maybe Text
a -> ListBuildsResponse
s {$sel:nextToken:ListBuildsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListBuildsResponse)

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

instance Prelude.NFData ListBuildsResponse