{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Command = Command'
{
Command -> Maybe Text
acknowledgedAt :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
commandId :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
completedAt :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
Command -> Maybe Int
exitCode :: Prelude.Maybe Prelude.Int,
Command -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
logUrl :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Command -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (Command -> Command -> Bool
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]
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
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. 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'
{ $sel:acknowledgedAt:Command' :: Maybe Text
acknowledgedAt = forall a. Maybe a
Prelude.Nothing,
$sel:commandId:Command' :: Maybe Text
commandId = forall a. Maybe a
Prelude.Nothing,
$sel:completedAt:Command' :: Maybe Text
completedAt = forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Command' :: Maybe Text
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:deploymentId:Command' :: Maybe Text
deploymentId = forall a. Maybe a
Prelude.Nothing,
$sel:exitCode:Command' :: Maybe Int
exitCode = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:Command' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
$sel:logUrl:Command' :: Maybe Text
logUrl = forall a. Maybe a
Prelude.Nothing,
$sel:status:Command' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
$sel:type':Command' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing
}
command_acknowledgedAt :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_acknowledgedAt :: Lens' Command (Maybe Text)
command_acknowledgedAt = 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)
command_commandId :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_commandId :: Lens' Command (Maybe Text)
command_commandId = 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_completedAt :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_completedAt :: Lens' Command (Maybe Text)
command_completedAt = 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_createdAt :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_createdAt :: Lens' Command (Maybe Text)
command_createdAt = 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_deploymentId :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_deploymentId :: Lens' Command (Maybe Text)
command_deploymentId = 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_exitCode :: Lens.Lens' Command (Prelude.Maybe Prelude.Int)
command_exitCode :: Lens' Command (Maybe Int)
command_exitCode = 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_instanceId :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_instanceId :: Lens' Command (Maybe Text)
command_instanceId = 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_logUrl :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_logUrl :: Lens' Command (Maybe Text)
command_logUrl = 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_status :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_status :: Lens' Command (Maybe Text)
command_status = 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_type :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_type :: Lens' Command (Maybe Text)
command_type = 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)
instance Data.FromJSON Command where
parseJSON :: Value -> Parser Command
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Command"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Command
Command'
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
"AcknowledgedAt")
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
"CommandId")
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
"CreatedAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DeploymentId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ExitCode")
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
"InstanceId")
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
"LogUrl")
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
"Status")
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
"Type")
)
instance Prelude.Hashable Command where
hashWithSalt :: Int -> Command -> Int
hashWithSalt Int
_salt Command' {Maybe Int
Maybe Text
type' :: Maybe Text
status :: Maybe Text
logUrl :: Maybe Text
instanceId :: Maybe Text
exitCode :: Maybe Int
deploymentId :: Maybe Text
createdAt :: Maybe Text
completedAt :: Maybe Text
commandId :: Maybe Text
acknowledgedAt :: Maybe Text
$sel:type':Command' :: Command -> Maybe Text
$sel:status:Command' :: Command -> Maybe Text
$sel:logUrl:Command' :: Command -> Maybe Text
$sel:instanceId:Command' :: Command -> Maybe Text
$sel:exitCode:Command' :: Command -> Maybe Int
$sel:deploymentId:Command' :: Command -> Maybe Text
$sel:createdAt:Command' :: Command -> Maybe Text
$sel:completedAt:Command' :: Command -> Maybe Text
$sel:commandId:Command' :: Command -> Maybe Text
$sel:acknowledgedAt:Command' :: Command -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acknowledgedAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
commandId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
completedAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deploymentId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
exitCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
instance Prelude.NFData Command where
rnf :: Command -> ()
rnf Command' {Maybe Int
Maybe Text
type' :: Maybe Text
status :: Maybe Text
logUrl :: Maybe Text
instanceId :: Maybe Text
exitCode :: Maybe Int
deploymentId :: Maybe Text
createdAt :: Maybe Text
completedAt :: Maybe Text
commandId :: Maybe Text
acknowledgedAt :: Maybe Text
$sel:type':Command' :: Command -> Maybe Text
$sel:status:Command' :: Command -> Maybe Text
$sel:logUrl:Command' :: Command -> Maybe Text
$sel:instanceId:Command' :: Command -> Maybe Text
$sel:exitCode:Command' :: Command -> Maybe Int
$sel:deploymentId:Command' :: Command -> Maybe Text
$sel:createdAt:Command' :: Command -> Maybe Text
$sel:completedAt:Command' :: Command -> Maybe Text
$sel:commandId:Command' :: Command -> Maybe Text
$sel:acknowledgedAt:Command' :: Command -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
acknowledgedAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
commandId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
completedAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deploymentId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
exitCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'