{-# 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.HostedZoneLimit
-- 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.HostedZoneLimit 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.HostedZoneLimitType

-- | A complex type that contains the type of limit that you specified in the
-- request and the current value for that limit.
--
-- /See:/ 'newHostedZoneLimit' smart constructor.
data HostedZoneLimit = HostedZoneLimit'
  { -- | The limit that you requested. Valid values include the following:
    --
    -- -   __MAX_RRSETS_BY_ZONE__: The maximum number of records that you can
    --     create in the specified hosted zone.
    --
    -- -   __MAX_VPCS_ASSOCIATED_BY_ZONE__: The maximum number of Amazon VPCs
    --     that you can associate with the specified private hosted zone.
    HostedZoneLimit -> HostedZoneLimitType
type' :: HostedZoneLimitType,
    -- | The current value for the limit that is specified by @Type@.
    HostedZoneLimit -> Natural
value :: Prelude.Natural
  }
  deriving (HostedZoneLimit -> HostedZoneLimit -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HostedZoneLimit -> HostedZoneLimit -> Bool
$c/= :: HostedZoneLimit -> HostedZoneLimit -> Bool
== :: HostedZoneLimit -> HostedZoneLimit -> Bool
$c== :: HostedZoneLimit -> HostedZoneLimit -> Bool
Prelude.Eq, ReadPrec [HostedZoneLimit]
ReadPrec HostedZoneLimit
Int -> ReadS HostedZoneLimit
ReadS [HostedZoneLimit]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HostedZoneLimit]
$creadListPrec :: ReadPrec [HostedZoneLimit]
readPrec :: ReadPrec HostedZoneLimit
$creadPrec :: ReadPrec HostedZoneLimit
readList :: ReadS [HostedZoneLimit]
$creadList :: ReadS [HostedZoneLimit]
readsPrec :: Int -> ReadS HostedZoneLimit
$creadsPrec :: Int -> ReadS HostedZoneLimit
Prelude.Read, Int -> HostedZoneLimit -> ShowS
[HostedZoneLimit] -> ShowS
HostedZoneLimit -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HostedZoneLimit] -> ShowS
$cshowList :: [HostedZoneLimit] -> ShowS
show :: HostedZoneLimit -> String
$cshow :: HostedZoneLimit -> String
showsPrec :: Int -> HostedZoneLimit -> ShowS
$cshowsPrec :: Int -> HostedZoneLimit -> ShowS
Prelude.Show, forall x. Rep HostedZoneLimit x -> HostedZoneLimit
forall x. HostedZoneLimit -> Rep HostedZoneLimit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HostedZoneLimit x -> HostedZoneLimit
$cfrom :: forall x. HostedZoneLimit -> Rep HostedZoneLimit x
Prelude.Generic)

-- |
-- Create a value of 'HostedZoneLimit' 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'', 'hostedZoneLimit_type' - The limit that you requested. Valid values include the following:
--
-- -   __MAX_RRSETS_BY_ZONE__: The maximum number of records that you can
--     create in the specified hosted zone.
--
-- -   __MAX_VPCS_ASSOCIATED_BY_ZONE__: The maximum number of Amazon VPCs
--     that you can associate with the specified private hosted zone.
--
-- 'value', 'hostedZoneLimit_value' - The current value for the limit that is specified by @Type@.
newHostedZoneLimit ::
  -- | 'type''
  HostedZoneLimitType ->
  -- | 'value'
  Prelude.Natural ->
  HostedZoneLimit
newHostedZoneLimit :: HostedZoneLimitType -> Natural -> HostedZoneLimit
newHostedZoneLimit HostedZoneLimitType
pType_ Natural
pValue_ =
  HostedZoneLimit' {$sel:type':HostedZoneLimit' :: HostedZoneLimitType
type' = HostedZoneLimitType
pType_, $sel:value:HostedZoneLimit' :: Natural
value = Natural
pValue_}

-- | The limit that you requested. Valid values include the following:
--
-- -   __MAX_RRSETS_BY_ZONE__: The maximum number of records that you can
--     create in the specified hosted zone.
--
-- -   __MAX_VPCS_ASSOCIATED_BY_ZONE__: The maximum number of Amazon VPCs
--     that you can associate with the specified private hosted zone.
hostedZoneLimit_type :: Lens.Lens' HostedZoneLimit HostedZoneLimitType
hostedZoneLimit_type :: Lens' HostedZoneLimit HostedZoneLimitType
hostedZoneLimit_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZoneLimit' {HostedZoneLimitType
type' :: HostedZoneLimitType
$sel:type':HostedZoneLimit' :: HostedZoneLimit -> HostedZoneLimitType
type'} -> HostedZoneLimitType
type') (\s :: HostedZoneLimit
s@HostedZoneLimit' {} HostedZoneLimitType
a -> HostedZoneLimit
s {$sel:type':HostedZoneLimit' :: HostedZoneLimitType
type' = HostedZoneLimitType
a} :: HostedZoneLimit)

-- | The current value for the limit that is specified by @Type@.
hostedZoneLimit_value :: Lens.Lens' HostedZoneLimit Prelude.Natural
hostedZoneLimit_value :: Lens' HostedZoneLimit Natural
hostedZoneLimit_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZoneLimit' {Natural
value :: Natural
$sel:value:HostedZoneLimit' :: HostedZoneLimit -> Natural
value} -> Natural
value) (\s :: HostedZoneLimit
s@HostedZoneLimit' {} Natural
a -> HostedZoneLimit
s {$sel:value:HostedZoneLimit' :: Natural
value = Natural
a} :: HostedZoneLimit)

instance Data.FromXML HostedZoneLimit where
  parseXML :: [Node] -> Either String HostedZoneLimit
parseXML [Node]
x =
    HostedZoneLimitType -> Natural -> HostedZoneLimit
HostedZoneLimit'
      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 HostedZoneLimit where
  hashWithSalt :: Int -> HostedZoneLimit -> Int
hashWithSalt Int
_salt HostedZoneLimit' {Natural
HostedZoneLimitType
value :: Natural
type' :: HostedZoneLimitType
$sel:value:HostedZoneLimit' :: HostedZoneLimit -> Natural
$sel:type':HostedZoneLimit' :: HostedZoneLimit -> HostedZoneLimitType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HostedZoneLimitType
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
value

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