{-# 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.AccessAnalyzer.Types.S3AccessPointConfiguration where
import Amazonka.AccessAnalyzer.Types.NetworkOriginConfiguration
import Amazonka.AccessAnalyzer.Types.S3PublicAccessBlockConfiguration
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
data S3AccessPointConfiguration = S3AccessPointConfiguration'
{
S3AccessPointConfiguration -> Maybe Text
accessPointPolicy :: Prelude.Maybe Prelude.Text,
S3AccessPointConfiguration -> Maybe NetworkOriginConfiguration
networkOrigin :: Prelude.Maybe NetworkOriginConfiguration,
S3AccessPointConfiguration
-> Maybe S3PublicAccessBlockConfiguration
publicAccessBlock :: Prelude.Maybe S3PublicAccessBlockConfiguration
}
deriving (S3AccessPointConfiguration -> S3AccessPointConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3AccessPointConfiguration -> S3AccessPointConfiguration -> Bool
$c/= :: S3AccessPointConfiguration -> S3AccessPointConfiguration -> Bool
== :: S3AccessPointConfiguration -> S3AccessPointConfiguration -> Bool
$c== :: S3AccessPointConfiguration -> S3AccessPointConfiguration -> Bool
Prelude.Eq, ReadPrec [S3AccessPointConfiguration]
ReadPrec S3AccessPointConfiguration
Int -> ReadS S3AccessPointConfiguration
ReadS [S3AccessPointConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3AccessPointConfiguration]
$creadListPrec :: ReadPrec [S3AccessPointConfiguration]
readPrec :: ReadPrec S3AccessPointConfiguration
$creadPrec :: ReadPrec S3AccessPointConfiguration
readList :: ReadS [S3AccessPointConfiguration]
$creadList :: ReadS [S3AccessPointConfiguration]
readsPrec :: Int -> ReadS S3AccessPointConfiguration
$creadsPrec :: Int -> ReadS S3AccessPointConfiguration
Prelude.Read, Int -> S3AccessPointConfiguration -> ShowS
[S3AccessPointConfiguration] -> ShowS
S3AccessPointConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3AccessPointConfiguration] -> ShowS
$cshowList :: [S3AccessPointConfiguration] -> ShowS
show :: S3AccessPointConfiguration -> String
$cshow :: S3AccessPointConfiguration -> String
showsPrec :: Int -> S3AccessPointConfiguration -> ShowS
$cshowsPrec :: Int -> S3AccessPointConfiguration -> ShowS
Prelude.Show, forall x.
Rep S3AccessPointConfiguration x -> S3AccessPointConfiguration
forall x.
S3AccessPointConfiguration -> Rep S3AccessPointConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3AccessPointConfiguration x -> S3AccessPointConfiguration
$cfrom :: forall x.
S3AccessPointConfiguration -> Rep S3AccessPointConfiguration x
Prelude.Generic)
newS3AccessPointConfiguration ::
S3AccessPointConfiguration
newS3AccessPointConfiguration :: S3AccessPointConfiguration
newS3AccessPointConfiguration =
S3AccessPointConfiguration'
{ $sel:accessPointPolicy:S3AccessPointConfiguration' :: Maybe Text
accessPointPolicy =
forall a. Maybe a
Prelude.Nothing,
$sel:networkOrigin:S3AccessPointConfiguration' :: Maybe NetworkOriginConfiguration
networkOrigin = forall a. Maybe a
Prelude.Nothing,
$sel:publicAccessBlock:S3AccessPointConfiguration' :: Maybe S3PublicAccessBlockConfiguration
publicAccessBlock = forall a. Maybe a
Prelude.Nothing
}
s3AccessPointConfiguration_accessPointPolicy :: Lens.Lens' S3AccessPointConfiguration (Prelude.Maybe Prelude.Text)
s3AccessPointConfiguration_accessPointPolicy :: Lens' S3AccessPointConfiguration (Maybe Text)
s3AccessPointConfiguration_accessPointPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3AccessPointConfiguration' {Maybe Text
accessPointPolicy :: Maybe Text
$sel:accessPointPolicy:S3AccessPointConfiguration' :: S3AccessPointConfiguration -> Maybe Text
accessPointPolicy} -> Maybe Text
accessPointPolicy) (\s :: S3AccessPointConfiguration
s@S3AccessPointConfiguration' {} Maybe Text
a -> S3AccessPointConfiguration
s {$sel:accessPointPolicy:S3AccessPointConfiguration' :: Maybe Text
accessPointPolicy = Maybe Text
a} :: S3AccessPointConfiguration)
s3AccessPointConfiguration_networkOrigin :: Lens.Lens' S3AccessPointConfiguration (Prelude.Maybe NetworkOriginConfiguration)
s3AccessPointConfiguration_networkOrigin :: Lens' S3AccessPointConfiguration (Maybe NetworkOriginConfiguration)
s3AccessPointConfiguration_networkOrigin = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3AccessPointConfiguration' {Maybe NetworkOriginConfiguration
networkOrigin :: Maybe NetworkOriginConfiguration
$sel:networkOrigin:S3AccessPointConfiguration' :: S3AccessPointConfiguration -> Maybe NetworkOriginConfiguration
networkOrigin} -> Maybe NetworkOriginConfiguration
networkOrigin) (\s :: S3AccessPointConfiguration
s@S3AccessPointConfiguration' {} Maybe NetworkOriginConfiguration
a -> S3AccessPointConfiguration
s {$sel:networkOrigin:S3AccessPointConfiguration' :: Maybe NetworkOriginConfiguration
networkOrigin = Maybe NetworkOriginConfiguration
a} :: S3AccessPointConfiguration)
s3AccessPointConfiguration_publicAccessBlock :: Lens.Lens' S3AccessPointConfiguration (Prelude.Maybe S3PublicAccessBlockConfiguration)
s3AccessPointConfiguration_publicAccessBlock :: Lens'
S3AccessPointConfiguration (Maybe S3PublicAccessBlockConfiguration)
s3AccessPointConfiguration_publicAccessBlock = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3AccessPointConfiguration' {Maybe S3PublicAccessBlockConfiguration
publicAccessBlock :: Maybe S3PublicAccessBlockConfiguration
$sel:publicAccessBlock:S3AccessPointConfiguration' :: S3AccessPointConfiguration
-> Maybe S3PublicAccessBlockConfiguration
publicAccessBlock} -> Maybe S3PublicAccessBlockConfiguration
publicAccessBlock) (\s :: S3AccessPointConfiguration
s@S3AccessPointConfiguration' {} Maybe S3PublicAccessBlockConfiguration
a -> S3AccessPointConfiguration
s {$sel:publicAccessBlock:S3AccessPointConfiguration' :: Maybe S3PublicAccessBlockConfiguration
publicAccessBlock = Maybe S3PublicAccessBlockConfiguration
a} :: S3AccessPointConfiguration)
instance Data.FromJSON S3AccessPointConfiguration where
parseJSON :: Value -> Parser S3AccessPointConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"S3AccessPointConfiguration"
( \Object
x ->
Maybe Text
-> Maybe NetworkOriginConfiguration
-> Maybe S3PublicAccessBlockConfiguration
-> S3AccessPointConfiguration
S3AccessPointConfiguration'
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
"accessPointPolicy")
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
"networkOrigin")
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
"publicAccessBlock")
)
instance Prelude.Hashable S3AccessPointConfiguration where
hashWithSalt :: Int -> S3AccessPointConfiguration -> Int
hashWithSalt Int
_salt S3AccessPointConfiguration' {Maybe Text
Maybe S3PublicAccessBlockConfiguration
Maybe NetworkOriginConfiguration
publicAccessBlock :: Maybe S3PublicAccessBlockConfiguration
networkOrigin :: Maybe NetworkOriginConfiguration
accessPointPolicy :: Maybe Text
$sel:publicAccessBlock:S3AccessPointConfiguration' :: S3AccessPointConfiguration
-> Maybe S3PublicAccessBlockConfiguration
$sel:networkOrigin:S3AccessPointConfiguration' :: S3AccessPointConfiguration -> Maybe NetworkOriginConfiguration
$sel:accessPointPolicy:S3AccessPointConfiguration' :: S3AccessPointConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accessPointPolicy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkOriginConfiguration
networkOrigin
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3PublicAccessBlockConfiguration
publicAccessBlock
instance Prelude.NFData S3AccessPointConfiguration where
rnf :: S3AccessPointConfiguration -> ()
rnf S3AccessPointConfiguration' {Maybe Text
Maybe S3PublicAccessBlockConfiguration
Maybe NetworkOriginConfiguration
publicAccessBlock :: Maybe S3PublicAccessBlockConfiguration
networkOrigin :: Maybe NetworkOriginConfiguration
accessPointPolicy :: Maybe Text
$sel:publicAccessBlock:S3AccessPointConfiguration' :: S3AccessPointConfiguration
-> Maybe S3PublicAccessBlockConfiguration
$sel:networkOrigin:S3AccessPointConfiguration' :: S3AccessPointConfiguration -> Maybe NetworkOriginConfiguration
$sel:accessPointPolicy:S3AccessPointConfiguration' :: S3AccessPointConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accessPointPolicy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkOriginConfiguration
networkOrigin
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3PublicAccessBlockConfiguration
publicAccessBlock
instance Data.ToJSON S3AccessPointConfiguration where
toJSON :: S3AccessPointConfiguration -> Value
toJSON S3AccessPointConfiguration' {Maybe Text
Maybe S3PublicAccessBlockConfiguration
Maybe NetworkOriginConfiguration
publicAccessBlock :: Maybe S3PublicAccessBlockConfiguration
networkOrigin :: Maybe NetworkOriginConfiguration
accessPointPolicy :: Maybe Text
$sel:publicAccessBlock:S3AccessPointConfiguration' :: S3AccessPointConfiguration
-> Maybe S3PublicAccessBlockConfiguration
$sel:networkOrigin:S3AccessPointConfiguration' :: S3AccessPointConfiguration -> Maybe NetworkOriginConfiguration
$sel:accessPointPolicy:S3AccessPointConfiguration' :: S3AccessPointConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"accessPointPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
accessPointPolicy,
(Key
"networkOrigin" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkOriginConfiguration
networkOrigin,
(Key
"publicAccessBlock" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3PublicAccessBlockConfiguration
publicAccessBlock
]
)