{-# 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.ProductionVariantSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.DeployedImage
data ProductionVariantSummary = ProductionVariantSummary'
{
ProductionVariantSummary -> Maybe Natural
desiredInstanceCount :: Prelude.Maybe Prelude.Natural,
ProductionVariantSummary -> Maybe Double
desiredWeight :: Prelude.Maybe Prelude.Double,
ProductionVariantSummary -> Maybe Double
currentWeight :: Prelude.Maybe Prelude.Double,
ProductionVariantSummary -> Maybe Natural
currentInstanceCount :: Prelude.Maybe Prelude.Natural,
ProductionVariantSummary -> Maybe [DeployedImage]
deployedImages :: Prelude.Maybe [DeployedImage],
ProductionVariantSummary -> Text
variantName :: Prelude.Text
}
deriving (ProductionVariantSummary -> ProductionVariantSummary -> Bool
(ProductionVariantSummary -> ProductionVariantSummary -> Bool)
-> (ProductionVariantSummary -> ProductionVariantSummary -> Bool)
-> Eq ProductionVariantSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProductionVariantSummary -> ProductionVariantSummary -> Bool
$c/= :: ProductionVariantSummary -> ProductionVariantSummary -> Bool
== :: ProductionVariantSummary -> ProductionVariantSummary -> Bool
$c== :: ProductionVariantSummary -> ProductionVariantSummary -> Bool
Prelude.Eq, ReadPrec [ProductionVariantSummary]
ReadPrec ProductionVariantSummary
Int -> ReadS ProductionVariantSummary
ReadS [ProductionVariantSummary]
(Int -> ReadS ProductionVariantSummary)
-> ReadS [ProductionVariantSummary]
-> ReadPrec ProductionVariantSummary
-> ReadPrec [ProductionVariantSummary]
-> Read ProductionVariantSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProductionVariantSummary]
$creadListPrec :: ReadPrec [ProductionVariantSummary]
readPrec :: ReadPrec ProductionVariantSummary
$creadPrec :: ReadPrec ProductionVariantSummary
readList :: ReadS [ProductionVariantSummary]
$creadList :: ReadS [ProductionVariantSummary]
readsPrec :: Int -> ReadS ProductionVariantSummary
$creadsPrec :: Int -> ReadS ProductionVariantSummary
Prelude.Read, Int -> ProductionVariantSummary -> ShowS
[ProductionVariantSummary] -> ShowS
ProductionVariantSummary -> String
(Int -> ProductionVariantSummary -> ShowS)
-> (ProductionVariantSummary -> String)
-> ([ProductionVariantSummary] -> ShowS)
-> Show ProductionVariantSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProductionVariantSummary] -> ShowS
$cshowList :: [ProductionVariantSummary] -> ShowS
show :: ProductionVariantSummary -> String
$cshow :: ProductionVariantSummary -> String
showsPrec :: Int -> ProductionVariantSummary -> ShowS
$cshowsPrec :: Int -> ProductionVariantSummary -> ShowS
Prelude.Show, (forall x.
ProductionVariantSummary -> Rep ProductionVariantSummary x)
-> (forall x.
Rep ProductionVariantSummary x -> ProductionVariantSummary)
-> Generic ProductionVariantSummary
forall x.
Rep ProductionVariantSummary x -> ProductionVariantSummary
forall x.
ProductionVariantSummary -> Rep ProductionVariantSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProductionVariantSummary x -> ProductionVariantSummary
$cfrom :: forall x.
ProductionVariantSummary -> Rep ProductionVariantSummary x
Prelude.Generic)
newProductionVariantSummary ::
Prelude.Text ->
ProductionVariantSummary
newProductionVariantSummary :: Text -> ProductionVariantSummary
newProductionVariantSummary Text
pVariantName_ =
ProductionVariantSummary' :: Maybe Natural
-> Maybe Double
-> Maybe Double
-> Maybe Natural
-> Maybe [DeployedImage]
-> Text
-> ProductionVariantSummary
ProductionVariantSummary'
{ $sel:desiredInstanceCount:ProductionVariantSummary' :: Maybe Natural
desiredInstanceCount =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:desiredWeight:ProductionVariantSummary' :: Maybe Double
desiredWeight = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:currentWeight:ProductionVariantSummary' :: Maybe Double
currentWeight = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:currentInstanceCount:ProductionVariantSummary' :: Maybe Natural
currentInstanceCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:deployedImages:ProductionVariantSummary' :: Maybe [DeployedImage]
deployedImages = Maybe [DeployedImage]
forall a. Maybe a
Prelude.Nothing,
$sel:variantName:ProductionVariantSummary' :: Text
variantName = Text
pVariantName_
}
productionVariantSummary_desiredInstanceCount :: Lens.Lens' ProductionVariantSummary (Prelude.Maybe Prelude.Natural)
productionVariantSummary_desiredInstanceCount :: (Maybe Natural -> f (Maybe Natural))
-> ProductionVariantSummary -> f ProductionVariantSummary
productionVariantSummary_desiredInstanceCount = (ProductionVariantSummary -> Maybe Natural)
-> (ProductionVariantSummary
-> Maybe Natural -> ProductionVariantSummary)
-> Lens
ProductionVariantSummary
ProductionVariantSummary
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariantSummary' {Maybe Natural
desiredInstanceCount :: Maybe Natural
$sel:desiredInstanceCount:ProductionVariantSummary' :: ProductionVariantSummary -> Maybe Natural
desiredInstanceCount} -> Maybe Natural
desiredInstanceCount) (\s :: ProductionVariantSummary
s@ProductionVariantSummary' {} Maybe Natural
a -> ProductionVariantSummary
s {$sel:desiredInstanceCount:ProductionVariantSummary' :: Maybe Natural
desiredInstanceCount = Maybe Natural
a} :: ProductionVariantSummary)
productionVariantSummary_desiredWeight :: Lens.Lens' ProductionVariantSummary (Prelude.Maybe Prelude.Double)
productionVariantSummary_desiredWeight :: (Maybe Double -> f (Maybe Double))
-> ProductionVariantSummary -> f ProductionVariantSummary
productionVariantSummary_desiredWeight = (ProductionVariantSummary -> Maybe Double)
-> (ProductionVariantSummary
-> Maybe Double -> ProductionVariantSummary)
-> Lens
ProductionVariantSummary
ProductionVariantSummary
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariantSummary' {Maybe Double
desiredWeight :: Maybe Double
$sel:desiredWeight:ProductionVariantSummary' :: ProductionVariantSummary -> Maybe Double
desiredWeight} -> Maybe Double
desiredWeight) (\s :: ProductionVariantSummary
s@ProductionVariantSummary' {} Maybe Double
a -> ProductionVariantSummary
s {$sel:desiredWeight:ProductionVariantSummary' :: Maybe Double
desiredWeight = Maybe Double
a} :: ProductionVariantSummary)
productionVariantSummary_currentWeight :: Lens.Lens' ProductionVariantSummary (Prelude.Maybe Prelude.Double)
productionVariantSummary_currentWeight :: (Maybe Double -> f (Maybe Double))
-> ProductionVariantSummary -> f ProductionVariantSummary
productionVariantSummary_currentWeight = (ProductionVariantSummary -> Maybe Double)
-> (ProductionVariantSummary
-> Maybe Double -> ProductionVariantSummary)
-> Lens
ProductionVariantSummary
ProductionVariantSummary
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariantSummary' {Maybe Double
currentWeight :: Maybe Double
$sel:currentWeight:ProductionVariantSummary' :: ProductionVariantSummary -> Maybe Double
currentWeight} -> Maybe Double
currentWeight) (\s :: ProductionVariantSummary
s@ProductionVariantSummary' {} Maybe Double
a -> ProductionVariantSummary
s {$sel:currentWeight:ProductionVariantSummary' :: Maybe Double
currentWeight = Maybe Double
a} :: ProductionVariantSummary)
productionVariantSummary_currentInstanceCount :: Lens.Lens' ProductionVariantSummary (Prelude.Maybe Prelude.Natural)
productionVariantSummary_currentInstanceCount :: (Maybe Natural -> f (Maybe Natural))
-> ProductionVariantSummary -> f ProductionVariantSummary
productionVariantSummary_currentInstanceCount = (ProductionVariantSummary -> Maybe Natural)
-> (ProductionVariantSummary
-> Maybe Natural -> ProductionVariantSummary)
-> Lens
ProductionVariantSummary
ProductionVariantSummary
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariantSummary' {Maybe Natural
currentInstanceCount :: Maybe Natural
$sel:currentInstanceCount:ProductionVariantSummary' :: ProductionVariantSummary -> Maybe Natural
currentInstanceCount} -> Maybe Natural
currentInstanceCount) (\s :: ProductionVariantSummary
s@ProductionVariantSummary' {} Maybe Natural
a -> ProductionVariantSummary
s {$sel:currentInstanceCount:ProductionVariantSummary' :: Maybe Natural
currentInstanceCount = Maybe Natural
a} :: ProductionVariantSummary)
productionVariantSummary_deployedImages :: Lens.Lens' ProductionVariantSummary (Prelude.Maybe [DeployedImage])
productionVariantSummary_deployedImages :: (Maybe [DeployedImage] -> f (Maybe [DeployedImage]))
-> ProductionVariantSummary -> f ProductionVariantSummary
productionVariantSummary_deployedImages = (ProductionVariantSummary -> Maybe [DeployedImage])
-> (ProductionVariantSummary
-> Maybe [DeployedImage] -> ProductionVariantSummary)
-> Lens
ProductionVariantSummary
ProductionVariantSummary
(Maybe [DeployedImage])
(Maybe [DeployedImage])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariantSummary' {Maybe [DeployedImage]
deployedImages :: Maybe [DeployedImage]
$sel:deployedImages:ProductionVariantSummary' :: ProductionVariantSummary -> Maybe [DeployedImage]
deployedImages} -> Maybe [DeployedImage]
deployedImages) (\s :: ProductionVariantSummary
s@ProductionVariantSummary' {} Maybe [DeployedImage]
a -> ProductionVariantSummary
s {$sel:deployedImages:ProductionVariantSummary' :: Maybe [DeployedImage]
deployedImages = Maybe [DeployedImage]
a} :: ProductionVariantSummary) ((Maybe [DeployedImage] -> f (Maybe [DeployedImage]))
-> ProductionVariantSummary -> f ProductionVariantSummary)
-> ((Maybe [DeployedImage] -> f (Maybe [DeployedImage]))
-> Maybe [DeployedImage] -> f (Maybe [DeployedImage]))
-> (Maybe [DeployedImage] -> f (Maybe [DeployedImage]))
-> ProductionVariantSummary
-> f ProductionVariantSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DeployedImage] [DeployedImage] [DeployedImage] [DeployedImage]
-> Iso
(Maybe [DeployedImage])
(Maybe [DeployedImage])
(Maybe [DeployedImage])
(Maybe [DeployedImage])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[DeployedImage] [DeployedImage] [DeployedImage] [DeployedImage]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
productionVariantSummary_variantName :: Lens.Lens' ProductionVariantSummary Prelude.Text
productionVariantSummary_variantName :: (Text -> f Text)
-> ProductionVariantSummary -> f ProductionVariantSummary
productionVariantSummary_variantName = (ProductionVariantSummary -> Text)
-> (ProductionVariantSummary -> Text -> ProductionVariantSummary)
-> Lens ProductionVariantSummary ProductionVariantSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariantSummary' {Text
variantName :: Text
$sel:variantName:ProductionVariantSummary' :: ProductionVariantSummary -> Text
variantName} -> Text
variantName) (\s :: ProductionVariantSummary
s@ProductionVariantSummary' {} Text
a -> ProductionVariantSummary
s {$sel:variantName:ProductionVariantSummary' :: Text
variantName = Text
a} :: ProductionVariantSummary)
instance Core.FromJSON ProductionVariantSummary where
parseJSON :: Value -> Parser ProductionVariantSummary
parseJSON =
String
-> (Object -> Parser ProductionVariantSummary)
-> Value
-> Parser ProductionVariantSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProductionVariantSummary"
( \Object
x ->
Maybe Natural
-> Maybe Double
-> Maybe Double
-> Maybe Natural
-> Maybe [DeployedImage]
-> Text
-> ProductionVariantSummary
ProductionVariantSummary'
(Maybe Natural
-> Maybe Double
-> Maybe Double
-> Maybe Natural
-> Maybe [DeployedImage]
-> Text
-> ProductionVariantSummary)
-> Parser (Maybe Natural)
-> Parser
(Maybe Double
-> Maybe Double
-> Maybe Natural
-> Maybe [DeployedImage]
-> Text
-> ProductionVariantSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DesiredInstanceCount")
Parser
(Maybe Double
-> Maybe Double
-> Maybe Natural
-> Maybe [DeployedImage]
-> Text
-> ProductionVariantSummary)
-> Parser (Maybe Double)
-> Parser
(Maybe Double
-> Maybe Natural
-> Maybe [DeployedImage]
-> Text
-> ProductionVariantSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DesiredWeight")
Parser
(Maybe Double
-> Maybe Natural
-> Maybe [DeployedImage]
-> Text
-> ProductionVariantSummary)
-> Parser (Maybe Double)
-> Parser
(Maybe Natural
-> Maybe [DeployedImage] -> Text -> ProductionVariantSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentWeight")
Parser
(Maybe Natural
-> Maybe [DeployedImage] -> Text -> ProductionVariantSummary)
-> Parser (Maybe Natural)
-> Parser
(Maybe [DeployedImage] -> Text -> ProductionVariantSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentInstanceCount")
Parser (Maybe [DeployedImage] -> Text -> ProductionVariantSummary)
-> Parser (Maybe [DeployedImage])
-> Parser (Text -> ProductionVariantSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [DeployedImage]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeployedImages" Parser (Maybe (Maybe [DeployedImage]))
-> Maybe [DeployedImage] -> Parser (Maybe [DeployedImage])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DeployedImage]
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> ProductionVariantSummary)
-> Parser Text -> Parser ProductionVariantSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VariantName")
)
instance Prelude.Hashable ProductionVariantSummary
instance Prelude.NFData ProductionVariantSummary