{-# 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 #-}
module Amazonka.OpsWorks.Types.Command where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Command = Command'
{
Command -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
logUrl :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
commandId :: Prelude.Maybe Prelude.Text,
Command -> Maybe Int
exitCode :: Prelude.Maybe Prelude.Int,
Command -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
completedAt :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
acknowledgedAt :: Prelude.Maybe Prelude.Text
}
deriving (Command -> Command -> Bool
(Command -> Command -> Bool)
-> (Command -> Command -> Bool) -> Eq Command
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Command -> Command -> Bool
$c/= :: Command -> Command -> Bool
== :: Command -> Command -> Bool
$c== :: Command -> Command -> Bool
Prelude.Eq, ReadPrec [Command]
ReadPrec Command
Int -> ReadS Command
ReadS [Command]
(Int -> ReadS Command)
-> ReadS [Command]
-> ReadPrec Command
-> ReadPrec [Command]
-> Read Command
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Command]
$creadListPrec :: ReadPrec [Command]
readPrec :: ReadPrec Command
$creadPrec :: ReadPrec Command
readList :: ReadS [Command]
$creadList :: ReadS [Command]
readsPrec :: Int -> ReadS Command
$creadsPrec :: Int -> ReadS Command
Prelude.Read, Int -> Command -> ShowS
[Command] -> ShowS
Command -> String
(Int -> Command -> ShowS)
-> (Command -> String) -> ([Command] -> ShowS) -> Show Command
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Command] -> ShowS
$cshowList :: [Command] -> ShowS
show :: Command -> String
$cshow :: Command -> String
showsPrec :: Int -> Command -> ShowS
$cshowsPrec :: Int -> Command -> ShowS
Prelude.Show, (forall x. Command -> Rep Command x)
-> (forall x. Rep Command x -> Command) -> Generic Command
forall x. Rep Command x -> Command
forall x. Command -> Rep Command x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Command x -> Command
$cfrom :: forall x. Command -> Rep Command x
Prelude.Generic)
newCommand ::
Command
newCommand :: Command
newCommand =
Command' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command
Command'
{ $sel:deploymentId:Command' :: Maybe Text
deploymentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:Command' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:Command' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logUrl:Command' :: Maybe Text
logUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Command' :: Maybe Text
createdAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:commandId:Command' :: Maybe Text
commandId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:exitCode:Command' :: Maybe Int
exitCode = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:type':Command' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:completedAt:Command' :: Maybe Text
completedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:acknowledgedAt:Command' :: Maybe Text
acknowledgedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
command_deploymentId :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_deploymentId :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_deploymentId = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:Command' :: Command -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:deploymentId:Command' :: Maybe Text
deploymentId = Maybe Text
a} :: Command)
command_instanceId :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_instanceId :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_instanceId = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:Command' :: Command -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:instanceId:Command' :: Maybe Text
instanceId = Maybe Text
a} :: Command)
command_status :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_status :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_status = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
status :: Maybe Text
$sel:status:Command' :: Command -> Maybe Text
status} -> Maybe Text
status) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:status:Command' :: Maybe Text
status = Maybe Text
a} :: Command)
command_logUrl :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_logUrl :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_logUrl = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
logUrl :: Maybe Text
$sel:logUrl:Command' :: Command -> Maybe Text
logUrl} -> Maybe Text
logUrl) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:logUrl:Command' :: Maybe Text
logUrl = Maybe Text
a} :: Command)
command_createdAt :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_createdAt :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_createdAt = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
createdAt :: Maybe Text
$sel:createdAt:Command' :: Command -> Maybe Text
createdAt} -> Maybe Text
createdAt) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:createdAt:Command' :: Maybe Text
createdAt = Maybe Text
a} :: Command)
command_commandId :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_commandId :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_commandId = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
commandId :: Maybe Text
$sel:commandId:Command' :: Command -> Maybe Text
commandId} -> Maybe Text
commandId) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:commandId:Command' :: Maybe Text
commandId = Maybe Text
a} :: Command)
command_exitCode :: Lens.Lens' Command (Prelude.Maybe Prelude.Int)
command_exitCode :: (Maybe Int -> f (Maybe Int)) -> Command -> f Command
command_exitCode = (Command -> Maybe Int)
-> (Command -> Maybe Int -> Command)
-> Lens Command Command (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Int
exitCode :: Maybe Int
$sel:exitCode:Command' :: Command -> Maybe Int
exitCode} -> Maybe Int
exitCode) (\s :: Command
s@Command' {} Maybe Int
a -> Command
s {$sel:exitCode:Command' :: Maybe Int
exitCode = Maybe Int
a} :: Command)
command_type :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_type :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_type = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
type' :: Maybe Text
$sel:type':Command' :: Command -> Maybe Text
type'} -> Maybe Text
type') (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:type':Command' :: Maybe Text
type' = Maybe Text
a} :: Command)
command_completedAt :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_completedAt :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_completedAt = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
completedAt :: Maybe Text
$sel:completedAt:Command' :: Command -> Maybe Text
completedAt} -> Maybe Text
completedAt) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:completedAt:Command' :: Maybe Text
completedAt = Maybe Text
a} :: Command)
command_acknowledgedAt :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_acknowledgedAt :: (Maybe Text -> f (Maybe Text)) -> Command -> f Command
command_acknowledgedAt = (Command -> Maybe Text)
-> (Command -> Maybe Text -> Command)
-> Lens Command Command (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
acknowledgedAt :: Maybe Text
$sel:acknowledgedAt:Command' :: Command -> Maybe Text
acknowledgedAt} -> Maybe Text
acknowledgedAt) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:acknowledgedAt:Command' :: Maybe Text
acknowledgedAt = Maybe Text
a} :: Command)
instance Core.FromJSON Command where
parseJSON :: Value -> Parser Command
parseJSON =
String -> (Object -> Parser Command) -> Value -> Parser Command
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Command"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command
Command'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
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
"InstanceId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
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
"LogUrl")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Int -> Maybe Text -> Maybe Text -> Maybe Text -> Command)
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 Int -> Maybe Text -> Maybe Text -> Maybe Text -> Command)
-> Parser (Maybe Text)
-> Parser
(Maybe Int -> Maybe Text -> Maybe Text -> Maybe Text -> Command)
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
"CommandId")
Parser
(Maybe Int -> Maybe Text -> Maybe Text -> Maybe Text -> Command)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Command)
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
"ExitCode")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Command)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Command)
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
"Type")
Parser (Maybe Text -> Maybe Text -> Command)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Command)
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 -> Command)
-> Parser (Maybe Text) -> Parser Command
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
"AcknowledgedAt")
)
instance Prelude.Hashable Command
instance Prelude.NFData Command