{-# 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.Glue.Types.S3ParquetSource
-- 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.Glue.Types.S3ParquetSource where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.GlueSchema
import Amazonka.Glue.Types.ParquetCompressionType
import Amazonka.Glue.Types.S3DirectSourceAdditionalOptions
import qualified Amazonka.Prelude as Prelude

-- | Specifies an Apache Parquet data store stored in Amazon S3.
--
-- /See:/ 'newS3ParquetSource' smart constructor.
data S3ParquetSource = S3ParquetSource'
  { -- | Specifies additional connection options.
    S3ParquetSource -> Maybe S3DirectSourceAdditionalOptions
additionalOptions :: Prelude.Maybe S3DirectSourceAdditionalOptions,
    -- | Specifies how the data is compressed. This is generally not necessary if
    -- the data has a standard file extension. Possible values are @\"gzip\"@
    -- and @\"bzip\"@).
    S3ParquetSource -> Maybe ParquetCompressionType
compressionType :: Prelude.Maybe ParquetCompressionType,
    -- | A string containing a JSON list of Unix-style glob patterns to exclude.
    -- For example, \"[\\\"**.pdf\\\"]\" excludes all PDF files.
    S3ParquetSource -> Maybe [Text]
exclusions :: Prelude.Maybe [Prelude.Text],
    -- | Grouping files is turned on by default when the input contains more than
    -- 50,000 files. To turn on grouping with fewer than 50,000 files, set this
    -- parameter to \"inPartition\". To disable grouping when there are more
    -- than 50,000 files, set this parameter to @\"none\"@.
    S3ParquetSource -> Maybe Text
groupFiles :: Prelude.Maybe Prelude.Text,
    -- | The target group size in bytes. The default is computed based on the
    -- input data size and the size of your cluster. When there are fewer than
    -- 50,000 input files, @\"groupFiles\"@ must be set to @\"inPartition\"@
    -- for this to take effect.
    S3ParquetSource -> Maybe Text
groupSize :: Prelude.Maybe Prelude.Text,
    -- | This option controls the duration in milliseconds after which the s3
    -- listing is likely to be consistent. Files with modification timestamps
    -- falling within the last maxBand milliseconds are tracked specially when
    -- using JobBookmarks to account for Amazon S3 eventual consistency. Most
    -- users don\'t need to set this option. The default is 900000
    -- milliseconds, or 15 minutes.
    S3ParquetSource -> Maybe Natural
maxBand :: Prelude.Maybe Prelude.Natural,
    -- | This option specifies the maximum number of files to save from the last
    -- maxBand seconds. If this number is exceeded, extra files are skipped and
    -- only processed in the next job run.
    S3ParquetSource -> Maybe Natural
maxFilesInBand :: Prelude.Maybe Prelude.Natural,
    -- | Specifies the data schema for the S3 Parquet source.
    S3ParquetSource -> Maybe [GlueSchema]
outputSchemas :: Prelude.Maybe [GlueSchema],
    -- | If set to true, recursively reads files in all subdirectories under the
    -- specified paths.
    S3ParquetSource -> Maybe Bool
recurse :: Prelude.Maybe Prelude.Bool,
    -- | The name of the data store.
    S3ParquetSource -> Text
name :: Prelude.Text,
    -- | A list of the Amazon S3 paths to read from.
    S3ParquetSource -> [Text]
paths :: [Prelude.Text]
  }
  deriving (S3ParquetSource -> S3ParquetSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ParquetSource -> S3ParquetSource -> Bool
$c/= :: S3ParquetSource -> S3ParquetSource -> Bool
== :: S3ParquetSource -> S3ParquetSource -> Bool
$c== :: S3ParquetSource -> S3ParquetSource -> Bool
Prelude.Eq, ReadPrec [S3ParquetSource]
ReadPrec S3ParquetSource
Int -> ReadS S3ParquetSource
ReadS [S3ParquetSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ParquetSource]
$creadListPrec :: ReadPrec [S3ParquetSource]
readPrec :: ReadPrec S3ParquetSource
$creadPrec :: ReadPrec S3ParquetSource
readList :: ReadS [S3ParquetSource]
$creadList :: ReadS [S3ParquetSource]
readsPrec :: Int -> ReadS S3ParquetSource
$creadsPrec :: Int -> ReadS S3ParquetSource
Prelude.Read, Int -> S3ParquetSource -> ShowS
[S3ParquetSource] -> ShowS
S3ParquetSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ParquetSource] -> ShowS
$cshowList :: [S3ParquetSource] -> ShowS
show :: S3ParquetSource -> String
$cshow :: S3ParquetSource -> String
showsPrec :: Int -> S3ParquetSource -> ShowS
$cshowsPrec :: Int -> S3ParquetSource -> ShowS
Prelude.Show, forall x. Rep S3ParquetSource x -> S3ParquetSource
forall x. S3ParquetSource -> Rep S3ParquetSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3ParquetSource x -> S3ParquetSource
$cfrom :: forall x. S3ParquetSource -> Rep S3ParquetSource x
Prelude.Generic)

-- |
-- Create a value of 'S3ParquetSource' 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:
--
-- 'additionalOptions', 's3ParquetSource_additionalOptions' - Specifies additional connection options.
--
-- 'compressionType', 's3ParquetSource_compressionType' - Specifies how the data is compressed. This is generally not necessary if
-- the data has a standard file extension. Possible values are @\"gzip\"@
-- and @\"bzip\"@).
--
-- 'exclusions', 's3ParquetSource_exclusions' - A string containing a JSON list of Unix-style glob patterns to exclude.
-- For example, \"[\\\"**.pdf\\\"]\" excludes all PDF files.
--
-- 'groupFiles', 's3ParquetSource_groupFiles' - Grouping files is turned on by default when the input contains more than
-- 50,000 files. To turn on grouping with fewer than 50,000 files, set this
-- parameter to \"inPartition\". To disable grouping when there are more
-- than 50,000 files, set this parameter to @\"none\"@.
--
-- 'groupSize', 's3ParquetSource_groupSize' - The target group size in bytes. The default is computed based on the
-- input data size and the size of your cluster. When there are fewer than
-- 50,000 input files, @\"groupFiles\"@ must be set to @\"inPartition\"@
-- for this to take effect.
--
-- 'maxBand', 's3ParquetSource_maxBand' - This option controls the duration in milliseconds after which the s3
-- listing is likely to be consistent. Files with modification timestamps
-- falling within the last maxBand milliseconds are tracked specially when
-- using JobBookmarks to account for Amazon S3 eventual consistency. Most
-- users don\'t need to set this option. The default is 900000
-- milliseconds, or 15 minutes.
--
-- 'maxFilesInBand', 's3ParquetSource_maxFilesInBand' - This option specifies the maximum number of files to save from the last
-- maxBand seconds. If this number is exceeded, extra files are skipped and
-- only processed in the next job run.
--
-- 'outputSchemas', 's3ParquetSource_outputSchemas' - Specifies the data schema for the S3 Parquet source.
--
-- 'recurse', 's3ParquetSource_recurse' - If set to true, recursively reads files in all subdirectories under the
-- specified paths.
--
-- 'name', 's3ParquetSource_name' - The name of the data store.
--
-- 'paths', 's3ParquetSource_paths' - A list of the Amazon S3 paths to read from.
newS3ParquetSource ::
  -- | 'name'
  Prelude.Text ->
  S3ParquetSource
newS3ParquetSource :: Text -> S3ParquetSource
newS3ParquetSource Text
pName_ =
  S3ParquetSource'
    { $sel:additionalOptions:S3ParquetSource' :: Maybe S3DirectSourceAdditionalOptions
additionalOptions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:compressionType:S3ParquetSource' :: Maybe ParquetCompressionType
compressionType = forall a. Maybe a
Prelude.Nothing,
      $sel:exclusions:S3ParquetSource' :: Maybe [Text]
exclusions = forall a. Maybe a
Prelude.Nothing,
      $sel:groupFiles:S3ParquetSource' :: Maybe Text
groupFiles = forall a. Maybe a
Prelude.Nothing,
      $sel:groupSize:S3ParquetSource' :: Maybe Text
groupSize = forall a. Maybe a
Prelude.Nothing,
      $sel:maxBand:S3ParquetSource' :: Maybe Natural
maxBand = forall a. Maybe a
Prelude.Nothing,
      $sel:maxFilesInBand:S3ParquetSource' :: Maybe Natural
maxFilesInBand = forall a. Maybe a
Prelude.Nothing,
      $sel:outputSchemas:S3ParquetSource' :: Maybe [GlueSchema]
outputSchemas = forall a. Maybe a
Prelude.Nothing,
      $sel:recurse:S3ParquetSource' :: Maybe Bool
recurse = forall a. Maybe a
Prelude.Nothing,
      $sel:name:S3ParquetSource' :: Text
name = Text
pName_,
      $sel:paths:S3ParquetSource' :: [Text]
paths = forall a. Monoid a => a
Prelude.mempty
    }

-- | Specifies additional connection options.
s3ParquetSource_additionalOptions :: Lens.Lens' S3ParquetSource (Prelude.Maybe S3DirectSourceAdditionalOptions)
s3ParquetSource_additionalOptions :: Lens' S3ParquetSource (Maybe S3DirectSourceAdditionalOptions)
s3ParquetSource_additionalOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe S3DirectSourceAdditionalOptions
additionalOptions :: Maybe S3DirectSourceAdditionalOptions
$sel:additionalOptions:S3ParquetSource' :: S3ParquetSource -> Maybe S3DirectSourceAdditionalOptions
additionalOptions} -> Maybe S3DirectSourceAdditionalOptions
additionalOptions) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe S3DirectSourceAdditionalOptions
a -> S3ParquetSource
s {$sel:additionalOptions:S3ParquetSource' :: Maybe S3DirectSourceAdditionalOptions
additionalOptions = Maybe S3DirectSourceAdditionalOptions
a} :: S3ParquetSource)

-- | Specifies how the data is compressed. This is generally not necessary if
-- the data has a standard file extension. Possible values are @\"gzip\"@
-- and @\"bzip\"@).
s3ParquetSource_compressionType :: Lens.Lens' S3ParquetSource (Prelude.Maybe ParquetCompressionType)
s3ParquetSource_compressionType :: Lens' S3ParquetSource (Maybe ParquetCompressionType)
s3ParquetSource_compressionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe ParquetCompressionType
compressionType :: Maybe ParquetCompressionType
$sel:compressionType:S3ParquetSource' :: S3ParquetSource -> Maybe ParquetCompressionType
compressionType} -> Maybe ParquetCompressionType
compressionType) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe ParquetCompressionType
a -> S3ParquetSource
s {$sel:compressionType:S3ParquetSource' :: Maybe ParquetCompressionType
compressionType = Maybe ParquetCompressionType
a} :: S3ParquetSource)

-- | A string containing a JSON list of Unix-style glob patterns to exclude.
-- For example, \"[\\\"**.pdf\\\"]\" excludes all PDF files.
s3ParquetSource_exclusions :: Lens.Lens' S3ParquetSource (Prelude.Maybe [Prelude.Text])
s3ParquetSource_exclusions :: Lens' S3ParquetSource (Maybe [Text])
s3ParquetSource_exclusions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe [Text]
exclusions :: Maybe [Text]
$sel:exclusions:S3ParquetSource' :: S3ParquetSource -> Maybe [Text]
exclusions} -> Maybe [Text]
exclusions) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe [Text]
a -> S3ParquetSource
s {$sel:exclusions:S3ParquetSource' :: Maybe [Text]
exclusions = Maybe [Text]
a} :: S3ParquetSource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Grouping files is turned on by default when the input contains more than
-- 50,000 files. To turn on grouping with fewer than 50,000 files, set this
-- parameter to \"inPartition\". To disable grouping when there are more
-- than 50,000 files, set this parameter to @\"none\"@.
s3ParquetSource_groupFiles :: Lens.Lens' S3ParquetSource (Prelude.Maybe Prelude.Text)
s3ParquetSource_groupFiles :: Lens' S3ParquetSource (Maybe Text)
s3ParquetSource_groupFiles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe Text
groupFiles :: Maybe Text
$sel:groupFiles:S3ParquetSource' :: S3ParquetSource -> Maybe Text
groupFiles} -> Maybe Text
groupFiles) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe Text
a -> S3ParquetSource
s {$sel:groupFiles:S3ParquetSource' :: Maybe Text
groupFiles = Maybe Text
a} :: S3ParquetSource)

-- | The target group size in bytes. The default is computed based on the
-- input data size and the size of your cluster. When there are fewer than
-- 50,000 input files, @\"groupFiles\"@ must be set to @\"inPartition\"@
-- for this to take effect.
s3ParquetSource_groupSize :: Lens.Lens' S3ParquetSource (Prelude.Maybe Prelude.Text)
s3ParquetSource_groupSize :: Lens' S3ParquetSource (Maybe Text)
s3ParquetSource_groupSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe Text
groupSize :: Maybe Text
$sel:groupSize:S3ParquetSource' :: S3ParquetSource -> Maybe Text
groupSize} -> Maybe Text
groupSize) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe Text
a -> S3ParquetSource
s {$sel:groupSize:S3ParquetSource' :: Maybe Text
groupSize = Maybe Text
a} :: S3ParquetSource)

-- | This option controls the duration in milliseconds after which the s3
-- listing is likely to be consistent. Files with modification timestamps
-- falling within the last maxBand milliseconds are tracked specially when
-- using JobBookmarks to account for Amazon S3 eventual consistency. Most
-- users don\'t need to set this option. The default is 900000
-- milliseconds, or 15 minutes.
s3ParquetSource_maxBand :: Lens.Lens' S3ParquetSource (Prelude.Maybe Prelude.Natural)
s3ParquetSource_maxBand :: Lens' S3ParquetSource (Maybe Natural)
s3ParquetSource_maxBand = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe Natural
maxBand :: Maybe Natural
$sel:maxBand:S3ParquetSource' :: S3ParquetSource -> Maybe Natural
maxBand} -> Maybe Natural
maxBand) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe Natural
a -> S3ParquetSource
s {$sel:maxBand:S3ParquetSource' :: Maybe Natural
maxBand = Maybe Natural
a} :: S3ParquetSource)

-- | This option specifies the maximum number of files to save from the last
-- maxBand seconds. If this number is exceeded, extra files are skipped and
-- only processed in the next job run.
s3ParquetSource_maxFilesInBand :: Lens.Lens' S3ParquetSource (Prelude.Maybe Prelude.Natural)
s3ParquetSource_maxFilesInBand :: Lens' S3ParquetSource (Maybe Natural)
s3ParquetSource_maxFilesInBand = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe Natural
maxFilesInBand :: Maybe Natural
$sel:maxFilesInBand:S3ParquetSource' :: S3ParquetSource -> Maybe Natural
maxFilesInBand} -> Maybe Natural
maxFilesInBand) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe Natural
a -> S3ParquetSource
s {$sel:maxFilesInBand:S3ParquetSource' :: Maybe Natural
maxFilesInBand = Maybe Natural
a} :: S3ParquetSource)

-- | Specifies the data schema for the S3 Parquet source.
s3ParquetSource_outputSchemas :: Lens.Lens' S3ParquetSource (Prelude.Maybe [GlueSchema])
s3ParquetSource_outputSchemas :: Lens' S3ParquetSource (Maybe [GlueSchema])
s3ParquetSource_outputSchemas = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe [GlueSchema]
outputSchemas :: Maybe [GlueSchema]
$sel:outputSchemas:S3ParquetSource' :: S3ParquetSource -> Maybe [GlueSchema]
outputSchemas} -> Maybe [GlueSchema]
outputSchemas) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe [GlueSchema]
a -> S3ParquetSource
s {$sel:outputSchemas:S3ParquetSource' :: Maybe [GlueSchema]
outputSchemas = Maybe [GlueSchema]
a} :: S3ParquetSource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If set to true, recursively reads files in all subdirectories under the
-- specified paths.
s3ParquetSource_recurse :: Lens.Lens' S3ParquetSource (Prelude.Maybe Prelude.Bool)
s3ParquetSource_recurse :: Lens' S3ParquetSource (Maybe Bool)
s3ParquetSource_recurse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Maybe Bool
recurse :: Maybe Bool
$sel:recurse:S3ParquetSource' :: S3ParquetSource -> Maybe Bool
recurse} -> Maybe Bool
recurse) (\s :: S3ParquetSource
s@S3ParquetSource' {} Maybe Bool
a -> S3ParquetSource
s {$sel:recurse:S3ParquetSource' :: Maybe Bool
recurse = Maybe Bool
a} :: S3ParquetSource)

