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