{-# 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.NetworkFirewallPolicyModifiedViolation
-- 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.NetworkFirewallPolicyModifiedViolation where

import qualified Amazonka.Core as Core
import Amazonka.FMS.Types.NetworkFirewallPolicyDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Violation detail for Network Firewall for a firewall policy that has a
-- different NetworkFirewallPolicyDescription than is required by the
-- Firewall Manager policy.
--
-- /See:/ 'newNetworkFirewallPolicyModifiedViolation' smart constructor.
data NetworkFirewallPolicyModifiedViolation = NetworkFirewallPolicyModifiedViolation'
  { -- | The policy that\'s currently in use in the individual account.
    NetworkFirewallPolicyModifiedViolation
-> Maybe NetworkFirewallPolicyDescription
currentPolicyDescription :: Prelude.Maybe NetworkFirewallPolicyDescription,
    -- | The ID of the Network Firewall or VPC resource that\'s in violation.
    NetworkFirewallPolicyModifiedViolation -> Maybe Text
violationTarget :: Prelude.Maybe Prelude.Text,
    -- | The policy that should be in use in the individual account in order to
    -- be compliant.
    NetworkFirewallPolicyModifiedViolation
-> Maybe NetworkFirewallPolicyDescription
expectedPolicyDescription :: Prelude.Maybe NetworkFirewallPolicyDescription
  }
  deriving (NetworkFirewallPolicyModifiedViolation
-> NetworkFirewallPolicyModifiedViolation -> Bool
(NetworkFirewallPolicyModifiedViolation
 -> NetworkFirewallPolicyModifiedViolation -> Bool)
-> (NetworkFirewallPolicyModifiedViolation
    -> NetworkFirewallPolicyModifiedViolation -> Bool)
-> Eq NetworkFirewallPolicyModifiedViolation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkFirewallPolicyModifiedViolation
-> NetworkFirewallPolicyModifiedViolation -> Bool
$c/= :: NetworkFirewallPolicyModifiedViolation
-> NetworkFirewallPolicyModifiedViolation -> Bool
== :: NetworkFirewallPolicyModifiedViolation
-> NetworkFirewallPolicyModifiedViolation -> Bool
$c== :: NetworkFirewallPolicyModifiedViolation
-> NetworkFirewallPolicyModifiedViolation -> Bool
Prelude.Eq, ReadPrec [NetworkFirewallPolicyModifiedViolation]
ReadPrec NetworkFirewallPolicyModifiedViolation
Int -> ReadS NetworkFirewallPolicyModifiedViolation
ReadS [NetworkFirewallPolicyModifiedViolation]
(Int -> ReadS NetworkFirewallPolicyModifiedViolation)
-> ReadS [NetworkFirewallPolicyModifiedViolation]
-> ReadPrec NetworkFirewallPolicyModifiedViolation
-> ReadPrec [NetworkFirewallPolicyModifiedViolation]
-> Read NetworkFirewallPolicyModifiedViolation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkFirewallPolicyModifiedViolation]
$creadListPrec :: ReadPrec [NetworkFirewallPolicyModifiedViolation]
readPrec :: ReadPrec NetworkFirewallPolicyModifiedViolation
$creadPrec :: ReadPrec NetworkFirewallPolicyModifiedViolation
readList :: ReadS [NetworkFirewallPolicyModifiedViolation]
$creadList :: ReadS [NetworkFirewallPolicyModifiedViolation]
readsPrec :: Int -> ReadS NetworkFirewallPolicyModifiedViolation
$creadsPrec :: Int -> ReadS NetworkFirewallPolicyModifiedViolation
Prelude.Read, Int -> NetworkFirewallPolicyModifiedViolation -> ShowS
[NetworkFirewallPolicyModifiedViolation] -> ShowS
NetworkFirewallPolicyModifiedViolation -> String
(Int -> NetworkFirewallPolicyModifiedViolation -> ShowS)
-> (NetworkFirewallPolicyModifiedViolation -> String)
-> ([NetworkFirewallPolicyModifiedViolation] -> ShowS)
-> Show NetworkFirewallPolicyModifiedViolation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkFirewallPolicyModifiedViolation] -> ShowS
$cshowList :: [NetworkFirewallPolicyModifiedViolation] -> ShowS
show :: NetworkFirewallPolicyModifiedViolation -> String
$cshow :: NetworkFirewallPolicyModifiedViolation -> String
showsPrec :: Int -> NetworkFirewallPolicyModifiedViolation -> ShowS
$cshowsPrec :: Int -> NetworkFirewallPolicyModifiedViolation -> ShowS
Prelude.Show, (forall x.
 NetworkFirewallPolicyModifiedViolation
 -> Rep NetworkFirewallPolicyModifiedViolation x)
-> (forall x.
    Rep NetworkFirewallPolicyModifiedViolation x
    -> NetworkFirewallPolicyModifiedViolation)
-> Generic NetworkFirewallPolicyModifiedViolation
forall x.
Rep NetworkFirewallPolicyModifiedViolation x
-> NetworkFirewallPolicyModifiedViolation
forall x.
NetworkFirewallPolicyModifiedViolation
-> Rep NetworkFirewallPolicyModifiedViolation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NetworkFirewallPolicyModifiedViolation x
-> NetworkFirewallPolicyModifiedViolation
$cfrom :: forall x.
NetworkFirewallPolicyModifiedViolation
-> Rep NetworkFirewallPolicyModifiedViolation x
Prelude.Generic)

-- |
-- Create a value of 'NetworkFirewallPolicyModifiedViolation' 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:
--
-- 'currentPolicyDescription', 'networkFirewallPolicyModifiedViolation_currentPolicyDescription' - The policy that\'s currently in use in the individual account.
--
-- 'violationTarget', 'networkFirewallPolicyModifiedViolation_violationTarget' - The ID of the Network Firewall or VPC resource that\'s in violation.
--
-- 'expectedPolicyDescription', 'networkFirewallPolicyModifiedViolation_expectedPolicyDescription' - The policy that should be in use in the individual account in order to
-- be compliant.
newNetworkFirewallPolicyModifiedViolation ::
  NetworkFirewallPolicyModifiedViolation
newNetworkFirewallPolicyModifiedViolation :: NetworkFirewallPolicyModifiedViolation
newNetworkFirewallPolicyModifiedViolation =
  NetworkFirewallPolicyModifiedViolation' :: Maybe NetworkFirewallPolicyDescription
-> Maybe Text
-> Maybe NetworkFirewallPolicyDescription
-> NetworkFirewallPolicyModifiedViolation
NetworkFirewallPolicyModifiedViolation'
    { $sel:currentPolicyDescription:NetworkFirewallPolicyModifiedViolation' :: Maybe NetworkFirewallPolicyDescription
currentPolicyDescription =
        Maybe NetworkFirewallPolicyDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:violationTarget:NetworkFirewallPolicyModifiedViolation' :: Maybe Text
violationTarget = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expectedPolicyDescription:NetworkFirewallPolicyModifiedViolation' :: Maybe NetworkFirewallPolicyDescription
expectedPolicyDescription =
        Maybe NetworkFirewallPolicyDescription
forall a. Maybe a
Prelude.Nothing
    }

-- | The policy that\'s currently in use in the individual account.
networkFirewallPolicyModifiedViolation_currentPolicyDescription :: Lens.Lens' NetworkFirewallPolicyModifiedViolation (Prelude.Maybe NetworkFirewallPolicyDescription)
networkFirewallPolicyModifiedViolation_currentPolicyDescription :: (Maybe NetworkFirewallPolicyDescription
 -> f (Maybe NetworkFirewallPolicyDescription))
-> NetworkFirewallPolicyModifiedViolation
-> f NetworkFirewallPolicyModifiedViolation
networkFirewallPolicyModifiedViolation_currentPolicyDescription = (NetworkFirewallPolicyModifiedViolation
 -> Maybe NetworkFirewallPolicyDescription)
-> (NetworkFirewallPolicyModifiedViolation
    -> Maybe NetworkFirewallPolicyDescription
    -> NetworkFirewallPolicyModifiedViolation)
-> Lens
     NetworkFirewallPolicyModifiedViolation
     NetworkFirewallPolicyModifiedViolation
     (Maybe NetworkFirewallPolicyDescription)
     (Maybe NetworkFirewallPolicyDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallPolicyModifiedViolation' {Maybe NetworkFirewallPolicyDescription
currentPolicyDescription :: Maybe NetworkFirewallPolicyDescription
$sel:currentPolicyDescription:NetworkFirewallPolicyModifiedViolation' :: NetworkFirewallPolicyModifiedViolation
-> Maybe NetworkFirewallPolicyDescription
currentPolicyDescription} -> Maybe NetworkFirewallPolicyDescription
currentPolicyDescription) (\s :: NetworkFirewallPolicyModifiedViolation
s@NetworkFirewallPolicyModifiedViolation' {} Maybe NetworkFirewallPolicyDescription
a -> NetworkFirewallPolicyModifiedViolation
s {$sel:currentPolicyDescription:NetworkFirewallPolicyModifiedViolation' :: Maybe NetworkFirewallPolicyDescription
currentPolicyDescription = Maybe NetworkFirewallPolicyDescription
a} :: NetworkFirewallPolicyModifiedViolation)

-- | The ID of the Network Firewall or VPC resource that\'s in violation.
networkFirewallPolicyModifiedViolation_violationTarget :: Lens.Lens' NetworkFirewallPolicyModifiedViolation (Prelude.Maybe Prelude.Text)
networkFirewallPolicyModifiedViolation_violationTarget :: (Maybe Text -> f (Maybe Text))
-> NetworkFirewallPolicyModifiedViolation
-> f NetworkFirewallPolicyModifiedViolation
networkFirewallPolicyModifiedViolation_violationTarget = (NetworkFirewallPolicyModifiedViolation -> Maybe Text)
-> (NetworkFirewallPolicyModifiedViolation
    -> Maybe Text -> NetworkFirewallPolicyModifiedViolation)
-> Lens
     NetworkFirewallPolicyModifiedViolation
     NetworkFirewallPolicyModifiedViolation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallPolicyModifiedViolation' {Maybe Text
violationTarget :: Maybe Text
$sel:violationTarget:NetworkFirewallPolicyModifiedViolation' :: NetworkFirewallPolicyModifiedViolation -> Maybe Text
violationTarget} -> Maybe Text
violationTarget) (\s :: NetworkFirewallPolicyModifiedViolation
s@NetworkFirewallPolicyModifiedViolation' {} Maybe Text
a -> NetworkFirewallPolicyModifiedViolation
s {$sel:violationTarget:NetworkFirewallPolicyModifiedViolation' :: Maybe Text
violationTarget = Maybe Text
a} :: NetworkFirewallPolicyModifiedViolation)

-- | The policy that should be in use in the individual account in order to
-- be compliant.
networkFirewallPolicyModifiedViolation_expectedPolicyDescription :: Lens.Lens' NetworkFirewallPolicyModifiedViolation (Prelude.Maybe NetworkFirewallPolicyDescription)
networkFirewallPolicyModifiedViolation_expectedPolicyDescription :: (Maybe NetworkFirewallPolicyDescription
 -> f (Maybe NetworkFirewallPolicyDescription))
-> NetworkFirewallPolicyModifiedViolation
-> f NetworkFirewallPolicyModifiedViolation
networkFirewallPolicyModifiedViolation_expectedPolicyDescription = (NetworkFirewallPolicyModifiedViolation
 -> Maybe NetworkFirewallPolicyDescription)
-> (NetworkFirewallPolicyModifiedViolation
    -> Maybe NetworkFirewallPolicyDescription
    -> NetworkFirewallPolicyModifiedViolation)
-> Lens
     NetworkFirewallPolicyModifiedViolation
     NetworkFirewallPolicyModifiedViolation
     (Maybe NetworkFirewallPolicyDescription)
     (Maybe NetworkFirewallPolicyDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallPolicyModifiedViolation' {Maybe NetworkFirewallPolicyDescription
expectedPolicyDescription :: Maybe NetworkFirewallPolicyDescription
$sel:expectedPolicyDescription:NetworkFirewallPolicyModifiedViolation' :: NetworkFirewallPolicyModifiedViolation
-> Maybe NetworkFirewallPolicyDescription
expectedPolicyDescription} -> Maybe NetworkFirewallPolicyDescription
expectedPolicyDescription) (\s :: NetworkFirewallPolicyModifiedViolation
s@NetworkFirewallPolicyModifiedViolation' {} Maybe NetworkFirewallPolicyDescription
a -> NetworkFirewallPolicyModifiedViolation
s {$sel:expectedPolicyDescription:NetworkFirewallPolicyModifiedViolation' :: Maybe NetworkFirewallPolicyDescription
expectedPolicyDescription = Maybe NetworkFirewallPolicyDescription
a} :: NetworkFirewallPolicyModifiedViolation)

instance
  Core.FromJSON
    NetworkFirewallPolicyModifiedViolation
  where
  parseJSON :: Value -> Parser NetworkFirewallPolicyModifiedViolation
parseJSON =
    String
-> (Object -> Parser NetworkFirewallPolicyModifiedViolation)
-> Value
-> Parser NetworkFirewallPolicyModifiedViolation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NetworkFirewallPolicyModifiedViolation"
      ( \Object
x ->
          Maybe NetworkFirewallPolicyDescription
-> Maybe Text
-> Maybe NetworkFirewallPolicyDescription
-> NetworkFirewallPolicyModifiedViolation
NetworkFirewallPolicyModifiedViolation'
            (Maybe NetworkFirewallPolicyDescription
 -> Maybe Text
 -> Maybe NetworkFirewallPolicyDescription
 -> NetworkFirewallPolicyModifiedViolation)
-> Parser (Maybe NetworkFirewallPolicyDescription)
-> Parser
     (Maybe Text
      -> Maybe NetworkFirewallPolicyDescription
      -> NetworkFirewallPolicyModifiedViolation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NetworkFirewallPolicyDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentPolicyDescription")
            Parser
  (Maybe Text
   -> Maybe NetworkFirewallPolicyDescription
   -> NetworkFirewallPolicyModifiedViolation)
-> Parser (Maybe Text)
-> Parser
     (Maybe NetworkFirewallPolicyDescription
      -> NetworkFirewallPolicyModifiedViolation)
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")
            Parser
  (Maybe NetworkFirewallPolicyDescription
   -> NetworkFirewallPolicyModifiedViolation)
-> Parser (Maybe NetworkFirewallPolicyDescription)
-> Parser NetworkFirewallPolicyModifiedViolation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NetworkFirewallPolicyDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExpectedPolicyDescription")
      )

instance
  Prelude.Hashable
    NetworkFirewallPolicyModifiedViolation

instance
  Prelude.NFData
    NetworkFirewallPolicyModifiedViolation