{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53.Types.ReusableDelegationSetLimit 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
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
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]
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
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.
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'
    { $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 :: Lens' ReusableDelegationSetLimit ReusableDelegationSetLimitType
reusableDelegationSetLimit_type = 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 :: Lens' ReusableDelegationSetLimit Natural
reusableDelegationSetLimit_value = 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 Data.FromXML ReusableDelegationSetLimit where
  parseXML :: [Node] -> Either String ReusableDelegationSetLimit
parseXML [Node]
x =
    ReusableDelegationSetLimitType
-> Natural -> ReusableDelegationSetLimit
ReusableDelegationSetLimit'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Type")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Value")

instance Prelude.Hashable ReusableDelegationSetLimit where
  hashWithSalt :: Int -> ReusableDelegationSetLimit -> Int
hashWithSalt Int
_salt ReusableDelegationSetLimit' {Natural
ReusableDelegationSetLimitType
value :: Natural
type' :: ReusableDelegationSetLimitType
$sel:value:ReusableDelegationSetLimit' :: ReusableDelegationSetLimit -> Natural
$sel:type':ReusableDelegationSetLimit' :: ReusableDelegationSetLimit -> ReusableDelegationSetLimitType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ReusableDelegationSetLimitType
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
value

instance Prelude.NFData ReusableDelegationSetLimit where
  rnf :: ReusableDelegationSetLimit -> ()
rnf ReusableDelegationSetLimit' {Natural
ReusableDelegationSetLimitType
value :: Natural
type' :: ReusableDelegationSetLimitType
$sel:value:ReusableDelegationSetLimit' :: ReusableDelegationSetLimit -> Natural
$sel:type':ReusableDelegationSetLimit' :: ReusableDelegationSetLimit -> ReusableDelegationSetLimitType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf ReusableDelegationSetLimitType
type' seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
value