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

    -- * Request Lenses
    listRobotApplications_versionQualifier,
    listRobotApplications_filters,
    listRobotApplications_nextToken,
    listRobotApplications_maxResults,

    -- * Destructuring the Response
    ListRobotApplicationsResponse (..),
    newListRobotApplicationsResponse,

    -- * Response Lenses
    listRobotApplicationsResponse_robotApplicationSummaries,
    listRobotApplicationsResponse_nextToken,
    listRobotApplicationsResponse_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:/ 'newListRobotApplications' smart constructor.
data ListRobotApplications = ListRobotApplications'
  { -- | The version qualifier of the robot application.
    ListRobotApplications -> Maybe Text
versionQualifier :: Prelude.Maybe Prelude.Text,
    -- | Optional 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.
    ListRobotApplications -> 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 @ListRobotApplications@
    -- 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.
    ListRobotApplications -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When this parameter is used, @ListRobotApplications@ 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 @ListRobotApplications@ request with the returned
    -- @nextToken@ value. This value can be between 1 and 100. If this
    -- parameter is not used, then @ListRobotApplications@ returns up to 100
    -- results and a @nextToken@ value if applicable.
    ListRobotApplications -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListRobotApplications -> ListRobotApplications -> Bool
(ListRobotApplications -> ListRobotApplications -> Bool)
-> (ListRobotApplications -> ListRobotApplications -> Bool)
-> Eq ListRobotApplications
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRobotApplications -> ListRobotApplications -> Bool
$c/= :: ListRobotApplications -> ListRobotApplications -> Bool
== :: ListRobotApplications -> ListRobotApplications -> Bool
$c== :: ListRobotApplications -> ListRobotApplications -> Bool
Prelude.Eq, ReadPrec [ListRobotApplications]
ReadPrec ListRobotApplications
Int -> ReadS ListRobotApplications
ReadS [ListRobotApplications]
(Int -> ReadS ListRobotApplications)
-> ReadS [ListRobotApplications]
-> ReadPrec ListRobotApplications
-> ReadPrec [ListRobotApplications]
-> Read ListRobotApplications
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRobotApplications]
$creadListPrec :: ReadPrec [ListRobotApplications]
readPrec :: ReadPrec ListRobotApplications
$creadPrec :: ReadPrec ListRobotApplications
readList :: ReadS [ListRobotApplications]
$creadList :: ReadS [ListRobotApplications]
readsPrec :: Int -> ReadS ListRobotApplications
$creadsPrec :: Int -> ReadS ListRobotApplications
Prelude.Read, Int -> ListRobotApplications -> ShowS
[ListRobotApplications] -> ShowS
ListRobotApplications -> String
(Int -> ListRobotApplications -> ShowS)
-> (ListRobotApplications -> String)
-> ([ListRobotApplications] -> ShowS)
-> Show ListRobotApplications
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRobotApplications] -> ShowS
$cshowList :: [ListRobotApplications] -> ShowS
show :: ListRobotApplications -> String
$cshow :: ListRobotApplications -> String
showsPrec :: Int -> ListRobotApplications -> ShowS
$cshowsPrec :: Int -> ListRobotApplications -> ShowS
Prelude.Show, (forall x. ListRobotApplications -> Rep ListRobotApplications x)
-> (forall x. Rep ListRobotApplications x -> ListRobotApplications)
-> Generic ListRobotApplications
forall x. Rep ListRobotApplications x -> ListRobotApplications
forall x. ListRobotApplications -> Rep ListRobotApplications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRobotApplications x -> ListRobotApplications
$cfrom :: forall x. ListRobotApplications -> Rep ListRobotApplications x
Prelude.Generic)

-- |
-- Create a value of 'ListRobotApplications' 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', 'listRobotApplications_versionQualifier' - The version qualifier of the robot application.
--
-- 'filters', 'listRobotApplications_filters' - Optional 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', 'listRobotApplications_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 @ListRobotApplications@
-- 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', 'listRobotApplications_maxResults' - When this parameter is used, @ListRobotApplications@ 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 @ListRobotApplications@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If this
-- parameter is not used, then @ListRobotApplications@ returns up to 100
-- results and a @nextToken@ value if applicable.
newListRobotApplications ::
  ListRobotApplications
newListRobotApplications :: ListRobotApplications
newListRobotApplications =
  ListRobotApplications' :: Maybe Text
-> Maybe (NonEmpty Filter)
-> Maybe Text
-> Maybe Int
-> ListRobotApplications
ListRobotApplications'
    { $sel:versionQualifier:ListRobotApplications' :: Maybe Text
versionQualifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:ListRobotApplications' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRobotApplications' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRobotApplications' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

-- | Optional 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.
listRobotApplications_filters :: Lens.Lens' ListRobotApplications (Prelude.Maybe (Prelude.NonEmpty Filter))
listRobotApplications_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListRobotApplications -> f ListRobotApplications
listRobotApplications_filters = (ListRobotApplications -> Maybe (NonEmpty Filter))
-> (ListRobotApplications
    -> Maybe (NonEmpty Filter) -> ListRobotApplications)
-> Lens
     ListRobotApplications
     ListRobotApplications
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRobotApplications' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListRobotApplications' :: ListRobotApplications -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListRobotApplications
s@ListRobotApplications' {} Maybe (NonEmpty Filter)
a -> ListRobotApplications
s {$sel:filters:ListRobotApplications' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListRobotApplications) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListRobotApplications -> f ListRobotApplications)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListRobotApplications
-> f ListRobotApplications
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 @ListRobotApplications@
-- 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.
listRobotApplications_nextToken :: Lens.Lens' ListRobotApplications (Prelude.Maybe Prelude.Text)
listRobotApplications_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRobotApplications -> f ListRobotApplications
listRobotApplications_nextToken = (ListRobotApplications -> Maybe Text)
-> (ListRobotApplications -> Maybe Text -> ListRobotApplications)
-> Lens
     ListRobotApplications
     ListRobotApplications
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRobotApplications' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRobotApplications' :: ListRobotApplications -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRobotApplications
s@ListRobotApplications' {} Maybe Text
a -> ListRobotApplications
s {$sel:nextToken:ListRobotApplications' :: Maybe Text
nextToken = Maybe Text
a} :: ListRobotApplications)

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

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

instance Prelude.NFData ListRobotApplications

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

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

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

-- |
-- Create a value of 'ListRobotApplicationsResponse' 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:
--
-- 'robotApplicationSummaries', 'listRobotApplicationsResponse_robotApplicationSummaries' - A list of robot application summaries that meet the criteria of the
-- request.
--
-- 'nextToken', 'listRobotApplicationsResponse_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 @ListRobotApplications@
-- 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', 'listRobotApplicationsResponse_httpStatus' - The response's http status code.
newListRobotApplicationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRobotApplicationsResponse
newListRobotApplicationsResponse :: Int -> ListRobotApplicationsResponse
newListRobotApplicationsResponse Int
pHttpStatus_ =
  ListRobotApplicationsResponse' :: Maybe [RobotApplicationSummary]
-> Maybe Text -> Int -> ListRobotApplicationsResponse
ListRobotApplicationsResponse'
    { $sel:robotApplicationSummaries:ListRobotApplicationsResponse' :: Maybe [RobotApplicationSummary]
robotApplicationSummaries =
        Maybe [RobotApplicationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRobotApplicationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRobotApplicationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of robot application summaries that meet the criteria of the
-- request.
listRobotApplicationsResponse_robotApplicationSummaries :: Lens.Lens' ListRobotApplicationsResponse (Prelude.Maybe [RobotApplicationSummary])
listRobotApplicationsResponse_robotApplicationSummaries :: (Maybe [RobotApplicationSummary]
 -> f (Maybe [RobotApplicationSummary]))
-> ListRobotApplicationsResponse -> f ListRobotApplicationsResponse
listRobotApplicationsResponse_robotApplicationSummaries = (ListRobotApplicationsResponse -> Maybe [RobotApplicationSummary])
-> (ListRobotApplicationsResponse
    -> Maybe [RobotApplicationSummary]
    -> ListRobotApplicationsResponse)
-> Lens'
     ListRobotApplicationsResponse (Maybe [RobotApplicationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRobotApplicationsResponse' {Maybe [RobotApplicationSummary]
robotApplicationSummaries :: Maybe [RobotApplicationSummary]
$sel:robotApplicationSummaries:ListRobotApplicationsResponse' :: ListRobotApplicationsResponse -> Maybe [RobotApplicationSummary]
robotApplicationSummaries} -> Maybe [RobotApplicationSummary]
robotApplicationSummaries) (\s :: ListRobotApplicationsResponse
s@ListRobotApplicationsResponse' {} Maybe [RobotApplicationSummary]
a -> ListRobotApplicationsResponse
s {$sel:robotApplicationSummaries:ListRobotApplicationsResponse' :: Maybe [RobotApplicationSummary]
robotApplicationSummaries = Maybe [RobotApplicationSummary]
a} :: ListRobotApplicationsResponse) ((Maybe [RobotApplicationSummary]
  -> f (Maybe [RobotApplicationSummary]))
 -> ListRobotApplicationsResponse
 -> f ListRobotApplicationsResponse)
-> ((Maybe [RobotApplicationSummary]
     -> f (Maybe [RobotApplicationSummary]))
    -> Maybe [RobotApplicationSummary]
    -> f (Maybe [RobotApplicationSummary]))
-> (Maybe [RobotApplicationSummary]
    -> f (Maybe [RobotApplicationSummary]))
-> ListRobotApplicationsResponse
-> f ListRobotApplicationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RobotApplicationSummary]
  [RobotApplicationSummary]
  [RobotApplicationSummary]
  [RobotApplicationSummary]
-> Iso
     (Maybe [RobotApplicationSummary])
     (Maybe [RobotApplicationSummary])
     (Maybe [RobotApplicationSummary])
     (Maybe [RobotApplicationSummary])
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
  [RobotApplicationSummary]
  [RobotApplicationSummary]
  [RobotApplicationSummary]
  [RobotApplicationSummary]
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 @ListRobotApplications@
-- 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.
listRobotApplicationsResponse_nextToken :: Lens.Lens' ListRobotApplicationsResponse (Prelude.Maybe Prelude.Text)
listRobotApplicationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRobotApplicationsResponse -> f ListRobotApplicationsResponse
listRobotApplicationsResponse_nextToken = (ListRobotApplicationsResponse -> Maybe Text)
-> (ListRobotApplicationsResponse
    -> Maybe Text -> ListRobotApplicationsResponse)
-> Lens' ListRobotApplicationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRobotApplicationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRobotApplicationsResponse' :: ListRobotApplicationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRobotApplicationsResponse
s@ListRobotApplicationsResponse' {} Maybe Text
a -> ListRobotApplicationsResponse
s {$sel:nextToken:ListRobotApplicationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRobotApplicationsResponse)

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

instance Prelude.NFData ListRobotApplicationsResponse