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

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

-- | Violation detail for Network Firewall for an Availability Zone that\'s
-- missing the expected Firewall Manager managed subnet.
--
-- /See:/ 'newNetworkFirewallMissingSubnetViolation' smart constructor.
data NetworkFirewallMissingSubnetViolation = NetworkFirewallMissingSubnetViolation'
  { -- | The reason the resource has this violation, if one is available.
    NetworkFirewallMissingSubnetViolation -> Maybe Text
targetViolationReason :: Prelude.Maybe Prelude.Text,
    -- | The Availability Zone of a violating subnet.
    NetworkFirewallMissingSubnetViolation -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The resource ID of the VPC associated with a violating subnet.
    NetworkFirewallMissingSubnetViolation -> Maybe Text
vpc :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Network Firewall or VPC resource that\'s in violation.
    NetworkFirewallMissingSubnetViolation -> Maybe Text
violationTarget :: Prelude.Maybe Prelude.Text
  }
  deriving (NetworkFirewallMissingSubnetViolation
-> NetworkFirewallMissingSubnetViolation -> Bool
(NetworkFirewallMissingSubnetViolation
 -> NetworkFirewallMissingSubnetViolation -> Bool)
-> (NetworkFirewallMissingSubnetViolation
    -> NetworkFirewallMissingSubnetViolation -> Bool)
-> Eq NetworkFirewallMissingSubnetViolation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkFirewallMissingSubnetViolation
-> NetworkFirewallMissingSubnetViolation -> Bool
$c/= :: NetworkFirewallMissingSubnetViolation
-> NetworkFirewallMissingSubnetViolation -> Bool
== :: NetworkFirewallMissingSubnetViolation
-> NetworkFirewallMissingSubnetViolation -> Bool
$c== :: NetworkFirewallMissingSubnetViolation
-> NetworkFirewallMissingSubnetViolation -> Bool
Prelude.Eq, ReadPrec [NetworkFirewallMissingSubnetViolation]
ReadPrec NetworkFirewallMissingSubnetViolation
Int -> ReadS NetworkFirewallMissingSubnetViolation
ReadS [NetworkFirewallMissingSubnetViolation]
(Int -> ReadS NetworkFirewallMissingSubnetViolation)
-> ReadS [NetworkFirewallMissingSubnetViolation]
-> ReadPrec NetworkFirewallMissingSubnetViolation
-> ReadPrec [NetworkFirewallMissingSubnetViolation]
-> Read NetworkFirewallMissingSubnetViolation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkFirewallMissingSubnetViolation]
$creadListPrec :: ReadPrec [NetworkFirewallMissingSubnetViolation]
readPrec :: ReadPrec NetworkFirewallMissingSubnetViolation
$creadPrec :: ReadPrec NetworkFirewallMissingSubnetViolation
readList :: ReadS [NetworkFirewallMissingSubnetViolation]
$creadList :: ReadS [NetworkFirewallMissingSubnetViolation]
readsPrec :: Int -> ReadS NetworkFirewallMissingSubnetViolation
$creadsPrec :: Int -> ReadS NetworkFirewallMissingSubnetViolation
Prelude.Read, Int -> NetworkFirewallMissingSubnetViolation -> ShowS
[NetworkFirewallMissingSubnetViolation] -> ShowS
NetworkFirewallMissingSubnetViolation -> String
(Int -> NetworkFirewallMissingSubnetViolation -> ShowS)
-> (NetworkFirewallMissingSubnetViolation -> String)
-> ([NetworkFirewallMissingSubnetViolation] -> ShowS)
-> Show NetworkFirewallMissingSubnetViolation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkFirewallMissingSubnetViolation] -> ShowS
$cshowList :: [NetworkFirewallMissingSubnetViolation] -> ShowS
show :: NetworkFirewallMissingSubnetViolation -> String
$cshow :: NetworkFirewallMissingSubnetViolation -> String
showsPrec :: Int -> NetworkFirewallMissingSubnetViolation -> ShowS
$cshowsPrec :: Int -> NetworkFirewallMissingSubnetViolation -> ShowS
Prelude.Show, (forall x.
 NetworkFirewallMissingSubnetViolation
 -> Rep NetworkFirewallMissingSubnetViolation x)
-> (forall x.
    Rep NetworkFirewallMissingSubnetViolation x
    -> NetworkFirewallMissingSubnetViolation)
-> Generic NetworkFirewallMissingSubnetViolation
forall x.
Rep NetworkFirewallMissingSubnetViolation x
-> NetworkFirewallMissingSubnetViolation
forall x.
NetworkFirewallMissingSubnetViolation
-> Rep NetworkFirewallMissingSubnetViolation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NetworkFirewallMissingSubnetViolation x
-> NetworkFirewallMissingSubnetViolation
$cfrom :: forall x.
NetworkFirewallMissingSubnetViolation
-> Rep NetworkFirewallMissingSubnetViolation x
Prelude.Generic)

-- |
-- Create a value of 'NetworkFirewallMissingSubnetViolation' 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:
--
-- 'targetViolationReason', 'networkFirewallMissingSubnetViolation_targetViolationReason' - The reason the resource has this violation, if one is available.
--
-- 'availabilityZone', 'networkFirewallMissingSubnetViolation_availabilityZone' - The Availability Zone of a violating subnet.
--
-- 'vpc', 'networkFirewallMissingSubnetViolation_vpc' - The resource ID of the VPC associated with a violating subnet.
--
-- 'violationTarget', 'networkFirewallMissingSubnetViolation_violationTarget' - The ID of the Network Firewall or VPC resource that\'s in violation.
newNetworkFirewallMissingSubnetViolation ::
  NetworkFirewallMissingSubnetViolation
newNetworkFirewallMissingSubnetViolation :: NetworkFirewallMissingSubnetViolation
newNetworkFirewallMissingSubnetViolation =
  NetworkFirewallMissingSubnetViolation' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> NetworkFirewallMissingSubnetViolation
NetworkFirewallMissingSubnetViolation'
    { $sel:targetViolationReason:NetworkFirewallMissingSubnetViolation' :: Maybe Text
targetViolationReason =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:NetworkFirewallMissingSubnetViolation' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpc:NetworkFirewallMissingSubnetViolation' :: Maybe Text
vpc = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:violationTarget:NetworkFirewallMissingSubnetViolation' :: Maybe Text
violationTarget = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The reason the resource has this violation, if one is available.
networkFirewallMissingSubnetViolation_targetViolationReason :: Lens.Lens' NetworkFirewallMissingSubnetViolation (Prelude.Maybe Prelude.Text)
networkFirewallMissingSubnetViolation_targetViolationReason :: (Maybe Text -> f (Maybe Text))
-> NetworkFirewallMissingSubnetViolation
-> f NetworkFirewallMissingSubnetViolation
networkFirewallMissingSubnetViolation_targetViolationReason = (NetworkFirewallMissingSubnetViolation -> Maybe Text)
-> (NetworkFirewallMissingSubnetViolation
    -> Maybe Text -> NetworkFirewallMissingSubnetViolation)
-> Lens
     NetworkFirewallMissingSubnetViolation
     NetworkFirewallMissingSubnetViolation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallMissingSubnetViolation' {Maybe Text
targetViolationReason :: Maybe Text
$sel:targetViolationReason:NetworkFirewallMissingSubnetViolation' :: NetworkFirewallMissingSubnetViolation -> Maybe Text
targetViolationReason} -> Maybe Text
targetViolationReason) (\s :: NetworkFirewallMissingSubnetViolation
s@NetworkFirewallMissingSubnetViolation' {} Maybe Text
a -> NetworkFirewallMissingSubnetViolation
s {$sel:targetViolationReason:NetworkFirewallMissingSubnetViolation' :: Maybe Text
targetViolationReason = Maybe Text
a} :: NetworkFirewallMissingSubnetViolation)

-- | The Availability Zone of a violating subnet.
networkFirewallMissingSubnetViolation_availabilityZone :: Lens.Lens' NetworkFirewallMissingSubnetViolation (Prelude.Maybe Prelude.Text)
networkFirewallMissingSubnetViolation_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> NetworkFirewallMissingSubnetViolation
-> f NetworkFirewallMissingSubnetViolation
networkFirewallMissingSubnetViolation_availabilityZone = (NetworkFirewallMissingSubnetViolation -> Maybe Text)
-> (NetworkFirewallMissingSubnetViolation
    -> Maybe Text -> NetworkFirewallMissingSubnetViolation)
-> Lens
     NetworkFirewallMissingSubnetViolation
     NetworkFirewallMissingSubnetViolation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallMissingSubnetViolation' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:NetworkFirewallMissingSubnetViolation' :: NetworkFirewallMissingSubnetViolation -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: NetworkFirewallMissingSubnetViolation
s@NetworkFirewallMissingSubnetViolation' {} Maybe Text
a -> NetworkFirewallMissingSubnetViolation
s {$sel:availabilityZone:NetworkFirewallMissingSubnetViolation' :: Maybe Text
availabilityZone = Maybe Text
a} :: NetworkFirewallMissingSubnetViolation)

-- | The resource ID of the VPC associated with a violating subnet.
networkFirewallMissingSubnetViolation_vpc :: Lens.Lens' NetworkFirewallMissingSubnetViolation (Prelude.Maybe Prelude.Text)
networkFirewallMissingSubnetViolation_vpc :: (Maybe Text -> f (Maybe Text))
-> NetworkFirewallMissingSubnetViolation
-> f NetworkFirewallMissingSubnetViolation
networkFirewallMissingSubnetViolation_vpc = (NetworkFirewallMissingSubnetViolation -> Maybe Text)
-> (NetworkFirewallMissingSubnetViolation
    -> Maybe Text -> NetworkFirewallMissingSubnetViolation)
-> Lens
     NetworkFirewallMissingSubnetViolation
     NetworkFirewallMissingSubnetViolation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallMissingSubnetViolation' {Maybe Text
vpc :: Maybe Text
$sel:vpc:NetworkFirewallMissingSubnetViolation' :: NetworkFirewallMissingSubnetViolation -> Maybe Text
vpc} -> Maybe Text
vpc) (\s :: NetworkFirewallMissingSubnetViolation
s@NetworkFirewallMissingSubnetViolation' {} Maybe Text
a -> NetworkFirewallMissingSubnetViolation
s {$sel:vpc:NetworkFirewallMissingSubnetViolation' :: Maybe Text
vpc = Maybe Text
a} :: NetworkFirewallMissingSubnetViolation)

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

instance
  Core.FromJSON
    NetworkFirewallMissingSubnetViolation
  where
  parseJSON :: Value -> Parser NetworkFirewallMissingSubnetViolation
parseJSON =
    String
-> (Object -> Parser NetworkFirewallMissingSubnetViolation)
-> Value
-> Parser NetworkFirewallMissingSubnetViolation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NetworkFirewallMissingSubnetViolation"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> NetworkFirewallMissingSubnetViolation
NetworkFirewallMissingSubnetViolation'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> NetworkFirewallMissingSubnetViolation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> NetworkFirewallMissingSubnetViolation)
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
"TargetViolationReason")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> NetworkFirewallMissingSubnetViolation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> NetworkFirewallMissingSubnetViolation)
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
"AvailabilityZone")
            Parser
  (Maybe Text -> Maybe Text -> NetworkFirewallMissingSubnetViolation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> NetworkFirewallMissingSubnetViolation)
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
"VPC")
            Parser (Maybe Text -> NetworkFirewallMissingSubnetViolation)
-> Parser (Maybe Text)
-> Parser NetworkFirewallMissingSubnetViolation
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
    NetworkFirewallMissingSubnetViolation

instance
  Prelude.NFData
    NetworkFirewallMissingSubnetViolation