{-# 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.ChannelSpecification 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.CompressionType
import Amazonka.SageMaker.Types.TrainingInputMode
data ChannelSpecification = ChannelSpecification'
{
ChannelSpecification -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ChannelSpecification -> Maybe Bool
isRequired :: Prelude.Maybe Prelude.Bool,
ChannelSpecification -> Maybe [CompressionType]
supportedCompressionTypes :: Prelude.Maybe [CompressionType],
ChannelSpecification -> Text
name :: Prelude.Text,
ChannelSpecification -> [Text]
supportedContentTypes :: [Prelude.Text],
ChannelSpecification -> NonEmpty TrainingInputMode
supportedInputModes :: Prelude.NonEmpty TrainingInputMode
}
deriving (ChannelSpecification -> ChannelSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelSpecification -> ChannelSpecification -> Bool
$c/= :: ChannelSpecification -> ChannelSpecification -> Bool
== :: ChannelSpecification -> ChannelSpecification -> Bool
$c== :: ChannelSpecification -> ChannelSpecification -> Bool
Prelude.Eq, ReadPrec [ChannelSpecification]
ReadPrec ChannelSpecification
Int -> ReadS ChannelSpecification
ReadS [ChannelSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelSpecification]
$creadListPrec :: ReadPrec [ChannelSpecification]
readPrec :: ReadPrec ChannelSpecification
$creadPrec :: ReadPrec ChannelSpecification
readList :: ReadS [ChannelSpecification]
$creadList :: ReadS [ChannelSpecification]
readsPrec :: Int -> ReadS ChannelSpecification
$creadsPrec :: Int -> ReadS ChannelSpecification
Prelude.Read, Int -> ChannelSpecification -> ShowS
[ChannelSpecification] -> ShowS
ChannelSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelSpecification] -> ShowS
$cshowList :: [ChannelSpecification] -> ShowS
show :: ChannelSpecification -> String
$cshow :: ChannelSpecification -> String
showsPrec :: Int -> ChannelSpecification -> ShowS
$cshowsPrec :: Int -> ChannelSpecification -> ShowS
Prelude.Show, forall x. Rep ChannelSpecification x -> ChannelSpecification
forall x. ChannelSpecification -> Rep ChannelSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelSpecification x -> ChannelSpecification
$cfrom :: forall x. ChannelSpecification -> Rep ChannelSpecification x
Prelude.Generic)
newChannelSpecification ::
Prelude.Text ->
Prelude.NonEmpty TrainingInputMode ->
ChannelSpecification
newChannelSpecification :: Text -> NonEmpty TrainingInputMode -> ChannelSpecification
newChannelSpecification Text
pName_ NonEmpty TrainingInputMode
pSupportedInputModes_ =
ChannelSpecification'
{ $sel:description:ChannelSpecification' :: Maybe Text
description =
forall a. Maybe a
Prelude.Nothing,
$sel:isRequired:ChannelSpecification' :: Maybe Bool
isRequired = forall a. Maybe a
Prelude.Nothing,
$sel:supportedCompressionTypes:ChannelSpecification' :: Maybe [CompressionType]
supportedCompressionTypes = forall a. Maybe a
Prelude.Nothing,
$sel:name:ChannelSpecification' :: Text
name = Text
pName_,
$sel:supportedContentTypes:ChannelSpecification' :: [Text]
supportedContentTypes = forall a. Monoid a => a
Prelude.mempty,
$sel:supportedInputModes:ChannelSpecification' :: NonEmpty TrainingInputMode
supportedInputModes =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty TrainingInputMode
pSupportedInputModes_
}
channelSpecification_description :: Lens.Lens' ChannelSpecification (Prelude.Maybe Prelude.Text)
channelSpecification_description :: Lens' ChannelSpecification (Maybe Text)
channelSpecification_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSpecification' {Maybe Text
description :: Maybe Text
$sel:description:ChannelSpecification' :: ChannelSpecification -> Maybe Text
description} -> Maybe Text
description) (\s :: ChannelSpecification
s@ChannelSpecification' {} Maybe Text
a -> ChannelSpecification
s {$sel:description:ChannelSpecification' :: Maybe Text
description = Maybe Text
a} :: ChannelSpecification)
channelSpecification_isRequired :: Lens.Lens' ChannelSpecification (Prelude.Maybe Prelude.Bool)
channelSpecification_isRequired :: Lens' ChannelSpecification (Maybe Bool)
channelSpecification_isRequired = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSpecification' {Maybe Bool
isRequired :: Maybe Bool
$sel:isRequired:ChannelSpecification' :: ChannelSpecification -> Maybe Bool
isRequired} -> Maybe Bool
isRequired) (\s :: ChannelSpecification
s@ChannelSpecification' {} Maybe Bool
a -> ChannelSpecification
s {$sel:isRequired:ChannelSpecification' :: Maybe Bool
isRequired = Maybe Bool
a} :: ChannelSpecification)
channelSpecification_supportedCompressionTypes :: Lens.Lens' ChannelSpecification (Prelude.Maybe [CompressionType])
channelSpecification_supportedCompressionTypes :: Lens' ChannelSpecification (Maybe [CompressionType])
channelSpecification_supportedCompressionTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSpecification' {Maybe [CompressionType]
supportedCompressionTypes :: Maybe [CompressionType]
$sel:supportedCompressionTypes:ChannelSpecification' :: ChannelSpecification -> Maybe [CompressionType]
supportedCompressionTypes} -> Maybe [CompressionType]
supportedCompressionTypes) (\s :: ChannelSpecification
s@ChannelSpecification' {} Maybe [CompressionType]
a -> ChannelSpecification
s {$sel:supportedCompressionTypes:ChannelSpecification' :: Maybe [CompressionType]
supportedCompressionTypes = Maybe [CompressionType]
a} :: ChannelSpecification) 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
channelSpecification_name :: Lens.Lens' ChannelSpecification Prelude.Text
channelSpecification_name :: Lens' ChannelSpecification Text
channelSpecification_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSpecification' {Text
name :: Text
$sel:name:ChannelSpecification' :: ChannelSpecification -> Text
name} -> Text
name) (\s :: ChannelSpecification
s@ChannelSpecification' {} Text
a -> ChannelSpecification
s {$sel:name:ChannelSpecification' :: Text
name = Text
a} :: ChannelSpecification)
channelSpecification_supportedContentTypes :: Lens.Lens' ChannelSpecification [Prelude.Text]
channelSpecification_supportedContentTypes :: Lens' ChannelSpecification [Text]
channelSpecification_supportedContentTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSpecification' {[Text]
supportedContentTypes :: [Text]
$sel:supportedContentTypes:ChannelSpecification' :: ChannelSpecification -> [Text]
supportedContentTypes} -> [Text]
supportedContentTypes) (\s :: ChannelSpecification
s@ChannelSpecification' {} [Text]
a -> ChannelSpecification
s {$sel:supportedContentTypes:ChannelSpecification' :: [Text]
supportedContentTypes = [Text]
a} :: ChannelSpecification) 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
channelSpecification_supportedInputModes :: Lens.Lens' ChannelSpecification (Prelude.NonEmpty TrainingInputMode)
channelSpecification_supportedInputModes :: Lens' ChannelSpecification (NonEmpty TrainingInputMode)
channelSpecification_supportedInputModes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSpecification' {NonEmpty TrainingInputMode
supportedInputModes :: NonEmpty TrainingInputMode
$sel:supportedInputModes:ChannelSpecification' :: ChannelSpecification -> NonEmpty TrainingInputMode
supportedInputModes} -> NonEmpty TrainingInputMode
supportedInputModes) (\s :: ChannelSpecification
s@ChannelSpecification' {} NonEmpty TrainingInputMode
a -> ChannelSpecification
s {$sel:supportedInputModes:ChannelSpecification' :: NonEmpty TrainingInputMode
supportedInputModes = NonEmpty TrainingInputMode
a} :: ChannelSpecification) 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 ChannelSpecification where
parseJSON :: Value -> Parser ChannelSpecification
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ChannelSpecification"
( \Object
x ->
Maybe Text
-> Maybe Bool
-> Maybe [CompressionType]
-> Text
-> [Text]
-> NonEmpty TrainingInputMode
-> ChannelSpecification
ChannelSpecification'
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
"Description")
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
"IsRequired")
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
"SupportedCompressionTypes"
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 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
"SupportedContentTypes"
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 a
Data..: Key
"SupportedInputModes")
)
instance Prelude.Hashable ChannelSpecification where
hashWithSalt :: Int -> ChannelSpecification -> Int
hashWithSalt Int
_salt ChannelSpecification' {[Text]
Maybe Bool
Maybe [CompressionType]
Maybe Text
NonEmpty TrainingInputMode
Text
supportedInputModes :: NonEmpty TrainingInputMode
supportedContentTypes :: [Text]
name :: Text
supportedCompressionTypes :: Maybe [CompressionType]
isRequired :: Maybe Bool
description :: Maybe Text
$sel:supportedInputModes:ChannelSpecification' :: ChannelSpecification -> NonEmpty TrainingInputMode
$sel:supportedContentTypes:ChannelSpecification' :: ChannelSpecification -> [Text]
$sel:name:ChannelSpecification' :: ChannelSpecification -> Text
$sel:supportedCompressionTypes:ChannelSpecification' :: ChannelSpecification -> Maybe [CompressionType]
$sel:isRequired:ChannelSpecification' :: ChannelSpecification -> Maybe Bool
$sel:description:ChannelSpecification' :: ChannelSpecification -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isRequired
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CompressionType]
supportedCompressionTypes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
supportedContentTypes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty TrainingInputMode
supportedInputModes
instance Prelude.NFData ChannelSpecification where
rnf :: ChannelSpecification -> ()
rnf ChannelSpecification' {[Text]
Maybe Bool
Maybe [CompressionType]
Maybe Text
NonEmpty TrainingInputMode
Text
supportedInputModes :: NonEmpty TrainingInputMode
supportedContentTypes :: [Text]
name :: Text
supportedCompressionTypes :: Maybe [CompressionType]
isRequired :: Maybe Bool
description :: Maybe Text
$sel:supportedInputModes:ChannelSpecification' :: ChannelSpecification -> NonEmpty TrainingInputMode
$sel:supportedContentTypes:ChannelSpecification' :: ChannelSpecification -> [Text]
$sel:name:ChannelSpecification' :: ChannelSpecification -> Text
$sel:supportedCompressionTypes:ChannelSpecification' :: ChannelSpecification -> Maybe [CompressionType]
$sel:isRequired:ChannelSpecification' :: ChannelSpecification -> Maybe Bool
$sel:description:ChannelSpecification' :: ChannelSpecification -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isRequired
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [CompressionType]
supportedCompressionTypes
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]
supportedContentTypes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty TrainingInputMode
supportedInputModes
instance Data.ToJSON ChannelSpecification where
toJSON :: ChannelSpecification -> Value
toJSON ChannelSpecification' {[Text]
Maybe Bool
Maybe [CompressionType]
Maybe Text
NonEmpty TrainingInputMode
Text
supportedInputModes :: NonEmpty TrainingInputMode
supportedContentTypes :: [Text]
name :: Text
supportedCompressionTypes :: Maybe [CompressionType]
isRequired :: Maybe Bool
description :: Maybe Text
$sel:supportedInputModes:ChannelSpecification' :: ChannelSpecification -> NonEmpty TrainingInputMode
$sel:supportedContentTypes:ChannelSpecification' :: ChannelSpecification -> [Text]
$sel:name:ChannelSpecification' :: ChannelSpecification -> Text
$sel:supportedCompressionTypes:ChannelSpecification' :: ChannelSpecification -> Maybe [CompressionType]
$sel:isRequired:ChannelSpecification' :: ChannelSpecification -> Maybe Bool
$sel:description:ChannelSpecification' :: ChannelSpecification -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Description" 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
description,
(Key
"IsRequired" 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
isRequired,
(Key
"SupportedCompressionTypes" 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]
supportedCompressionTypes,
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
"SupportedContentTypes"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
supportedContentTypes
),
forall a. a -> Maybe a
Prelude.Just
(Key
"SupportedInputModes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty TrainingInputMode
supportedInputModes)
]
)