{-# 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-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)
module Amazonka.ElasticBeanstalk.Types.ResourceQuota where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ResourceQuota -> ResourceQuota -> Bool)
-> (ResourceQuota -> ResourceQuota -> Bool) -> Eq ResourceQuota
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]
(Int -> ReadS ResourceQuota)
-> ReadS [ResourceQuota]
-> ReadPrec ResourceQuota
-> ReadPrec [ResourceQuota]
-> Read 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
(Int -> ResourceQuota -> ShowS)
-> (ResourceQuota -> String)
-> ([ResourceQuota] -> ShowS)
-> Show ResourceQuota
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. ResourceQuota -> Rep ResourceQuota x)
-> (forall x. Rep ResourceQuota x -> ResourceQuota)
-> Generic ResourceQuota
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' :: Maybe Int -> ResourceQuota
ResourceQuota' {$sel:maximum:ResourceQuota' :: Maybe Int
maximum = Maybe Int
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 :: (Maybe Int -> f (Maybe Int)) -> ResourceQuota -> f ResourceQuota
resourceQuota_maximum = (ResourceQuota -> Maybe Int)
-> (ResourceQuota -> Maybe Int -> ResourceQuota)
-> Lens ResourceQuota ResourceQuota (Maybe Int) (Maybe Int)
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 Core.FromXML ResourceQuota where
  parseXML :: [Node] -> Either String ResourceQuota
parseXML [Node]
x =
    Maybe Int -> ResourceQuota
ResourceQuota' (Maybe Int -> ResourceQuota)
-> Either String (Maybe Int) -> Either String ResourceQuota
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Maximum")

instance Prelude.Hashable ResourceQuota

instance Prelude.NFData ResourceQuota