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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A DNS Firewall rule group that Firewall Manager tried to associate with
-- a VPC is already associated with the VPC and can\'t be associated again.
--
-- /See:/ 'newDnsDuplicateRuleGroupViolation' smart constructor.
data DnsDuplicateRuleGroupViolation = DnsDuplicateRuleGroupViolation'
  { -- | A description of the violation that specifies the rule group and VPC.
    DnsDuplicateRuleGroupViolation -> Maybe Text
violationTargetDescription :: Prelude.Maybe Prelude.Text,
    -- | Information about the VPC ID.
    DnsDuplicateRuleGroupViolation -> Maybe Text
violationTarget :: Prelude.Maybe Prelude.Text
  }
  deriving (DnsDuplicateRuleGroupViolation
-> DnsDuplicateRuleGroupViolation -> Bool
(DnsDuplicateRuleGroupViolation
 -> DnsDuplicateRuleGroupViolation -> Bool)
-> (DnsDuplicateRuleGroupViolation
    -> DnsDuplicateRuleGroupViolation -> Bool)
-> Eq DnsDuplicateRuleGroupViolation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DnsDuplicateRuleGroupViolation
-> DnsDuplicateRuleGroupViolation -> Bool
$c/= :: DnsDuplicateRuleGroupViolation
-> DnsDuplicateRuleGroupViolation -> Bool
== :: DnsDuplicateRuleGroupViolation
-> DnsDuplicateRuleGroupViolation -> Bool
$c== :: DnsDuplicateRuleGroupViolation
-> DnsDuplicateRuleGroupViolation -> Bool
Prelude.Eq, ReadPrec [DnsDuplicateRuleGroupViolation]
ReadPrec DnsDuplicateRuleGroupViolation
Int -> ReadS DnsDuplicateRuleGroupViolation
ReadS [DnsDuplicateRuleGroupViolation]
(Int -> ReadS DnsDuplicateRuleGroupViolation)
-> ReadS [DnsDuplicateRuleGroupViolation]
-> ReadPrec DnsDuplicateRuleGroupViolation
-> ReadPrec [DnsDuplicateRuleGroupViolation]
-> Read DnsDuplicateRuleGroupViolation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DnsDuplicateRuleGroupViolation]
$creadListPrec :: ReadPrec [DnsDuplicateRuleGroupViolation]
readPrec :: ReadPrec DnsDuplicateRuleGroupViolation
$creadPrec :: ReadPrec DnsDuplicateRuleGroupViolation
readList :: ReadS [DnsDuplicateRuleGroupViolation]
$creadList :: ReadS [DnsDuplicateRuleGroupViolation]
readsPrec :: Int -> ReadS DnsDuplicateRuleGroupViolation
$creadsPrec :: Int -> ReadS DnsDuplicateRuleGroupViolation
Prelude.Read, Int -> DnsDuplicateRuleGroupViolation -> ShowS
[DnsDuplicateRuleGroupViolation] -> ShowS
DnsDuplicateRuleGroupViolation -> String
(Int -> DnsDuplicateRuleGroupViolation -> ShowS)
-> (DnsDuplicateRuleGroupViolation -> String)
-> ([DnsDuplicateRuleGroupViolation] -> ShowS)
-> Show DnsDuplicateRuleGroupViolation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DnsDuplicateRuleGroupViolation] -> ShowS
$cshowList :: [DnsDuplicateRuleGroupViolation] -> ShowS
show :: DnsDuplicateRuleGroupViolation -> String
$cshow :: DnsDuplicateRuleGroupViolation -> String
showsPrec :: Int -> DnsDuplicateRuleGroupViolation -> ShowS
$cshowsPrec :: Int -> DnsDuplicateRuleGroupViolation -> ShowS
Prelude.Show, (forall x.
 DnsDuplicateRuleGroupViolation
 -> Rep DnsDuplicateRuleGroupViolation x)
-> (forall x.
    Rep DnsDuplicateRuleGroupViolation x
    -> DnsDuplicateRuleGroupViolation)
-> Generic DnsDuplicateRuleGroupViolation
forall x.
Rep DnsDuplicateRuleGroupViolation x
-> DnsDuplicateRuleGroupViolation
forall x.
DnsDuplicateRuleGroupViolation
-> Rep DnsDuplicateRuleGroupViolation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DnsDuplicateRuleGroupViolation x
-> DnsDuplicateRuleGroupViolation
$cfrom :: forall x.
DnsDuplicateRuleGroupViolation
-> Rep DnsDuplicateRuleGroupViolation x
Prelude.Generic)

-- |
-- Create a value of 'DnsDuplicateRuleGroupViolation' 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:
--
-- 'violationTargetDescription', 'dnsDuplicateRuleGroupViolation_violationTargetDescription' - A description of the violation that specifies the rule group and VPC.
--
-- 'violationTarget', 'dnsDuplicateRuleGroupViolation_violationTarget' - Information about the VPC ID.
newDnsDuplicateRuleGroupViolation ::
  DnsDuplicateRuleGroupViolation
newDnsDuplicateRuleGroupViolation :: DnsDuplicateRuleGroupViolation
newDnsDuplicateRuleGroupViolation =
  DnsDuplicateRuleGroupViolation' :: Maybe Text -> Maybe Text -> DnsDuplicateRuleGroupViolation
DnsDuplicateRuleGroupViolation'
    { $sel:violationTargetDescription:DnsDuplicateRuleGroupViolation' :: Maybe Text
violationTargetDescription =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:violationTarget:DnsDuplicateRuleGroupViolation' :: Maybe Text
violationTarget = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.FromJSON DnsDuplicateRuleGroupViolation where
  parseJSON :: Value -> Parser DnsDuplicateRuleGroupViolation
parseJSON =
    String
-> (Object -> Parser DnsDuplicateRuleGroupViolation)
-> Value
-> Parser DnsDuplicateRuleGroupViolation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DnsDuplicateRuleGroupViolation"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> DnsDuplicateRuleGroupViolation
DnsDuplicateRuleGroupViolation'
            (Maybe Text -> Maybe Text -> DnsDuplicateRuleGroupViolation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> DnsDuplicateRuleGroupViolation)
forall (f :: * -> *) a b. Functor 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
"ViolationTargetDescription")
            Parser (Maybe Text -> DnsDuplicateRuleGroupViolation)
-> Parser (Maybe Text) -> Parser DnsDuplicateRuleGroupViolation
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
"ViolationTarget")
      )

instance
  Prelude.Hashable
    DnsDuplicateRuleGroupViolation

instance
  Prelude.NFData
    DnsDuplicateRuleGroupViolation