{-# 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.RobOMaker.ListSimulationJobBatches
-- 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)
--
-- Returns a list simulation job batches. You can optionally provide
-- filters to retrieve specific simulation batch jobs.
--
-- This operation returns paginated results.
module Amazonka.RobOMaker.ListSimulationJobBatches
  ( -- * Creating a Request
    ListSimulationJobBatches (..),
    newListSimulationJobBatches,

    -- * Request Lenses
    listSimulationJobBatches_filters,
    listSimulationJobBatches_nextToken,
    listSimulationJobBatches_maxResults,

    -- * Destructuring the Response
    ListSimulationJobBatchesResponse (..),
    newListSimulationJobBatchesResponse,

    -- * Response Lenses
    listSimulationJobBatchesResponse_nextToken,
    listSimulationJobBatchesResponse_simulationJobBatchSummaries,
    listSimulationJobBatchesResponse_httpStatus,
  )
where

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
import Amazonka.RobOMaker.Types

-- | /See:/ 'newListSimulationJobBatches' smart constructor.
data ListSimulationJobBatches = ListSimulationJobBatches'
  { -- | Optional filters to limit results.
    ListSimulationJobBatches -> Maybe (NonEmpty Filter)
filters :: Prelude.Maybe (Prelude.NonEmpty Filter),
    -- | If the previous paginated request did not return all of the remaining
    -- results, the response object\'s @nextToken@ parameter value is set to a
    -- token. To retrieve the next set of results, call
    -- @ListSimulationJobBatches@ again and assign that token to the request
    -- object\'s @nextToken@ parameter. If there are no remaining results, the
    -- previous response object\'s NextToken parameter is set to null.
    ListSimulationJobBatches -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When this parameter is used, @ListSimulationJobBatches@ only returns
    -- @maxResults@ results in a single page along with a @nextToken@ response
    -- element. The remaining results of the initial request can be seen by
    -- sending another @ListSimulationJobBatches@ request with the returned
    -- @nextToken@ value.
    ListSimulationJobBatches -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListSimulationJobBatches -> ListSimulationJobBatches -> Bool
(ListSimulationJobBatches -> ListSimulationJobBatches -> Bool)
-> (ListSimulationJobBatches -> ListSimulationJobBatches -> Bool)
-> Eq ListSimulationJobBatches
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSimulationJobBatches -> ListSimulationJobBatches -> Bool
$c/= :: ListSimulationJobBatches -> ListSimulationJobBatches -> Bool
== :: ListSimulationJobBatches -> ListSimulationJobBatches -> Bool
$c== :: ListSimulationJobBatches -> ListSimulationJobBatches -> Bool
Prelude.Eq, ReadPrec [ListSimulationJobBatches]
ReadPrec ListSimulationJobBatches
Int -> ReadS ListSimulationJobBatches
ReadS [ListSimulationJobBatches]
(Int -> ReadS ListSimulationJobBatches)
-> ReadS [ListSimulationJobBatches]
-> ReadPrec ListSimulationJobBatches
-> ReadPrec [ListSimulationJobBatches]
-> Read ListSimulationJobBatches
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSimulationJobBatches]
$creadListPrec :: ReadPrec [ListSimulationJobBatches]
readPrec :: ReadPrec ListSimulationJobBatches
$creadPrec :: ReadPrec ListSimulationJobBatches
readList :: ReadS [ListSimulationJobBatches]
$creadList :: ReadS [ListSimulationJobBatches]
readsPrec :: Int -> ReadS ListSimulationJobBatches
$creadsPrec :: Int -> ReadS ListSimulationJobBatches
Prelude.Read, Int -> ListSimulationJobBatches -> ShowS
[ListSimulationJobBatches] -> ShowS
ListSimulationJobBatches -> String
(Int -> ListSimulationJobBatches -> ShowS)
-> (ListSimulationJobBatches -> String)
-> ([ListSimulationJobBatches] -> ShowS)
-> Show ListSimulationJobBatches
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSimulationJobBatches] -> ShowS
$cshowList :: [ListSimulationJobBatches] -> ShowS
show :: ListSimulationJobBatches -> String
$cshow :: ListSimulationJobBatches -> String
showsPrec :: Int -> ListSimulationJobBatches -> ShowS
$cshowsPrec :: Int -> ListSimulationJobBatches -> ShowS
Prelude.Show, (forall x.
 ListSimulationJobBatches -> Rep ListSimulationJobBatches x)
-> (forall x.
    Rep ListSimulationJobBatches x -> ListSimulationJobBatches)
-> Generic ListSimulationJobBatches
forall x.
Rep ListSimulationJobBatches x -> ListSimulationJobBatches
forall x.
ListSimulationJobBatches -> Rep ListSimulationJobBatches x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSimulationJobBatches x -> ListSimulationJobBatches
$cfrom :: forall x.
ListSimulationJobBatches -> Rep ListSimulationJobBatches x
Prelude.Generic)

-- |
-- Create a value of 'ListSimulationJobBatches' 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:
--
-- 'filters', 'listSimulationJobBatches_filters' - Optional filters to limit results.
--
-- 'nextToken', 'listSimulationJobBatches_nextToken' - If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call
-- @ListSimulationJobBatches@ again and assign that token to the request
-- object\'s @nextToken@ parameter. If there are no remaining results, the
-- previous response object\'s NextToken parameter is set to null.
--
-- 'maxResults', 'listSimulationJobBatches_maxResults' - When this parameter is used, @ListSimulationJobBatches@ only returns
-- @maxResults@ results in a single page along with a @nextToken@ response
-- element. The remaining results of the initial request can be seen by
-- sending another @ListSimulationJobBatches@ request with the returned
-- @nextToken@ value.
newListSimulationJobBatches ::
  ListSimulationJobBatches
newListSimulationJobBatches :: ListSimulationJobBatches
newListSimulationJobBatches =
  ListSimulationJobBatches' :: Maybe (NonEmpty Filter)
-> Maybe Text -> Maybe Int -> ListSimulationJobBatches
ListSimulationJobBatches'
    { $sel:filters:ListSimulationJobBatches' :: Maybe (NonEmpty Filter)
filters =
        Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSimulationJobBatches' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSimulationJobBatches' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional filters to limit results.
listSimulationJobBatches_filters :: Lens.Lens' ListSimulationJobBatches (Prelude.Maybe (Prelude.NonEmpty Filter))
listSimulationJobBatches_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListSimulationJobBatches -> f ListSimulationJobBatches
listSimulationJobBatches_filters = (ListSimulationJobBatches -> Maybe (NonEmpty Filter))
-> (ListSimulationJobBatches
    -> Maybe (NonEmpty Filter) -> ListSimulationJobBatches)
-> Lens
     ListSimulationJobBatches
     ListSimulationJobBatches
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobBatches' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListSimulationJobBatches' :: ListSimulationJobBatches -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListSimulationJobBatches
s@ListSimulationJobBatches' {} Maybe (NonEmpty Filter)
a -> ListSimulationJobBatches
s {$sel:filters:ListSimulationJobBatches' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListSimulationJobBatches) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListSimulationJobBatches -> f ListSimulationJobBatches)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListSimulationJobBatches
-> f ListSimulationJobBatches
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
-> Iso
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
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 Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call
-- @ListSimulationJobBatches@ again and assign that token to the request
-- object\'s @nextToken@ parameter. If there are no remaining results, the
-- previous response object\'s NextToken parameter is set to null.
listSimulationJobBatches_nextToken :: Lens.Lens' ListSimulationJobBatches (Prelude.Maybe Prelude.Text)
listSimulationJobBatches_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSimulationJobBatches -> f ListSimulationJobBatches
listSimulationJobBatches_nextToken = (ListSimulationJobBatches -> Maybe Text)
-> (ListSimulationJobBatches
    -> Maybe Text -> ListSimulationJobBatches)
-> Lens
     ListSimulationJobBatches
     ListSimulationJobBatches
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobBatches' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSimulationJobBatches' :: ListSimulationJobBatches -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSimulationJobBatches
s@ListSimulationJobBatches' {} Maybe Text
a -> ListSimulationJobBatches
s {$sel:nextToken:ListSimulationJobBatches' :: Maybe Text
nextToken = Maybe Text
a} :: ListSimulationJobBatches)

-- | When this parameter is used, @ListSimulationJobBatches@ only returns
-- @maxResults@ results in a single page along with a @nextToken@ response
-- element. The remaining results of the initial request can be seen by
-- sending another @ListSimulationJobBatches@ request with the returned
-- @nextToken@ value.
listSimulationJobBatches_maxResults :: Lens.Lens' ListSimulationJobBatches (Prelude.Maybe Prelude.Int)
listSimulationJobBatches_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListSimulationJobBatches -> f ListSimulationJobBatches
listSimulationJobBatches_maxResults = (ListSimulationJobBatches -> Maybe Int)
-> (ListSimulationJobBatches
    -> Maybe Int -> ListSimulationJobBatches)
-> Lens
     ListSimulationJobBatches
     ListSimulationJobBatches
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobBatches' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListSimulationJobBatches' :: ListSimulationJobBatches -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListSimulationJobBatches
s@ListSimulationJobBatches' {} Maybe Int
a -> ListSimulationJobBatches
s {$sel:maxResults:ListSimulationJobBatches' :: Maybe Int
maxResults = Maybe Int
a} :: ListSimulationJobBatches)

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

