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