{-# 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.SageMaker.Types.RedshiftDatasetDefinition
-- 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.SageMaker.Types.RedshiftDatasetDefinition where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.RedshiftResultCompressionType
import Amazonka.SageMaker.Types.RedshiftResultFormat

-- | Configuration for Redshift Dataset Definition input.
--
-- /See:/ 'newRedshiftDatasetDefinition' smart constructor.
data RedshiftDatasetDefinition = RedshiftDatasetDefinition'
  { -- | The Amazon Web Services Key Management Service (Amazon Web Services KMS)
    -- key that Amazon SageMaker uses to encrypt data from a Redshift
    -- execution.
    RedshiftDatasetDefinition -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    RedshiftDatasetDefinition -> Maybe RedshiftResultCompressionType
outputCompression :: Prelude.Maybe RedshiftResultCompressionType,
    RedshiftDatasetDefinition -> Text
clusterId :: Prelude.Text,
    RedshiftDatasetDefinition -> Text
database :: Prelude.Text,
    RedshiftDatasetDefinition -> Text
dbUser :: Prelude.Text,
    RedshiftDatasetDefinition -> Text
queryString :: Prelude.Text,
    -- | The IAM role attached to your Redshift cluster that Amazon SageMaker
    -- uses to generate datasets.
    RedshiftDatasetDefinition -> Text
clusterRoleArn :: Prelude.Text,
    -- | The location in Amazon S3 where the Redshift query results are stored.
    RedshiftDatasetDefinition -> Text
outputS3Uri :: Prelude.Text,
    RedshiftDatasetDefinition -> RedshiftResultFormat
outputFormat :: RedshiftResultFormat
  }
  deriving (RedshiftDatasetDefinition -> RedshiftDatasetDefinition -> Bool
(RedshiftDatasetDefinition -> RedshiftDatasetDefinition -> Bool)
-> (RedshiftDatasetDefinition -> RedshiftDatasetDefinition -> Bool)
-> Eq RedshiftDatasetDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftDatasetDefinition -> RedshiftDatasetDefinition -> Bool
$c/= :: RedshiftDatasetDefinition -> RedshiftDatasetDefinition -> Bool
== :: RedshiftDatasetDefinition -> RedshiftDatasetDefinition -> Bool
$c== :: RedshiftDatasetDefinition -> RedshiftDatasetDefinition -> Bool
Prelude.Eq, ReadPrec [RedshiftDatasetDefinition]
ReadPrec RedshiftDatasetDefinition
Int -> ReadS RedshiftDatasetDefinition
ReadS [RedshiftDatasetDefinition]
(Int -> ReadS RedshiftDatasetDefinition)
-> ReadS [RedshiftDatasetDefinition]
-> ReadPrec RedshiftDatasetDefinition
-> ReadPrec [RedshiftDatasetDefinition]
-> Read RedshiftDatasetDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedshiftDatasetDefinition]
$creadListPrec :: ReadPrec [RedshiftDatasetDefinition]
readPrec :: ReadPrec RedshiftDatasetDefinition
$creadPrec :: ReadPrec RedshiftDatasetDefinition
readList :: ReadS [RedshiftDatasetDefinition]
$creadList :: ReadS [RedshiftDatasetDefinition]
readsPrec :: Int -> ReadS RedshiftDatasetDefinition
$creadsPrec :: Int -> ReadS RedshiftDatasetDefinition
Prelude.Read, Int -> RedshiftDatasetDefinition -> ShowS
[RedshiftDatasetDefinition] -> ShowS
RedshiftDatasetDefinition -> String
(Int -> RedshiftDatasetDefinition -> ShowS)
-> (RedshiftDatasetDefinition -> String)
-> ([RedshiftDatasetDefinition] -> ShowS)
-> Show RedshiftDatasetDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftDatasetDefinition] -> ShowS
$cshowList :: [RedshiftDatasetDefinition] -> ShowS
show :: RedshiftDatasetDefinition -> String
$cshow :: RedshiftDatasetDefinition -> String
showsPrec :: Int -> RedshiftDatasetDefinition -> ShowS
$cshowsPrec :: Int -> RedshiftDatasetDefinition -> ShowS
Prelude.Show, (forall x.
 RedshiftDatasetDefinition -> Rep RedshiftDatasetDefinition x)
-> (forall x.
    Rep RedshiftDatasetDefinition x -> RedshiftDatasetDefinition)
-> Generic RedshiftDatasetDefinition
forall x.
Rep RedshiftDatasetDefinition x -> RedshiftDatasetDefinition
forall x.
RedshiftDatasetDefinition -> Rep RedshiftDatasetDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RedshiftDatasetDefinition x -> RedshiftDatasetDefinition
$cfrom :: forall x.
RedshiftDatasetDefinition -> Rep RedshiftDatasetDefinition x
Prelude.Generic)

-- |
-- Create a value of 'RedshiftDatasetDefinition' 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:
--
-- 'kmsKeyId', 'redshiftDatasetDefinition_kmsKeyId' - The Amazon Web Services Key Management Service (Amazon Web Services KMS)
-- key that Amazon SageMaker uses to encrypt data from a Redshift
-- execution.
--
-- 'outputCompression', 'redshiftDatasetDefinition_outputCompression' - Undocumented member.
--
-- 'clusterId', 'redshiftDatasetDefinition_clusterId' - Undocumented member.
--
-- 'database', 'redshiftDatasetDefinition_database' - Undocumented member.
--
-- 'dbUser', 'redshiftDatasetDefinition_dbUser' - Undocumented member.
--
-- 'queryString', 'redshiftDatasetDefinition_queryString' - Undocumented member.
--
-- 'clusterRoleArn', 'redshiftDatasetDefinition_clusterRoleArn' - The IAM role attached to your Redshift cluster that Amazon SageMaker
-- uses to generate datasets.
--
-- 'outputS3Uri', 'redshiftDatasetDefinition_outputS3Uri' - The location in Amazon S3 where the Redshift query results are stored.
--
-- 'outputFormat', 'redshiftDatasetDefinition_outputFormat' - Undocumented member.
newRedshiftDatasetDefinition ::
  -- | 'clusterId'
  Prelude.Text ->
  -- | 'database'
  Prelude.Text ->
  -- | 'dbUser'
  Prelude.Text ->
  -- | 'queryString'
  Prelude.Text ->
  -- | 'clusterRoleArn'
  Prelude.Text ->
  -- | 'outputS3Uri'
  Prelude.Text ->
  -- | 'outputFormat'
  RedshiftResultFormat ->
  RedshiftDatasetDefinition
newRedshiftDatasetDefinition :: Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> RedshiftResultFormat
-> RedshiftDatasetDefinition
newRedshiftDatasetDefinition
  Text
pClusterId_
  Text
pDatabase_
  Text
pDbUser_
  Text
pQueryString_
  Text
pClusterRoleArn_
  Text
pOutputS3Uri_
  RedshiftResultFormat
pOutputFormat_ =
    RedshiftDatasetDefinition' :: Maybe Text
-> Maybe RedshiftResultCompressionType
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> RedshiftResultFormat
-> RedshiftDatasetDefinition
RedshiftDatasetDefinition'
      { $sel:kmsKeyId:RedshiftDatasetDefinition' :: Maybe Text
kmsKeyId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:outputCompression:RedshiftDatasetDefinition' :: Maybe RedshiftResultCompressionType
outputCompression = Maybe RedshiftResultCompressionType
forall a. Maybe a
Prelude.Nothing,
        $sel:clusterId:RedshiftDatasetDefinition' :: Text
clusterId = Text
pClusterId_,
        $sel:database:RedshiftDatasetDefinition' :: Text
database = Text
pDatabase_,
        $sel:dbUser:RedshiftDatasetDefinition' :: Text
dbUser = Text
pDbUser_,
        $sel:queryString:RedshiftDatasetDefinition' :: Text
queryString = Text
pQueryString_,
        $sel:clusterRoleArn:RedshiftDatasetDefinition' :: Text
clusterRoleArn = Text
pClusterRoleArn_,
        $sel:outputS3Uri:RedshiftDatasetDefinition' :: Text
outputS3Uri = Text
pOutputS3Uri_,
        $sel:outputFormat:RedshiftDatasetDefinition' :: RedshiftResultFormat
outputFormat = RedshiftResultFormat
pOutputFormat_
      }

-- | The Amazon Web Services Key Management Service (Amazon Web Services KMS)
-- key that Amazon SageMaker uses to encrypt data from a Redshift
-- execution.
redshiftDatasetDefinition_kmsKeyId :: Lens.Lens' RedshiftDatasetDefinition (Prelude.Maybe Prelude.Text)
redshiftDatasetDefinition_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_kmsKeyId = (RedshiftDatasetDefinition -> Maybe Text)
-> (RedshiftDatasetDefinition
    -> Maybe Text -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition
     RedshiftDatasetDefinition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} Maybe Text
a -> RedshiftDatasetDefinition
s {$sel:kmsKeyId:RedshiftDatasetDefinition' :: Maybe Text
kmsKeyId = Maybe Text
a} :: RedshiftDatasetDefinition)

-- | Undocumented member.
redshiftDatasetDefinition_outputCompression :: Lens.Lens' RedshiftDatasetDefinition (Prelude.Maybe RedshiftResultCompressionType)
redshiftDatasetDefinition_outputCompression :: (Maybe RedshiftResultCompressionType
 -> f (Maybe RedshiftResultCompressionType))
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_outputCompression = (RedshiftDatasetDefinition -> Maybe RedshiftResultCompressionType)
-> (RedshiftDatasetDefinition
    -> Maybe RedshiftResultCompressionType
    -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition
     RedshiftDatasetDefinition
     (Maybe RedshiftResultCompressionType)
     (Maybe RedshiftResultCompressionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {Maybe RedshiftResultCompressionType
outputCompression :: Maybe RedshiftResultCompressionType
$sel:outputCompression:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Maybe RedshiftResultCompressionType
outputCompression} -> Maybe RedshiftResultCompressionType
outputCompression) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} Maybe RedshiftResultCompressionType
a -> RedshiftDatasetDefinition
s {$sel:outputCompression:RedshiftDatasetDefinition' :: Maybe RedshiftResultCompressionType
outputCompression = Maybe RedshiftResultCompressionType
a} :: RedshiftDatasetDefinition)

-- | Undocumented member.
redshiftDatasetDefinition_clusterId :: Lens.Lens' RedshiftDatasetDefinition Prelude.Text
redshiftDatasetDefinition_clusterId :: (Text -> f Text)
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_clusterId = (RedshiftDatasetDefinition -> Text)
-> (RedshiftDatasetDefinition -> Text -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition RedshiftDatasetDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {Text
clusterId :: Text
$sel:clusterId:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
clusterId} -> Text
clusterId) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} Text
a -> RedshiftDatasetDefinition
s {$sel:clusterId:RedshiftDatasetDefinition' :: Text
clusterId = Text
a} :: RedshiftDatasetDefinition)

-- | Undocumented member.
redshiftDatasetDefinition_database :: Lens.Lens' RedshiftDatasetDefinition Prelude.Text
redshiftDatasetDefinition_database :: (Text -> f Text)
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_database = (RedshiftDatasetDefinition -> Text)
-> (RedshiftDatasetDefinition -> Text -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition RedshiftDatasetDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {Text
database :: Text
$sel:database:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
database} -> Text
database) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} Text
a -> RedshiftDatasetDefinition
s {$sel:database:RedshiftDatasetDefinition' :: Text
database = Text
a} :: RedshiftDatasetDefinition)

-- | Undocumented member.
redshiftDatasetDefinition_dbUser :: Lens.Lens' RedshiftDatasetDefinition Prelude.Text
redshiftDatasetDefinition_dbUser :: (Text -> f Text)
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_dbUser = (RedshiftDatasetDefinition -> Text)
-> (RedshiftDatasetDefinition -> Text -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition RedshiftDatasetDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {Text
dbUser :: Text
$sel:dbUser:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
dbUser} -> Text
dbUser) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} Text
a -> RedshiftDatasetDefinition
s {$sel:dbUser:RedshiftDatasetDefinition' :: Text
dbUser = Text
a} :: RedshiftDatasetDefinition)

