{-# 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.DescribeFleetAttributes
-- 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 core fleet-wide properties, including the computing hardware
-- and deployment configuration for all instances in the fleet.
--
-- This operation can be used in the following ways:
--
-- -   To get attributes for one or more specific fleets, provide a list of
--     fleet IDs or fleet ARNs.
--
-- -   To get attributes for all fleets, do not provide a fleet identifier.
--
-- When requesting attributes for multiple fleets, use the pagination
-- parameters to retrieve results as a set of sequential pages.
--
-- If successful, a @FleetAttributes@ object is returned for each fleet
-- requested, unless the fleet identifier is not found.
--
-- Some API operations limit the number of fleet IDs that allowed in one
-- request. If a request exceeds this limit, the request fails and the
-- error message contains the maximum allowed number.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html Setting up GameLift fleets>
--
-- __Related actions__
--
-- ListFleets | DescribeEC2InstanceLimits | DescribeFleetAttributes |
-- DescribeFleetCapacity | DescribeFleetEvents |
-- DescribeFleetLocationAttributes | DescribeFleetPortSettings |
-- DescribeFleetUtilization | DescribeRuntimeConfiguration |
-- DescribeScalingPolicies |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
--
-- This operation returns paginated results.
module Amazonka.GameLift.DescribeFleetAttributes
  ( -- * Creating a Request
    DescribeFleetAttributes (..),
    newDescribeFleetAttributes,

    -- * Request Lenses
    describeFleetAttributes_nextToken,
    describeFleetAttributes_limit,
    describeFleetAttributes_fleetIds,

    -- * Destructuring the Response
    DescribeFleetAttributesResponse (..),
    newDescribeFleetAttributesResponse,

    -- * Response Lenses
    describeFleetAttributesResponse_nextToken,
    describeFleetAttributesResponse_fleetAttributes,
    describeFleetAttributesResponse_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:/ 'newDescribeFleetAttributes' smart constructor.
data DescribeFleetAttributes = DescribeFleetAttributes'
  { -- | 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.
    -- This parameter is ignored when the request specifies one or a list of
    -- fleet IDs.
    DescribeFleetAttributes -> 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 parameter
    -- is ignored when the request specifies one or a list of fleet IDs.
    DescribeFleetAttributes -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | A list of unique fleet identifiers to retrieve attributes for. You can
    -- use either the fleet ID or ARN value. To retrieve attributes for all
    -- current fleets, do not include this parameter.
    DescribeFleetAttributes -> Maybe (NonEmpty Text)
fleetIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (DescribeFleetAttributes -> DescribeFleetAttributes -> Bool
(DescribeFleetAttributes -> DescribeFleetAttributes -> Bool)
-> (DescribeFleetAttributes -> DescribeFleetAttributes -> Bool)
-> Eq DescribeFleetAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFleetAttributes -> DescribeFleetAttributes -> Bool
$c/= :: DescribeFleetAttributes -> DescribeFleetAttributes -> Bool
== :: DescribeFleetAttributes -> DescribeFleetAttributes -> Bool
$c== :: DescribeFleetAttributes -> DescribeFleetAttributes -> Bool
Prelude.Eq, ReadPrec [DescribeFleetAttributes]
ReadPrec DescribeFleetAttributes
Int -> ReadS DescribeFleetAttributes
ReadS [DescribeFleetAttributes]
(Int -> ReadS DescribeFleetAttributes)
-> ReadS [DescribeFleetAttributes]
-> ReadPrec DescribeFleetAttributes
-> ReadPrec [DescribeFleetAttributes]
-> Read DescribeFleetAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFleetAttributes]
$creadListPrec :: ReadPrec [DescribeFleetAttributes]
readPrec :: ReadPrec DescribeFleetAttributes
$creadPrec :: ReadPrec DescribeFleetAttributes
readList :: ReadS [DescribeFleetAttributes]
$creadList :: ReadS [DescribeFleetAttributes]
readsPrec :: Int -> ReadS DescribeFleetAttributes
$creadsPrec :: Int -> ReadS DescribeFleetAttributes
Prelude.Read, Int -> DescribeFleetAttributes -> ShowS
[DescribeFleetAttributes] -> ShowS
DescribeFleetAttributes -> String
(Int -> DescribeFleetAttributes -> ShowS)
-> (DescribeFleetAttributes -> String)
-> ([DescribeFleetAttributes] -> ShowS)
-> Show DescribeFleetAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFleetAttributes] -> ShowS
$cshowList :: [DescribeFleetAttributes] -> ShowS
show :: DescribeFleetAttributes -> String
$cshow :: DescribeFleetAttributes -> String
showsPrec :: Int -> DescribeFleetAttributes -> ShowS
$cshowsPrec :: Int -> DescribeFleetAttributes -> ShowS
Prelude.Show, (forall x.
 DescribeFleetAttributes -> Rep DescribeFleetAttributes x)
-> (forall x.
    Rep DescribeFleetAttributes x -> DescribeFleetAttributes)
-> Generic DescribeFleetAttributes
forall x. Rep DescribeFleetAttributes x -> DescribeFleetAttributes
forall x. DescribeFleetAttributes -> Rep DescribeFleetAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFleetAttributes x -> DescribeFleetAttributes
$cfrom :: forall x. DescribeFleetAttributes -> Rep DescribeFleetAttributes x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFleetAttributes' 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', 'describeFleetAttributes_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.
-- This parameter is ignored when the request specifies one or a list of
-- fleet IDs.
--
-- 'limit', 'describeFleetAttributes_limit' - The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages. This parameter
-- is ignored when the request specifies one or a list of fleet IDs.
--
-- 'fleetIds', 'describeFleetAttributes_fleetIds' - A list of unique fleet identifiers to retrieve attributes for. You can
-- use either the fleet ID or ARN value. To retrieve attributes for all
-- current fleets, do not include this parameter.
newDescribeFleetAttributes ::
  DescribeFleetAttributes
newDescribeFleetAttributes :: DescribeFleetAttributes
newDescribeFleetAttributes =
  DescribeFleetAttributes' :: Maybe Text
-> Maybe Natural
-> Maybe (NonEmpty Text)
-> DescribeFleetAttributes
DescribeFleetAttributes'
    { $sel:nextToken:DescribeFleetAttributes' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeFleetAttributes' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetIds:DescribeFleetAttributes' :: Maybe (NonEmpty Text)
fleetIds = Maybe (NonEmpty Text)
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.
-- This parameter is ignored when the request specifies one or a list of
-- fleet IDs.
describeFleetAttributes_nextToken :: Lens.Lens' DescribeFleetAttributes (Prelude.Maybe Prelude.Text)
describeFleetAttributes_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeFleetAttributes -> f DescribeFleetAttributes
describeFleetAttributes_nextToken = (DescribeFleetAttributes -> Maybe Text)
-> (DescribeFleetAttributes
    -> Maybe Text -> DescribeFleetAttributes)
-> Lens
     DescribeFleetAttributes
     DescribeFleetAttributes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetAttributes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeFleetAttributes' :: DescribeFleetAttributes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeFleetAttributes
s@DescribeFleetAttributes' {} Maybe Text
a -> DescribeFleetAttributes
s {$sel:nextToken:DescribeFleetAttributes' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeFleetAttributes)

-- | The maximum number of results to return. Use this parameter with
-- @NextToken@ to get results as a set of sequential pages. This parameter
-- is ignored when the request specifies one or a list of fleet IDs.
describeFleetAttributes_limit :: Lens.Lens' DescribeFleetAttributes (Prelude.Maybe Prelude.Natural)
describeFleetAttributes_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeFleetAttributes -> f DescribeFleetAttributes
describeFleetAttributes_limit = (DescribeFleetAttributes -> Maybe Natural)
-> (DescribeFleetAttributes
    -> Maybe Natural -> DescribeFleetAttributes)
-> Lens
     DescribeFleetAttributes
     DescribeFleetAttributes
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetAttributes' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeFleetAttributes' :: DescribeFleetAttributes -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeFleetAttributes
s@DescribeFleetAttributes' {} Maybe Natural
a -> DescribeFleetAttributes
s {$sel:limit:DescribeFleetAttributes' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeFleetAttributes)

-- | A list of unique fleet identifiers to retrieve attributes for. You can
-- use either the fleet ID or ARN value. To retrieve attributes for all
-- current fleets, do not include this parameter.
describeFleetAttributes_fleetIds :: Lens.Lens' DescribeFleetAttributes (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeFleetAttributes_fleetIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeFleetAttributes -> f DescribeFleetAttributes
describeFleetAttributes_fleetIds = (DescribeFleetAttributes -> Maybe (NonEmpty Text))
-> (DescribeFleetAttributes
    -> Maybe (NonEmpty Text) -> DescribeFleetAttributes)
-> Lens
     DescribeFleetAttributes
     DescribeFleetAttributes
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetAttributes' {Maybe (NonEmpty Text)
fleetIds :: Maybe (NonEmpty Text)
$sel:fleetIds:DescribeFleetAttributes' :: DescribeFleetAttributes -> Maybe (NonEmpty Text)
fleetIds} -> Maybe (NonEmpty Text)
fleetIds) (\s :: DescribeFleetAttributes
s@DescribeFleetAttributes' {} Maybe (NonEmpty Text)
a -> DescribeFleetAttributes
s {$sel:fleetIds:DescribeFleetAttributes' :: Maybe (NonEmpty Text)
fleetIds = Maybe (NonEmpty Text)
a} :: DescribeFleetAttributes) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> DescribeFleetAttributes -> f DescribeFleetAttributes)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeFleetAttributes
-> f DescribeFleetAttributes
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

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

instance Prelude.NFData DescribeFleetAttributes

instance Core.ToHeaders DescribeFleetAttributes where
  toHeaders :: DescribeFleetAttributes -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeFleetAttributes -> 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.DescribeFleetAttributes" ::
                          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 DescribeFleetAttributes where
  toJSON :: DescribeFleetAttributes -> Value
toJSON DescribeFleetAttributes' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
fleetIds :: Maybe (NonEmpty Text)
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:fleetIds:DescribeFleetAttributes' :: DescribeFleetAttributes -> Maybe (NonEmpty Text)
$sel:limit:DescribeFleetAttributes' :: DescribeFleetAttributes -> Maybe Natural
$sel:nextToken:DescribeFleetAttributes' :: DescribeFleetAttributes -> 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
"FleetIds" 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)
fleetIds
          ]
      )

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

