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