{-# 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.GameLift.ListGameServerGroups
-- 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)
--
-- __This operation is used with the GameLift FleetIQ solution and game
-- server groups.__
--
-- Retrieves information on all game servers groups that exist in the
-- current AWS account for the selected Region. Use the pagination
-- parameters to retrieve results in a set of sequential segments.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html GameLift FleetIQ Guide>
--
-- __Related actions__
--
-- CreateGameServerGroup | ListGameServerGroups | DescribeGameServerGroup |
-- UpdateGameServerGroup | DeleteGameServerGroup | ResumeGameServerGroup |
-- SuspendGameServerGroup | DescribeGameServerInstances |
-- <https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html All APIs by task>
--
-- This operation returns paginated results.
module Amazonka.GameLift.ListGameServerGroups
  ( -- * Creating a Request
    ListGameServerGroups (..),
    newListGameServerGroups,

    -- * Request Lenses
    listGameServerGroups_nextToken,
    listGameServerGroups_limit,

    -- * Destructuring the Response
    ListGameServerGroupsResponse (..),
    newListGameServerGroupsResponse,

    -- * Response Lenses
    listGameServerGroupsResponse_gameServerGroups,
    listGameServerGroupsResponse_nextToken,
    listGameServerGroupsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListGameServerGroups' smart constructor.
data ListGameServerGroups = ListGameServerGroups'
  { -- | A token that indicates the start of the next sequential page of results.
    -- Use the token that is returned with a previous call to this operation.
    -- To start at the beginning of the result set, do not specify a value.
    ListGameServerGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return. Use this parameter with
    -- @NextToken@ to get results as a set of sequential pages.
    ListGameServerGroups -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListGameServerGroups -> ListGameServerGroups -> Bool
(ListGameServerGroups -> ListGameServerGroups -> Bool)
-> (ListGameServerGroups -> ListGameServerGroups -> Bool)
-> Eq ListGameServerGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGameServerGroups -> ListGameServerGroups -> Bool
$c/= :: ListGameServerGroups -> ListGameServerGroups -> Bool
== :: ListGameServerGroups -> ListGameServerGroups -> Bool
$c== :: ListGameServerGroups -> ListGameServerGroups -> Bool
Prelude.Eq, ReadPrec [ListGameServerGroups]
ReadPrec ListGameServerGroups
Int -> ReadS ListGameServerGroups
ReadS [ListGameServerGroups]
(Int -> ReadS ListGameServerGroups)
-> ReadS [ListGameServerGroups]
-> ReadPrec ListGameServerGroups
-> ReadPrec [ListGameServerGroups]
-> Read ListGameServerGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGameServerGroups]
$creadListPrec :: ReadPrec [ListGameServerGroups]
readPrec :: ReadPrec ListGameServerGroups
$creadPrec :: ReadPrec ListGameServerGroups
readList :: ReadS [ListGameServerGroups]
$creadList :: ReadS [ListGameServerGroups]
readsPrec :: Int -> ReadS ListGameServerGroups
$creadsPrec :: Int -> ReadS ListGameServerGroups
Prelude.Read, Int -> ListGameServerGroups -> ShowS
[ListGameServerGroups] -> ShowS
ListGameServerGroups -> String
(Int -> ListGameServerGroups -> ShowS)
-> (ListGameServerGroups -> String)
-> ([ListGameServerGroups] -> ShowS)
-> Show ListGameServerGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGameServerGroups] -> ShowS
$cshowList :: [ListGameServerGroups] -> ShowS
show :: ListGameServerGroups -> String
$cshow :: ListGameServerGroups -> String
showsPrec :: Int -> ListGameServerGroups -> ShowS
$cshowsPrec :: Int -> ListGameServerGroups -> ShowS
Prelude.Show, (forall x. ListGameServerGroups -> Rep ListGameServerGroups x)
-> (forall x. Rep ListGameServerGroups x -> ListGameServerGroups)
-> Generic ListGameServerGroups
forall x. Rep ListGameServerGroups x -> ListGameServerGroups
forall x. ListGameServerGroups -> Rep ListGameServerGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGameServerGroups x -> ListGameServerGroups
$cfrom :: forall x. ListGameServerGroups -> Rep ListGameServerGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListGameServerGroups' 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', 'listGameServerGroups_nextToken' - A token that indicates the start of the next sequential page of results.
-- Use the token that is returned with a previous call to this operation.
-- To start at the beginning of the result set, do not specify a value.
--
-- 'limit', 'listGameServerGroups_limit' - The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages.
newListGameServerGroups ::
  ListGameServerGroups
newListGameServerGroups :: ListGameServerGroups
newListGameServerGroups =
  ListGameServerGroups' :: Maybe Text -> Maybe Natural -> ListGameServerGroups