instance Core.ToQuery DescribeFleetAttributes where
  toQuery :: DescribeFleetAttributes -> QueryString
toQuery = QueryString -> DescribeFleetAttributes -> 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:/ 'newDescribeFleetAttributesResponse' smart constructor.
data DescribeFleetAttributesResponse = DescribeFleetAttributesResponse'
  { -- | 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.
    DescribeFleetAttributesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A collection of objects containing attribute metadata for each requested
    -- fleet ID. Attribute objects are returned only for fleets that currently
    -- exist.
    DescribeFleetAttributesResponse -> Maybe [FleetAttributes]
fleetAttributes :: Prelude.Maybe [FleetAttributes],
    -- | The response's http status code.
    DescribeFleetAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeFleetAttributesResponse
-> DescribeFleetAttributesResponse -> Bool
(DescribeFleetAttributesResponse
 -> DescribeFleetAttributesResponse -> Bool)
-> (DescribeFleetAttributesResponse
    -> DescribeFleetAttributesResponse -> Bool)
-> Eq DescribeFleetAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFleetAttributesResponse
-> DescribeFleetAttributesResponse -> Bool
$c/= :: DescribeFleetAttributesResponse
-> DescribeFleetAttributesResponse -> Bool
== :: DescribeFleetAttributesResponse
-> DescribeFleetAttributesResponse -> Bool
$c== :: DescribeFleetAttributesResponse
-> DescribeFleetAttributesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFleetAttributesResponse]
ReadPrec DescribeFleetAttributesResponse
Int -> ReadS DescribeFleetAttributesResponse
ReadS [DescribeFleetAttributesResponse]
(Int -> ReadS DescribeFleetAttributesResponse)
-> ReadS [DescribeFleetAttributesResponse]
-> ReadPrec DescribeFleetAttributesResponse
-> ReadPrec [DescribeFleetAttributesResponse]
-> Read DescribeFleetAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFleetAttributesResponse]
$creadListPrec :: ReadPrec [DescribeFleetAttributesResponse]
readPrec :: ReadPrec DescribeFleetAttributesResponse
$creadPrec :: ReadPrec DescribeFleetAttributesResponse
readList :: ReadS [DescribeFleetAttributesResponse]
$creadList :: ReadS [DescribeFleetAttributesResponse]
readsPrec :: Int -> ReadS DescribeFleetAttributesResponse
$creadsPrec :: Int -> ReadS DescribeFleetAttributesResponse
Prelude.Read, Int -> DescribeFleetAttributesResponse -> ShowS
[DescribeFleetAttributesResponse] -> ShowS
DescribeFleetAttributesResponse -> String
(Int -> DescribeFleetAttributesResponse -> ShowS)
-> (DescribeFleetAttributesResponse -> String)
-> ([DescribeFleetAttributesResponse] -> ShowS)
-> Show DescribeFleetAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFleetAttributesResponse] -> ShowS
$cshowList :: [DescribeFleetAttributesResponse] -> ShowS
show :: DescribeFleetAttributesResponse -> String
$cshow :: DescribeFleetAttributesResponse -> String
showsPrec :: Int -> DescribeFleetAttributesResponse -> ShowS
$cshowsPrec :: Int -> DescribeFleetAttributesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeFleetAttributesResponse
 -> Rep DescribeFleetAttributesResponse x)
-> (forall x.
    Rep DescribeFleetAttributesResponse x
    -> DescribeFleetAttributesResponse)
-> Generic DescribeFleetAttributesResponse
forall x.
Rep DescribeFleetAttributesResponse x
-> DescribeFleetAttributesResponse
forall x.
DescribeFleetAttributesResponse
-> Rep DescribeFleetAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFleetAttributesResponse x
-> DescribeFleetAttributesResponse
$cfrom :: forall x.
DescribeFleetAttributesResponse
-> Rep DescribeFleetAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFleetAttributesResponse' 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', 'describeFleetAttributesResponse_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.
--
-- 'fleetAttributes', 'describeFleetAttributesResponse_fleetAttributes' - A collection of objects containing attribute metadata for each requested
-- fleet ID. Attribute objects are returned only for fleets that currently
-- exist.
--
-- 'httpStatus', 'describeFleetAttributesResponse_httpStatus' - The response's http status code.
newDescribeFleetAttributesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeFleetAttributesResponse
newDescribeFleetAttributesResponse :: Int -> DescribeFleetAttributesResponse
newDescribeFleetAttributesResponse Int
pHttpStatus_ =
  DescribeFleetAttributesResponse' :: Maybe Text
-> Maybe [FleetAttributes]
-> Int
-> DescribeFleetAttributesResponse
DescribeFleetAttributesResponse'
    { $sel:nextToken:DescribeFleetAttributesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetAttributes:DescribeFleetAttributesResponse' :: Maybe [FleetAttributes]
fleetAttributes = Maybe [FleetAttributes]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeFleetAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A collection of objects containing attribute metadata for each requested
-- fleet ID. Attribute objects are returned only for fleets that currently
-- exist.
describeFleetAttributesResponse_fleetAttributes :: Lens.Lens' DescribeFleetAttributesResponse (Prelude.Maybe [FleetAttributes])
describeFleetAttributesResponse_fleetAttributes :: (Maybe [FleetAttributes] -> f (Maybe [FleetAttributes]))
-> DescribeFleetAttributesResponse
-> f DescribeFleetAttributesResponse
describeFleetAttributesResponse_fleetAttributes = (DescribeFleetAttributesResponse -> Maybe [FleetAttributes])
-> (DescribeFleetAttributesResponse
    -> Maybe [FleetAttributes] -> DescribeFleetAttributesResponse)
-> Lens' DescribeFleetAttributesResponse (Maybe [FleetAttributes])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetAttributesResponse' {Maybe [FleetAttributes]
fleetAttributes :: Maybe [FleetAttributes]
$sel:fleetAttributes:DescribeFleetAttributesResponse' :: DescribeFleetAttributesResponse -> Maybe [FleetAttributes]
fleetAttributes} -> Maybe [FleetAttributes]
fleetAttributes) (\s :: DescribeFleetAttributesResponse
s@DescribeFleetAttributesResponse' {} Maybe [FleetAttributes]
a -> DescribeFleetAttributesResponse
s {$sel:fleetAttributes:DescribeFleetAttributesResponse' :: Maybe [FleetAttributes]
fleetAttributes = Maybe [FleetAttributes]
a} :: DescribeFleetAttributesResponse) ((Maybe [FleetAttributes] -> f (Maybe [FleetAttributes]))
 -> DescribeFleetAttributesResponse
 -> f DescribeFleetAttributesResponse)
-> ((Maybe [FleetAttributes] -> f (Maybe [FleetAttributes]))
    -> Maybe [FleetAttributes] -> f (Maybe [FleetAttributes]))
-> (Maybe [FleetAttributes] -> f (Maybe [FleetAttributes]))
-> DescribeFleetAttributesResponse
-> f DescribeFleetAttributesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FleetAttributes]
  [FleetAttributes]
  [FleetAttributes]
  [FleetAttributes]
-> Iso
     (Maybe [FleetAttributes])
     (Maybe [FleetAttributes])
     (Maybe [FleetAttributes])
     (Maybe [FleetAttributes])
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
  [FleetAttributes]
  [FleetAttributes]
  [FleetAttributes]
  [FleetAttributes]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeFleetAttributesResponse