{-# 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.AppConfig.Types.Deployment
-- 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.AppConfig.Types.Deployment where

import Amazonka.AppConfig.Types.AppliedExtension
import Amazonka.AppConfig.Types.DeploymentEvent
import Amazonka.AppConfig.Types.DeploymentState
import Amazonka.AppConfig.Types.GrowthType
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

-- | /See:/ 'newDeployment' smart constructor.
data Deployment = Deployment'
  { -- | The ID of the application that was deployed.
    Deployment -> Maybe Text
applicationId :: Prelude.Maybe Prelude.Text,
    -- | A list of extensions that were processed as part of the deployment. The
    -- extensions that were previously associated to the configuration profile,
    -- environment, or the application when @StartDeployment@ was called.
    Deployment -> Maybe [AppliedExtension]
appliedExtensions :: Prelude.Maybe [AppliedExtension],
    -- | The time the deployment completed.
    Deployment -> Maybe ISO8601
completedAt :: Prelude.Maybe Data.ISO8601,
    -- | Information about the source location of the configuration.
    Deployment -> Maybe Text
configurationLocationUri :: Prelude.Maybe Prelude.Text,
    -- | The name of the configuration.
    Deployment -> Maybe Text
configurationName :: Prelude.Maybe Prelude.Text,
    -- | The ID of the configuration profile that was deployed.
    Deployment -> Maybe Text
configurationProfileId :: Prelude.Maybe Prelude.Text,
    -- | The configuration version that was deployed.
    Deployment -> Maybe Text
configurationVersion :: Prelude.Maybe Prelude.Text,
    -- | Total amount of time the deployment lasted.
    Deployment -> Maybe Natural
deploymentDurationInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | The sequence number of the deployment.
    Deployment -> Maybe Int
deploymentNumber :: Prelude.Maybe Prelude.Int,
    -- | The ID of the deployment strategy that was deployed.
    Deployment -> Maybe Text
deploymentStrategyId :: Prelude.Maybe Prelude.Text,
    -- | The description of the deployment.
    Deployment -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ID of the environment that was deployed.
    Deployment -> Maybe Text
environmentId :: Prelude.Maybe Prelude.Text,
    -- | A list containing all events related to a deployment. The most recent
    -- events are displayed first.
    Deployment -> Maybe [DeploymentEvent]
eventLog :: Prelude.Maybe [DeploymentEvent],
    -- | The amount of time that AppConfig monitored for alarms before
    -- considering the deployment to be complete and no longer eligible for
    -- automatic rollback.
    Deployment -> Maybe Natural
finalBakeTimeInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | The percentage of targets to receive a deployed configuration during
    -- each interval.
    Deployment -> Maybe Double
growthFactor :: Prelude.Maybe Prelude.Double,
    -- | The algorithm used to define how percentage grew over time.
    Deployment -> Maybe GrowthType
growthType :: Prelude.Maybe GrowthType,
    -- | The percentage of targets for which the deployment is available.
    Deployment -> Maybe Double
percentageComplete :: Prelude.Maybe Prelude.Double,
    -- | The time the deployment started.
    Deployment -> Maybe ISO8601
startedAt :: Prelude.Maybe Data.ISO8601,
    -- | The state of the deployment.
    Deployment -> Maybe DeploymentState
state :: Prelude.Maybe DeploymentState
  }
  deriving (Deployment -> Deployment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Deployment -> Deployment -> Bool
$c/= :: Deployment -> Deployment -> Bool
== :: Deployment -> Deployment -> Bool
$c== :: Deployment -> Deployment -> Bool
Prelude.Eq, ReadPrec [Deployment]
ReadPrec Deployment
Int -> ReadS Deployment
ReadS [Deployment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Deployment]
$creadListPrec :: ReadPrec [Deployment]
readPrec :: ReadPrec Deployment
$creadPrec :: ReadPrec Deployment
readList :: ReadS [Deployment]
$creadList :: ReadS [Deployment]
readsPrec :: Int -> ReadS Deployment
$creadsPrec :: Int -> ReadS Deployment
Prelude.Read, Int -> Deployment -> ShowS
[Deployment] -> ShowS
Deployment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Deployment] -> ShowS
$cshowList :: [Deployment] -> ShowS
show :: Deployment -> String
$cshow :: Deployment -> String
showsPrec :: Int -> Deployment -> ShowS
$cshowsPrec :: Int -> Deployment -> ShowS
Prelude.Show, forall x. Rep Deployment x -> Deployment
forall x. Deployment -> Rep Deployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Deployment x -> Deployment
$cfrom :: forall x. Deployment -> Rep Deployment x
Prelude.Generic)

-- |
-- Create a value of 'Deployment' 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:
--
-- 'applicationId', 'deployment_applicationId' - The ID of the application that was deployed.
--
-- 'appliedExtensions', 'deployment_appliedExtensions' - A list of extensions that were processed as part of the deployment. The
-- extensions that were previously associated to the configuration profile,
-- environment, or the application when @StartDeployment@ was called.
--
-- 'completedAt', 'deployment_completedAt' - The time the deployment completed.
--
-- 'configurationLocationUri', 'deployment_configurationLocationUri' - Information about the source location of the configuration.
--
-- 'configurationName', 'deployment_configurationName' - The name of the configuration.
--
-- 'configurationProfileId', 'deployment_configurationProfileId' - The ID of the configuration profile that was deployed.
--
-- 'configurationVersion', 'deployment_configurationVersion' - The configuration version that was deployed.
--
-- 'deploymentDurationInMinutes', 'deployment_deploymentDurationInMinutes' - Total amount of time the deployment lasted.
--
-- 'deploymentNumber', 'deployment_deploymentNumber' - The sequence number of the deployment.
--
-- 'deploymentStrategyId', 'deployment_deploymentStrategyId' - The ID of the deployment strategy that was deployed.
--
-- 'description', 'deployment_description' - The description of the deployment.
--
-- 'environmentId', 'deployment_environmentId' - The ID of the environment that was deployed.
--
-- 'eventLog', 'deployment_eventLog' - A list containing all events related to a deployment. The most recent
-- events are displayed first.
--
-- 'finalBakeTimeInMinutes', 'deployment_finalBakeTimeInMinutes' - The amount of time that AppConfig monitored for alarms before
-- considering the deployment to be complete and no longer eligible for
-- automatic rollback.
--
-- 'growthFactor', 'deployment_growthFactor' - The percentage of targets to receive a deployed configuration during
-- each interval.
--
-- 'growthType', 'deployment_growthType' - The algorithm used to define how percentage grew over time.
--
-- 'percentageComplete', 'deployment_percentageComplete' - The percentage of targets for which the deployment is available.
--
-- 'startedAt', 'deployment_startedAt' - The time the deployment started.
--
-- 'state', 'deployment_state' - The state of the deployment.
newDeployment ::
  Deployment
newDeployment :: Deployment
newDeployment =
  Deployment'
    { $sel:applicationId:Deployment' :: Maybe Text
applicationId = forall a. Maybe a
Prelude.Nothing,
      $sel:appliedExtensions:Deployment' :: Maybe [AppliedExtension]
appliedExtensions = forall a. Maybe a
Prelude.Nothing,
      $sel:completedAt:Deployment' :: Maybe ISO8601
completedAt = forall a. Maybe a
Prelude.Nothing,
      $sel:configurationLocationUri:Deployment' :: Maybe Text
configurationLocationUri = forall a. Maybe a
Prelude.Nothing,
      $sel:configurationName:Deployment' :: Maybe Text
configurationName = forall a. Maybe a
Prelude.Nothing,
      $sel:configurationProfileId:Deployment' :: Maybe Text
configurationProfileId = forall a. Maybe a
Prelude.Nothing,
      $sel:configurationVersion:Deployment' :: Maybe Text
configurationVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentDurationInMinutes:Deployment' :: Maybe Natural
deploymentDurationInMinutes = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentNumber:Deployment' :: Maybe Int
deploymentNumber = forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentStrategyId:Deployment' :: Maybe Text
deploymentStrategyId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:Deployment' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:environmentId:Deployment' :: Maybe Text
environmentId = forall a. Maybe a
Prelude.Nothing,
      $sel:eventLog:Deployment' :: Maybe [DeploymentEvent]
eventLog = forall a. Maybe a
Prelude.Nothing,
      $sel:finalBakeTimeInMinutes:Deployment' :: Maybe Natural
finalBakeTimeInMinutes = forall a. Maybe a
Prelude.Nothing,
      $sel:growthFactor:Deployment' :: Maybe Double
growthFactor = forall a. Maybe a
Prelude.Nothing,
      $sel:growthType:Deployment' :: Maybe GrowthType
growthType = forall a. Maybe a
Prelude.Nothing,
      $sel:percentageComplete:Deployment' :: Maybe Double
percentageComplete = forall a. Maybe a
Prelude.Nothing,
      $sel:startedAt:Deployment' :: Maybe ISO8601
startedAt = forall a. Maybe a
Prelude.Nothing,
      $sel:state:Deployment' :: Maybe DeploymentState
state = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the application that was deployed.
deployment_applicationId :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_applicationId :: Lens' Deployment (Maybe Text)
deployment_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
applicationId :: Maybe Text
$sel:applicationId:Deployment' :: Deployment -> Maybe Text
applicationId} -> Maybe Text
applicationId) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:applicationId:Deployment' :: Maybe Text
applicationId = Maybe Text
a} :: Deployment)

-- | A list of extensions that were processed as part of the deployment. The
-- extensions that were previously associated to the configuration profile,
-- environment, or the application when @StartDeployment@ was called.
deployment_appliedExtensions :: Lens.Lens' Deployment (Prelude.Maybe [AppliedExtension])
deployment_appliedExtensions :: Lens' Deployment (Maybe [AppliedExtension])
deployment_appliedExtensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe [AppliedExtension]
appliedExtensions :: Maybe [AppliedExtension]
$sel:appliedExtensions:Deployment' :: Deployment -> Maybe [AppliedExtension]
appliedExtensions} -> Maybe [AppliedExtension]
appliedExtensions) (\s :: Deployment
s@Deployment' {} Maybe [AppliedExtension]
a -> Deployment
s {$sel:appliedExtensions:Deployment' :: Maybe [AppliedExtension]
appliedExtensions = Maybe [AppliedExtension]
a} :: Deployment) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time the deployment completed.
deployment_completedAt :: Lens.Lens' Deployment (Prelude.Maybe Prelude.UTCTime)
deployment_completedAt :: Lens' Deployment (Maybe UTCTime)
deployment_completedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe ISO8601
completedAt :: Maybe ISO8601
$sel:completedAt:Deployment' :: Deployment -> Maybe ISO8601
completedAt} -> Maybe ISO8601
completedAt) (\s :: Deployment
s@Deployment' {} Maybe ISO8601
a -> Deployment
s {$sel:completedAt:Deployment' :: Maybe ISO8601
completedAt = Maybe ISO8601
a} :: Deployment) 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

-- | Information about the source location of the configuration.
deployment_configurationLocationUri :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_configurationLocationUri :: Lens' Deployment (Maybe Text)
deployment_configurationLocationUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
configurationLocationUri :: Maybe Text
$sel:configurationLocationUri:Deployment' :: Deployment -> Maybe Text
configurationLocationUri} -> Maybe Text
configurationLocationUri) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:configurationLocationUri:Deployment' :: Maybe Text
configurationLocationUri = Maybe Text
a} :: Deployment)

-- | The name of the configuration.
deployment_configurationName :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_configurationName :: Lens' Deployment (Maybe Text)
deployment_configurationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
configurationName :: Maybe Text
$sel:configurationName:Deployment' :: Deployment -> Maybe Text
configurationName} -> Maybe Text
configurationName) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:configurationName:Deployment' :: Maybe Text
configurationName = Maybe Text
a} :: Deployment)

-- | The ID of the configuration profile that was deployed.
deployment_configurationProfileId :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_configurationProfileId :: Lens' Deployment (Maybe Text)
deployment_configurationProfileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
configurationProfileId :: Maybe Text
$sel:configurationProfileId:Deployment' :: Deployment -> Maybe Text
configurationProfileId} -> Maybe Text
configurationProfileId) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:configurationProfileId:Deployment' :: Maybe Text
configurationProfileId = Maybe Text
a} :: Deployment)

-- | The configuration version that was deployed.
deployment_configurationVersion :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_configurationVersion :: Lens' Deployment (Maybe Text)
deployment_configurationVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
configurationVersion :: Maybe Text
$sel:configurationVersion:Deployment' :: Deployment -> Maybe Text
configurationVersion} -> Maybe Text
configurationVersion) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:configurationVersion:Deployment' :: Maybe Text
configurationVersion = Maybe Text
a} :: Deployment)

-- | Total amount of time the deployment lasted.
deployment_deploymentDurationInMinutes :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Natural)
deployment_deploymentDurationInMinutes :: Lens' Deployment (Maybe Natural)
deployment_deploymentDurationInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Natural
deploymentDurationInMinutes :: Maybe Natural
$sel:deploymentDurationInMinutes:Deployment' :: Deployment -> Maybe Natural
deploymentDurationInMinutes} -> Maybe Natural
deploymentDurationInMinutes) (\s :: Deployment
s@Deployment' {} Maybe Natural
a -> Deployment
s {$sel:deploymentDurationInMinutes:Deployment' :: Maybe Natural
deploymentDurationInMinutes = Maybe Natural
a} :: Deployment)

-- | The sequence number of the deployment.
deployment_deploymentNumber :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Int)
deployment_deploymentNumber :: Lens' Deployment (Maybe Int)
deployment_deploymentNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Int
deploymentNumber :: Maybe Int
$sel:deploymentNumber:Deployment' :: Deployment -> Maybe Int
deploymentNumber} -> Maybe Int
deploymentNumber) (\s :: Deployment
s@Deployment' {} Maybe Int
a -> Deployment
s {$sel:deploymentNumber:Deployment' :: Maybe Int
deploymentNumber = Maybe Int
a} :: Deployment)

-- | The ID of the deployment strategy that was deployed.
deployment_deploymentStrategyId :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_deploymentStrategyId :: Lens' Deployment (Maybe Text)
deployment_deploymentStrategyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
deploymentStrategyId :: Maybe Text
$sel:deploymentStrategyId:Deployment' :: Deployment -> Maybe Text
deploymentStrategyId} -> Maybe Text
deploymentStrategyId) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:deploymentStrategyId:Deployment' :: Maybe Text
deploymentStrategyId = Maybe Text
a} :: Deployment)

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

-- | The ID of the environment that was deployed.
deployment_environmentId :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_environmentId :: Lens' Deployment (Maybe Text)
deployment_environmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
environmentId :: Maybe Text
$sel:environmentId:Deployment' :: Deployment -> Maybe Text
environmentId} -> Maybe Text
environmentId) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:environmentId:Deployment' :: Maybe Text
environmentId = Maybe Text
a} :: Deployment)

-- | A list containing all events related to a deployment. The most recent
-- events are displayed first.
deployment_eventLog :: Lens.Lens' Deployment (Prelude.Maybe [DeploymentEvent])
deployment_eventLog :: Lens' Deployment (Maybe [DeploymentEvent])
deployment_eventLog = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe [DeploymentEvent]
eventLog :: Maybe [DeploymentEvent]
$sel:eventLog:Deployment' :: Deployment -> Maybe [DeploymentEvent]
eventLog} -> Maybe [DeploymentEvent]
eventLog) (\s :: Deployment
s@Deployment' {} Maybe [DeploymentEvent]
a -> Deployment
s {$sel:eventLog:Deployment' :: Maybe [DeploymentEvent]
eventLog = Maybe [DeploymentEvent]
a} :: Deployment) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The amount of time that AppConfig monitored for alarms before
-- considering the deployment to be complete and no longer eligible for
-- automatic rollback.
deployment_finalBakeTimeInMinutes :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Natural)
deployment_finalBakeTimeInMinutes :: Lens' Deployment (Maybe Natural)
deployment_finalBakeTimeInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Natural
finalBakeTimeInMinutes :: Maybe Natural
$sel:finalBakeTimeInMinutes:Deployment' :: Deployment -> Maybe Natural
finalBakeTimeInMinutes} -> Maybe Natural
finalBakeTimeInMinutes) (\s :: Deployment
s@Deployment' {} Maybe Natural
a -> Deployment
s {$sel:finalBakeTimeInMinutes:Deployment' :: Maybe Natural
finalBakeTimeInMinutes = Maybe Natural
a} :: Deployment)

-- | The percentage of targets to receive a deployed configuration during
-- each interval.
deployment_growthFactor :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Double)
deployment_growthFactor :: Lens' Deployment (Maybe Double)
deployment_growthFactor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Double
growthFactor :: Maybe Double
$sel:growthFactor:Deployment' :: Deployment -> Maybe Double
growthFactor} -> Maybe Double
growthFactor) (\s :: Deployment
s@Deployment' {} Maybe Double
a -> Deployment
s {$sel:growthFactor:Deployment' :: Maybe Double
growthFactor = Maybe Double
a} :: Deployment)

-- | The algorithm used to define how percentage grew over time.
deployment_growthType :: Lens.Lens' Deployment (Prelude.Maybe GrowthType)
deployment_growthType :: Lens' Deployment (Maybe GrowthType)
deployment_growthType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe GrowthType
growthType :: Maybe GrowthType
$sel:growthType:Deployment' :: Deployment -> Maybe GrowthType
growthType} -> Maybe GrowthType
growthType) (\s :: Deployment
s@Deployment' {} Maybe GrowthType
a -> Deployment
s {$sel:growthType:Deployment' :: Maybe GrowthType
growthType = Maybe GrowthType
a} :: Deployment)