ListGameServerGroups'
    { $sel:nextToken:ListGameServerGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListGameServerGroups' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token that indicates the start of the next sequential page of results.
-- Use the token that is returned with a previous call to this operation.
-- To start at the beginning of the result set, do not specify a value.
listGameServerGroups_nextToken :: Lens.Lens' ListGameServerGroups (Prelude.Maybe Prelude.Text)
listGameServerGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGameServerGroups -> f ListGameServerGroups
listGameServerGroups_nextToken = (ListGameServerGroups -> Maybe Text)
-> (ListGameServerGroups -> Maybe Text -> ListGameServerGroups)
-> Lens
     ListGameServerGroups ListGameServerGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGameServerGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGameServerGroups' :: ListGameServerGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGameServerGroups
s@ListGameServerGroups' {} Maybe Text
a -> ListGameServerGroups
s {$sel:nextToken:ListGameServerGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListGameServerGroups)

-- | The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages.
listGameServerGroups_limit :: Lens.Lens' ListGameServerGroups (Prelude.Maybe Prelude.Natural)
listGameServerGroups_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListGameServerGroups -> f ListGameServerGroups
listGameServerGroups_limit = (ListGameServerGroups -> Maybe Natural)
-> (ListGameServerGroups -> Maybe Natural -> ListGameServerGroups)
-> Lens
     ListGameServerGroups
     ListGameServerGroups
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGameServerGroups' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListGameServerGroups' :: ListGameServerGroups -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListGameServerGroups
s@ListGameServerGroups' {} Maybe Natural
a -> ListGameServerGroups
s {$sel:limit:ListGameServerGroups' :: Maybe Natural
limit = Maybe Natural
a} :: ListGameServerGroups)

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

instance Prelude.NFData ListGameServerGroups

instance Core.ToHeaders ListGameServerGroups where
  toHeaders :: ListGameServerGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListGameServerGroups -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"GameLift.ListGameServerGroups" ::
                          Prelude.ByteString
                      ),
            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 ListGameServerGroups where
  toJSON :: ListGameServerGroups -> Value
toJSON ListGameServerGroups' {Maybe Natural
Maybe Text
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:limit:ListGameServerGroups' :: ListGameServerGroups -> Maybe Natural
$sel:nextToken:ListGameServerGroups' :: ListGameServerGroups -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit
          ]
      )

instance Core.ToPath ListGameServerGroups where
  toPath :: ListGameServerGroups -> ByteString
toPath = ByteString -> ListGameServerGroups -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListGameServerGroupsResponse' smart constructor.
data ListGameServerGroupsResponse = ListGameServerGroupsResponse'
  { -- | A collection of game server group objects that match the request.
    ListGameServerGroupsResponse -> Maybe [GameServerGroup]
gameServerGroups :: Prelude.Maybe [GameServerGroup],
    -- | A token that indicates where to resume retrieving results on the next
    -- call to this operation. If no token is returned, these results represent
    -- the end of the list.
    ListGameServerGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListGameServerGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListGameServerGroupsResponse
-> ListGameServerGroupsResponse -> Bool
(ListGameServerGroupsResponse
 -> ListGameServerGroupsResponse -> Bool)
-> (ListGameServerGroupsResponse
    -> ListGameServerGroupsResponse -> Bool)
-> Eq ListGameServerGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGameServerGroupsResponse
-> ListGameServerGroupsResponse -> Bool
$c/= :: ListGameServerGroupsResponse
-> ListGameServerGroupsResponse -> Bool
== :: ListGameServerGroupsResponse
-> ListGameServerGroupsResponse -> Bool
$c== :: ListGameServerGroupsResponse
-> ListGameServerGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListGameServerGroupsResponse]
ReadPrec ListGameServerGroupsResponse
Int -> ReadS ListGameServerGroupsResponse
ReadS [ListGameServerGroupsResponse]
(Int -> ReadS ListGameServerGroupsResponse)
-> ReadS [ListGameServerGroupsResponse]
-> ReadPrec ListGameServerGroupsResponse
-> ReadPrec [ListGameServerGroupsResponse]
-> Read ListGameServerGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGameServerGroupsResponse]
$creadListPrec :: ReadPrec [ListGameServerGroupsResponse]
readPrec :: ReadPrec ListGameServerGroupsResponse
$creadPrec :: ReadPrec ListGameServerGroupsResponse
readList :: ReadS [ListGameServerGroupsResponse]
$creadList :: ReadS [ListGameServerGroupsResponse]
readsPrec :: Int -> ReadS ListGameServerGroupsResponse
$creadsPrec :: Int -> ReadS ListGameServerGroupsResponse
Prelude.Read, Int -> ListGameServerGroupsResponse -> ShowS
[ListGameServerGroupsResponse] -> ShowS
ListGameServerGroupsResponse -> String
(Int -> ListGameServerGroupsResponse -> ShowS)
-> (ListGameServerGroupsResponse -> String)
-> ([ListGameServerGroupsResponse] -> ShowS)
-> Show ListGameServerGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGameServerGroupsResponse] -> ShowS
$cshowList :: [ListGameServerGroupsResponse] -> ShowS
show :: ListGameServerGroupsResponse -> String
$cshow :: ListGameServerGroupsResponse -> String
showsPrec :: Int -> ListGameServerGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListGameServerGroupsResponse -> ShowS
Prelude.Show, (forall x.
 ListGameServerGroupsResponse -> Rep ListGameServerGroupsResponse x)
