{-# 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.S3DataSource 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.S3DataDistribution
import Amazonka.SageMaker.Types.S3DataType
data S3DataSource = S3DataSource'
{
S3DataSource -> Maybe [Text]
attributeNames :: Prelude.Maybe [Prelude.Text],
S3DataSource -> Maybe [Text]
instanceGroupNames :: Prelude.Maybe [Prelude.Text],
S3DataSource -> Maybe S3DataDistribution
s3DataDistributionType :: Prelude.Maybe S3DataDistribution,
S3DataSource -> S3DataType
s3DataType :: S3DataType,
S3DataSource -> Text
s3Uri :: Prelude.Text
}
deriving (S3DataSource -> S3DataSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3DataSource -> S3DataSource -> Bool
$c/= :: S3DataSource -> S3DataSource -> Bool
== :: S3DataSource -> S3DataSource -> Bool
$c== :: S3DataSource -> S3DataSource -> Bool
Prelude.Eq, ReadPrec [S3DataSource]
ReadPrec S3DataSource
Int -> ReadS S3DataSource
ReadS [S3DataSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3DataSource]
$creadListPrec :: ReadPrec [S3DataSource]
readPrec :: ReadPrec S3DataSource
$creadPrec :: ReadPrec S3DataSource
readList :: ReadS [S3DataSource]
$creadList :: ReadS [S3DataSource]
readsPrec :: Int -> ReadS S3DataSource
$creadsPrec :: Int -> ReadS S3DataSource
Prelude.Read, Int -> S3DataSource -> ShowS
[S3DataSource] -> ShowS
S3DataSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3DataSource] -> ShowS
$cshowList :: [S3DataSource] -> ShowS
show :: S3DataSource -> String
$cshow :: S3DataSource -> String
showsPrec :: Int -> S3DataSource -> ShowS
$cshowsPrec :: Int -> S3DataSource -> ShowS
Prelude.Show, forall x. Rep S3DataSource x -> S3DataSource
forall x. S3DataSource -> Rep S3DataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3DataSource x -> S3DataSource
$cfrom :: forall x. S3DataSource -> Rep S3DataSource x
Prelude.Generic)
newS3DataSource ::
S3DataType ->
Prelude.Text ->
S3DataSource
newS3DataSource :: S3DataType -> Text -> S3DataSource
newS3DataSource S3DataType
pS3DataType_ Text
pS3Uri_ =
S3DataSource'
{ $sel:attributeNames:S3DataSource' :: Maybe [Text]
attributeNames = forall a. Maybe a
Prelude.Nothing,
$sel:instanceGroupNames:S3DataSource' :: Maybe [Text]
instanceGroupNames = forall a. Maybe a
Prelude.Nothing,
$sel:s3DataDistributionType:S3DataSource' :: Maybe S3DataDistribution
s3DataDistributionType = forall a. Maybe a
Prelude.Nothing,
$sel:s3DataType:S3DataSource' :: S3DataType
s3DataType = S3DataType
pS3DataType_,
$sel:s3Uri:S3DataSource' :: Text
s3Uri = Text
pS3Uri_
}
s3DataSource_attributeNames :: Lens.Lens' S3DataSource (Prelude.Maybe [Prelude.Text])
s3DataSource_attributeNames :: Lens' S3DataSource (Maybe [Text])
s3DataSource_attributeNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DataSource' {Maybe [Text]
attributeNames :: Maybe [Text]
$sel:attributeNames:S3DataSource' :: S3DataSource -> Maybe [Text]
attributeNames} -> Maybe [Text]
attributeNames) (\s :: S3DataSource
s@S3DataSource' {} Maybe [Text]
a -> S3DataSource
s {$sel:attributeNames:S3DataSource' :: Maybe [Text]
attributeNames = Maybe [Text]
a} :: S3DataSource) 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
s3DataSource_instanceGroupNames :: Lens.Lens' S3DataSource (Prelude.Maybe [Prelude.Text])
s3DataSource_instanceGroupNames :: Lens' S3DataSource (Maybe [Text])
s3DataSource_instanceGroupNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DataSource' {Maybe [Text]
instanceGroupNames :: Maybe [Text]
$sel:instanceGroupNames:S3DataSource' :: S3DataSource -> Maybe [Text]
instanceGroupNames} -> Maybe [Text]
instanceGroupNames) (\s :: S3DataSource
s@S3DataSource' {} Maybe [Text]
a -> S3DataSource
s {$sel:instanceGroupNames:S3DataSource' :: Maybe [Text]
instanceGroupNames = Maybe [Text]
a} :: S3DataSource) 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
s3DataSource_s3DataDistributionType :: Lens.Lens' S3DataSource (Prelude.Maybe S3DataDistribution)
s3DataSource_s3DataDistributionType :: Lens' S3DataSource (Maybe S3DataDistribution)
s3DataSource_s3DataDistributionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DataSource' {Maybe S3DataDistribution
s3DataDistributionType :: Maybe S3DataDistribution
$sel:s3DataDistributionType:S3DataSource' :: S3DataSource -> Maybe S3DataDistribution
s3DataDistributionType} -> Maybe S3DataDistribution
s3DataDistributionType) (\s :: S3DataSource
s@S3DataSource' {} Maybe S3DataDistribution
a -> S3DataSource
s {$sel:s3DataDistributionType:S3DataSource' :: Maybe S3DataDistribution
s3DataDistributionType = Maybe S3DataDistribution
a} :: S3DataSource)
s3DataSource_s3DataType :: Lens.Lens' S3DataSource S3DataType
s3DataSource_s3DataType :: Lens' S3DataSource S3DataType
s3DataSource_s3DataType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DataSource' {S3DataType
s3DataType :: S3DataType
$sel:s3DataType:S3DataSource' :: S3DataSource -> S3DataType
s3DataType} -> S3DataType
s3DataType) (\s :: S3DataSource
s@S3DataSource' {} S3DataType
a -> S3DataSource
s {$sel:s3DataType:S3DataSource' :: S3DataType
s3DataType = S3DataType
a} :: S3DataSource)
s3DataSource_s3Uri :: Lens.Lens' S3DataSource Prelude.Text
s3DataSource_s3Uri :: Lens' S3DataSource Text
s3DataSource_s3Uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DataSource' {Text
s3Uri :: Text
$sel:s3Uri:S3DataSource' :: S3DataSource -> Text
s3Uri} -> Text
s3Uri) (\s :: S3DataSource
s@S3DataSource' {} Text
a -> S3DataSource
s {$sel:s3Uri:S3DataSource' :: Text
s3Uri = Text
a} :: S3DataSource)
instance Data.FromJSON S3DataSource where
parseJSON :: Value -> Parser S3DataSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"S3DataSource"
( \Object
x ->
Maybe [Text]
-> Maybe [Text]
-> Maybe S3DataDistribution
-> S3DataType
-> Text
-> S3DataSource
S3DataSource'
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
"AttributeNames" 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
"InstanceGroupNames"
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
"S3DataDistributionType")
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
"S3DataType")
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
"S3Uri")
)
instance Prelude.Hashable S3DataSource where
hashWithSalt :: Int -> S3DataSource -> Int
hashWithSalt Int
_salt S3DataSource' {Maybe [Text]
Maybe S3DataDistribution
Text
S3DataType
s3Uri :: Text
s3DataType :: S3DataType
s3DataDistributionType :: Maybe S3DataDistribution
instanceGroupNames :: Maybe [Text]
attributeNames :: Maybe [Text]
$sel:s3Uri:S3DataSource' :: S3DataSource -> Text
$sel:s3DataType:S3DataSource' :: S3DataSource -> S3DataType
$sel:s3DataDistributionType:S3DataSource' :: S3DataSource -> Maybe S3DataDistribution
$sel:instanceGroupNames:S3DataSource' :: S3DataSource -> Maybe [Text]
$sel:attributeNames:S3DataSource' :: S3DataSource -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
attributeNames
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
instanceGroupNames
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3DataDistribution
s3DataDistributionType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3DataType
s3DataType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3Uri
instance Prelude.NFData S3DataSource where
rnf :: S3DataSource -> ()
rnf S3DataSource' {Maybe [Text]
Maybe S3DataDistribution
Text
S3DataType
s3Uri :: Text
s3DataType :: S3DataType
s3DataDistributionType :: Maybe S3DataDistribution
instanceGroupNames :: Maybe [Text]
attributeNames :: Maybe [Text]
$sel:s3Uri:S3DataSource' :: S3DataSource -> Text
$sel:s3DataType:S3DataSource' :: S3DataSource -> S3DataType
$sel:s3DataDistributionType:S3DataSource' :: S3DataSource -> Maybe S3DataDistribution
$sel:instanceGroupNames:S3DataSource' :: S3DataSource -> Maybe [Text]
$sel:attributeNames:S3DataSource' :: S3DataSource -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
attributeNames
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
instanceGroupNames
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3DataDistribution
s3DataDistributionType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf S3DataType
s3DataType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
s3Uri
instance Data.ToJSON S3DataSource where
toJSON :: S3DataSource -> Value
toJSON S3DataSource' {Maybe [Text]
Maybe S3DataDistribution
Text
S3DataType
s3Uri :: Text
s3DataType :: S3DataType
s3DataDistributionType :: Maybe S3DataDistribution
instanceGroupNames :: Maybe [Text]
attributeNames :: Maybe [Text]
$sel:s3Uri:S3DataSource' :: S3DataSource -> Text
$sel:s3DataType:S3DataSource' :: S3DataSource -> S3DataType
$sel:s3DataDistributionType:S3DataSource' :: S3DataSource -> Maybe S3DataDistribution
$sel:instanceGroupNames:S3DataSource' :: S3DataSource -> Maybe [Text]
$sel:attributeNames:S3DataSource' :: S3DataSource -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AttributeNames" 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]
attributeNames,
(Key
"InstanceGroupNames" 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]
instanceGroupNames,
(Key
"S3DataDistributionType" 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 S3DataDistribution
s3DataDistributionType,
forall a. a -> Maybe a
Prelude.Just (Key
"S3DataType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3DataType
s3DataType),
forall a. a -> Maybe a
Prelude.Just (Key
"S3Uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
s3Uri)
]
)