{-# 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.S3DirectSourceAdditionalOptions
-- 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.S3DirectSourceAdditionalOptions where

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

-- | Specifies additional connection options for the Amazon S3 data store.
--
-- /See:/ 'newS3DirectSourceAdditionalOptions' smart constructor.
data S3DirectSourceAdditionalOptions = S3DirectSourceAdditionalOptions'
  { -- | Sets the upper limit for the target number of files that will be
    -- processed.
    S3DirectSourceAdditionalOptions -> Maybe Integer
boundedFiles :: Prelude.Maybe Prelude.Integer,
    -- | Sets the upper limit for the target size of the dataset in bytes that
    -- will be processed.
    S3DirectSourceAdditionalOptions -> Maybe Integer
boundedSize :: Prelude.Maybe Prelude.Integer,
    -- | Sets option to enable a sample path.
    S3DirectSourceAdditionalOptions -> Maybe Bool
enableSamplePath :: Prelude.Maybe Prelude.Bool,
    -- | If enabled, specifies the sample path.
    S3DirectSourceAdditionalOptions -> Maybe Text
samplePath :: Prelude.Maybe Prelude.Text
  }
  deriving (S3DirectSourceAdditionalOptions
-> S3DirectSourceAdditionalOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3DirectSourceAdditionalOptions
-> S3DirectSourceAdditionalOptions -> Bool
$c/= :: S3DirectSourceAdditionalOptions
-> S3DirectSourceAdditionalOptions -> Bool
== :: S3DirectSourceAdditionalOptions
-> S3DirectSourceAdditionalOptions -> Bool
$c== :: S3DirectSourceAdditionalOptions
-> S3DirectSourceAdditionalOptions -> Bool
Prelude.Eq, ReadPrec [S3DirectSourceAdditionalOptions]
ReadPrec S3DirectSourceAdditionalOptions
Int -> ReadS S3DirectSourceAdditionalOptions
ReadS [S3DirectSourceAdditionalOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3DirectSourceAdditionalOptions]
$creadListPrec :: ReadPrec [S3DirectSourceAdditionalOptions]
readPrec :: ReadPrec S3DirectSourceAdditionalOptions
$creadPrec :: ReadPrec S3DirectSourceAdditionalOptions
readList :: ReadS [S3DirectSourceAdditionalOptions]
$creadList :: ReadS [S3DirectSourceAdditionalOptions]
readsPrec :: Int -> ReadS S3DirectSourceAdditionalOptions
$creadsPrec :: Int -> ReadS S3DirectSourceAdditionalOptions
Prelude.Read, Int -> S3DirectSourceAdditionalOptions -> ShowS
[S3DirectSourceAdditionalOptions] -> ShowS
S3DirectSourceAdditionalOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3DirectSourceAdditionalOptions] -> ShowS
$cshowList :: [S3DirectSourceAdditionalOptions] -> ShowS
show :: S3DirectSourceAdditionalOptions -> String
$cshow :: S3DirectSourceAdditionalOptions -> String
showsPrec :: Int -> S3DirectSourceAdditionalOptions -> ShowS
$cshowsPrec :: Int -> S3DirectSourceAdditionalOptions -> ShowS
Prelude.Show, forall x.
Rep S3DirectSourceAdditionalOptions x
-> S3DirectSourceAdditionalOptions
forall x.
S3DirectSourceAdditionalOptions
-> Rep S3DirectSourceAdditionalOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3DirectSourceAdditionalOptions x
-> S3DirectSourceAdditionalOptions
$cfrom :: forall x.
S3DirectSourceAdditionalOptions
-> Rep S3DirectSourceAdditionalOptions x
Prelude.Generic)