instance Prelude.NFData ListSimulationJobBatches

instance Core.ToHeaders ListSimulationJobBatches where
  toHeaders :: ListSimulationJobBatches -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSimulationJobBatches -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 ListSimulationJobBatches where
  toJSON :: ListSimulationJobBatches -> Value
toJSON ListSimulationJobBatches' {Maybe Int
Maybe (NonEmpty Filter)
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
filters :: Maybe (NonEmpty Filter)
$sel:maxResults:ListSimulationJobBatches' :: ListSimulationJobBatches -> Maybe Int
$sel:nextToken:ListSimulationJobBatches' :: ListSimulationJobBatches -> Maybe Text
$sel:filters:ListSimulationJobBatches' :: ListSimulationJobBatches -> Maybe (NonEmpty Filter)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filters" Text -> NonEmpty Filter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Filter -> Pair) -> Maybe (NonEmpty Filter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Filter)
filters,
            (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
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newListSimulationJobBatchesResponse' smart constructor.
data ListSimulationJobBatchesResponse = ListSimulationJobBatchesResponse'
  { -- | If the previous paginated request did not return all of the remaining
    -- results, the response object\'s @nextToken@ parameter value is set to a
    -- token. To retrieve the next set of results, call
    -- @ListSimulationJobBatches@ again and assign that token to the request
    -- object\'s @nextToken@ parameter. If there are no remaining results, the
    -- previous response object\'s NextToken parameter is set to null.
    ListSimulationJobBatchesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of simulation job batch summaries.
    ListSimulationJobBatchesResponse
-> Maybe [SimulationJobBatchSummary]
simulationJobBatchSummaries :: Prelude.Maybe [SimulationJobBatchSummary],
    -- | The response's http status code.
    ListSimulationJobBatchesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSimulationJobBatchesResponse
-> ListSimulationJobBatchesResponse -> Bool
(ListSimulationJobBatchesResponse
 -> ListSimulationJobBatchesResponse -> Bool)
-> (ListSimulationJobBatchesResponse
    -> ListSimulationJobBatchesResponse -> Bool)
-> Eq ListSimulationJobBatchesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSimulationJobBatchesResponse
-> ListSimulationJobBatchesResponse -> Bool
$c/= :: ListSimulationJobBatchesResponse
-> ListSimulationJobBatchesResponse -> Bool
== :: ListSimulationJobBatchesResponse
-> ListSimulationJobBatchesResponse -> Bool
$c== :: ListSimulationJobBatchesResponse
-> ListSimulationJobBatchesResponse -> Bool
Prelude.Eq, ReadPrec [ListSimulationJobBatchesResponse]
ReadPrec ListSimulationJobBatchesResponse
Int -> ReadS ListSimulationJobBatchesResponse
ReadS [ListSimulationJobBatchesResponse]
(Int -> ReadS ListSimulationJobBatchesResponse)
-> ReadS [ListSimulationJobBatchesResponse]
-> ReadPrec ListSimulationJobBatchesResponse
-> ReadPrec [ListSimulationJobBatchesResponse]
-> Read ListSimulationJobBatchesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSimulationJobBatchesResponse]
$creadListPrec :: ReadPrec [ListSimulationJobBatchesResponse]
readPrec :: ReadPrec ListSimulationJobBatchesResponse
$creadPrec :: ReadPrec ListSimulationJobBatchesResponse
readList :: ReadS [ListSimulationJobBatchesResponse]
$creadList :: ReadS [ListSimulationJobBatchesResponse]
readsPrec :: Int -> ReadS ListSimulationJobBatchesResponse
$creadsPrec :: Int -> ReadS ListSimulationJobBatchesResponse
Prelude.Read, Int -> ListSimulationJobBatchesResponse -> ShowS
[ListSimulationJobBatchesResponse] -> ShowS
ListSimulationJobBatchesResponse -> String
(Int -> ListSimulationJobBatchesResponse -> ShowS)
-> (ListSimulationJobBatchesResponse -> String)
-> ([ListSimulationJobBatchesResponse] -> ShowS)
-> Show ListSimulationJobBatchesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSimulationJobBatchesResponse] -> ShowS
$cshowList :: [ListSimulationJobBatchesResponse] -> ShowS
show :: ListSimulationJobBatchesResponse -> String
$cshow :: ListSimulationJobBatchesResponse -> String
showsPrec :: Int -> ListSimulationJobBatchesResponse -> ShowS
$cshowsPrec :: Int -> ListSimulationJobBatchesResponse -> ShowS
Prelude.Show, (forall x.
 ListSimulationJobBatchesResponse
 -> Rep ListSimulationJobBatchesResponse x)
