{-# 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 #-}
module Amazonka.Shield.Types.Protection 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
import Amazonka.Shield.Types.ApplicationLayerAutomaticResponseConfiguration
data Protection = Protection'
{
Protection -> Maybe ApplicationLayerAutomaticResponseConfiguration
applicationLayerAutomaticResponseConfiguration :: Prelude.Maybe ApplicationLayerAutomaticResponseConfiguration,
Protection -> Maybe [Text]
healthCheckIds :: Prelude.Maybe [Prelude.Text],
Protection -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Protection -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Protection -> Maybe Text
protectionArn :: Prelude.Maybe Prelude.Text,
Protection -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text
}
deriving (Protection -> Protection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Protection -> Protection -> Bool
$c/= :: Protection -> Protection -> Bool
== :: Protection -> Protection -> Bool
$c== :: Protection -> Protection -> Bool
Prelude.Eq, ReadPrec [Protection]
ReadPrec Protection
Int -> ReadS Protection
ReadS [Protection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Protection]
$creadListPrec :: ReadPrec [Protection]
readPrec :: ReadPrec Protection
$creadPrec :: ReadPrec Protection
readList :: ReadS [Protection]
$creadList :: ReadS [Protection]
readsPrec :: Int -> ReadS Protection
$creadsPrec :: Int -> ReadS Protection
Prelude.Read, Int -> Protection -> ShowS
[Protection] -> ShowS
Protection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Protection] -> ShowS
$cshowList :: [Protection] -> ShowS
show :: Protection -> String
$cshow :: Protection -> String
showsPrec :: Int -> Protection -> ShowS
$cshowsPrec :: Int -> Protection -> ShowS
Prelude.Show, forall x. Rep Protection x -> Protection
forall x. Protection -> Rep Protection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Protection x -> Protection
$cfrom :: forall x. Protection -> Rep Protection x
Prelude.Generic)
newProtection ::
Protection
newProtection :: Protection
newProtection =
Protection'
{ $sel:applicationLayerAutomaticResponseConfiguration:Protection' :: Maybe ApplicationLayerAutomaticResponseConfiguration
applicationLayerAutomaticResponseConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:healthCheckIds:Protection' :: Maybe [Text]
healthCheckIds = forall a. Maybe a
Prelude.Nothing,
$sel:id:Protection' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:name:Protection' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:protectionArn:Protection' :: Maybe Text
protectionArn = forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:Protection' :: Maybe Text
resourceArn = forall a. Maybe a
Prelude.Nothing
}
protection_applicationLayerAutomaticResponseConfiguration :: Lens.Lens' Protection (Prelude.Maybe ApplicationLayerAutomaticResponseConfiguration)
protection_applicationLayerAutomaticResponseConfiguration :: Lens'
Protection (Maybe ApplicationLayerAutomaticResponseConfiguration)
protection_applicationLayerAutomaticResponseConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Protection' {Maybe ApplicationLayerAutomaticResponseConfiguration
applicationLayerAutomaticResponseConfiguration :: Maybe ApplicationLayerAutomaticResponseConfiguration
$sel:applicationLayerAutomaticResponseConfiguration:Protection' :: Protection -> Maybe ApplicationLayerAutomaticResponseConfiguration
applicationLayerAutomaticResponseConfiguration} -> Maybe ApplicationLayerAutomaticResponseConfiguration
applicationLayerAutomaticResponseConfiguration) (\s :: Protection
s@Protection' {} Maybe ApplicationLayerAutomaticResponseConfiguration
a -> Protection
s {$sel:applicationLayerAutomaticResponseConfiguration:Protection' :: Maybe ApplicationLayerAutomaticResponseConfiguration
applicationLayerAutomaticResponseConfiguration = Maybe ApplicationLayerAutomaticResponseConfiguration
a} :: Protection)
protection_healthCheckIds :: Lens.Lens' Protection (Prelude.Maybe [Prelude.Text])
protection_healthCheckIds :: Lens' Protection (Maybe [Text])
protection_healthCheckIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Protection' {Maybe [Text]
healthCheckIds :: Maybe [Text]
$sel:healthCheckIds:Protection' :: Protection -> Maybe [Text]
healthCheckIds} -> Maybe [Text]
healthCheckIds) (\s :: Protection
s@Protection' {} Maybe [Text]
a -> Protection
s {$sel:healthCheckIds:Protection' :: Maybe [Text]
healthCheckIds = Maybe [Text]
a} :: Protection) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
protection_id :: Lens.Lens' Protection (Prelude.Maybe Prelude.Text)
protection_id :: Lens' Protection (Maybe Text)
protection_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Protection' {Maybe Text
id :: Maybe Text
$sel:id:Protection' :: Protection -> Maybe Text
id} -> Maybe Text
id) (\s :: Protection
s@Protection' {} Maybe Text
a -> Protection
s {$sel:id:Protection' :: Maybe Text
id = Maybe Text
a} :: Protection)
protection_name :: Lens.Lens' Protection (Prelude.Maybe Prelude.Text)
protection_name :: Lens' Protection (Maybe Text)
protection_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Protection' {Maybe Text
name :: Maybe Text
$sel:name:Protection' :: Protection -> Maybe Text
name} -> Maybe Text
name) (\s :: Protection
s@Protection' {} Maybe Text
a -> Protection
s {$sel:name:Protection' :: Maybe Text
name = Maybe Text
a} :: Protection)
protection_protectionArn :: Lens.Lens' Protection (Prelude.Maybe Prelude.Text)
protection_protectionArn :: Lens' Protection (Maybe Text)
protection_protectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Protection' {Maybe Text
protectionArn :: Maybe Text
$sel:protectionArn:Protection' :: Protection -> Maybe Text
protectionArn} -> Maybe Text
protectionArn) (\s :: Protection
s@Protection' {} Maybe Text
a -> Protection
s {$sel:protectionArn:Protection' :: Maybe Text
protectionArn = Maybe Text
a} :: Protection)
protection_resourceArn :: Lens.Lens' Protection (Prelude.Maybe Prelude.Text)
protection_resourceArn :: Lens' Protection (Maybe Text)
protection_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Protection' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:Protection' :: Protection -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: Protection
s@Protection' {} Maybe Text
a -> Protection
s {$sel:resourceArn:Protection' :: Maybe Text
resourceArn = Maybe Text
a} :: Protection)
instance Data.FromJSON Protection where
parseJSON :: Value -> Parser Protection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Protection"
( \Object
x ->
Maybe ApplicationLayerAutomaticResponseConfiguration
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Protection
Protection'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ApplicationLayerAutomaticResponseConfiguration"
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HealthCheckIds" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProtectionArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceArn")
)
instance Prelude.Hashable Protection where
hashWithSalt :: Int -> Protection -> Int
hashWithSalt Int
_salt Protection' {Maybe [Text]
Maybe Text
Maybe ApplicationLayerAutomaticResponseConfiguration
resourceArn :: Maybe Text
protectionArn :: Maybe Text
name :: Maybe Text
id :: Maybe Text
healthCheckIds :: Maybe [Text]
applicationLayerAutomaticResponseConfiguration :: Maybe ApplicationLayerAutomaticResponseConfiguration
$sel:resourceArn:Protection' :: Protection -> Maybe Text
$sel:protectionArn:Protection' :: Protection -> Maybe Text
$sel:name:Protection' :: Protection -> Maybe Text
$sel:id:Protection' :: Protection -> Maybe Text
$sel:healthCheckIds:Protection' :: Protection -> Maybe [Text]
$sel:applicationLayerAutomaticResponseConfiguration:Protection' :: Protection -> Maybe ApplicationLayerAutomaticResponseConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ApplicationLayerAutomaticResponseConfiguration
applicationLayerAutomaticResponseConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
healthCheckIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
protectionArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceArn
instance Prelude.NFData Protection where
rnf :: Protection -> ()
rnf Protection' {Maybe [Text]
Maybe Text
Maybe ApplicationLayerAutomaticResponseConfiguration
resourceArn :: Maybe Text
protectionArn :: Maybe Text
name :: Maybe Text
id :: Maybe Text
healthCheckIds :: Maybe [Text]
applicationLayerAutomaticResponseConfiguration :: Maybe ApplicationLayerAutomaticResponseConfiguration
$sel:resourceArn:Protection' :: Protection -> Maybe Text
$sel:protectionArn:Protection' :: Protection -> Maybe Text
$sel:name:Protection' :: Protection -> Maybe Text
$sel:id:Protection' :: Protection -> Maybe Text
$sel:healthCheckIds:Protection' :: Protection -> Maybe [Text]
$sel:applicationLayerAutomaticResponseConfiguration:Protection' :: Protection -> Maybe ApplicationLayerAutomaticResponseConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf
Maybe ApplicationLayerAutomaticResponseConfiguration
applicationLayerAutomaticResponseConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
healthCheckIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
protectionArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceArn