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

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

-- | Violation detail for an unexpected gateway route that’s present in a
-- route table.
--
-- /See:/ 'newNetworkFirewallUnexpectedGatewayRoutesViolation' smart constructor.
data NetworkFirewallUnexpectedGatewayRoutesViolation = NetworkFirewallUnexpectedGatewayRoutesViolation'
  { -- | Information about the route table.
    NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe Text
routeTableId :: Prelude.Maybe Prelude.Text,
    -- | Information about the VPC ID.
    NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The routes that are in violation.
    NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe [Route]
violatingRoutes :: Prelude.Maybe [Route],
    -- | Information about the gateway ID.
    NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe Text
gatewayId :: Prelude.Maybe Prelude.Text
  }
  deriving (NetworkFirewallUnexpectedGatewayRoutesViolation
-> NetworkFirewallUnexpectedGatewayRoutesViolation -> Bool
(NetworkFirewallUnexpectedGatewayRoutesViolation
 -> NetworkFirewallUnexpectedGatewayRoutesViolation -> Bool)
-> (NetworkFirewallUnexpectedGatewayRoutesViolation
    -> NetworkFirewallUnexpectedGatewayRoutesViolation -> Bool)
-> Eq NetworkFirewallUnexpectedGatewayRoutesViolation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkFirewallUnexpectedGatewayRoutesViolation
-> NetworkFirewallUnexpectedGatewayRoutesViolation -> Bool
$c/= :: NetworkFirewallUnexpectedGatewayRoutesViolation
-> NetworkFirewallUnexpectedGatewayRoutesViolation -> Bool
== :: NetworkFirewallUnexpectedGatewayRoutesViolation
-> NetworkFirewallUnexpectedGatewayRoutesViolation -> Bool
$c== :: NetworkFirewallUnexpectedGatewayRoutesViolation
-> NetworkFirewallUnexpectedGatewayRoutesViolation -> Bool
Prelude.Eq, ReadPrec [NetworkFirewallUnexpectedGatewayRoutesViolation]
ReadPrec NetworkFirewallUnexpectedGatewayRoutesViolation
Int -> ReadS NetworkFirewallUnexpectedGatewayRoutesViolation
ReadS [NetworkFirewallUnexpectedGatewayRoutesViolation]
(Int -> ReadS NetworkFirewallUnexpectedGatewayRoutesViolation)
-> ReadS [NetworkFirewallUnexpectedGatewayRoutesViolation]
-> ReadPrec NetworkFirewallUnexpectedGatewayRoutesViolation
-> ReadPrec [NetworkFirewallUnexpectedGatewayRoutesViolation]
-> Read NetworkFirewallUnexpectedGatewayRoutesViolation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkFirewallUnexpectedGatewayRoutesViolation]
$creadListPrec :: ReadPrec [NetworkFirewallUnexpectedGatewayRoutesViolation]
readPrec :: ReadPrec NetworkFirewallUnexpectedGatewayRoutesViolation
$creadPrec :: ReadPrec NetworkFirewallUnexpectedGatewayRoutesViolation
readList :: ReadS [NetworkFirewallUnexpectedGatewayRoutesViolation]
$creadList :: ReadS [NetworkFirewallUnexpectedGatewayRoutesViolation]
readsPrec :: Int -> ReadS NetworkFirewallUnexpectedGatewayRoutesViolation
$creadsPrec :: Int -> ReadS NetworkFirewallUnexpectedGatewayRoutesViolation
Prelude.Read, Int -> NetworkFirewallUnexpectedGatewayRoutesViolation -> ShowS
[NetworkFirewallUnexpectedGatewayRoutesViolation] -> ShowS
NetworkFirewallUnexpectedGatewayRoutesViolation -> String
(Int -> NetworkFirewallUnexpectedGatewayRoutesViolation -> ShowS)
-> (NetworkFirewallUnexpectedGatewayRoutesViolation -> String)
-> ([NetworkFirewallUnexpectedGatewayRoutesViolation] -> ShowS)
-> Show NetworkFirewallUnexpectedGatewayRoutesViolation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkFirewallUnexpectedGatewayRoutesViolation] -> ShowS
$cshowList :: [NetworkFirewallUnexpectedGatewayRoutesViolation] -> ShowS
show :: NetworkFirewallUnexpectedGatewayRoutesViolation -> String
$cshow :: NetworkFirewallUnexpectedGatewayRoutesViolation -> String
showsPrec :: Int -> NetworkFirewallUnexpectedGatewayRoutesViolation -> ShowS
$cshowsPrec :: Int -> NetworkFirewallUnexpectedGatewayRoutesViolation -> ShowS
Prelude.Show, (forall x.
 NetworkFirewallUnexpectedGatewayRoutesViolation
 -> Rep NetworkFirewallUnexpectedGatewayRoutesViolation x)
-> (forall x.
    Rep NetworkFirewallUnexpectedGatewayRoutesViolation x
    -> NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Generic NetworkFirewallUnexpectedGatewayRoutesViolation
forall x.
Rep NetworkFirewallUnexpectedGatewayRoutesViolation x
-> NetworkFirewallUnexpectedGatewayRoutesViolation
forall x.
NetworkFirewallUnexpectedGatewayRoutesViolation
-> Rep NetworkFirewallUnexpectedGatewayRoutesViolation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NetworkFirewallUnexpectedGatewayRoutesViolation x
-> NetworkFirewallUnexpectedGatewayRoutesViolation
$cfrom :: forall x.
NetworkFirewallUnexpectedGatewayRoutesViolation
-> Rep NetworkFirewallUnexpectedGatewayRoutesViolation x
Prelude.Generic)

-- |
-- Create a value of 'NetworkFirewallUnexpectedGatewayRoutesViolation' 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:
--
-- 'routeTableId', 'networkFirewallUnexpectedGatewayRoutesViolation_routeTableId' - Information about the route table.
--
-- 'vpcId', 'networkFirewallUnexpectedGatewayRoutesViolation_vpcId' - Information about the VPC ID.
--
-- 'violatingRoutes', 'networkFirewallUnexpectedGatewayRoutesViolation_violatingRoutes' - The routes that are in violation.
--
-- 'gatewayId', 'networkFirewallUnexpectedGatewayRoutesViolation_gatewayId' - Information about the gateway ID.
newNetworkFirewallUnexpectedGatewayRoutesViolation ::
  NetworkFirewallUnexpectedGatewayRoutesViolation
newNetworkFirewallUnexpectedGatewayRoutesViolation :: NetworkFirewallUnexpectedGatewayRoutesViolation
newNetworkFirewallUnexpectedGatewayRoutesViolation =
  NetworkFirewallUnexpectedGatewayRoutesViolation' :: Maybe Text
-> Maybe Text
-> Maybe [Route]
-> Maybe Text
-> NetworkFirewallUnexpectedGatewayRoutesViolation
NetworkFirewallUnexpectedGatewayRoutesViolation'
    { $sel:routeTableId:NetworkFirewallUnexpectedGatewayRoutesViolation' :: Maybe Text
routeTableId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:NetworkFirewallUnexpectedGatewayRoutesViolation' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:violatingRoutes:NetworkFirewallUnexpectedGatewayRoutesViolation' :: Maybe [Route]
violatingRoutes =
        Maybe [Route]
forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayId:NetworkFirewallUnexpectedGatewayRoutesViolation' :: Maybe Text
gatewayId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the route table.
networkFirewallUnexpectedGatewayRoutesViolation_routeTableId :: Lens.Lens' NetworkFirewallUnexpectedGatewayRoutesViolation (Prelude.Maybe Prelude.Text)
networkFirewallUnexpectedGatewayRoutesViolation_routeTableId :: (Maybe Text -> f (Maybe Text))
-> NetworkFirewallUnexpectedGatewayRoutesViolation
-> f NetworkFirewallUnexpectedGatewayRoutesViolation
networkFirewallUnexpectedGatewayRoutesViolation_routeTableId = (NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe Text)
-> (NetworkFirewallUnexpectedGatewayRoutesViolation
    -> Maybe Text -> NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Lens
     NetworkFirewallUnexpectedGatewayRoutesViolation
     NetworkFirewallUnexpectedGatewayRoutesViolation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallUnexpectedGatewayRoutesViolation' {Maybe Text
routeTableId :: Maybe Text
$sel:routeTableId:NetworkFirewallUnexpectedGatewayRoutesViolation' :: NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe Text
routeTableId} -> Maybe Text
routeTableId) (\s :: NetworkFirewallUnexpectedGatewayRoutesViolation
s@NetworkFirewallUnexpectedGatewayRoutesViolation' {} Maybe Text
a -> NetworkFirewallUnexpectedGatewayRoutesViolation
s {$sel:routeTableId:NetworkFirewallUnexpectedGatewayRoutesViolation' :: Maybe Text
routeTableId = Maybe Text
a} :: NetworkFirewallUnexpectedGatewayRoutesViolation)

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

-- | The routes that are in violation.
networkFirewallUnexpectedGatewayRoutesViolation_violatingRoutes :: Lens.Lens' NetworkFirewallUnexpectedGatewayRoutesViolation (Prelude.Maybe [Route])
networkFirewallUnexpectedGatewayRoutesViolation_violatingRoutes :: (Maybe [Route] -> f (Maybe [Route]))
-> NetworkFirewallUnexpectedGatewayRoutesViolation
-> f NetworkFirewallUnexpectedGatewayRoutesViolation
networkFirewallUnexpectedGatewayRoutesViolation_violatingRoutes = (NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe [Route])
-> (NetworkFirewallUnexpectedGatewayRoutesViolation
    -> Maybe [Route]
    -> NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Lens
     NetworkFirewallUnexpectedGatewayRoutesViolation
     NetworkFirewallUnexpectedGatewayRoutesViolation
     (Maybe [Route])
     (Maybe [Route])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallUnexpectedGatewayRoutesViolation' {Maybe [Route]
violatingRoutes :: Maybe [Route]
$sel:violatingRoutes:NetworkFirewallUnexpectedGatewayRoutesViolation' :: NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe [Route]
violatingRoutes} -> Maybe [Route]
violatingRoutes) (\s :: NetworkFirewallUnexpectedGatewayRoutesViolation
s@NetworkFirewallUnexpectedGatewayRoutesViolation' {} Maybe [Route]
a -> NetworkFirewallUnexpectedGatewayRoutesViolation
s {$sel:violatingRoutes:NetworkFirewallUnexpectedGatewayRoutesViolation' :: Maybe [Route]
violatingRoutes = Maybe [Route]
a} :: NetworkFirewallUnexpectedGatewayRoutesViolation) ((Maybe [Route] -> f (Maybe [Route]))
 -> NetworkFirewallUnexpectedGatewayRoutesViolation
 -> f NetworkFirewallUnexpectedGatewayRoutesViolation)
-> ((Maybe [Route] -> f (Maybe [Route]))
    -> Maybe [Route] -> f (Maybe [Route]))
-> (Maybe [Route] -> f (Maybe [Route]))
-> NetworkFirewallUnexpectedGatewayRoutesViolation
-> f NetworkFirewallUnexpectedGatewayRoutesViolation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Route] [Route] [Route] [Route]
-> Iso
     (Maybe [Route]) (Maybe [Route]) (Maybe [Route]) (Maybe [Route])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Route] [Route] [Route] [Route]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the gateway ID.
networkFirewallUnexpectedGatewayRoutesViolation_gatewayId :: Lens.Lens' NetworkFirewallUnexpectedGatewayRoutesViolation (Prelude.Maybe Prelude.Text)
networkFirewallUnexpectedGatewayRoutesViolation_gatewayId :: (Maybe Text -> f (Maybe Text))
-> NetworkFirewallUnexpectedGatewayRoutesViolation
-> f NetworkFirewallUnexpectedGatewayRoutesViolation
networkFirewallUnexpectedGatewayRoutesViolation_gatewayId = (NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe Text)
-> (NetworkFirewallUnexpectedGatewayRoutesViolation
    -> Maybe Text -> NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Lens
     NetworkFirewallUnexpectedGatewayRoutesViolation
     NetworkFirewallUnexpectedGatewayRoutesViolation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkFirewallUnexpectedGatewayRoutesViolation' {Maybe Text
gatewayId :: Maybe Text
$sel:gatewayId:NetworkFirewallUnexpectedGatewayRoutesViolation' :: NetworkFirewallUnexpectedGatewayRoutesViolation -> Maybe Text
gatewayId} -> Maybe Text
gatewayId) (\s :: NetworkFirewallUnexpectedGatewayRoutesViolation
s@NetworkFirewallUnexpectedGatewayRoutesViolation' {} Maybe Text
a -> NetworkFirewallUnexpectedGatewayRoutesViolation
s {$sel:gatewayId:NetworkFirewallUnexpectedGatewayRoutesViolation' :: Maybe Text
gatewayId = Maybe Text
a} :: NetworkFirewallUnexpectedGatewayRoutesViolation)

instance
  Core.FromJSON
    NetworkFirewallUnexpectedGatewayRoutesViolation
  where
  parseJSON :: Value -> Parser NetworkFirewallUnexpectedGatewayRoutesViolation
parseJSON =
    String
-> (Object
    -> Parser NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Value
-> Parser NetworkFirewallUnexpectedGatewayRoutesViolation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NetworkFirewallUnexpectedGatewayRoutesViolation"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Route]
-> Maybe Text
-> NetworkFirewallUnexpectedGatewayRoutesViolation
NetworkFirewallUnexpectedGatewayRoutesViolation'
            (Maybe Text
 -> Maybe Text
 -> Maybe [Route]
 -> Maybe Text
 -> NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Route]
      -> Maybe Text
      -> NetworkFirewallUnexpectedGatewayRoutesViolation)
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
"RouteTableId")
              Parser
  (Maybe Text
   -> Maybe [Route]
   -> Maybe Text
   -> NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Route]
      -> Maybe Text -> NetworkFirewallUnexpectedGatewayRoutesViolation)
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
"VpcId")
              Parser
  (Maybe [Route]
   -> Maybe Text -> NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Parser (Maybe [Route])
-> Parser
     (Maybe Text -> NetworkFirewallUnexpectedGatewayRoutesViolation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Route]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ViolatingRoutes"
                              Parser (Maybe (Maybe [Route]))
-> Maybe [Route] -> Parser (Maybe [Route])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Route]
forall a. Monoid a => a
Prelude.mempty
                          )
              Parser
  (Maybe Text -> NetworkFirewallUnexpectedGatewayRoutesViolation)
-> Parser (Maybe Text)
-> Parser NetworkFirewallUnexpectedGatewayRoutesViolation
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
"GatewayId")
      )

instance
  Prelude.Hashable
    NetworkFirewallUnexpectedGatewayRoutesViolation

instance
  Prelude.NFData
    NetworkFirewallUnexpectedGatewayRoutesViolation