{-# 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.DescribeFleetCapacity
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the resource capacity settings for one or more fleets. The
-- data returned includes the current fleet capacity (number of EC2
-- instances), and settings that can control how capacity scaling. For
-- fleets with remote locations, this operation retrieves data for the
-- fleet\'s home Region only.
--
-- This operation can be used in the following ways:
--
-- -   To get capacity data for one or more specific fleets, provide a list
--     of fleet IDs or fleet ARNs.
--
-- -   To get capacity data for all fleets, do not provide a fleet
--     identifier.
--
-- When requesting multiple fleets, use the pagination parameters to
-- retrieve results as a set of sequential pages.
--
-- If successful, a @FleetCapacity@ object is returned for each requested
-- fleet ID. Each FleetCapacity object includes a @Location@ property,
-- which is set to the fleet\'s home Region. When a list of fleet IDs is
-- provided, attribute objects are returned only for fleets that currently
-- exist.
--
-- Some API operations may limit the number of fleet IDs that are allowed
-- in one request. If a request exceeds this limit, the request fails and
-- the error message includes the maximum allowed.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html Setting up GameLift fleets>
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html#gamelift-metrics-fleet GameLift metrics for fleets>
--
-- This operation returns paginated results.
module Amazonka.GameLift.DescribeFleetCapacity
  ( -- * Creating a Request
    DescribeFleetCapacity (..),
    newDescribeFleetCapacity,

    -- * Request Lenses
    describeFleetCapacity_fleetIds,
    describeFleetCapacity_limit,
    describeFleetCapacity_nextToken,

    -- * Destructuring the Response
    DescribeFleetCapacityResponse (..),
    newDescribeFleetCapacityResponse,

    -- * Response Lenses
    describeFleetCapacityResponse_fleetCapacity,
    describeFleetCapacityResponse_nextToken,
    describeFleetCapacityResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeFleetCapacity' smart constructor.
data DescribeFleetCapacity = DescribeFleetCapacity'
  { -- | A unique identifier for the fleet to retrieve capacity information for.
    -- You can use either the fleet ID or ARN value. Leave this parameter empty
    -- to retrieve capacity information for all fleets.
    DescribeFleetCapacity -> Maybe (NonEmpty Text)
fleetIds :: Prelude.Maybe (Prelude.NonEmpty 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.
    DescribeFleetCapacity -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | 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.
    DescribeFleetCapacity -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeFleetCapacity -> DescribeFleetCapacity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFleetCapacity -> DescribeFleetCapacity -> Bool
$c/= :: DescribeFleetCapacity -> DescribeFleetCapacity -> Bool
== :: DescribeFleetCapacity -> DescribeFleetCapacity -> Bool
$c== :: DescribeFleetCapacity -> DescribeFleetCapacity -> Bool
Prelude.Eq, ReadPrec [DescribeFleetCapacity]
ReadPrec DescribeFleetCapacity
Int -> ReadS DescribeFleetCapacity
ReadS [DescribeFleetCapacity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFleetCapacity]
$creadListPrec :: ReadPrec [DescribeFleetCapacity]
readPrec :: ReadPrec DescribeFleetCapacity
$creadPrec :: ReadPrec DescribeFleetCapacity
readList :: ReadS [DescribeFleetCapacity]
$creadList :: ReadS [DescribeFleetCapacity]
readsPrec :: Int -> ReadS DescribeFleetCapacity
$creadsPrec :: Int -> ReadS DescribeFleetCapacity
Prelude.Read, Int -> DescribeFleetCapacity -> ShowS
[DescribeFleetCapacity] -> ShowS
DescribeFleetCapacity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFleetCapacity] -> ShowS
$cshowList :: [DescribeFleetCapacity] -> ShowS
show :: DescribeFleetCapacity -> String
$cshow :: DescribeFleetCapacity -> String
showsPrec :: Int -> DescribeFleetCapacity -> ShowS
$cshowsPrec :: Int -> DescribeFleetCapacity -> ShowS
Prelude.Show, forall x. Rep DescribeFleetCapacity x -> DescribeFleetCapacity
forall x. DescribeFleetCapacity -> Rep DescribeFleetCapacity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFleetCapacity x -> DescribeFleetCapacity
$cfrom :: forall x. DescribeFleetCapacity -> Rep DescribeFleetCapacity x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFleetCapacity' 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:
--
-- 'fleetIds', 'describeFleetCapacity_fleetIds' - A unique identifier for the fleet to retrieve capacity information for.
-- You can use either the fleet ID or ARN value. Leave this parameter empty
-- to retrieve capacity information for all fleets.
--
-- 'limit', 'describeFleetCapacity_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.
--
-- 'nextToken', 'describeFleetCapacity_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.
newDescribeFleetCapacity ::
  DescribeFleetCapacity
newDescribeFleetCapacity :: DescribeFleetCapacity
newDescribeFleetCapacity =
  DescribeFleetCapacity'
    { $sel:fleetIds:DescribeFleetCapacity' :: Maybe (NonEmpty Text)
fleetIds = forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeFleetCapacity' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeFleetCapacity' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier for the fleet to retrieve capacity information for.
-- You can use either the fleet ID or ARN value. Leave this parameter empty
-- to retrieve capacity information for all fleets.
describeFleetCapacity_fleetIds :: Lens.Lens' DescribeFleetCapacity (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeFleetCapacity_fleetIds :: Lens' DescribeFleetCapacity (Maybe (NonEmpty Text))
describeFleetCapacity_fleetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetCapacity' {Maybe (NonEmpty Text)
fleetIds :: Maybe (NonEmpty Text)
$sel:fleetIds:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe (NonEmpty Text)
fleetIds} -> Maybe (NonEmpty Text)
fleetIds) (\s :: DescribeFleetCapacity
s@DescribeFleetCapacity' {} Maybe (NonEmpty Text)
a -> DescribeFleetCapacity
s {$sel:fleetIds:DescribeFleetCapacity' :: Maybe (NonEmpty Text)
fleetIds = Maybe (NonEmpty Text)
a} :: DescribeFleetCapacity) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.
describeFleetCapacity_limit :: Lens.Lens' DescribeFleetCapacity (Prelude.Maybe Prelude.Natural)
describeFleetCapacity_limit :: Lens' DescribeFleetCapacity (Maybe Natural)
describeFleetCapacity_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetCapacity' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeFleetCapacity
s@DescribeFleetCapacity' {} Maybe Natural
a -> DescribeFleetCapacity
s {$sel:limit:DescribeFleetCapacity' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeFleetCapacity)

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

instance Core.AWSPager DescribeFleetCapacity where
  page :: DescribeFleetCapacity
-> AWSResponse DescribeFleetCapacity -> Maybe DescribeFleetCapacity
page DescribeFleetCapacity
rq AWSResponse DescribeFleetCapacity
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeFleetCapacity
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeFleetCapacityResponse (Maybe Text)
describeFleetCapacityResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeFleetCapacity
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeFleetCapacityResponse (Maybe [FleetCapacity])
describeFleetCapacityResponse_fleetCapacity
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeFleetCapacity
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeFleetCapacity (Maybe Text)
describeFleetCapacity_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeFleetCapacity
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeFleetCapacityResponse (Maybe Text)
describeFleetCapacityResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeFleetCapacity where
  type
    AWSResponse DescribeFleetCapacity =
      DescribeFleetCapacityResponse
  request :: (Service -> Service)
-> DescribeFleetCapacity -> Request DescribeFleetCapacity
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeFleetCapacity
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeFleetCapacity)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [FleetCapacity]
-> Maybe Text -> Int -> DescribeFleetCapacityResponse
DescribeFleetCapacityResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FleetCapacity" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeFleetCapacity where
  hashWithSalt :: Int -> DescribeFleetCapacity -> Int
hashWithSalt Int
_salt DescribeFleetCapacity' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
nextToken :: Maybe Text
limit :: Maybe Natural
fleetIds :: Maybe (NonEmpty Text)
$sel:nextToken:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe Text
$sel:limit:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe Natural
$sel:fleetIds:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe (NonEmpty Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
fleetIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeFleetCapacity where
  rnf :: DescribeFleetCapacity -> ()
rnf DescribeFleetCapacity' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
nextToken :: Maybe Text
limit :: Maybe Natural
fleetIds :: Maybe (NonEmpty Text)
$sel:nextToken:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe Text
$sel:limit:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe Natural
$sel:fleetIds:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe (NonEmpty Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
fleetIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders DescribeFleetCapacity where
  toHeaders :: DescribeFleetCapacity -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"GameLift.DescribeFleetCapacity" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeFleetCapacity where
  toJSON :: DescribeFleetCapacity -> Value
toJSON DescribeFleetCapacity' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
nextToken :: Maybe Text
limit :: Maybe Natural
fleetIds :: Maybe (NonEmpty Text)
$sel:nextToken:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe Text
$sel:limit:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe Natural
$sel:fleetIds:DescribeFleetCapacity' :: DescribeFleetCapacity -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"FleetIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
fleetIds,
            (Key
"Limit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

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

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

-- | /See:/ 'newDescribeFleetCapacityResponse' smart constructor.
data DescribeFleetCapacityResponse = DescribeFleetCapacityResponse'
  { -- | A collection of objects that contains capacity information for each
    -- requested fleet ID. Capacity objects are returned only for fleets that
    -- currently exist.
    DescribeFleetCapacityResponse -> Maybe [FleetCapacity]
fleetCapacity :: Prelude.Maybe [FleetCapacity],
    -- | 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.
    DescribeFleetCapacityResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeFleetCapacityResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeFleetCapacityResponse
-> DescribeFleetCapacityResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFleetCapacityResponse
-> DescribeFleetCapacityResponse -> Bool
$c/= :: DescribeFleetCapacityResponse
-> DescribeFleetCapacityResponse -> Bool
== :: DescribeFleetCapacityResponse
-> DescribeFleetCapacityResponse -> Bool
$c== :: DescribeFleetCapacityResponse
-> DescribeFleetCapacityResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFleetCapacityResponse]
ReadPrec DescribeFleetCapacityResponse
Int -> ReadS DescribeFleetCapacityResponse
ReadS [DescribeFleetCapacityResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFleetCapacityResponse]
$creadListPrec :: ReadPrec [DescribeFleetCapacityResponse]
readPrec :: ReadPrec DescribeFleetCapacityResponse
$creadPrec :: ReadPrec DescribeFleetCapacityResponse
readList :: ReadS [DescribeFleetCapacityResponse]
$creadList :: ReadS [DescribeFleetCapacityResponse]
readsPrec :: Int -> ReadS DescribeFleetCapacityResponse
$creadsPrec :: Int -> ReadS DescribeFleetCapacityResponse
Prelude.Read, Int -> DescribeFleetCapacityResponse -> ShowS
[DescribeFleetCapacityResponse] -> ShowS
DescribeFleetCapacityResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFleetCapacityResponse] -> ShowS
$cshowList :: [DescribeFleetCapacityResponse] -> ShowS
show :: DescribeFleetCapacityResponse -> String
$cshow :: DescribeFleetCapacityResponse -> String
showsPrec :: Int -> DescribeFleetCapacityResponse -> ShowS
$cshowsPrec :: Int -> DescribeFleetCapacityResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeFleetCapacityResponse x
-> DescribeFleetCapacityResponse
forall x.
DescribeFleetCapacityResponse
-> Rep DescribeFleetCapacityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFleetCapacityResponse x
-> DescribeFleetCapacityResponse
$cfrom :: forall x.
DescribeFleetCapacityResponse
-> Rep DescribeFleetCapacityResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFleetCapacityResponse' 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:
--
-- 'fleetCapacity', 'describeFleetCapacityResponse_fleetCapacity' - A collection of objects that contains capacity information for each
-- requested fleet ID. Capacity objects are returned only for fleets that
-- currently exist.
--
-- 'nextToken', 'describeFleetCapacityResponse_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', 'describeFleetCapacityResponse_httpStatus' - The response's http status code.
newDescribeFleetCapacityResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeFleetCapacityResponse
newDescribeFleetCapacityResponse :: Int -> DescribeFleetCapacityResponse
newDescribeFleetCapacityResponse Int
pHttpStatus_ =
  DescribeFleetCapacityResponse'
    { $sel:fleetCapacity:DescribeFleetCapacityResponse' :: Maybe [FleetCapacity]
fleetCapacity =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeFleetCapacityResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeFleetCapacityResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A collection of objects that contains capacity information for each
-- requested fleet ID. Capacity objects are returned only for fleets that
-- currently exist.
describeFleetCapacityResponse_fleetCapacity :: Lens.Lens' DescribeFleetCapacityResponse (Prelude.Maybe [FleetCapacity])
describeFleetCapacityResponse_fleetCapacity :: Lens' DescribeFleetCapacityResponse (Maybe [FleetCapacity])
describeFleetCapacityResponse_fleetCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetCapacityResponse' {Maybe [FleetCapacity]
fleetCapacity :: Maybe [FleetCapacity]
$sel:fleetCapacity:DescribeFleetCapacityResponse' :: DescribeFleetCapacityResponse -> Maybe [FleetCapacity]
fleetCapacity} -> Maybe [FleetCapacity]
fleetCapacity) (\s :: DescribeFleetCapacityResponse
s@DescribeFleetCapacityResponse' {} Maybe [FleetCapacity]
a -> DescribeFleetCapacityResponse
s {$sel:fleetCapacity:DescribeFleetCapacityResponse' :: Maybe [FleetCapacity]
fleetCapacity = Maybe [FleetCapacity]
a} :: DescribeFleetCapacityResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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.
describeFleetCapacityResponse_nextToken :: Lens.Lens' DescribeFleetCapacityResponse (Prelude.Maybe Prelude.Text)
describeFleetCapacityResponse_nextToken :: Lens' DescribeFleetCapacityResponse (Maybe Text)
describeFleetCapacityResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFleetCapacityResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeFleetCapacityResponse' :: DescribeFleetCapacityResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeFleetCapacityResponse
s@DescribeFleetCapacityResponse' {} Maybe Text
a -> DescribeFleetCapacityResponse
s {$sel:nextToken:DescribeFleetCapacityResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeFleetCapacityResponse)

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

instance Prelude.NFData DescribeFleetCapacityResponse where
  rnf :: DescribeFleetCapacityResponse -> ()
rnf DescribeFleetCapacityResponse' {Int
Maybe [FleetCapacity]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
fleetCapacity :: Maybe [FleetCapacity]
$sel:httpStatus:DescribeFleetCapacityResponse' :: DescribeFleetCapacityResponse -> Int
$sel:nextToken:DescribeFleetCapacityResponse' :: DescribeFleetCapacityResponse -> Maybe Text
$sel:fleetCapacity:DescribeFleetCapacityResponse' :: DescribeFleetCapacityResponse -> Maybe [FleetCapacity]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [FleetCapacity]
fleetCapacity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus