{-# 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.Shield.Types.AttackVectorDescription
-- 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.Shield.Types.AttackVectorDescription where

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

-- | Describes the attack.
--
-- /See:/ 'newAttackVectorDescription' smart constructor.
data AttackVectorDescription = AttackVectorDescription'
  { -- | The attack type. Valid values:
    --
    -- -   UDP_TRAFFIC
    --
    -- -   UDP_FRAGMENT
    --
    -- -   GENERIC_UDP_REFLECTION
    --
    -- -   DNS_REFLECTION
    --
    -- -   NTP_REFLECTION
    --
    -- -   CHARGEN_REFLECTION
    --
    -- -   SSDP_REFLECTION
    --
    -- -   PORT_MAPPER
    --
    -- -   RIP_REFLECTION
    --
    -- -   SNMP_REFLECTION
    --
    -- -   MSSQL_REFLECTION
    --
    -- -   NET_BIOS_REFLECTION
    --
    -- -   SYN_FLOOD
    --
    -- -   ACK_FLOOD
    --
    -- -   REQUEST_FLOOD
    --
    -- -   HTTP_REFLECTION
    --
    -- -   UDS_REFLECTION
    --
    -- -   MEMCACHED_REFLECTION
    AttackVectorDescription -> Text
vectorType :: Prelude.Text
  }
  deriving (AttackVectorDescription -> AttackVectorDescription -> Bool
(AttackVectorDescription -> AttackVectorDescription -> Bool)
-> (AttackVectorDescription -> AttackVectorDescription -> Bool)
-> Eq AttackVectorDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttackVectorDescription -> AttackVectorDescription -> Bool
$c/= :: AttackVectorDescription -> AttackVectorDescription -> Bool
== :: AttackVectorDescription -> AttackVectorDescription -> Bool
$c== :: AttackVectorDescription -> AttackVectorDescription -> Bool
Prelude.Eq, ReadPrec [AttackVectorDescription]
ReadPrec AttackVectorDescription
Int -> ReadS AttackVectorDescription
ReadS [AttackVectorDescription]
(Int -> ReadS AttackVectorDescription)
-> ReadS [AttackVectorDescription]
-> ReadPrec AttackVectorDescription
-> ReadPrec [AttackVectorDescription]
-> Read AttackVectorDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttackVectorDescription]
$creadListPrec :: ReadPrec [AttackVectorDescription]
readPrec :: ReadPrec AttackVectorDescription
$creadPrec :: ReadPrec AttackVectorDescription
readList :: ReadS [AttackVectorDescription]
$creadList :: ReadS [AttackVectorDescription]
readsPrec :: Int -> ReadS AttackVectorDescription
$creadsPrec :: Int -> ReadS AttackVectorDescription
Prelude.Read, Int -> AttackVectorDescription -> ShowS
[AttackVectorDescription] -> ShowS
AttackVectorDescription -> String
(Int -> AttackVectorDescription -> ShowS)
-> (AttackVectorDescription -> String)
-> ([AttackVectorDescription] -> ShowS)
-> Show AttackVectorDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttackVectorDescription] -> ShowS
$cshowList :: [AttackVectorDescription] -> ShowS
show :: AttackVectorDescription -> String
$cshow :: AttackVectorDescription -> String
showsPrec :: Int -> AttackVectorDescription -> ShowS
$cshowsPrec :: Int -> AttackVectorDescription -> ShowS
Prelude.Show, (forall x.
 AttackVectorDescription -> Rep AttackVectorDescription x)
-> (forall x.
    Rep AttackVectorDescription x -> AttackVectorDescription)
-> Generic AttackVectorDescription
forall x. Rep AttackVectorDescription x -> AttackVectorDescription
forall x. AttackVectorDescription -> Rep AttackVectorDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttackVectorDescription x -> AttackVectorDescription
$cfrom :: forall x. AttackVectorDescription -> Rep AttackVectorDescription x
Prelude.Generic)

-- |
-- Create a value of 'AttackVectorDescription' 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:
--
-- 'vectorType', 'attackVectorDescription_vectorType' - The attack type. Valid values:
--
-- -   UDP_TRAFFIC
--
-- -   UDP_FRAGMENT
--
-- -   GENERIC_UDP_REFLECTION
--
-- -   DNS_REFLECTION
--
-- -   NTP_REFLECTION
--
-- -   CHARGEN_REFLECTION
--
-- -   SSDP_REFLECTION
--
-- -   PORT_MAPPER
--
-- -   RIP_REFLECTION
--
-- -   SNMP_REFLECTION
--
-- -   MSSQL_REFLECTION
--
-- -   NET_BIOS_REFLECTION
--
-- -   SYN_FLOOD
--
-- -   ACK_FLOOD
--
-- -   REQUEST_FLOOD
--
-- -   HTTP_REFLECTION
--
-- -   UDS_REFLECTION
--
-- -   MEMCACHED_REFLECTION
newAttackVectorDescription ::
  -- | 'vectorType'
  Prelude.Text ->
  AttackVectorDescription
newAttackVectorDescription :: Text -> AttackVectorDescription
newAttackVectorDescription Text
pVectorType_ =
  AttackVectorDescription' :: Text -> AttackVectorDescription
AttackVectorDescription' {$sel:vectorType:AttackVectorDescription' :: Text
vectorType = Text
pVectorType_}

-- | The attack type. Valid values:
--
-- -   UDP_TRAFFIC
--
-- -   UDP_FRAGMENT
--
-- -   GENERIC_UDP_REFLECTION
--
-- -   DNS_REFLECTION
--
-- -   NTP_REFLECTION
--
-- -   CHARGEN_REFLECTION
--
-- -   SSDP_REFLECTION
--
-- -   PORT_MAPPER
--
-- -   RIP_REFLECTION
--
-- -   SNMP_REFLECTION
--
-- -   MSSQL_REFLECTION
--
-- -   NET_BIOS_REFLECTION
--
-- -   SYN_FLOOD
--
-- -   ACK_FLOOD
--
-- -   REQUEST_FLOOD
--
-- -   HTTP_REFLECTION
--
-- -   UDS_REFLECTION
--
-- -   MEMCACHED_REFLECTION
attackVectorDescription_vectorType :: Lens.Lens' AttackVectorDescription Prelude.Text
attackVectorDescription_vectorType :: (Text -> f Text)
-> AttackVectorDescription -> f AttackVectorDescription
attackVectorDescription_vectorType = (AttackVectorDescription -> Text)
-> (AttackVectorDescription -> Text -> AttackVectorDescription)
-> Lens AttackVectorDescription AttackVectorDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttackVectorDescription' {Text
vectorType :: Text
$sel:vectorType:AttackVectorDescription' :: AttackVectorDescription -> Text
vectorType} -> Text
vectorType) (\s :: AttackVectorDescription
s@AttackVectorDescription' {} Text
a -> AttackVectorDescription
s {$sel:vectorType:AttackVectorDescription' :: Text
vectorType = Text
a} :: AttackVectorDescription)

instance Core.FromJSON AttackVectorDescription where
  parseJSON :: Value -> Parser AttackVectorDescription
parseJSON =
    String
-> (Object -> Parser AttackVectorDescription)
-> Value
-> Parser AttackVectorDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AttackVectorDescription"
      ( \Object
x ->
          Text -> AttackVectorDescription
AttackVectorDescription'
            (Text -> AttackVectorDescription)
-> Parser Text -> Parser AttackVectorDescription
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VectorType")
      )

instance Prelude.Hashable AttackVectorDescription

instance Prelude.NFData AttackVectorDescription