{-# 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.ListWorlds
-- 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)
--
-- Lists worlds.
--
-- This operation returns paginated results.
module Amazonka.RobOMaker.ListWorlds
  ( -- * Creating a Request
    ListWorlds (..),
    newListWorlds,

    -- * Request Lenses
    listWorlds_filters,
    listWorlds_nextToken,
    listWorlds_maxResults,

    -- * Destructuring the Response
    ListWorldsResponse (..),
    newListWorldsResponse,

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

-- |
-- Create a value of 'ListWorlds' 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', 'listWorlds_filters' - Optional filters to limit results. You can use @status@.
--
-- 'nextToken', 'listWorlds_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 @ListWorlds@ 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', 'listWorlds_maxResults' - When this parameter is used, @ListWorlds@ 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
-- @ListWorlds@ request with the returned @nextToken@ value. This value can
-- be between 1 and 100. If this parameter is not used, then @ListWorlds@
-- returns up to 100 results and a @nextToken@ value if applicable.
newListWorlds ::
  ListWorlds
newListWorlds :: ListWorlds
newListWorlds =
  ListWorlds' :: Maybe (NonEmpty Filter) -> Maybe Text -> Maybe Int -> ListWorlds
ListWorlds'
    { $sel:filters:ListWorlds' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListWorlds' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListWorlds' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional filters to limit results. You can use @status@.
listWorlds_filters :: Lens.Lens' ListWorlds (Prelude.Maybe (Prelude.NonEmpty Filter))
listWorlds_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListWorlds -> f ListWorlds
listWorlds_filters = (ListWorlds -> Maybe (NonEmpty Filter))
-> (ListWorlds -> Maybe (NonEmpty Filter) -> ListWorlds)
-> Lens
     ListWorlds
     ListWorlds
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorlds' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListWorlds' :: ListWorlds -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListWorlds
s@ListWorlds' {} Maybe (NonEmpty Filter)
a -> ListWorlds
s {$sel:filters:ListWorlds' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListWorlds) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListWorlds -> f ListWorlds)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListWorlds
-> f ListWorlds
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 @ListWorlds@ 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.
listWorlds_nextToken :: Lens.Lens' ListWorlds (Prelude.Maybe Prelude.Text)
listWorlds_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListWorlds -> f ListWorlds
listWorlds_nextToken = (ListWorlds -> Maybe Text)
-> (ListWorlds -> Maybe Text -> ListWorlds)
-> Lens ListWorlds ListWorlds (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorlds' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorlds' :: ListWorlds -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorlds
s@ListWorlds' {} Maybe Text
a -> ListWorlds
s {$sel:nextToken:ListWorlds' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorlds)

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

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

instance Prelude.NFData ListWorlds

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

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

-- | /See:/ 'newListWorldsResponse' smart constructor.
data ListWorldsResponse = ListWorldsResponse'
  { -- | 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 @ListWorlds@ 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.
    ListWorldsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Summary information for worlds.
    ListWorldsResponse -> Maybe [WorldSummary]
worldSummaries :: Prelude.Maybe [WorldSummary],
    -- | The response's http status code.
    ListWorldsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListWorldsResponse -> ListWorldsResponse -> Bool
(ListWorldsResponse -> ListWorldsResponse -> Bool)
-> (ListWorldsResponse -> ListWorldsResponse -> Bool)
-> Eq ListWorldsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorldsResponse -> ListWorldsResponse -> Bool
$c/= :: ListWorldsResponse -> ListWorldsResponse -> Bool
== :: ListWorldsResponse -> ListWorldsResponse -> Bool
$c== :: ListWorldsResponse -> ListWorldsResponse -> Bool
Prelude.Eq, ReadPrec [ListWorldsResponse]
ReadPrec ListWorldsResponse
Int -> ReadS ListWorldsResponse
ReadS [ListWorldsResponse]
(Int -> ReadS ListWorldsResponse)
-> ReadS [ListWorldsResponse]
-> ReadPrec ListWorldsResponse
-> ReadPrec [ListWorldsResponse]
-> Read ListWorldsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorldsResponse]
$creadListPrec :: ReadPrec [ListWorldsResponse]
readPrec :: ReadPrec ListWorldsResponse
$creadPrec :: ReadPrec ListWorldsResponse
readList :: ReadS [ListWorldsResponse]
$creadList :: ReadS [ListWorldsResponse]
readsPrec :: Int -> ReadS ListWorldsResponse
$creadsPrec :: Int -> ReadS ListWorldsResponse
Prelude.Read, Int -> ListWorldsResponse -> ShowS
[ListWorldsResponse] -> ShowS
ListWorldsResponse -> String
(Int -> ListWorldsResponse -> ShowS)
-> (ListWorldsResponse -> String)
-> ([ListWorldsResponse] -> ShowS)
-> Show ListWorldsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorldsResponse] -> ShowS
$cshowList :: [ListWorldsResponse] -> ShowS
show :: ListWorldsResponse -> String
$cshow :: ListWorldsResponse -> String
showsPrec :: Int -> ListWorldsResponse -> ShowS
$cshowsPrec :: Int -> ListWorldsResponse -> ShowS
Prelude.Show, (forall x. ListWorldsResponse -> Rep ListWorldsResponse x)
-> (forall x. Rep ListWorldsResponse x -> ListWorldsResponse)
-> Generic ListWorldsResponse
forall x. Rep ListWorldsResponse x -> ListWorldsResponse
forall x. ListWorldsResponse -> Rep ListWorldsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorldsResponse x -> ListWorldsResponse
$cfrom :: forall x. ListWorldsResponse -> Rep ListWorldsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListWorldsResponse' 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', 'listWorldsResponse_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 @ListWorlds@ 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.
--
-- 'worldSummaries', 'listWorldsResponse_worldSummaries' - Summary information for worlds.
--
-- 'httpStatus', 'listWorldsResponse_httpStatus' - The response's http status code.
newListWorldsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListWorldsResponse
newListWorldsResponse :: Int -> ListWorldsResponse
newListWorldsResponse Int
pHttpStatus_ =
  ListWorldsResponse' :: Maybe Text -> Maybe [WorldSummary] -> Int -> ListWorldsResponse
ListWorldsResponse'
    { $sel:nextToken:ListWorldsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:worldSummaries:ListWorldsResponse' :: Maybe [WorldSummary]
worldSummaries = Maybe [WorldSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListWorldsResponse' :: 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 @ListWorlds@ 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.
listWorldsResponse_nextToken :: Lens.Lens' ListWorldsResponse (Prelude.Maybe Prelude.Text)
listWorldsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListWorldsResponse -> f ListWorldsResponse
listWorldsResponse_nextToken = (ListWorldsResponse -> Maybe Text)
-> (ListWorldsResponse -> Maybe Text -> ListWorldsResponse)
-> Lens' ListWorldsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorldsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorldsResponse' :: ListWorldsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorldsResponse
s@ListWorldsResponse' {} Maybe Text
a -> ListWorldsResponse
s {$sel:nextToken:ListWorldsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorldsResponse)

-- | Summary information for worlds.
listWorldsResponse_worldSummaries :: Lens.Lens' ListWorldsResponse (Prelude.Maybe [WorldSummary])
listWorldsResponse_worldSummaries :: (Maybe [WorldSummary] -> f (Maybe [WorldSummary]))
-> ListWorldsResponse -> f ListWorldsResponse
listWorldsResponse_worldSummaries = (ListWorldsResponse -> Maybe [WorldSummary])
-> (ListWorldsResponse
    -> Maybe [WorldSummary] -> ListWorldsResponse)
-> Lens' ListWorldsResponse (Maybe [WorldSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorldsResponse' {Maybe [WorldSummary]
worldSummaries :: Maybe [WorldSummary]
$sel:worldSummaries:ListWorldsResponse' :: ListWorldsResponse -> Maybe [WorldSummary]
worldSummaries} -> Maybe [WorldSummary]
worldSummaries) (\s :: ListWorldsResponse
s@ListWorldsResponse' {} Maybe [WorldSummary]
a -> ListWorldsResponse
s {$sel:worldSummaries:ListWorldsResponse' :: Maybe [WorldSummary]
worldSummaries = Maybe [WorldSummary]
a} :: ListWorldsResponse) ((Maybe [WorldSummary] -> f (Maybe [WorldSummary]))
 -> ListWorldsResponse -> f ListWorldsResponse)
-> ((Maybe [WorldSummary] -> f (Maybe [WorldSummary]))
    -> Maybe [WorldSummary] -> f (Maybe [WorldSummary]))
-> (Maybe [WorldSummary] -> f (Maybe [WorldSummary]))
-> ListWorldsResponse
-> f ListWorldsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [WorldSummary] [WorldSummary] [WorldSummary] [WorldSummary]
-> Iso
     (Maybe [WorldSummary])
     (Maybe [WorldSummary])
     (Maybe [WorldSummary])
     (Maybe [WorldSummary])
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 [WorldSummary] [WorldSummary] [WorldSummary] [WorldSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListWorldsResponse