{-# 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.Route53.Types.ReusableDelegationSetLimit
-- 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.Route53.Types.ReusableDelegationSetLimit where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
import Amazonka.Route53.Types.ReusableDelegationSetLimitType

-- | A complex type that contains the type of limit that you specified in the
-- request and the current value for that limit.
--
-- /See:/ 'newReusableDelegationSetLimit' smart constructor.
data ReusableDelegationSetLimit = ReusableDelegationSetLimit'
  { -- | The limit that you requested: @MAX_ZONES_BY_REUSABLE_DELEGATION_SET@,
    -- the maximum number of hosted zones that you can associate with the
    -- specified reusable delegation set.
    ReusableDelegationSetLimit -> ReusableDelegationSetLimitType
type' :: ReusableDelegationSetLimitType,
    -- | The current value for the @MAX_ZONES_BY_REUSABLE_DELEGATION_SET@ limit.
    ReusableDelegationSetLimit -> Natural
value :: Prelude.Natural
  }
  deriving (ReusableDelegationSetLimit -> ReusableDelegationSetLimit -> Bool
(ReusableDelegationSetLimit -> ReusableDelegationSetLimit -> Bool)
-> (ReusableDelegationSetLimit
    -> ReusableDelegationSetLimit -> Bool)
-> Eq ReusableDelegationSetLimit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReusableDelegationSetLimit -> ReusableDelegationSetLimit -> Bool
$c/= :: ReusableDelegationSetLimit -> ReusableDelegationSetLimit -> Bool
== :: ReusableDelegationSetLimit -> ReusableDelegationSetLimit -> Bool
$c== :: ReusableDelegationSetLimit -> ReusableDelegationSetLimit -> Bool
Prelude.Eq, ReadPrec [ReusableDelegationSetLimit]
ReadPrec ReusableDelegationSetLimit
Int -> ReadS ReusableDelegationSetLimit
ReadS [ReusableDelegationSetLimit]
(Int -> ReadS ReusableDelegationSetLimit)
-> ReadS [ReusableDelegationSetLimit]
-> ReadPrec ReusableDelegationSetLimit
-> ReadPrec [ReusableDelegationSetLimit]
-> Read ReusableDelegationSetLimit
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReusableDelegationSetLimit]
$creadListPrec :: ReadPrec [ReusableDelegationSetLimit]
readPrec :: ReadPrec ReusableDelegationSetLimit
$creadPrec :: ReadPrec ReusableDelegationSetLimit
readList :: ReadS [ReusableDelegationSetLimit]
$creadList :: ReadS [ReusableDelegationSetLimit]
readsPrec :: Int -> ReadS ReusableDelegationSetLimit
$creadsPrec :: Int -> ReadS ReusableDelegationSetLimit
Prelude.Read, Int -> ReusableDelegationSetLimit -> ShowS
[ReusableDelegationSetLimit] -> ShowS
ReusableDelegationSetLimit -> String
(Int -> ReusableDelegationSetLimit -> ShowS)
-> (ReusableDelegationSetLimit -> String)
-> ([ReusableDelegationSetLimit] -> ShowS)
-> Show ReusableDelegationSetLimit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReusableDelegationSetLimit] -> ShowS
$cshowList :: [ReusableDelegationSetLimit] -> ShowS
show :: ReusableDelegationSetLimit -> String
$cshow :: ReusableDelegationSetLimit -> String
showsPrec :: Int -> ReusableDelegationSetLimit -> ShowS
$cshowsPrec :: Int -> ReusableDelegationSetLimit -> ShowS
Prelude.Show, (forall x.
 ReusableDelegationSetLimit -> Rep ReusableDelegationSetLimit x)
-> (forall x.
    Rep ReusableDelegationSetLimit x -> ReusableDelegationSetLimit)
-> Generic ReusableDelegationSetLimit
forall x.
Rep ReusableDelegationSetLimit x -> ReusableDelegationSetLimit
forall x.
ReusableDelegationSetLimit -> Rep ReusableDelegationSetLimit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReusableDelegationSetLimit x -> ReusableDelegationSetLimit
$cfrom :: forall x.
ReusableDelegationSetLimit -> Rep ReusableDelegationSetLimit x
Prelude.Generic)

-- |
-- Create a value of 'ReusableDelegationSetLimit' 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:
--
-- 'type'', 'reusableDelegationSetLimit_type' - The limit that you requested: @MAX_ZONES_BY_REUSABLE_DELEGATION_SET@,
-- the maximum number of hosted zones that you can associate with the
-- specified reusable delegation set.
--
-- 'value', 'reusableDelegationSetLimit_value' - The current value for the @MAX_ZONES_BY_REUSABLE_DELEGATION_SET@ limit.
newReusableDelegationSetLimit ::
  -- | 'type''
  ReusableDelegationSetLimitType ->
  -- | 'value'
  Prelude.Natural ->
  ReusableDelegationSetLimit
newReusableDelegationSetLimit :: ReusableDelegationSetLimitType
-> Natural -> ReusableDelegationSetLimit
newReusableDelegationSetLimit ReusableDelegationSetLimitType
pType_ Natural
pValue_ =
  ReusableDelegationSetLimit' :: ReusableDelegationSetLimitType
-> Natural -> ReusableDelegationSetLimit
ReusableDelegationSetLimit'
    { $sel:type':ReusableDelegationSetLimit' :: ReusableDelegationSetLimitType
type' = ReusableDelegationSetLimitType
pType_,
      $sel:value:ReusableDelegationSetLimit' :: Natural
value = Natural
pValue_
    }

-- | The limit that you requested: @MAX_ZONES_BY_REUSABLE_DELEGATION_SET@,
-- the maximum number of hosted zones that you can associate with the
-- specified reusable delegation set.
reusableDelegationSetLimit_type :: Lens.Lens' ReusableDelegationSetLimit ReusableDelegationSetLimitType
reusableDelegationSetLimit_type :: (ReusableDelegationSetLimitType
 -> f ReusableDelegationSetLimitType)
-> ReusableDelegationSetLimit -> f ReusableDelegationSetLimit
reusableDelegationSetLimit_type = (ReusableDelegationSetLimit -> ReusableDelegationSetLimitType)
-> (ReusableDelegationSetLimit
    -> ReusableDelegationSetLimitType -> ReusableDelegationSetLimit)
-> Lens
     ReusableDelegationSetLimit
     ReusableDelegationSetLimit
     ReusableDelegationSetLimitType
     ReusableDelegationSetLimitType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReusableDelegationSetLimit' {ReusableDelegationSetLimitType
type' :: ReusableDelegationSetLimitType
$sel:type':ReusableDelegationSetLimit' :: ReusableDelegationSetLimit -> ReusableDelegationSetLimitType
type'} -> ReusableDelegationSetLimitType
type') (\s :: ReusableDelegationSetLimit
s@ReusableDelegationSetLimit' {} ReusableDelegationSetLimitType
a -> ReusableDelegationSetLimit
s {$sel:type':ReusableDelegationSetLimit' :: ReusableDelegationSetLimitType
type' = ReusableDelegationSetLimitType
a} :: ReusableDelegationSetLimit)

-- | The current value for the @MAX_ZONES_BY_REUSABLE_DELEGATION_SET@ limit.
reusableDelegationSetLimit_value :: Lens.Lens' ReusableDelegationSetLimit Prelude.Natural
reusableDelegationSetLimit_value :: (Natural -> f Natural)
-> ReusableDelegationSetLimit -> f ReusableDelegationSetLimit
reusableDelegationSetLimit_value = (ReusableDelegationSetLimit -> Natural)
-> (ReusableDelegationSetLimit
    -> Natural -> ReusableDelegationSetLimit)
-> Lens
     ReusableDelegationSetLimit
     ReusableDelegationSetLimit
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReusableDelegationSetLimit' {Natural
value :: Natural
$sel:value:ReusableDelegationSetLimit' :: ReusableDelegationSetLimit -> Natural
value} -> Natural
value) (\s :: ReusableDelegationSetLimit
s@ReusableDelegationSetLimit' {} Natural
a -> ReusableDelegationSetLimit
s {$sel:value:ReusableDelegationSetLimit' :: Natural
value = Natural
a} :: ReusableDelegationSetLimit)

instance Core.FromXML ReusableDelegationSetLimit where
  parseXML :: [Node] -> Either String ReusableDelegationSetLimit
parseXML [Node]
x =
    ReusableDelegationSetLimitType
-> Natural -> ReusableDelegationSetLimit
ReusableDelegationSetLimit'
      (ReusableDelegationSetLimitType
 -> Natural -> ReusableDelegationSetLimit)
-> Either String ReusableDelegationSetLimitType
-> Either String (Natural -> ReusableDelegationSetLimit)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String ReusableDelegationSetLimitType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Type") Either String (Natural -> ReusableDelegationSetLimit)
-> Either String Natural
-> Either String ReusableDelegationSetLimit
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Natural
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Value")

instance Prelude.Hashable ReusableDelegationSetLimit

instance Prelude.NFData ReusableDelegationSetLimit