{-# 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 Amazonka.Inspector.Types.Attribute
import Amazonka.Inspector.Types.Scope
import qualified Amazonka.Lens as Lens
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
(Exclusion -> Exclusion -> Bool)
-> (Exclusion -> Exclusion -> Bool) -> Eq Exclusion
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]
(Int -> ReadS Exclusion)
-> ReadS [Exclusion]
-> ReadPrec Exclusion
-> ReadPrec [Exclusion]
-> Read 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
(Int -> Exclusion -> ShowS)
-> (Exclusion -> String)
-> ([Exclusion] -> ShowS)
-> Show Exclusion
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. Exclusion -> Rep Exclusion x)
-> (forall x. Rep Exclusion x -> Exclusion) -> Generic Exclusion
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' :: Maybe [Attribute]
-> Text -> Text -> Text -> Text -> NonEmpty Scope -> Exclusion
Exclusion'
{ $sel:attributes:Exclusion' :: Maybe [Attribute]
attributes = Maybe [Attribute]
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 = Tagged (NonEmpty Scope) (Identity (NonEmpty Scope))
-> Tagged (NonEmpty Scope) (Identity (NonEmpty Scope))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Scope) (Identity (NonEmpty Scope))
-> Tagged (NonEmpty Scope) (Identity (NonEmpty Scope)))
-> NonEmpty Scope -> NonEmpty Scope
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Scope
pScopes_
}
exclusion_attributes :: Lens.Lens' Exclusion (Prelude.Maybe [Attribute])
exclusion_attributes :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> Exclusion -> f Exclusion
exclusion_attributes = (Exclusion -> Maybe [Attribute])
-> (Exclusion -> Maybe [Attribute] -> Exclusion)
-> Lens Exclusion Exclusion (Maybe [Attribute]) (Maybe [Attribute])
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) ((Maybe [Attribute] -> f (Maybe [Attribute]))
-> Exclusion -> f Exclusion)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
-> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> Exclusion
-> f Exclusion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
(Maybe [Attribute])
(Maybe [Attribute])
(Maybe [Attribute])
(Maybe [Attribute])
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 [Attribute] [Attribute] [Attribute] [Attribute]
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 :: (Text -> f Text) -> Exclusion -> f Exclusion
exclusion_arn = (Exclusion -> Text)
-> (Exclusion -> Text -> Exclusion)
-> Lens Exclusion Exclusion Text Text
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 :: (Text -> f Text) -> Exclusion -> f Exclusion
exclusion_title = (Exclusion -> Text)
-> (Exclusion -> Text -> Exclusion)
-> Lens Exclusion Exclusion Text Text
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 :: (Text -> f Text) -> Exclusion -> f Exclusion
exclusion_description = (Exclusion -> Text)
-> (Exclusion -> Text -> Exclusion)
-> Lens Exclusion Exclusion Text Text
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 :: (Text -> f Text) -> Exclusion -> f Exclusion
exclusion_recommendation = (Exclusion -> Text)
-> (Exclusion -> Text -> Exclusion)
-> Lens Exclusion Exclusion Text Text
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 :: (NonEmpty Scope -> f (NonEmpty Scope)) -> Exclusion -> f Exclusion
exclusion_scopes = (Exclusion -> NonEmpty Scope)
-> (Exclusion -> NonEmpty Scope -> Exclusion)
-> Lens Exclusion Exclusion (NonEmpty Scope) (NonEmpty Scope)
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) ((NonEmpty Scope -> f (NonEmpty Scope))
-> Exclusion -> f Exclusion)
-> ((NonEmpty Scope -> f (NonEmpty Scope))
-> NonEmpty Scope -> f (NonEmpty Scope))
-> (NonEmpty Scope -> f (NonEmpty Scope))
-> Exclusion
-> f Exclusion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Scope -> f (NonEmpty Scope))
-> NonEmpty Scope -> f (NonEmpty Scope)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Exclusion where
parseJSON :: Value -> Parser Exclusion
parseJSON =
String -> (Object -> Parser Exclusion) -> Value -> Parser Exclusion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Exclusion"
( \Object
x ->
Maybe [Attribute]
-> Text -> Text -> Text -> Text -> NonEmpty Scope -> Exclusion
Exclusion'
(Maybe [Attribute]
-> Text -> Text -> Text -> Text -> NonEmpty Scope -> Exclusion)
-> Parser (Maybe [Attribute])
-> Parser
(Text -> Text -> Text -> Text -> NonEmpty Scope -> Exclusion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Attribute]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attributes" Parser (Maybe (Maybe [Attribute]))
-> Maybe [Attribute] -> Parser (Maybe [Attribute])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Attribute]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Text -> Text -> Text -> Text -> NonEmpty Scope -> Exclusion)
-> Parser Text
-> Parser (Text -> Text -> Text -> NonEmpty Scope -> Exclusion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
Parser (Text -> Text -> Text -> NonEmpty Scope -> Exclusion)
-> Parser Text
-> Parser (Text -> Text -> NonEmpty Scope -> Exclusion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"title")
Parser (Text -> Text -> NonEmpty Scope -> Exclusion)
-> Parser Text -> Parser (Text -> NonEmpty Scope -> Exclusion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"description")
Parser (Text -> NonEmpty Scope -> Exclusion)
-> Parser Text -> Parser (NonEmpty Scope -> Exclusion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"recommendation")
Parser (NonEmpty Scope -> Exclusion)
-> Parser (NonEmpty Scope) -> Parser Exclusion
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty Scope)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"scopes")
)
instance Prelude.Hashable Exclusion
instance Prelude.NFData Exclusion