-> (forall x.
    Rep ListSimulationJobBatchesResponse x
    -> ListSimulationJobBatchesResponse)
-> Generic ListSimulationJobBatchesResponse
forall x.
Rep ListSimulationJobBatchesResponse x
-> ListSimulationJobBatchesResponse
forall x.
ListSimulationJobBatchesResponse
-> Rep ListSimulationJobBatchesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSimulationJobBatchesResponse x
-> ListSimulationJobBatchesResponse
$cfrom :: forall x.
ListSimulationJobBatchesResponse
-> Rep ListSimulationJobBatchesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSimulationJobBatchesResponse' 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', 'listSimulationJobBatchesResponse_nextToken' - If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call
-- @ListSimulationJobBatches@ again and assign that token to the request
-- object\'s @nextToken@ parameter. If there are no remaining results, the
-- previous response object\'s NextToken parameter is set to null.
--
-- 'simulationJobBatchSummaries', 'listSimulationJobBatchesResponse_simulationJobBatchSummaries' - A list of simulation job batch summaries.
--
-- 'httpStatus', 'listSimulationJobBatchesResponse_httpStatus' - The response's http status code.
newListSimulationJobBatchesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSimulationJobBatchesResponse
newListSimulationJobBatchesResponse :: Int -> ListSimulationJobBatchesResponse
newListSimulationJobBatchesResponse Int
pHttpStatus_ =
  ListSimulationJobBatchesResponse' :: Maybe Text
-> Maybe [SimulationJobBatchSummary]
-> Int
-> ListSimulationJobBatchesResponse
ListSimulationJobBatchesResponse'
    { $sel:nextToken:ListSimulationJobBatchesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:simulationJobBatchSummaries:ListSimulationJobBatchesResponse' :: Maybe [SimulationJobBatchSummary]
simulationJobBatchSummaries =
        Maybe [SimulationJobBatchSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSimulationJobBatchesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the previous paginated request did not return all of the remaining
-- results, the response object\'s @nextToken@ parameter value is set to a
-- token. To retrieve the next set of results, call
-- @ListSimulationJobBatches@ again and assign that token to the request
-- object\'s @nextToken@ parameter. If there are no remaining results, the
-- previous response object\'s NextToken parameter is set to null.
listSimulationJobBatchesResponse_nextToken :: Lens.Lens' ListSimulationJobBatchesResponse (Prelude.Maybe Prelude.Text)
listSimulationJobBatchesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSimulationJobBatchesResponse
-> f ListSimulationJobBatchesResponse
listSimulationJobBatchesResponse_nextToken = (ListSimulationJobBatchesResponse -> Maybe Text)
-> (ListSimulationJobBatchesResponse
    -> Maybe Text -> ListSimulationJobBatchesResponse)
-> Lens' ListSimulationJobBatchesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobBatchesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSimulationJobBatchesResponse' :: ListSimulationJobBatchesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSimulationJobBatchesResponse
s@ListSimulationJobBatchesResponse' {} Maybe Text
a -> ListSimulationJobBatchesResponse
s {$sel:nextToken:ListSimulationJobBatchesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSimulationJobBatchesResponse)

-- | A list of simulation job batch summaries.
listSimulationJobBatchesResponse_simulationJobBatchSummaries :: Lens.Lens' ListSimulationJobBatchesResponse (Prelude.Maybe [SimulationJobBatchSummary])
listSimulationJobBatchesResponse_simulationJobBatchSummaries :: (Maybe [SimulationJobBatchSummary]
 -> f (Maybe [SimulationJobBatchSummary]))
-> ListSimulationJobBatchesResponse
-> f ListSimulationJobBatchesResponse
listSimulationJobBatchesResponse_simulationJobBatchSummaries = (ListSimulationJobBatchesResponse
 -> Maybe [SimulationJobBatchSummary])
-> (ListSimulationJobBatchesResponse
    -> Maybe [SimulationJobBatchSummary]
    -> ListSimulationJobBatchesResponse)
-> Lens'
     ListSimulationJobBatchesResponse
     (Maybe [SimulationJobBatchSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobBatchesResponse' {Maybe [SimulationJobBatchSummary]
simulationJobBatchSummaries :: Maybe [SimulationJobBatchSummary]
$sel:simulationJobBatchSummaries:ListSimulationJobBatchesResponse' :: ListSimulationJobBatchesResponse
-> Maybe [SimulationJobBatchSummary]
simulationJobBatchSummaries} -> Maybe [SimulationJobBatchSummary]
simulationJobBatchSummaries) (\s :: ListSimulationJobBatchesResponse
s@ListSimulationJobBatchesResponse' {} Maybe [SimulationJobBatchSummary]
a -> ListSimulationJobBatchesResponse
s {$sel:simulationJobBatchSummaries:ListSimulationJobBatchesResponse' :: Maybe [SimulationJobBatchSummary]
simulationJobBatchSummaries = Maybe [SimulationJobBatchSummary]
a} :: ListSimulationJobBatchesResponse) ((Maybe [SimulationJobBatchSummary]
  -> f (Maybe [SimulationJobBatchSummary]))
 -> ListSimulationJobBatchesResponse
 -> f ListSimulationJobBatchesResponse)
-> ((Maybe [SimulationJobBatchSummary]
     -> f (Maybe [SimulationJobBatchSummary]))
    -> Maybe [SimulationJobBatchSummary]
    -> f (Maybe [SimulationJobBatchSummary]))
-> (Maybe [SimulationJobBatchSummary]
    -> f (Maybe [SimulationJobBatchSummary]))
-> ListSimulationJobBatchesResponse
-> f ListSimulationJobBatchesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SimulationJobBatchSummary]
  [SimulationJobBatchSummary]
  [SimulationJobBatchSummary]
  [SimulationJobBatchSummary]
-> Iso
     (Maybe [SimulationJobBatchSummary])
     (Maybe [SimulationJobBatchSummary])
     (Maybe [SimulationJobBatchSummary])
     (Maybe [SimulationJobBatchSummary])
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
  [SimulationJobBatchSummary]
  [SimulationJobBatchSummary]
  [SimulationJobBatchSummary]
  [SimulationJobBatchSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListSimulationJobBatchesResponse