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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types.DeploymentCommand
import qualified Amazonka.Prelude as Prelude

-- | Describes a deployment of a stack or app.
--
-- /See:/ 'newDeployment' smart constructor.
data Deployment = Deployment'
  { -- | The deployment ID.
    Deployment -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | The deployment status:
    --
    -- -   running
    --
    -- -   successful
    --
    -- -   failed
    Deployment -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | Used to specify a stack or deployment command.
    Deployment -> Maybe DeploymentCommand
command :: Prelude.Maybe DeploymentCommand,
    -- | Date when the deployment was created.
    Deployment -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text,
    -- | A string that contains user-defined custom JSON. It can be used to
    -- override the corresponding default stack configuration attribute values
    -- for stack or to pass data to recipes. The string should be in the
    -- following format:
    --
    -- @\"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\",...}\"@
    --
    -- For more information on custom JSON, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the Stack Configuration Attributes>.
    Deployment -> Maybe Text
customJson :: Prelude.Maybe Prelude.Text,
    -- | The user\'s IAM ARN.
    Deployment -> Maybe Text
iamUserArn :: Prelude.Maybe Prelude.Text,
    -- | The app ID.
    Deployment -> Maybe Text
appId :: Prelude.Maybe Prelude.Text,
    -- | The IDs of the target instances.
    Deployment -> Maybe [Text]
instanceIds :: Prelude.Maybe [Prelude.Text],
    -- | Date when the deployment completed.
    Deployment -> Maybe Text
completedAt :: Prelude.Maybe Prelude.Text,
    -- | The stack ID.
    Deployment -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
    -- | A user-defined comment.
    Deployment -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The deployment duration.
    Deployment -> Maybe Int
duration :: Prelude.Maybe Prelude.Int
  }
  deriving (Deployment -> Deployment -> Bool
(Deployment -> Deployment -> Bool)
-> (Deployment -> Deployment -> Bool) -> Eq Deployment
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]
(Int -> ReadS Deployment)
-> ReadS [Deployment]
-> ReadPrec Deployment
-> ReadPrec [Deployment]
-> Read 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
(Int -> Deployment -> ShowS)
-> (Deployment -> String)
-> ([Deployment] -> ShowS)
-> Show Deployment
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. Deployment -> Rep Deployment x)
-> (forall x. Rep Deployment x -> Deployment) -> Generic Deployment
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:
--
-- 'deploymentId', 'deployment_deploymentId' - The deployment ID.
--
-- 'status', 'deployment_status' - The deployment status:
--
-- -   running
--
-- -   successful
--
-- -   failed
--
-- 'command', 'deployment_command' - Used to specify a stack or deployment command.
--
-- 'createdAt', 'deployment_createdAt' - Date when the deployment was created.
--
-- 'customJson', 'deployment_customJson' - A string that contains user-defined custom JSON. It can be used to
-- override the corresponding default stack configuration attribute values
-- for stack or to pass data to recipes. The string should be in the
-- following format:
--
-- @\"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\",...}\"@
--
-- For more information on custom JSON, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the Stack Configuration Attributes>.
--
-- 'iamUserArn', 'deployment_iamUserArn' - The user\'s IAM ARN.
--
-- 'appId', 'deployment_appId' - The app ID.
--
-- 'instanceIds', 'deployment_instanceIds' - The IDs of the target instances.
--
-- 'completedAt', 'deployment_completedAt' - Date when the deployment completed.
--
-- 'stackId', 'deployment_stackId' - The stack ID.
--
-- 'comment', 'deployment_comment' - A user-defined comment.
--
-- 'duration', 'deployment_duration' - The deployment duration.
newDeployment ::
  Deployment
newDeployment :: Deployment
newDeployment =
  Deployment' :: Maybe Text
