{-# 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.MonitoringClusterConfig 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 MonitoringClusterConfig = MonitoringClusterConfig'
{
MonitoringClusterConfig -> Maybe Text
volumeKmsKeyId :: Prelude.Maybe Prelude.Text,
MonitoringClusterConfig -> Natural
instanceCount :: Prelude.Natural,
MonitoringClusterConfig -> ProcessingInstanceType
instanceType :: ProcessingInstanceType,
MonitoringClusterConfig -> Natural
volumeSizeInGB :: Prelude.Natural
}
deriving (MonitoringClusterConfig -> MonitoringClusterConfig -> Bool
(MonitoringClusterConfig -> MonitoringClusterConfig -> Bool)
-> (MonitoringClusterConfig -> MonitoringClusterConfig -> Bool)
-> Eq MonitoringClusterConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitoringClusterConfig -> MonitoringClusterConfig -> Bool
$c/= :: MonitoringClusterConfig -> MonitoringClusterConfig -> Bool
== :: MonitoringClusterConfig -> MonitoringClusterConfig -> Bool
$c== :: MonitoringClusterConfig -> MonitoringClusterConfig -> Bool
Prelude.Eq, ReadPrec [MonitoringClusterConfig]
ReadPrec MonitoringClusterConfig
Int -> ReadS MonitoringClusterConfig
ReadS [MonitoringClusterConfig]
(Int -> ReadS MonitoringClusterConfig)
-> ReadS [MonitoringClusterConfig]
-> ReadPrec MonitoringClusterConfig
-> ReadPrec [MonitoringClusterConfig]
-> Read MonitoringClusterConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitoringClusterConfig]
$creadListPrec :: ReadPrec [MonitoringClusterConfig]
readPrec :: ReadPrec MonitoringClusterConfig
$creadPrec :: ReadPrec MonitoringClusterConfig
readList :: ReadS [MonitoringClusterConfig]
$creadList :: ReadS [MonitoringClusterConfig]
readsPrec :: Int -> ReadS MonitoringClusterConfig
$creadsPrec :: Int -> ReadS MonitoringClusterConfig
Prelude.Read, Int -> MonitoringClusterConfig -> ShowS
[MonitoringClusterConfig] -> ShowS
MonitoringClusterConfig -> String
(Int -> MonitoringClusterConfig -> ShowS)
-> (MonitoringClusterConfig -> String)
-> ([MonitoringClusterConfig] -> ShowS)
-> Show MonitoringClusterConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitoringClusterConfig] -> ShowS
$cshowList :: [MonitoringClusterConfig] -> ShowS
show :: MonitoringClusterConfig -> String
$cshow :: MonitoringClusterConfig -> String
showsPrec :: Int -> MonitoringClusterConfig -> ShowS
$cshowsPrec :: Int -> MonitoringClusterConfig -> ShowS
Prelude.Show, (forall x.
MonitoringClusterConfig -> Rep MonitoringClusterConfig x)
-> (forall x.
Rep MonitoringClusterConfig x -> MonitoringClusterConfig)
-> Generic MonitoringClusterConfig
forall x. Rep MonitoringClusterConfig x -> MonitoringClusterConfig
forall x. MonitoringClusterConfig -> Rep MonitoringClusterConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonitoringClusterConfig x -> MonitoringClusterConfig
$cfrom :: forall x. MonitoringClusterConfig -> Rep MonitoringClusterConfig x
Prelude.Generic)
newMonitoringClusterConfig ::
Prelude.Natural ->
ProcessingInstanceType ->
Prelude.Natural ->
MonitoringClusterConfig
newMonitoringClusterConfig :: Natural
-> ProcessingInstanceType -> Natural -> MonitoringClusterConfig
newMonitoringClusterConfig
Natural
pInstanceCount_
ProcessingInstanceType
pInstanceType_
Natural
pVolumeSizeInGB_ =
MonitoringClusterConfig' :: Maybe Text
-> Natural
-> ProcessingInstanceType
-> Natural
-> MonitoringClusterConfig
MonitoringClusterConfig'
{ $sel:volumeKmsKeyId:MonitoringClusterConfig' :: Maybe Text
volumeKmsKeyId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceCount:MonitoringClusterConfig' :: Natural
instanceCount = Natural
pInstanceCount_,
$sel:instanceType:MonitoringClusterConfig' :: ProcessingInstanceType
instanceType = ProcessingInstanceType
pInstanceType_,
$sel:volumeSizeInGB:MonitoringClusterConfig' :: Natural
volumeSizeInGB = Natural
pVolumeSizeInGB_
}
monitoringClusterConfig_volumeKmsKeyId :: Lens.Lens' MonitoringClusterConfig (Prelude.Maybe Prelude.Text)
monitoringClusterConfig_volumeKmsKeyId :: (Maybe Text -> f (Maybe Text))
-> MonitoringClusterConfig -> f MonitoringClusterConfig
monitoringClusterConfig_volumeKmsKeyId = (MonitoringClusterConfig -> Maybe Text)
-> (MonitoringClusterConfig
-> Maybe Text -> MonitoringClusterConfig)
-> Lens
MonitoringClusterConfig
MonitoringClusterConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringClusterConfig' {Maybe Text
volumeKmsKeyId :: Maybe Text
$sel:volumeKmsKeyId:MonitoringClusterConfig' :: MonitoringClusterConfig -> Maybe Text
volumeKmsKeyId} -> Maybe Text
volumeKmsKeyId) (\s :: MonitoringClusterConfig
s@MonitoringClusterConfig' {} Maybe Text
a -> MonitoringClusterConfig
s {$sel:volumeKmsKeyId:MonitoringClusterConfig' :: Maybe Text
volumeKmsKeyId = Maybe Text
a} :: MonitoringClusterConfig)
monitoringClusterConfig_instanceCount :: Lens.Lens' MonitoringClusterConfig Prelude.Natural
monitoringClusterConfig_instanceCount :: (Natural -> f Natural)
-> MonitoringClusterConfig -> f MonitoringClusterConfig
monitoringClusterConfig_instanceCount = (MonitoringClusterConfig -> Natural)
-> (MonitoringClusterConfig -> Natural -> MonitoringClusterConfig)
-> Lens
MonitoringClusterConfig MonitoringClusterConfig Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringClusterConfig' {Natural
instanceCount :: Natural
$sel:instanceCount:MonitoringClusterConfig' :: MonitoringClusterConfig -> Natural
instanceCount} -> Natural
instanceCount) (\s :: MonitoringClusterConfig
s@MonitoringClusterConfig' {} Natural
a -> MonitoringClusterConfig
s {$sel:instanceCount:MonitoringClusterConfig' :: Natural
instanceCount = Natural
a} :: MonitoringClusterConfig)
monitoringClusterConfig_instanceType :: Lens.Lens' MonitoringClusterConfig ProcessingInstanceType
monitoringClusterConfig_instanceType :: (ProcessingInstanceType -> f ProcessingInstanceType)
-> MonitoringClusterConfig -> f MonitoringClusterConfig
monitoringClusterConfig_instanceType = (MonitoringClusterConfig -> ProcessingInstanceType)
-> (MonitoringClusterConfig
-> ProcessingInstanceType -> MonitoringClusterConfig)
-> Lens
MonitoringClusterConfig
MonitoringClusterConfig
ProcessingInstanceType
ProcessingInstanceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringClusterConfig' {ProcessingInstanceType
instanceType :: ProcessingInstanceType
$sel:instanceType:MonitoringClusterConfig' :: MonitoringClusterConfig -> ProcessingInstanceType
instanceType} -> ProcessingInstanceType
instanceType) (\s :: MonitoringClusterConfig
s@MonitoringClusterConfig' {} ProcessingInstanceType
a -> MonitoringClusterConfig
s {$sel:instanceType:MonitoringClusterConfig' :: ProcessingInstanceType
instanceType = ProcessingInstanceType
a} :: MonitoringClusterConfig)
monitoringClusterConfig_volumeSizeInGB :: Lens.Lens' MonitoringClusterConfig Prelude.Natural
monitoringClusterConfig_volumeSizeInGB :: (Natural -> f Natural)
-> MonitoringClusterConfig -> f MonitoringClusterConfig
monitoringClusterConfig_volumeSizeInGB = (MonitoringClusterConfig -> Natural)
-> (MonitoringClusterConfig -> Natural -> MonitoringClusterConfig)
-> Lens
MonitoringClusterConfig MonitoringClusterConfig Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringClusterConfig' {Natural
volumeSizeInGB :: Natural
$sel:volumeSizeInGB:MonitoringClusterConfig' :: MonitoringClusterConfig -> Natural
volumeSizeInGB} -> Natural
volumeSizeInGB) (\s :: MonitoringClusterConfig
s@MonitoringClusterConfig' {} Natural
a -> MonitoringClusterConfig
s {$sel:volumeSizeInGB:MonitoringClusterConfig' :: Natural
volumeSizeInGB = Natural
a} :: MonitoringClusterConfig)
instance Core.FromJSON MonitoringClusterConfig where
parseJSON :: Value -> Parser MonitoringClusterConfig
parseJSON =
String
-> (Object -> Parser MonitoringClusterConfig)
-> Value
-> Parser MonitoringClusterConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MonitoringClusterConfig"
( \Object
x ->
Maybe Text
-> Natural
-> ProcessingInstanceType
-> Natural
-> MonitoringClusterConfig
MonitoringClusterConfig'
(Maybe Text
-> Natural
-> ProcessingInstanceType
-> Natural
-> MonitoringClusterConfig)
-> Parser (Maybe Text)
-> Parser
(Natural
-> ProcessingInstanceType -> Natural -> MonitoringClusterConfig)
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 -> MonitoringClusterConfig)
-> Parser Natural
-> Parser
(ProcessingInstanceType -> Natural -> MonitoringClusterConfig)
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 -> MonitoringClusterConfig)
-> Parser ProcessingInstanceType
-> Parser (Natural -> MonitoringClusterConfig)
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 -> MonitoringClusterConfig)
-> Parser Natural -> Parser MonitoringClusterConfig
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 MonitoringClusterConfig
instance Prelude.NFData MonitoringClusterConfig
instance Core.ToJSON MonitoringClusterConfig where
toJSON :: MonitoringClusterConfig -> Value
toJSON MonitoringClusterConfig' {Natural
Maybe Text
ProcessingInstanceType
volumeSizeInGB :: Natural
instanceType :: ProcessingInstanceType
instanceCount :: Natural
volumeKmsKeyId :: Maybe Text
$sel:volumeSizeInGB:MonitoringClusterConfig' :: MonitoringClusterConfig -> Natural
$sel:instanceType:MonitoringClusterConfig' :: MonitoringClusterConfig -> ProcessingInstanceType
$sel:instanceCount:MonitoringClusterConfig' :: MonitoringClusterConfig -> Natural
$sel:volumeKmsKeyId:MonitoringClusterConfig' :: MonitoringClusterConfig -> 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)
]
)