-- | The percentage of targets for which the deployment is available.
deployment_percentageComplete :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Double)
deployment_percentageComplete :: Lens' Deployment (Maybe Double)
deployment_percentageComplete = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Double
percentageComplete :: Maybe Double
$sel:percentageComplete:Deployment' :: Deployment -> Maybe Double
percentageComplete} -> Maybe Double
percentageComplete) (\s :: Deployment
s@Deployment' {} Maybe Double
a -> Deployment
s {$sel:percentageComplete:Deployment' :: Maybe Double
percentageComplete = Maybe Double
a} :: Deployment)

-- | The time the deployment started.
deployment_startedAt :: Lens.Lens' Deployment (Prelude.Maybe Prelude.UTCTime)
deployment_startedAt :: Lens' Deployment (Maybe UTCTime)
deployment_startedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe ISO8601
startedAt :: Maybe ISO8601
$sel:startedAt:Deployment' :: Deployment -> Maybe ISO8601
startedAt} -> Maybe ISO8601
startedAt) (\s :: Deployment
s@Deployment' {} Maybe ISO8601
a -> Deployment
s {$sel:startedAt:Deployment' :: Maybe ISO8601
startedAt = Maybe ISO8601
a} :: Deployment) 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 state of the deployment.
deployment_state :: Lens.Lens' Deployment (Prelude.Maybe DeploymentState)
deployment_state :: Lens' Deployment (Maybe DeploymentState)
deployment_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe DeploymentState
state :: Maybe DeploymentState
$sel:state:Deployment' :: Deployment -> Maybe DeploymentState
state} -> Maybe DeploymentState
state) (\s :: Deployment
s@Deployment' {} Maybe DeploymentState
a -> Deployment
s {$sel:state:Deployment' :: Maybe DeploymentState
state = Maybe DeploymentState
a} :: Deployment)

instance Data.FromJSON Deployment where
  parseJSON :: Value -> Parser Deployment
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Deployment"
      ( \Object
x ->
          Maybe Text
-> Maybe [AppliedExtension]
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [DeploymentEvent]
-> Maybe Natural
-> Maybe Double
-> Maybe GrowthType
-> Maybe Double
-> Maybe ISO8601
-> Maybe DeploymentState
-> Deployment
Deployment'
            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
"ApplicationId")
            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
"AppliedExtensions"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"CompletedAt")
            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
"ConfigurationLocationUri")
            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
"ConfigurationName")
            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
"ConfigurationProfileId")
            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
"ConfigurationVersion")
            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
"DeploymentDurationInMinutes")
            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
"DeploymentNumber")
            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
"DeploymentStrategyId")
            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
"Description")
            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
"EnvironmentId")
            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
"EventLog" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"FinalBakeTimeInMinutes")
            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
"GrowthFactor")
            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
"GrowthType")
            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
"PercentageComplete")
            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
"StartedAt")
            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
"State")
      )

instance Prelude.Hashable Deployment where
  hashWithSalt :: Int -> Deployment -> Int
