{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SageMaker.Types.ProductionVariant
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.ProductionVariant 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.ProductionVariantAcceleratorType
import Amazonka.SageMaker.Types.ProductionVariantCoreDumpConfig
import Amazonka.SageMaker.Types.ProductionVariantInstanceType
import Amazonka.SageMaker.Types.ProductionVariantServerlessConfig

-- | Identifies a model that you want to host and the resources chosen to
-- deploy for hosting it. If you are deploying multiple models, tell
-- SageMaker how to distribute traffic among the models by specifying
-- variant weights.
--
-- /See:/ 'newProductionVariant' smart constructor.
data ProductionVariant = ProductionVariant'
  { -- | The size of the Elastic Inference (EI) instance to use for the
    -- production variant. EI instances provide on-demand GPU computing for
    -- inference. For more information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html Using Elastic Inference in Amazon SageMaker>.
    ProductionVariant -> Maybe ProductionVariantAcceleratorType
acceleratorType :: Prelude.Maybe ProductionVariantAcceleratorType,
    -- | The timeout value, in seconds, for your inference container to pass
    -- health check by SageMaker Hosting. For more information about health
    -- check, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-algo-ping-requests How Your Container Should Respond to Health Check (Ping) Requests>.
    ProductionVariant -> Maybe Natural
containerStartupHealthCheckTimeoutInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | Specifies configuration for a core dump from the model container when
    -- the process crashes.
    ProductionVariant -> Maybe ProductionVariantCoreDumpConfig
coreDumpConfig :: Prelude.Maybe ProductionVariantCoreDumpConfig,
    -- | Number of instances to launch initially.
    ProductionVariant -> Maybe Natural
initialInstanceCount :: Prelude.Maybe Prelude.Natural,
    -- | Determines initial traffic distribution among all of the models that you
    -- specify in the endpoint configuration. The traffic to a production
    -- variant is determined by the ratio of the @VariantWeight@ to the sum of
    -- all @VariantWeight@ values across all ProductionVariants. If
    -- unspecified, it defaults to 1.0.
    ProductionVariant -> Maybe Double
initialVariantWeight :: Prelude.Maybe Prelude.Double,
    -- | The ML compute instance type.
    ProductionVariant -> Maybe ProductionVariantInstanceType
instanceType :: Prelude.Maybe ProductionVariantInstanceType,
    -- | The timeout value, in seconds, to download and extract the model that
    -- you want to host from Amazon S3 to the individual inference instance
    -- associated with this production variant.
    ProductionVariant -> Maybe Natural
modelDataDownloadTimeoutInSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The serverless configuration for an endpoint. Specifies a serverless
    -- endpoint configuration instead of an instance-based endpoint
    -- configuration.
    ProductionVariant -> Maybe ProductionVariantServerlessConfig
serverlessConfig :: Prelude.Maybe ProductionVariantServerlessConfig,
    -- | The size, in GB, of the ML storage volume attached to individual
    -- inference instance associated with the production variant. Currenly only
    -- Amazon EBS gp2 storage volumes are supported.
    ProductionVariant -> Maybe Natural
volumeSizeInGB :: Prelude.Maybe Prelude.Natural,
    -- | The name of the production variant.
    ProductionVariant -> Text
variantName :: Prelude.Text,
    -- | The name of the model that you want to host. This is the name that you
    -- specified when creating the model.
    ProductionVariant -> Text
modelName :: Prelude.Text
  }
  deriving (ProductionVariant -> ProductionVariant -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProductionVariant -> ProductionVariant -> Bool
$c/= :: ProductionVariant -> ProductionVariant -> Bool
== :: ProductionVariant -> ProductionVariant -> Bool
$c== :: ProductionVariant -> ProductionVariant -> Bool
Prelude.Eq, ReadPrec [ProductionVariant]
ReadPrec ProductionVariant
Int -> ReadS ProductionVariant
ReadS [ProductionVariant]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProductionVariant]
$creadListPrec :: ReadPrec [ProductionVariant]
readPrec :: ReadPrec ProductionVariant
$creadPrec :: ReadPrec ProductionVariant
readList :: ReadS [ProductionVariant]
$creadList :: ReadS [ProductionVariant]
readsPrec :: Int -> ReadS ProductionVariant
$creadsPrec :: Int -> ReadS ProductionVariant
Prelude.Read, Int -> ProductionVariant -> ShowS
[ProductionVariant] -> ShowS
ProductionVariant -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProductionVariant] -> ShowS
$cshowList :: [ProductionVariant] -> ShowS
show :: ProductionVariant -> String
$cshow :: ProductionVariant -> String
showsPrec :: Int -> ProductionVariant -> ShowS
$cshowsPrec :: Int -> ProductionVariant -> ShowS
Prelude.Show, forall x. Rep ProductionVariant x -> ProductionVariant
forall x. ProductionVariant -> Rep ProductionVariant x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProductionVariant x -> ProductionVariant
$cfrom :: forall x. ProductionVariant -> Rep ProductionVariant x
Prelude.Generic)

-- |
-- Create a value of 'ProductionVariant' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'acceleratorType', 'productionVariant_acceleratorType' - The size of the Elastic Inference (EI) instance to use for the
-- production variant. EI instances provide on-demand GPU computing for
-- inference. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html Using Elastic Inference in Amazon SageMaker>.
--
-- 'containerStartupHealthCheckTimeoutInSeconds', 'productionVariant_containerStartupHealthCheckTimeoutInSeconds' - The timeout value, in seconds, for your inference container to pass
-- health check by SageMaker Hosting. For more information about health
-- check, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-algo-ping-requests How Your Container Should Respond to Health Check (Ping) Requests>.
--
-- 'coreDumpConfig', 'productionVariant_coreDumpConfig' - Specifies configuration for a core dump from the model container when
-- the process crashes.
--
-- 'initialInstanceCount', 'productionVariant_initialInstanceCount' - Number of instances to launch initially.
--
-- 'initialVariantWeight', 'productionVariant_initialVariantWeight' - Determines initial traffic distribution among all of the models that you
-- specify in the endpoint configuration. The traffic to a production
-- variant is determined by the ratio of the @VariantWeight@ to the sum of
-- all @VariantWeight@ values across all ProductionVariants. If
-- unspecified, it defaults to 1.0.
--
-- 'instanceType', 'productionVariant_instanceType' - The ML compute instance type.
--
-- 'modelDataDownloadTimeoutInSeconds', 'productionVariant_modelDataDownloadTimeoutInSeconds' - The timeout value, in seconds, to download and extract the model that
-- you want to host from Amazon S3 to the individual inference instance
-- associated with this production variant.
--
-- 'serverlessConfig', 'productionVariant_serverlessConfig' - The serverless configuration for an endpoint. Specifies a serverless
-- endpoint configuration instead of an instance-based endpoint
-- configuration.
--
-- 'volumeSizeInGB', 'productionVariant_volumeSizeInGB' - The size, in GB, of the ML storage volume attached to individual
-- inference instance associated with the production variant. Currenly only
-- Amazon EBS gp2 storage volumes are supported.
--
-- 'variantName', 'productionVariant_variantName' - The name of the production variant.
--
-- 'modelName', 'productionVariant_modelName' - The name of the model that you want to host. This is the name that you
-- specified when creating the model.
newProductionVariant ::
  -- | 'variantName'
  Prelude.Text ->
  -- | 'modelName'
  Prelude.Text ->
  ProductionVariant
newProductionVariant :: Text -> Text -> ProductionVariant
newProductionVariant Text
pVariantName_ Text
pModelName_ =
  ProductionVariant'
    { $sel:acceleratorType:ProductionVariant' :: Maybe ProductionVariantAcceleratorType
acceleratorType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:containerStartupHealthCheckTimeoutInSeconds:ProductionVariant' :: Maybe Natural
containerStartupHealthCheckTimeoutInSeconds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:coreDumpConfig:ProductionVariant' :: Maybe ProductionVariantCoreDumpConfig
coreDumpConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:initialInstanceCount:ProductionVariant' :: Maybe Natural
initialInstanceCount = forall a. Maybe a
Prelude.Nothing,
      $sel:initialVariantWeight:ProductionVariant' :: Maybe Double
initialVariantWeight = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:ProductionVariant' :: Maybe ProductionVariantInstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:modelDataDownloadTimeoutInSeconds:ProductionVariant' :: Maybe Natural
modelDataDownloadTimeoutInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:serverlessConfig:ProductionVariant' :: Maybe ProductionVariantServerlessConfig
serverlessConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSizeInGB:ProductionVariant' :: Maybe Natural
volumeSizeInGB = forall a. Maybe a
Prelude.Nothing,
      $sel:variantName:ProductionVariant' :: Text
variantName = Text
pVariantName_,
      $sel:modelName:ProductionVariant' :: Text
modelName = Text
pModelName_
    }

-- | The size of the Elastic Inference (EI) instance to use for the
-- production variant. EI instances provide on-demand GPU computing for
-- inference. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html Using Elastic Inference in Amazon SageMaker>.
productionVariant_acceleratorType :: Lens.Lens' ProductionVariant (Prelude.Maybe ProductionVariantAcceleratorType)
productionVariant_acceleratorType :: Lens' ProductionVariant (Maybe ProductionVariantAcceleratorType)
productionVariant_acceleratorType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe ProductionVariantAcceleratorType
acceleratorType :: Maybe ProductionVariantAcceleratorType
$sel:acceleratorType:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantAcceleratorType
acceleratorType} -> Maybe ProductionVariantAcceleratorType
acceleratorType) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe ProductionVariantAcceleratorType
a -> ProductionVariant
s {$sel:acceleratorType:ProductionVariant' :: Maybe ProductionVariantAcceleratorType
acceleratorType = Maybe ProductionVariantAcceleratorType
a} :: ProductionVariant)

-- | The timeout value, in seconds, for your inference container to pass
-- health check by SageMaker Hosting. For more information about health
-- check, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-algo-ping-requests How Your Container Should Respond to Health Check (Ping) Requests>.
productionVariant_containerStartupHealthCheckTimeoutInSeconds :: Lens.Lens' ProductionVariant (Prelude.Maybe Prelude.Natural)
productionVariant_containerStartupHealthCheckTimeoutInSeconds :: Lens' ProductionVariant (Maybe Natural)
productionVariant_containerStartupHealthCheckTimeoutInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe Natural
containerStartupHealthCheckTimeoutInSeconds :: Maybe Natural
$sel:containerStartupHealthCheckTimeoutInSeconds:ProductionVariant' :: ProductionVariant -> Maybe Natural
containerStartupHealthCheckTimeoutInSeconds} -> Maybe Natural
containerStartupHealthCheckTimeoutInSeconds) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe Natural
a -> ProductionVariant
s {$sel:containerStartupHealthCheckTimeoutInSeconds:ProductionVariant' :: Maybe Natural
containerStartupHealthCheckTimeoutInSeconds = Maybe Natural
a} :: ProductionVariant)

-- | Specifies configuration for a core dump from the model container when
-- the process crashes.
productionVariant_coreDumpConfig :: Lens.Lens' ProductionVariant (Prelude.Maybe ProductionVariantCoreDumpConfig)
productionVariant_coreDumpConfig :: Lens' ProductionVariant (Maybe ProductionVariantCoreDumpConfig)
productionVariant_coreDumpConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe ProductionVariantCoreDumpConfig
coreDumpConfig :: Maybe ProductionVariantCoreDumpConfig
$sel:coreDumpConfig:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantCoreDumpConfig
coreDumpConfig} -> Maybe ProductionVariantCoreDumpConfig
coreDumpConfig) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe ProductionVariantCoreDumpConfig
a -> ProductionVariant
s {$sel:coreDumpConfig:ProductionVariant' :: Maybe ProductionVariantCoreDumpConfig
coreDumpConfig = Maybe ProductionVariantCoreDumpConfig
a} :: ProductionVariant)

-- | Number of instances to launch initially.
productionVariant_initialInstanceCount :: Lens.Lens' ProductionVariant (Prelude.Maybe Prelude.Natural)
productionVariant_initialInstanceCount :: Lens' ProductionVariant (Maybe Natural)
productionVariant_initialInstanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe Natural
initialInstanceCount :: Maybe Natural
$sel:initialInstanceCount:ProductionVariant' :: ProductionVariant -> Maybe Natural
initialInstanceCount} -> Maybe Natural
initialInstanceCount) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe Natural
a -> ProductionVariant
s {$sel:initialInstanceCount:ProductionVariant' :: Maybe Natural
initialInstanceCount = Maybe Natural
a} :: ProductionVariant)

-- | Determines initial traffic distribution among all of the models that you
-- specify in the endpoint configuration. The traffic to a production
-- variant is determined by the ratio of the @VariantWeight@ to the sum of
-- all @VariantWeight@ values across all ProductionVariants. If
-- unspecified, it defaults to 1.0.
productionVariant_initialVariantWeight :: Lens.Lens' ProductionVariant (Prelude.Maybe Prelude.Double)
productionVariant_initialVariantWeight :: Lens' ProductionVariant (Maybe Double)
productionVariant_initialVariantWeight = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe Double
initialVariantWeight :: Maybe Double
$sel:initialVariantWeight:ProductionVariant' :: ProductionVariant -> Maybe Double
initialVariantWeight} -> Maybe Double
initialVariantWeight) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe Double
a -> ProductionVariant
s {$sel:initialVariantWeight:ProductionVariant' :: Maybe Double
initialVariantWeight = Maybe Double
a} :: ProductionVariant)

-- | The ML compute instance type.
productionVariant_instanceType :: Lens.Lens' ProductionVariant (Prelude.Maybe ProductionVariantInstanceType)
productionVariant_instanceType :: Lens' ProductionVariant (Maybe ProductionVariantInstanceType)
productionVariant_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe ProductionVariantInstanceType
instanceType :: Maybe ProductionVariantInstanceType
$sel:instanceType:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantInstanceType
instanceType} -> Maybe ProductionVariantInstanceType
instanceType) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe ProductionVariantInstanceType
a -> ProductionVariant
s {$sel:instanceType:ProductionVariant' :: Maybe ProductionVariantInstanceType
instanceType = Maybe ProductionVariantInstanceType
a} :: ProductionVariant)

-- | The timeout value, in seconds, to download and extract the model that
-- you want to host from Amazon S3 to the individual inference instance
-- associated with this production variant.
productionVariant_modelDataDownloadTimeoutInSeconds :: Lens.Lens' ProductionVariant (Prelude.Maybe Prelude.Natural)
productionVariant_modelDataDownloadTimeoutInSeconds :: Lens' ProductionVariant (Maybe Natural)
productionVariant_modelDataDownloadTimeoutInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe Natural
modelDataDownloadTimeoutInSeconds :: Maybe Natural
$sel:modelDataDownloadTimeoutInSeconds:ProductionVariant' :: ProductionVariant -> Maybe Natural
modelDataDownloadTimeoutInSeconds} -> Maybe Natural
modelDataDownloadTimeoutInSeconds) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe Natural
a -> ProductionVariant
s {$sel:modelDataDownloadTimeoutInSeconds:ProductionVariant' :: Maybe Natural
modelDataDownloadTimeoutInSeconds = Maybe Natural
a} :: ProductionVariant)

-- | The serverless configuration for an endpoint. Specifies a serverless
-- endpoint configuration instead of an instance-based endpoint
-- configuration.
productionVariant_serverlessConfig :: Lens.Lens' ProductionVariant (Prelude.Maybe ProductionVariantServerlessConfig)
productionVariant_serverlessConfig :: Lens' ProductionVariant (Maybe ProductionVariantServerlessConfig)
productionVariant_serverlessConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe ProductionVariantServerlessConfig
serverlessConfig :: Maybe ProductionVariantServerlessConfig
$sel:serverlessConfig:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantServerlessConfig
serverlessConfig} -> Maybe ProductionVariantServerlessConfig
serverlessConfig) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe ProductionVariantServerlessConfig
a -> ProductionVariant
s {$sel:serverlessConfig:ProductionVariant' :: Maybe ProductionVariantServerlessConfig
serverlessConfig = Maybe ProductionVariantServerlessConfig
a} :: ProductionVariant)

-- | The size, in GB, of the ML storage volume attached to individual
-- inference instance associated with the production variant. Currenly only
-- Amazon EBS gp2 storage volumes are supported.
productionVariant_volumeSizeInGB :: Lens.Lens' ProductionVariant (Prelude.Maybe Prelude.Natural)
productionVariant_volumeSizeInGB :: Lens' ProductionVariant (Maybe Natural)
productionVariant_volumeSizeInGB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Maybe Natural
volumeSizeInGB :: Maybe Natural
$sel:volumeSizeInGB:ProductionVariant' :: ProductionVariant -> Maybe Natural
volumeSizeInGB} -> Maybe Natural
volumeSizeInGB) (\s :: ProductionVariant
s@ProductionVariant' {} Maybe Natural
a -> ProductionVariant
s {$sel:volumeSizeInGB:ProductionVariant' :: Maybe Natural
volumeSizeInGB = Maybe Natural
a} :: ProductionVariant)

-- | The name of the production variant.
productionVariant_variantName :: Lens.Lens' ProductionVariant Prelude.Text
productionVariant_variantName :: Lens' ProductionVariant Text
productionVariant_variantName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Text
variantName :: Text
$sel:variantName:ProductionVariant' :: ProductionVariant -> Text
variantName} -> Text
variantName) (\s :: ProductionVariant
s@ProductionVariant' {} Text
a -> ProductionVariant
s {$sel:variantName:ProductionVariant' :: Text
variantName = Text
a} :: ProductionVariant)

-- | The name of the model that you want to host. This is the name that you
-- specified when creating the model.
productionVariant_modelName :: Lens.Lens' ProductionVariant Prelude.Text
productionVariant_modelName :: Lens' ProductionVariant Text
productionVariant_modelName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProductionVariant' {Text
modelName :: Text
$sel:modelName:ProductionVariant' :: ProductionVariant -> Text
modelName} -> Text
modelName) (\s :: ProductionVariant
s@ProductionVariant' {} Text
a -> ProductionVariant
s {$sel:modelName:ProductionVariant' :: Text
modelName = Text
a} :: ProductionVariant)

instance Data.FromJSON ProductionVariant where
  parseJSON :: Value -> Parser ProductionVariant
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProductionVariant"
      ( \Object
x ->
          Maybe ProductionVariantAcceleratorType
-> Maybe Natural
-> Maybe ProductionVariantCoreDumpConfig
-> Maybe Natural
-> Maybe Double
-> Maybe ProductionVariantInstanceType
-> Maybe Natural
-> Maybe ProductionVariantServerlessConfig
-> Maybe Natural
-> Text
-> Text
-> ProductionVariant
ProductionVariant'
            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
"AcceleratorType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ContainerStartupHealthCheckTimeoutInSeconds"
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CoreDumpConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InitialInstanceCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InitialVariantWeight")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe 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 (Maybe a)
Data..:? Key
"ModelDataDownloadTimeoutInSeconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ServerlessConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VolumeSizeInGB")
            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
"VariantName")
            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
"ModelName")
      )

instance Prelude.Hashable ProductionVariant where
  hashWithSalt :: Int -> ProductionVariant -> Int
hashWithSalt Int
_salt ProductionVariant' {Maybe Double
Maybe Natural
Maybe ProductionVariantAcceleratorType
Maybe ProductionVariantCoreDumpConfig
Maybe ProductionVariantInstanceType
Maybe ProductionVariantServerlessConfig
Text
modelName :: Text
variantName :: Text
volumeSizeInGB :: Maybe Natural
serverlessConfig :: Maybe ProductionVariantServerlessConfig
modelDataDownloadTimeoutInSeconds :: Maybe Natural
instanceType :: Maybe ProductionVariantInstanceType
initialVariantWeight :: Maybe Double
initialInstanceCount :: Maybe Natural
coreDumpConfig :: Maybe ProductionVariantCoreDumpConfig
containerStartupHealthCheckTimeoutInSeconds :: Maybe Natural
acceleratorType :: Maybe ProductionVariantAcceleratorType
$sel:modelName:ProductionVariant' :: ProductionVariant -> Text
$sel:variantName:ProductionVariant' :: ProductionVariant -> Text
$sel:volumeSizeInGB:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:serverlessConfig:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantServerlessConfig
$sel:modelDataDownloadTimeoutInSeconds:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:instanceType:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantInstanceType
$sel:initialVariantWeight:ProductionVariant' :: ProductionVariant -> Maybe Double
$sel:initialInstanceCount:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:coreDumpConfig:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantCoreDumpConfig
$sel:containerStartupHealthCheckTimeoutInSeconds:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:acceleratorType:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantAcceleratorType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProductionVariantAcceleratorType
acceleratorType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
containerStartupHealthCheckTimeoutInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProductionVariantCoreDumpConfig
coreDumpConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
initialInstanceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
initialVariantWeight
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProductionVariantInstanceType
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
modelDataDownloadTimeoutInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProductionVariantServerlessConfig
serverlessConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
volumeSizeInGB
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
variantName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
modelName

instance Prelude.NFData ProductionVariant where
  rnf :: ProductionVariant -> ()
rnf ProductionVariant' {Maybe Double
Maybe Natural
Maybe ProductionVariantAcceleratorType
Maybe ProductionVariantCoreDumpConfig
Maybe ProductionVariantInstanceType
Maybe ProductionVariantServerlessConfig
Text
modelName :: Text
variantName :: Text
volumeSizeInGB :: Maybe Natural
serverlessConfig :: Maybe ProductionVariantServerlessConfig
modelDataDownloadTimeoutInSeconds :: Maybe Natural
instanceType :: Maybe ProductionVariantInstanceType
initialVariantWeight :: Maybe Double
initialInstanceCount :: Maybe Natural
coreDumpConfig :: Maybe ProductionVariantCoreDumpConfig
containerStartupHealthCheckTimeoutInSeconds :: Maybe Natural
acceleratorType :: Maybe ProductionVariantAcceleratorType
$sel:modelName:ProductionVariant' :: ProductionVariant -> Text
$sel:variantName:ProductionVariant' :: ProductionVariant -> Text
$sel:volumeSizeInGB:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:serverlessConfig:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantServerlessConfig
$sel:modelDataDownloadTimeoutInSeconds:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:instanceType:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantInstanceType
$sel:initialVariantWeight:ProductionVariant' :: ProductionVariant -> Maybe Double
$sel:initialInstanceCount:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:coreDumpConfig:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantCoreDumpConfig
$sel:containerStartupHealthCheckTimeoutInSeconds:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:acceleratorType:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantAcceleratorType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ProductionVariantAcceleratorType
acceleratorType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe Natural
containerStartupHealthCheckTimeoutInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProductionVariantCoreDumpConfig
coreDumpConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
initialInstanceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
initialVariantWeight
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProductionVariantInstanceType
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
modelDataDownloadTimeoutInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProductionVariantServerlessConfig
serverlessConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
volumeSizeInGB
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
variantName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
modelName

instance Data.ToJSON ProductionVariant where
  toJSON :: ProductionVariant -> Value
toJSON ProductionVariant' {Maybe Double
Maybe Natural
Maybe ProductionVariantAcceleratorType
Maybe ProductionVariantCoreDumpConfig
Maybe ProductionVariantInstanceType
Maybe ProductionVariantServerlessConfig
Text
modelName :: Text
variantName :: Text
volumeSizeInGB :: Maybe Natural
serverlessConfig :: Maybe ProductionVariantServerlessConfig
modelDataDownloadTimeoutInSeconds :: Maybe Natural
instanceType :: Maybe ProductionVariantInstanceType
initialVariantWeight :: Maybe Double
initialInstanceCount :: Maybe Natural
coreDumpConfig :: Maybe ProductionVariantCoreDumpConfig
containerStartupHealthCheckTimeoutInSeconds :: Maybe Natural
acceleratorType :: Maybe ProductionVariantAcceleratorType
$sel:modelName:ProductionVariant' :: ProductionVariant -> Text
$sel:variantName:ProductionVariant' :: ProductionVariant -> Text
$sel:volumeSizeInGB:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:serverlessConfig:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantServerlessConfig
$sel:modelDataDownloadTimeoutInSeconds:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:instanceType:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantInstanceType
$sel:initialVariantWeight:ProductionVariant' :: ProductionVariant -> Maybe Double
$sel:initialInstanceCount:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:coreDumpConfig:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantCoreDumpConfig
$sel:containerStartupHealthCheckTimeoutInSeconds:ProductionVariant' :: ProductionVariant -> Maybe Natural
$sel:acceleratorType:ProductionVariant' :: ProductionVariant -> Maybe ProductionVariantAcceleratorType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AcceleratorType" 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 ProductionVariantAcceleratorType
acceleratorType,
            ( Key
"ContainerStartupHealthCheckTimeoutInSeconds"
                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
containerStartupHealthCheckTimeoutInSeconds,
            (Key
"CoreDumpConfig" 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 ProductionVariantCoreDumpConfig
coreDumpConfig,
            (Key
"InitialInstanceCount" 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
initialInstanceCount,
            (Key
"InitialVariantWeight" 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
initialVariantWeight,
            (Key
"InstanceType" 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 ProductionVariantInstanceType
instanceType,
            (Key
"ModelDataDownloadTimeoutInSeconds" 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
modelDataDownloadTimeoutInSeconds,
            (Key
"ServerlessConfig" 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 ProductionVariantServerlessConfig
serverlessConfig,
            (Key
"VolumeSizeInGB" 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
volumeSizeInGB,
            forall a. a -> Maybe a
Prelude.Just (Key
"VariantName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
variantName),
            forall a. a -> Maybe a
Prelude.Just (Key
"ModelName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
modelName)
          ]
      )