{-# 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.DescribeFleetLocationAttributes
-- 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)
--
-- Retrieves information on a fleet\'s remote locations, including
-- life-cycle status and any suspended fleet activity.
--
-- This operation can be used in the following ways:
--
-- -   To get data for specific locations, provide a fleet identifier and a
--     list of locations. Location data is returned in the order that it is
--     requested.
--
-- -   To get data for all locations, provide a fleet identifier only.
--     Location data is returned in no particular order.
--
-- When requesting attributes for multiple locations, use the pagination
-- parameters to retrieve results as a set of sequential pages.
--
-- If successful, a @LocationAttributes@ object is returned for each
-- requested location. If the fleet does not have a requested location, no
-- information is returned. This operation does not return the home Region.
-- To get information on a fleet\'s home Region, call
-- @DescribeFleetAttributes@.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html Setting up GameLift fleets>
--
-- __Related actions__
--
-- CreateFleetLocations | DescribeFleetLocationAttributes |
-- DescribeFleetLocationCapacity | DescribeFleetLocationUtilization |
-- DescribeFleetAttributes | DescribeFleetCapacity |
-- DescribeFleetUtilization | UpdateFleetCapacity | StopFleetActions |
-- DeleteFleetLocations |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.DescribeFleetLocationAttributes
  ( -- * Creating a Request
    DescribeFleetLocationAttributes (..),
    newDescribeFleetLocationAttributes,

    -- * Request Lenses
    describeFleetLocationAttributes_nextToken,
    describeFleetLocationAttributes_limit,
    describeFleetLocationAttributes_locations,
    describeFleetLocationAttributes_fleetId,

    -- * Destructuring the Response
    DescribeFleetLocationAttributesResponse (..),
    newDescribeFleetLocationAttributesResponse,

    -- * Response Lenses
    describeFleetLocationAttributesResponse_fleetArn,
    describeFleetLocationAttributesResponse_nextToken,
    describeFleetLocationAttributesResponse_locationAttributes,
    describeFleetLocationAttributesResponse_fleetId,
    describeFleetLocationAttributesResponse_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

-- | Represents the input for a request operation.
--
-- /See:/ 'newDescribeFleetLocationAttributes' smart constructor.
data DescribeFleetLocationAttributes = DescribeFleetLocationAttributes'
  { -- | 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.
    DescribeFleetLocationAttributes -> 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. This limit is
    -- not currently enforced.
    DescribeFleetLocationAttributes -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | A list of fleet locations to retrieve information for. Specify locations
    -- in the form of an AWS Region code, such as @us-west-2@.
    DescribeFleetLocationAttributes -> Maybe (NonEmpty Text)
locations :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A unique identifier for the fleet to retrieve remote locations for. You
    -- can use either the fleet ID or ARN value.
    DescribeFleetLocationAttributes -> Text
fleetId :: Prelude.Text
  }
  deriving (DescribeFleetLocationAttributes
-> DescribeFleetLocationAttributes -> Bool
(DescribeFleetLocationAttributes
 -> DescribeFleetLocationAttributes -> Bool)
-> (DescribeFleetLocationAttributes
    -> DescribeFleetLocationAttributes -> Bool)
-> Eq DescribeFleetLocationAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFleetLocationAttributes
-> DescribeFleetLocationAttributes -> Bool
$c/= :: DescribeFleetLocationAttributes
-> DescribeFleetLocationAttributes -> Bool
== :: DescribeFleetLocationAttributes
-> DescribeFleetLocationAttributes -> Bool
$c== :: DescribeFleetLocationAttributes
-> DescribeFleetLocationAttributes -> Bool
Prelude.Eq, ReadPrec [DescribeFleetLocationAttributes]
ReadPrec DescribeFleetLocationAttributes
Int -> ReadS DescribeFleetLocationAttributes
ReadS [DescribeFleetLocationAttributes]
(Int -> ReadS DescribeFleetLocationAttributes)
-> ReadS [DescribeFleetLocationAttributes]
-> ReadPrec DescribeFleetLocationAttributes
-> ReadPrec [DescribeFleetLocationAttributes]
-> Read DescribeFleetLocationAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFleetLocationAttributes]
$creadListPrec :: ReadPrec [DescribeFleetLocationAttributes]
readPrec :: ReadPrec DescribeFleetLocationAttributes
$creadPrec :: ReadPrec DescribeFleetLocationAttributes
readList :: ReadS [DescribeFleetLocationAttributes]
$creadList :: ReadS [DescribeFleetLocationAttributes]
readsPrec :: Int -> ReadS DescribeFleetLocationAttributes
$creadsPrec :: Int -> ReadS DescribeFleetLocationAttributes
Prelude.Read, Int -> DescribeFleetLocationAttributes -> ShowS
[DescribeFleetLocationAttributes] -> ShowS
DescribeFleetLocationAttributes -> String
(Int -> DescribeFleetLocationAttributes -> ShowS)
-> (DescribeFleetLocationAttributes -> String)
-> ([DescribeFleetLocationAttributes] -> ShowS)
-> Show DescribeFleetLocationAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFleetLocationAttributes] -> ShowS
$cshowList :: [DescribeFleetLocationAttributes] -> ShowS
show :: DescribeFleetLocationAttributes -> String
$cshow :: DescribeFleetLocationAttributes -> String
showsPrec :: Int -> DescribeFleetLocationAttributes -> ShowS
$cshowsPrec :: Int -> DescribeFleetLocationAttributes -> ShowS
Prelude.Show, (forall x.
 DescribeFleetLocationAttributes
 -> Rep DescribeFleetLocationAttributes x)
-> (forall x.
    Rep DescribeFleetLocationAttributes x
    -> DescribeFleetLocationAttributes)
-> Generic DescribeFleetLocationAttributes
forall x.
Rep DescribeFleetLocationAttributes x
-> DescribeFleetLocationAttributes
forall x.
DescribeFleetLocationAttributes
-> Rep DescribeFleetLocationAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFleetLocationAttributes x
-> DescribeFleetLocationAttributes
$cfrom :: forall x.
DescribeFleetLocationAttributes
-> Rep DescribeFleetLocationAttributes x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFleetLocationAttributes' 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', 'describeFleetLocationAttributes_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', 'describeFleetLocationAttributes_limit' - The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages. This limit is
-- not currently enforced.
--
-- 'locations', 'describeFleetLocationAttributes_locations' - A list of fleet locations to retrieve information for. Specify locations
-- in the form of an AWS Region code, such as @us-west-2@.
--
-- 'fleetId', 'describeFleetLocationAttributes_fleetId' - A unique identifier for the fleet to retrieve remote locations for. You
-- can use either the fleet ID or ARN value.
newDescribeFleetLocationAttributes ::
  -- | 'fleetId'
  Prelude.Text ->
  DescribeFleetLocationAttributes
newDescribeFleetLocationAttributes :: Text -> DescribeFleetLocationAttributes
newDescribeFleetLocationAttributes Text
pFleetId_ =
  DescribeFleetLocationAttributes' :: Maybe Text
-> Maybe Natural
-> Maybe (NonEmpty Text)
-> Text
-> DescribeFleetLocationAttributes
DescribeFleetLocationAttributes'
    { $sel:nextToken:DescribeFleetLocationAttributes' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeFleetLocationAttributes' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:locations:DescribeFleetLocationAttributes' :: Maybe (NonEmpty Text)
locations = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetId:DescribeFleetLocationAttributes' :: Text
fleetId = Text
pFleetId_
    }

-- | 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.
describeFleetLocationAttributes_nextToken :: Lens.Lens' DescribeFleetLocationAttributes (Prelude.Maybe Prelude.Text)
describeFleetLocationAttributes_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeFleetLocationAttributes
-> f DescribeFleetLocationAttributes
describeFleetLocationAttributes_nextToken = (DescribeFleetLocationAttributes -> Maybe Text)
-> (DescribeFleetLocationAttributes
    -> Maybe Text -> DescribeFleetLocationAttributes)
-> Lens
     DescribeFleetLocationAttributes
     DescribeFleetLocationAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationAttributes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeFleetLocationAttributes' :: DescribeFleetLocationAttributes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeFleetLocationAttributes
s@DescribeFleetLocationAttributes' {} Maybe Text
a -> DescribeFleetLocationAttributes
s {$sel:nextToken:DescribeFleetLocationAttributes' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeFleetLocationAttributes)

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

-- | A list of fleet locations to retrieve information for. Specify locations
-- in the form of an AWS Region code, such as @us-west-2@.
describeFleetLocationAttributes_locations :: Lens.Lens' DescribeFleetLocationAttributes (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeFleetLocationAttributes_locations :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeFleetLocationAttributes
-> f DescribeFleetLocationAttributes
describeFleetLocationAttributes_locations = (DescribeFleetLocationAttributes -> Maybe (NonEmpty Text))
-> (DescribeFleetLocationAttributes
    -> Maybe (NonEmpty Text) -> DescribeFleetLocationAttributes)
-> Lens
     DescribeFleetLocationAttributes
     DescribeFleetLocationAttributes
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationAttributes' {Maybe (NonEmpty Text)
locations :: Maybe (NonEmpty Text)
$sel:locations:DescribeFleetLocationAttributes' :: DescribeFleetLocationAttributes -> Maybe (NonEmpty Text)
locations} -> Maybe (NonEmpty Text)
locations) (\s :: DescribeFleetLocationAttributes
s@DescribeFleetLocationAttributes' {} Maybe (NonEmpty Text)
a -> DescribeFleetLocationAttributes
s {$sel:locations:DescribeFleetLocationAttributes' :: Maybe (NonEmpty Text)
locations = Maybe (NonEmpty Text)
a} :: DescribeFleetLocationAttributes) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> DescribeFleetLocationAttributes
 -> f DescribeFleetLocationAttributes)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeFleetLocationAttributes
-> f DescribeFleetLocationAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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 Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique identifier for the fleet to retrieve remote locations for. You
-- can use either the fleet ID or ARN value.
describeFleetLocationAttributes_fleetId :: Lens.Lens' DescribeFleetLocationAttributes Prelude.Text
describeFleetLocationAttributes_fleetId :: (Text -> f Text)
-> DescribeFleetLocationAttributes
-> f DescribeFleetLocationAttributes
describeFleetLocationAttributes_fleetId = (DescribeFleetLocationAttributes -> Text)
-> (DescribeFleetLocationAttributes
    -> Text -> DescribeFleetLocationAttributes)
-> Lens
     DescribeFleetLocationAttributes
     DescribeFleetLocationAttributes
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationAttributes' {Text
fleetId :: Text
$sel:fleetId:DescribeFleetLocationAttributes' :: DescribeFleetLocationAttributes -> Text
fleetId} -> Text
fleetId) (\s :: DescribeFleetLocationAttributes
s@DescribeFleetLocationAttributes' {} Text
a -> DescribeFleetLocationAttributes
s {$sel:fleetId:DescribeFleetLocationAttributes' :: Text
fleetId = Text
a} :: DescribeFleetLocationAttributes)

instance
  Core.AWSRequest
    DescribeFleetLocationAttributes
  where
  type
    AWSResponse DescribeFleetLocationAttributes =
      DescribeFleetLocationAttributesResponse
  request :: DescribeFleetLocationAttributes
-> Request DescribeFleetLocationAttributes
request = Service
-> DescribeFleetLocationAttributes
-> Request DescribeFleetLocationAttributes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeFleetLocationAttributes
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeFleetLocationAttributes)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeFleetLocationAttributes))
-> Logger
-> Service
-> Proxy DescribeFleetLocationAttributes
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeFleetLocationAttributes)))
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 Text
-> Maybe [LocationAttributes]
-> Maybe Text
-> Int
-> DescribeFleetLocationAttributesResponse
DescribeFleetLocationAttributesResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [LocationAttributes]
 -> Maybe Text
 -> Int
 -> DescribeFleetLocationAttributesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [LocationAttributes]
      -> Maybe Text
      -> Int
      -> DescribeFleetLocationAttributesResponse)
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
"FleetArn")
            Either
  String
  (Maybe Text
   -> Maybe [LocationAttributes]
   -> Maybe Text
   -> Int
   -> DescribeFleetLocationAttributesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [LocationAttributes]
      -> Maybe Text -> Int -> DescribeFleetLocationAttributesResponse)
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
  (Maybe [LocationAttributes]
   -> Maybe Text -> Int -> DescribeFleetLocationAttributesResponse)
-> Either String (Maybe [LocationAttributes])
-> Either
     String
     (Maybe Text -> Int -> DescribeFleetLocationAttributesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [LocationAttributes]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LocationAttributes"
                            Either String (Maybe (Maybe [LocationAttributes]))
-> Maybe [LocationAttributes]
-> Either String (Maybe [LocationAttributes])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [LocationAttributes]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text -> Int -> DescribeFleetLocationAttributesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeFleetLocationAttributesResponse)
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
"FleetId")
            Either String (Int -> DescribeFleetLocationAttributesResponse)
-> Either String Int
-> Either String DescribeFleetLocationAttributesResponse
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
    DescribeFleetLocationAttributes

instance
  Prelude.NFData
    DescribeFleetLocationAttributes

instance
  Core.ToHeaders
    DescribeFleetLocationAttributes
  where
  toHeaders :: DescribeFleetLocationAttributes -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DescribeFleetLocationAttributes -> 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.DescribeFleetLocationAttributes" ::
                          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 DescribeFleetLocationAttributes where
  toJSON :: DescribeFleetLocationAttributes -> Value
toJSON DescribeFleetLocationAttributes' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Text
fleetId :: Text
locations :: Maybe (NonEmpty Text)
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:fleetId:DescribeFleetLocationAttributes' :: DescribeFleetLocationAttributes -> Text
$sel:locations:DescribeFleetLocationAttributes' :: DescribeFleetLocationAttributes -> Maybe (NonEmpty Text)
$sel:limit:DescribeFleetLocationAttributes' :: DescribeFleetLocationAttributes -> Maybe Natural
$sel:nextToken:DescribeFleetLocationAttributes' :: DescribeFleetLocationAttributes -> 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,
            (Text
"Locations" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
locations,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetId)
          ]
      )

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

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

-- | Represents the returned data in response to a request operation.
--
-- /See:/ 'newDescribeFleetLocationAttributesResponse' smart constructor.
data DescribeFleetLocationAttributesResponse = DescribeFleetLocationAttributesResponse'
  { -- | The Amazon Resource Name
    -- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
    -- that is assigned to a GameLift fleet resource and uniquely identifies
    -- it. ARNs are unique across all Regions. Format is
    -- @arn:aws:gamelift:\<region>::fleet\/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912@.
    DescribeFleetLocationAttributesResponse -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
    -- | 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.
    DescribeFleetLocationAttributesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Location-specific information on the requested fleet\'s remote
    -- locations.
    DescribeFleetLocationAttributesResponse
-> Maybe [LocationAttributes]
locationAttributes :: Prelude.Maybe [LocationAttributes],
    -- | A unique identifier for the fleet that location attributes were
    -- requested for.
    DescribeFleetLocationAttributesResponse -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeFleetLocationAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeFleetLocationAttributesResponse
-> DescribeFleetLocationAttributesResponse -> Bool
(DescribeFleetLocationAttributesResponse
 -> DescribeFleetLocationAttributesResponse -> Bool)
-> (DescribeFleetLocationAttributesResponse
    -> DescribeFleetLocationAttributesResponse -> Bool)
-> Eq DescribeFleetLocationAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFleetLocationAttributesResponse
-> DescribeFleetLocationAttributesResponse -> Bool
$c/= :: DescribeFleetLocationAttributesResponse
-> DescribeFleetLocationAttributesResponse -> Bool
== :: DescribeFleetLocationAttributesResponse
-> DescribeFleetLocationAttributesResponse -> Bool
$c== :: DescribeFleetLocationAttributesResponse
-> DescribeFleetLocationAttributesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFleetLocationAttributesResponse]
ReadPrec DescribeFleetLocationAttributesResponse
Int -> ReadS DescribeFleetLocationAttributesResponse
ReadS [DescribeFleetLocationAttributesResponse]
(Int -> ReadS DescribeFleetLocationAttributesResponse)
-> ReadS [DescribeFleetLocationAttributesResponse]
-> ReadPrec DescribeFleetLocationAttributesResponse
-> ReadPrec [DescribeFleetLocationAttributesResponse]
-> Read DescribeFleetLocationAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFleetLocationAttributesResponse]
$creadListPrec :: ReadPrec [DescribeFleetLocationAttributesResponse]
readPrec :: ReadPrec DescribeFleetLocationAttributesResponse
$creadPrec :: ReadPrec DescribeFleetLocationAttributesResponse
readList :: ReadS [DescribeFleetLocationAttributesResponse]
$creadList :: ReadS [DescribeFleetLocationAttributesResponse]
readsPrec :: Int -> ReadS DescribeFleetLocationAttributesResponse
$creadsPrec :: Int -> ReadS DescribeFleetLocationAttributesResponse
Prelude.Read, Int -> DescribeFleetLocationAttributesResponse -> ShowS
[DescribeFleetLocationAttributesResponse] -> ShowS
DescribeFleetLocationAttributesResponse -> String
(Int -> DescribeFleetLocationAttributesResponse -> ShowS)
-> (DescribeFleetLocationAttributesResponse -> String)
-> ([DescribeFleetLocationAttributesResponse] -> ShowS)
-> Show DescribeFleetLocationAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFleetLocationAttributesResponse] -> ShowS
$cshowList :: [DescribeFleetLocationAttributesResponse] -> ShowS
show :: DescribeFleetLocationAttributesResponse -> String
$cshow :: DescribeFleetLocationAttributesResponse -> String
showsPrec :: Int -> DescribeFleetLocationAttributesResponse -> ShowS
$cshowsPrec :: Int -> DescribeFleetLocationAttributesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeFleetLocationAttributesResponse
 -> Rep DescribeFleetLocationAttributesResponse x)
-> (forall x.
    Rep DescribeFleetLocationAttributesResponse x
    -> DescribeFleetLocationAttributesResponse)
-> Generic DescribeFleetLocationAttributesResponse
forall x.
Rep DescribeFleetLocationAttributesResponse x
-> DescribeFleetLocationAttributesResponse
forall x.
DescribeFleetLocationAttributesResponse
-> Rep DescribeFleetLocationAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFleetLocationAttributesResponse x
-> DescribeFleetLocationAttributesResponse
$cfrom :: forall x.
DescribeFleetLocationAttributesResponse
-> Rep DescribeFleetLocationAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFleetLocationAttributesResponse' 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:
--
-- 'fleetArn', 'describeFleetLocationAttributesResponse_fleetArn' - The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- that is assigned to a GameLift fleet resource and uniquely identifies
-- it. ARNs are unique across all Regions. Format is
-- @arn:aws:gamelift:\<region>::fleet\/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912@.
--
-- 'nextToken', 'describeFleetLocationAttributesResponse_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.
--
-- 'locationAttributes', 'describeFleetLocationAttributesResponse_locationAttributes' - Location-specific information on the requested fleet\'s remote
-- locations.
--
-- 'fleetId', 'describeFleetLocationAttributesResponse_fleetId' - A unique identifier for the fleet that location attributes were
-- requested for.
--
-- 'httpStatus', 'describeFleetLocationAttributesResponse_httpStatus' - The response's http status code.
newDescribeFleetLocationAttributesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeFleetLocationAttributesResponse
newDescribeFleetLocationAttributesResponse :: Int -> DescribeFleetLocationAttributesResponse
newDescribeFleetLocationAttributesResponse
  Int
