{-# 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.DeploymentStageStatusSummary
-- 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.DeploymentStageStatusSummary 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.DeviceSelectionConfig
import Amazonka.SageMaker.Types.EdgeDeploymentConfig
import Amazonka.SageMaker.Types.EdgeDeploymentStatus

-- | Contains information summarizing the deployment stage results.
--
-- /See:/ 'newDeploymentStageStatusSummary' smart constructor.
data DeploymentStageStatusSummary = DeploymentStageStatusSummary'
  { -- | The name of the stage.
    DeploymentStageStatusSummary -> Text
stageName :: Prelude.Text,
    -- | Configuration of the devices in the stage.
    DeploymentStageStatusSummary -> DeviceSelectionConfig
deviceSelectionConfig :: DeviceSelectionConfig,
    -- | Configuration of the deployment details.
    DeploymentStageStatusSummary -> EdgeDeploymentConfig
deploymentConfig :: EdgeDeploymentConfig,
    -- | General status of the current state.
    DeploymentStageStatusSummary -> EdgeDeploymentStatus
deploymentStatus :: EdgeDeploymentStatus
  }
  deriving (DeploymentStageStatusSummary
-> DeploymentStageStatusSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentStageStatusSummary
-> DeploymentStageStatusSummary -> Bool
$c/= :: DeploymentStageStatusSummary
-> DeploymentStageStatusSummary -> Bool
== :: DeploymentStageStatusSummary
-> DeploymentStageStatusSummary -> Bool
$c== :: DeploymentStageStatusSummary
-> DeploymentStageStatusSummary -> Bool
Prelude.Eq, ReadPrec [DeploymentStageStatusSummary]
ReadPrec DeploymentStageStatusSummary
Int -> ReadS DeploymentStageStatusSummary
ReadS [DeploymentStageStatusSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentStageStatusSummary]
$creadListPrec :: ReadPrec [DeploymentStageStatusSummary]
readPrec :: ReadPrec DeploymentStageStatusSummary
$creadPrec :: ReadPrec DeploymentStageStatusSummary
readList :: ReadS [DeploymentStageStatusSummary]
$creadList :: ReadS [DeploymentStageStatusSummary]
readsPrec :: Int -> ReadS DeploymentStageStatusSummary
$creadsPrec :: Int -> ReadS DeploymentStageStatusSummary
Prelude.Read, Int -> DeploymentStageStatusSummary -> ShowS
[DeploymentStageStatusSummary] -> ShowS
DeploymentStageStatusSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentStageStatusSummary] -> ShowS
$cshowList :: [DeploymentStageStatusSummary] -> ShowS
show :: DeploymentStageStatusSummary -> String
$cshow :: DeploymentStageStatusSummary -> String
showsPrec :: Int -> DeploymentStageStatusSummary -> ShowS
$cshowsPrec :: Int -> DeploymentStageStatusSummary -> ShowS
Prelude.Show, forall x.
Rep DeploymentStageStatusSummary x -> DeploymentStageStatusSummary
forall x.
DeploymentStageStatusSummary -> Rep DeploymentStageStatusSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeploymentStageStatusSummary x -> DeploymentStageStatusSummary
$cfrom :: forall x.
DeploymentStageStatusSummary -> Rep DeploymentStageStatusSummary x
Prelude.Generic)

-- |
-- Create a value of 'DeploymentStageStatusSummary' 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:
--
-- 'stageName', 'deploymentStageStatusSummary_stageName' - The name of the stage.
--
-- 'deviceSelectionConfig', 'deploymentStageStatusSummary_deviceSelectionConfig' - Configuration of the devices in the stage.
--
-- 'deploymentConfig', 'deploymentStageStatusSummary_deploymentConfig' - Configuration of the deployment details.
--
-- 'deploymentStatus', 'deploymentStageStatusSummary_deploymentStatus' - General status of the current state.
newDeploymentStageStatusSummary ::
  -- | 'stageName'
  Prelude.Text ->
  -- | 'deviceSelectionConfig'
  DeviceSelectionConfig ->
  -- | 'deploymentConfig'
  EdgeDeploymentConfig ->
  -- | 'deploymentStatus'
  EdgeDeploymentStatus ->
  DeploymentStageStatusSummary
newDeploymentStageStatusSummary :: Text
-> DeviceSelectionConfig
-> EdgeDeploymentConfig
-> EdgeDeploymentStatus
-> DeploymentStageStatusSummary
newDeploymentStageStatusSummary
  Text
pStageName_
  DeviceSelectionConfig
pDeviceSelectionConfig_
  EdgeDeploymentConfig
pDeploymentConfig_
  EdgeDeploymentStatus
pDeploymentStatus_ =
    DeploymentStageStatusSummary'
      { $sel:stageName:DeploymentStageStatusSummary' :: Text
stageName =
          Text
pStageName_,
        $sel:deviceSelectionConfig:DeploymentStageStatusSummary' :: DeviceSelectionConfig
deviceSelectionConfig =
          DeviceSelectionConfig
pDeviceSelectionConfig_,
        $sel:deploymentConfig:DeploymentStageStatusSummary' :: EdgeDeploymentConfig
deploymentConfig = EdgeDeploymentConfig
pDeploymentConfig_,
        $sel:deploymentStatus:DeploymentStageStatusSummary' :: EdgeDeploymentStatus
deploymentStatus = EdgeDeploymentStatus
pDeploymentStatus_
      }