-> Maybe Text
-> Maybe DeploymentCommand
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Deployment
Deployment'
    { $sel:deploymentId:Deployment' :: Maybe Text
deploymentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:Deployment' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:command:Deployment' :: Maybe DeploymentCommand
command = Maybe DeploymentCommand
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Deployment' :: Maybe Text
createdAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customJson:Deployment' :: Maybe Text
customJson = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:iamUserArn:Deployment' :: Maybe Text
iamUserArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:Deployment' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceIds:Deployment' :: Maybe [Text]
instanceIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:completedAt:Deployment' :: Maybe Text
completedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackId:Deployment' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:Deployment' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:Deployment' :: Maybe Int
duration = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The deployment ID.
deployment_deploymentId :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_deploymentId :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_deploymentId = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:Deployment' :: Deployment -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:deploymentId:Deployment' :: Maybe Text
deploymentId = Maybe Text
a} :: Deployment)

-- | The deployment status:
--
-- -   running
--
-- -   successful
--
-- -   failed
deployment_status :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_status :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_status = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
status :: Maybe Text
$sel:status:Deployment' :: Deployment -> Maybe Text
status} -> Maybe Text
status) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:status:Deployment' :: Maybe Text
status = Maybe Text
a} :: Deployment)

-- | Used to specify a stack or deployment command.
deployment_command :: Lens.Lens' Deployment (Prelude.Maybe DeploymentCommand)
deployment_command :: (Maybe DeploymentCommand -> f (Maybe DeploymentCommand))
-> Deployment -> f Deployment
deployment_command = (Deployment -> Maybe DeploymentCommand)
-> (Deployment -> Maybe DeploymentCommand -> Deployment)
-> Lens
     Deployment
     Deployment
     (Maybe DeploymentCommand)
     (Maybe DeploymentCommand)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe DeploymentCommand
command :: Maybe DeploymentCommand
$sel:command:Deployment' :: Deployment -> Maybe DeploymentCommand
command} -> Maybe DeploymentCommand
command) (\s :: Deployment
s@Deployment' {} Maybe DeploymentCommand
a -> Deployment
s {$sel:command:Deployment' :: Maybe DeploymentCommand
command = Maybe DeploymentCommand
a} :: Deployment)

-- | Date when the deployment was created.
deployment_createdAt :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_createdAt :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_createdAt = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
createdAt :: Maybe Text
$sel:createdAt:Deployment' :: Deployment -> Maybe Text
createdAt} -> Maybe Text
createdAt) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:createdAt:Deployment' :: Maybe Text
createdAt = Maybe Text
a} :: Deployment)

-- | A string that contains user-defined custom JSON. It can be used to
-- override the corresponding default stack configuration attribute values
-- for stack or to pass data to recipes. The string should be in the
-- following format:
--
-- @\"{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\",...}\"@
--
-- For more information on custom JSON, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the Stack Configuration Attributes>.
deployment_customJson :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_customJson :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_customJson = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
customJson :: Maybe Text
$sel:customJson:Deployment' :: Deployment -> Maybe Text
customJson} -> Maybe Text
customJson) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:customJson:Deployment' :: Maybe Text
customJson = Maybe Text
a} :: Deployment)

-- | The user\'s IAM ARN.
deployment_iamUserArn :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_iamUserArn :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_iamUserArn = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
iamUserArn :: Maybe Text
$sel:iamUserArn:Deployment' :: Deployment -> Maybe Text
iamUserArn} -> Maybe Text
iamUserArn) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:iamUserArn:Deployment' :: Maybe Text
iamUserArn = Maybe Text
a} :: Deployment)

-- | The app ID.
deployment_appId :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_appId :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_appId = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
appId :: Maybe Text
$sel:appId:Deployment' :: Deployment -> Maybe Text
appId} -> Maybe Text
appId) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:appId:Deployment' :: Maybe Text
appId = Maybe Text
a} :: Deployment)

-- | The IDs of the target instances.
deployment_instanceIds :: Lens.Lens' Deployment (Prelude.Maybe [Prelude.Text])
deployment_instanceIds :: (Maybe [Text] -> f (Maybe [Text])) -> Deployment -> f Deployment
deployment_instanceIds = (Deployment -> Maybe [Text])
-> (Deployment -> Maybe [Text] -> Deployment)
-> Lens Deployment Deployment (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe [Text]
instanceIds :: Maybe [Text]
$sel:instanceIds:Deployment' :: Deployment -> Maybe [Text]
instanceIds} -> Maybe [Text]
instanceIds) (\s :: Deployment
s@Deployment' {} Maybe [Text]
a -> Deployment
s {$sel:instanceIds:Deployment' :: Maybe [Text]
instanceIds = Maybe [Text]
a} :: Deployment) ((Maybe [Text] -> f (Maybe [Text])) -> Deployment -> f Deployment)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Deployment
-> f Deployment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Date when the deployment completed.
deployment_completedAt :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_completedAt :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_completedAt = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
completedAt :: Maybe Text
$sel:completedAt:Deployment' :: Deployment -> Maybe Text
completedAt} -> Maybe Text
completedAt) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:completedAt:Deployment' :: Maybe Text
completedAt = Maybe Text
a} :: Deployment)

-- | The stack ID.
deployment_stackId :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_stackId :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_stackId = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
stackId :: Maybe Text
$sel:stackId:Deployment' :: Deployment -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:stackId:Deployment' :: Maybe Text
stackId = Maybe Text
a} :: Deployment)

-- | A user-defined comment.
deployment_comment :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_comment :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_comment = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
comment :: Maybe Text
$sel:comment:Deployment' :: Deployment -> Maybe Text
comment} -> Maybe Text
comment) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:comment:Deployment' :: Maybe Text
comment = Maybe Text
a} :: Deployment)

-- | The deployment duration.
deployment_duration :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Int)
deployment_duration :: (Maybe Int -> f (Maybe Int)) -> Deployment -> f Deployment
deployment_duration = (Deployment -> Maybe Int)
-> (Deployment -> Maybe Int -> Deployment)
-> Lens Deployment Deployment (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Int
duration :: Maybe Int
$sel:duration:Deployment' :: Deployment -> Maybe Int
duration} -> Maybe Int
duration) (\s :: Deployment
s@Deployment' {} Maybe Int
a -> Deployment
s {$sel:duration:Deployment' :: Maybe Int
duration = Maybe Int
a} :: Deployment)

instance Core.FromJSON Deployment where
  parseJSON :: Value -> Parser Deployment
parseJSON =
    String
-> (Object -> Parser Deployment) -> Value -> Parser Deployment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Deployment"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe DeploymentCommand
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Deployment
Deployment'
            (Maybe Text
 -> Maybe Text
 -> Maybe DeploymentCommand
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe DeploymentCommand
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Deployment)
forall (f :: * -> *) a b. Functor 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
"DeploymentId")
            Parser
  (Maybe Text
   -> Maybe DeploymentCommand
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe DeploymentCommand
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Deployment)
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
"Status")
            Parser
  (Maybe DeploymentCommand
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Deployment)
-> Parser (Maybe DeploymentCommand)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeploymentCommand)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Command")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Deployment)
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
"CreatedAt")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Deployment)
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
"CustomJson")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Deployment)
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
"IamUserArn")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Deployment)
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
"AppId")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Deployment)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceIds" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Deployment)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Int -> Deployment)
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
"CompletedAt")
            Parser (Maybe Text -> Maybe Text -> Maybe Int -> Deployment)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> Deployment)
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
"StackId")
            Parser (Maybe Text -> Maybe Int -> Deployment)
-> Parser (Maybe Text) -> Parser (Maybe Int -> Deployment)
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
"Comment")
            Parser (Maybe Int -> Deployment)
-> Parser (Maybe Int) -> Parser Deployment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Duration")
      )

instance Prelude.Hashable Deployment

instance Prelude.NFData Deployment