pHttpStatus_ =
    DescribeFleetLocationAttributesResponse' :: Maybe Text
-> Maybe Text
-> Maybe [LocationAttributes]
-> Maybe Text
-> Int
-> DescribeFleetLocationAttributesResponse
DescribeFleetLocationAttributesResponse'
      { $sel:fleetArn:DescribeFleetLocationAttributesResponse' :: Maybe Text
fleetArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeFleetLocationAttributesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:locationAttributes:DescribeFleetLocationAttributesResponse' :: Maybe [LocationAttributes]
locationAttributes =
          Maybe [LocationAttributes]
forall a. Maybe a
Prelude.Nothing,
        $sel:fleetId:DescribeFleetLocationAttributesResponse' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeFleetLocationAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- that is assigned to a GameLift fleet resource and uniquely identifies
-- it. ARNs are unique across all Regions. Format is
-- @arn:aws:gamelift:\<region>::fleet\/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912@.
describeFleetLocationAttributesResponse_fleetArn :: Lens.Lens' DescribeFleetLocationAttributesResponse (Prelude.Maybe Prelude.Text)
describeFleetLocationAttributesResponse_fleetArn :: (Maybe Text -> f (Maybe Text))
-> DescribeFleetLocationAttributesResponse
-> f DescribeFleetLocationAttributesResponse
describeFleetLocationAttributesResponse_fleetArn = (DescribeFleetLocationAttributesResponse -> Maybe Text)
-> (DescribeFleetLocationAttributesResponse
    -> Maybe Text -> DescribeFleetLocationAttributesResponse)
-> Lens
     DescribeFleetLocationAttributesResponse
     DescribeFleetLocationAttributesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationAttributesResponse' {Maybe Text
fleetArn :: Maybe Text
$sel:fleetArn:DescribeFleetLocationAttributesResponse' :: DescribeFleetLocationAttributesResponse -> Maybe Text
fleetArn} -> Maybe Text
fleetArn) (\s :: DescribeFleetLocationAttributesResponse
s@DescribeFleetLocationAttributesResponse' {} Maybe Text
a -> DescribeFleetLocationAttributesResponse
s {$sel:fleetArn:DescribeFleetLocationAttributesResponse' :: Maybe Text
fleetArn = Maybe Text
a} :: DescribeFleetLocationAttributesResponse)

-- | 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.
describeFleetLocationAttributesResponse_nextToken :: Lens.Lens' DescribeFleetLocationAttributesResponse (Prelude.Maybe Prelude.Text)
describeFleetLocationAttributesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeFleetLocationAttributesResponse
-> f DescribeFleetLocationAttributesResponse
describeFleetLocationAttributesResponse_nextToken = (DescribeFleetLocationAttributesResponse -> Maybe Text)
-> (DescribeFleetLocationAttributesResponse
    -> Maybe Text -> DescribeFleetLocationAttributesResponse)
-> Lens
     DescribeFleetLocationAttributesResponse
     DescribeFleetLocationAttributesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationAttributesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeFleetLocationAttributesResponse' :: DescribeFleetLocationAttributesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeFleetLocationAttributesResponse
s@DescribeFleetLocationAttributesResponse' {} Maybe Text
a -> DescribeFleetLocationAttributesResponse
s {$sel:nextToken:DescribeFleetLocationAttributesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeFleetLocationAttributesResponse)

-- | Location-specific information on the requested fleet\'s remote
-- locations.
describeFleetLocationAttributesResponse_locationAttributes :: Lens.Lens' DescribeFleetLocationAttributesResponse (Prelude.Maybe [LocationAttributes])
describeFleetLocationAttributesResponse_locationAttributes :: (Maybe [LocationAttributes] -> f (Maybe [LocationAttributes]))
-> DescribeFleetLocationAttributesResponse
-> f DescribeFleetLocationAttributesResponse
describeFleetLocationAttributesResponse_locationAttributes = (DescribeFleetLocationAttributesResponse
 -> Maybe [LocationAttributes])
-> (DescribeFleetLocationAttributesResponse
    -> Maybe [LocationAttributes]
    -> DescribeFleetLocationAttributesResponse)
-> Lens
     DescribeFleetLocationAttributesResponse
     DescribeFleetLocationAttributesResponse
     (Maybe [LocationAttributes])
     (Maybe [LocationAttributes])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationAttributesResponse' {Maybe [LocationAttributes]
locationAttributes :: Maybe [LocationAttributes]
$sel:locationAttributes:DescribeFleetLocationAttributesResponse' :: DescribeFleetLocationAttributesResponse
-> Maybe [LocationAttributes]
locationAttributes} -> Maybe [LocationAttributes]
locationAttributes) (\s :: DescribeFleetLocationAttributesResponse
s@DescribeFleetLocationAttributesResponse' {} Maybe [LocationAttributes]
a -> DescribeFleetLocationAttributesResponse
s {$sel:locationAttributes:DescribeFleetLocationAttributesResponse' :: Maybe [LocationAttributes]
locationAttributes = Maybe [LocationAttributes]
a} :: DescribeFleetLocationAttributesResponse) ((Maybe [LocationAttributes] -> f (Maybe [LocationAttributes]))
 -> DescribeFleetLocationAttributesResponse
 -> f DescribeFleetLocationAttributesResponse)
-> ((Maybe [LocationAttributes] -> f (Maybe [LocationAttributes]))
    -> Maybe [LocationAttributes] -> f (Maybe [LocationAttributes]))
-> (Maybe [LocationAttributes] -> f (Maybe [LocationAttributes]))
-> DescribeFleetLocationAttributesResponse
-> f DescribeFleetLocationAttributesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LocationAttributes]
  [LocationAttributes]
  [LocationAttributes]
  [LocationAttributes]
-> Iso
     (Maybe [LocationAttributes])
     (Maybe [LocationAttributes])
     (Maybe [LocationAttributes])
     (Maybe [LocationAttributes])
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
  [LocationAttributes]
  [LocationAttributes]
  [LocationAttributes]
  [LocationAttributes]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique identifier for the fleet that location attributes were
-- requested for.
describeFleetLocationAttributesResponse_fleetId :: Lens.Lens' DescribeFleetLocationAttributesResponse (Prelude.Maybe Prelude.Text)
describeFleetLocationAttributesResponse_fleetId :: (Maybe Text -> f (Maybe Text))
-> DescribeFleetLocationAttributesResponse
-> f DescribeFleetLocationAttributesResponse
describeFleetLocationAttributesResponse_fleetId = (DescribeFleetLocationAttributesResponse -> Maybe Text)
-> (DescribeFleetLocationAttributesResponse
    -> Maybe Text -> DescribeFleetLocationAttributesResponse)
-> Lens
     DescribeFleetLocationAttributesResponse
     DescribeFleetLocationAttributesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetLocationAttributesResponse' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:DescribeFleetLocationAttributesResponse' :: DescribeFleetLocationAttributesResponse -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: DescribeFleetLocationAttributesResponse
s@DescribeFleetLocationAttributesResponse' {} Maybe Text
a -> DescribeFleetLocationAttributesResponse
s {$sel:fleetId:DescribeFleetLocationAttributesResponse' :: Maybe Text
fleetId = Maybe Text
a} :: DescribeFleetLocationAttributesResponse)

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

instance
  Prelude.NFData
    DescribeFleetLocationAttributesResponse