{-# 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.DescribeEC2InstanceLimits
-- 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)
--
-- The GameLift service limits and current utilization for an AWS Region or
-- location. Instance limits control the number of instances, per instance
-- type, per location, that your AWS account can use. Learn more at
-- <http://aws.amazon.com/ec2/instance-types/ Amazon EC2 Instance Types>.
-- The information returned includes the maximum number of instances
-- allowed and your account\'s current usage across all fleets. This
-- information can affect your ability to scale your GameLift fleets. You
-- can request a limit increase for your account by using the __Service
-- limits__ page in the GameLift console.
--
-- Instance limits differ based on whether the instances are deployed in a
-- fleet\'s home Region or in a remote location. For remote locations,
-- limits also differ based on the combination of home Region and remote
-- location. All requests must specify an AWS Region (either explicitly or
-- as your default settings). To get the limit for a remote location, you
-- must also specify the location. For example, the following requests all
-- return different results:
--
-- -   Request specifies the Region @ap-northeast-1@ with no location. The
--     result is limits and usage data on all instance types that are
--     deployed in @us-east-2@, by all of the fleets that reside in
--     @ap-northeast-1@.
--
-- -   Request specifies the Region @us-east-1@ with location
--     @ca-central-1@. The result is limits and usage data on all instance
--     types that are deployed in @ca-central-1@, by all of the fleets that
--     reside in @us-east-2@. These limits do not affect fleets in any
--     other Regions that deploy instances to @ca-central-1@.
--
-- -   Request specifies the Region @eu-west-1@ with location
--     @ca-central-1@. The result is limits and usage data on all instance
--     types that are deployed in @ca-central-1@, by all of the fleets that
--     reside in @eu-west-1@.
--
-- This operation can be used in the following ways:
--
-- -   To get limit and usage data for all instance types that are deployed
--     in an AWS Region by fleets that reside in the same Region: Specify
--     the Region only. Optionally, specify a single instance type to
--     retrieve information for.
--
-- -   To get limit and usage data for all instance types that are deployed
--     to a remote location by fleets that reside in different AWS Region:
--     Provide both the AWS Region and the remote location. Optionally,
--     specify a single instance type to retrieve information for.
--
-- If successful, an @EC2InstanceLimits@ object is returned with limits and
-- usage data for each requested instance type.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html Setting up GameLift fleets>
--
-- __Related actions__
--
-- CreateFleet | UpdateFleetCapacity | PutScalingPolicy |
-- DescribeEC2InstanceLimits | DescribeFleetAttributes |
-- DescribeFleetLocationAttributes | UpdateFleetAttributes |
-- StopFleetActions | DeleteFleet |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.DescribeEC2InstanceLimits
  ( -- * Creating a Request
    DescribeEC2InstanceLimits (..),
    newDescribeEC2InstanceLimits,

    -- * Request Lenses
    describeEC2InstanceLimits_location,
    describeEC2InstanceLimits_eC2InstanceType,

    -- * Destructuring the Response
    DescribeEC2InstanceLimitsResponse (..),
    newDescribeEC2InstanceLimitsResponse,

    -- * Response Lenses
    describeEC2InstanceLimitsResponse_eC2InstanceLimits,
    describeEC2InstanceLimitsResponse_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:/ 'newDescribeEC2InstanceLimits' smart constructor.
data DescribeEC2InstanceLimits = DescribeEC2InstanceLimits'
  { -- | The name of a remote location to request instance limits for, in the
    -- form of an AWS Region code such as @us-west-2@.
    DescribeEC2InstanceLimits -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | Name of an EC2 instance type that is supported in GameLift. A fleet
    -- instance type determines the computing resources of each instance in the
    -- fleet, including CPU, memory, storage, and networking capacity. Do not
    -- specify a value for this parameter to retrieve limits for all instance
    -- types.
    DescribeEC2InstanceLimits -> Maybe EC2InstanceType
eC2InstanceType :: Prelude.Maybe EC2InstanceType
  }
  deriving (DescribeEC2InstanceLimits -> DescribeEC2InstanceLimits -> Bool
(DescribeEC2InstanceLimits -> DescribeEC2InstanceLimits -> Bool)
-> (DescribeEC2InstanceLimits -> DescribeEC2InstanceLimits -> Bool)
-> Eq DescribeEC2InstanceLimits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEC2InstanceLimits -> DescribeEC2InstanceLimits -> Bool
$c/= :: DescribeEC2InstanceLimits -> DescribeEC2InstanceLimits -> Bool
== :: DescribeEC2InstanceLimits -> DescribeEC2InstanceLimits -> Bool
$c== :: DescribeEC2InstanceLimits -> DescribeEC2InstanceLimits -> Bool
Prelude.Eq, ReadPrec [DescribeEC2InstanceLimits]
ReadPrec DescribeEC2InstanceLimits
Int -> ReadS DescribeEC2InstanceLimits
ReadS [DescribeEC2InstanceLimits]
(Int -> ReadS DescribeEC2InstanceLimits)
-> ReadS [DescribeEC2InstanceLimits]
-> ReadPrec DescribeEC2InstanceLimits
-> ReadPrec [DescribeEC2InstanceLimits]
-> Read DescribeEC2InstanceLimits
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEC2InstanceLimits]
$creadListPrec :: ReadPrec [DescribeEC2InstanceLimits]
readPrec :: ReadPrec DescribeEC2InstanceLimits
$creadPrec :: ReadPrec DescribeEC2InstanceLimits
readList :: ReadS [DescribeEC2InstanceLimits]
$creadList :: ReadS [DescribeEC2InstanceLimits]
readsPrec :: Int -> ReadS DescribeEC2InstanceLimits
$creadsPrec :: Int -> ReadS DescribeEC2InstanceLimits
Prelude.Read, Int -> DescribeEC2InstanceLimits -> ShowS
[DescribeEC2InstanceLimits] -> ShowS
DescribeEC2InstanceLimits -> String
(Int -> DescribeEC2InstanceLimits -> ShowS)
-> (DescribeEC2InstanceLimits -> String)
-> ([DescribeEC2InstanceLimits] -> ShowS)
-> Show DescribeEC2InstanceLimits
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEC2InstanceLimits] -> ShowS
$cshowList :: [DescribeEC2InstanceLimits] -> ShowS
show :: DescribeEC2InstanceLimits -> String
$cshow :: DescribeEC2InstanceLimits -> String
showsPrec :: Int -> DescribeEC2InstanceLimits -> ShowS
$cshowsPrec :: Int -> DescribeEC2InstanceLimits -> ShowS
Prelude.Show, (forall x.
 DescribeEC2InstanceLimits -> Rep DescribeEC2InstanceLimits x)
