{-# 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.ListSimulationJobs
-- 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 of simulation jobs. You can optionally provide filters to
-- retrieve specific simulation jobs.
--
-- This operation returns paginated results.
module Amazonka.RobOMaker.ListSimulationJobs
  ( -- * Creating a Request
    ListSimulationJobs (..),
    newListSimulationJobs,

    -- * Request Lenses
    listSimulationJobs_filters,
    listSimulationJobs_nextToken,
    listSimulationJobs_maxResults,

    -- * Destructuring the Response
    ListSimulationJobsResponse (..),
    newListSimulationJobsResponse,

    -- * Response Lenses
    listSimulationJobsResponse_nextToken,
    listSimulationJobsResponse_httpStatus,
    listSimulationJobsResponse_simulationJobSummaries,
  )
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:/ 'newListSimulationJobs' smart constructor.
data ListSimulationJobs = ListSimulationJobs'
  { -- | Optional filters to limit results.
    --
    -- The filter names @status@ and @simulationApplicationName@ and
    -- @robotApplicationName@ are supported. When filtering, you must use the
    -- complete value of the filtered item. You can use up to three filters,
    -- but they must be for the same named item. For example, if you are
    -- looking for items with the status @Preparing@ or the status @Running@.
    ListSimulationJobs -> 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 @ListSimulationJobs@
    -- 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.
    ListSimulationJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When this parameter is used, @ListSimulationJobs@ 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 @ListSimulationJobs@ request with the returned
    -- @nextToken@ value. This value can be between 1 and 1000. If this
    -- parameter is not used, then @ListSimulationJobs@ returns up to 1000
    -- results and a @nextToken@ value if applicable.
    ListSimulationJobs -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListSimulationJobs -> ListSimulationJobs -> Bool
(ListSimulationJobs -> ListSimulationJobs -> Bool)
-> (ListSimulationJobs -> ListSimulationJobs -> Bool)
-> Eq ListSimulationJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSimulationJobs -> ListSimulationJobs -> Bool
$c/= :: ListSimulationJobs -> ListSimulationJobs -> Bool
== :: ListSimulationJobs -> ListSimulationJobs -> Bool
$c== :: ListSimulationJobs -> ListSimulationJobs -> Bool
Prelude.Eq, ReadPrec [ListSimulationJobs]
ReadPrec ListSimulationJobs
Int -> ReadS ListSimulationJobs
ReadS [ListSimulationJobs]
(Int -> ReadS ListSimulationJobs)
-> ReadS [ListSimulationJobs]
-> ReadPrec ListSimulationJobs
-> ReadPrec [ListSimulationJobs]
-> Read ListSimulationJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSimulationJobs]
$creadListPrec :: ReadPrec [ListSimulationJobs]
readPrec :: ReadPrec ListSimulationJobs
$creadPrec :: ReadPrec ListSimulationJobs
readList :: ReadS [ListSimulationJobs]
$creadList :: ReadS [ListSimulationJobs]
readsPrec :: Int -> ReadS ListSimulationJobs
$creadsPrec :: Int -> ReadS ListSimulationJobs
Prelude.Read, Int -> ListSimulationJobs -> ShowS
[ListSimulationJobs] -> ShowS
ListSimulationJobs -> String
(Int -> ListSimulationJobs -> ShowS)
-> (ListSimulationJobs -> String)
-> ([ListSimulationJobs] -> ShowS)
-> Show ListSimulationJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSimulationJobs] -> ShowS
$cshowList :: [ListSimulationJobs] -> ShowS
show :: ListSimulationJobs -> String
$cshow :: ListSimulationJobs -> String
showsPrec :: Int -> ListSimulationJobs -> ShowS
$cshowsPrec :: Int -> ListSimulationJobs -> ShowS
Prelude.Show, (forall x. ListSimulationJobs -> Rep ListSimulationJobs x)
-> (forall x. Rep ListSimulationJobs x -> ListSimulationJobs)
-> Generic ListSimulationJobs
forall x. Rep ListSimulationJobs x -> ListSimulationJobs
forall x. ListSimulationJobs -> Rep ListSimulationJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSimulationJobs x -> ListSimulationJobs
$cfrom :: forall x. ListSimulationJobs -> Rep ListSimulationJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListSimulationJobs' 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', 'listSimulationJobs_filters' - Optional filters to limit results.
--
-- The filter names @status@ and @simulationApplicationName@ and
-- @robotApplicationName@ are supported. When filtering, you must use the
-- complete value of the filtered item. You can use up to three filters,
-- but they must be for the same named item. For example, if you are
-- looking for items with the status @Preparing@ or the status @Running@.
--
-- 'nextToken', 'listSimulationJobs_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 @ListSimulationJobs@
-- 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', 'listSimulationJobs_maxResults' - When this parameter is used, @ListSimulationJobs@ 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 @ListSimulationJobs@ request with the returned
-- @nextToken@ value. This value can be between 1 and 1000. If this
-- parameter is not used, then @ListSimulationJobs@ returns up to 1000
-- results and a @nextToken@ value if applicable.
newListSimulationJobs ::
  ListSimulationJobs
newListSimulationJobs :: ListSimulationJobs
newListSimulationJobs =
  ListSimulationJobs' :: Maybe (NonEmpty Filter)
-> Maybe Text -> Maybe Int -> ListSimulationJobs
ListSimulationJobs'
    { $sel:filters:ListSimulationJobs' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSimulationJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSimulationJobs' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional filters to limit results.
--
-- The filter names @status@ and @simulationApplicationName@ and
-- @robotApplicationName@ are supported. When filtering, you must use the
-- complete value of the filtered item. You can use up to three filters,
-- but they must be for the same named item. For example, if you are
-- looking for items with the status @Preparing@ or the status @Running@.
listSimulationJobs_filters :: Lens.Lens' ListSimulationJobs (Prelude.Maybe (Prelude.NonEmpty Filter))
listSimulationJobs_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListSimulationJobs -> f ListSimulationJobs
listSimulationJobs_filters = (ListSimulationJobs -> Maybe (NonEmpty Filter))
-> (ListSimulationJobs
    -> Maybe (NonEmpty Filter) -> ListSimulationJobs)
-> Lens
     ListSimulationJobs
     ListSimulationJobs
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobs' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListSimulationJobs' :: ListSimulationJobs -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListSimulationJobs
s@ListSimulationJobs' {} Maybe (NonEmpty Filter)
a -> ListSimulationJobs
s {$sel:filters:ListSimulationJobs' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListSimulationJobs) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListSimulationJobs -> f ListSimulationJobs)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListSimulationJobs
-> f ListSimulationJobs
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 @ListSimulationJobs@
-- 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.
listSimulationJobs_nextToken :: Lens.Lens' ListSimulationJobs (Prelude.Maybe Prelude.Text)
listSimulationJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSimulationJobs -> f ListSimulationJobs
listSimulationJobs_nextToken = (ListSimulationJobs -> Maybe Text)
-> (ListSimulationJobs -> Maybe Text -> ListSimulationJobs)
-> Lens
     ListSimulationJobs ListSimulationJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSimulationJobs' :: ListSimulationJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSimulationJobs
s@ListSimulationJobs' {} Maybe Text
a -> ListSimulationJobs
s {$sel:nextToken:ListSimulationJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListSimulationJobs)

-- | When this parameter is used, @ListSimulationJobs@ 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 @ListSimulationJobs@ request with the returned
-- @nextToken@ value. This value can be between 1 and 1000. If this
-- parameter is not used, then @ListSimulationJobs@ returns up to 1000
-- results and a @nextToken@ value if applicable.
listSimulationJobs_maxResults :: Lens.Lens' ListSimulationJobs (Prelude.Maybe Prelude.Int)
listSimulationJobs_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListSimulationJobs -> f ListSimulationJobs
listSimulationJobs_maxResults = (ListSimulationJobs -> Maybe Int)
-> (ListSimulationJobs -> Maybe Int -> ListSimulationJobs)
-> Lens
     ListSimulationJobs ListSimulationJobs (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobs' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListSimulationJobs' :: ListSimulationJobs -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListSimulationJobs
s@ListSimulationJobs' {} Maybe Int
a -> ListSimulationJobs
s {$sel:maxResults:ListSimulationJobs' :: Maybe Int
maxResults = Maybe Int
a} :: ListSimulationJobs)

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

instance Prelude.Hashable ListSimulationJobs

instance Prelude.NFData ListSimulationJobs

instance Core.ToHeaders ListSimulationJobs where
  toHeaders :: ListSimulationJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSimulationJobs -> 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 ListSimulationJobs where
  toJSON :: ListSimulationJobs -> Value
toJSON ListSimulationJobs' {Maybe Int
Maybe (NonEmpty Filter)
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
filters :: Maybe (NonEmpty Filter)
$sel:maxResults:ListSimulationJobs' :: ListSimulationJobs -> Maybe Int
$sel:nextToken:ListSimulationJobs' :: ListSimulationJobs -> Maybe Text
$sel:filters:ListSimulationJobs' :: ListSimulationJobs -> 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 ListSimulationJobs where
  toPath :: ListSimulationJobs -> ByteString
toPath = ByteString -> ListSimulationJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/listSimulationJobs"

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

-- | /See:/ 'newListSimulationJobsResponse' smart constructor.
data ListSimulationJobsResponse = ListSimulationJobsResponse'
  { -- | 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 @ListSimulationJobs@
    -- 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.
    ListSimulationJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListSimulationJobsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of simulation job summaries that meet the criteria of the
    -- request.
    ListSimulationJobsResponse -> [SimulationJobSummary]
simulationJobSummaries :: [SimulationJobSummary]
  }
  deriving (ListSimulationJobsResponse -> ListSimulationJobsResponse -> Bool
(ListSimulationJobsResponse -> ListSimulationJobsResponse -> Bool)
-> (ListSimulationJobsResponse
    -> ListSimulationJobsResponse -> Bool)
-> Eq ListSimulationJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSimulationJobsResponse -> ListSimulationJobsResponse -> Bool
$c/= :: ListSimulationJobsResponse -> ListSimulationJobsResponse -> Bool
== :: ListSimulationJobsResponse -> ListSimulationJobsResponse -> Bool
$c== :: ListSimulationJobsResponse -> ListSimulationJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListSimulationJobsResponse]
ReadPrec ListSimulationJobsResponse
Int -> ReadS ListSimulationJobsResponse
ReadS [ListSimulationJobsResponse]
(Int -> ReadS ListSimulationJobsResponse)
-> ReadS [ListSimulationJobsResponse]
-> ReadPrec ListSimulationJobsResponse
-> ReadPrec [ListSimulationJobsResponse]
-> Read ListSimulationJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSimulationJobsResponse]
$creadListPrec :: ReadPrec [ListSimulationJobsResponse]
readPrec :: ReadPrec ListSimulationJobsResponse
$creadPrec :: ReadPrec ListSimulationJobsResponse
readList :: ReadS [ListSimulationJobsResponse]
$creadList :: ReadS [ListSimulationJobsResponse]
readsPrec :: Int -> ReadS ListSimulationJobsResponse
$creadsPrec :: Int -> ReadS ListSimulationJobsResponse
Prelude.Read, Int -> ListSimulationJobsResponse -> ShowS
[ListSimulationJobsResponse] -> ShowS
ListSimulationJobsResponse -> String
(Int -> ListSimulationJobsResponse -> ShowS)
-> (ListSimulationJobsResponse -> String)
-> ([ListSimulationJobsResponse] -> ShowS)
-> Show ListSimulationJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSimulationJobsResponse] -> ShowS
$cshowList :: [ListSimulationJobsResponse] -> ShowS
show :: ListSimulationJobsResponse -> String
$cshow :: ListSimulationJobsResponse -> String
showsPrec :: Int -> ListSimulationJobsResponse -> ShowS
$cshowsPrec :: Int -> ListSimulationJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListSimulationJobsResponse -> Rep ListSimulationJobsResponse x)
-> (forall x.
    Rep ListSimulationJobsResponse x -> ListSimulationJobsResponse)
-> Generic ListSimulationJobsResponse
forall x.
Rep ListSimulationJobsResponse x -> ListSimulationJobsResponse
forall x.
ListSimulationJobsResponse -> Rep ListSimulationJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSimulationJobsResponse x -> ListSimulationJobsResponse
$cfrom :: forall x.
ListSimulationJobsResponse -> Rep ListSimulationJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSimulationJobsResponse' 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', 'listSimulationJobsResponse_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 @ListSimulationJobs@
-- 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.
--
-- 'httpStatus', 'listSimulationJobsResponse_httpStatus' - The response's http status code.
--
-- 'simulationJobSummaries', 'listSimulationJobsResponse_simulationJobSummaries' - A list of simulation job summaries that meet the criteria of the
-- request.
newListSimulationJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSimulationJobsResponse
newListSimulationJobsResponse :: Int -> ListSimulationJobsResponse
newListSimulationJobsResponse Int
pHttpStatus_ =
  ListSimulationJobsResponse' :: Maybe Text
-> Int -> [SimulationJobSummary] -> ListSimulationJobsResponse
ListSimulationJobsResponse'
    { $sel:nextToken:ListSimulationJobsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSimulationJobsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:simulationJobSummaries:ListSimulationJobsResponse' :: [SimulationJobSummary]
simulationJobSummaries = [SimulationJobSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | 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 @ListSimulationJobs@
-- 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.
listSimulationJobsResponse_nextToken :: Lens.Lens' ListSimulationJobsResponse (Prelude.Maybe Prelude.Text)
listSimulationJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSimulationJobsResponse -> f ListSimulationJobsResponse
listSimulationJobsResponse_nextToken = (ListSimulationJobsResponse -> Maybe Text)
-> (ListSimulationJobsResponse
    -> Maybe Text -> ListSimulationJobsResponse)
-> Lens' ListSimulationJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSimulationJobsResponse' :: ListSimulationJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSimulationJobsResponse
s@ListSimulationJobsResponse' {} Maybe Text
a -> ListSimulationJobsResponse
s {$sel:nextToken:ListSimulationJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSimulationJobsResponse)

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

-- | A list of simulation job summaries that meet the criteria of the
-- request.
listSimulationJobsResponse_simulationJobSummaries :: Lens.Lens' ListSimulationJobsResponse [SimulationJobSummary]
listSimulationJobsResponse_simulationJobSummaries :: ([SimulationJobSummary] -> f [SimulationJobSummary])
-> ListSimulationJobsResponse -> f ListSimulationJobsResponse
listSimulationJobsResponse_simulationJobSummaries = (ListSimulationJobsResponse -> [SimulationJobSummary])
-> (ListSimulationJobsResponse
    -> [SimulationJobSummary] -> ListSimulationJobsResponse)
-> Lens' ListSimulationJobsResponse [SimulationJobSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationJobsResponse' {[SimulationJobSummary]
simulationJobSummaries :: [SimulationJobSummary]
$sel:simulationJobSummaries:ListSimulationJobsResponse' :: ListSimulationJobsResponse -> [SimulationJobSummary]
simulationJobSummaries} -> [SimulationJobSummary]
simulationJobSummaries) (\s :: ListSimulationJobsResponse
s@ListSimulationJobsResponse' {} [SimulationJobSummary]
a -> ListSimulationJobsResponse
s {$sel:simulationJobSummaries:ListSimulationJobsResponse' :: [SimulationJobSummary]
simulationJobSummaries = [SimulationJobSummary]
a} :: ListSimulationJobsResponse) (([SimulationJobSummary] -> f [SimulationJobSummary])
 -> ListSimulationJobsResponse -> f ListSimulationJobsResponse)
-> (([SimulationJobSummary] -> f [SimulationJobSummary])
    -> [SimulationJobSummary] -> f [SimulationJobSummary])
-> ([SimulationJobSummary] -> f [SimulationJobSummary])
-> ListSimulationJobsResponse
-> f ListSimulationJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SimulationJobSummary] -> f [SimulationJobSummary])
-> [SimulationJobSummary] -> f [SimulationJobSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListSimulationJobsResponse