{-# 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.GamesParks.Types.StageDeploymentSummary
-- 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.GamesParks.Types.StageDeploymentSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GamesParks.Types.DeploymentAction
import Amazonka.GamesParks.Types.DeploymentResult
import Amazonka.GamesParks.Types.DeploymentState
import qualified Amazonka.Prelude as Prelude

-- | The summary of the properties of a stage deployment.
--
-- /See:/ 'newStageDeploymentSummary' smart constructor.
data StageDeploymentSummary = StageDeploymentSummary'
  { -- | The type of action of the deployment.
    StageDeploymentSummary -> Maybe DeploymentAction
deploymentAction :: Prelude.Maybe DeploymentAction,
    -- | The identifier of the deployment.
    StageDeploymentSummary -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | The result of the deployment.
    StageDeploymentSummary -> Maybe DeploymentResult
deploymentResult :: Prelude.Maybe DeploymentResult,
    -- | The state of the deployment.
    StageDeploymentSummary -> Maybe DeploymentState
deploymentState :: Prelude.Maybe DeploymentState,
    -- | The timestamp of when the deployment was last updated.
    StageDeploymentSummary -> Maybe ISO8601
lastUpdated :: Prelude.Maybe Data.ISO8601,
    -- | The identifier of the snapshot associated with the stage deployment.
    StageDeploymentSummary -> Maybe Text
snapshotId :: Prelude.Maybe Prelude.Text
  }
  deriving (StageDeploymentSummary -> StageDeploymentSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StageDeploymentSummary -> StageDeploymentSummary -> Bool
$c/= :: StageDeploymentSummary -> StageDeploymentSummary -> Bool
== :: StageDeploymentSummary -> StageDeploymentSummary -> Bool
$c== :: StageDeploymentSummary -> StageDeploymentSummary -> Bool
Prelude.Eq, ReadPrec [StageDeploymentSummary]
ReadPrec StageDeploymentSummary
Int -> ReadS StageDeploymentSummary
ReadS [StageDeploymentSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StageDeploymentSummary]
$creadListPrec :: ReadPrec [StageDeploymentSummary]
readPrec :: ReadPrec StageDeploymentSummary
$creadPrec :: ReadPrec StageDeploymentSummary
readList :: ReadS [StageDeploymentSummary]
$creadList :: ReadS [StageDeploymentSummary]
readsPrec :: Int -> ReadS StageDeploymentSummary
$creadsPrec :: Int -> ReadS StageDeploymentSummary
Prelude.Read, Int -> StageDeploymentSummary -> ShowS
[StageDeploymentSummary] -> ShowS
StageDeploymentSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StageDeploymentSummary] -> ShowS
$cshowList :: [StageDeploymentSummary] -> ShowS
show :: StageDeploymentSummary -> String
$cshow :: StageDeploymentSummary -> String
showsPrec :: Int -> StageDeploymentSummary -> ShowS
$cshowsPrec :: Int -> StageDeploymentSummary -> ShowS
Prelude.Show, forall x. Rep StageDeploymentSummary x -> StageDeploymentSummary
forall x. StageDeploymentSummary -> Rep StageDeploymentSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StageDeploymentSummary x -> StageDeploymentSummary
$cfrom :: forall x. StageDeploymentSummary -> Rep StageDeploymentSummary x
Prelude.Generic)

-- |
-- Create a value of 'StageDeploymentSummary' 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:
--
-- 'deploymentAction', 'stageDeploymentSummary_deploymentAction' - The type of action of the deployment.
--
-- 'deploymentId', 'stageDeploymentSummary_deploymentId' - The identifier of the deployment.
--
-- 'deploymentResult', 'stageDeploymentSummary_deploymentResult' - The result of the deployment.
--
-- 'deploymentState', 'stageDeploymentSummary_deploymentState' - The state of the deployment.
--
-- 'lastUpdated', 'stageDeploymentSummary_lastUpdated' - The timestamp of when the deployment was last updated.
--
-- 'snapshotId', 'stageDeploymentSummary_snapshotId' - The identifier of the snapshot associated with the stage deployment.
newStageDeploymentSummary ::
  StageDeploymentSummary
newStageDeploymentSummary :: StageDeploymentSummary
newStageDeploymentSummary =
  StageDeploymentSummary'
    { $sel:deploymentAction:StageDeploymentSummary' :: Maybe DeploymentAction
deploymentAction =
        forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentId:StageDeploymentSummary' :: Maybe Text
deploymentId = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentResult:StageDeploymentSummary' :: Maybe DeploymentResult
deploymentResult = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentState:StageDeploymentSummary' :: Maybe DeploymentState
deploymentState = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdated:StageDeploymentSummary' :: Maybe ISO8601
lastUpdated = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:StageDeploymentSummary' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of action of the deployment.
stageDeploymentSummary_deploymentAction :: Lens.Lens' StageDeploymentSummary (Prelude.Maybe DeploymentAction)
stageDeploymentSummary_deploymentAction :: Lens' StageDeploymentSummary (Maybe DeploymentAction)
stageDeploymentSummary_deploymentAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentSummary' {Maybe DeploymentAction
deploymentAction :: Maybe DeploymentAction
$sel:deploymentAction:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentAction
deploymentAction} -> Maybe DeploymentAction
deploymentAction) (\s :: StageDeploymentSummary
s@StageDeploymentSummary' {} Maybe DeploymentAction
a -> StageDeploymentSummary
s {$sel:deploymentAction:StageDeploymentSummary' :: Maybe DeploymentAction
deploymentAction = Maybe DeploymentAction
a} :: StageDeploymentSummary)

-- | The identifier of the deployment.
stageDeploymentSummary_deploymentId :: Lens.Lens' StageDeploymentSummary (Prelude.Maybe Prelude.Text)
stageDeploymentSummary_deploymentId :: Lens' StageDeploymentSummary (Maybe Text)
stageDeploymentSummary_deploymentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentSummary' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: StageDeploymentSummary
s@StageDeploymentSummary' {} Maybe Text
a -> StageDeploymentSummary
s {$sel:deploymentId:StageDeploymentSummary' :: Maybe Text
deploymentId = Maybe Text
a} :: StageDeploymentSummary)

-- | The result of the deployment.
stageDeploymentSummary_deploymentResult :: Lens.Lens' StageDeploymentSummary (Prelude.Maybe DeploymentResult)
stageDeploymentSummary_deploymentResult :: Lens' StageDeploymentSummary (Maybe DeploymentResult)
stageDeploymentSummary_deploymentResult = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentSummary' {Maybe DeploymentResult
deploymentResult :: Maybe DeploymentResult
$sel:deploymentResult:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentResult
deploymentResult} -> Maybe DeploymentResult
deploymentResult) (\s :: StageDeploymentSummary
s@StageDeploymentSummary' {} Maybe DeploymentResult
a -> StageDeploymentSummary
s {$sel:deploymentResult:StageDeploymentSummary' :: Maybe DeploymentResult
deploymentResult = Maybe DeploymentResult
a} :: StageDeploymentSummary)

-- | The state of the deployment.
stageDeploymentSummary_deploymentState :: Lens.Lens' StageDeploymentSummary (Prelude.Maybe DeploymentState)
stageDeploymentSummary_deploymentState :: Lens' StageDeploymentSummary (Maybe DeploymentState)
stageDeploymentSummary_deploymentState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentSummary' {Maybe DeploymentState
deploymentState :: Maybe DeploymentState
$sel:deploymentState:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentState
deploymentState} -> Maybe DeploymentState
deploymentState) (\s :: StageDeploymentSummary
s@StageDeploymentSummary' {} Maybe DeploymentState
a -> StageDeploymentSummary
s {$sel:deploymentState:StageDeploymentSummary' :: Maybe DeploymentState
deploymentState = Maybe DeploymentState
a} :: StageDeploymentSummary)