-> (forall x.
    Rep DescribeEC2InstanceLimits x -> DescribeEC2InstanceLimits)
-> Generic DescribeEC2InstanceLimits
forall x.
Rep DescribeEC2InstanceLimits x -> DescribeEC2InstanceLimits
forall x.
DescribeEC2InstanceLimits -> Rep DescribeEC2InstanceLimits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEC2InstanceLimits x -> DescribeEC2InstanceLimits
$cfrom :: forall x.
DescribeEC2InstanceLimits -> Rep DescribeEC2InstanceLimits x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEC2InstanceLimits' 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:
--
-- 'location', 'describeEC2InstanceLimits_location' - The name of a remote location to request instance limits for, in the
-- form of an AWS Region code such as @us-west-2@.
--
-- 'eC2InstanceType', 'describeEC2InstanceLimits_eC2InstanceType' - Name of an EC2 instance type that is supported in GameLift. A fleet
-- instance type determines the computing resources of each instance in the
-- fleet, including CPU, memory, storage, and networking capacity. Do not
-- specify a value for this parameter to retrieve limits for all instance
-- types.
newDescribeEC2InstanceLimits ::
  DescribeEC2InstanceLimits
newDescribeEC2InstanceLimits :: DescribeEC2InstanceLimits
newDescribeEC2InstanceLimits =
  DescribeEC2InstanceLimits' :: Maybe Text -> Maybe EC2InstanceType -> DescribeEC2InstanceLimits
