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

    -- * Request Lenses
    listSimulationApplications_versionQualifier,
    listSimulationApplications_filters,
    listSimulationApplications_nextToken,
    listSimulationApplications_maxResults,

    -- * Destructuring the Response
    ListSimulationApplicationsResponse (..),
    newListSimulationApplicationsResponse,

    -- * Response Lenses
    listSimulationApplicationsResponse_nextToken,
    listSimulationApplicationsResponse_simulationApplicationSummaries,
    listSimulationApplicationsResponse_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:/ 'newListSimulationApplications' smart constructor.
data ListSimulationApplications = ListSimulationApplications'
  { -- | The version qualifier of the simulation application.
    ListSimulationApplications -> Maybe Text
versionQualifier :: Prelude.Maybe Prelude.Text,
    -- | Optional list of filters to limit results.
    --
    -- The filter name @name@ is supported. When filtering, you must use the
    -- complete value of the filtered item. You can use up to three filters.
    ListSimulationApplications -> 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
    -- @ListSimulationApplications@ 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.
    ListSimulationApplications -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When this parameter is used, @ListSimulationApplications@ 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 @ListSimulationApplications@ request with the returned
    -- @nextToken@ value. This value can be between 1 and 100. If this
    -- parameter is not used, then @ListSimulationApplications@ returns up to
    -- 100 results and a @nextToken@ value if applicable.
    ListSimulationApplications -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListSimulationApplications -> ListSimulationApplications -> Bool
(ListSimulationApplications -> ListSimulationApplications -> Bool)
-> (ListSimulationApplications
    -> ListSimulationApplications -> Bool)
-> Eq ListSimulationApplications
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSimulationApplications -> ListSimulationApplications -> Bool
$c/= :: ListSimulationApplications -> ListSimulationApplications -> Bool
== :: ListSimulationApplications -> ListSimulationApplications -> Bool
$c== :: ListSimulationApplications -> ListSimulationApplications -> Bool
Prelude.Eq, ReadPrec [ListSimulationApplications]
ReadPrec ListSimulationApplications
Int -> ReadS ListSimulationApplications
ReadS [ListSimulationApplications]
(Int -> ReadS ListSimulationApplications)
-> ReadS [ListSimulationApplications]
-> ReadPrec ListSimulationApplications
-> ReadPrec [ListSimulationApplications]
-> Read ListSimulationApplications
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSimulationApplications]
$creadListPrec :: ReadPrec [ListSimulationApplications]
readPrec :: ReadPrec ListSimulationApplications
$creadPrec :: ReadPrec ListSimulationApplications
readList :: ReadS [ListSimulationApplications]
$creadList :: ReadS [ListSimulationApplications]
readsPrec :: Int -> ReadS ListSimulationApplications
$creadsPrec :: Int -> ReadS ListSimulationApplications
Prelude.Read, Int -> ListSimulationApplications -> ShowS
[ListSimulationApplications] -> ShowS
ListSimulationApplications -> String
(Int -> ListSimulationApplications -> ShowS)
-> (ListSimulationApplications -> String)
-> ([ListSimulationApplications] -> ShowS)
-> Show ListSimulationApplications
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSimulationApplications] -> ShowS
$cshowList :: [ListSimulationApplications] -> ShowS
show :: ListSimulationApplications -> String
$cshow :: ListSimulationApplications -> String
showsPrec :: Int -> ListSimulationApplications -> ShowS
$cshowsPrec :: Int -> ListSimulationApplications -> ShowS
Prelude.Show, (forall x.
 ListSimulationApplications -> Rep ListSimulationApplications x)
-> (forall x.
    Rep ListSimulationApplications x -> ListSimulationApplications)
-> Generic ListSimulationApplications
forall x.
Rep ListSimulationApplications x -> ListSimulationApplications
forall x.
ListSimulationApplications -> Rep ListSimulationApplications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSimulationApplications x -> ListSimulationApplications
$cfrom :: forall x.
ListSimulationApplications -> Rep ListSimulationApplications x
Prelude.Generic)

-- |
-- Create a value of 'ListSimulationApplications' 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:
--
-- 'versionQualifier', 'listSimulationApplications_versionQualifier' - The version qualifier of the simulation application.
--
-- 'filters', 'listSimulationApplications_filters' - Optional list of filters to limit results.
--
-- The filter name @name@ is supported. When filtering, you must use the
-- complete value of the filtered item. You can use up to three filters.
--
-- 'nextToken', 'listSimulationApplications_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
-- @ListSimulationApplications@ 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', 'listSimulationApplications_maxResults' - When this parameter is used, @ListSimulationApplications@ 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 @ListSimulationApplications@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If this
-- parameter is not used, then @ListSimulationApplications@ returns up to
-- 100 results and a @nextToken@ value if applicable.
newListSimulationApplications ::
  ListSimulationApplications
