{-# 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.ServiceQuotas.Types.ServiceQuota
-- 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.ServiceQuotas.Types.ServiceQuota where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceQuotas.Types.ErrorReason
import Amazonka.ServiceQuotas.Types.MetricInfo
import Amazonka.ServiceQuotas.Types.QuotaPeriod

-- | Information about a quota.
--
-- /See:/ 'newServiceQuota' smart constructor.
data ServiceQuota = ServiceQuota'
  { -- | Indicates whether the quota is global.
    ServiceQuota -> Maybe Bool
globalQuota :: Prelude.Maybe Prelude.Bool,
    -- | The period of time.
    ServiceQuota -> Maybe QuotaPeriod
period :: Prelude.Maybe QuotaPeriod,
    -- | The quota value.
    ServiceQuota -> Maybe Double
value :: Prelude.Maybe Prelude.Double,
    -- | The Amazon Resource Name (ARN) of the quota.
    ServiceQuota -> Maybe Text
quotaArn :: Prelude.Maybe Prelude.Text,
    -- | Information about the measurement.
    ServiceQuota -> Maybe MetricInfo
usageMetric :: Prelude.Maybe MetricInfo,
    -- | The error code and error reason.
    ServiceQuota -> Maybe ErrorReason
errorReason :: Prelude.Maybe ErrorReason,
    -- | Indicates whether the quota value can be increased.
    ServiceQuota -> Maybe Bool
adjustable :: Prelude.Maybe Prelude.Bool,
    -- | The service name.
    ServiceQuota -> Maybe Text
serviceName :: Prelude.Maybe Prelude.Text,
    -- | The service identifier.
    ServiceQuota -> Maybe Text
serviceCode :: Prelude.Maybe Prelude.Text,
    -- | The quota identifier.
    ServiceQuota -> Maybe Text
quotaCode :: Prelude.Maybe Prelude.Text,
    -- | The unit of measurement.
    ServiceQuota -> Maybe Text
unit :: Prelude.Maybe Prelude.Text,
    -- | The quota name.
    ServiceQuota -> Maybe Text
quotaName :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceQuota -> ServiceQuota -> Bool
(ServiceQuota -> ServiceQuota -> Bool)
-> (ServiceQuota -> ServiceQuota -> Bool) -> Eq ServiceQuota
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceQuota -> ServiceQuota -> Bool
$c/= :: ServiceQuota -> ServiceQuota -> Bool
== :: ServiceQuota -> ServiceQuota -> Bool
$c== :: ServiceQuota -> ServiceQuota -> Bool
Prelude.Eq, ReadPrec [ServiceQuota]
ReadPrec ServiceQuota
Int -> ReadS ServiceQuota
ReadS [ServiceQuota]
(Int -> ReadS ServiceQuota)
-> ReadS [ServiceQuota]
-> ReadPrec ServiceQuota
-> ReadPrec [ServiceQuota]
-> Read ServiceQuota
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceQuota]
$creadListPrec :: ReadPrec [ServiceQuota]
readPrec :: ReadPrec ServiceQuota
$creadPrec :: ReadPrec ServiceQuota
readList :: ReadS [ServiceQuota]
$creadList :: ReadS [ServiceQuota]
readsPrec :: Int -> ReadS ServiceQuota
$creadsPrec :: Int -> ReadS ServiceQuota
Prelude.Read, Int -> ServiceQuota -> ShowS
[ServiceQuota] -> ShowS
ServiceQuota -> String
(Int -> ServiceQuota -> ShowS)
-> (ServiceQuota -> String)
-> ([ServiceQuota] -> ShowS)
-> Show ServiceQuota
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceQuota] -> ShowS
$cshowList :: [ServiceQuota] -> ShowS
show :: ServiceQuota -> String
$cshow :: ServiceQuota -> String
showsPrec :: Int -> ServiceQuota -> ShowS
$cshowsPrec :: Int -> ServiceQuota -> ShowS
Prelude.Show, (forall x. ServiceQuota -> Rep ServiceQuota x)
-> (forall x. Rep ServiceQuota x -> ServiceQuota)
-> Generic ServiceQuota
forall x. Rep ServiceQuota x -> ServiceQuota
forall x. ServiceQuota -> Rep ServiceQuota x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceQuota x -> ServiceQuota
$cfrom :: forall x. ServiceQuota -> Rep ServiceQuota x
Prelude.Generic)

-- |
-- Create a value of 'ServiceQuota' 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:
--
-- 'globalQuota', 'serviceQuota_globalQuota' - Indicates whether the quota is global.
--
-- 'period', 'serviceQuota_period' - The period of time.
--
-- 'value', 'serviceQuota_value' - The quota value.
--
-- 'quotaArn', 'serviceQuota_quotaArn' - The Amazon Resource Name (ARN) of the quota.
--
-- 'usageMetric', 'serviceQuota_usageMetric' - Information about the measurement.
--
-- 'errorReason', 'serviceQuota_errorReason' - The error code and error reason.
--
-- 'adjustable', 'serviceQuota_adjustable' - Indicates whether the quota value can be increased.
--
-- 'serviceName', 'serviceQuota_serviceName' - The service name.
--
-- 'serviceCode', 'serviceQuota_serviceCode' - The service identifier.
--
-- 'quotaCode', 'serviceQuota_quotaCode' - The quota identifier.
--
-- 'unit', 'serviceQuota_unit' - The unit of measurement.
--
-- 'quotaName', 'serviceQuota_quotaName' - The quota name.
newServiceQuota ::
  ServiceQuota
newServiceQuota :: ServiceQuota
newServiceQuota =
  ServiceQuota' :: Maybe Bool
-> Maybe QuotaPeriod
-> Maybe Double
-> Maybe Text
-> Maybe MetricInfo
-> Maybe ErrorReason
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ServiceQuota
ServiceQuota'
    { $sel:globalQuota:ServiceQuota' :: Maybe Bool
globalQuota = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:period:ServiceQuota' :: Maybe QuotaPeriod
period = Maybe QuotaPeriod
forall a. Maybe a
Prelude.Nothing,
      $sel:value:ServiceQuota' :: Maybe Double
value = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:quotaArn:ServiceQuota' :: Maybe Text
quotaArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:usageMetric:ServiceQuota' :: Maybe MetricInfo
usageMetric = Maybe MetricInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:errorReason:ServiceQuota' :: Maybe ErrorReason
errorReason = Maybe ErrorReason
forall a. Maybe a
Prelude.Nothing,
      $sel:adjustable:ServiceQuota' :: Maybe Bool
adjustable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceName:ServiceQuota' :: Maybe Text
serviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceCode:ServiceQuota' :: Maybe Text
serviceCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:quotaCode:ServiceQuota' :: Maybe Text
quotaCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:unit:ServiceQuota' :: Maybe Text
unit = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:quotaName:ServiceQuota' :: Maybe Text
quotaName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the quota is global.
serviceQuota_globalQuota :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Bool)
serviceQuota_globalQuota :: (Maybe Bool -> f (Maybe Bool)) -> ServiceQuota -> f ServiceQuota
serviceQuota_globalQuota = (ServiceQuota -> Maybe Bool)
-> (ServiceQuota -> Maybe Bool -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Bool
globalQuota :: Maybe Bool
$sel:globalQuota:ServiceQuota' :: ServiceQuota -> Maybe Bool
globalQuota} -> Maybe Bool
globalQuota) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Bool
a -> ServiceQuota
s {$sel:globalQuota:ServiceQuota' :: Maybe Bool
globalQuota = Maybe Bool
a} :: ServiceQuota)

-- | The period of time.
serviceQuota_period :: Lens.Lens' ServiceQuota (Prelude.Maybe QuotaPeriod)
serviceQuota_period :: (Maybe QuotaPeriod -> f (Maybe QuotaPeriod))
-> ServiceQuota -> f ServiceQuota
serviceQuota_period = (ServiceQuota -> Maybe QuotaPeriod)
-> (ServiceQuota -> Maybe QuotaPeriod -> ServiceQuota)
-> Lens
     ServiceQuota ServiceQuota (Maybe QuotaPeriod) (Maybe QuotaPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe QuotaPeriod
period :: Maybe QuotaPeriod
$sel:period:ServiceQuota' :: ServiceQuota -> Maybe QuotaPeriod
period} -> Maybe QuotaPeriod
period) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe QuotaPeriod
a -> ServiceQuota
s {$sel:period:ServiceQuota' :: Maybe QuotaPeriod
period = Maybe QuotaPeriod
a} :: ServiceQuota)

-- | The quota value.
serviceQuota_value :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Double)
serviceQuota_value :: (Maybe Double -> f (Maybe Double))
-> ServiceQuota -> f ServiceQuota
serviceQuota_value = (ServiceQuota -> Maybe Double)
-> (ServiceQuota -> Maybe Double -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Double
value :: Maybe Double
$sel:value:ServiceQuota' :: ServiceQuota -> Maybe Double
value} -> Maybe Double
value) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Double
a -> ServiceQuota
s {$sel:value:ServiceQuota' :: Maybe Double
value = Maybe Double
a} :: ServiceQuota)