-- | The name of the data store.
s3ParquetSource_name :: Lens.Lens' S3ParquetSource Prelude.Text
s3ParquetSource_name :: Lens' S3ParquetSource Text
s3ParquetSource_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {Text
name :: Text
$sel:name:S3ParquetSource' :: S3ParquetSource -> Text
name} -> Text
name) (\s :: S3ParquetSource
s@S3ParquetSource' {} Text
a -> S3ParquetSource
s {$sel:name:S3ParquetSource' :: Text
name = Text
a} :: S3ParquetSource)

-- | A list of the Amazon S3 paths to read from.
s3ParquetSource_paths :: Lens.Lens' S3ParquetSource [Prelude.Text]
s3ParquetSource_paths :: Lens' S3ParquetSource [Text]
s3ParquetSource_paths = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ParquetSource' {[Text]
paths :: [Text]
$sel:paths:S3ParquetSource' :: S3ParquetSource -> [Text]
paths} -> [Text]
paths) (\s :: S3ParquetSource
s@S3ParquetSource' {} [Text]
a -> S3ParquetSource
s {$sel:paths:S3ParquetSource' :: [Text]
paths = [Text]
a} :: S3ParquetSource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON S3ParquetSource where
  parseJSON :: Value -> Parser S3ParquetSource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"S3ParquetSource"
      ( \Object
x ->
          Maybe S3DirectSourceAdditionalOptions
-> Maybe ParquetCompressionType
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe [GlueSchema]
-> Maybe Bool
-> Text
-> [Text]
-> S3ParquetSource
S3ParquetSource'
            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
"AdditionalOptions")
            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
"CompressionType")
            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
"Exclusions" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"GroupFiles")
            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
"GroupSize")
            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
"MaxBand")
            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
"MaxFilesInBand")
            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
"OutputSchemas" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"Recurse")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
            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
"Paths" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable S3ParquetSource where
  hashWithSalt :: Int -> S3ParquetSource -> Int
hashWithSalt Int
_salt S3ParquetSource' {[Text]
Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [GlueSchema]
Maybe Text
Maybe ParquetCompressionType
Maybe S3DirectSourceAdditionalOptions
Text
paths :: [Text]
name :: Text
recurse :: Maybe Bool
outputSchemas :: Maybe [GlueSchema]
maxFilesInBand :: Maybe Natural
maxBand :: Maybe Natural
groupSize :: Maybe Text
groupFiles :: Maybe Text
exclusions :: Maybe [Text]
compressionType :: Maybe ParquetCompressionType
additionalOptions :: Maybe S3DirectSourceAdditionalOptions
$sel:paths:S3ParquetSource' :: S3ParquetSource -> [Text]
$sel:name:S3ParquetSource' :: S3ParquetSource -> Text
$sel:recurse:S3ParquetSource' :: S3ParquetSource -> Maybe Bool
$sel:outputSchemas:S3ParquetSource' :: S3ParquetSource -> Maybe [GlueSchema]
$sel:maxFilesInBand:S3ParquetSource' :: S3ParquetSource -> Maybe Natural
$sel:maxBand:S3ParquetSource' :: S3ParquetSource -> Maybe Natural
$sel:groupSize:S3ParquetSource' :: S3ParquetSource -> Maybe Text
$sel:groupFiles:S3ParquetSource' :: S3ParquetSource -> Maybe Text
$sel:exclusions:S3ParquetSource' :: S3ParquetSource -> Maybe [Text]
$sel:compressionType:S3ParquetSource' :: S3ParquetSource -> Maybe ParquetCompressionType
$sel:additionalOptions:S3ParquetSource' :: S3ParquetSource -> Maybe S3DirectSourceAdditionalOptions
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3DirectSourceAdditionalOptions
additionalOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ParquetCompressionType
compressionType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
exclusions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupFiles
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxBand
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxFilesInBand
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [GlueSchema]
outputSchemas
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
recurse
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
paths

instance Prelude.NFData S3ParquetSource where
  rnf :: S3ParquetSource -> ()
rnf S3ParquetSource' {[Text]
Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [GlueSchema]
Maybe Text
Maybe ParquetCompressionType
Maybe S3DirectSourceAdditionalOptions
Text
paths :: [Text]
name :: Text
recurse :: Maybe Bool
outputSchemas :: Maybe [GlueSchema]
maxFilesInBand :: Maybe Natural
maxBand :: Maybe Natural
groupSize :: Maybe Text
groupFiles :: Maybe Text
exclusions :: Maybe [Text]
compressionType :: Maybe ParquetCompressionType
additionalOptions :: Maybe S3DirectSourceAdditionalOptions
$sel:paths:S3ParquetSource' :: S3ParquetSource -> [Text]
$sel:name:S3ParquetSource' :: S3ParquetSource -> Text
$sel:recurse:S3ParquetSource' :: S3ParquetSource -> Maybe Bool
$sel:outputSchemas:S3ParquetSource' :: S3ParquetSource -> Maybe [GlueSchema]
$sel:maxFilesInBand:S3ParquetSource' :: S3ParquetSource -> Maybe Natural
$sel:maxBand:S3ParquetSource' :: S3ParquetSource -> Maybe Natural
$sel:groupSize:S3ParquetSource' :: S3ParquetSource -> Maybe Text
$sel:groupFiles:S3ParquetSource' :: S3ParquetSource -> Maybe Text
$sel:exclusions:S3ParquetSource' :: S3ParquetSource -> Maybe [Text]
$sel:compressionType:S3ParquetSource' :: S3ParquetSource -> Maybe ParquetCompressionType
$sel:additionalOptions:S3ParquetSource' :: S3ParquetSource -> Maybe S3DirectSourceAdditionalOptions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe S3DirectSourceAdditionalOptions
additionalOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ParquetCompressionType
compressionType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
exclusions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupFiles
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxBand
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxFilesInBand
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [GlueSchema]
outputSchemas
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
recurse
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
paths

instance Data.ToJSON S3ParquetSource where
  toJSON :: S3ParquetSource -> Value
toJSON S3ParquetSource' {[Text]
Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [GlueSchema]
Maybe Text
Maybe ParquetCompressionType
Maybe S3DirectSourceAdditionalOptions
Text
paths :: [Text]
name :: Text
recurse :: Maybe Bool
outputSchemas :: Maybe [GlueSchema]
maxFilesInBand :: Maybe Natural
maxBand :: Maybe Natural
groupSize :: Maybe Text
groupFiles :: Maybe Text
exclusions :: Maybe [Text]
compressionType :: Maybe ParquetCompressionType
additionalOptions :: Maybe S3DirectSourceAdditionalOptions
$sel:paths:S3ParquetSource' :: S3ParquetSource -> [Text]
$sel:name:S3ParquetSource' :: S3ParquetSource -> Text
$sel:recurse:S3ParquetSource' :: S3ParquetSource -> Maybe Bool
$sel:outputSchemas:S3ParquetSource' :: S3ParquetSource -> Maybe [GlueSchema]
$sel:maxFilesInBand:S3ParquetSource' :: S3ParquetSource -> Maybe Natural
$sel:maxBand:S3ParquetSource' :: S3ParquetSource -> Maybe Natural
$sel:groupSize:S3ParquetSource' :: S3ParquetSource -> Maybe Text
$sel:groupFiles:S3ParquetSource' :: S3ParquetSource -> Maybe Text
$sel:exclusions:S3ParquetSource' :: S3ParquetSource -> Maybe [Text]
$sel:compressionType:S3ParquetSource' :: S3ParquetSource -> Maybe ParquetCompressionType
$sel:additionalOptions:S3ParquetSource' :: S3ParquetSource -> Maybe S3DirectSourceAdditionalOptions
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AdditionalOptions" 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 S3DirectSourceAdditionalOptions
additionalOptions,
            (Key
"CompressionType" 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 ParquetCompressionType
compressionType,
            (Key
"Exclusions" 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]
exclusions,
            (Key
"GroupFiles" 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
groupFiles,
            (Key
"GroupSize" 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
groupSize,
            (Key
"MaxBand" 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
maxBand,
            (Key
"MaxFilesInBand" 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
maxFilesInBand,
            (Key
"OutputSchemas" 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 [GlueSchema]
outputSchemas,
            (Key
"Recurse" 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
recurse,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just (Key
"Paths" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
paths)
          ]
      )