newListSimulationApplications :: ListSimulationApplications
newListSimulationApplications =
  ListSimulationApplications' :: Maybe Text
-> Maybe (NonEmpty Filter)
-> Maybe Text
-> Maybe Int
-> ListSimulationApplications
ListSimulationApplications'
    { $sel:versionQualifier:ListSimulationApplications' :: Maybe Text
versionQualifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:ListSimulationApplications' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSimulationApplications' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSimulationApplications' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The version qualifier of the simulation application.
listSimulationApplications_versionQualifier :: Lens.Lens' ListSimulationApplications (Prelude.Maybe Prelude.Text)
listSimulationApplications_versionQualifier :: (Maybe Text -> f (Maybe Text))
-> ListSimulationApplications -> f ListSimulationApplications
listSimulationApplications_versionQualifier = (ListSimulationApplications -> Maybe Text)
-> (ListSimulationApplications
    -> Maybe Text -> ListSimulationApplications)
-> Lens
     ListSimulationApplications
     ListSimulationApplications
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationApplications' {Maybe Text
versionQualifier :: Maybe Text
$sel:versionQualifier:ListSimulationApplications' :: ListSimulationApplications -> Maybe Text
versionQualifier} -> Maybe Text
versionQualifier) (\s :: ListSimulationApplications
s@ListSimulationApplications' {} Maybe Text
a -> ListSimulationApplications
s {$sel:versionQualifier:ListSimulationApplications' :: Maybe Text
versionQualifier = Maybe Text
a} :: ListSimulationApplications)

-- | Optional list of filters to limit results.
--
-- The filter name @name@ is supported. When filtering, you must use the
-- complete value of the filtered item. You can use up to three filters.
listSimulationApplications_filters :: Lens.Lens' ListSimulationApplications (Prelude.Maybe (Prelude.NonEmpty Filter))
listSimulationApplications_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListSimulationApplications -> f ListSimulationApplications
listSimulationApplications_filters = (ListSimulationApplications -> Maybe (NonEmpty Filter))
-> (ListSimulationApplications
    -> Maybe (NonEmpty Filter) -> ListSimulationApplications)
-> Lens
     ListSimulationApplications
     ListSimulationApplications
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationApplications' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListSimulationApplications' :: ListSimulationApplications -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListSimulationApplications
s@ListSimulationApplications' {} Maybe (NonEmpty Filter)
a -> ListSimulationApplications
s {$sel:filters:ListSimulationApplications' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListSimulationApplications) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListSimulationApplications -> f ListSimulationApplications)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListSimulationApplications
-> f ListSimulationApplications
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
-- @ListSimulationApplications@ 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.
listSimulationApplications_nextToken :: Lens.Lens' ListSimulationApplications (Prelude.Maybe Prelude.Text)
listSimulationApplications_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSimulationApplications -> f ListSimulationApplications
listSimulationApplications_nextToken = (ListSimulationApplications -> Maybe Text)
-> (ListSimulationApplications
    -> Maybe Text -> ListSimulationApplications)
-> Lens
     ListSimulationApplications
     ListSimulationApplications
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationApplications' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSimulationApplications' :: ListSimulationApplications -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSimulationApplications
s@ListSimulationApplications' {} Maybe Text
a -> ListSimulationApplications
s {$sel:nextToken:ListSimulationApplications' :: Maybe Text
nextToken = Maybe Text
a} :: ListSimulationApplications)

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

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

instance Prelude.NFData ListSimulationApplications

instance Core.ToHeaders ListSimulationApplications where
  toHeaders :: ListSimulationApplications -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSimulationApplications -> 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 ListSimulationApplications where
  toJSON :: ListSimulationApplications -> Value