-- | The Amazon Resource Name (ARN) of the quota.
serviceQuota_quotaArn :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Text)
serviceQuota_quotaArn :: (Maybe Text -> f (Maybe Text)) -> ServiceQuota -> f ServiceQuota
serviceQuota_quotaArn = (ServiceQuota -> Maybe Text)
-> (ServiceQuota -> Maybe Text -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Text
quotaArn :: Maybe Text
$sel:quotaArn:ServiceQuota' :: ServiceQuota -> Maybe Text
quotaArn} -> Maybe Text
quotaArn) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Text
a -> ServiceQuota
s {$sel:quotaArn:ServiceQuota' :: Maybe Text
quotaArn = Maybe Text
a} :: ServiceQuota)

-- | Information about the measurement.
serviceQuota_usageMetric :: Lens.Lens' ServiceQuota (Prelude.Maybe MetricInfo)
serviceQuota_usageMetric :: (Maybe MetricInfo -> f (Maybe MetricInfo))
-> ServiceQuota -> f ServiceQuota
serviceQuota_usageMetric = (ServiceQuota -> Maybe MetricInfo)
-> (ServiceQuota -> Maybe MetricInfo -> ServiceQuota)
-> Lens
     ServiceQuota ServiceQuota (Maybe MetricInfo) (Maybe MetricInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe MetricInfo
usageMetric :: Maybe MetricInfo
$sel:usageMetric:ServiceQuota' :: ServiceQuota -> Maybe MetricInfo
usageMetric} -> Maybe MetricInfo
usageMetric) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe MetricInfo
a -> ServiceQuota
s {$sel:usageMetric:ServiceQuota' :: Maybe MetricInfo
usageMetric = Maybe MetricInfo
a} :: ServiceQuota)

-- | The error code and error reason.
serviceQuota_errorReason :: Lens.Lens' ServiceQuota (Prelude.Maybe ErrorReason)
serviceQuota_errorReason :: (Maybe ErrorReason -> f (Maybe ErrorReason))
-> ServiceQuota -> f ServiceQuota
serviceQuota_errorReason = (ServiceQuota -> Maybe ErrorReason)
-> (ServiceQuota -> Maybe ErrorReason -> ServiceQuota)
-> Lens
     ServiceQuota ServiceQuota (Maybe ErrorReason) (Maybe ErrorReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe ErrorReason
errorReason :: Maybe ErrorReason
$sel:errorReason:ServiceQuota' :: ServiceQuota -> Maybe ErrorReason
errorReason} -> Maybe ErrorReason
errorReason) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe ErrorReason
a -> ServiceQuota
s {$sel:errorReason:ServiceQuota' :: Maybe ErrorReason
errorReason = Maybe ErrorReason
a} :: ServiceQuota)

-- | Indicates whether the quota value can be increased.
serviceQuota_adjustable :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Bool)
serviceQuota_adjustable :: (Maybe Bool -> f (Maybe Bool)) -> ServiceQuota -> f ServiceQuota
serviceQuota_adjustable = (ServiceQuota -> Maybe Bool)
-> (ServiceQuota -> Maybe Bool -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Bool
adjustable :: Maybe Bool
$sel:adjustable:ServiceQuota' :: ServiceQuota -> Maybe Bool
adjustable} -> Maybe Bool
adjustable) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Bool
a -> ServiceQuota
s {$sel:adjustable:ServiceQuota' :: Maybe Bool
adjustable = Maybe Bool
a} :: ServiceQuota)

-- | The service name.
serviceQuota_serviceName :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Text)
serviceQuota_serviceName :: (Maybe Text -> f (Maybe Text)) -> ServiceQuota -> f ServiceQuota
serviceQuota_serviceName = (ServiceQuota -> Maybe Text)
-> (ServiceQuota -> Maybe Text -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Text
serviceName :: Maybe Text
$sel:serviceName:ServiceQuota' :: ServiceQuota -> Maybe Text
serviceName} -> Maybe Text
serviceName) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Text
a -> ServiceQuota
s {$sel:serviceName:ServiceQuota' :: Maybe Text
serviceName = Maybe Text
a} :: ServiceQuota)

-- | The service identifier.
serviceQuota_serviceCode :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Text)
serviceQuota_serviceCode :: (Maybe Text -> f (Maybe Text)) -> ServiceQuota -> f ServiceQuota
serviceQuota_serviceCode = (ServiceQuota -> Maybe Text)
-> (ServiceQuota -> Maybe Text -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Text
serviceCode :: Maybe Text
$sel:serviceCode:ServiceQuota' :: ServiceQuota -> Maybe Text
serviceCode} -> Maybe Text
serviceCode) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Text
a -> ServiceQuota
s {$sel:serviceCode:ServiceQuota' :: Maybe Text
serviceCode = Maybe Text
a} :: ServiceQuota)

-- | The quota identifier.
serviceQuota_quotaCode :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Text)
serviceQuota_quotaCode :: (Maybe Text -> f (Maybe Text)) -> ServiceQuota -> f ServiceQuota
serviceQuota_quotaCode = (ServiceQuota -> Maybe Text)
-> (ServiceQuota -> Maybe Text -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Text
quotaCode :: Maybe Text
$sel:quotaCode:ServiceQuota' :: ServiceQuota -> Maybe Text
quotaCode} -> Maybe Text
quotaCode) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Text
a -> ServiceQuota
s {$sel:quotaCode:ServiceQuota' :: Maybe Text
quotaCode = Maybe Text
a} :: ServiceQuota)

-- | The unit of measurement.
serviceQuota_unit :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Text)
serviceQuota_unit :: (Maybe Text -> f (Maybe Text)) -> ServiceQuota -> f ServiceQuota
serviceQuota_unit = (ServiceQuota -> Maybe Text)
-> (ServiceQuota -> Maybe Text -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Text
unit :: Maybe Text
$sel:unit:ServiceQuota' :: ServiceQuota -> Maybe Text
unit} -> Maybe Text
unit) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Text
a -> ServiceQuota
s {$sel:unit:ServiceQuota' :: Maybe Text
unit = Maybe Text
a} :: ServiceQuota)

-- | The quota name.
serviceQuota_quotaName :: Lens.Lens' ServiceQuota (Prelude.Maybe Prelude.Text)
serviceQuota_quotaName :: (Maybe Text -> f (Maybe Text)) -> ServiceQuota -> f ServiceQuota
serviceQuota_quotaName = (ServiceQuota -> Maybe Text)
-> (ServiceQuota -> Maybe Text -> ServiceQuota)
-> Lens ServiceQuota ServiceQuota (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceQuota' {Maybe Text
quotaName :: Maybe Text
$sel:quotaName:ServiceQuota' :: ServiceQuota -> Maybe Text
quotaName} -> Maybe Text
quotaName) (\s :: ServiceQuota
s@ServiceQuota' {} Maybe Text
a -> ServiceQuota
s {$sel:quotaName:ServiceQuota' :: Maybe Text
quotaName = Maybe Text
a} :: ServiceQuota)

instance Core.FromJSON ServiceQuota where
  parseJSON :: Value -> Parser ServiceQuota
parseJSON =
    String
-> (Object -> Parser ServiceQuota) -> Value -> Parser ServiceQuota
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ServiceQuota"
      ( \Object
x ->
          Maybe Bool
-> Maybe QuotaPeriod
-> Maybe Double
-> Maybe Text
-> Maybe MetricInfo
-> Maybe ErrorReason
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ServiceQuota
ServiceQuota'
            (Maybe Bool
 -> Maybe QuotaPeriod
 -> Maybe Double
 -> Maybe Text
 -> Maybe MetricInfo
 -> Maybe ErrorReason
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> ServiceQuota)
-> Parser (Maybe Bool)
-> Parser
     (Maybe QuotaPeriod
      -> Maybe Double
      -> Maybe Text
      -> Maybe MetricInfo
      -> Maybe ErrorReason
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ServiceQuota)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GlobalQuota")
            Parser
  (Maybe QuotaPeriod
   -> Maybe Double
   -> Maybe Text
   -> Maybe MetricInfo
   -> Maybe ErrorReason
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ServiceQuota)
-> Parser (Maybe QuotaPeriod)
-> Parser
     (Maybe Double
      -> Maybe Text
      -> Maybe MetricInfo
      -> Maybe ErrorReason
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QuotaPeriod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Period")
            Parser
  (Maybe Double
   -> Maybe Text
   -> Maybe MetricInfo
   -> Maybe ErrorReason
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ServiceQuota)
-> Parser (Maybe Double)
-> Parser
     (Maybe Text
      -> Maybe MetricInfo
      -> Maybe ErrorReason
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Value")
            Parser
  (Maybe Text
   -> Maybe MetricInfo
   -> Maybe ErrorReason
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ServiceQuota)
-> Parser (Maybe Text)
-> Parser
     (Maybe MetricInfo
      -> Maybe ErrorReason
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuotaArn")
            Parser
  (Maybe MetricInfo
   -> Maybe ErrorReason
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ServiceQuota)
-> Parser (Maybe MetricInfo)
-> Parser
     (Maybe ErrorReason
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MetricInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UsageMetric")
            Parser
  (Maybe ErrorReason
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ServiceQuota)
-> Parser (Maybe ErrorReason)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ErrorReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorReason")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ServiceQuota)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Adjustable")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ServiceQuota)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceName")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> ServiceQuota)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceCode")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> ServiceQuota)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuotaCode")
            Parser (Maybe Text -> Maybe Text -> ServiceQuota)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ServiceQuota)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Unit")
            Parser (Maybe Text -> ServiceQuota)
-> Parser (Maybe Text) -> Parser ServiceQuota
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QuotaName")
      )

instance Prelude.Hashable ServiceQuota

instance Prelude.NFData ServiceQuota