-- |
-- Create a value of 'S3DirectSourceAdditionalOptions' 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:
--
-- 'boundedFiles', 's3DirectSourceAdditionalOptions_boundedFiles' - Sets the upper limit for the target number of files that will be
-- processed.
--
-- 'boundedSize', 's3DirectSourceAdditionalOptions_boundedSize' - Sets the upper limit for the target size of the dataset in bytes that
-- will be processed.
--
-- 'enableSamplePath', 's3DirectSourceAdditionalOptions_enableSamplePath' - Sets option to enable a sample path.
--
-- 'samplePath', 's3DirectSourceAdditionalOptions_samplePath' - If enabled, specifies the sample path.
newS3DirectSourceAdditionalOptions ::
  S3DirectSourceAdditionalOptions
newS3DirectSourceAdditionalOptions :: S3DirectSourceAdditionalOptions
newS3DirectSourceAdditionalOptions =
  S3DirectSourceAdditionalOptions'
    { $sel:boundedFiles:S3DirectSourceAdditionalOptions' :: Maybe Integer
boundedFiles =
        forall a. Maybe a
Prelude.Nothing,
      $sel:boundedSize:S3DirectSourceAdditionalOptions' :: Maybe Integer
boundedSize = forall a. Maybe a
Prelude.Nothing,
      $sel:enableSamplePath:S3DirectSourceAdditionalOptions' :: Maybe Bool
enableSamplePath = forall a. Maybe a
Prelude.Nothing,
      $sel:samplePath:S3DirectSourceAdditionalOptions' :: Maybe Text
samplePath = forall a. Maybe a
Prelude.Nothing
    }

-- | Sets the upper limit for the target number of files that will be
-- processed.
s3DirectSourceAdditionalOptions_boundedFiles :: Lens.Lens' S3DirectSourceAdditionalOptions (Prelude.Maybe Prelude.Integer)
s3DirectSourceAdditionalOptions_boundedFiles :: Lens' S3DirectSourceAdditionalOptions (Maybe Integer)
s3DirectSourceAdditionalOptions_boundedFiles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DirectSourceAdditionalOptions' {Maybe Integer
boundedFiles :: Maybe Integer
$sel:boundedFiles:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Integer
boundedFiles} -> Maybe Integer
boundedFiles) (\s :: S3DirectSourceAdditionalOptions
s@S3DirectSourceAdditionalOptions' {} Maybe Integer
a -> S3DirectSourceAdditionalOptions
s {$sel:boundedFiles:S3DirectSourceAdditionalOptions' :: Maybe Integer
boundedFiles = Maybe Integer
a} :: S3DirectSourceAdditionalOptions)

-- | Sets the upper limit for the target size of the dataset in bytes that
-- will be processed.
s3DirectSourceAdditionalOptions_boundedSize :: Lens.Lens' S3DirectSourceAdditionalOptions (Prelude.Maybe Prelude.Integer)
s3DirectSourceAdditionalOptions_boundedSize :: Lens' S3DirectSourceAdditionalOptions (Maybe Integer)
s3DirectSourceAdditionalOptions_boundedSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DirectSourceAdditionalOptions' {Maybe Integer
boundedSize :: Maybe Integer
$sel:boundedSize:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Integer
boundedSize} -> Maybe Integer
boundedSize) (\s :: S3DirectSourceAdditionalOptions
s@S3DirectSourceAdditionalOptions' {} Maybe Integer
a -> S3DirectSourceAdditionalOptions
s {$sel:boundedSize:S3DirectSourceAdditionalOptions' :: Maybe Integer
boundedSize = Maybe Integer
a} :: S3DirectSourceAdditionalOptions)

-- | Sets option to enable a sample path.
s3DirectSourceAdditionalOptions_enableSamplePath :: Lens.Lens' S3DirectSourceAdditionalOptions (Prelude.Maybe Prelude.Bool)
s3DirectSourceAdditionalOptions_enableSamplePath :: Lens' S3DirectSourceAdditionalOptions (Maybe Bool)
s3DirectSourceAdditionalOptions_enableSamplePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DirectSourceAdditionalOptions' {Maybe Bool
enableSamplePath :: Maybe Bool
$sel:enableSamplePath:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Bool
enableSamplePath} -> Maybe Bool
enableSamplePath) (\s :: S3DirectSourceAdditionalOptions
s@S3DirectSourceAdditionalOptions' {} Maybe Bool
a -> S3DirectSourceAdditionalOptions
s {$sel:enableSamplePath:S3DirectSourceAdditionalOptions' :: Maybe Bool
enableSamplePath = Maybe Bool
a} :: S3DirectSourceAdditionalOptions)

