{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Athena.Types.WorkGroupConfiguration
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The configuration of the workgroup, which includes the location in
-- Amazon S3 where query results are stored, the encryption option, if any,
-- used for query results, whether the Amazon CloudWatch Metrics are
-- enabled for the workgroup and whether workgroup settings override query
-- settings, and the data usage limits for the amount of data scanned per
-- query or per workgroup. The workgroup settings override is specified in
-- @EnforceWorkGroupConfiguration@ (true\/false) in the
-- @WorkGroupConfiguration@. See
-- WorkGroupConfiguration$EnforceWorkGroupConfiguration.
--
-- /See:/ 'newWorkGroupConfiguration' smart constructor.
data WorkGroupConfiguration = WorkGroupConfiguration'
  { -- | The engine version that all queries running on the workgroup use.
    -- Queries on the @AmazonAthenaPreviewFunctionality@ workgroup run on the
    -- preview engine regardless of this setting.
    WorkGroupConfiguration -> Maybe EngineVersion
engineVersion :: Prelude.Maybe EngineVersion,
    -- | If set to @true@, allows members assigned to a workgroup to reference
    -- Amazon S3 Requester Pays buckets in queries. If set to @false@,
    -- workgroup members cannot query data from Requester Pays buckets, and
    -- queries that retrieve data from Requester Pays buckets cause an error.
    -- The default is @false@. For more information about Requester Pays
    -- buckets, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html Requester Pays Buckets>
    -- in the /Amazon Simple Storage Service Developer Guide/.
    WorkGroupConfiguration -> Maybe Bool
requesterPaysEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The configuration for the workgroup, which includes the location in
    -- Amazon S3 where query results are stored and the encryption option, if
    -- any, used for query results. To run the query, you must specify the
    -- query results location using one of the ways: either in the workgroup
    -- using this setting, or for individual queries (client-side), using
    -- ResultConfiguration$OutputLocation. If none of them is set, Athena
    -- issues an error that no output location is provided. For more
    -- information, see
    -- <https://docs.aws.amazon.com/athena/latest/ug/querying.html Query Results>.
    WorkGroupConfiguration -> Maybe ResultConfiguration
resultConfiguration :: Prelude.Maybe ResultConfiguration,
    -- | The upper data usage limit (cutoff) for the amount of bytes a single
    -- query in a workgroup is allowed to scan.
    WorkGroupConfiguration -> Maybe Natural
bytesScannedCutoffPerQuery :: Prelude.Maybe Prelude.Natural,
    -- | If set to \"true\", the settings for the workgroup override client-side
    -- settings. If set to \"false\", client-side settings are used. For more
    -- information, see
    -- <https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html Workgroup Settings Override Client-Side Settings>.
    WorkGroupConfiguration -> Maybe Bool
enforceWorkGroupConfiguration :: Prelude.Maybe Prelude.Bool,
    -- | Indicates that the Amazon CloudWatch metrics are enabled for the
    -- workgroup.
    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)

-- |
-- Create a value of 'WorkGroupConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'engineVersion', 'workGroupConfiguration_engineVersion' - The engine version that all queries running on the workgroup use.
-- Queries on the @AmazonAthenaPreviewFunctionality@ workgroup run on the
-- preview engine regardless of this setting.
--
-- 'requesterPaysEnabled', 'workGroupConfiguration_requesterPaysEnabled' - If set to @true@, allows members assigned to a workgroup to reference
-- Amazon S3 Requester Pays buckets in queries. If set to @false@,
-- workgroup members cannot query data from Requester Pays buckets, and
-- queries that retrieve data from Requester Pays buckets cause an error.
-- The default is @false@. For more information about Requester Pays
-- buckets, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html Requester Pays Buckets>
-- in the /Amazon Simple Storage Service Developer Guide/.
--
-- 'resultConfiguration', 'workGroupConfiguration_resultConfiguration' - The configuration for the workgroup, which includes the location in
-- Amazon S3 where query results are stored and the encryption option, if
-- any, used for query results. To run the query, you must specify the
-- query results location using one of the ways: either in the workgroup
-- using this setting, or for individual queries (client-side), using
-- ResultConfiguration$OutputLocation. If none of them is set, Athena
-- issues an error that no output location is provided. For more
-- information, see
-- <https://docs.aws.amazon.com/athena/latest/ug/querying.html Query Results>.
--
-- 'bytesScannedCutoffPerQuery', 'workGroupConfiguration_bytesScannedCutoffPerQuery' - The upper data usage limit (cutoff) for the amount of bytes a single
-- query in a workgroup is allowed to scan.
--
-- 'enforceWorkGroupConfiguration', 'workGroupConfiguration_enforceWorkGroupConfiguration' - If set to \"true\", the settings for the workgroup override client-side
-- settings. If set to \"false\", client-side settings are used. For more
-- information, see
-- <https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html Workgroup Settings Override Client-Side Settings>.
--
-- 'publishCloudWatchMetricsEnabled', 'workGroupConfiguration_publishCloudWatchMetricsEnabled' - Indicates that the Amazon CloudWatch metrics are enabled for the
-- workgroup.
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
    }

-- | The engine version that all queries running on the workgroup use.
-- Queries on the @AmazonAthenaPreviewFunctionality@ workgroup run on the
-- preview engine regardless of this setting.
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)

-- | If set to @true@, allows members assigned to a workgroup to reference
-- Amazon S3 Requester Pays buckets in queries. If set to @false@,
-- workgroup members cannot query data from Requester Pays buckets, and
-- queries that retrieve data from Requester Pays buckets cause an error.
-- The default is @false@. For more information about Requester Pays
-- buckets, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html Requester Pays Buckets>
-- in the /Amazon Simple Storage Service Developer Guide/.
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)

-- | The configuration for the workgroup, which includes the location in
-- Amazon S3 where query results are stored and the encryption option, if
-- any, used for query results. To run the query, you must specify the
-- query results location using one of the ways: either in the workgroup
-- using this setting, or for individual queries (client-side), using
-- ResultConfiguration$OutputLocation. If none of them is set, Athena
-- issues an error that no output location is provided. For more
-- information, see
-- <https://docs.aws.amazon.com/athena/latest/ug/querying.html Query Results>.
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)

-- | The upper data usage limit (cutoff) for the amount of bytes a single
-- query in a workgroup is allowed to scan.
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)

-- | If set to \"true\", the settings for the workgroup override client-side
-- settings. If set to \"false\", client-side settings are used. For more
-- information, see
-- <https://docs.aws.amazon.com/athena/latest/ug/workgroups-settings-override.html Workgroup Settings Override Client-Side Settings>.
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)

-- | Indicates that the Amazon CloudWatch metrics are enabled for the
-- workgroup.
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
          ]
      )