{-# 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.DesiredWeightAndCapacity 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
data DesiredWeightAndCapacity = DesiredWeightAndCapacity'
{
DesiredWeightAndCapacity -> Maybe Natural
desiredInstanceCount :: Prelude.Maybe Prelude.Natural,
DesiredWeightAndCapacity -> Maybe Double
desiredWeight :: Prelude.Maybe Prelude.Double,
DesiredWeightAndCapacity -> Text
variantName :: Prelude.Text
}
deriving (DesiredWeightAndCapacity -> DesiredWeightAndCapacity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DesiredWeightAndCapacity -> DesiredWeightAndCapacity -> Bool
$c/= :: DesiredWeightAndCapacity -> DesiredWeightAndCapacity -> Bool
== :: DesiredWeightAndCapacity -> DesiredWeightAndCapacity -> Bool
$c== :: DesiredWeightAndCapacity -> DesiredWeightAndCapacity -> Bool
Prelude.Eq, ReadPrec [DesiredWeightAndCapacity]
ReadPrec DesiredWeightAndCapacity
Int -> ReadS DesiredWeightAndCapacity
ReadS [DesiredWeightAndCapacity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DesiredWeightAndCapacity]
$creadListPrec :: ReadPrec [DesiredWeightAndCapacity]
readPrec :: ReadPrec DesiredWeightAndCapacity
$creadPrec :: ReadPrec DesiredWeightAndCapacity
readList :: ReadS [DesiredWeightAndCapacity]
$creadList :: ReadS [DesiredWeightAndCapacity]
readsPrec :: Int -> ReadS DesiredWeightAndCapacity
$creadsPrec :: Int -> ReadS DesiredWeightAndCapacity
Prelude.Read, Int -> DesiredWeightAndCapacity -> ShowS
[DesiredWeightAndCapacity] -> ShowS
DesiredWeightAndCapacity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DesiredWeightAndCapacity] -> ShowS
$cshowList :: [DesiredWeightAndCapacity] -> ShowS
show :: DesiredWeightAndCapacity -> String
$cshow :: DesiredWeightAndCapacity -> String
showsPrec :: Int -> DesiredWeightAndCapacity -> ShowS
$cshowsPrec :: Int -> DesiredWeightAndCapacity -> ShowS
Prelude.Show, forall x.
Rep DesiredWeightAndCapacity x -> DesiredWeightAndCapacity
forall x.
DesiredWeightAndCapacity -> Rep DesiredWeightAndCapacity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DesiredWeightAndCapacity x -> DesiredWeightAndCapacity
$cfrom :: forall x.
DesiredWeightAndCapacity -> Rep DesiredWeightAndCapacity x
Prelude.Generic)
newDesiredWeightAndCapacity ::
Prelude.Text ->
DesiredWeightAndCapacity
newDesiredWeightAndCapacity :: Text -> DesiredWeightAndCapacity
newDesiredWeightAndCapacity Text
pVariantName_ =
DesiredWeightAndCapacity'
{ $sel:desiredInstanceCount:DesiredWeightAndCapacity' :: Maybe Natural
desiredInstanceCount =
forall a. Maybe a
Prelude.Nothing,
$sel:desiredWeight:DesiredWeightAndCapacity' :: Maybe Double
desiredWeight = forall a. Maybe a
Prelude.Nothing,
$sel:variantName:DesiredWeightAndCapacity' :: Text
variantName = Text
pVariantName_
}
desiredWeightAndCapacity_desiredInstanceCount :: Lens.Lens' DesiredWeightAndCapacity (Prelude.Maybe Prelude.Natural)
desiredWeightAndCapacity_desiredInstanceCount :: Lens' DesiredWeightAndCapacity (Maybe Natural)
desiredWeightAndCapacity_desiredInstanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DesiredWeightAndCapacity' {Maybe Natural
desiredInstanceCount :: Maybe Natural
$sel:desiredInstanceCount:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Maybe Natural
desiredInstanceCount} -> Maybe Natural
desiredInstanceCount) (\s :: DesiredWeightAndCapacity
s@DesiredWeightAndCapacity' {} Maybe Natural
a -> DesiredWeightAndCapacity
s {$sel:desiredInstanceCount:DesiredWeightAndCapacity' :: Maybe Natural
desiredInstanceCount = Maybe Natural
a} :: DesiredWeightAndCapacity)
desiredWeightAndCapacity_desiredWeight :: Lens.Lens' DesiredWeightAndCapacity (Prelude.Maybe Prelude.Double)
desiredWeightAndCapacity_desiredWeight :: Lens' DesiredWeightAndCapacity (Maybe Double)
desiredWeightAndCapacity_desiredWeight = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DesiredWeightAndCapacity' {Maybe Double
desiredWeight :: Maybe Double
$sel:desiredWeight:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Maybe Double
desiredWeight} -> Maybe Double
desiredWeight) (\s :: DesiredWeightAndCapacity
s@DesiredWeightAndCapacity' {} Maybe Double
a -> DesiredWeightAndCapacity
s {$sel:desiredWeight:DesiredWeightAndCapacity' :: Maybe Double
desiredWeight = Maybe Double
a} :: DesiredWeightAndCapacity)
desiredWeightAndCapacity_variantName :: Lens.Lens' DesiredWeightAndCapacity Prelude.Text
desiredWeightAndCapacity_variantName :: Lens' DesiredWeightAndCapacity Text
desiredWeightAndCapacity_variantName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DesiredWeightAndCapacity' {Text
variantName :: Text
$sel:variantName:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Text
variantName} -> Text
variantName) (\s :: DesiredWeightAndCapacity
s@DesiredWeightAndCapacity' {} Text
a -> DesiredWeightAndCapacity
s {$sel:variantName:DesiredWeightAndCapacity' :: Text
variantName = Text
a} :: DesiredWeightAndCapacity)
instance Prelude.Hashable DesiredWeightAndCapacity where
hashWithSalt :: Int -> DesiredWeightAndCapacity -> Int
hashWithSalt Int
_salt DesiredWeightAndCapacity' {Maybe Double
Maybe Natural
Text
variantName :: Text
desiredWeight :: Maybe Double
desiredInstanceCount :: Maybe Natural
$sel:variantName:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Text
$sel:desiredWeight:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Maybe Double
$sel:desiredInstanceCount:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
desiredInstanceCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
desiredWeight
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
variantName
instance Prelude.NFData DesiredWeightAndCapacity where
rnf :: DesiredWeightAndCapacity -> ()
rnf DesiredWeightAndCapacity' {Maybe Double
Maybe Natural
Text
variantName :: Text
desiredWeight :: Maybe Double
desiredInstanceCount :: Maybe Natural
$sel:variantName:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Text
$sel:desiredWeight:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Maybe Double
$sel:desiredInstanceCount:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
desiredInstanceCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
desiredWeight
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
variantName
instance Data.ToJSON DesiredWeightAndCapacity where
toJSON :: DesiredWeightAndCapacity -> Value
toJSON DesiredWeightAndCapacity' {Maybe Double
Maybe Natural
Text
variantName :: Text
desiredWeight :: Maybe Double
desiredInstanceCount :: Maybe Natural
$sel:variantName:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Text
$sel:desiredWeight:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Maybe Double
$sel:desiredInstanceCount:DesiredWeightAndCapacity' :: DesiredWeightAndCapacity -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DesiredInstanceCount" 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 Natural
desiredInstanceCount,
(Key
"DesiredWeight" 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 Double
desiredWeight,
forall a. a -> Maybe a
Prelude.Just (Key
"VariantName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
variantName)
]
)