{-# 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.FMS.Types.DnsRuleGroupLimitExceededViolation
-- 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.FMS.Types.DnsRuleGroupLimitExceededViolation 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

-- | The VPC that Firewall Manager was applying a DNS Fireall policy to
-- reached the limit for associated DNS Firewall rule groups. Firewall
-- Manager tried to associate another rule group with the VPC and failed
-- due to the limit.
--
-- /See:/ 'newDnsRuleGroupLimitExceededViolation' smart constructor.
data DnsRuleGroupLimitExceededViolation = DnsRuleGroupLimitExceededViolation'
  { -- | The number of rule groups currently associated with the VPC.
    DnsRuleGroupLimitExceededViolation -> Maybe Int
numberOfRuleGroupsAlreadyAssociated :: Prelude.Maybe Prelude.Int,
    -- | Information about the VPC ID.
    DnsRuleGroupLimitExceededViolation -> Maybe Text
violationTarget :: Prelude.Maybe Prelude.Text,
    -- | A description of the violation that specifies the rule group and VPC.
    DnsRuleGroupLimitExceededViolation -> Maybe Text
violationTargetDescription :: Prelude.Maybe Prelude.Text
  }
  deriving (DnsRuleGroupLimitExceededViolation
-> DnsRuleGroupLimitExceededViolation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DnsRuleGroupLimitExceededViolation
-> DnsRuleGroupLimitExceededViolation -> Bool
$c/= :: DnsRuleGroupLimitExceededViolation
-> DnsRuleGroupLimitExceededViolation -> Bool
== :: DnsRuleGroupLimitExceededViolation
-> DnsRuleGroupLimitExceededViolation -> Bool
$c== :: DnsRuleGroupLimitExceededViolation
-> DnsRuleGroupLimitExceededViolation -> Bool
Prelude.Eq, ReadPrec [DnsRuleGroupLimitExceededViolation]
ReadPrec DnsRuleGroupLimitExceededViolation
Int -> ReadS DnsRuleGroupLimitExceededViolation
ReadS [DnsRuleGroupLimitExceededViolation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DnsRuleGroupLimitExceededViolation]
$creadListPrec :: ReadPrec [DnsRuleGroupLimitExceededViolation]
readPrec :: ReadPrec DnsRuleGroupLimitExceededViolation
$creadPrec :: ReadPrec DnsRuleGroupLimitExceededViolation
readList :: ReadS [DnsRuleGroupLimitExceededViolation]
$creadList :: ReadS [DnsRuleGroupLimitExceededViolation]
readsPrec :: Int -> ReadS DnsRuleGroupLimitExceededViolation
$creadsPrec :: Int -> ReadS DnsRuleGroupLimitExceededViolation
Prelude.Read, Int -> DnsRuleGroupLimitExceededViolation -> ShowS
[DnsRuleGroupLimitExceededViolation] -> ShowS
DnsRuleGroupLimitExceededViolation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DnsRuleGroupLimitExceededViolation] -> ShowS
$cshowList :: [DnsRuleGroupLimitExceededViolation] -> ShowS
show :: DnsRuleGroupLimitExceededViolation -> String
$cshow :: DnsRuleGroupLimitExceededViolation -> String
showsPrec :: Int -> DnsRuleGroupLimitExceededViolation -> ShowS
$cshowsPrec :: Int -> DnsRuleGroupLimitExceededViolation -> ShowS
Prelude.Show, forall x.
Rep DnsRuleGroupLimitExceededViolation x
-> DnsRuleGroupLimitExceededViolation
forall x.
DnsRuleGroupLimitExceededViolation
-> Rep DnsRuleGroupLimitExceededViolation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DnsRuleGroupLimitExceededViolation x
-> DnsRuleGroupLimitExceededViolation
$cfrom :: forall x.
DnsRuleGroupLimitExceededViolation
-> Rep DnsRuleGroupLimitExceededViolation x
Prelude.Generic)

-- |
-- Create a value of 'DnsRuleGroupLimitExceededViolation' 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:
--
-- 'numberOfRuleGroupsAlreadyAssociated', 'dnsRuleGroupLimitExceededViolation_numberOfRuleGroupsAlreadyAssociated' - The number of rule groups currently associated with the VPC.
--
-- 'violationTarget', 'dnsRuleGroupLimitExceededViolation_violationTarget' - Information about the VPC ID.
--
-- 'violationTargetDescription', 'dnsRuleGroupLimitExceededViolation_violationTargetDescription' - A description of the violation that specifies the rule group and VPC.
newDnsRuleGroupLimitExceededViolation ::
  DnsRuleGroupLimitExceededViolation