hashWithSalt Int
_salt Deployment' {Maybe Double
Maybe Int
Maybe Natural
Maybe [AppliedExtension]
Maybe [DeploymentEvent]
Maybe Text
Maybe ISO8601
Maybe DeploymentState
Maybe GrowthType
state :: Maybe DeploymentState
startedAt :: Maybe ISO8601
percentageComplete :: Maybe Double
growthType :: Maybe GrowthType
growthFactor :: Maybe Double
finalBakeTimeInMinutes :: Maybe Natural
eventLog :: Maybe [DeploymentEvent]
environmentId :: Maybe Text
description :: Maybe Text
deploymentStrategyId :: Maybe Text
deploymentNumber :: Maybe Int
deploymentDurationInMinutes :: Maybe Natural
configurationVersion :: Maybe Text
configurationProfileId :: Maybe Text
configurationName :: Maybe Text
configurationLocationUri :: Maybe Text
completedAt :: Maybe ISO8601
appliedExtensions :: Maybe [AppliedExtension]
applicationId :: Maybe Text
$sel:state:Deployment' :: Deployment -> Maybe DeploymentState
$sel:startedAt:Deployment' :: Deployment -> Maybe ISO8601
$sel:percentageComplete:Deployment' :: Deployment -> Maybe Double
$sel:growthType:Deployment' :: Deployment -> Maybe GrowthType
$sel:growthFactor:Deployment' :: Deployment -> Maybe Double
$sel:finalBakeTimeInMinutes:Deployment' :: Deployment -> Maybe Natural
$sel:eventLog:Deployment' :: Deployment -> Maybe [DeploymentEvent]
$sel:environmentId:Deployment' :: Deployment -> Maybe Text
$sel:description:Deployment' :: Deployment -> Maybe Text
$sel:deploymentStrategyId:Deployment' :: Deployment -> Maybe Text
$sel:deploymentNumber:Deployment' :: Deployment -> Maybe Int
$sel:deploymentDurationInMinutes:Deployment' :: Deployment -> Maybe Natural
$sel:configurationVersion:Deployment' :: Deployment -> Maybe Text
$sel:configurationProfileId:Deployment' :: Deployment -> Maybe Text
$sel:configurationName:Deployment' :: Deployment -> Maybe Text
$sel:configurationLocationUri:Deployment' :: Deployment -> Maybe Text
$sel:completedAt:Deployment' :: Deployment -> Maybe ISO8601
$sel:appliedExtensions:Deployment' :: Deployment -> Maybe [AppliedExtension]
$sel:applicationId:Deployment' :: Deployment -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
applicationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AppliedExtension]
appliedExtensions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
completedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationLocationUri
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationProfileId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
deploymentDurationInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
deploymentNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deploymentStrategyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
environmentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DeploymentEvent]
eventLog
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
finalBakeTimeInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
growthFactor
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GrowthType
growthType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
percentageComplete
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
startedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeploymentState
state

instance Prelude.NFData Deployment where
  rnf :: Deployment -> ()
rnf Deployment' {Maybe Double
Maybe Int
Maybe Natural
Maybe [AppliedExtension]
Maybe [DeploymentEvent]
Maybe Text
Maybe ISO8601
Maybe DeploymentState
Maybe GrowthType
state :: Maybe DeploymentState
startedAt :: Maybe ISO8601
percentageComplete :: Maybe Double
growthType :: Maybe GrowthType
growthFactor :: Maybe Double
finalBakeTimeInMinutes :: Maybe Natural
eventLog :: Maybe [DeploymentEvent]
environmentId :: Maybe Text
description :: Maybe Text
deploymentStrategyId :: Maybe Text
deploymentNumber :: Maybe Int
deploymentDurationInMinutes :: Maybe Natural
configurationVersion :: Maybe Text
configurationProfileId :: Maybe Text
configurationName :: Maybe Text
configurationLocationUri :: Maybe Text
completedAt :: Maybe ISO8601
appliedExtensions :: Maybe [AppliedExtension]
applicationId :: Maybe Text
$sel:state:Deployment' :: Deployment -> Maybe DeploymentState
$sel:startedAt:Deployment' :: Deployment -> Maybe ISO8601
$sel:percentageComplete:Deployment' :: Deployment -> Maybe Double
$sel:growthType:Deployment' :: Deployment -> Maybe GrowthType
$sel:growthFactor:Deployment' :: Deployment -> Maybe Double
$sel:finalBakeTimeInMinutes:Deployment' :: Deployment -> Maybe Natural
$sel:eventLog:Deployment' :: Deployment -> Maybe [DeploymentEvent]
$sel:environmentId:Deployment' :: Deployment -> Maybe Text
$sel:description:Deployment' :: Deployment -> Maybe Text
$sel:deploymentStrategyId:Deployment' :: Deployment -> Maybe Text
$sel:deploymentNumber:Deployment' :: Deployment -> Maybe Int
$sel:deploymentDurationInMinutes:Deployment' :: Deployment -> Maybe Natural
$sel:configurationVersion:Deployment' :: Deployment -> Maybe Text
$sel:configurationProfileId:Deployment' :: Deployment -> Maybe Text
$sel:configurationName:Deployment' :: Deployment -> Maybe Text
$sel:configurationLocationUri:Deployment' :: Deployment -> Maybe Text
$sel:completedAt:Deployment' :: Deployment -> Maybe ISO8601
$sel:appliedExtensions:Deployment' :: Deployment -> Maybe [AppliedExtension]
$sel:applicationId:Deployment' :: Deployment -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
applicationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [AppliedExtension]
appliedExtensions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
completedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationLocationUri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationProfileId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
deploymentDurationInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
deploymentNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deploymentStrategyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
environmentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [DeploymentEvent]
eventLog
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
finalBakeTimeInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
growthFactor
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GrowthType
growthType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
percentageComplete
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
startedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentState
state