-- | Undocumented member.
redshiftDatasetDefinition_queryString :: Lens.Lens' RedshiftDatasetDefinition Prelude.Text
redshiftDatasetDefinition_queryString :: (Text -> f Text)
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_queryString = (RedshiftDatasetDefinition -> Text)
-> (RedshiftDatasetDefinition -> Text -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition RedshiftDatasetDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {Text
queryString :: Text
$sel:queryString:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
queryString} -> Text
queryString) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} Text
a -> RedshiftDatasetDefinition
s {$sel:queryString:RedshiftDatasetDefinition' :: Text
queryString = Text
a} :: RedshiftDatasetDefinition)

-- | The IAM role attached to your Redshift cluster that Amazon SageMaker
-- uses to generate datasets.
redshiftDatasetDefinition_clusterRoleArn :: Lens.Lens' RedshiftDatasetDefinition Prelude.Text
redshiftDatasetDefinition_clusterRoleArn :: (Text -> f Text)
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_clusterRoleArn = (RedshiftDatasetDefinition -> Text)
-> (RedshiftDatasetDefinition -> Text -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition RedshiftDatasetDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {Text
clusterRoleArn :: Text
$sel:clusterRoleArn:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
clusterRoleArn} -> Text
clusterRoleArn) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} Text
a -> RedshiftDatasetDefinition
s {$sel:clusterRoleArn:RedshiftDatasetDefinition' :: Text
clusterRoleArn = Text
a} :: RedshiftDatasetDefinition)

-- | The location in Amazon S3 where the Redshift query results are stored.
redshiftDatasetDefinition_outputS3Uri :: Lens.Lens' RedshiftDatasetDefinition Prelude.Text
redshiftDatasetDefinition_outputS3Uri :: (Text -> f Text)
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_outputS3Uri = (RedshiftDatasetDefinition -> Text)
-> (RedshiftDatasetDefinition -> Text -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition RedshiftDatasetDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {Text
outputS3Uri :: Text
$sel:outputS3Uri:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
outputS3Uri} -> Text
outputS3Uri) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} Text
a -> RedshiftDatasetDefinition
s {$sel:outputS3Uri:RedshiftDatasetDefinition' :: Text
outputS3Uri = Text
a} :: RedshiftDatasetDefinition)

-- | Undocumented member.
redshiftDatasetDefinition_outputFormat :: Lens.Lens' RedshiftDatasetDefinition RedshiftResultFormat
redshiftDatasetDefinition_outputFormat :: (RedshiftResultFormat -> f RedshiftResultFormat)
-> RedshiftDatasetDefinition -> f RedshiftDatasetDefinition
redshiftDatasetDefinition_outputFormat = (RedshiftDatasetDefinition -> RedshiftResultFormat)
-> (RedshiftDatasetDefinition
    -> RedshiftResultFormat -> RedshiftDatasetDefinition)
-> Lens
     RedshiftDatasetDefinition
     RedshiftDatasetDefinition
     RedshiftResultFormat
     RedshiftResultFormat
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDatasetDefinition' {RedshiftResultFormat
outputFormat :: RedshiftResultFormat
$sel:outputFormat:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> RedshiftResultFormat
outputFormat} -> RedshiftResultFormat
outputFormat) (\s :: RedshiftDatasetDefinition
s@RedshiftDatasetDefinition' {} RedshiftResultFormat
a -> RedshiftDatasetDefinition
s {$sel:outputFormat:RedshiftDatasetDefinition' :: RedshiftResultFormat
outputFormat = RedshiftResultFormat
a} :: RedshiftDatasetDefinition)

instance Core.FromJSON RedshiftDatasetDefinition where
  parseJSON :: Value -> Parser RedshiftDatasetDefinition
parseJSON =
    String
-> (Object -> Parser RedshiftDatasetDefinition)
-> Value
-> Parser RedshiftDatasetDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RedshiftDatasetDefinition"
      ( \Object
x ->
          Maybe Text
-> Maybe RedshiftResultCompressionType
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> RedshiftResultFormat
-> RedshiftDatasetDefinition
RedshiftDatasetDefinition'
            (Maybe Text
 -> Maybe RedshiftResultCompressionType
 -> Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> RedshiftResultFormat
 -> RedshiftDatasetDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe RedshiftResultCompressionType
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> RedshiftResultFormat
      -> RedshiftDatasetDefinition)
forall (f :: * -> *) a b. Functor 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
"KmsKeyId")
            Parser
  (Maybe RedshiftResultCompressionType
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> RedshiftResultFormat
   -> RedshiftDatasetDefinition)
-> Parser (Maybe RedshiftResultCompressionType)
-> Parser
     (Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> RedshiftResultFormat
      -> RedshiftDatasetDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RedshiftResultCompressionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutputCompression")
            Parser
  (Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> RedshiftResultFormat
   -> RedshiftDatasetDefinition)
-> Parser Text
-> Parser
     (Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> RedshiftResultFormat
      -> RedshiftDatasetDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ClusterId")
            Parser
  (Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> RedshiftResultFormat
   -> RedshiftDatasetDefinition)
-> Parser Text
-> Parser
     (Text
      -> Text
      -> Text
      -> Text
      -> RedshiftResultFormat
      -> RedshiftDatasetDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Database")
            Parser
  (Text
   -> Text
   -> Text
   -> Text
   -> RedshiftResultFormat
   -> RedshiftDatasetDefinition)
-> Parser Text
-> Parser
     (Text
      -> Text
      -> Text
      -> RedshiftResultFormat
      -> RedshiftDatasetDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DbUser")
            Parser
  (Text
   -> Text
   -> Text
   -> RedshiftResultFormat
   -> RedshiftDatasetDefinition)
-> Parser Text
-> Parser
     (Text -> Text -> RedshiftResultFormat -> RedshiftDatasetDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"QueryString")
            Parser
  (Text -> Text -> RedshiftResultFormat -> RedshiftDatasetDefinition)
-> Parser Text
-> Parser
     (Text -> RedshiftResultFormat -> RedshiftDatasetDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ClusterRoleArn")
            Parser (Text -> RedshiftResultFormat -> RedshiftDatasetDefinition)
-> Parser Text
-> Parser (RedshiftResultFormat -> RedshiftDatasetDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OutputS3Uri")
            Parser (RedshiftResultFormat -> RedshiftDatasetDefinition)
-> Parser RedshiftResultFormat -> Parser RedshiftDatasetDefinition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RedshiftResultFormat
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"OutputFormat")
      )

instance Prelude.Hashable RedshiftDatasetDefinition

instance Prelude.NFData RedshiftDatasetDefinition

instance Core.ToJSON RedshiftDatasetDefinition where
  toJSON :: RedshiftDatasetDefinition -> Value
toJSON RedshiftDatasetDefinition' {Maybe Text
Maybe RedshiftResultCompressionType
Text
RedshiftResultFormat
outputFormat :: RedshiftResultFormat
outputS3Uri :: Text
clusterRoleArn :: Text
queryString :: Text
dbUser :: Text
database :: Text
clusterId :: Text
outputCompression :: Maybe RedshiftResultCompressionType
kmsKeyId :: Maybe Text
$sel:outputFormat:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> RedshiftResultFormat
$sel:outputS3Uri:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
$sel:clusterRoleArn:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
$sel:queryString:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
$sel:dbUser:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
$sel:database:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
$sel:clusterId:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Text
$sel:outputCompression:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Maybe RedshiftResultCompressionType
$sel:kmsKeyId:RedshiftDatasetDefinition' :: RedshiftDatasetDefinition -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"KmsKeyId" 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
kmsKeyId,
            (Text
"OutputCompression" Text -> RedshiftResultCompressionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RedshiftResultCompressionType -> Pair)
-> Maybe RedshiftResultCompressionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RedshiftResultCompressionType
outputCompression,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClusterId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Database" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
database),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DbUser" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dbUser),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"QueryString" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
queryString),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ClusterRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterRoleArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OutputS3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
outputS3Uri),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OutputFormat" Text -> RedshiftResultFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RedshiftResultFormat
outputFormat)
          ]
      )