{-# 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.ShuffleConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ShuffleConfig = ShuffleConfig'
{
ShuffleConfig -> Integer
seed :: Prelude.Integer
}
deriving (ShuffleConfig -> ShuffleConfig -> Bool
(ShuffleConfig -> ShuffleConfig -> Bool)
-> (ShuffleConfig -> ShuffleConfig -> Bool) -> Eq ShuffleConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShuffleConfig -> ShuffleConfig -> Bool
$c/= :: ShuffleConfig -> ShuffleConfig -> Bool
== :: ShuffleConfig -> ShuffleConfig -> Bool
$c== :: ShuffleConfig -> ShuffleConfig -> Bool
Prelude.Eq, ReadPrec [ShuffleConfig]
ReadPrec ShuffleConfig
Int -> ReadS ShuffleConfig
ReadS [ShuffleConfig]
(Int -> ReadS ShuffleConfig)
-> ReadS [ShuffleConfig]
-> ReadPrec ShuffleConfig
-> ReadPrec [ShuffleConfig]
-> Read ShuffleConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShuffleConfig]
$creadListPrec :: ReadPrec [ShuffleConfig]
readPrec :: ReadPrec ShuffleConfig
$creadPrec :: ReadPrec ShuffleConfig
readList :: ReadS [ShuffleConfig]
$creadList :: ReadS [ShuffleConfig]
readsPrec :: Int -> ReadS ShuffleConfig
$creadsPrec :: Int -> ReadS ShuffleConfig
Prelude.Read, Int -> ShuffleConfig -> ShowS
[ShuffleConfig] -> ShowS
ShuffleConfig -> String
(Int -> ShuffleConfig -> ShowS)
-> (ShuffleConfig -> String)
-> ([ShuffleConfig] -> ShowS)
-> Show ShuffleConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShuffleConfig] -> ShowS
$cshowList :: [ShuffleConfig] -> ShowS
show :: ShuffleConfig -> String
$cshow :: ShuffleConfig -> String
showsPrec :: Int -> ShuffleConfig -> ShowS
$cshowsPrec :: Int -> ShuffleConfig -> ShowS
Prelude.Show, (forall x. ShuffleConfig -> Rep ShuffleConfig x)
-> (forall x. Rep ShuffleConfig x -> ShuffleConfig)
-> Generic ShuffleConfig
forall x. Rep ShuffleConfig x -> ShuffleConfig
forall x. ShuffleConfig -> Rep ShuffleConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShuffleConfig x -> ShuffleConfig
$cfrom :: forall x. ShuffleConfig -> Rep ShuffleConfig x
Prelude.Generic)
newShuffleConfig ::
Prelude.Integer ->
ShuffleConfig
newShuffleConfig :: Integer -> ShuffleConfig
newShuffleConfig Integer
pSeed_ =
ShuffleConfig' :: Integer -> ShuffleConfig
ShuffleConfig' {$sel:seed:ShuffleConfig' :: Integer
seed = Integer
pSeed_}
shuffleConfig_seed :: Lens.Lens' ShuffleConfig Prelude.Integer
shuffleConfig_seed :: (Integer -> f Integer) -> ShuffleConfig -> f ShuffleConfig
shuffleConfig_seed = (ShuffleConfig -> Integer)
-> (ShuffleConfig -> Integer -> ShuffleConfig)
-> Lens ShuffleConfig ShuffleConfig Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShuffleConfig' {Integer
seed :: Integer
$sel:seed:ShuffleConfig' :: ShuffleConfig -> Integer
seed} -> Integer
seed) (\s :: ShuffleConfig
s@ShuffleConfig' {} Integer
a -> ShuffleConfig
s {$sel:seed:ShuffleConfig' :: Integer
seed = Integer
a} :: ShuffleConfig)
instance Core.FromJSON ShuffleConfig where
parseJSON :: Value -> Parser ShuffleConfig
parseJSON =
String
-> (Object -> Parser ShuffleConfig)
-> Value
-> Parser ShuffleConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ShuffleConfig"
( \Object
x ->
Integer -> ShuffleConfig
ShuffleConfig' (Integer -> ShuffleConfig)
-> Parser Integer -> Parser ShuffleConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Seed")
)
instance Prelude.Hashable ShuffleConfig
instance Prelude.NFData ShuffleConfig
instance Core.ToJSON ShuffleConfig where
toJSON :: ShuffleConfig -> Value
toJSON ShuffleConfig' {Integer
seed :: Integer
$sel:seed:ShuffleConfig' :: ShuffleConfig -> Integer
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Seed" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Integer
seed)]
)