{-# 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.StageDeploymentDetails
-- 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.StageDeploymentDetails 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

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

-- |
-- Create a value of 'StageDeploymentDetails' 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:
--
-- 'created', 'stageDeploymentDetails_created' - The timestamp of when the stage deployment was created.
--
-- 'deploymentAction', 'stageDeploymentDetails_deploymentAction' - The type of action of the stage deployment.
--
-- 'deploymentId', 'stageDeploymentDetails_deploymentId' - The identifier of the deployment.
--
-- 'deploymentResult', 'stageDeploymentDetails_deploymentResult' - The result of the deployment.
--
-- 'deploymentState', 'stageDeploymentDetails_deploymentState' - The state of the deployment.
--
-- 'lastUpdated', 'stageDeploymentDetails_lastUpdated' - The timestamp of when the deployment was last updated.
--
-- 'snapshotId', 'stageDeploymentDetails_snapshotId' - The identifier of the snapshot associated with the stage deployment.
newStageDeploymentDetails ::
  StageDeploymentDetails
newStageDeploymentDetails :: StageDeploymentDetails
newStageDeploymentDetails =
  StageDeploymentDetails'
    { $sel:created:StageDeploymentDetails' :: Maybe ISO8601
created = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentAction:StageDeploymentDetails' :: Maybe DeploymentAction
deploymentAction = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentId:StageDeploymentDetails' :: Maybe Text
deploymentId = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentResult:StageDeploymentDetails' :: Maybe DeploymentResult
deploymentResult = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentState:StageDeploymentDetails' :: Maybe DeploymentState
deploymentState = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdated:StageDeploymentDetails' :: Maybe ISO8601
lastUpdated = forall a. Maybe a
Prelude.Nothing,
      $sel:snapshotId:StageDeploymentDetails' :: Maybe Text
snapshotId = forall a. Maybe a
Prelude.Nothing
    }

-- | The timestamp of when the stage deployment was created.
stageDeploymentDetails_created :: Lens.Lens' StageDeploymentDetails (Prelude.Maybe Prelude.UTCTime)
stageDeploymentDetails_created :: Lens' StageDeploymentDetails (Maybe UTCTime)
stageDeploymentDetails_created = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentDetails' {Maybe ISO8601
created :: Maybe ISO8601
$sel:created:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe ISO8601
created} -> Maybe ISO8601
created) (\s :: StageDeploymentDetails
s@StageDeploymentDetails' {} Maybe ISO8601
a -> StageDeploymentDetails
s {$sel:created:StageDeploymentDetails' :: Maybe ISO8601
created = Maybe ISO8601
a} :: StageDeploymentDetails) 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 type of action of the stage deployment.
stageDeploymentDetails_deploymentAction :: Lens.Lens' StageDeploymentDetails (Prelude.Maybe DeploymentAction)
stageDeploymentDetails_deploymentAction :: Lens' StageDeploymentDetails (Maybe DeploymentAction)
stageDeploymentDetails_deploymentAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentDetails' {Maybe DeploymentAction
deploymentAction :: Maybe DeploymentAction
$sel:deploymentAction:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe DeploymentAction
deploymentAction} -> Maybe DeploymentAction
deploymentAction) (\s :: StageDeploymentDetails
s@StageDeploymentDetails' {} Maybe DeploymentAction
a -> StageDeploymentDetails
s {$sel:deploymentAction:StageDeploymentDetails' :: Maybe DeploymentAction
deploymentAction = Maybe DeploymentAction
a} :: StageDeploymentDetails)

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

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

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

-- | The timestamp of when the deployment was last updated.
stageDeploymentDetails_lastUpdated :: Lens.Lens' StageDeploymentDetails (Prelude.Maybe Prelude.UTCTime)
stageDeploymentDetails_lastUpdated :: Lens' StageDeploymentDetails (Maybe UTCTime)
stageDeploymentDetails_lastUpdated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentDetails' {Maybe ISO8601
lastUpdated :: Maybe ISO8601
$sel:lastUpdated:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe ISO8601
lastUpdated} -> Maybe ISO8601
lastUpdated) (\s :: StageDeploymentDetails
s@StageDeploymentDetails' {} Maybe ISO8601
a -> StageDeploymentDetails
s {$sel:lastUpdated:StageDeploymentDetails' :: Maybe ISO8601
lastUpdated = Maybe ISO8601
a} :: StageDeploymentDetails) 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.
stageDeploymentDetails_snapshotId :: Lens.Lens' StageDeploymentDetails (Prelude.Maybe Prelude.Text)
stageDeploymentDetails_snapshotId :: Lens' StageDeploymentDetails (Maybe Text)
stageDeploymentDetails_snapshotId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageDeploymentDetails' {Maybe Text
snapshotId :: Maybe Text
$sel:snapshotId:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe Text
snapshotId} -> Maybe Text
snapshotId) (\s :: StageDeploymentDetails
s@StageDeploymentDetails' {} Maybe Text
a -> StageDeploymentDetails
s {$sel:snapshotId:StageDeploymentDetails' :: Maybe Text
snapshotId = Maybe Text
a} :: StageDeploymentDetails)

instance Data.FromJSON StageDeploymentDetails where
  parseJSON :: Value -> Parser StageDeploymentDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StageDeploymentDetails"
      ( \Object
x ->
          Maybe ISO8601
-> Maybe DeploymentAction
-> Maybe Text
-> Maybe DeploymentResult
-> Maybe DeploymentState
-> Maybe ISO8601
-> Maybe Text
-> StageDeploymentDetails
StageDeploymentDetails'
            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
"Created")
            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
"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 StageDeploymentDetails where
  hashWithSalt :: Int -> StageDeploymentDetails -> Int
hashWithSalt Int
_salt StageDeploymentDetails' {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
created :: Maybe ISO8601
$sel:snapshotId:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe Text
$sel:lastUpdated:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe ISO8601
$sel:deploymentState:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe DeploymentState
$sel:deploymentResult:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe DeploymentResult
$sel:deploymentId:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe Text
$sel:deploymentAction:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe DeploymentAction
$sel:created:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe ISO8601
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
created
      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 StageDeploymentDetails where
  rnf :: StageDeploymentDetails -> ()
rnf StageDeploymentDetails' {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
created :: Maybe ISO8601
$sel:snapshotId:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe Text
$sel:lastUpdated:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe ISO8601
$sel:deploymentState:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe DeploymentState
$sel:deploymentResult:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe DeploymentResult
$sel:deploymentId:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe Text
$sel:deploymentAction:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe DeploymentAction
$sel:created:StageDeploymentDetails' :: StageDeploymentDetails -> Maybe ISO8601
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
created
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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