{-# 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.Lens as Lens
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
(ProcessingClusterConfig -> ProcessingClusterConfig -> Bool)
-> (ProcessingClusterConfig -> ProcessingClusterConfig -> Bool)
-> Eq ProcessingClusterConfig
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]
(Int -> ReadS ProcessingClusterConfig)
-> ReadS [ProcessingClusterConfig]
-> ReadPrec ProcessingClusterConfig
-> ReadPrec [ProcessingClusterConfig]
-> Read 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
(Int -> ProcessingClusterConfig -> ShowS)
-> (ProcessingClusterConfig -> String)
-> ([ProcessingClusterConfig] -> ShowS)
-> Show ProcessingClusterConfig
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.
ProcessingClusterConfig -> Rep ProcessingClusterConfig x)
-> (forall x.
Rep ProcessingClusterConfig x -> ProcessingClusterConfig)
-> Generic ProcessingClusterConfig
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' :: Maybe Text
-> Natural
-> ProcessingInstanceType
-> Natural
-> ProcessingClusterConfig
ProcessingClusterConfig'
{ $sel:volumeKmsKeyId:ProcessingClusterConfig' :: Maybe Text
volumeKmsKeyId =
Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> ProcessingClusterConfig -> f ProcessingClusterConfig
processingClusterConfig_volumeKmsKeyId = (ProcessingClusterConfig -> Maybe Text)
-> (ProcessingClusterConfig
-> Maybe Text -> ProcessingClusterConfig)
-> Lens
ProcessingClusterConfig
ProcessingClusterConfig
(Maybe Text)
(Maybe Text)
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 :: (Natural -> f Natural)
-> ProcessingClusterConfig -> f ProcessingClusterConfig
processingClusterConfig_instanceCount = (ProcessingClusterConfig -> Natural)
-> (ProcessingClusterConfig -> Natural -> ProcessingClusterConfig)
-> Lens
ProcessingClusterConfig ProcessingClusterConfig Natural Natural
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 :: (ProcessingInstanceType -> f ProcessingInstanceType)
-> ProcessingClusterConfig -> f ProcessingClusterConfig
processingClusterConfig_instanceType = (ProcessingClusterConfig -> ProcessingInstanceType)
-> (ProcessingClusterConfig
-> ProcessingInstanceType -> ProcessingClusterConfig)
-> Lens
ProcessingClusterConfig
ProcessingClusterConfig
ProcessingInstanceType
ProcessingInstanceType
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 :: (Natural -> f Natural)
-> ProcessingClusterConfig -> f ProcessingClusterConfig
processingClusterConfig_volumeSizeInGB = (ProcessingClusterConfig -> Natural)
-> (ProcessingClusterConfig -> Natural -> ProcessingClusterConfig)
-> Lens
ProcessingClusterConfig ProcessingClusterConfig Natural Natural
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 Core.FromJSON ProcessingClusterConfig where
parseJSON :: Value -> Parser ProcessingClusterConfig
parseJSON =
String
-> (Object -> Parser ProcessingClusterConfig)
-> Value
-> Parser ProcessingClusterConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProcessingClusterConfig"
( \Object
x ->
Maybe Text
-> Natural
-> ProcessingInstanceType
-> Natural
-> ProcessingClusterConfig
ProcessingClusterConfig'
(Maybe Text
-> Natural
-> ProcessingInstanceType
-> Natural
-> ProcessingClusterConfig)
-> Parser (Maybe Text)
-> Parser
(Natural
-> ProcessingInstanceType -> Natural -> ProcessingClusterConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeKmsKeyId")
Parser
(Natural
-> ProcessingInstanceType -> Natural -> ProcessingClusterConfig)
-> Parser Natural
-> Parser
(ProcessingInstanceType -> Natural -> ProcessingClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"InstanceCount")
Parser
(ProcessingInstanceType -> Natural -> ProcessingClusterConfig)
-> Parser ProcessingInstanceType
-> Parser (Natural -> ProcessingClusterConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ProcessingInstanceType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"InstanceType")
Parser (Natural -> ProcessingClusterConfig)
-> Parser Natural -> Parser ProcessingClusterConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VolumeSizeInGB")
)
instance Prelude.Hashable ProcessingClusterConfig
instance Prelude.NFData ProcessingClusterConfig
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"VolumeKmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
volumeKmsKeyId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
instanceCount),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceType" Text -> ProcessingInstanceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ProcessingInstanceType
instanceType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"VolumeSizeInGB" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
volumeSizeInGB)
]
)