{-# 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.ModelVariantConfigSummary
-- 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.ModelVariantConfigSummary 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.ModelInfrastructureConfig
import Amazonka.SageMaker.Types.ModelVariantStatus

-- | Summary of the deployment configuration of a model.
--
-- /See:/ 'newModelVariantConfigSummary' smart constructor.
data ModelVariantConfigSummary = ModelVariantConfigSummary'
  { -- | The name of the Amazon SageMaker Model entity.
    ModelVariantConfigSummary -> Text
modelName :: Prelude.Text,
    -- | The name of the variant.
    ModelVariantConfigSummary -> Text
variantName :: Prelude.Text,
    -- | The configuration of the infrastructure that the model has been deployed
    -- to.
    ModelVariantConfigSummary -> ModelInfrastructureConfig
infrastructureConfig :: ModelInfrastructureConfig,
    -- | The status of deployment for the model variant on the hosted inference
    -- endpoint.
    --
    -- -   @Creating@ - Amazon SageMaker is preparing the model variant on the
    --     hosted inference endpoint.
    --
    -- -   @InService@ - The model variant is running on the hosted inference
    --     endpoint.
    --
    -- -   @Updating@ - Amazon SageMaker is updating the model variant on the
    --     hosted inference endpoint.
    --
    -- -   @Deleting@ - Amazon SageMaker is deleting the model variant on the
    --     hosted inference endpoint.
    --
    -- -   @Deleted@ - The model variant has been deleted on the hosted
    --     inference endpoint. This can only happen after stopping the
    --     experiment.
    ModelVariantConfigSummary -> ModelVariantStatus
status :: ModelVariantStatus
  }
  deriving (ModelVariantConfigSummary -> ModelVariantConfigSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelVariantConfigSummary -> ModelVariantConfigSummary -> Bool
$c/= :: ModelVariantConfigSummary -> ModelVariantConfigSummary -> Bool
== :: ModelVariantConfigSummary -> ModelVariantConfigSummary -> Bool
$c== :: ModelVariantConfigSummary -> ModelVariantConfigSummary -> Bool
Prelude.Eq, ReadPrec [ModelVariantConfigSummary]
ReadPrec ModelVariantConfigSummary
Int -> ReadS ModelVariantConfigSummary
ReadS [ModelVariantConfigSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelVariantConfigSummary]
$creadListPrec :: ReadPrec [ModelVariantConfigSummary]
readPrec :: ReadPrec ModelVariantConfigSummary
$creadPrec :: ReadPrec ModelVariantConfigSummary
readList :: ReadS [ModelVariantConfigSummary]
$creadList :: ReadS [ModelVariantConfigSummary]
readsPrec :: Int -> ReadS ModelVariantConfigSummary
$creadsPrec :: Int -> ReadS ModelVariantConfigSummary
Prelude.Read, Int -> ModelVariantConfigSummary -> ShowS
[ModelVariantConfigSummary] -> ShowS
ModelVariantConfigSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelVariantConfigSummary] -> ShowS
$cshowList :: [ModelVariantConfigSummary] -> ShowS
show :: ModelVariantConfigSummary -> String
$cshow :: ModelVariantConfigSummary -> String
showsPrec :: Int -> ModelVariantConfigSummary -> ShowS
$cshowsPrec :: Int -> ModelVariantConfigSummary -> ShowS
Prelude.Show, forall x.
Rep ModelVariantConfigSummary x -> ModelVariantConfigSummary
forall x.
ModelVariantConfigSummary -> Rep ModelVariantConfigSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModelVariantConfigSummary x -> ModelVariantConfigSummary
$cfrom :: forall x.
ModelVariantConfigSummary -> Rep ModelVariantConfigSummary x
Prelude.Generic)

-- |
-- Create a value of 'ModelVariantConfigSummary' 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:
--
-- 'modelName', 'modelVariantConfigSummary_modelName' - The name of the Amazon SageMaker Model entity.
--
-- 'variantName', 'modelVariantConfigSummary_variantName' - The name of the variant.
--
-- 'infrastructureConfig', 'modelVariantConfigSummary_infrastructureConfig' - The configuration of the infrastructure that the model has been deployed
-- to.
--
-- 'status', 'modelVariantConfigSummary_status' - The status of deployment for the model variant on the hosted inference
-- endpoint.
--
-- -   @Creating@ - Amazon SageMaker is preparing the model variant on the
--     hosted inference endpoint.
--
-- -   @InService@ - The model variant is running on the hosted inference
--     endpoint.
--
-- -   @Updating@ - Amazon SageMaker is updating the model variant on the
--     hosted inference endpoint.
--
-- -   @Deleting@ - Amazon SageMaker is deleting the model variant on the
--     hosted inference endpoint.
--
-- -   @Deleted@ - The model variant has been deleted on the hosted
--     inference endpoint. This can only happen after stopping the
--     experiment.
newModelVariantConfigSummary ::
  -- | 'modelName'
  Prelude.Text ->
  -- | 'variantName'
  Prelude.Text ->
  -- | 'infrastructureConfig'
  ModelInfrastructureConfig ->
  -- | 'status'
  ModelVariantStatus ->
  ModelVariantConfigSummary
newModelVariantConfigSummary :: Text
-> Text
-> ModelInfrastructureConfig
-> ModelVariantStatus
-> ModelVariantConfigSummary
newModelVariantConfigSummary
  Text
pModelName_
  Text
pVariantName_
  ModelInfrastructureConfig
pInfrastructureConfig_
  ModelVariantStatus
pStatus_ =
    ModelVariantConfigSummary'
      { $sel:modelName:ModelVariantConfigSummary' :: Text
modelName = Text
pModelName_,
        $sel:variantName:ModelVariantConfigSummary' :: Text
variantName = Text
pVariantName_,
        $sel:infrastructureConfig:ModelVariantConfigSummary' :: ModelInfrastructureConfig
infrastructureConfig = ModelInfrastructureConfig
pInfrastructureConfig_,
        $sel:status:ModelVariantConfigSummary' :: ModelVariantStatus
status = ModelVariantStatus
pStatus_
      }

-- | The name of the Amazon SageMaker Model entity.
modelVariantConfigSummary_modelName :: Lens.Lens' ModelVariantConfigSummary Prelude.Text
modelVariantConfigSummary_modelName :: Lens' ModelVariantConfigSummary Text
modelVariantConfigSummary_modelName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelVariantConfigSummary' {Text
modelName :: Text
$sel:modelName:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> Text
modelName} -> Text
modelName) (\s :: ModelVariantConfigSummary
s@ModelVariantConfigSummary' {} Text
a -> ModelVariantConfigSummary
s {$sel:modelName:ModelVariantConfigSummary' :: Text
modelName = Text
a} :: ModelVariantConfigSummary)

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

-- | The configuration of the infrastructure that the model has been deployed
-- to.
modelVariantConfigSummary_infrastructureConfig :: Lens.Lens' ModelVariantConfigSummary ModelInfrastructureConfig
modelVariantConfigSummary_infrastructureConfig :: Lens' ModelVariantConfigSummary ModelInfrastructureConfig
modelVariantConfigSummary_infrastructureConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelVariantConfigSummary' {ModelInfrastructureConfig
infrastructureConfig :: ModelInfrastructureConfig
$sel:infrastructureConfig:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> ModelInfrastructureConfig
infrastructureConfig} -> ModelInfrastructureConfig
infrastructureConfig) (\s :: ModelVariantConfigSummary
s@ModelVariantConfigSummary' {} ModelInfrastructureConfig
a -> ModelVariantConfigSummary
s {$sel:infrastructureConfig:ModelVariantConfigSummary' :: ModelInfrastructureConfig
infrastructureConfig = ModelInfrastructureConfig
a} :: ModelVariantConfigSummary)

-- | The status of deployment for the model variant on the hosted inference
-- endpoint.
--
-- -   @Creating@ - Amazon SageMaker is preparing the model variant on the
--     hosted inference endpoint.
--
-- -   @InService@ - The model variant is running on the hosted inference
--     endpoint.
--
-- -   @Updating@ - Amazon SageMaker is updating the model variant on the
--     hosted inference endpoint.
--
-- -   @Deleting@ - Amazon SageMaker is deleting the model variant on the
--     hosted inference endpoint.
--
-- -   @Deleted@ - The model variant has been deleted on the hosted
--     inference endpoint. This can only happen after stopping the
--     experiment.
modelVariantConfigSummary_status :: Lens.Lens' ModelVariantConfigSummary ModelVariantStatus
modelVariantConfigSummary_status :: Lens' ModelVariantConfigSummary ModelVariantStatus
modelVariantConfigSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelVariantConfigSummary' {ModelVariantStatus
status :: ModelVariantStatus
$sel:status:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> ModelVariantStatus
status} -> ModelVariantStatus
status) (\s :: ModelVariantConfigSummary
s@ModelVariantConfigSummary' {} ModelVariantStatus
a -> ModelVariantConfigSummary
s {$sel:status:ModelVariantConfigSummary' :: ModelVariantStatus
status = ModelVariantStatus
a} :: ModelVariantConfigSummary)

instance Data.FromJSON ModelVariantConfigSummary where
  parseJSON :: Value -> Parser ModelVariantConfigSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ModelVariantConfigSummary"
      ( \Object
x ->
          Text
-> Text
-> ModelInfrastructureConfig
-> ModelVariantStatus
-> ModelVariantConfigSummary
ModelVariantConfigSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ModelName")
            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
"InfrastructureConfig")
            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
"Status")
      )

instance Prelude.Hashable ModelVariantConfigSummary where
  hashWithSalt :: Int -> ModelVariantConfigSummary -> Int
hashWithSalt Int
_salt ModelVariantConfigSummary' {Text
ModelVariantStatus
ModelInfrastructureConfig
status :: ModelVariantStatus
infrastructureConfig :: ModelInfrastructureConfig
variantName :: Text
modelName :: Text
$sel:status:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> ModelVariantStatus
$sel:infrastructureConfig:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> ModelInfrastructureConfig
$sel:variantName:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> Text
$sel:modelName:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
modelName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
variantName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ModelInfrastructureConfig
infrastructureConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ModelVariantStatus
status

instance Prelude.NFData ModelVariantConfigSummary where
  rnf :: ModelVariantConfigSummary -> ()
rnf ModelVariantConfigSummary' {Text
ModelVariantStatus
ModelInfrastructureConfig
status :: ModelVariantStatus
infrastructureConfig :: ModelInfrastructureConfig
variantName :: Text
modelName :: Text
$sel:status:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> ModelVariantStatus
$sel:infrastructureConfig:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> ModelInfrastructureConfig
$sel:variantName:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> Text
$sel:modelName:ModelVariantConfigSummary' :: ModelVariantConfigSummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
modelName
      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 ModelInfrastructureConfig
infrastructureConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ModelVariantStatus
status