{-# 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.ProcessingClusterConfig 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.ProcessingInstanceType
data ProcessingClusterConfig = ProcessingClusterConfig'
{
ProcessingClusterConfig -> Maybe Text
volumeKmsKeyId :: Prelude.Maybe Prelude.Text,
ProcessingClusterConfig -> Natural
instanceCount :: Prelude.Natural,
ProcessingClusterConfig -> ProcessingInstanceType
instanceType :: ProcessingInstanceType,
ProcessingClusterConfig -> Natural
volumeSizeInGB :: Prelude.Natural
}
deriving (ProcessingClusterConfig -> ProcessingClusterConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProcessingClusterConfig -> ProcessingClusterConfig -> Bool
$c/= :: ProcessingClusterConfig -> ProcessingClusterConfig -> Bool
== :: ProcessingClusterConfig -> ProcessingClusterConfig -> Bool
$c== :: ProcessingClusterConfig -> ProcessingClusterConfig -> Bool
Prelude.Eq, ReadPrec [ProcessingClusterConfig]
ReadPrec ProcessingClusterConfig
Int -> ReadS ProcessingClusterConfig
ReadS [ProcessingClusterConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProcessingClusterConfig]
$creadListPrec :: ReadPrec [ProcessingClusterConfig]
readPrec :: ReadPrec ProcessingClusterConfig
$creadPrec :: ReadPrec ProcessingClusterConfig
readList :: ReadS [ProcessingClusterConfig]
$creadList :: ReadS [ProcessingClusterConfig]
readsPrec :: Int -> ReadS ProcessingClusterConfig
$creadsPrec :: Int -> ReadS ProcessingClusterConfig
Prelude.Read, Int -> ProcessingClusterConfig -> ShowS
[ProcessingClusterConfig] -> ShowS
ProcessingClusterConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProcessingClusterConfig] -> ShowS
$cshowList :: [ProcessingClusterConfig] -> ShowS
show :: ProcessingClusterConfig -> String
$cshow :: ProcessingClusterConfig -> String
showsPrec :: Int -> ProcessingClusterConfig -> ShowS
$cshowsPrec :: Int -> ProcessingClusterConfig -> ShowS
Prelude.Show, forall x. Rep ProcessingClusterConfig x -> ProcessingClusterConfig
forall x. ProcessingClusterConfig -> Rep ProcessingClusterConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProcessingClusterConfig x -> ProcessingClusterConfig
$cfrom :: forall x. ProcessingClusterConfig -> Rep ProcessingClusterConfig x
Prelude.Generic)
newProcessingClusterConfig ::
Prelude.Natural ->
ProcessingInstanceType ->
Prelude.Natural ->
ProcessingClusterConfig
newProcessingClusterConfig :: Natural
-> ProcessingInstanceType -> Natural -> ProcessingClusterConfig
newProcessingClusterConfig
Natural
pInstanceCount_
ProcessingInstanceType
pInstanceType_
Natural
pVolumeSizeInGB_ =
ProcessingClusterConfig'
{ $sel:volumeKmsKeyId:ProcessingClusterConfig' :: Maybe Text
volumeKmsKeyId =
forall a. Maybe a
Prelude.Nothing,
$sel:instanceCount:ProcessingClusterConfig' :: Natural
instanceCount = Natural
pInstanceCount_,
$sel:instanceType:ProcessingClusterConfig' :: ProcessingInstanceType
instanceType = ProcessingInstanceType
pInstanceType_,
$sel:volumeSizeInGB:ProcessingClusterConfig' :: Natural
volumeSizeInGB = Natural
pVolumeSizeInGB_
}
processingClusterConfig_volumeKmsKeyId :: Lens.Lens' ProcessingClusterConfig (Prelude.Maybe Prelude.Text)
processingClusterConfig_volumeKmsKeyId :: Lens' ProcessingClusterConfig (Maybe Text)
processingClusterConfig_volumeKmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessingClusterConfig' {Maybe Text
volumeKmsKeyId :: Maybe Text
$sel:volumeKmsKeyId:ProcessingClusterConfig' :: ProcessingClusterConfig -> Maybe Text
volumeKmsKeyId} -> Maybe Text
volumeKmsKeyId) (\s :: ProcessingClusterConfig
s@ProcessingClusterConfig' {} Maybe Text
a -> ProcessingClusterConfig
s {$sel:volumeKmsKeyId:ProcessingClusterConfig' :: Maybe Text
volumeKmsKeyId = Maybe Text
a} :: ProcessingClusterConfig)
processingClusterConfig_instanceCount :: Lens.Lens' ProcessingClusterConfig Prelude.Natural
processingClusterConfig_instanceCount :: Lens' ProcessingClusterConfig Natural
processingClusterConfig_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessingClusterConfig' {Natural
instanceCount :: Natural
$sel:instanceCount:ProcessingClusterConfig' :: ProcessingClusterConfig -> Natural
instanceCount} -> Natural
instanceCount) (\s :: ProcessingClusterConfig
s@ProcessingClusterConfig' {} Natural
a -> ProcessingClusterConfig
s {$sel:instanceCount:ProcessingClusterConfig' :: Natural
instanceCount = Natural
a} :: ProcessingClusterConfig)
processingClusterConfig_instanceType :: Lens.Lens' ProcessingClusterConfig ProcessingInstanceType
processingClusterConfig_instanceType :: Lens' ProcessingClusterConfig ProcessingInstanceType
processingClusterConfig_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessingClusterConfig' {ProcessingInstanceType
instanceType :: ProcessingInstanceType
$sel:instanceType:ProcessingClusterConfig' :: ProcessingClusterConfig -> ProcessingInstanceType
instanceType} -> ProcessingInstanceType
instanceType) (\s :: ProcessingClusterConfig
s@ProcessingClusterConfig' {} ProcessingInstanceType
a -> ProcessingClusterConfig
s {$sel:instanceType:ProcessingClusterConfig' :: ProcessingInstanceType
instanceType = ProcessingInstanceType
a} :: ProcessingClusterConfig)
processingClusterConfig_volumeSizeInGB :: Lens.Lens' ProcessingClusterConfig Prelude.Natural
processingClusterConfig_volumeSizeInGB :: Lens' ProcessingClusterConfig Natural
processingClusterConfig_volumeSizeInGB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessingClusterConfig' {Natural
volumeSizeInGB :: Natural
$sel:volumeSizeInGB:ProcessingClusterConfig' :: ProcessingClusterConfig -> Natural
volumeSizeInGB} -> Natural
volumeSizeInGB) (\s :: ProcessingClusterConfig
s@ProcessingClusterConfig' {} Natural
a -> ProcessingClusterConfig
s {$sel:volumeSizeInGB:ProcessingClusterConfig' :: Natural
volumeSizeInGB = Natural
a} :: ProcessingClusterConfig)
instance Data.FromJSON ProcessingClusterConfig where
parseJSON :: Value -> Parser ProcessingClusterConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ProcessingClusterConfig"
( \Object
x ->
Maybe Text
-> Natural
-> ProcessingInstanceType
-> Natural
-> ProcessingClusterConfig
ProcessingClusterConfig'
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
"VolumeKmsKeyId")
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
"InstanceCount")
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
"InstanceType")
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
"VolumeSizeInGB")
)
instance Prelude.Hashable ProcessingClusterConfig where
hashWithSalt :: Int -> ProcessingClusterConfig -> Int
hashWithSalt Int
_salt ProcessingClusterConfig' {Natural
Maybe Text
ProcessingInstanceType
volumeSizeInGB :: Natural
instanceType :: ProcessingInstanceType
instanceCount :: Natural
volumeKmsKeyId :: Maybe Text
$sel:volumeSizeInGB:ProcessingClusterConfig' :: ProcessingClusterConfig -> Natural
$sel:instanceType:ProcessingClusterConfig' :: ProcessingClusterConfig -> ProcessingInstanceType
$sel:instanceCount:ProcessingClusterConfig' :: ProcessingClusterConfig -> Natural
$sel:volumeKmsKeyId:ProcessingClusterConfig' :: ProcessingClusterConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeKmsKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
instanceCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProcessingInstanceType
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
volumeSizeInGB
instance Prelude.NFData ProcessingClusterConfig where
rnf :: ProcessingClusterConfig -> ()
rnf ProcessingClusterConfig' {Natural
Maybe Text
ProcessingInstanceType
volumeSizeInGB :: Natural
instanceType :: ProcessingInstanceType
instanceCount :: Natural
volumeKmsKeyId :: Maybe Text
$sel:volumeSizeInGB:ProcessingClusterConfig' :: ProcessingClusterConfig -> Natural
$sel:instanceType:ProcessingClusterConfig' :: ProcessingClusterConfig -> ProcessingInstanceType
$sel:instanceCount:ProcessingClusterConfig' :: ProcessingClusterConfig -> Natural
$sel:volumeKmsKeyId:ProcessingClusterConfig' :: ProcessingClusterConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeKmsKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
instanceCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProcessingInstanceType
instanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
volumeSizeInGB
instance Data.ToJSON ProcessingClusterConfig where
toJSON :: ProcessingClusterConfig -> Value
toJSON ProcessingClusterConfig' {Natural
Maybe Text
ProcessingInstanceType
volumeSizeInGB :: Natural
instanceType :: ProcessingInstanceType
instanceCount :: Natural
volumeKmsKeyId :: Maybe Text
$sel:volumeSizeInGB:ProcessingClusterConfig' :: ProcessingClusterConfig -> Natural
$sel:instanceType:ProcessingClusterConfig' :: ProcessingClusterConfig -> ProcessingInstanceType
$sel:instanceCount:ProcessingClusterConfig' :: ProcessingClusterConfig -> Natural
$sel:volumeKmsKeyId:ProcessingClusterConfig' :: ProcessingClusterConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"VolumeKmsKeyId" 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
volumeKmsKeyId,
forall a. a -> Maybe a
Prelude.Just (Key
"InstanceCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
instanceCount),
forall a. a -> Maybe a
Prelude.Just (Key
"InstanceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ProcessingInstanceType
instanceType),
forall a. a -> Maybe a
Prelude.Just
(Key
"VolumeSizeInGB" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
volumeSizeInGB)
]
)