-- | The name of the stage.
deploymentStageStatusSummary_stageName :: Lens.Lens' DeploymentStageStatusSummary Prelude.Text
deploymentStageStatusSummary_stageName :: Lens' DeploymentStageStatusSummary Text
deploymentStageStatusSummary_stageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStageStatusSummary' {Text
stageName :: Text
$sel:stageName:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> Text
stageName} -> Text
stageName) (\s :: DeploymentStageStatusSummary
s@DeploymentStageStatusSummary' {} Text
a -> DeploymentStageStatusSummary
s {$sel:stageName:DeploymentStageStatusSummary' :: Text
stageName = Text
a} :: DeploymentStageStatusSummary)

-- | Configuration of the devices in the stage.
deploymentStageStatusSummary_deviceSelectionConfig :: Lens.Lens' DeploymentStageStatusSummary DeviceSelectionConfig
deploymentStageStatusSummary_deviceSelectionConfig :: Lens' DeploymentStageStatusSummary DeviceSelectionConfig
deploymentStageStatusSummary_deviceSelectionConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStageStatusSummary' {DeviceSelectionConfig
deviceSelectionConfig :: DeviceSelectionConfig
$sel:deviceSelectionConfig:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> DeviceSelectionConfig
deviceSelectionConfig} -> DeviceSelectionConfig
deviceSelectionConfig) (\s :: DeploymentStageStatusSummary
s@DeploymentStageStatusSummary' {} DeviceSelectionConfig
a -> DeploymentStageStatusSummary
s {$sel:deviceSelectionConfig:DeploymentStageStatusSummary' :: DeviceSelectionConfig
deviceSelectionConfig = DeviceSelectionConfig
a} :: DeploymentStageStatusSummary)

-- | Configuration of the deployment details.
deploymentStageStatusSummary_deploymentConfig :: Lens.Lens' DeploymentStageStatusSummary EdgeDeploymentConfig
deploymentStageStatusSummary_deploymentConfig :: Lens' DeploymentStageStatusSummary EdgeDeploymentConfig
deploymentStageStatusSummary_deploymentConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStageStatusSummary' {EdgeDeploymentConfig
deploymentConfig :: EdgeDeploymentConfig
$sel:deploymentConfig:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> EdgeDeploymentConfig
deploymentConfig} -> EdgeDeploymentConfig
deploymentConfig) (\s :: DeploymentStageStatusSummary
s@DeploymentStageStatusSummary' {} EdgeDeploymentConfig
a -> DeploymentStageStatusSummary
s {$sel:deploymentConfig:DeploymentStageStatusSummary' :: EdgeDeploymentConfig
deploymentConfig = EdgeDeploymentConfig
a} :: DeploymentStageStatusSummary)

-- | General status of the current state.
deploymentStageStatusSummary_deploymentStatus :: Lens.Lens' DeploymentStageStatusSummary EdgeDeploymentStatus
deploymentStageStatusSummary_deploymentStatus :: Lens' DeploymentStageStatusSummary EdgeDeploymentStatus
deploymentStageStatusSummary_deploymentStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStageStatusSummary' {EdgeDeploymentStatus
deploymentStatus :: EdgeDeploymentStatus
$sel:deploymentStatus:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> EdgeDeploymentStatus
deploymentStatus} -> EdgeDeploymentStatus
deploymentStatus) (\s :: DeploymentStageStatusSummary
s@DeploymentStageStatusSummary' {} EdgeDeploymentStatus
a -> DeploymentStageStatusSummary
s {$sel:deploymentStatus:DeploymentStageStatusSummary' :: EdgeDeploymentStatus
deploymentStatus = EdgeDeploymentStatus
a} :: DeploymentStageStatusSummary)

instance Data.FromJSON DeploymentStageStatusSummary where
  parseJSON :: Value -> Parser DeploymentStageStatusSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DeploymentStageStatusSummary"
      ( \Object
x ->
          Text
-> DeviceSelectionConfig
-> EdgeDeploymentConfig
-> EdgeDeploymentStatus
-> DeploymentStageStatusSummary
DeploymentStageStatusSummary'
            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
"StageName")
            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
"DeviceSelectionConfig")
            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
"DeploymentConfig")
            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
"DeploymentStatus")
      )

instance
  Prelude.Hashable
    DeploymentStageStatusSummary
  where
  hashWithSalt :: Int -> DeploymentStageStatusSummary -> Int
hashWithSalt Int
_salt DeploymentStageStatusSummary' {Text
DeviceSelectionConfig
EdgeDeploymentConfig
EdgeDeploymentStatus
deploymentStatus :: EdgeDeploymentStatus
deploymentConfig :: EdgeDeploymentConfig
deviceSelectionConfig :: DeviceSelectionConfig
stageName :: Text
$sel:deploymentStatus:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> EdgeDeploymentStatus
$sel:deploymentConfig:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> EdgeDeploymentConfig
$sel:deviceSelectionConfig:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> DeviceSelectionConfig
$sel:stageName:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stageName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DeviceSelectionConfig
deviceSelectionConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EdgeDeploymentConfig
deploymentConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EdgeDeploymentStatus
deploymentStatus

instance Prelude.NFData DeploymentStageStatusSummary where
  rnf :: DeploymentStageStatusSummary -> ()
rnf DeploymentStageStatusSummary' {Text
DeviceSelectionConfig
EdgeDeploymentConfig
EdgeDeploymentStatus
deploymentStatus :: EdgeDeploymentStatus
deploymentConfig :: EdgeDeploymentConfig
deviceSelectionConfig :: DeviceSelectionConfig
stageName :: Text
$sel:deploymentStatus:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> EdgeDeploymentStatus
$sel:deploymentConfig:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> EdgeDeploymentConfig
$sel:deviceSelectionConfig:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> DeviceSelectionConfig
$sel:stageName:DeploymentStageStatusSummary' :: DeploymentStageStatusSummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
stageName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DeviceSelectionConfig
deviceSelectionConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EdgeDeploymentConfig
deploymentConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EdgeDeploymentStatus
deploymentStatus