-- | If enabled, specifies the sample path.
s3DirectSourceAdditionalOptions_samplePath :: Lens.Lens' S3DirectSourceAdditionalOptions (Prelude.Maybe Prelude.Text)
s3DirectSourceAdditionalOptions_samplePath :: Lens' S3DirectSourceAdditionalOptions (Maybe Text)
s3DirectSourceAdditionalOptions_samplePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DirectSourceAdditionalOptions' {Maybe Text
samplePath :: Maybe Text
$sel:samplePath:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Text
samplePath} -> Maybe Text
samplePath) (\s :: S3DirectSourceAdditionalOptions
s@S3DirectSourceAdditionalOptions' {} Maybe Text
a -> S3DirectSourceAdditionalOptions
s {$sel:samplePath:S3DirectSourceAdditionalOptions' :: Maybe Text
samplePath = Maybe Text
a} :: S3DirectSourceAdditionalOptions)

instance
  Data.FromJSON
    S3DirectSourceAdditionalOptions
  where
  parseJSON :: Value -> Parser S3DirectSourceAdditionalOptions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"S3DirectSourceAdditionalOptions"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Bool
-> Maybe Text
-> S3DirectSourceAdditionalOptions
S3DirectSourceAdditionalOptions'
            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
"BoundedFiles")
            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
"BoundedSize")
            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
"EnableSamplePath")
            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
"SamplePath")
      )

instance
  Prelude.Hashable
    S3DirectSourceAdditionalOptions
  where
  hashWithSalt :: Int -> S3DirectSourceAdditionalOptions -> Int
hashWithSalt
    Int
_salt
    S3DirectSourceAdditionalOptions' {Maybe Bool
Maybe Integer
Maybe Text
samplePath :: Maybe Text
enableSamplePath :: Maybe Bool
boundedSize :: Maybe Integer
boundedFiles :: Maybe Integer
$sel:samplePath:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Text
$sel:enableSamplePath:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Bool
$sel:boundedSize:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Integer
$sel:boundedFiles:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Integer
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
boundedFiles
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
boundedSize
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enableSamplePath
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
samplePath

instance
  Prelude.NFData
    S3DirectSourceAdditionalOptions
  where
  rnf :: S3DirectSourceAdditionalOptions -> ()
rnf S3DirectSourceAdditionalOptions' {Maybe Bool
Maybe Integer
Maybe Text
samplePath :: Maybe Text
enableSamplePath :: Maybe Bool
boundedSize :: Maybe Integer
boundedFiles :: Maybe Integer
$sel:samplePath:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Text
$sel:enableSamplePath:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Bool
$sel:boundedSize:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Integer
$sel:boundedFiles:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
boundedFiles
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
boundedSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enableSamplePath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
samplePath

instance Data.ToJSON S3DirectSourceAdditionalOptions where
  toJSON :: S3DirectSourceAdditionalOptions -> Value
toJSON S3DirectSourceAdditionalOptions' {Maybe Bool
Maybe Integer
Maybe Text
samplePath :: Maybe Text
enableSamplePath :: Maybe Bool
boundedSize :: Maybe Integer
boundedFiles :: Maybe Integer
$sel:samplePath:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Text
$sel:enableSamplePath:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Bool
$sel:boundedSize:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Integer
$sel:boundedFiles:S3DirectSourceAdditionalOptions' :: S3DirectSourceAdditionalOptions -> Maybe Integer
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BoundedFiles" 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 Integer
boundedFiles,
            (Key
"BoundedSize" 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 Integer
boundedSize,
            (Key
"EnableSamplePath" 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
enableSamplePath,
            (Key
"SamplePath" 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
samplePath
          ]
      )