DescribeEC2InstanceLimits'
    { $sel:location:DescribeEC2InstanceLimits' :: Maybe Text
location =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eC2InstanceType:DescribeEC2InstanceLimits' :: Maybe EC2InstanceType
eC2InstanceType = Maybe EC2InstanceType
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of a remote location to request instance limits for, in the
-- form of an AWS Region code such as @us-west-2@.
describeEC2InstanceLimits_location :: Lens.Lens' DescribeEC2InstanceLimits (Prelude.Maybe Prelude.Text)
describeEC2InstanceLimits_location :: (Maybe Text -> f (Maybe Text))
-> DescribeEC2InstanceLimits -> f DescribeEC2InstanceLimits
describeEC2InstanceLimits_location = (DescribeEC2InstanceLimits -> Maybe Text)
-> (DescribeEC2InstanceLimits
    -> Maybe Text -> DescribeEC2InstanceLimits)
-> Lens
     DescribeEC2InstanceLimits
     DescribeEC2InstanceLimits
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEC2InstanceLimits' {Maybe Text
location :: Maybe Text
$sel:location:DescribeEC2InstanceLimits' :: DescribeEC2InstanceLimits -> Maybe Text
location} -> Maybe Text
location) (\s :: DescribeEC2InstanceLimits
s@DescribeEC2InstanceLimits' {} Maybe Text
a -> DescribeEC2InstanceLimits
s {$sel:location:DescribeEC2InstanceLimits' :: Maybe Text
location = Maybe Text
a} :: DescribeEC2InstanceLimits)

-- | Name of an EC2 instance type that is supported in GameLift. A fleet
-- instance type determines the computing resources of each instance in the
-- fleet, including CPU, memory, storage, and networking capacity. Do not
-- specify a value for this parameter to retrieve limits for all instance
-- types.
describeEC2InstanceLimits_eC2InstanceType :: Lens.Lens' DescribeEC2InstanceLimits (Prelude.Maybe EC2InstanceType)
describeEC2InstanceLimits_eC2InstanceType :: (Maybe EC2InstanceType -> f (Maybe EC2InstanceType))
-> DescribeEC2InstanceLimits -> f DescribeEC2InstanceLimits
describeEC2InstanceLimits_eC2InstanceType = (DescribeEC2InstanceLimits -> Maybe EC2InstanceType)
-> (DescribeEC2InstanceLimits
    -> Maybe EC2InstanceType -> DescribeEC2InstanceLimits)
-> Lens
     DescribeEC2InstanceLimits
     DescribeEC2InstanceLimits
     (Maybe EC2InstanceType)
     (Maybe EC2InstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEC2InstanceLimits' {Maybe EC2InstanceType
eC2InstanceType :: Maybe EC2InstanceType
$sel:eC2InstanceType:DescribeEC2InstanceLimits' :: DescribeEC2InstanceLimits -> Maybe EC2InstanceType
eC2InstanceType} -> Maybe EC2InstanceType
eC2InstanceType) (\s :: DescribeEC2InstanceLimits
s@DescribeEC2InstanceLimits' {} Maybe EC2InstanceType
a -> DescribeEC2InstanceLimits
s {$sel:eC2InstanceType:DescribeEC2InstanceLimits' :: Maybe EC2InstanceType
eC2InstanceType = Maybe EC2InstanceType
a} :: DescribeEC2InstanceLimits)

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

instance Prelude.NFData DescribeEC2InstanceLimits

instance Core.ToHeaders DescribeEC2InstanceLimits where
  toHeaders :: DescribeEC2InstanceLimits -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeEC2InstanceLimits -> 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.DescribeEC2InstanceLimits" ::
                          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 DescribeEC2InstanceLimits where
  toJSON :: DescribeEC2InstanceLimits -> Value
toJSON DescribeEC2InstanceLimits' {Maybe Text
Maybe EC2InstanceType
eC2InstanceType :: Maybe EC2InstanceType
location :: Maybe Text
$sel:eC2InstanceType:DescribeEC2InstanceLimits' :: DescribeEC2InstanceLimits -> Maybe EC2InstanceType
$sel:location:DescribeEC2InstanceLimits' :: DescribeEC2InstanceLimits -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Location" 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
location,
            (Text
"EC2InstanceType" Text -> EC2InstanceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EC2InstanceType -> Pair) -> Maybe EC2InstanceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EC2InstanceType
eC2InstanceType
          ]
      )

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

instance Core.ToQuery DescribeEC2InstanceLimits where
  toQuery :: DescribeEC2InstanceLimits -> QueryString
