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

    -- * Request Lenses
    listRobots_filters,
    listRobots_nextToken,
    listRobots_maxResults,

    -- * Destructuring the Response
    ListRobotsResponse (..),
    newListRobotsResponse,

    -- * Response Lenses
    listRobotsResponse_robots,
    listRobotsResponse_nextToken,
    listRobotsResponse_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:/ 'newListRobots' smart constructor.
data ListRobots = ListRobots'
  { -- | Optional filters to limit results.
    --
    -- The filter names @status@ and @fleetName@ 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 @Registered@ or the status
    -- @Available@.
    ListRobots -> 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 @ListRobots@ 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.
    ListRobots -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | When this parameter is used, @ListRobots@ 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
    -- @ListRobots@ request with the returned @nextToken@ value. This value can
    -- be between 1 and 200. If this parameter is not used, then @ListRobots@
    -- returns up to 200 results and a @nextToken@ value if applicable.
    ListRobots -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (ListRobots -> ListRobots -> Bool
(ListRobots -> ListRobots -> Bool)
-> (ListRobots -> ListRobots -> Bool) -> Eq ListRobots
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRobots -> ListRobots -> Bool
$c/= :: ListRobots -> ListRobots -> Bool
== :: ListRobots -> ListRobots -> Bool
$c== :: ListRobots -> ListRobots -> Bool
Prelude.Eq, ReadPrec [ListRobots]
ReadPrec ListRobots
Int -> ReadS ListRobots
ReadS [ListRobots]
(Int -> ReadS ListRobots)
-> ReadS [ListRobots]
-> ReadPrec ListRobots
-> ReadPrec [ListRobots]
-> Read ListRobots
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRobots]
$creadListPrec :: ReadPrec [ListRobots]
readPrec :: ReadPrec ListRobots
$creadPrec :: ReadPrec ListRobots
readList :: ReadS [ListRobots]
$creadList :: ReadS [ListRobots]
readsPrec :: Int -> ReadS ListRobots
$creadsPrec :: Int -> ReadS ListRobots
Prelude.Read, Int -> ListRobots -> ShowS
[ListRobots] -> ShowS
ListRobots -> String
(Int -> ListRobots -> ShowS)
-> (ListRobots -> String)
-> ([ListRobots] -> ShowS)
-> Show ListRobots
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRobots] -> ShowS
$cshowList :: [ListRobots] -> ShowS
show :: ListRobots -> String
$cshow :: ListRobots -> String
showsPrec :: Int -> ListRobots -> ShowS
$cshowsPrec :: Int -> ListRobots -> ShowS
Prelude.Show, (forall x. ListRobots -> Rep ListRobots x)
-> (forall x. Rep ListRobots x -> ListRobots) -> Generic ListRobots
forall x. Rep ListRobots x -> ListRobots
forall x. ListRobots -> Rep ListRobots x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRobots x -> ListRobots
$cfrom :: forall x. ListRobots -> Rep ListRobots x
Prelude.Generic)

-- |
-- Create a value of 'ListRobots' 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', 'listRobots_filters' - Optional filters to limit results.
--
-- The filter names @status@ and @fleetName@ 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 @Registered@ or the status
-- @Available@.
--
-- 'nextToken', 'listRobots_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 @ListRobots@ 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', 'listRobots_maxResults' - When this parameter is used, @ListRobots@ 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
-- @ListRobots@ request with the returned @nextToken@ value. This value can
-- be between 1 and 200. If this parameter is not used, then @ListRobots@
-- returns up to 200 results and a @nextToken@ value if applicable.
newListRobots ::
  ListRobots
newListRobots :: ListRobots
newListRobots =
  ListRobots' :: Maybe (NonEmpty Filter) -> Maybe Text -> Maybe Int -> ListRobots
ListRobots'
    { $sel:filters:ListRobots' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRobots' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRobots' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional filters to limit results.
--
-- The filter names @status@ and @fleetName@ 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 @Registered@ or the status
-- @Available@.
listRobots_filters :: Lens.Lens' ListRobots (Prelude.Maybe (Prelude.NonEmpty Filter))
listRobots_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListRobots -> f ListRobots
listRobots_filters = (ListRobots -> Maybe (NonEmpty Filter))
-> (ListRobots -> Maybe (NonEmpty Filter) -> ListRobots)
-> Lens
     ListRobots
     ListRobots
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRobots' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListRobots' :: ListRobots -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListRobots
s@ListRobots' {} Maybe (NonEmpty Filter)
a -> ListRobots
s {$sel:filters:ListRobots' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListRobots) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListRobots -> f ListRobots)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListRobots
-> f ListRobots
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 @ListRobots@ 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.
listRobots_nextToken :: Lens.Lens' ListRobots (Prelude.Maybe Prelude.Text)
listRobots_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListRobots -> f ListRobots
listRobots_nextToken = (ListRobots -> Maybe Text)
-> (ListRobots -> Maybe Text -> ListRobots)
-> Lens ListRobots ListRobots (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRobots' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRobots' :: ListRobots -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRobots
s@ListRobots' {} Maybe Text
a -> ListRobots
s {$sel:nextToken:ListRobots' :: Maybe Text
nextToken = Maybe Text
a} :: ListRobots)

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

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

instance Prelude.NFData ListRobots

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

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

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

-- |
-- Create a value of 'ListRobotsResponse' 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:
--
-- 'robots', 'listRobotsResponse_robots' - A list of robots that meet the criteria of the request.
--
-- 'nextToken', 'listRobotsResponse_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 @ListRobots@ 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', 'listRobotsResponse_httpStatus' - The response's http status code.
newListRobotsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRobotsResponse
newListRobotsResponse :: Int -> ListRobotsResponse
newListRobotsResponse Int
pHttpStatus_ =
  ListRobotsResponse' :: Maybe [Robot] -> Maybe Text -> Int -> ListRobotsResponse
ListRobotsResponse'
    { $sel:robots:ListRobotsResponse' :: Maybe [Robot]
robots = Maybe [Robot]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRobotsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRobotsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of robots that meet the criteria of the request.
listRobotsResponse_robots :: Lens.Lens' ListRobotsResponse (Prelude.Maybe [Robot])
listRobotsResponse_robots :: (Maybe [Robot] -> f (Maybe [Robot]))
-> ListRobotsResponse -> f ListRobotsResponse
listRobotsResponse_robots = (ListRobotsResponse -> Maybe [Robot])
-> (ListRobotsResponse -> Maybe [Robot] -> ListRobotsResponse)
-> Lens' ListRobotsResponse (Maybe [Robot])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRobotsResponse' {Maybe [Robot]
robots :: Maybe [Robot]
$sel:robots:ListRobotsResponse' :: ListRobotsResponse -> Maybe [Robot]
robots} -> Maybe [Robot]
robots) (\s :: ListRobotsResponse
s@ListRobotsResponse' {} Maybe [Robot]
a -> ListRobotsResponse
s {$sel:robots:ListRobotsResponse' :: Maybe [Robot]
robots = Maybe [Robot]
a} :: ListRobotsResponse) ((Maybe [Robot] -> f (Maybe [Robot]))
 -> ListRobotsResponse -> f ListRobotsResponse)
-> ((Maybe [Robot] -> f (Maybe [Robot]))
    -> Maybe [Robot] -> f (Maybe [Robot]))
-> (Maybe [Robot] -> f (Maybe [Robot]))
-> ListRobotsResponse
-> f ListRobotsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Robot] [Robot] [Robot] [Robot]
-> Iso
     (Maybe [Robot]) (Maybe [Robot]) (Maybe [Robot]) (Maybe [Robot])
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 [Robot] [Robot] [Robot] [Robot]
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 @ListRobots@ 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.
listRobotsResponse_nextToken :: Lens.Lens' ListRobotsResponse (Prelude.Maybe Prelude.Text)
listRobotsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRobotsResponse -> f ListRobotsResponse
listRobotsResponse_nextToken = (ListRobotsResponse -> Maybe Text)
-> (ListRobotsResponse -> Maybe Text -> ListRobotsResponse)
-> Lens' ListRobotsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRobotsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRobotsResponse' :: ListRobotsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRobotsResponse
s@ListRobotsResponse' {} Maybe Text
a -> ListRobotsResponse
s {$sel:nextToken:ListRobotsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRobotsResponse)

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

instance Prelude.NFData ListRobotsResponse