toJSON ListSimulationApplications' {Maybe Int
Maybe (NonEmpty Filter)
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
filters :: Maybe (NonEmpty Filter)
versionQualifier :: Maybe Text
$sel:maxResults:ListSimulationApplications' :: ListSimulationApplications -> Maybe Int
$sel:nextToken:ListSimulationApplications' :: ListSimulationApplications -> Maybe Text
$sel:filters:ListSimulationApplications' :: ListSimulationApplications -> Maybe (NonEmpty Filter)
$sel:versionQualifier:ListSimulationApplications' :: ListSimulationApplications -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"versionQualifier" 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
versionQualifier,
            (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 ListSimulationApplications where
  toPath :: ListSimulationApplications -> ByteString
toPath = ByteString -> ListSimulationApplications -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/listSimulationApplications"

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

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

-- |
-- Create a value of 'ListSimulationApplicationsResponse' 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', 'listSimulationApplicationsResponse_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
-- @ListSimulationApplications@ 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.
--
-- 'simulationApplicationSummaries', 'listSimulationApplicationsResponse_simulationApplicationSummaries' - A list of simulation application summaries that meet the criteria of the
-- request.
--
-- 'httpStatus', 'listSimulationApplicationsResponse_httpStatus' - The response's http status code.
newListSimulationApplicationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSimulationApplicationsResponse
newListSimulationApplicationsResponse :: Int -> ListSimulationApplicationsResponse
newListSimulationApplicationsResponse Int
pHttpStatus_ =
  ListSimulationApplicationsResponse' :: Maybe Text
-> Maybe [SimulationApplicationSummary]
-> Int
-> ListSimulationApplicationsResponse
ListSimulationApplicationsResponse'
    { $sel:nextToken:ListSimulationApplicationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:simulationApplicationSummaries:ListSimulationApplicationsResponse' :: Maybe [SimulationApplicationSummary]
simulationApplicationSummaries =
        Maybe [SimulationApplicationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSimulationApplicationsResponse' :: 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
-- @ListSimulationApplications@ 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.
listSimulationApplicationsResponse_nextToken :: Lens.Lens' ListSimulationApplicationsResponse (Prelude.Maybe Prelude.Text)
listSimulationApplicationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSimulationApplicationsResponse
-> f ListSimulationApplicationsResponse
listSimulationApplicationsResponse_nextToken = (ListSimulationApplicationsResponse -> Maybe Text)
-> (ListSimulationApplicationsResponse
    -> Maybe Text -> ListSimulationApplicationsResponse)
-> Lens' ListSimulationApplicationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationApplicationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSimulationApplicationsResponse' :: ListSimulationApplicationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSimulationApplicationsResponse
s@ListSimulationApplicationsResponse' {} Maybe Text
a -> ListSimulationApplicationsResponse
s {$sel:nextToken:ListSimulationApplicationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSimulationApplicationsResponse)

-- | A list of simulation application summaries that meet the criteria of the
-- request.
listSimulationApplicationsResponse_simulationApplicationSummaries :: Lens.Lens' ListSimulationApplicationsResponse (Prelude.Maybe [SimulationApplicationSummary])
listSimulationApplicationsResponse_simulationApplicationSummaries :: (Maybe [SimulationApplicationSummary]
 -> f (Maybe [SimulationApplicationSummary]))
-> ListSimulationApplicationsResponse
-> f ListSimulationApplicationsResponse
listSimulationApplicationsResponse_simulationApplicationSummaries = (ListSimulationApplicationsResponse
 -> Maybe [SimulationApplicationSummary])
-> (ListSimulationApplicationsResponse
    -> Maybe [SimulationApplicationSummary]
    -> ListSimulationApplicationsResponse)
-> Lens'
     ListSimulationApplicationsResponse
     (Maybe [SimulationApplicationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSimulationApplicationsResponse' {Maybe [SimulationApplicationSummary]
simulationApplicationSummaries :: Maybe [SimulationApplicationSummary]
$sel:simulationApplicationSummaries:ListSimulationApplicationsResponse' :: ListSimulationApplicationsResponse
-> Maybe [SimulationApplicationSummary]
simulationApplicationSummaries} -> Maybe [SimulationApplicationSummary]
simulationApplicationSummaries) (\s :: ListSimulationApplicationsResponse
s@ListSimulationApplicationsResponse' {} Maybe [SimulationApplicationSummary]
a -> ListSimulationApplicationsResponse
s {$sel:simulationApplicationSummaries:ListSimulationApplicationsResponse' :: Maybe [SimulationApplicationSummary]
simulationApplicationSummaries = Maybe [SimulationApplicationSummary]
a} :: ListSimulationApplicationsResponse) ((Maybe [SimulationApplicationSummary]
  -> f (Maybe [SimulationApplicationSummary]))
 -> ListSimulationApplicationsResponse
 -> f ListSimulationApplicationsResponse)
-> ((Maybe [SimulationApplicationSummary]
     -> f (Maybe [SimulationApplicationSummary]))
    -> Maybe [SimulationApplicationSummary]
    -> f (Maybe [SimulationApplicationSummary]))
-> (Maybe [SimulationApplicationSummary]
    -> f (Maybe [SimulationApplicationSummary]))
-> ListSimulationApplicationsResponse
-> f ListSimulationApplicationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SimulationApplicationSummary]
  [SimulationApplicationSummary]
  [SimulationApplicationSummary]
  [SimulationApplicationSummary]
-> Iso
     (Maybe [SimulationApplicationSummary])
     (Maybe [SimulationApplicationSummary])
     (Maybe [SimulationApplicationSummary])
     (Maybe [SimulationApplicationSummary])
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
  [SimulationApplicationSummary]
  [SimulationApplicationSummary]
  [SimulationApplicationSummary]
  [SimulationApplicationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListSimulationApplicationsResponse