{-# 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.Proton.Types.Environment
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Proton.Types.Environment where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types.DeploymentStatus
import Amazonka.Proton.Types.Provisioning

-- | The environment detail data. An AWS Proton environment is a set
-- resources shared across an AWS Proton service.
--
-- /See:/ 'newEnvironment' smart constructor.
data Environment = Environment'
  { -- | An environment deployment status message.
    Environment -> Maybe (Sensitive Text)
deploymentStatusMessage :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The ID of the environment account that the environment infrastructure
    -- resources are provisioned in.
    Environment -> Maybe Text
environmentAccountId :: Prelude.Maybe Prelude.Text,
    -- | When included, indicates that the environment template is for customer
    -- provisioned and managed infrastructure.
    Environment -> Maybe Provisioning
provisioning :: Prelude.Maybe Provisioning,
    -- | The Amazon Resource Name (ARN) of the AWS Proton service role that
    -- allows AWS Proton to make calls to other services on your behalf.
    Environment -> Maybe Text
protonServiceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the environment account connection that\'s used to provision
    -- infrastructure resources in an environment account.
    Environment -> Maybe Text
environmentAccountConnectionId :: Prelude.Maybe Prelude.Text,
    -- | The environment spec.
    Environment -> Maybe (Sensitive Text)
spec :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The description of the environment.
    Environment -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the environment.
    Environment -> Text
arn :: Prelude.Text,
    -- | The time when the environment was created.
    Environment -> POSIX
createdAt :: Core.POSIX,
    -- | The environment deployment status.
    Environment -> DeploymentStatus
deploymentStatus :: DeploymentStatus,
    -- | The time when a deployment of the environment was last attempted.
    Environment -> POSIX
lastDeploymentAttemptedAt :: Core.POSIX,
    -- | The time when the environment was last deployed successfully.
    Environment -> POSIX
lastDeploymentSucceededAt :: Core.POSIX,
    -- | The name of the environment.
    Environment -> Text
name :: Prelude.Text,
    -- | The ID of the major version of the environment template.
    Environment -> Text
templateMajorVersion :: Prelude.Text,
    -- | The ID of the minor version of the environment template.
    Environment -> Text
templateMinorVersion :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the environment template.
    Environment -> Text
templateName :: Prelude.Text
  }
  deriving (Environment -> Environment -> Bool
(Environment -> Environment -> Bool)
-> (Environment -> Environment -> Bool) -> Eq Environment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Environment -> Environment -> Bool
$c/= :: Environment -> Environment -> Bool
== :: Environment -> Environment -> Bool
$c== :: Environment -> Environment -> Bool
Prelude.Eq, Int -> Environment -> ShowS
[Environment] -> ShowS
Environment -> String
(Int -> Environment -> ShowS)
-> (Environment -> String)
-> ([Environment] -> ShowS)
-> Show Environment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Environment] -> ShowS
$cshowList :: [Environment] -> ShowS
show :: Environment -> String
$cshow :: Environment -> String
showsPrec :: Int -> Environment -> ShowS
$cshowsPrec :: Int -> Environment -> ShowS
Prelude.Show, (forall x. Environment -> Rep Environment x)
-> (forall x. Rep Environment x -> Environment)
-> Generic Environment
forall x. Rep Environment x -> Environment
forall x. Environment -> Rep Environment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Environment x -> Environment
$cfrom :: forall x. Environment -> Rep Environment x
Prelude.Generic)

-- |
-- Create a value of 'Environment' 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:
--
-- 'deploymentStatusMessage', 'environment_deploymentStatusMessage' - An environment deployment status message.
--
-- 'environmentAccountId', 'environment_environmentAccountId' - The ID of the environment account that the environment infrastructure
-- resources are provisioned in.
--
-- 'provisioning', 'environment_provisioning' - When included, indicates that the environment template is for customer
-- provisioned and managed infrastructure.
--
-- 'protonServiceRoleArn', 'environment_protonServiceRoleArn' - The Amazon Resource Name (ARN) of the AWS Proton service role that
-- allows AWS Proton to make calls to other services on your behalf.
--
-- 'environmentAccountConnectionId', 'environment_environmentAccountConnectionId' - The ID of the environment account connection that\'s used to provision
-- infrastructure resources in an environment account.
--
-- 'spec', 'environment_spec' - The environment spec.
--
-- 'description', 'environment_description' - The description of the environment.
--
-- 'arn', 'environment_arn' - The Amazon Resource Name (ARN) of the environment.
--
-- 'createdAt', 'environment_createdAt' - The time when the environment was created.
--
-- 'deploymentStatus', 'environment_deploymentStatus' - The environment deployment status.
--
-- 'lastDeploymentAttemptedAt', 'environment_lastDeploymentAttemptedAt' - The time when a deployment of the environment was last attempted.
--
-- 'lastDeploymentSucceededAt', 'environment_lastDeploymentSucceededAt' - The time when the environment was last deployed successfully.
--
-- 'name', 'environment_name' - The name of the environment.
--
-- 'templateMajorVersion', 'environment_templateMajorVersion' - The ID of the major version of the environment template.
--
-- 'templateMinorVersion', 'environment_templateMinorVersion' - The ID of the minor version of the environment template.
--
-- 'templateName', 'environment_templateName' - The Amazon Resource Name (ARN) of the environment template.
newEnvironment ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'deploymentStatus'
  DeploymentStatus ->
  -- | 'lastDeploymentAttemptedAt'
  Prelude.UTCTime ->
  -- | 'lastDeploymentSucceededAt'
  Prelude.UTCTime ->
  -- | 'name'
  Prelude.Text ->
  -- | 'templateMajorVersion'
  Prelude.Text ->
  -- | 'templateMinorVersion'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  Environment
newEnvironment :: Text
-> UTCTime
-> DeploymentStatus
-> UTCTime
-> UTCTime
-> Text
-> Text
-> Text
-> Text
-> Environment
newEnvironment
  Text
pArn_
  UTCTime
pCreatedAt_
  DeploymentStatus
pDeploymentStatus_
  UTCTime
pLastDeploymentAttemptedAt_
  UTCTime
pLastDeploymentSucceededAt_
  Text
pName_
  Text
pTemplateMajorVersion_
  Text
pTemplateMinorVersion_
  Text
pTemplateName_ =
    Environment' :: Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Provisioning
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Text
-> POSIX
-> DeploymentStatus
-> POSIX
-> POSIX
-> Text
-> Text
-> Text
-> Text
-> Environment
Environment'
      { $sel:deploymentStatusMessage:Environment' :: Maybe (Sensitive Text)
deploymentStatusMessage =
          Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:environmentAccountId:Environment' :: Maybe Text
environmentAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:provisioning:Environment' :: Maybe Provisioning
provisioning = Maybe Provisioning
forall a. Maybe a
Prelude.Nothing,
        $sel:protonServiceRoleArn:Environment' :: Maybe Text
protonServiceRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:environmentAccountConnectionId:Environment' :: Maybe Text
environmentAccountConnectionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:spec:Environment' :: Maybe (Sensitive Text)
spec = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:description:Environment' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:Environment' :: Text
arn = Text
pArn_,
        $sel:createdAt:Environment' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:deploymentStatus:Environment' :: DeploymentStatus
deploymentStatus = DeploymentStatus
pDeploymentStatus_,
        $sel:lastDeploymentAttemptedAt:Environment' :: POSIX
lastDeploymentAttemptedAt =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastDeploymentAttemptedAt_,
        $sel:lastDeploymentSucceededAt:Environment' :: POSIX
lastDeploymentSucceededAt =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastDeploymentSucceededAt_,
        $sel:name:Environment' :: Text
name = Text
pName_,
        $sel:templateMajorVersion:Environment' :: Text
templateMajorVersion = Text
pTemplateMajorVersion_,
        $sel:templateMinorVersion:Environment' :: Text
templateMinorVersion = Text
pTemplateMinorVersion_,
        $sel:templateName:Environment' :: Text
templateName = Text
pTemplateName_
      }

-- | An environment deployment status message.
environment_deploymentStatusMessage :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_deploymentStatusMessage :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_deploymentStatusMessage = (Environment -> Maybe (Sensitive Text))
-> (Environment -> Maybe (Sensitive Text) -> Environment)
-> Lens
     Environment
     Environment
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe (Sensitive Text)
deploymentStatusMessage :: Maybe (Sensitive Text)
$sel:deploymentStatusMessage:Environment' :: Environment -> Maybe (Sensitive Text)
deploymentStatusMessage} -> Maybe (Sensitive Text)
deploymentStatusMessage) (\s :: Environment
s@Environment' {} Maybe (Sensitive Text)
a -> Environment
s {$sel:deploymentStatusMessage:Environment' :: Maybe (Sensitive Text)
deploymentStatusMessage = Maybe (Sensitive Text)
a} :: Environment) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> Environment -> f Environment)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Environment
-> f Environment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The ID of the environment account that the environment infrastructure
-- resources are provisioned in.
environment_environmentAccountId :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_environmentAccountId :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_environmentAccountId = (Environment -> Maybe Text)
-> (Environment -> Maybe Text -> Environment)
-> Lens Environment Environment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe Text
environmentAccountId :: Maybe Text
$sel:environmentAccountId:Environment' :: Environment -> Maybe Text
environmentAccountId} -> Maybe Text
environmentAccountId) (\s :: Environment
s@Environment' {} Maybe Text
a -> Environment
s {$sel:environmentAccountId:Environment' :: Maybe Text
environmentAccountId = Maybe Text
a} :: Environment)

-- | When included, indicates that the environment template is for customer
-- provisioned and managed infrastructure.
environment_provisioning :: Lens.Lens' Environment (Prelude.Maybe Provisioning)
environment_provisioning :: (Maybe Provisioning -> f (Maybe Provisioning))
-> Environment -> f Environment
environment_provisioning = (Environment -> Maybe Provisioning)
-> (Environment -> Maybe Provisioning -> Environment)
-> Lens
     Environment Environment (Maybe Provisioning) (Maybe Provisioning)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe Provisioning
provisioning :: Maybe Provisioning
$sel:provisioning:Environment' :: Environment -> Maybe Provisioning
provisioning} -> Maybe Provisioning
provisioning) (\s :: Environment
s@Environment' {} Maybe Provisioning
a -> Environment
s {$sel:provisioning:Environment' :: Maybe Provisioning
provisioning = Maybe Provisioning
a} :: Environment)

-- | The Amazon Resource Name (ARN) of the AWS Proton service role that
-- allows AWS Proton to make calls to other services on your behalf.
environment_protonServiceRoleArn :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_protonServiceRoleArn :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_protonServiceRoleArn = (Environment -> Maybe Text)
-> (Environment -> Maybe Text -> Environment)
-> Lens Environment Environment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe Text
protonServiceRoleArn :: Maybe Text
$sel:protonServiceRoleArn:Environment' :: Environment -> Maybe Text
protonServiceRoleArn} -> Maybe Text
protonServiceRoleArn) (\s :: Environment
s@Environment' {} Maybe Text
a -> Environment
s {$sel:protonServiceRoleArn:Environment' :: Maybe Text
protonServiceRoleArn = Maybe Text
a} :: Environment)

-- | The ID of the environment account connection that\'s used to provision
-- infrastructure resources in an environment account.
environment_environmentAccountConnectionId :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_environmentAccountConnectionId :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_environmentAccountConnectionId = (Environment -> Maybe Text)
-> (Environment -> Maybe Text -> Environment)
-> Lens Environment Environment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe Text
environmentAccountConnectionId :: Maybe Text
$sel:environmentAccountConnectionId:Environment' :: Environment -> Maybe Text
environmentAccountConnectionId} -> Maybe Text
environmentAccountConnectionId) (\s :: Environment
s@Environment' {} Maybe Text
a -> Environment
s {$sel:environmentAccountConnectionId:Environment' :: Maybe Text
environmentAccountConnectionId = Maybe Text
a} :: Environment)

-- | The environment spec.
environment_spec :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_spec :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_spec = (Environment -> Maybe (Sensitive Text))
-> (Environment -> Maybe (Sensitive Text) -> Environment)
-> Lens
     Environment
     Environment
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe (Sensitive Text)
spec :: Maybe (Sensitive Text)
$sel:spec:Environment' :: Environment -> Maybe (Sensitive Text)
spec} -> Maybe (Sensitive Text)
spec) (\s :: Environment
s@Environment' {} Maybe (Sensitive Text)
a -> Environment
s {$sel:spec:Environment' :: Maybe (Sensitive Text)
spec = Maybe (Sensitive Text)
a} :: Environment) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> Environment -> f Environment)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Environment
-> f Environment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The description of the environment.
environment_description :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_description :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_description = (Environment -> Maybe (Sensitive Text))
-> (Environment -> Maybe (Sensitive Text) -> Environment)
-> Lens
     Environment
     Environment
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:Environment' :: Environment -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: Environment
s@Environment' {} Maybe (Sensitive Text)
a -> Environment
s {$sel:description:Environment' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: Environment) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> Environment -> f Environment)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Environment
-> f Environment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The Amazon Resource Name (ARN) of the environment.
environment_arn :: Lens.Lens' Environment Prelude.Text
environment_arn :: (Text -> f Text) -> Environment -> f Environment
environment_arn = (Environment -> Text)
-> (Environment -> Text -> Environment)
-> Lens Environment Environment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Text
arn :: Text
$sel:arn:Environment' :: Environment -> Text
arn} -> Text
arn) (\s :: Environment
s@Environment' {} Text
a -> Environment
s {$sel:arn:Environment' :: Text
arn = Text
a} :: Environment)

-- | The time when the environment was created.
environment_createdAt :: Lens.Lens' Environment Prelude.UTCTime
environment_createdAt :: (UTCTime -> f UTCTime) -> Environment -> f Environment
environment_createdAt = (Environment -> POSIX)
-> (Environment -> POSIX -> Environment)
-> Lens Environment Environment POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {POSIX
createdAt :: POSIX
$sel:createdAt:Environment' :: Environment -> POSIX
createdAt} -> POSIX
createdAt) (\s :: Environment
s@Environment' {} POSIX
a -> Environment
s {$sel:createdAt:Environment' :: POSIX
createdAt = POSIX
a} :: Environment) ((POSIX -> f POSIX) -> Environment -> f Environment)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Environment
-> f Environment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The environment deployment status.
environment_deploymentStatus :: Lens.Lens' Environment DeploymentStatus
environment_deploymentStatus :: (DeploymentStatus -> f DeploymentStatus)
-> Environment -> f Environment
environment_deploymentStatus = (Environment -> DeploymentStatus)
-> (Environment -> DeploymentStatus -> Environment)
-> Lens Environment Environment DeploymentStatus DeploymentStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {DeploymentStatus
deploymentStatus :: DeploymentStatus
$sel:deploymentStatus:Environment' :: Environment -> DeploymentStatus
deploymentStatus} -> DeploymentStatus
deploymentStatus) (\s :: Environment
s@Environment' {} DeploymentStatus
a -> Environment
s {$sel:deploymentStatus:Environment' :: DeploymentStatus
deploymentStatus = DeploymentStatus
a} :: Environment)