-- | The timestamp of when the deployment was last updated.
stageDeploymentSummary_lastUpdated :: Lens.Lens' StageDeploymentSummary (Prelude.Maybe Prelude.UTCTime)
stageDeploymentSummary_lastUpdated :: Lens' StageDeploymentSummary (Maybe UTCTime)
stageDeploymentSummary_lastUpdated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentSummary' {Maybe ISO8601
lastUpdated :: Maybe ISO8601
$sel:lastUpdated:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe ISO8601
lastUpdated} -> Maybe ISO8601
lastUpdated) (\s :: StageDeploymentSummary
s@StageDeploymentSummary' {} Maybe ISO8601
a -> StageDeploymentSummary
s {$sel:lastUpdated:StageDeploymentSummary' :: Maybe ISO8601
lastUpdated = Maybe ISO8601
a} :: StageDeploymentSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The identifier of the snapshot associated with the stage deployment.
stageDeploymentSummary_snapshotId :: Lens.Lens' StageDeploymentSummary (Prelude.Maybe Prelude.Text)
stageDeploymentSummary_snapshotId :: Lens' StageDeploymentSummary (Maybe Text)
stageDeploymentSummary_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentSummary' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: StageDeploymentSummary
s@StageDeploymentSummary' {} Maybe Text
a -> StageDeploymentSummary
s {$sel:snapshotId:StageDeploymentSummary' :: Maybe Text
snapshotId = Maybe Text
a} :: StageDeploymentSummary)

instance Data.FromJSON StageDeploymentSummary where
  parseJSON :: Value -> Parser StageDeploymentSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StageDeploymentSummary"
      ( \Object
x ->
          Maybe DeploymentAction
-> Maybe Text
-> Maybe DeploymentResult
-> Maybe DeploymentState
-> Maybe ISO8601
-> Maybe Text
-> StageDeploymentSummary
StageDeploymentSummary'
            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
"DeploymentAction")
            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
"DeploymentId")
            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
"DeploymentResult")
            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
"DeploymentState")
            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
"LastUpdated")
            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
"SnapshotId")
      )

instance Prelude.Hashable StageDeploymentSummary where
  hashWithSalt :: Int -> StageDeploymentSummary -> Int
hashWithSalt Int
_salt StageDeploymentSummary' {Maybe Text
Maybe ISO8601
Maybe DeploymentAction
Maybe DeploymentState
Maybe DeploymentResult
snapshotId :: Maybe Text
lastUpdated :: Maybe ISO8601
deploymentState :: Maybe DeploymentState
deploymentResult :: Maybe DeploymentResult
deploymentId :: Maybe Text
deploymentAction :: Maybe DeploymentAction
$sel:snapshotId:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe Text
$sel:lastUpdated:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe ISO8601
$sel:deploymentState:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentState
$sel:deploymentResult:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentResult
$sel:deploymentId:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe Text
$sel:deploymentAction:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentAction
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeploymentAction
deploymentAction
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deploymentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeploymentResult
deploymentResult
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeploymentState
deploymentState
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
lastUpdated
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotId

instance Prelude.NFData StageDeploymentSummary where
  rnf :: StageDeploymentSummary -> ()
rnf StageDeploymentSummary' {Maybe Text
Maybe ISO8601
Maybe DeploymentAction
Maybe DeploymentState
Maybe DeploymentResult
snapshotId :: Maybe Text
lastUpdated :: Maybe ISO8601
deploymentState :: Maybe DeploymentState
deploymentResult :: Maybe DeploymentResult
deploymentId :: Maybe Text
deploymentAction :: Maybe DeploymentAction
$sel:snapshotId:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe Text
$sel:lastUpdated:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe ISO8601
$sel:deploymentState:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentState
$sel:deploymentResult:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentResult
$sel:deploymentId:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe Text
$sel:deploymentAction:StageDeploymentSummary' :: StageDeploymentSummary -> Maybe DeploymentAction
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentAction
deploymentAction
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deploymentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentResult
deploymentResult
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentState
deploymentState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
lastUpdated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotId