{-# 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.ResourceQuotas
-- 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.ResourceQuotas where

import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types.ResourceQuota
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A set of per-resource AWS Elastic Beanstalk quotas associated with an
-- AWS account. They reflect Elastic Beanstalk resource limits for this
-- account.
--
-- /See:/ 'newResourceQuotas' smart constructor.
data ResourceQuotas = ResourceQuotas'
  { -- | The quota for applications in the AWS account.
    ResourceQuotas -> Maybe ResourceQuota
applicationQuota :: Prelude.Maybe ResourceQuota,
    -- | The quota for custom platforms in the AWS account.
    ResourceQuotas -> Maybe ResourceQuota
customPlatformQuota :: Prelude.Maybe ResourceQuota,
    -- | The quota for application versions in the AWS account.
    ResourceQuotas -> Maybe ResourceQuota
applicationVersionQuota :: Prelude.Maybe ResourceQuota,
    -- | The quota for environments in the AWS account.
    ResourceQuotas -> Maybe ResourceQuota
environmentQuota :: Prelude.Maybe ResourceQuota,
    -- | The quota for configuration templates in the AWS account.
    ResourceQuotas -> Maybe ResourceQuota
configurationTemplateQuota :: Prelude.Maybe ResourceQuota
  }
  deriving (ResourceQuotas -> ResourceQuotas -> Bool
(ResourceQuotas -> ResourceQuotas -> Bool)
-> (ResourceQuotas -> ResourceQuotas -> Bool) -> Eq ResourceQuotas
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceQuotas -> ResourceQuotas -> Bool
$c/= :: ResourceQuotas -> ResourceQuotas -> Bool
== :: ResourceQuotas -> ResourceQuotas -> Bool
$c== :: ResourceQuotas -> ResourceQuotas -> Bool
Prelude.Eq, ReadPrec [ResourceQuotas]
ReadPrec ResourceQuotas
Int -> ReadS ResourceQuotas
ReadS [ResourceQuotas]
(Int -> ReadS ResourceQuotas)
-> ReadS [ResourceQuotas]
-> ReadPrec ResourceQuotas
-> ReadPrec [ResourceQuotas]
-> Read ResourceQuotas
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceQuotas]
$creadListPrec :: ReadPrec [ResourceQuotas]
readPrec :: ReadPrec ResourceQuotas
$creadPrec :: ReadPrec ResourceQuotas
readList :: ReadS [ResourceQuotas]
$creadList :: ReadS [ResourceQuotas]
readsPrec :: Int -> ReadS ResourceQuotas
$creadsPrec :: Int -> ReadS ResourceQuotas
Prelude.Read, Int -> ResourceQuotas -> ShowS
[ResourceQuotas] -> ShowS
ResourceQuotas -> String
(Int -> ResourceQuotas -> ShowS)
-> (ResourceQuotas -> String)
-> ([ResourceQuotas] -> ShowS)
-> Show ResourceQuotas
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceQuotas] -> ShowS
$cshowList :: [ResourceQuotas] -> ShowS
show :: ResourceQuotas -> String
$cshow :: ResourceQuotas -> String
showsPrec :: Int -> ResourceQuotas -> ShowS
$cshowsPrec :: Int -> ResourceQuotas -> ShowS
Prelude.Show, (forall x. ResourceQuotas -> Rep ResourceQuotas x)
-> (forall x. Rep ResourceQuotas x -> ResourceQuotas)
-> Generic ResourceQuotas
forall x. Rep ResourceQuotas x -> ResourceQuotas
forall x. ResourceQuotas -> Rep ResourceQuotas x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceQuotas x -> ResourceQuotas
$cfrom :: forall x. ResourceQuotas -> Rep ResourceQuotas x
Prelude.Generic)

-- |
-- Create a value of 'ResourceQuotas' 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:
--
-- 'applicationQuota', 'resourceQuotas_applicationQuota' - The quota for applications in the AWS account.
--
-- 'customPlatformQuota', 'resourceQuotas_customPlatformQuota' - The quota for custom platforms in the AWS account.
--
-- 'applicationVersionQuota', 'resourceQuotas_applicationVersionQuota' - The quota for application versions in the AWS account.
--
-- 'environmentQuota', 'resourceQuotas_environmentQuota' - The quota for environments in the AWS account.
--
-- 'configurationTemplateQuota', 'resourceQuotas_configurationTemplateQuota' - The quota for configuration templates in the AWS account.
newResourceQuotas ::
  ResourceQuotas
newResourceQuotas :: ResourceQuotas
newResourceQuotas =
  ResourceQuotas' :: Maybe ResourceQuota
-> Maybe ResourceQuota
-> Maybe ResourceQuota
-> Maybe ResourceQuota
-> Maybe ResourceQuota
-> ResourceQuotas
ResourceQuotas'
    { $sel:applicationQuota:ResourceQuotas' :: Maybe ResourceQuota
applicationQuota = Maybe ResourceQuota
forall a. Maybe a
Prelude.Nothing,
      $sel:customPlatformQuota:ResourceQuotas' :: Maybe ResourceQuota
customPlatformQuota = Maybe ResourceQuota
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationVersionQuota:ResourceQuotas' :: Maybe ResourceQuota
applicationVersionQuota = Maybe ResourceQuota
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentQuota:ResourceQuotas' :: Maybe ResourceQuota
environmentQuota = Maybe ResourceQuota
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationTemplateQuota:ResourceQuotas' :: Maybe ResourceQuota
configurationTemplateQuota = Maybe ResourceQuota
forall a. Maybe a
Prelude.Nothing
    }

-- | The quota for applications in the AWS account.
resourceQuotas_applicationQuota :: Lens.Lens' ResourceQuotas (Prelude.Maybe ResourceQuota)
resourceQuotas_applicationQuota :: (Maybe ResourceQuota -> f (Maybe ResourceQuota))
-> ResourceQuotas -> f ResourceQuotas
resourceQuotas_applicationQuota = (ResourceQuotas -> Maybe ResourceQuota)
-> (ResourceQuotas -> Maybe ResourceQuota -> ResourceQuotas)
-> Lens
     ResourceQuotas
     ResourceQuotas
     (Maybe ResourceQuota)
     (Maybe ResourceQuota)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceQuotas' {Maybe ResourceQuota
applicationQuota :: Maybe ResourceQuota
$sel:applicationQuota:ResourceQuotas' :: ResourceQuotas -> Maybe ResourceQuota
applicationQuota} -> Maybe ResourceQuota
applicationQuota) (\s :: ResourceQuotas
s@ResourceQuotas' {} Maybe ResourceQuota
a -> ResourceQuotas
s {$sel:applicationQuota:ResourceQuotas' :: Maybe ResourceQuota
applicationQuota = Maybe ResourceQuota
a} :: ResourceQuotas)

-- | The quota for custom platforms in the AWS account.
resourceQuotas_customPlatformQuota :: Lens.Lens' ResourceQuotas (Prelude.Maybe ResourceQuota)
resourceQuotas_customPlatformQuota :: (Maybe ResourceQuota -> f (Maybe ResourceQuota))
-> ResourceQuotas -> f ResourceQuotas
resourceQuotas_customPlatformQuota = (ResourceQuotas -> Maybe ResourceQuota)
-> (ResourceQuotas -> Maybe ResourceQuota -> ResourceQuotas)
-> Lens
     ResourceQuotas
     ResourceQuotas
     (Maybe ResourceQuota)
     (Maybe ResourceQuota)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceQuotas' {Maybe ResourceQuota
customPlatformQuota :: Maybe ResourceQuota
$sel:customPlatformQuota:ResourceQuotas' :: ResourceQuotas -> Maybe ResourceQuota
customPlatformQuota} -> Maybe ResourceQuota
customPlatformQuota) (\s :: ResourceQuotas
s@ResourceQuotas' {} Maybe ResourceQuota
a -> ResourceQuotas
s {$sel:customPlatformQuota:ResourceQuotas' :: Maybe ResourceQuota
customPlatformQuota = Maybe ResourceQuota
a} :: ResourceQuotas)

-- | The quota for application versions in the AWS account.
resourceQuotas_applicationVersionQuota :: Lens.Lens' ResourceQuotas (Prelude.Maybe ResourceQuota)
resourceQuotas_applicationVersionQuota :: (Maybe ResourceQuota -> f (Maybe ResourceQuota))
-> ResourceQuotas -> f ResourceQuotas
resourceQuotas_applicationVersionQuota = (ResourceQuotas -> Maybe ResourceQuota)
-> (ResourceQuotas -> Maybe ResourceQuota -> ResourceQuotas)
-> Lens
     ResourceQuotas
     ResourceQuotas
     (Maybe ResourceQuota)
     (Maybe ResourceQuota)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceQuotas' {Maybe ResourceQuota
applicationVersionQuota :: Maybe ResourceQuota
$sel:applicationVersionQuota:ResourceQuotas' :: ResourceQuotas -> Maybe ResourceQuota
applicationVersionQuota} -> Maybe ResourceQuota
applicationVersionQuota) (\s :: ResourceQuotas
s@ResourceQuotas' {} Maybe ResourceQuota
a -> ResourceQuotas
s {$sel:applicationVersionQuota:ResourceQuotas' :: Maybe ResourceQuota
applicationVersionQuota = Maybe ResourceQuota
a} :: ResourceQuotas)

-- | The quota for environments in the AWS account.
resourceQuotas_environmentQuota :: Lens.Lens' ResourceQuotas (Prelude.Maybe ResourceQuota)
resourceQuotas_environmentQuota :: (Maybe ResourceQuota -> f (Maybe ResourceQuota))
-> ResourceQuotas -> f ResourceQuotas
resourceQuotas_environmentQuota = (ResourceQuotas -> Maybe ResourceQuota)
-> (ResourceQuotas -> Maybe ResourceQuota -> ResourceQuotas)
-> Lens
     ResourceQuotas
     ResourceQuotas
     (Maybe ResourceQuota)
     (Maybe ResourceQuota)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceQuotas' {Maybe ResourceQuota
environmentQuota :: Maybe ResourceQuota
$sel:environmentQuota:ResourceQuotas' :: ResourceQuotas -> Maybe ResourceQuota
environmentQuota} -> Maybe ResourceQuota
environmentQuota) (\s :: ResourceQuotas
s@ResourceQuotas' {} Maybe ResourceQuota
a -> ResourceQuotas
s {$sel:environmentQuota:ResourceQuotas' :: Maybe ResourceQuota
environmentQuota = Maybe ResourceQuota
a} :: ResourceQuotas)

-- | The quota for configuration templates in the AWS account.
resourceQuotas_configurationTemplateQuota :: Lens.Lens' ResourceQuotas (Prelude.Maybe ResourceQuota)
resourceQuotas_configurationTemplateQuota :: (Maybe ResourceQuota -> f (Maybe ResourceQuota))
-> ResourceQuotas -> f ResourceQuotas
resourceQuotas_configurationTemplateQuota = (ResourceQuotas -> Maybe ResourceQuota)
-> (ResourceQuotas -> Maybe ResourceQuota -> ResourceQuotas)
-> Lens
     ResourceQuotas
     ResourceQuotas
     (Maybe ResourceQuota)
     (Maybe ResourceQuota)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceQuotas' {Maybe ResourceQuota
configurationTemplateQuota :: Maybe ResourceQuota
$sel:configurationTemplateQuota:ResourceQuotas' :: ResourceQuotas -> Maybe ResourceQuota
configurationTemplateQuota} -> Maybe ResourceQuota
configurationTemplateQuota) (\s :: ResourceQuotas
s@ResourceQuotas' {} Maybe ResourceQuota
a -> ResourceQuotas
s {$sel:configurationTemplateQuota:ResourceQuotas' :: Maybe ResourceQuota
configurationTemplateQuota = Maybe ResourceQuota
a} :: ResourceQuotas)

instance Core.FromXML ResourceQuotas where
  parseXML :: [Node] -> Either String ResourceQuotas
parseXML [Node]
x =
    Maybe ResourceQuota
-> Maybe ResourceQuota
-> Maybe ResourceQuota
-> Maybe ResourceQuota
-> Maybe ResourceQuota
-> ResourceQuotas
ResourceQuotas'
      (Maybe ResourceQuota
 -> Maybe ResourceQuota
 -> Maybe ResourceQuota
 -> Maybe ResourceQuota
 -> Maybe ResourceQuota
 -> ResourceQuotas)
-> Either String (Maybe ResourceQuota)
-> Either
     String
     (Maybe ResourceQuota
      -> Maybe ResourceQuota
      -> Maybe ResourceQuota
      -> Maybe ResourceQuota
      -> ResourceQuotas)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ResourceQuota)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ApplicationQuota")
      Either
  String
  (Maybe ResourceQuota
   -> Maybe ResourceQuota
   -> Maybe ResourceQuota
   -> Maybe ResourceQuota
   -> ResourceQuotas)
-> Either String (Maybe ResourceQuota)
-> Either
     String
     (Maybe ResourceQuota
      -> Maybe ResourceQuota -> Maybe ResourceQuota -> ResourceQuotas)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ResourceQuota)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CustomPlatformQuota")
      Either
  String
  (Maybe ResourceQuota
   -> Maybe ResourceQuota -> Maybe ResourceQuota -> ResourceQuotas)
-> Either String (Maybe ResourceQuota)
-> Either
     String
     (Maybe ResourceQuota -> Maybe ResourceQuota -> ResourceQuotas)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ResourceQuota)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ApplicationVersionQuota")
      Either
  String
  (Maybe ResourceQuota -> Maybe ResourceQuota -> ResourceQuotas)
-> Either String (Maybe ResourceQuota)
-> Either String (Maybe ResourceQuota -> ResourceQuotas)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ResourceQuota)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EnvironmentQuota")
      Either String (Maybe ResourceQuota -> ResourceQuotas)
-> Either String (Maybe ResourceQuota)
-> Either String ResourceQuotas
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ResourceQuota)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ConfigurationTemplateQuota")

instance Prelude.Hashable ResourceQuotas

instance Prelude.NFData ResourceQuotas