{-# 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.Lens as Lens
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
(DesiredWeightAndCapacity -> DesiredWeightAndCapacity -> Bool)
-> (DesiredWeightAndCapacity -> DesiredWeightAndCapacity -> Bool)
-> Eq DesiredWeightAndCapacity
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]
(Int -> ReadS DesiredWeightAndCapacity)
-> ReadS [DesiredWeightAndCapacity]
-> ReadPrec DesiredWeightAndCapacity
-> ReadPrec [DesiredWeightAndCapacity]
-> Read 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
(Int -> DesiredWeightAndCapacity -> ShowS)
-> (DesiredWeightAndCapacity -> String)
-> ([DesiredWeightAndCapacity] -> ShowS)
-> Show DesiredWeightAndCapacity
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.
DesiredWeightAndCapacity -> Rep DesiredWeightAndCapacity x)
-> (forall x.
Rep DesiredWeightAndCapacity x -> DesiredWeightAndCapacity)
-> Generic DesiredWeightAndCapacity
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' :: Maybe Natural -> Maybe Double -> Text -> DesiredWeightAndCapacity
DesiredWeightAndCapacity'
{ $sel:desiredInstanceCount:DesiredWeightAndCapacity' :: Maybe Natural
desiredInstanceCount =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:desiredWeight:DesiredWeightAndCapacity' :: Maybe Double
desiredWeight = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:variantName:DesiredWeightAndCapacity' :: Text
variantName = Text
pVariantName_
}
desiredWeightAndCapacity_desiredInstanceCount :: Lens.Lens' DesiredWeightAndCapacity (Prelude.Maybe Prelude.Natural)
desiredWeightAndCapacity_desiredInstanceCount :: (Maybe Natural -> f (Maybe Natural))
-> DesiredWeightAndCapacity -> f DesiredWeightAndCapacity
desiredWeightAndCapacity_desiredInstanceCount = (DesiredWeightAndCapacity -> Maybe Natural)
-> (DesiredWeightAndCapacity
-> Maybe Natural -> DesiredWeightAndCapacity)
-> Lens
DesiredWeightAndCapacity
DesiredWeightAndCapacity
(Maybe Natural)
(Maybe Natural)
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 :: (Maybe Double -> f (Maybe Double))
-> DesiredWeightAndCapacity -> f DesiredWeightAndCapacity
desiredWeightAndCapacity_desiredWeight = (DesiredWeightAndCapacity -> Maybe Double)
-> (DesiredWeightAndCapacity
-> Maybe Double -> DesiredWeightAndCapacity)
-> Lens
DesiredWeightAndCapacity
DesiredWeightAndCapacity
(Maybe Double)
(Maybe Double)
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 :: (Text -> f Text)
-> DesiredWeightAndCapacity -> f DesiredWeightAndCapacity
desiredWeightAndCapacity_variantName = (DesiredWeightAndCapacity -> Text)
-> (DesiredWeightAndCapacity -> Text -> DesiredWeightAndCapacity)
-> Lens DesiredWeightAndCapacity DesiredWeightAndCapacity Text Text
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
instance Prelude.NFData DesiredWeightAndCapacity
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DesiredInstanceCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
desiredInstanceCount,
(Text
"DesiredWeight" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
desiredWeight,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"VariantName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
variantName)
]
)