{-# 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.Athena.Types.ResultConfiguration where
import Amazonka.Athena.Types.AclConfiguration
import Amazonka.Athena.Types.EncryptionConfiguration
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 ResultConfiguration = ResultConfiguration'
{
ResultConfiguration -> Maybe AclConfiguration
aclConfiguration :: Prelude.Maybe AclConfiguration,
ResultConfiguration -> Maybe EncryptionConfiguration
encryptionConfiguration :: Prelude.Maybe EncryptionConfiguration,
ResultConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
ResultConfiguration -> Maybe Text
outputLocation :: Prelude.Maybe Prelude.Text
}
deriving (ResultConfiguration -> ResultConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResultConfiguration -> ResultConfiguration -> Bool
$c/= :: ResultConfiguration -> ResultConfiguration -> Bool
== :: ResultConfiguration -> ResultConfiguration -> Bool
$c== :: ResultConfiguration -> ResultConfiguration -> Bool
Prelude.Eq, ReadPrec [ResultConfiguration]
ReadPrec ResultConfiguration
Int -> ReadS ResultConfiguration
ReadS [ResultConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResultConfiguration]
$creadListPrec :: ReadPrec [ResultConfiguration]
readPrec :: ReadPrec ResultConfiguration
$creadPrec :: ReadPrec ResultConfiguration
readList :: ReadS [ResultConfiguration]
$creadList :: ReadS [ResultConfiguration]
readsPrec :: Int -> ReadS ResultConfiguration
$creadsPrec :: Int -> ReadS ResultConfiguration
Prelude.Read, Int -> ResultConfiguration -> ShowS
[ResultConfiguration] -> ShowS
ResultConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResultConfiguration] -> ShowS
$cshowList :: [ResultConfiguration] -> ShowS
show :: ResultConfiguration -> String
$cshow :: ResultConfiguration -> String
showsPrec :: Int -> ResultConfiguration -> ShowS
$cshowsPrec :: Int -> ResultConfiguration -> ShowS
Prelude.Show, forall x. Rep ResultConfiguration x -> ResultConfiguration
forall x. ResultConfiguration -> Rep ResultConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResultConfiguration x -> ResultConfiguration
$cfrom :: forall x. ResultConfiguration -> Rep ResultConfiguration x
Prelude.Generic)
newResultConfiguration ::
ResultConfiguration
newResultConfiguration :: ResultConfiguration
newResultConfiguration =
ResultConfiguration'
{ $sel:aclConfiguration:ResultConfiguration' :: Maybe AclConfiguration
aclConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:encryptionConfiguration:ResultConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:ResultConfiguration' :: Maybe Text
expectedBucketOwner = forall a. Maybe a
Prelude.Nothing,
$sel:outputLocation:ResultConfiguration' :: Maybe Text
outputLocation = forall a. Maybe a
Prelude.Nothing
}
resultConfiguration_aclConfiguration :: Lens.Lens' ResultConfiguration (Prelude.Maybe AclConfiguration)
resultConfiguration_aclConfiguration :: Lens' ResultConfiguration (Maybe AclConfiguration)
resultConfiguration_aclConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultConfiguration' {Maybe AclConfiguration
aclConfiguration :: Maybe AclConfiguration
$sel:aclConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe AclConfiguration
aclConfiguration} -> Maybe AclConfiguration
aclConfiguration) (\s :: ResultConfiguration
s@ResultConfiguration' {} Maybe AclConfiguration
a -> ResultConfiguration
s {$sel:aclConfiguration:ResultConfiguration' :: Maybe AclConfiguration
aclConfiguration = Maybe AclConfiguration
a} :: ResultConfiguration)
resultConfiguration_encryptionConfiguration :: Lens.Lens' ResultConfiguration (Prelude.Maybe EncryptionConfiguration)
resultConfiguration_encryptionConfiguration :: Lens' ResultConfiguration (Maybe EncryptionConfiguration)
resultConfiguration_encryptionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultConfiguration' {Maybe EncryptionConfiguration
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:encryptionConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe EncryptionConfiguration
encryptionConfiguration} -> Maybe EncryptionConfiguration
encryptionConfiguration) (\s :: ResultConfiguration
s@ResultConfiguration' {} Maybe EncryptionConfiguration
a -> ResultConfiguration
s {$sel:encryptionConfiguration:ResultConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
a} :: ResultConfiguration)
resultConfiguration_expectedBucketOwner :: Lens.Lens' ResultConfiguration (Prelude.Maybe Prelude.Text)
resultConfiguration_expectedBucketOwner :: Lens' ResultConfiguration (Maybe Text)
resultConfiguration_expectedBucketOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:ResultConfiguration' :: ResultConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: ResultConfiguration
s@ResultConfiguration' {} Maybe Text
a -> ResultConfiguration
s {$sel:expectedBucketOwner:ResultConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: ResultConfiguration)
resultConfiguration_outputLocation :: Lens.Lens' ResultConfiguration (Prelude.Maybe Prelude.Text)
resultConfiguration_outputLocation :: Lens' ResultConfiguration (Maybe Text)
resultConfiguration_outputLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResultConfiguration' {Maybe Text
outputLocation :: Maybe Text
$sel:outputLocation:ResultConfiguration' :: ResultConfiguration -> Maybe Text
outputLocation} -> Maybe Text
outputLocation) (\s :: ResultConfiguration
s@ResultConfiguration' {} Maybe Text
a -> ResultConfiguration
s {$sel:outputLocation:ResultConfiguration' :: Maybe Text
outputLocation = Maybe Text
a} :: ResultConfiguration)
instance Data.FromJSON ResultConfiguration where
parseJSON :: Value -> Parser ResultConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResultConfiguration"
( \Object
x ->
Maybe AclConfiguration
-> Maybe EncryptionConfiguration
-> Maybe Text
-> Maybe Text
-> ResultConfiguration
ResultConfiguration'
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
"AclConfiguration")
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
"EncryptionConfiguration")
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
"ExpectedBucketOwner")
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
"OutputLocation")
)
instance Prelude.Hashable ResultConfiguration where
hashWithSalt :: Int -> ResultConfiguration -> Int
hashWithSalt Int
_salt ResultConfiguration' {Maybe Text
Maybe EncryptionConfiguration
Maybe AclConfiguration
outputLocation :: Maybe Text
expectedBucketOwner :: Maybe Text
encryptionConfiguration :: Maybe EncryptionConfiguration
aclConfiguration :: Maybe AclConfiguration
$sel:outputLocation:ResultConfiguration' :: ResultConfiguration -> Maybe Text
$sel:expectedBucketOwner:ResultConfiguration' :: ResultConfiguration -> Maybe Text
$sel:encryptionConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe EncryptionConfiguration
$sel:aclConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe AclConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AclConfiguration
aclConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EncryptionConfiguration
encryptionConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expectedBucketOwner
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputLocation
instance Prelude.NFData ResultConfiguration where
rnf :: ResultConfiguration -> ()
rnf ResultConfiguration' {Maybe Text
Maybe EncryptionConfiguration
Maybe AclConfiguration
outputLocation :: Maybe Text
expectedBucketOwner :: Maybe Text
encryptionConfiguration :: Maybe EncryptionConfiguration
aclConfiguration :: Maybe AclConfiguration
$sel:outputLocation:ResultConfiguration' :: ResultConfiguration -> Maybe Text
$sel:expectedBucketOwner:ResultConfiguration' :: ResultConfiguration -> Maybe Text
$sel:encryptionConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe EncryptionConfiguration
$sel:aclConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe AclConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AclConfiguration
aclConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EncryptionConfiguration
encryptionConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
expectedBucketOwner
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputLocation
instance Data.ToJSON ResultConfiguration where
toJSON :: ResultConfiguration -> Value
toJSON ResultConfiguration' {Maybe Text
Maybe EncryptionConfiguration
Maybe AclConfiguration
outputLocation :: Maybe Text
expectedBucketOwner :: Maybe Text
encryptionConfiguration :: Maybe EncryptionConfiguration
aclConfiguration :: Maybe AclConfiguration
$sel:outputLocation:ResultConfiguration' :: ResultConfiguration -> Maybe Text
$sel:expectedBucketOwner:ResultConfiguration' :: ResultConfiguration -> Maybe Text
$sel:encryptionConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe EncryptionConfiguration
$sel:aclConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe AclConfiguration
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AclConfiguration" 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 AclConfiguration
aclConfiguration,
(Key
"EncryptionConfiguration" 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 EncryptionConfiguration
encryptionConfiguration,
(Key
"ExpectedBucketOwner" 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
expectedBucketOwner,
(Key
"OutputLocation" 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
outputLocation
]
)