{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Shield.Types.AttackVectorDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$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 :: Lens' AttackVectorDescription Text
attackVectorDescription_vectorType = 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 Data.FromJSON AttackVectorDescription where
  parseJSON :: Value -> Parser AttackVectorDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AttackVectorDescription"
      ( \Object
x ->
          Text -> AttackVectorDescription
AttackVectorDescription'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"VectorType")
      )

instance Prelude.Hashable AttackVectorDescription where
  hashWithSalt :: Int -> AttackVectorDescription -> Int
hashWithSalt Int
_salt AttackVectorDescription' {Text
vectorType :: Text
$sel:vectorType:AttackVectorDescription' :: AttackVectorDescription -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vectorType

instance Prelude.NFData AttackVectorDescription where
  rnf :: AttackVectorDescription -> ()
rnf AttackVectorDescription' {Text
vectorType :: Text
$sel:vectorType:AttackVectorDescription' :: AttackVectorDescription -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
vectorType