-- | The time when a deployment of the environment was last attempted.
environment_lastDeploymentAttemptedAt :: Lens.Lens' Environment Prelude.UTCTime
environment_lastDeploymentAttemptedAt :: (UTCTime -> f UTCTime) -> Environment -> f Environment
environment_lastDeploymentAttemptedAt = (Environment -> POSIX)
-> (Environment -> POSIX -> Environment)
-> Lens Environment Environment POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {POSIX
lastDeploymentAttemptedAt :: POSIX
$sel:lastDeploymentAttemptedAt:Environment' :: Environment -> POSIX
lastDeploymentAttemptedAt} -> POSIX
lastDeploymentAttemptedAt) (\s :: Environment
s@Environment' {} POSIX
a -> Environment
s {$sel:lastDeploymentAttemptedAt:Environment' :: POSIX
lastDeploymentAttemptedAt = POSIX
a} :: Environment) ((POSIX -> f POSIX) -> Environment -> f Environment)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Environment
-> f Environment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The time when the environment was last deployed successfully.
environment_lastDeploymentSucceededAt :: Lens.Lens' Environment Prelude.UTCTime
environment_lastDeploymentSucceededAt :: (UTCTime -> f UTCTime) -> Environment -> f Environment
environment_lastDeploymentSucceededAt = (Environment -> POSIX)
-> (Environment -> POSIX -> Environment)
-> Lens Environment Environment POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {POSIX
lastDeploymentSucceededAt :: POSIX
$sel:lastDeploymentSucceededAt:Environment' :: Environment -> POSIX
lastDeploymentSucceededAt} -> POSIX
lastDeploymentSucceededAt) (\s :: Environment
s@Environment' {} POSIX
a -> Environment
s {$sel:lastDeploymentSucceededAt:Environment' :: POSIX
lastDeploymentSucceededAt = POSIX
a} :: Environment) ((POSIX -> f POSIX) -> Environment -> f Environment)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Environment
-> f Environment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the environment.
environment_name :: Lens.Lens' Environment Prelude.Text
environment_name :: (Text -> f Text) -> Environment -> f Environment
environment_name = (Environment -> Text)
-> (Environment -> Text -> Environment)
-> Lens Environment Environment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Text
name :: Text
$sel:name:Environment' :: Environment -> Text
name} -> Text
name) (\s :: Environment
s@Environment' {} Text
a -> Environment
s {$sel:name:Environment' :: Text
name = Text
a} :: Environment)

-- | The ID of the major version of the environment template.
environment_templateMajorVersion :: Lens.Lens' Environment Prelude.Text
environment_templateMajorVersion :: (Text -> f Text) -> Environment -> f Environment
environment_templateMajorVersion = (Environment -> Text)
-> (Environment -> Text -> Environment)
-> Lens Environment Environment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Text
templateMajorVersion :: Text
$sel:templateMajorVersion:Environment' :: Environment -> Text
templateMajorVersion} -> Text
templateMajorVersion) (\s :: Environment
s@Environment' {} Text
a -> Environment
s {$sel:templateMajorVersion:Environment' :: Text
templateMajorVersion = Text
a} :: Environment)

-- | The ID of the minor version of the environment template.
environment_templateMinorVersion :: Lens.Lens' Environment Prelude.Text
environment_templateMinorVersion :: (Text -> f Text) -> Environment -> f Environment
environment_templateMinorVersion = (Environment -> Text)
-> (Environment -> Text -> Environment)
-> Lens Environment Environment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Text
templateMinorVersion :: Text
$sel:templateMinorVersion:Environment' :: Environment -> Text
templateMinorVersion} -> Text
templateMinorVersion) (\s :: Environment
s@Environment' {} Text
a -> Environment
s {$sel:templateMinorVersion:Environment' :: Text
templateMinorVersion = Text
a} :: Environment)

-- | The Amazon Resource Name (ARN) of the environment template.
environment_templateName :: Lens.Lens' Environment Prelude.Text
environment_templateName :: (Text -> f Text) -> Environment -> f Environment
environment_templateName = (Environment -> Text)
-> (Environment -> Text -> Environment)
-> Lens Environment Environment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Text
templateName :: Text
$sel:templateName:Environment' :: Environment -> Text
templateName} -> Text
templateName) (\s :: Environment
s@Environment' {} Text
a -> Environment
s {$sel:templateName:Environment' :: Text
templateName = Text
a} :: Environment)

instance Core.FromJSON Environment where
  parseJSON :: Value -> Parser Environment
parseJSON =
    String
-> (Object -> Parser Environment) -> Value -> Parser Environment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Environment"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Provisioning
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Text
-> POSIX
-> DeploymentStatus
-> POSIX
-> POSIX
-> Text
-> Text
-> Text
-> Text
-> Environment
Environment'
            (Maybe (Sensitive Text)
 -> Maybe Text
 -> Maybe Provisioning
 -> Maybe Text
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe (Sensitive Text)
 -> Text
 -> POSIX
 -> DeploymentStatus
 -> POSIX
 -> POSIX
 -> Text
 -> Text
 -> Text
 -> Text
 -> Environment)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe Text
      -> Maybe Provisioning
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Text
      -> POSIX
      -> DeploymentStatus
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Environment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deploymentStatusMessage")
            Parser
  (Maybe Text
   -> Maybe Provisioning
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Text
   -> POSIX
   -> DeploymentStatus
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Environment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Provisioning
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Text
      -> POSIX
      -> DeploymentStatus
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"environmentAccountId")
            Parser
  (Maybe Provisioning
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Text
   -> POSIX
   -> DeploymentStatus
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Environment)
-> Parser (Maybe Provisioning)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Text
      -> POSIX
      -> DeploymentStatus
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Provisioning)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"provisioning")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Text
   -> POSIX
   -> DeploymentStatus
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Environment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Text
      -> POSIX
      -> DeploymentStatus
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"protonServiceRoleArn")
            Parser
  (Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Text
   -> POSIX
   -> DeploymentStatus
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Environment)
-> Parser (Maybe Text)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Text
      -> POSIX
      -> DeploymentStatus
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"environmentAccountConnectionId")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Text
   -> POSIX
   -> DeploymentStatus
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Environment)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe (Sensitive Text)
      -> Text
      -> POSIX
      -> DeploymentStatus
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"spec")
            Parser
  (Maybe (Sensitive Text)
   -> Text
   -> POSIX
   -> DeploymentStatus
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Environment)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Text
      -> POSIX
      -> DeploymentStatus
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
            Parser
  (Text
   -> POSIX
   -> DeploymentStatus
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Environment)
-> Parser Text
-> Parser
     (POSIX
      -> DeploymentStatus
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
            Parser
  (POSIX
   -> DeploymentStatus
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Environment)
-> Parser POSIX
-> Parser
     (DeploymentStatus
      -> POSIX -> POSIX -> Text -> Text -> Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"createdAt")
            Parser
  (DeploymentStatus
   -> POSIX -> POSIX -> Text -> Text -> Text -> Text -> Environment)
-> Parser DeploymentStatus
-> Parser
     (POSIX -> POSIX -> Text -> Text -> Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeploymentStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"deploymentStatus")
            Parser
  (POSIX -> POSIX -> Text -> Text -> Text -> Text -> Environment)
-> Parser POSIX
-> Parser (POSIX -> Text -> Text -> Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"lastDeploymentAttemptedAt")
            Parser (POSIX -> Text -> Text -> Text -> Text -> Environment)
-> Parser POSIX
-> Parser (Text -> Text -> Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"lastDeploymentSucceededAt")
            Parser (Text -> Text -> Text -> Text -> Environment)
-> Parser Text -> Parser (Text -> Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
            Parser (Text -> Text -> Text -> Environment)
-> Parser Text -> Parser (Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"templateMajorVersion")
            Parser (Text -> Text -> Environment)
-> Parser Text -> Parser (Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"templateMinorVersion")
            Parser (Text -> Environment) -> Parser Text -> Parser Environment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"templateName")
      )

instance Prelude.Hashable Environment

instance Prelude.NFData Environment