-> (forall x.
    Rep ListGameServerGroupsResponse x -> ListGameServerGroupsResponse)
-> Generic ListGameServerGroupsResponse
forall x.
Rep ListGameServerGroupsResponse x -> ListGameServerGroupsResponse
forall x.
ListGameServerGroupsResponse -> Rep ListGameServerGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGameServerGroupsResponse x -> ListGameServerGroupsResponse
$cfrom :: forall x.
ListGameServerGroupsResponse -> Rep ListGameServerGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListGameServerGroupsResponse' 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:
--
-- 'gameServerGroups', 'listGameServerGroupsResponse_gameServerGroups' - A collection of game server group objects that match the request.
--
-- 'nextToken', 'listGameServerGroupsResponse_nextToken' - A token that indicates where to resume retrieving results on the next
-- call to this operation. If no token is returned, these results represent
-- the end of the list.
--
-- 'httpStatus', 'listGameServerGroupsResponse_httpStatus' - The response's http status code.
newListGameServerGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListGameServerGroupsResponse
newListGameServerGroupsResponse :: Int -> ListGameServerGroupsResponse
newListGameServerGroupsResponse Int
pHttpStatus_ =
  ListGameServerGroupsResponse' :: Maybe [GameServerGroup]
-> Maybe Text -> Int -> ListGameServerGroupsResponse
ListGameServerGroupsResponse'
    { $sel:gameServerGroups:ListGameServerGroupsResponse' :: Maybe [GameServerGroup]
gameServerGroups =
        Maybe [GameServerGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListGameServerGroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListGameServerGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A collection of game server group objects that match the request.
listGameServerGroupsResponse_gameServerGroups :: Lens.Lens' ListGameServerGroupsResponse (Prelude.Maybe [GameServerGroup])
listGameServerGroupsResponse_gameServerGroups :: (Maybe [GameServerGroup] -> f (Maybe [GameServerGroup]))
-> ListGameServerGroupsResponse -> f ListGameServerGroupsResponse
listGameServerGroupsResponse_gameServerGroups = (ListGameServerGroupsResponse -> Maybe [GameServerGroup])
-> (ListGameServerGroupsResponse
    -> Maybe [GameServerGroup] -> ListGameServerGroupsResponse)
-> Lens' ListGameServerGroupsResponse (Maybe [GameServerGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGameServerGroupsResponse' {Maybe [GameServerGroup]
gameServerGroups :: Maybe [GameServerGroup]
$sel:gameServerGroups:ListGameServerGroupsResponse' :: ListGameServerGroupsResponse -> Maybe [GameServerGroup]
gameServerGroups} -> Maybe [GameServerGroup]
gameServerGroups) (\s :: ListGameServerGroupsResponse
s@ListGameServerGroupsResponse' {} Maybe [GameServerGroup]
a -> ListGameServerGroupsResponse
s {$sel:gameServerGroups:ListGameServerGroupsResponse' :: Maybe [GameServerGroup]
gameServerGroups = Maybe [GameServerGroup]
a} :: ListGameServerGroupsResponse) ((Maybe [GameServerGroup] -> f (Maybe [GameServerGroup]))
 -> ListGameServerGroupsResponse -> f ListGameServerGroupsResponse)
-> ((Maybe [GameServerGroup] -> f (Maybe [GameServerGroup]))
    -> Maybe [GameServerGroup] -> f (Maybe [GameServerGroup]))
-> (Maybe [GameServerGroup] -> f (Maybe [GameServerGroup]))
-> ListGameServerGroupsResponse
-> f ListGameServerGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GameServerGroup]
  [GameServerGroup]
  [GameServerGroup]
  [GameServerGroup]
-> Iso
     (Maybe [GameServerGroup])
     (Maybe [GameServerGroup])
     (Maybe [GameServerGroup])
     (Maybe [GameServerGroup])
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
  [GameServerGroup]
  [GameServerGroup]
  [GameServerGroup]
  [GameServerGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token that indicates where to resume retrieving results on the next
-- call to this operation. If no token is returned, these results represent
-- the end of the list.
listGameServerGroupsResponse_nextToken :: Lens.Lens' ListGameServerGroupsResponse (Prelude.Maybe Prelude.Text)
listGameServerGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGameServerGroupsResponse -> f ListGameServerGroupsResponse
listGameServerGroupsResponse_nextToken = (ListGameServerGroupsResponse -> Maybe Text)
-> (ListGameServerGroupsResponse
    -> Maybe Text -> ListGameServerGroupsResponse)
-> Lens' ListGameServerGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGameServerGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGameServerGroupsResponse' :: ListGameServerGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGameServerGroupsResponse
s@ListGameServerGroupsResponse' {} Maybe Text
a -> ListGameServerGroupsResponse
s {$sel:nextToken:ListGameServerGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGameServerGroupsResponse)

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

instance Prelude.NFData ListGameServerGroupsResponse