{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ElasticBeanstalk.Types.ResourceQuota
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticBeanstalk.Types.ResourceQuota where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The AWS Elastic Beanstalk quota information for a single resource type
-- in an AWS account. It reflects the resource\'s limits for this account.
--
-- /See:/ 'newResourceQuota' smart constructor.
data ResourceQuota = ResourceQuota'
  { -- | The maximum number of instances of this Elastic Beanstalk resource type
    -- that an AWS account can use.
    ResourceQuota -> Maybe Int
maximum :: Prelude.Maybe Prelude.Int
  }
  deriving (ResourceQuota -> ResourceQuota -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceQuota -> ResourceQuota -> Bool
$c/= :: ResourceQuota -> ResourceQuota -> Bool
== :: ResourceQuota -> ResourceQuota -> Bool
$c== :: ResourceQuota -> ResourceQuota -> Bool
Prelude.Eq, ReadPrec [ResourceQuota]
ReadPrec ResourceQuota
Int -> ReadS ResourceQuota
ReadS [ResourceQuota]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceQuota]
$creadListPrec :: ReadPrec [ResourceQuota]
readPrec :: ReadPrec ResourceQuota
$creadPrec :: ReadPrec ResourceQuota
readList :: ReadS [ResourceQuota]
$creadList :: ReadS [ResourceQuota]
readsPrec :: Int -> ReadS ResourceQuota
$creadsPrec :: Int -> ReadS ResourceQuota
Prelude.Read, Int -> ResourceQuota -> ShowS
[ResourceQuota] -> ShowS
ResourceQuota -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceQuota] -> ShowS
$cshowList :: [ResourceQuota] -> ShowS
show :: ResourceQuota -> String
$cshow :: ResourceQuota -> String
showsPrec :: Int -> ResourceQuota -> ShowS
$cshowsPrec :: Int -> ResourceQuota -> ShowS
Prelude.Show, forall x. Rep ResourceQuota x -> ResourceQuota
forall x. ResourceQuota -> Rep ResourceQuota x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceQuota x -> ResourceQuota
$cfrom :: forall x. ResourceQuota -> Rep ResourceQuota x
Prelude.Generic)

-- |
-- Create a value of 'ResourceQuota' 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:
--
-- 'maximum', 'resourceQuota_maximum' - The maximum number of instances of this Elastic Beanstalk resource type
-- that an AWS account can use.
newResourceQuota ::
  ResourceQuota
newResourceQuota :: ResourceQuota
newResourceQuota =
  ResourceQuota' {$sel:maximum:ResourceQuota' :: Maybe Int
maximum = forall a. Maybe a
Prelude.Nothing}

-- | The maximum number of instances of this Elastic Beanstalk resource type
-- that an AWS account can use.
resourceQuota_maximum :: Lens.Lens' ResourceQuota (Prelude.Maybe Prelude.Int)
resourceQuota_maximum :: Lens' ResourceQuota (Maybe Int)
resourceQuota_maximum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceQuota' {Maybe Int
maximum :: Maybe Int
$sel:maximum:ResourceQuota' :: ResourceQuota -> Maybe Int
maximum} -> Maybe Int
maximum) (\s :: ResourceQuota
s@ResourceQuota' {} Maybe Int
a -> ResourceQuota
s {$sel:maximum:ResourceQuota' :: Maybe Int
maximum = Maybe Int
a} :: ResourceQuota)

instance Data.FromXML ResourceQuota where
  parseXML :: [Node] -> Either String ResourceQuota
parseXML [Node]
x =
    Maybe Int -> ResourceQuota
ResourceQuota' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Maximum")

instance Prelude.Hashable ResourceQuota where
  hashWithSalt :: Int -> ResourceQuota -> Int
hashWithSalt Int
_salt ResourceQuota' {Maybe Int
maximum :: Maybe Int
$sel:maximum:ResourceQuota' :: ResourceQuota -> Maybe Int
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maximum

instance Prelude.NFData ResourceQuota where
  rnf :: ResourceQuota -> ()
rnf ResourceQuota' {Maybe Int
maximum :: Maybe Int
$sel:maximum:ResourceQuota' :: ResourceQuota -> Maybe Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maximum