newDnsRuleGroupLimitExceededViolation :: DnsRuleGroupLimitExceededViolation
newDnsRuleGroupLimitExceededViolation =
  DnsRuleGroupLimitExceededViolation'
    { $sel:numberOfRuleGroupsAlreadyAssociated:DnsRuleGroupLimitExceededViolation' :: Maybe Int
numberOfRuleGroupsAlreadyAssociated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:violationTarget:DnsRuleGroupLimitExceededViolation' :: Maybe Text
violationTarget = forall a. Maybe a
Prelude.Nothing,
      $sel:violationTargetDescription:DnsRuleGroupLimitExceededViolation' :: Maybe Text
violationTargetDescription =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The number of rule groups currently associated with the VPC.
dnsRuleGroupLimitExceededViolation_numberOfRuleGroupsAlreadyAssociated :: Lens.Lens' DnsRuleGroupLimitExceededViolation (Prelude.Maybe Prelude.Int)
dnsRuleGroupLimitExceededViolation_numberOfRuleGroupsAlreadyAssociated :: Lens' DnsRuleGroupLimitExceededViolation (Maybe Int)
dnsRuleGroupLimitExceededViolation_numberOfRuleGroupsAlreadyAssociated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DnsRuleGroupLimitExceededViolation' {Maybe Int
numberOfRuleGroupsAlreadyAssociated :: Maybe Int
$sel:numberOfRuleGroupsAlreadyAssociated:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Int
numberOfRuleGroupsAlreadyAssociated} -> Maybe Int
numberOfRuleGroupsAlreadyAssociated) (\s :: DnsRuleGroupLimitExceededViolation
s@DnsRuleGroupLimitExceededViolation' {} Maybe Int
a -> DnsRuleGroupLimitExceededViolation
s {$sel:numberOfRuleGroupsAlreadyAssociated:DnsRuleGroupLimitExceededViolation' :: Maybe Int
numberOfRuleGroupsAlreadyAssociated = Maybe Int
a} :: DnsRuleGroupLimitExceededViolation)

-- | Information about the VPC ID.
dnsRuleGroupLimitExceededViolation_violationTarget :: Lens.Lens' DnsRuleGroupLimitExceededViolation (Prelude.Maybe Prelude.Text)
dnsRuleGroupLimitExceededViolation_violationTarget :: Lens' DnsRuleGroupLimitExceededViolation (Maybe Text)
dnsRuleGroupLimitExceededViolation_violationTarget = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DnsRuleGroupLimitExceededViolation' {Maybe Text
violationTarget :: Maybe Text
$sel:violationTarget:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Text
violationTarget} -> Maybe Text
violationTarget) (\s :: DnsRuleGroupLimitExceededViolation
s@DnsRuleGroupLimitExceededViolation' {} Maybe Text
a -> DnsRuleGroupLimitExceededViolation
s {$sel:violationTarget:DnsRuleGroupLimitExceededViolation' :: Maybe Text
violationTarget = Maybe Text
a} :: DnsRuleGroupLimitExceededViolation)

-- | A description of the violation that specifies the rule group and VPC.
dnsRuleGroupLimitExceededViolation_violationTargetDescription :: Lens.Lens' DnsRuleGroupLimitExceededViolation (Prelude.Maybe Prelude.Text)
dnsRuleGroupLimitExceededViolation_violationTargetDescription :: Lens' DnsRuleGroupLimitExceededViolation (Maybe Text)
dnsRuleGroupLimitExceededViolation_violationTargetDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DnsRuleGroupLimitExceededViolation' {Maybe Text
violationTargetDescription :: Maybe Text
$sel:violationTargetDescription:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Text
violationTargetDescription} -> Maybe Text
violationTargetDescription) (\s :: DnsRuleGroupLimitExceededViolation
s@DnsRuleGroupLimitExceededViolation' {} Maybe Text
a -> DnsRuleGroupLimitExceededViolation
s {$sel:violationTargetDescription:DnsRuleGroupLimitExceededViolation' :: Maybe Text
violationTargetDescription = Maybe Text
a} :: DnsRuleGroupLimitExceededViolation)

instance
  Data.FromJSON
    DnsRuleGroupLimitExceededViolation
  where
  parseJSON :: Value -> Parser DnsRuleGroupLimitExceededViolation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DnsRuleGroupLimitExceededViolation"
      ( \Object
x ->
          Maybe Int
-> Maybe Text -> Maybe Text -> DnsRuleGroupLimitExceededViolation
DnsRuleGroupLimitExceededViolation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NumberOfRuleGroupsAlreadyAssociated")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ViolationTarget")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ViolationTargetDescription")
      )

instance
  Prelude.Hashable
    DnsRuleGroupLimitExceededViolation
  where
  hashWithSalt :: Int -> DnsRuleGroupLimitExceededViolation -> Int
hashWithSalt
    Int
_salt
    DnsRuleGroupLimitExceededViolation' {Maybe Int
Maybe Text
violationTargetDescription :: Maybe Text
violationTarget :: Maybe Text
numberOfRuleGroupsAlreadyAssociated :: Maybe Int
$sel:violationTargetDescription:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Text
$sel:violationTarget:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Text
$sel:numberOfRuleGroupsAlreadyAssociated:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Int
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numberOfRuleGroupsAlreadyAssociated
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
violationTarget
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
violationTargetDescription

instance
  Prelude.NFData
    DnsRuleGroupLimitExceededViolation
  where
  rnf :: DnsRuleGroupLimitExceededViolation -> ()
rnf DnsRuleGroupLimitExceededViolation' {Maybe Int
Maybe Text
violationTargetDescription :: Maybe Text
violationTarget :: Maybe Text
numberOfRuleGroupsAlreadyAssociated :: Maybe Int
$sel:violationTargetDescription:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Text
$sel:violationTarget:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Text
$sel:numberOfRuleGroupsAlreadyAssociated:DnsRuleGroupLimitExceededViolation' :: DnsRuleGroupLimitExceededViolation -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numberOfRuleGroupsAlreadyAssociated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
violationTarget
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
violationTargetDescription