{-# 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.AutoMLDataSource
-- 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.SageMaker.Types.AutoMLDataSource 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
import Amazonka.SageMaker.Types.AutoMLS3DataSource

-- | The data source for the Autopilot job.
--
-- /See:/ 'newAutoMLDataSource' smart constructor.
data AutoMLDataSource = AutoMLDataSource'
  { -- | The Amazon S3 location of the input data.
    AutoMLDataSource -> AutoMLS3DataSource
s3DataSource :: AutoMLS3DataSource
  }
  deriving (AutoMLDataSource -> AutoMLDataSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoMLDataSource -> AutoMLDataSource -> Bool
$c/= :: AutoMLDataSource -> AutoMLDataSource -> Bool
== :: AutoMLDataSource -> AutoMLDataSource -> Bool
$c== :: AutoMLDataSource -> AutoMLDataSource -> Bool
Prelude.Eq, ReadPrec [AutoMLDataSource]
ReadPrec AutoMLDataSource
Int -> ReadS AutoMLDataSource
ReadS [AutoMLDataSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoMLDataSource]
$creadListPrec :: ReadPrec [AutoMLDataSource]
readPrec :: ReadPrec AutoMLDataSource
$creadPrec :: ReadPrec AutoMLDataSource
readList :: ReadS [AutoMLDataSource]
$creadList :: ReadS [AutoMLDataSource]
readsPrec :: Int -> ReadS AutoMLDataSource
$creadsPrec :: Int -> ReadS AutoMLDataSource
Prelude.Read, Int -> AutoMLDataSource -> ShowS
[AutoMLDataSource] -> ShowS
AutoMLDataSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoMLDataSource] -> ShowS
$cshowList :: [AutoMLDataSource] -> ShowS
show :: AutoMLDataSource -> String
$cshow :: AutoMLDataSource -> String
showsPrec :: Int -> AutoMLDataSource -> ShowS
$cshowsPrec :: Int -> AutoMLDataSource -> ShowS
Prelude.Show, forall x. Rep AutoMLDataSource x -> AutoMLDataSource
forall x. AutoMLDataSource -> Rep AutoMLDataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoMLDataSource x -> AutoMLDataSource
$cfrom :: forall x. AutoMLDataSource -> Rep AutoMLDataSource x
Prelude.Generic)

-- |
-- Create a value of 'AutoMLDataSource' 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:
--
-- 's3DataSource', 'autoMLDataSource_s3DataSource' - The Amazon S3 location of the input data.
newAutoMLDataSource ::
  -- | 's3DataSource'
  AutoMLS3DataSource ->
  AutoMLDataSource
newAutoMLDataSource :: AutoMLS3DataSource -> AutoMLDataSource
newAutoMLDataSource AutoMLS3DataSource
pS3DataSource_ =
  AutoMLDataSource' {$sel:s3DataSource:AutoMLDataSource' :: AutoMLS3DataSource
s3DataSource = AutoMLS3DataSource
pS3DataSource_}

-- | The Amazon S3 location of the input data.
autoMLDataSource_s3DataSource :: Lens.Lens' AutoMLDataSource AutoMLS3DataSource
autoMLDataSource_s3DataSource :: Lens' AutoMLDataSource AutoMLS3DataSource
autoMLDataSource_s3DataSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLDataSource' {AutoMLS3DataSource
s3DataSource :: AutoMLS3DataSource
$sel:s3DataSource:AutoMLDataSource' :: AutoMLDataSource -> AutoMLS3DataSource
s3DataSource} -> AutoMLS3DataSource
s3DataSource) (\s :: AutoMLDataSource
s@AutoMLDataSource' {} AutoMLS3DataSource
a -> AutoMLDataSource
s {$sel:s3DataSource:AutoMLDataSource' :: AutoMLS3DataSource
s3DataSource = AutoMLS3DataSource
a} :: AutoMLDataSource)

instance Data.FromJSON AutoMLDataSource where
  parseJSON :: Value -> Parser AutoMLDataSource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AutoMLDataSource"
      ( \Object
x ->
          AutoMLS3DataSource -> AutoMLDataSource
AutoMLDataSource'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"S3DataSource")
      )

instance Prelude.Hashable AutoMLDataSource where
  hashWithSalt :: Int -> AutoMLDataSource -> Int
hashWithSalt Int
_salt AutoMLDataSource' {AutoMLS3DataSource
s3DataSource :: AutoMLS3DataSource
$sel:s3DataSource:AutoMLDataSource' :: AutoMLDataSource -> AutoMLS3DataSource
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AutoMLS3DataSource
s3DataSource

instance Prelude.NFData AutoMLDataSource where
  rnf :: AutoMLDataSource -> ()
rnf AutoMLDataSource' {AutoMLS3DataSource
s3DataSource :: AutoMLS3DataSource
$sel:s3DataSource:AutoMLDataSource' :: AutoMLDataSource -> AutoMLS3DataSource
..} = forall a. NFData a => a -> ()
Prelude.rnf AutoMLS3DataSource
s3DataSource

instance Data.ToJSON AutoMLDataSource where
  toJSON :: AutoMLDataSource -> Value
toJSON AutoMLDataSource' {AutoMLS3DataSource
s3DataSource :: AutoMLS3DataSource
$sel:s3DataSource:AutoMLDataSource' :: AutoMLDataSource -> AutoMLS3DataSource
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"S3DataSource" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AutoMLS3DataSource
s3DataSource)]
      )