{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Athena.Types.WorkGroupConfiguration where

import Amazonka.Athena.Types.CustomerContentEncryptionConfiguration
import Amazonka.Athena.Types.EngineVersion
import Amazonka.Athena.Types.ResultConfiguration
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

-- | 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'
  { -- | Specifies a user defined JSON string that is passed to the notebook
    -- engine.
    WorkGroupConfiguration -> Maybe Text
additionalConfiguration :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | Specifies the KMS key that is used to encrypt the user\'s data stores in
    -- Athena.
    WorkGroupConfiguration
-> Maybe CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration :: Prelude.Maybe CustomerContentEncryptionConfiguration,
    -- | 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,
    -- | 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,
    -- | Role used in a notebook session for accessing the user\'s resources.
    WorkGroupConfiguration -> Maybe Text
executionRole :: Prelude.Maybe Prelude.Text,
    -- | Indicates that the Amazon CloudWatch metrics are enabled for the
    -- workgroup.
    WorkGroupConfiguration -> Maybe Bool
publishCloudWatchMetricsEnabled :: Prelude.Maybe Prelude.Bool,
    -- | 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
  }
  deriving (WorkGroupConfiguration -> WorkGroupConfiguration -> Bool
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]
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
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. 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:
--
-- 'additionalConfiguration', 'workGroupConfiguration_additionalConfiguration' - Specifies a user defined JSON string that is passed to the notebook
-- engine.
--
-- 'bytesScannedCutoffPerQuery', 'workGroupConfiguration_bytesScannedCutoffPerQuery' - The upper data usage limit (cutoff) for the amount of bytes a single
-- query in a workgroup is allowed to scan.
--
-- 'customerContentEncryptionConfiguration', 'workGroupConfiguration_customerContentEncryptionConfiguration' - Specifies the KMS key that is used to encrypt the user\'s data stores in
-- Athena.
--
-- '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>.
--
-- '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.
--
-- 'executionRole', 'workGroupConfiguration_executionRole' - Role used in a notebook session for accessing the user\'s resources.
--
-- 'publishCloudWatchMetricsEnabled', 'workGroupConfiguration_publishCloudWatchMetricsEnabled' - Indicates that the Amazon CloudWatch metrics are enabled for the
-- workgroup.
--
-- '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>.
newWorkGroupConfiguration ::
  WorkGroupConfiguration
newWorkGroupConfiguration :: WorkGroupConfiguration
newWorkGroupConfiguration =
  WorkGroupConfiguration'
    { $sel:additionalConfiguration:WorkGroupConfiguration' :: Maybe Text
additionalConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:bytesScannedCutoffPerQuery:WorkGroupConfiguration' :: Maybe Natural
bytesScannedCutoffPerQuery = forall a. Maybe a
Prelude.Nothing,
      $sel:customerContentEncryptionConfiguration:WorkGroupConfiguration' :: Maybe CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enforceWorkGroupConfiguration:WorkGroupConfiguration' :: Maybe Bool
enforceWorkGroupConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:engineVersion:WorkGroupConfiguration' :: Maybe EngineVersion
engineVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:executionRole:WorkGroupConfiguration' :: Maybe Text
executionRole = forall a. Maybe a
Prelude.Nothing,
      $sel:publishCloudWatchMetricsEnabled:WorkGroupConfiguration' :: Maybe Bool
publishCloudWatchMetricsEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:requesterPaysEnabled:WorkGroupConfiguration' :: Maybe Bool
requesterPaysEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:resultConfiguration:WorkGroupConfiguration' :: Maybe ResultConfiguration
resultConfiguration = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies a user defined JSON string that is passed to the notebook
-- engine.
workGroupConfiguration_additionalConfiguration :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe Prelude.Text)
workGroupConfiguration_additionalConfiguration :: Lens' WorkGroupConfiguration (Maybe Text)
workGroupConfiguration_additionalConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe Text
additionalConfiguration :: Maybe Text
$sel:additionalConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Text
additionalConfiguration} -> Maybe Text
additionalConfiguration) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe Text
a -> WorkGroupConfiguration
s {$sel:additionalConfiguration:WorkGroupConfiguration' :: Maybe Text
additionalConfiguration = Maybe Text
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 :: Lens' WorkGroupConfiguration (Maybe Natural)
workGroupConfiguration_bytesScannedCutoffPerQuery = 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)

-- | Specifies the KMS key that is used to encrypt the user\'s data stores in
-- Athena.
workGroupConfiguration_customerContentEncryptionConfiguration :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe CustomerContentEncryptionConfiguration)
workGroupConfiguration_customerContentEncryptionConfiguration :: Lens'
  WorkGroupConfiguration
  (Maybe CustomerContentEncryptionConfiguration)
workGroupConfiguration_customerContentEncryptionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration :: Maybe CustomerContentEncryptionConfiguration
$sel:customerContentEncryptionConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration
-> Maybe CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration} -> Maybe CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe CustomerContentEncryptionConfiguration
a -> WorkGroupConfiguration
s {$sel:customerContentEncryptionConfiguration:WorkGroupConfiguration' :: Maybe CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration = Maybe CustomerContentEncryptionConfiguration
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 :: Lens' WorkGroupConfiguration (Maybe Bool)
workGroupConfiguration_enforceWorkGroupConfiguration = 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)

-- | 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 :: Lens' WorkGroupConfiguration (Maybe EngineVersion)
workGroupConfiguration_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)

-- | Role used in a notebook session for accessing the user\'s resources.
workGroupConfiguration_executionRole :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe Prelude.Text)
workGroupConfiguration_executionRole :: Lens' WorkGroupConfiguration (Maybe Text)
workGroupConfiguration_executionRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroupConfiguration' {Maybe Text
executionRole :: Maybe Text
$sel:executionRole:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Text
executionRole} -> Maybe Text
executionRole) (\s :: WorkGroupConfiguration
s@WorkGroupConfiguration' {} Maybe Text
a -> WorkGroupConfiguration
s {$sel:executionRole:WorkGroupConfiguration' :: Maybe Text
executionRole = Maybe Text
a} :: WorkGroupConfiguration)

-- | Indicates that the Amazon CloudWatch metrics are enabled for the
-- workgroup.
workGroupConfiguration_publishCloudWatchMetricsEnabled :: Lens.Lens' WorkGroupConfiguration (Prelude.Maybe Prelude.Bool)
workGroupConfiguration_publishCloudWatchMetricsEnabled :: Lens' WorkGroupConfiguration (Maybe Bool)
workGroupConfiguration_publishCloudWatchMetricsEnabled = 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)

-- | 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 :: Lens' WorkGroupConfiguration (Maybe Bool)
workGroupConfiguration_requesterPaysEnabled = 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 :: Lens' WorkGroupConfiguration (Maybe ResultConfiguration)
workGroupConfiguration_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)

instance Data.FromJSON WorkGroupConfiguration where
  parseJSON :: Value -> Parser WorkGroupConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkGroupConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe Natural
-> Maybe CustomerContentEncryptionConfiguration
-> Maybe Bool
-> Maybe EngineVersion
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe ResultConfiguration
-> WorkGroupConfiguration
WorkGroupConfiguration'
            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
"AdditionalConfiguration")
            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
"BytesScannedCutoffPerQuery")
            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
"CustomerContentEncryptionConfiguration")
            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
"EnforceWorkGroupConfiguration")
            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
"EngineVersion")
            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
"ExecutionRole")
            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
"PublishCloudWatchMetricsEnabled")
            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
"RequesterPaysEnabled")
            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
"ResultConfiguration")
      )

instance Prelude.Hashable WorkGroupConfiguration where
  hashWithSalt :: Int -> WorkGroupConfiguration -> Int
hashWithSalt Int
_salt WorkGroupConfiguration' {Maybe Bool
Maybe Natural
Maybe Text
Maybe CustomerContentEncryptionConfiguration
Maybe EngineVersion
Maybe ResultConfiguration
resultConfiguration :: Maybe ResultConfiguration
requesterPaysEnabled :: Maybe Bool
publishCloudWatchMetricsEnabled :: Maybe Bool
executionRole :: Maybe Text
engineVersion :: Maybe EngineVersion
enforceWorkGroupConfiguration :: Maybe Bool
customerContentEncryptionConfiguration :: Maybe CustomerContentEncryptionConfiguration
bytesScannedCutoffPerQuery :: Maybe Natural
additionalConfiguration :: Maybe Text
$sel:resultConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe ResultConfiguration
$sel:requesterPaysEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:publishCloudWatchMetricsEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:executionRole:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Text
$sel:engineVersion:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe EngineVersion
$sel:enforceWorkGroupConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:customerContentEncryptionConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration
-> Maybe CustomerContentEncryptionConfiguration
$sel:bytesScannedCutoffPerQuery:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Natural
$sel:additionalConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
additionalConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
bytesScannedCutoffPerQuery
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enforceWorkGroupConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EngineVersion
engineVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
executionRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
publishCloudWatchMetricsEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
requesterPaysEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResultConfiguration
resultConfiguration

instance Prelude.NFData WorkGroupConfiguration where
  rnf :: WorkGroupConfiguration -> ()
rnf WorkGroupConfiguration' {Maybe Bool
Maybe Natural
Maybe Text
Maybe CustomerContentEncryptionConfiguration
Maybe EngineVersion
Maybe ResultConfiguration
resultConfiguration :: Maybe ResultConfiguration
requesterPaysEnabled :: Maybe Bool
publishCloudWatchMetricsEnabled :: Maybe Bool
executionRole :: Maybe Text
engineVersion :: Maybe EngineVersion
enforceWorkGroupConfiguration :: Maybe Bool
customerContentEncryptionConfiguration :: Maybe CustomerContentEncryptionConfiguration
bytesScannedCutoffPerQuery :: Maybe Natural
additionalConfiguration :: Maybe Text
$sel:resultConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe ResultConfiguration
$sel:requesterPaysEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:publishCloudWatchMetricsEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:executionRole:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Text
$sel:engineVersion:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe EngineVersion
$sel:enforceWorkGroupConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:customerContentEncryptionConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration
-> Maybe CustomerContentEncryptionConfiguration
$sel:bytesScannedCutoffPerQuery:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Natural
$sel:additionalConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
additionalConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
bytesScannedCutoffPerQuery
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enforceWorkGroupConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EngineVersion
engineVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
executionRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
publishCloudWatchMetricsEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
requesterPaysEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResultConfiguration
resultConfiguration

instance Data.ToJSON WorkGroupConfiguration where
  toJSON :: WorkGroupConfiguration -> Value
toJSON WorkGroupConfiguration' {Maybe Bool
Maybe Natural
Maybe Text
Maybe CustomerContentEncryptionConfiguration
Maybe EngineVersion
Maybe ResultConfiguration
resultConfiguration :: Maybe ResultConfiguration
requesterPaysEnabled :: Maybe Bool
publishCloudWatchMetricsEnabled :: Maybe Bool
executionRole :: Maybe Text
engineVersion :: Maybe EngineVersion
enforceWorkGroupConfiguration :: Maybe Bool
customerContentEncryptionConfiguration :: Maybe CustomerContentEncryptionConfiguration
bytesScannedCutoffPerQuery :: Maybe Natural
additionalConfiguration :: Maybe Text
$sel:resultConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe ResultConfiguration
$sel:requesterPaysEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:publishCloudWatchMetricsEnabled:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:executionRole:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Text
$sel:engineVersion:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe EngineVersion
$sel:enforceWorkGroupConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Bool
$sel:customerContentEncryptionConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration
-> Maybe CustomerContentEncryptionConfiguration
$sel:bytesScannedCutoffPerQuery:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Natural
$sel:additionalConfiguration:WorkGroupConfiguration' :: WorkGroupConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AdditionalConfiguration" 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
additionalConfiguration,
            (Key
"BytesScannedCutoffPerQuery" 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 Natural
bytesScannedCutoffPerQuery,
            (Key
"CustomerContentEncryptionConfiguration" 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 CustomerContentEncryptionConfiguration
customerContentEncryptionConfiguration,
            (Key
"EnforceWorkGroupConfiguration" 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 Bool
enforceWorkGroupConfiguration,
            (Key
"EngineVersion" 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 EngineVersion
engineVersion,
            (Key
"ExecutionRole" 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
executionRole,
            (Key
"PublishCloudWatchMetricsEnabled" 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 Bool
publishCloudWatchMetricsEnabled,
            (Key
"RequesterPaysEnabled" 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 Bool
requesterPaysEnabled,
            (Key
"ResultConfiguration" 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 ResultConfiguration
resultConfiguration
          ]
      )