{-# 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.MacieV2.Types.ResourcesAffected where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types.S3Bucket
import Amazonka.MacieV2.Types.S3Object
import qualified Amazonka.Prelude as Prelude
data ResourcesAffected = ResourcesAffected'
{
ResourcesAffected -> Maybe S3Object
s3Object :: Prelude.Maybe S3Object,
ResourcesAffected -> Maybe S3Bucket
s3Bucket :: Prelude.Maybe S3Bucket
}
deriving (ResourcesAffected -> ResourcesAffected -> Bool
(ResourcesAffected -> ResourcesAffected -> Bool)
-> (ResourcesAffected -> ResourcesAffected -> Bool)
-> Eq ResourcesAffected
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourcesAffected -> ResourcesAffected -> Bool
$c/= :: ResourcesAffected -> ResourcesAffected -> Bool
== :: ResourcesAffected -> ResourcesAffected -> Bool
$c== :: ResourcesAffected -> ResourcesAffected -> Bool
Prelude.Eq, ReadPrec [ResourcesAffected]
ReadPrec ResourcesAffected
Int -> ReadS ResourcesAffected
ReadS [ResourcesAffected]
(Int -> ReadS ResourcesAffected)
-> ReadS [ResourcesAffected]
-> ReadPrec ResourcesAffected
-> ReadPrec [ResourcesAffected]
-> Read ResourcesAffected
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourcesAffected]
$creadListPrec :: ReadPrec [ResourcesAffected]
readPrec :: ReadPrec ResourcesAffected
$creadPrec :: ReadPrec ResourcesAffected
readList :: ReadS [ResourcesAffected]
$creadList :: ReadS [ResourcesAffected]
readsPrec :: Int -> ReadS ResourcesAffected
$creadsPrec :: Int -> ReadS ResourcesAffected
Prelude.Read, Int -> ResourcesAffected -> ShowS
[ResourcesAffected] -> ShowS
ResourcesAffected -> String
(Int -> ResourcesAffected -> ShowS)
-> (ResourcesAffected -> String)
-> ([ResourcesAffected] -> ShowS)
-> Show ResourcesAffected
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourcesAffected] -> ShowS
$cshowList :: [ResourcesAffected] -> ShowS
show :: ResourcesAffected -> String
$cshow :: ResourcesAffected -> String
showsPrec :: Int -> ResourcesAffected -> ShowS
$cshowsPrec :: Int -> ResourcesAffected -> ShowS
Prelude.Show, (forall x. ResourcesAffected -> Rep ResourcesAffected x)
-> (forall x. Rep ResourcesAffected x -> ResourcesAffected)
-> Generic ResourcesAffected
forall x. Rep ResourcesAffected x -> ResourcesAffected
forall x. ResourcesAffected -> Rep ResourcesAffected x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourcesAffected x -> ResourcesAffected
$cfrom :: forall x. ResourcesAffected -> Rep ResourcesAffected x
Prelude.Generic)
newResourcesAffected ::
ResourcesAffected
newResourcesAffected :: ResourcesAffected
newResourcesAffected =
ResourcesAffected' :: Maybe S3Object -> Maybe S3Bucket -> ResourcesAffected
ResourcesAffected'
{ $sel:s3Object:ResourcesAffected' :: Maybe S3Object
s3Object = Maybe S3Object
forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:ResourcesAffected' :: Maybe S3Bucket
s3Bucket = Maybe S3Bucket
forall a. Maybe a
Prelude.Nothing
}
resourcesAffected_s3Object :: Lens.Lens' ResourcesAffected (Prelude.Maybe S3Object)
resourcesAffected_s3Object :: (Maybe S3Object -> f (Maybe S3Object))
-> ResourcesAffected -> f ResourcesAffected
resourcesAffected_s3Object = (ResourcesAffected -> Maybe S3Object)
-> (ResourcesAffected -> Maybe S3Object -> ResourcesAffected)
-> Lens
ResourcesAffected
ResourcesAffected
(Maybe S3Object)
(Maybe S3Object)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcesAffected' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:ResourcesAffected' :: ResourcesAffected -> Maybe S3Object
s3Object} -> Maybe S3Object
s3Object) (\s :: ResourcesAffected
s@ResourcesAffected' {} Maybe S3Object
a -> ResourcesAffected
s {$sel:s3Object:ResourcesAffected' :: Maybe S3Object
s3Object = Maybe S3Object
a} :: ResourcesAffected)
resourcesAffected_s3Bucket :: Lens.Lens' ResourcesAffected (Prelude.Maybe S3Bucket)
resourcesAffected_s3Bucket :: (Maybe S3Bucket -> f (Maybe S3Bucket))
-> ResourcesAffected -> f ResourcesAffected
resourcesAffected_s3Bucket = (ResourcesAffected -> Maybe S3Bucket)
-> (ResourcesAffected -> Maybe S3Bucket -> ResourcesAffected)
-> Lens
ResourcesAffected
ResourcesAffected
(Maybe S3Bucket)
(Maybe S3Bucket)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcesAffected' {Maybe S3Bucket
s3Bucket :: Maybe S3Bucket
$sel:s3Bucket:ResourcesAffected' :: ResourcesAffected -> Maybe S3Bucket
s3Bucket} -> Maybe S3Bucket
s3Bucket) (\s :: ResourcesAffected
s@ResourcesAffected' {} Maybe S3Bucket
a -> ResourcesAffected
s {$sel:s3Bucket:ResourcesAffected' :: Maybe S3Bucket
s3Bucket = Maybe S3Bucket
a} :: ResourcesAffected)
instance Core.FromJSON ResourcesAffected where
parseJSON :: Value -> Parser ResourcesAffected
parseJSON =
String
-> (Object -> Parser ResourcesAffected)
-> Value
-> Parser ResourcesAffected
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourcesAffected"
( \Object
x ->
Maybe S3Object -> Maybe S3Bucket -> ResourcesAffected
ResourcesAffected'
(Maybe S3Object -> Maybe S3Bucket -> ResourcesAffected)
-> Parser (Maybe S3Object)
-> Parser (Maybe S3Bucket -> ResourcesAffected)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe S3Object)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"s3Object")
Parser (Maybe S3Bucket -> ResourcesAffected)
-> Parser (Maybe S3Bucket) -> Parser ResourcesAffected
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe S3Bucket)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"s3Bucket")
)
instance Prelude.Hashable ResourcesAffected
instance Prelude.NFData ResourcesAffected