{-# 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 #-}
module Amazonka.SageMaker.Types.AutoMLChannel 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.AutoMLChannelType
import Amazonka.SageMaker.Types.AutoMLDataSource
import Amazonka.SageMaker.Types.CompressionType
data AutoMLChannel = AutoMLChannel'
{
AutoMLChannel -> Maybe AutoMLChannelType
channelType :: Prelude.Maybe AutoMLChannelType,
AutoMLChannel -> Maybe CompressionType
compressionType :: Prelude.Maybe CompressionType,
AutoMLChannel -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
AutoMLChannel -> AutoMLDataSource
dataSource :: AutoMLDataSource,
AutoMLChannel -> Text
targetAttributeName :: Prelude.Text
}
deriving (AutoMLChannel -> AutoMLChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoMLChannel -> AutoMLChannel -> Bool
$c/= :: AutoMLChannel -> AutoMLChannel -> Bool
== :: AutoMLChannel -> AutoMLChannel -> Bool
$c== :: AutoMLChannel -> AutoMLChannel -> Bool
Prelude.Eq, ReadPrec [AutoMLChannel]
ReadPrec AutoMLChannel
Int -> ReadS AutoMLChannel
ReadS [AutoMLChannel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoMLChannel]
$creadListPrec :: ReadPrec [AutoMLChannel]
readPrec :: ReadPrec AutoMLChannel
$creadPrec :: ReadPrec AutoMLChannel
readList :: ReadS [AutoMLChannel]
$creadList :: ReadS [AutoMLChannel]
readsPrec :: Int -> ReadS AutoMLChannel
$creadsPrec :: Int -> ReadS AutoMLChannel
Prelude.Read, Int -> AutoMLChannel -> ShowS
[AutoMLChannel] -> ShowS
AutoMLChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoMLChannel] -> ShowS
$cshowList :: [AutoMLChannel] -> ShowS
show :: AutoMLChannel -> String
$cshow :: AutoMLChannel -> String
showsPrec :: Int -> AutoMLChannel -> ShowS
$cshowsPrec :: Int -> AutoMLChannel -> ShowS
Prelude.Show, forall x. Rep AutoMLChannel x -> AutoMLChannel
forall x. AutoMLChannel -> Rep AutoMLChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoMLChannel x -> AutoMLChannel
$cfrom :: forall x. AutoMLChannel -> Rep AutoMLChannel x
Prelude.Generic)
newAutoMLChannel ::
AutoMLDataSource ->
Prelude.Text ->
AutoMLChannel
newAutoMLChannel :: AutoMLDataSource -> Text -> AutoMLChannel
newAutoMLChannel AutoMLDataSource
pDataSource_ Text
pTargetAttributeName_ =
AutoMLChannel'
{ $sel:channelType:AutoMLChannel' :: Maybe AutoMLChannelType
channelType = forall a. Maybe a
Prelude.Nothing,
$sel:compressionType:AutoMLChannel' :: Maybe CompressionType
compressionType = forall a. Maybe a
Prelude.Nothing,
$sel:contentType:AutoMLChannel' :: Maybe Text
contentType = forall a. Maybe a
Prelude.Nothing,
$sel:dataSource:AutoMLChannel' :: AutoMLDataSource
dataSource = AutoMLDataSource
pDataSource_,
$sel:targetAttributeName:AutoMLChannel' :: Text
targetAttributeName = Text
pTargetAttributeName_
}
autoMLChannel_channelType :: Lens.Lens' AutoMLChannel (Prelude.Maybe AutoMLChannelType)
autoMLChannel_channelType :: Lens' AutoMLChannel (Maybe AutoMLChannelType)
autoMLChannel_channelType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLChannel' {Maybe AutoMLChannelType
channelType :: Maybe AutoMLChannelType
$sel:channelType:AutoMLChannel' :: AutoMLChannel -> Maybe AutoMLChannelType
channelType} -> Maybe AutoMLChannelType
channelType) (\s :: AutoMLChannel
s@AutoMLChannel' {} Maybe AutoMLChannelType
a -> AutoMLChannel
s {$sel:channelType:AutoMLChannel' :: Maybe AutoMLChannelType
channelType = Maybe AutoMLChannelType
a} :: AutoMLChannel)
autoMLChannel_compressionType :: Lens.Lens' AutoMLChannel (Prelude.Maybe CompressionType)
autoMLChannel_compressionType :: Lens' AutoMLChannel (Maybe CompressionType)
autoMLChannel_compressionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLChannel' {Maybe CompressionType
compressionType :: Maybe CompressionType
$sel:compressionType:AutoMLChannel' :: AutoMLChannel -> Maybe CompressionType
compressionType} -> Maybe CompressionType
compressionType) (\s :: AutoMLChannel
s@AutoMLChannel' {} Maybe CompressionType
a -> AutoMLChannel
s {$sel:compressionType:AutoMLChannel' :: Maybe CompressionType
compressionType = Maybe CompressionType
a} :: AutoMLChannel)
autoMLChannel_contentType :: Lens.Lens' AutoMLChannel (Prelude.Maybe Prelude.Text)
autoMLChannel_contentType :: Lens' AutoMLChannel (Maybe Text)
autoMLChannel_contentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLChannel' {Maybe Text
contentType :: Maybe Text
$sel:contentType:AutoMLChannel' :: AutoMLChannel -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: AutoMLChannel
s@AutoMLChannel' {} Maybe Text
a -> AutoMLChannel
s {$sel:contentType:AutoMLChannel' :: Maybe Text
contentType = Maybe Text
a} :: AutoMLChannel)
autoMLChannel_dataSource :: Lens.Lens' AutoMLChannel AutoMLDataSource
autoMLChannel_dataSource :: Lens' AutoMLChannel AutoMLDataSource
autoMLChannel_dataSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLChannel' {AutoMLDataSource
dataSource :: AutoMLDataSource
$sel:dataSource:AutoMLChannel' :: AutoMLChannel -> AutoMLDataSource
dataSource} -> AutoMLDataSource
dataSource) (\s :: AutoMLChannel
s@AutoMLChannel' {} AutoMLDataSource
a -> AutoMLChannel
s {$sel:dataSource:AutoMLChannel' :: AutoMLDataSource
dataSource = AutoMLDataSource
a} :: AutoMLChannel)
autoMLChannel_targetAttributeName :: Lens.Lens' AutoMLChannel Prelude.Text
autoMLChannel_targetAttributeName :: Lens' AutoMLChannel Text
autoMLChannel_targetAttributeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLChannel' {Text
targetAttributeName :: Text
$sel:targetAttributeName:AutoMLChannel' :: AutoMLChannel -> Text
targetAttributeName} -> Text
targetAttributeName) (\s :: AutoMLChannel
s@AutoMLChannel' {} Text
a -> AutoMLChannel
s {$sel:targetAttributeName:AutoMLChannel' :: Text
targetAttributeName = Text
a} :: AutoMLChannel)
instance Data.FromJSON AutoMLChannel where
parseJSON :: Value -> Parser AutoMLChannel
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AutoMLChannel"
( \Object
x ->
Maybe AutoMLChannelType
-> Maybe CompressionType
-> Maybe Text
-> AutoMLDataSource
-> Text
-> AutoMLChannel
AutoMLChannel'
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
"ChannelType")
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
"ContentType")
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
"DataSource")
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
"TargetAttributeName")
)
instance Prelude.Hashable AutoMLChannel where
hashWithSalt :: Int -> AutoMLChannel -> Int
hashWithSalt Int
_salt AutoMLChannel' {Maybe Text
Maybe AutoMLChannelType
Maybe CompressionType
Text
AutoMLDataSource
targetAttributeName :: Text
dataSource :: AutoMLDataSource
contentType :: Maybe Text
compressionType :: Maybe CompressionType
channelType :: Maybe AutoMLChannelType
$sel:targetAttributeName:AutoMLChannel' :: AutoMLChannel -> Text
$sel:dataSource:AutoMLChannel' :: AutoMLChannel -> AutoMLDataSource
$sel:contentType:AutoMLChannel' :: AutoMLChannel -> Maybe Text
$sel:compressionType:AutoMLChannel' :: AutoMLChannel -> Maybe CompressionType
$sel:channelType:AutoMLChannel' :: AutoMLChannel -> Maybe AutoMLChannelType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoMLChannelType
channelType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CompressionType
compressionType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AutoMLDataSource
dataSource
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
targetAttributeName
instance Prelude.NFData AutoMLChannel where
rnf :: AutoMLChannel -> ()
rnf AutoMLChannel' {Maybe Text
Maybe AutoMLChannelType
Maybe CompressionType
Text
AutoMLDataSource
targetAttributeName :: Text
dataSource :: AutoMLDataSource
contentType :: Maybe Text
compressionType :: Maybe CompressionType
channelType :: Maybe AutoMLChannelType
$sel:targetAttributeName:AutoMLChannel' :: AutoMLChannel -> Text
$sel:dataSource:AutoMLChannel' :: AutoMLChannel -> AutoMLDataSource
$sel:contentType:AutoMLChannel' :: AutoMLChannel -> Maybe Text
$sel:compressionType:AutoMLChannel' :: AutoMLChannel -> Maybe CompressionType
$sel:channelType:AutoMLChannel' :: AutoMLChannel -> Maybe AutoMLChannelType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoMLChannelType
channelType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CompressionType
compressionType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AutoMLDataSource
dataSource
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
targetAttributeName
instance Data.ToJSON AutoMLChannel where
toJSON :: AutoMLChannel -> Value
toJSON AutoMLChannel' {Maybe Text
Maybe AutoMLChannelType
Maybe CompressionType
Text
AutoMLDataSource
targetAttributeName :: Text
dataSource :: AutoMLDataSource
contentType :: Maybe Text
compressionType :: Maybe CompressionType
channelType :: Maybe AutoMLChannelType
$sel:targetAttributeName:AutoMLChannel' :: AutoMLChannel -> Text
$sel:dataSource:AutoMLChannel' :: AutoMLChannel -> AutoMLDataSource
$sel:contentType:AutoMLChannel' :: AutoMLChannel -> Maybe Text
$sel:compressionType:AutoMLChannel' :: AutoMLChannel -> Maybe CompressionType
$sel:channelType:AutoMLChannel' :: AutoMLChannel -> Maybe AutoMLChannelType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ChannelType" 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 AutoMLChannelType
channelType,
(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 CompressionType
compressionType,
(Key
"ContentType" 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
contentType,
forall a. a -> Maybe a
Prelude.Just (Key
"DataSource" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AutoMLDataSource
dataSource),
forall a. a -> Maybe a
Prelude.Just
(Key
"TargetAttributeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
targetAttributeName)
]
)