{-# 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.EncryptionConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResultConfiguration = ResultConfiguration'
{
ResultConfiguration -> Maybe EncryptionConfiguration
encryptionConfiguration :: Prelude.Maybe EncryptionConfiguration,
ResultConfiguration -> Maybe Text
outputLocation :: Prelude.Maybe Prelude.Text
}
deriving (ResultConfiguration -> ResultConfiguration -> Bool
(ResultConfiguration -> ResultConfiguration -> Bool)
-> (ResultConfiguration -> ResultConfiguration -> Bool)
-> Eq ResultConfiguration
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]
(Int -> ReadS ResultConfiguration)
-> ReadS [ResultConfiguration]
-> ReadPrec ResultConfiguration
-> ReadPrec [ResultConfiguration]
-> Read 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
(Int -> ResultConfiguration -> ShowS)
-> (ResultConfiguration -> String)
-> ([ResultConfiguration] -> ShowS)
-> Show ResultConfiguration
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. ResultConfiguration -> Rep ResultConfiguration x)
-> (forall x. Rep ResultConfiguration x -> ResultConfiguration)
-> Generic ResultConfiguration
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' :: Maybe EncryptionConfiguration -> Maybe Text -> ResultConfiguration
ResultConfiguration'
{ $sel:encryptionConfiguration:ResultConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration =
Maybe EncryptionConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:outputLocation:ResultConfiguration' :: Maybe Text
outputLocation = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
resultConfiguration_encryptionConfiguration :: Lens.Lens' ResultConfiguration (Prelude.Maybe EncryptionConfiguration)
resultConfiguration_encryptionConfiguration :: (Maybe EncryptionConfiguration
-> f (Maybe EncryptionConfiguration))
-> ResultConfiguration -> f ResultConfiguration
resultConfiguration_encryptionConfiguration = (ResultConfiguration -> Maybe EncryptionConfiguration)
-> (ResultConfiguration
-> Maybe EncryptionConfiguration -> ResultConfiguration)
-> Lens
ResultConfiguration
ResultConfiguration
(Maybe EncryptionConfiguration)
(Maybe 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_outputLocation :: Lens.Lens' ResultConfiguration (Prelude.Maybe Prelude.Text)
resultConfiguration_outputLocation :: (Maybe Text -> f (Maybe Text))
-> ResultConfiguration -> f ResultConfiguration
resultConfiguration_outputLocation = (ResultConfiguration -> Maybe Text)
-> (ResultConfiguration -> Maybe Text -> ResultConfiguration)
-> Lens
ResultConfiguration ResultConfiguration (Maybe Text) (Maybe Text)
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 Core.FromJSON ResultConfiguration where
parseJSON :: Value -> Parser ResultConfiguration
parseJSON =
String
-> (Object -> Parser ResultConfiguration)
-> Value
-> Parser ResultConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResultConfiguration"
( \Object
x ->
Maybe EncryptionConfiguration -> Maybe Text -> ResultConfiguration
ResultConfiguration'
(Maybe EncryptionConfiguration
-> Maybe Text -> ResultConfiguration)
-> Parser (Maybe EncryptionConfiguration)
-> Parser (Maybe Text -> ResultConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EncryptionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EncryptionConfiguration")
Parser (Maybe Text -> ResultConfiguration)
-> Parser (Maybe Text) -> Parser ResultConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutputLocation")
)
instance Prelude.Hashable ResultConfiguration
instance Prelude.NFData ResultConfiguration
instance Core.ToJSON ResultConfiguration where
toJSON :: ResultConfiguration -> Value
toJSON ResultConfiguration' {Maybe Text
Maybe EncryptionConfiguration
outputLocation :: Maybe Text
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:outputLocation:ResultConfiguration' :: ResultConfiguration -> Maybe Text
$sel:encryptionConfiguration:ResultConfiguration' :: ResultConfiguration -> Maybe EncryptionConfiguration
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EncryptionConfiguration" Text -> EncryptionConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EncryptionConfiguration -> Pair)
-> Maybe EncryptionConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionConfiguration
encryptionConfiguration,
(Text
"OutputLocation" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
outputLocation
]
)