toQuery = QueryString -> DescribeEC2InstanceLimits -> 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:/ 'newDescribeEC2InstanceLimitsResponse' smart constructor.
data DescribeEC2InstanceLimitsResponse = DescribeEC2InstanceLimitsResponse'
  { -- | The maximum number of instances for the specified instance type.
    DescribeEC2InstanceLimitsResponse -> Maybe [EC2InstanceLimit]
eC2InstanceLimits :: Prelude.Maybe [EC2InstanceLimit],
    -- | The response's http status code.
    DescribeEC2InstanceLimitsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeEC2InstanceLimitsResponse
-> DescribeEC2InstanceLimitsResponse -> Bool
(DescribeEC2InstanceLimitsResponse
 -> DescribeEC2InstanceLimitsResponse -> Bool)
-> (DescribeEC2InstanceLimitsResponse
    -> DescribeEC2InstanceLimitsResponse -> Bool)
-> Eq DescribeEC2InstanceLimitsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEC2InstanceLimitsResponse
-> DescribeEC2InstanceLimitsResponse -> Bool
$c/= :: DescribeEC2InstanceLimitsResponse
-> DescribeEC2InstanceLimitsResponse -> Bool
== :: DescribeEC2InstanceLimitsResponse
-> DescribeEC2InstanceLimitsResponse -> Bool
$c== :: DescribeEC2InstanceLimitsResponse
-> DescribeEC2InstanceLimitsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEC2InstanceLimitsResponse]
ReadPrec DescribeEC2InstanceLimitsResponse
Int -> ReadS DescribeEC2InstanceLimitsResponse
ReadS [DescribeEC2InstanceLimitsResponse]
(Int -> ReadS DescribeEC2InstanceLimitsResponse)
-> ReadS [DescribeEC2InstanceLimitsResponse]
-> ReadPrec DescribeEC2InstanceLimitsResponse
-> ReadPrec [DescribeEC2InstanceLimitsResponse]
-> Read DescribeEC2InstanceLimitsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEC2InstanceLimitsResponse]
$creadListPrec :: ReadPrec [DescribeEC2InstanceLimitsResponse]
readPrec :: ReadPrec DescribeEC2InstanceLimitsResponse
$creadPrec :: ReadPrec DescribeEC2InstanceLimitsResponse
readList :: ReadS [DescribeEC2InstanceLimitsResponse]
$creadList :: ReadS [DescribeEC2InstanceLimitsResponse]
readsPrec :: Int -> ReadS DescribeEC2InstanceLimitsResponse
$creadsPrec :: Int -> ReadS DescribeEC2InstanceLimitsResponse
Prelude.Read, Int -> DescribeEC2InstanceLimitsResponse -> ShowS
[DescribeEC2InstanceLimitsResponse] -> ShowS
DescribeEC2InstanceLimitsResponse -> String
(Int -> DescribeEC2InstanceLimitsResponse -> ShowS)
-> (DescribeEC2InstanceLimitsResponse -> String)
-> ([DescribeEC2InstanceLimitsResponse] -> ShowS)
-> Show DescribeEC2InstanceLimitsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEC2InstanceLimitsResponse] -> ShowS
$cshowList :: [DescribeEC2InstanceLimitsResponse] -> ShowS
show :: DescribeEC2InstanceLimitsResponse -> String
$cshow :: DescribeEC2InstanceLimitsResponse -> String
showsPrec :: Int -> DescribeEC2InstanceLimitsResponse -> ShowS
$cshowsPrec :: Int -> DescribeEC2InstanceLimitsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeEC2InstanceLimitsResponse
 -> Rep DescribeEC2InstanceLimitsResponse x)
-> (forall x.
    Rep DescribeEC2InstanceLimitsResponse x
    -> DescribeEC2InstanceLimitsResponse)
-> Generic DescribeEC2InstanceLimitsResponse
forall x.
Rep DescribeEC2InstanceLimitsResponse x
-> DescribeEC2InstanceLimitsResponse
forall x.
DescribeEC2InstanceLimitsResponse
-> Rep DescribeEC2InstanceLimitsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEC2InstanceLimitsResponse x
-> DescribeEC2InstanceLimitsResponse
$cfrom :: forall x.
DescribeEC2InstanceLimitsResponse
-> Rep DescribeEC2InstanceLimitsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEC2InstanceLimitsResponse' 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:
--
-- 'eC2InstanceLimits', 'describeEC2InstanceLimitsResponse_eC2InstanceLimits' - The maximum number of instances for the specified instance type.
--
-- 'httpStatus', 'describeEC2InstanceLimitsResponse_httpStatus' - The response's http status code.
newDescribeEC2InstanceLimitsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeEC2InstanceLimitsResponse
newDescribeEC2InstanceLimitsResponse :: Int -> DescribeEC2InstanceLimitsResponse
newDescribeEC2InstanceLimitsResponse Int
pHttpStatus_ =
  DescribeEC2InstanceLimitsResponse' :: Maybe [EC2InstanceLimit]
-> Int -> DescribeEC2InstanceLimitsResponse
DescribeEC2InstanceLimitsResponse'
    { $sel:eC2InstanceLimits:DescribeEC2InstanceLimitsResponse' :: Maybe [EC2InstanceLimit]
eC2InstanceLimits =
        Maybe [EC2InstanceLimit]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeEC2InstanceLimitsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The maximum number of instances for the specified instance type.
describeEC2InstanceLimitsResponse_eC2InstanceLimits :: Lens.Lens' DescribeEC2InstanceLimitsResponse (Prelude.Maybe [EC2InstanceLimit])
describeEC2InstanceLimitsResponse_eC2InstanceLimits :: (Maybe [EC2InstanceLimit] -> f (Maybe [EC2InstanceLimit]))
-> DescribeEC2InstanceLimitsResponse
-> f DescribeEC2InstanceLimitsResponse
describeEC2InstanceLimitsResponse_eC2InstanceLimits = (DescribeEC2InstanceLimitsResponse -> Maybe [EC2InstanceLimit])
-> (DescribeEC2InstanceLimitsResponse
    -> Maybe [EC2InstanceLimit] -> DescribeEC2InstanceLimitsResponse)
-> Lens
     DescribeEC2InstanceLimitsResponse
     DescribeEC2InstanceLimitsResponse
     (Maybe [EC2InstanceLimit])
     (Maybe [EC2InstanceLimit])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEC2InstanceLimitsResponse' {Maybe [EC2InstanceLimit]
eC2InstanceLimits :: Maybe [EC2InstanceLimit]
$sel:eC2InstanceLimits:DescribeEC2InstanceLimitsResponse' :: DescribeEC2InstanceLimitsResponse -> Maybe [EC2InstanceLimit]
eC2InstanceLimits} -> Maybe [EC2InstanceLimit]
eC2InstanceLimits) (\s :: DescribeEC2InstanceLimitsResponse
s@DescribeEC2InstanceLimitsResponse' {} Maybe [EC2InstanceLimit]
a -> DescribeEC2InstanceLimitsResponse
s {$sel:eC2InstanceLimits:DescribeEC2InstanceLimitsResponse' :: Maybe [EC2InstanceLimit]
eC2InstanceLimits = Maybe [EC2InstanceLimit]
a} :: DescribeEC2InstanceLimitsResponse) ((Maybe [EC2InstanceLimit] -> f (Maybe [EC2InstanceLimit]))
 -> DescribeEC2InstanceLimitsResponse
 -> f DescribeEC2InstanceLimitsResponse)
-> ((Maybe [EC2InstanceLimit] -> f (Maybe [EC2InstanceLimit]))
    -> Maybe [EC2InstanceLimit] -> f (Maybe [EC2InstanceLimit]))
-> (Maybe [EC2InstanceLimit] -> f (Maybe [EC2InstanceLimit]))
-> DescribeEC2InstanceLimitsResponse
-> f DescribeEC2InstanceLimitsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EC2InstanceLimit]
  [EC2InstanceLimit]
  [EC2InstanceLimit]
  [EC2InstanceLimit]
-> Iso
     (Maybe [EC2InstanceLimit])
     (Maybe [EC2InstanceLimit])
     (Maybe [EC2InstanceLimit])
     (Maybe [EC2InstanceLimit])
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
  [EC2InstanceLimit]
  [EC2InstanceLimit]
  [EC2InstanceLimit]
  [EC2InstanceLimit]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeEC2InstanceLimitsResponse