{-# 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.Inspector.Types.Exclusion where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector.Types.Attribute
import Amazonka.Inspector.Types.Scope
import qualified Amazonka.Prelude as Prelude
data Exclusion = Exclusion'
{
Exclusion -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
Exclusion -> Text
arn :: Prelude.Text,
Exclusion -> Text
title :: Prelude.Text,
Exclusion -> Text
description :: Prelude.Text,
Exclusion -> Text
recommendation :: Prelude.Text,
Exclusion -> NonEmpty Scope
scopes :: Prelude.NonEmpty Scope
}
deriving (Exclusion -> Exclusion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Exclusion -> Exclusion -> Bool
$c/= :: Exclusion -> Exclusion -> Bool
== :: Exclusion -> Exclusion -> Bool
$c== :: Exclusion -> Exclusion -> Bool
Prelude.Eq, ReadPrec [Exclusion]
ReadPrec Exclusion
Int -> ReadS Exclusion
ReadS [Exclusion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Exclusion]
$creadListPrec :: ReadPrec [Exclusion]
readPrec :: ReadPrec Exclusion
$creadPrec :: ReadPrec Exclusion
readList :: ReadS [Exclusion]
$creadList :: ReadS [Exclusion]
readsPrec :: Int -> ReadS Exclusion
$creadsPrec :: Int -> ReadS Exclusion
Prelude.Read, Int -> Exclusion -> ShowS
[Exclusion] -> ShowS
Exclusion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Exclusion] -> ShowS
$cshowList :: [Exclusion] -> ShowS
show :: Exclusion -> String
$cshow :: Exclusion -> String
showsPrec :: Int -> Exclusion -> ShowS
$cshowsPrec :: Int -> Exclusion -> ShowS
Prelude.Show, forall x. Rep Exclusion x -> Exclusion
forall x. Exclusion -> Rep Exclusion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Exclusion x -> Exclusion
$cfrom :: forall x. Exclusion -> Rep Exclusion x
Prelude.Generic)
newExclusion ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.NonEmpty Scope ->
Exclusion
newExclusion :: Text -> Text -> Text -> Text -> NonEmpty Scope -> Exclusion
newExclusion
Text
pArn_
Text
pTitle_
Text
pDescription_
Text
pRecommendation_
NonEmpty Scope
pScopes_ =
Exclusion'
{ $sel:attributes:Exclusion' :: Maybe [Attribute]
attributes = forall a. Maybe a
Prelude.Nothing,
$sel:arn:Exclusion' :: Text
arn = Text
pArn_,
$sel:title:Exclusion' :: Text
title = Text
pTitle_,
$sel:description:Exclusion' :: Text
description = Text
pDescription_,
$sel:recommendation:Exclusion' :: Text
recommendation = Text
pRecommendation_,
$sel:scopes:Exclusion' :: NonEmpty Scope
scopes = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Scope
pScopes_
}
exclusion_attributes :: Lens.Lens' Exclusion (Prelude.Maybe [Attribute])
exclusion_attributes :: Lens' Exclusion (Maybe [Attribute])
exclusion_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Exclusion' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:Exclusion' :: Exclusion -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: Exclusion
s@Exclusion' {} Maybe [Attribute]
a -> Exclusion
s {$sel:attributes:Exclusion' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: Exclusion) 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
exclusion_arn :: Lens.Lens' Exclusion Prelude.Text
exclusion_arn :: Lens' Exclusion Text
exclusion_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Exclusion' {Text
arn :: Text
$sel:arn:Exclusion' :: Exclusion -> Text
arn} -> Text
arn) (\s :: Exclusion
s@Exclusion' {} Text
a -> Exclusion
s {$sel:arn:Exclusion' :: Text
arn = Text
a} :: Exclusion)
exclusion_title :: Lens.Lens' Exclusion Prelude.Text
exclusion_title :: Lens' Exclusion Text
exclusion_title = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Exclusion' {Text
title :: Text
$sel:title:Exclusion' :: Exclusion -> Text
title} -> Text
title) (\s :: Exclusion
s@Exclusion' {} Text
a -> Exclusion
s {$sel:title:Exclusion' :: Text
title = Text
a} :: Exclusion)
exclusion_description :: Lens.Lens' Exclusion Prelude.Text
exclusion_description :: Lens' Exclusion Text
exclusion_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Exclusion' {Text
description :: Text
$sel:description:Exclusion' :: Exclusion -> Text
description} -> Text
description) (\s :: Exclusion
s@Exclusion' {} Text
a -> Exclusion
s {$sel:description:Exclusion' :: Text
description = Text
a} :: Exclusion)
exclusion_recommendation :: Lens.Lens' Exclusion Prelude.Text
exclusion_recommendation :: Lens' Exclusion Text
exclusion_recommendation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Exclusion' {Text
recommendation :: Text
$sel:recommendation:Exclusion' :: Exclusion -> Text
recommendation} -> Text
recommendation) (\s :: Exclusion
s@Exclusion' {} Text
a -> Exclusion
s {$sel:recommendation:Exclusion' :: Text
recommendation = Text
a} :: Exclusion)
exclusion_scopes :: Lens.Lens' Exclusion (Prelude.NonEmpty Scope)
exclusion_scopes :: Lens' Exclusion (NonEmpty Scope)
exclusion_scopes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Exclusion' {NonEmpty Scope
scopes :: NonEmpty Scope
$sel:scopes:Exclusion' :: Exclusion -> NonEmpty Scope
scopes} -> NonEmpty Scope
scopes) (\s :: Exclusion
s@Exclusion' {} NonEmpty Scope
a -> Exclusion
s {$sel:scopes:Exclusion' :: NonEmpty Scope
scopes = NonEmpty Scope
a} :: Exclusion) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON Exclusion where
parseJSON :: Value -> Parser Exclusion
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Exclusion"
( \Object
x ->
Maybe [Attribute]
-> Text -> Text -> Text -> Text -> NonEmpty Scope -> Exclusion
Exclusion'
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
"attributes" 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 a
Data..: Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"title")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"recommendation")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"scopes")
)
instance Prelude.Hashable Exclusion where
hashWithSalt :: Int -> Exclusion -> Int
hashWithSalt Int
_salt Exclusion' {Maybe [Attribute]
NonEmpty Scope
Text
scopes :: NonEmpty Scope
recommendation :: Text
description :: Text
title :: Text
arn :: Text
attributes :: Maybe [Attribute]
$sel:scopes:Exclusion' :: Exclusion -> NonEmpty Scope
$sel:recommendation:Exclusion' :: Exclusion -> Text
$sel:description:Exclusion' :: Exclusion -> Text
$sel:title:Exclusion' :: Exclusion -> Text
$sel:arn:Exclusion' :: Exclusion -> Text
$sel:attributes:Exclusion' :: Exclusion -> Maybe [Attribute]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Attribute]
attributes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
title
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recommendation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Scope
scopes
instance Prelude.NFData Exclusion where
rnf :: Exclusion -> ()
rnf Exclusion' {Maybe [Attribute]
NonEmpty Scope
Text
scopes :: NonEmpty Scope
recommendation :: Text
description :: Text
title :: Text
arn :: Text
attributes :: Maybe [Attribute]
$sel:scopes:Exclusion' :: Exclusion -> NonEmpty Scope
$sel:recommendation:Exclusion' :: Exclusion -> Text
$sel:description:Exclusion' :: Exclusion -> Text
$sel:title:Exclusion' :: Exclusion -> Text
$sel:arn:Exclusion' :: Exclusion -> Text
$sel:attributes:Exclusion' :: Exclusion -> Maybe [Attribute]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Attribute]
attributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
title
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recommendation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Scope
scopes