{-# 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.WorkGroupConfiguration where
import Amazonka.Athena.Types.EngineVersion
import Amazonka.Athena.Types.ResultConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data WorkGroupConfiguration = WorkGroupConfiguration'
{
WorkGroupConfiguration -> Maybe EngineVersion
engineVersion :: Prelude.Maybe EngineVersion,
WorkGroupConfiguration -> Maybe Bool
requesterPaysEnabled :: Prelude.Maybe Prelude.Bool,
WorkGroupConfiguration -> Maybe ResultConfiguration
resultConfiguration :: Prelude.Maybe ResultConfiguration,
WorkGroupConfiguration -> Maybe Natural
bytesScannedCutoffPerQuery :: Prelude.Maybe Prelude.Natural,
WorkGroupConfiguration -> Maybe Bool
enforceWorkGroupConfiguration :: Prelude.Maybe Prelude.Bool,
WorkGroupConfiguration -> Maybe Bool
publishCloudWatchMetricsEnabled :: Prelude.Maybe Prelude.Bool
}
deriving (WorkGroupConfiguration -> WorkGroupConfiguration -> Bool
(WorkGroupConfiguration -> WorkGroupConfiguration -> Bool)
-> (WorkGroupConfiguration -> WorkGroupConfiguration -> Bool)
-> Eq WorkGroupConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkGroupConfiguration -> WorkGroupConfiguration -> Bool
$c/= :: WorkGroupConfiguration -> WorkGroupConfiguration -> Bool
== :: WorkGroupConfiguration -> WorkGroupConfiguration -> Bool
$c== :: WorkGroupConfiguration -> WorkGroupConfiguration -> Bool
Prelude.Eq, ReadPrec [WorkGroupConfiguration]
ReadPrec WorkGroupConfiguration
Int -> ReadS WorkGroupConfiguration
ReadS [WorkGroupConfiguration]
(Int -> ReadS WorkGroupConfiguration)
-> ReadS [WorkGroupConfiguration]
-> ReadPrec WorkGroupConfiguration
-> ReadPrec [WorkGroupConfiguration]
-> Read WorkGroupConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkGroupConfiguration]
$creadListPrec :: ReadPrec [WorkGroupConfiguration]
readPrec :: ReadPrec WorkGroupConfiguration
$creadPrec :: ReadPrec WorkGroupConfiguration
readList :: ReadS [WorkGroupConfiguration]
$creadList :: ReadS [WorkGroupConfiguration]
readsPrec :: Int -> ReadS WorkGroupConfiguration
$creadsPrec :: Int -> ReadS WorkGroupConfiguration
Prelude.Read, Int -> WorkGroupConfiguration -> ShowS
[WorkGroupConfiguration] -> ShowS
WorkGroupConfiguration -> String
(Int -> WorkGroupConfiguration -> ShowS)
-> (WorkGroupConfiguration -> String)
-> ([WorkGroupConfiguration] -> ShowS)
-> Show WorkGroupConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkGroupConfiguration] -> ShowS
$cshowList :: [WorkGroupConfiguration] -> ShowS
show :: WorkGroupConfiguration -> String
$cshow :: WorkGroupConfiguration -> String
showsPrec :: Int -> WorkGroupConfiguration -> ShowS
$cshowsPrec :: Int -> WorkGroupConfiguration -> ShowS
Prelude.Show, (forall x. WorkGroupConfiguration -> Rep WorkGroupConfiguration x)
-> (forall x.
Rep WorkGroupConfiguration x -> WorkGroupConfiguration)
-> Generic WorkGroupConfiguration
forall x. Rep WorkGroupConfiguration x -> WorkGroupConfiguration
forall x. WorkGroupConfiguration -> Rep WorkGroupConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkGroupConfiguration x -> WorkGroupConfiguration
$cfrom :: forall x. WorkGroupConfiguration -> Rep WorkGroupConfiguration x
Prelude.Generic)
newWorkGroupConfiguration ::
WorkGroupConfiguration
newWorkGroupConfiguration :: WorkGroupConfiguration
newWorkGroupConfiguration =
WorkGroupConfiguration' :: Maybe EngineVersion
-> Maybe Bool
-> Maybe ResultConfiguration
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> WorkGroupConfiguration
WorkGroupConfiguration'
{ $sel:engineVersion:WorkGroupConfiguration' :: Maybe EngineVersion
engineVersion =
Maybe EngineVersion
forall a. Maybe a
Prelude.Nothing,
$sel:requesterPaysEnabled:WorkGroupConfiguration' :: Maybe Bool
requesterPaysEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:resultConfiguration:WorkGroupConfiguration' :: Maybe ResultConfiguration
resultConfiguration = Maybe ResultConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:bytesScannedCutoffPerQuery:WorkGroupConfiguration' :: Maybe Natural
bytesScannedCutoffPerQuery = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:enforceWorkGroupConfiguration:WorkGroupConfiguration' :: Maybe Bool
enforceWorkGroupConfiguration = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:publishCloudWatchMetricsEnabled:WorkGroupConfiguration' :: Maybe Bool
publishCloudWatchMetricsEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
workGroupConfiguration_engineVersion :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe EngineVersion)
workGroupConfiguration_engineVersion :: (Maybe EngineVersion -> f (Maybe EngineVersion))
-> WorkGroupConfiguration -> f WorkGroupConfiguration
workGroupConfiguration_engineVersion = (WorkGroupConfiguration -> Maybe EngineVersion)
-> (WorkGroupConfiguration
-> Maybe EngineVersion -> WorkGroupConfiguration)
-> Lens
WorkGroupConfiguration
WorkGroupConfiguration
(Maybe EngineVersion)
(Maybe EngineVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe EngineVersion
engineVersion :: Maybe EngineVersion
$sel:engineVersion:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe EngineVersion
engineVersion} -> Maybe EngineVersion
engineVersion) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe EngineVersion
a -> WorkGroupConfiguration
s {$sel:engineVersion:WorkGroupConfiguration' :: Maybe EngineVersion
engineVersion = Maybe EngineVersion
a} :: WorkGroupConfiguration)
workGroupConfiguration_requesterPaysEnabled :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe Prelude.Bool)
workGroupConfiguration_requesterPaysEnabled :: (Maybe Bool -> f (Maybe Bool))
-> WorkGroupConfiguration -> f WorkGroupConfiguration
workGroupConfiguration_requesterPaysEnabled = (WorkGroupConfiguration -> Maybe Bool)
-> (WorkGroupConfiguration -> Maybe Bool -> WorkGroupConfiguration)
-> Lens
WorkGroupConfiguration
WorkGroupConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe Bool
requesterPaysEnabled :: Maybe Bool
$sel:requesterPaysEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
requesterPaysEnabled} -> Maybe Bool
requesterPaysEnabled) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe Bool
a -> WorkGroupConfiguration
s {$sel:requesterPaysEnabled:WorkGroupConfiguration' :: Maybe Bool
requesterPaysEnabled = Maybe Bool
a} :: WorkGroupConfiguration)
workGroupConfiguration_resultConfiguration :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe ResultConfiguration)
workGroupConfiguration_resultConfiguration :: (Maybe ResultConfiguration -> f (Maybe ResultConfiguration))
-> WorkGroupConfiguration -> f WorkGroupConfiguration
workGroupConfiguration_resultConfiguration = (WorkGroupConfiguration -> Maybe ResultConfiguration)
-> (WorkGroupConfiguration
-> Maybe ResultConfiguration -> WorkGroupConfiguration)
-> Lens
WorkGroupConfiguration
WorkGroupConfiguration
(Maybe ResultConfiguration)
(Maybe ResultConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe ResultConfiguration
resultConfiguration :: Maybe ResultConfiguration
$sel:resultConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe ResultConfiguration
resultConfiguration} -> Maybe ResultConfiguration
resultConfiguration) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe ResultConfiguration
a -> WorkGroupConfiguration
s {$sel:resultConfiguration:WorkGroupConfiguration' :: Maybe ResultConfiguration
resultConfiguration = Maybe ResultConfiguration
a} :: WorkGroupConfiguration)
workGroupConfiguration_bytesScannedCutoffPerQuery :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe Prelude.Natural)
workGroupConfiguration_bytesScannedCutoffPerQuery :: (Maybe Natural -> f (Maybe Natural))
-> WorkGroupConfiguration -> f WorkGroupConfiguration
workGroupConfiguration_bytesScannedCutoffPerQuery = (WorkGroupConfiguration -> Maybe Natural)
-> (WorkGroupConfiguration
-> Maybe Natural -> WorkGroupConfiguration)
-> Lens
WorkGroupConfiguration
WorkGroupConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe Natural
bytesScannedCutoffPerQuery :: Maybe Natural
$sel:bytesScannedCutoffPerQuery:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Natural
bytesScannedCutoffPerQuery} -> Maybe Natural
bytesScannedCutoffPerQuery) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe Natural
a -> WorkGroupConfiguration
s {$sel:bytesScannedCutoffPerQuery:WorkGroupConfiguration' :: Maybe Natural
bytesScannedCutoffPerQuery = Maybe Natural
a} :: WorkGroupConfiguration)
workGroupConfiguration_enforceWorkGroupConfiguration :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe Prelude.Bool)
workGroupConfiguration_enforceWorkGroupConfiguration :: (Maybe Bool -> f (Maybe Bool))
-> WorkGroupConfiguration -> f WorkGroupConfiguration
workGroupConfiguration_enforceWorkGroupConfiguration = (WorkGroupConfiguration -> Maybe Bool)
-> (WorkGroupConfiguration -> Maybe Bool -> WorkGroupConfiguration)
-> Lens
WorkGroupConfiguration
WorkGroupConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe Bool
enforceWorkGroupConfiguration :: Maybe Bool
$sel:enforceWorkGroupConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
enforceWorkGroupConfiguration} -> Maybe Bool
enforceWorkGroupConfiguration) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe Bool
a -> WorkGroupConfiguration
s {$sel:enforceWorkGroupConfiguration:WorkGroupConfiguration' :: Maybe Bool
enforceWorkGroupConfiguration = Maybe Bool
a} :: WorkGroupConfiguration)
workGroupConfiguration_publishCloudWatchMetricsEnabled :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe Prelude.Bool)
workGroupConfiguration_publishCloudWatchMetricsEnabled :: (Maybe Bool -> f (Maybe Bool))
-> WorkGroupConfiguration -> f WorkGroupConfiguration
workGroupConfiguration_publishCloudWatchMetricsEnabled = (WorkGroupConfiguration -> Maybe Bool)
-> (WorkGroupConfiguration -> Maybe Bool -> WorkGroupConfiguration)
-> Lens
WorkGroupConfiguration
WorkGroupConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe Bool
publishCloudWatchMetricsEnabled :: Maybe Bool
$sel:publishCloudWatchMetricsEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
publishCloudWatchMetricsEnabled} -> Maybe Bool
publishCloudWatchMetricsEnabled) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe Bool
a -> WorkGroupConfiguration
s {$sel:publishCloudWatchMetricsEnabled:WorkGroupConfiguration' :: Maybe Bool
publishCloudWatchMetricsEnabled = Maybe Bool
a} :: WorkGroupConfiguration)
instance Core.FromJSON WorkGroupConfiguration where
parseJSON :: Value -> Parser WorkGroupConfiguration
parseJSON =
String
-> (Object -> Parser WorkGroupConfiguration)
-> Value
-> Parser WorkGroupConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorkGroupConfiguration"
( \Object
x ->
Maybe EngineVersion
-> Maybe Bool
-> Maybe ResultConfiguration
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> WorkGroupConfiguration
WorkGroupConfiguration'
(Maybe EngineVersion
-> Maybe Bool
-> Maybe ResultConfiguration
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> WorkGroupConfiguration)
-> Parser (Maybe EngineVersion)
-> Parser
(Maybe Bool
-> Maybe ResultConfiguration
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> WorkGroupConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EngineVersion)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EngineVersion")
Parser
(Maybe Bool
-> Maybe ResultConfiguration
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> WorkGroupConfiguration)
-> Parser (Maybe Bool)
-> Parser
(Maybe ResultConfiguration
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> WorkGroupConfiguration)
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
"RequesterPaysEnabled")
Parser
(Maybe ResultConfiguration
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> WorkGroupConfiguration)
-> Parser (Maybe ResultConfiguration)
-> Parser
(Maybe Natural
-> Maybe Bool -> Maybe Bool -> WorkGroupConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResultConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResultConfiguration")
Parser
(Maybe Natural
-> Maybe Bool -> Maybe Bool -> WorkGroupConfiguration)
-> Parser (Maybe Natural)
-> Parser (Maybe Bool -> Maybe Bool -> WorkGroupConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BytesScannedCutoffPerQuery")
Parser (Maybe Bool -> Maybe Bool -> WorkGroupConfiguration)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> WorkGroupConfiguration)
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
"EnforceWorkGroupConfiguration")
Parser (Maybe Bool -> WorkGroupConfiguration)
-> Parser (Maybe Bool) -> Parser WorkGroupConfiguration
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
"PublishCloudWatchMetricsEnabled")
)
instance Prelude.Hashable WorkGroupConfiguration
instance Prelude.NFData WorkGroupConfiguration
instance Core.ToJSON WorkGroupConfiguration where
toJSON :: WorkGroupConfiguration -> Value
toJSON WorkGroupConfiguration' {Maybe Bool
Maybe Natural
Maybe EngineVersion
Maybe ResultConfiguration
publishCloudWatchMetricsEnabled :: Maybe Bool
enforceWorkGroupConfiguration :: Maybe Bool
bytesScannedCutoffPerQuery :: Maybe Natural
resultConfiguration :: Maybe ResultConfiguration
requesterPaysEnabled :: Maybe Bool
engineVersion :: Maybe EngineVersion
$sel:publishCloudWatchMetricsEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:enforceWorkGroupConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:bytesScannedCutoffPerQuery:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Natural
$sel:resultConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe ResultConfiguration
$sel:requesterPaysEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:engineVersion:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe EngineVersion
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EngineVersion" Text -> EngineVersion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EngineVersion -> Pair) -> Maybe EngineVersion -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EngineVersion
engineVersion,
(Text
"RequesterPaysEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
requesterPaysEnabled,
(Text
"ResultConfiguration" Text -> ResultConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ResultConfiguration -> Pair)
-> Maybe ResultConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResultConfiguration
resultConfiguration,
(Text
"BytesScannedCutoffPerQuery" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
bytesScannedCutoffPerQuery,
(Text
"EnforceWorkGroupConfiguration" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enforceWorkGroupConfiguration,
(Text
"PublishCloudWatchMetricsEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
publishCloudWatchMetricsEnabled
]
)