{-# 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.M2.ListBatchJobDefinitions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all the available batch job definitions based on the batch job
-- resources uploaded during the application creation. You can use the
-- batch job definitions in the list to start a batch job.
--
-- This operation returns paginated results.
module Amazonka.M2.ListBatchJobDefinitions
  ( -- * Creating a Request
    ListBatchJobDefinitions (..),
    newListBatchJobDefinitions,

    -- * Request Lenses
    listBatchJobDefinitions_maxResults,
    listBatchJobDefinitions_nextToken,
    listBatchJobDefinitions_prefix,
    listBatchJobDefinitions_applicationId,

    -- * Destructuring the Response
    ListBatchJobDefinitionsResponse (..),
    newListBatchJobDefinitionsResponse,

    -- * Response Lenses
    listBatchJobDefinitionsResponse_nextToken,
    listBatchJobDefinitionsResponse_httpStatus,
    listBatchJobDefinitionsResponse_batchJobDefinitions,
  )
where

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

-- | /See:/ 'newListBatchJobDefinitions' smart constructor.
data ListBatchJobDefinitions = ListBatchJobDefinitions'
  { -- | The maximum number of batch job definitions to return.
    ListBatchJobDefinitions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A pagination token returned from a previous call to this operation. This
    -- specifies the next item to return. To return to the beginning of the
    -- list, exclude this parameter.
    ListBatchJobDefinitions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | If the batch job definition is a FileBatchJobDefinition, the prefix
    -- allows you to search on the file names of FileBatchJobDefinitions.
    ListBatchJobDefinitions -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the application.
    ListBatchJobDefinitions -> Text
applicationId :: Prelude.Text
  }
  deriving (ListBatchJobDefinitions -> ListBatchJobDefinitions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBatchJobDefinitions -> ListBatchJobDefinitions -> Bool
$c/= :: ListBatchJobDefinitions -> ListBatchJobDefinitions -> Bool
== :: ListBatchJobDefinitions -> ListBatchJobDefinitions -> Bool
$c== :: ListBatchJobDefinitions -> ListBatchJobDefinitions -> Bool
Prelude.Eq, ReadPrec [ListBatchJobDefinitions]
ReadPrec ListBatchJobDefinitions
Int -> ReadS ListBatchJobDefinitions
ReadS [ListBatchJobDefinitions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBatchJobDefinitions]
$creadListPrec :: ReadPrec [ListBatchJobDefinitions]
readPrec :: ReadPrec ListBatchJobDefinitions
$creadPrec :: ReadPrec ListBatchJobDefinitions
readList :: ReadS [ListBatchJobDefinitions]
$creadList :: ReadS [ListBatchJobDefinitions]
readsPrec :: Int -> ReadS ListBatchJobDefinitions
$creadsPrec :: Int -> ReadS ListBatchJobDefinitions
Prelude.Read, Int -> ListBatchJobDefinitions -> ShowS
[ListBatchJobDefinitions] -> ShowS
ListBatchJobDefinitions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBatchJobDefinitions] -> ShowS
$cshowList :: [ListBatchJobDefinitions] -> ShowS
show :: ListBatchJobDefinitions -> String
$cshow :: ListBatchJobDefinitions -> String
showsPrec :: Int -> ListBatchJobDefinitions -> ShowS
$cshowsPrec :: Int -> ListBatchJobDefinitions -> ShowS
Prelude.Show, forall x. Rep ListBatchJobDefinitions x -> ListBatchJobDefinitions
forall x. ListBatchJobDefinitions -> Rep ListBatchJobDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBatchJobDefinitions x -> ListBatchJobDefinitions
$cfrom :: forall x. ListBatchJobDefinitions -> Rep ListBatchJobDefinitions x
Prelude.Generic)

-- |
-- Create a value of 'ListBatchJobDefinitions' 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', 'listBatchJobDefinitions_maxResults' - The maximum number of batch job definitions to return.
--
-- 'nextToken', 'listBatchJobDefinitions_nextToken' - A pagination token returned from a previous call to this operation. This
-- specifies the next item to return. To return to the beginning of the
-- list, exclude this parameter.
--
-- 'prefix', 'listBatchJobDefinitions_prefix' - If the batch job definition is a FileBatchJobDefinition, the prefix
-- allows you to search on the file names of FileBatchJobDefinitions.
--
-- 'applicationId', 'listBatchJobDefinitions_applicationId' - The identifier of the application.
newListBatchJobDefinitions ::
  -- | 'applicationId'
  Prelude.Text ->
  ListBatchJobDefinitions
newListBatchJobDefinitions :: Text -> ListBatchJobDefinitions
newListBatchJobDefinitions Text
pApplicationId_ =
  ListBatchJobDefinitions'
    { $sel:maxResults:ListBatchJobDefinitions' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListBatchJobDefinitions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:prefix:ListBatchJobDefinitions' :: Maybe Text
prefix = forall a. Maybe a
Prelude.Nothing,
      $sel:applicationId:ListBatchJobDefinitions' :: Text
applicationId = Text
pApplicationId_
    }

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

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

-- | If the batch job definition is a FileBatchJobDefinition, the prefix
-- allows you to search on the file names of FileBatchJobDefinitions.
listBatchJobDefinitions_prefix :: Lens.Lens' ListBatchJobDefinitions (Prelude.Maybe Prelude.Text)
listBatchJobDefinitions_prefix :: Lens' ListBatchJobDefinitions (Maybe Text)
listBatchJobDefinitions_prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBatchJobDefinitions' {Maybe Text
prefix :: Maybe Text
$sel:prefix:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: ListBatchJobDefinitions
s@ListBatchJobDefinitions' {} Maybe Text
a -> ListBatchJobDefinitions
s {$sel:prefix:ListBatchJobDefinitions' :: Maybe Text
prefix = Maybe Text
a} :: ListBatchJobDefinitions)

-- | The identifier of the application.
listBatchJobDefinitions_applicationId :: Lens.Lens' ListBatchJobDefinitions Prelude.Text
listBatchJobDefinitions_applicationId :: Lens' ListBatchJobDefinitions Text
listBatchJobDefinitions_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBatchJobDefinitions' {Text
applicationId :: Text
$sel:applicationId:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Text
applicationId} -> Text
applicationId) (\s :: ListBatchJobDefinitions
s@ListBatchJobDefinitions' {} Text
a -> ListBatchJobDefinitions
s {$sel:applicationId:ListBatchJobDefinitions' :: Text
applicationId = Text
a} :: ListBatchJobDefinitions)

instance Core.AWSPager ListBatchJobDefinitions where
  page :: ListBatchJobDefinitions
-> AWSResponse ListBatchJobDefinitions
-> Maybe ListBatchJobDefinitions
page ListBatchJobDefinitions
rq AWSResponse ListBatchJobDefinitions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListBatchJobDefinitions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBatchJobDefinitionsResponse (Maybe Text)
listBatchJobDefinitionsResponse_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 ListBatchJobDefinitions
rs
            forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListBatchJobDefinitionsResponse [BatchJobDefinition]
listBatchJobDefinitionsResponse_batchJobDefinitions
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListBatchJobDefinitions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListBatchJobDefinitions (Maybe Text)
listBatchJobDefinitions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListBatchJobDefinitions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListBatchJobDefinitionsResponse (Maybe Text)
listBatchJobDefinitionsResponse_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 ListBatchJobDefinitions where
  type
    AWSResponse ListBatchJobDefinitions =
      ListBatchJobDefinitionsResponse
  request :: (Service -> Service)
-> ListBatchJobDefinitions -> Request ListBatchJobDefinitions
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListBatchJobDefinitions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListBatchJobDefinitions)))
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
-> Int -> [BatchJobDefinition] -> ListBatchJobDefinitionsResponse
ListBatchJobDefinitionsResponse'
            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            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
"batchJobDefinitions"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListBatchJobDefinitions where
  hashWithSalt :: Int -> ListBatchJobDefinitions -> Int
hashWithSalt Int
_salt ListBatchJobDefinitions' {Maybe Natural
Maybe Text
Text
applicationId :: Text
prefix :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:applicationId:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Text
$sel:prefix:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Text
$sel:nextToken:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Text
$sel:maxResults:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> 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 Text
prefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId

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

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

instance Data.ToPath ListBatchJobDefinitions where
  toPath :: ListBatchJobDefinitions -> ByteString
toPath ListBatchJobDefinitions' {Maybe Natural
Maybe Text
Text
applicationId :: Text
prefix :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:applicationId:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Text
$sel:prefix:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Text
$sel:nextToken:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Text
$sel:maxResults:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/applications/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
applicationId,
        ByteString
"/batch-job-definitions"
      ]

instance Data.ToQuery ListBatchJobDefinitions where
  toQuery :: ListBatchJobDefinitions -> QueryString
toQuery ListBatchJobDefinitions' {Maybe Natural
Maybe Text
Text
applicationId :: Text
prefix :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:applicationId:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Text
$sel:prefix:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Text
$sel:nextToken:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Text
$sel:maxResults:ListBatchJobDefinitions' :: ListBatchJobDefinitions -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"prefix" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
prefix
      ]

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

-- |
-- Create a value of 'ListBatchJobDefinitionsResponse' 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', 'listBatchJobDefinitionsResponse_nextToken' - If there are more items to return, this contains a token that is passed
-- to a subsequent call to this operation to retrieve the next set of
-- items.
--
-- 'httpStatus', 'listBatchJobDefinitionsResponse_httpStatus' - The response's http status code.
--
-- 'batchJobDefinitions', 'listBatchJobDefinitionsResponse_batchJobDefinitions' - The list of batch job definitions.
newListBatchJobDefinitionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBatchJobDefinitionsResponse
newListBatchJobDefinitionsResponse :: Int -> ListBatchJobDefinitionsResponse
newListBatchJobDefinitionsResponse Int
pHttpStatus_ =
  ListBatchJobDefinitionsResponse'
    { $sel:nextToken:ListBatchJobDefinitionsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListBatchJobDefinitionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:batchJobDefinitions:ListBatchJobDefinitionsResponse' :: [BatchJobDefinition]
batchJobDefinitions = forall a. Monoid a => a
Prelude.mempty
    }

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

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

-- | The list of batch job definitions.
listBatchJobDefinitionsResponse_batchJobDefinitions :: Lens.Lens' ListBatchJobDefinitionsResponse [BatchJobDefinition]
listBatchJobDefinitionsResponse_batchJobDefinitions :: Lens' ListBatchJobDefinitionsResponse [BatchJobDefinition]
listBatchJobDefinitionsResponse_batchJobDefinitions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBatchJobDefinitionsResponse' {[BatchJobDefinition]
batchJobDefinitions :: [BatchJobDefinition]
$sel:batchJobDefinitions:ListBatchJobDefinitionsResponse' :: ListBatchJobDefinitionsResponse -> [BatchJobDefinition]
batchJobDefinitions} -> [BatchJobDefinition]
batchJobDefinitions) (\s :: ListBatchJobDefinitionsResponse
s@ListBatchJobDefinitionsResponse' {} [BatchJobDefinition]
a -> ListBatchJobDefinitionsResponse
s {$sel:batchJobDefinitions:ListBatchJobDefinitionsResponse' :: [BatchJobDefinition]
batchJobDefinitions = [BatchJobDefinition]
a} :: ListBatchJobDefinitionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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