{-# 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.SSM.Types.Command
-- 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.SSM.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
import Amazonka.SSM.Types.AlarmConfiguration
import Amazonka.SSM.Types.AlarmStateInformation
import Amazonka.SSM.Types.CloudWatchOutputConfig
import Amazonka.SSM.Types.CommandStatus
import Amazonka.SSM.Types.NotificationConfig
import Amazonka.SSM.Types.Target

-- | Describes a command request.
--
-- /See:/ 'newCommand' smart constructor.
data Command = Command'
  { -- | The details for the CloudWatch alarm applied to your command.
    Command -> Maybe AlarmConfiguration
alarmConfiguration :: Prelude.Maybe AlarmConfiguration,
    -- | Amazon CloudWatch Logs information where you want Amazon Web Services
    -- Systems Manager to send the command output.
    Command -> Maybe CloudWatchOutputConfig
cloudWatchOutputConfig :: Prelude.Maybe CloudWatchOutputConfig,
    -- | A unique identifier for this command.
    Command -> Maybe Text
commandId :: Prelude.Maybe Prelude.Text,
    -- | User-specified information about the command, such as a brief
    -- description of what the command should do.
    Command -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The number of targets for which the command invocation reached a
    -- terminal state. Terminal states include the following: Success, Failed,
    -- Execution Timed Out, Delivery Timed Out, Cancelled, Terminated, or
    -- Undeliverable.
    Command -> Maybe Int
completedCount :: Prelude.Maybe Prelude.Int,
    -- | The number of targets for which the status is Delivery Timed Out.
    Command -> Maybe Int
deliveryTimedOutCount :: Prelude.Maybe Prelude.Int,
    -- | The name of the document requested for execution.
    Command -> Maybe Text
documentName :: Prelude.Maybe Prelude.Text,
    -- | The Systems Manager document (SSM document) version.
    Command -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | The number of targets for which the status is Failed or Execution Timed
    -- Out.
    Command -> Maybe Int
errorCount :: Prelude.Maybe Prelude.Int,
    -- | If a command expires, it changes status to @DeliveryTimedOut@ for all
    -- invocations that have the status @InProgress@, @Pending@, or @Delayed@.
    -- @ExpiresAfter@ is calculated based on the total timeout for the overall
    -- command. For more information, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html?icmpid=docs_ec2_console#monitor-about-status-timeouts Understanding command timeout values>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    Command -> Maybe POSIX
expiresAfter :: Prelude.Maybe Data.POSIX,
    -- | The managed node IDs against which this command was requested.
    Command -> Maybe [Text]
instanceIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of managed nodes that are allowed to run the command
    -- at the same time. You can specify a number of managed nodes, such as 10,
    -- or a percentage of nodes, such as 10%. The default value is 50. For more
    -- information about how to use @MaxConcurrency@, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html Running commands using Systems Manager Run Command>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    Command -> Maybe Text
maxConcurrency :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of errors allowed before the system stops sending the
    -- command to additional targets. You can specify a number of errors, such
    -- as 10, or a percentage or errors, such as 10%. The default value is @0@.
    -- For more information about how to use @MaxErrors@, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html Running commands using Systems Manager Run Command>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    Command -> Maybe Text
maxErrors :: Prelude.Maybe Prelude.Text,
    -- | Configurations for sending notifications about command status changes.
    Command -> Maybe NotificationConfig
notificationConfig :: Prelude.Maybe NotificationConfig,
    -- | The S3 bucket where the responses to the command executions should be
    -- stored. This was requested when issuing the command.
    Command -> Maybe Text
outputS3BucketName :: Prelude.Maybe Prelude.Text,
    -- | The S3 directory path inside the bucket where the responses to the
    -- command executions should be stored. This was requested when issuing the
    -- command.
    Command -> Maybe Text
outputS3KeyPrefix :: Prelude.Maybe Prelude.Text,
    -- | (Deprecated) You can no longer specify this parameter. The system
    -- ignores it. Instead, Systems Manager automatically determines the Amazon
    -- Web Services Region of the S3 bucket.
    Command -> Maybe Text
outputS3Region :: Prelude.Maybe Prelude.Text,
    -- | The parameter values to be inserted in the document when running the
    -- command.
    Command -> Maybe (Sensitive (HashMap Text [Text]))
parameters :: Prelude.Maybe (Data.Sensitive (Prelude.HashMap Prelude.Text [Prelude.Text])),
    -- | The date and time the command was requested.
    Command -> Maybe POSIX
requestedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The Identity and Access Management (IAM) service role that Run Command,
    -- a capability of Amazon Web Services Systems Manager, uses to act on your
    -- behalf when sending notifications about command status changes.
    Command -> Maybe Text
serviceRole :: Prelude.Maybe Prelude.Text,
    -- | The status of the command.
    Command -> Maybe CommandStatus
status :: Prelude.Maybe CommandStatus,
    -- | A detailed status of the command execution. @StatusDetails@ includes
    -- more information than @Status@ because it includes states resulting from
    -- error and concurrency control parameters. @StatusDetails@ can show
    -- different results than Status. For more information about these
    -- statuses, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html Understanding command statuses>
    -- in the /Amazon Web Services Systems Manager User Guide/. StatusDetails
    -- can be one of the following values:
    --
    -- -   Pending: The command hasn\'t been sent to any managed nodes.
    --
    -- -   In Progress: The command has been sent to at least one managed node
    --     but hasn\'t reached a final state on all managed nodes.
    --
    -- -   Success: The command successfully ran on all invocations. This is a
    --     terminal state.
    --
    -- -   Delivery Timed Out: The value of MaxErrors or more command
    --     invocations shows a status of Delivery Timed Out. This is a terminal
    --     state.
    --
    -- -   Execution Timed Out: The value of MaxErrors or more command
    --     invocations shows a status of Execution Timed Out. This is a
    --     terminal state.
    --
    -- -   Failed: The value of MaxErrors or more command invocations shows a
    --     status of Failed. This is a terminal state.
    --
    -- -   Incomplete: The command was attempted on all managed nodes and one
    --     or more invocations doesn\'t have a value of Success but not enough
    --     invocations failed for the status to be Failed. This is a terminal
    --     state.
    --
    -- -   Cancelled: The command was terminated before it was completed. This
    --     is a terminal state.
    --
    -- -   Rate Exceeded: The number of managed nodes targeted by the command
    --     exceeded the account limit for pending invocations. The system has
    --     canceled the command before running it on any managed node. This is
    --     a terminal state.
    --
    -- -   Delayed: The system attempted to send the command to the managed
    --     node but wasn\'t successful. The system retries again.
    Command -> Maybe Text
statusDetails :: Prelude.Maybe Prelude.Text,
    -- | The number of targets for the command.
    Command -> Maybe Int
targetCount :: Prelude.Maybe Prelude.Int,
    -- | An array of search criteria that targets managed nodes using a Key,Value
    -- combination that you specify. Targets is required if you don\'t provide
    -- one or more managed node IDs in the call.
    Command -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | The @TimeoutSeconds@ value specified for a command.
    Command -> Maybe Natural
timeoutSeconds :: Prelude.Maybe Prelude.Natural,
    -- | The CloudWatch alarm that was invoked by the command.
    Command -> Maybe (NonEmpty AlarmStateInformation)
triggeredAlarms :: Prelude.Maybe (Prelude.NonEmpty AlarmStateInformation)
  }
  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, 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)

-- |
-- Create a value of 'Command' 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:
--
-- 'alarmConfiguration', 'command_alarmConfiguration' - The details for the CloudWatch alarm applied to your command.
--
-- 'cloudWatchOutputConfig', 'command_cloudWatchOutputConfig' - Amazon CloudWatch Logs information where you want Amazon Web Services
-- Systems Manager to send the command output.
--
-- 'commandId', 'command_commandId' - A unique identifier for this command.
--
-- 'comment', 'command_comment' - User-specified information about the command, such as a brief
-- description of what the command should do.
--
-- 'completedCount', 'command_completedCount' - The number of targets for which the command invocation reached a
-- terminal state. Terminal states include the following: Success, Failed,
-- Execution Timed Out, Delivery Timed Out, Cancelled, Terminated, or
-- Undeliverable.
--
-- 'deliveryTimedOutCount', 'command_deliveryTimedOutCount' - The number of targets for which the status is Delivery Timed Out.
--
-- 'documentName', 'command_documentName' - The name of the document requested for execution.
--
-- 'documentVersion', 'command_documentVersion' - The Systems Manager document (SSM document) version.
--
-- 'errorCount', 'command_errorCount' - The number of targets for which the status is Failed or Execution Timed
-- Out.
--
-- 'expiresAfter', 'command_expiresAfter' - If a command expires, it changes status to @DeliveryTimedOut@ for all
-- invocations that have the status @InProgress@, @Pending@, or @Delayed@.
-- @ExpiresAfter@ is calculated based on the total timeout for the overall
-- command. For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html?icmpid=docs_ec2_console#monitor-about-status-timeouts Understanding command timeout values>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- 'instanceIds', 'command_instanceIds' - The managed node IDs against which this command was requested.
--
-- 'maxConcurrency', 'command_maxConcurrency' - The maximum number of managed nodes that are allowed to run the command
-- at the same time. You can specify a number of managed nodes, such as 10,
-- or a percentage of nodes, such as 10%. The default value is 50. For more
-- information about how to use @MaxConcurrency@, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html Running commands using Systems Manager Run Command>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- 'maxErrors', 'command_maxErrors' - The maximum number of errors allowed before the system stops sending the
-- command to additional targets. You can specify a number of errors, such
-- as 10, or a percentage or errors, such as 10%. The default value is @0@.
-- For more information about how to use @MaxErrors@, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html Running commands using Systems Manager Run Command>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- 'notificationConfig', 'command_notificationConfig' - Configurations for sending notifications about command status changes.
--
-- 'outputS3BucketName', 'command_outputS3BucketName' - The S3 bucket where the responses to the command executions should be
-- stored. This was requested when issuing the command.
--
-- 'outputS3KeyPrefix', 'command_outputS3KeyPrefix' - The S3 directory path inside the bucket where the responses to the
-- command executions should be stored. This was requested when issuing the
-- command.
--
-- 'outputS3Region', 'command_outputS3Region' - (Deprecated) You can no longer specify this parameter. The system
-- ignores it. Instead, Systems Manager automatically determines the Amazon
-- Web Services Region of the S3 bucket.
--
-- 'parameters', 'command_parameters' - The parameter values to be inserted in the document when running the
-- command.
--
-- 'requestedDateTime', 'command_requestedDateTime' - The date and time the command was requested.
--
-- 'serviceRole', 'command_serviceRole' - The Identity and Access Management (IAM) service role that Run Command,
-- a capability of Amazon Web Services Systems Manager, uses to act on your
-- behalf when sending notifications about command status changes.
--
-- 'status', 'command_status' - The status of the command.
--
-- 'statusDetails', 'command_statusDetails' - A detailed status of the command execution. @StatusDetails@ includes
-- more information than @Status@ because it includes states resulting from
-- error and concurrency control parameters. @StatusDetails@ can show
-- different results than Status. For more information about these
-- statuses, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html Understanding command statuses>
-- in the /Amazon Web Services Systems Manager User Guide/. StatusDetails
-- can be one of the following values:
--
-- -   Pending: The command hasn\'t been sent to any managed nodes.
--
-- -   In Progress: The command has been sent to at least one managed node
--     but hasn\'t reached a final state on all managed nodes.
--
-- -   Success: The command successfully ran on all invocations. This is a
--     terminal state.
--
-- -   Delivery Timed Out: The value of MaxErrors or more command
--     invocations shows a status of Delivery Timed Out. This is a terminal
--     state.
--
-- -   Execution Timed Out: The value of MaxErrors or more command
--     invocations shows a status of Execution Timed Out. This is a
--     terminal state.
--
-- -   Failed: The value of MaxErrors or more command invocations shows a
--     status of Failed. This is a terminal state.
--
-- -   Incomplete: The command was attempted on all managed nodes and one
--     or more invocations doesn\'t have a value of Success but not enough
--     invocations failed for the status to be Failed. This is a terminal
--     state.
--
-- -   Cancelled: The command was terminated before it was completed. This
--     is a terminal state.
--
-- -   Rate Exceeded: The number of managed nodes targeted by the command
--     exceeded the account limit for pending invocations. The system has
--     canceled the command before running it on any managed node. This is
--     a terminal state.
--
-- -   Delayed: The system attempted to send the command to the managed
--     node but wasn\'t successful. The system retries again.
--
-- 'targetCount', 'command_targetCount' - The number of targets for the command.
--
-- 'targets', 'command_targets' - An array of search criteria that targets managed nodes using a Key,Value
-- combination that you specify. Targets is required if you don\'t provide
-- one or more managed node IDs in the call.
--
-- 'timeoutSeconds', 'command_timeoutSeconds' - The @TimeoutSeconds@ value specified for a command.
--
-- 'triggeredAlarms', 'command_triggeredAlarms' - The CloudWatch alarm that was invoked by the command.
newCommand ::
  Command
newCommand :: Command
newCommand =
  Command'
    { $sel:alarmConfiguration:Command' :: Maybe AlarmConfiguration
alarmConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchOutputConfig:Command' :: Maybe CloudWatchOutputConfig
cloudWatchOutputConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:commandId:Command' :: Maybe Text
commandId = forall a. Maybe a
Prelude.Nothing,
      $sel:comment:Command' :: Maybe Text
comment = forall a. Maybe a
Prelude.Nothing,
      $sel:completedCount:Command' :: Maybe Int
completedCount = forall a. Maybe a
Prelude.Nothing,
      $sel:deliveryTimedOutCount:Command' :: Maybe Int
deliveryTimedOutCount = forall a. Maybe a
Prelude.Nothing,
      $sel:documentName:Command' :: Maybe Text
documentName = forall a. Maybe a
Prelude.Nothing,
      $sel:documentVersion:Command' :: Maybe Text
documentVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:errorCount:Command' :: Maybe Int
errorCount = forall a. Maybe a
Prelude.Nothing,
      $sel:expiresAfter:Command' :: Maybe POSIX
expiresAfter = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceIds:Command' :: Maybe [Text]
instanceIds = forall a. Maybe a
Prelude.Nothing,
      $sel:maxConcurrency:Command' :: Maybe Text
maxConcurrency = forall a. Maybe a
Prelude.Nothing,
      $sel:maxErrors:Command' :: Maybe Text
maxErrors = forall a. Maybe a
Prelude.Nothing,
      $sel:notificationConfig:Command' :: Maybe NotificationConfig
notificationConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:outputS3BucketName:Command' :: Maybe Text
outputS3BucketName = forall a. Maybe a
Prelude.Nothing,
      $sel:outputS3KeyPrefix:Command' :: Maybe Text
outputS3KeyPrefix = forall a. Maybe a
Prelude.Nothing,
      $sel:outputS3Region:Command' :: Maybe Text
outputS3Region = forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:Command' :: Maybe (Sensitive (HashMap Text [Text]))
parameters = forall a. Maybe a
Prelude.Nothing,
      $sel:requestedDateTime:Command' :: Maybe POSIX
requestedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceRole:Command' :: Maybe Text
serviceRole = forall a. Maybe a
Prelude.Nothing,
      $sel:status:Command' :: Maybe CommandStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetails:Command' :: Maybe Text
statusDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:targetCount:Command' :: Maybe Int
targetCount = forall a. Maybe a
Prelude.Nothing,
      $sel:targets:Command' :: Maybe [Target]
targets = forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutSeconds:Command' :: Maybe Natural
timeoutSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:triggeredAlarms:Command' :: Maybe (NonEmpty AlarmStateInformation)
triggeredAlarms = forall a. Maybe a
Prelude.Nothing
    }

-- | The details for the CloudWatch alarm applied to your command.
command_alarmConfiguration :: Lens.Lens' Command (Prelude.Maybe AlarmConfiguration)
command_alarmConfiguration :: Lens' Command (Maybe AlarmConfiguration)
command_alarmConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe AlarmConfiguration
alarmConfiguration :: Maybe AlarmConfiguration
$sel:alarmConfiguration:Command' :: Command -> Maybe AlarmConfiguration
alarmConfiguration} -> Maybe AlarmConfiguration
alarmConfiguration) (\s :: Command
s@Command' {} Maybe AlarmConfiguration
a -> Command
s {$sel:alarmConfiguration:Command' :: Maybe AlarmConfiguration
alarmConfiguration = Maybe AlarmConfiguration
a} :: Command)

-- | Amazon CloudWatch Logs information where you want Amazon Web Services
-- Systems Manager to send the command output.
command_cloudWatchOutputConfig :: Lens.Lens' Command (Prelude.Maybe CloudWatchOutputConfig)
command_cloudWatchOutputConfig :: Lens' Command (Maybe CloudWatchOutputConfig)
command_cloudWatchOutputConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe CloudWatchOutputConfig
cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig
$sel:cloudWatchOutputConfig:Command' :: Command -> Maybe CloudWatchOutputConfig
cloudWatchOutputConfig} -> Maybe CloudWatchOutputConfig
cloudWatchOutputConfig) (\s :: Command
s@Command' {} Maybe CloudWatchOutputConfig
a -> Command
s {$sel:cloudWatchOutputConfig:Command' :: Maybe CloudWatchOutputConfig
cloudWatchOutputConfig = Maybe CloudWatchOutputConfig
a} :: Command)

-- | A unique identifier for this 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)

-- | User-specified information about the command, such as a brief
-- description of what the command should do.
command_comment :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_comment :: Lens' Command (Maybe Text)
command_comment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
comment :: Maybe Text
$sel:comment:Command' :: Command -> Maybe Text
comment} -> Maybe Text
comment) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:comment:Command' :: Maybe Text
comment = Maybe Text
a} :: Command)

-- | The number of targets for which the command invocation reached a
-- terminal state. Terminal states include the following: Success, Failed,
-- Execution Timed Out, Delivery Timed Out, Cancelled, Terminated, or
-- Undeliverable.
command_completedCount :: Lens.Lens' Command (Prelude.Maybe Prelude.Int)
command_completedCount :: Lens' Command (Maybe Int)
command_completedCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Int
completedCount :: Maybe Int
$sel:completedCount:Command' :: Command -> Maybe Int
completedCount} -> Maybe Int
completedCount) (\s :: Command
s@Command' {} Maybe Int
a -> Command
s {$sel:completedCount:Command' :: Maybe Int
completedCount = Maybe Int
a} :: Command)

-- | The number of targets for which the status is Delivery Timed Out.
command_deliveryTimedOutCount :: Lens.Lens' Command (Prelude.Maybe Prelude.Int)
command_deliveryTimedOutCount :: Lens' Command (Maybe Int)
command_deliveryTimedOutCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Int
deliveryTimedOutCount :: Maybe Int
$sel:deliveryTimedOutCount:Command' :: Command -> Maybe Int
deliveryTimedOutCount} -> Maybe Int
deliveryTimedOutCount) (\s :: Command
s@Command' {} Maybe Int
a -> Command
s {$sel:deliveryTimedOutCount:Command' :: Maybe Int
deliveryTimedOutCount = Maybe Int
a} :: Command)

-- | The name of the document requested for execution.
command_documentName :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_documentName :: Lens' Command (Maybe Text)
command_documentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
documentName :: Maybe Text
$sel:documentName:Command' :: Command -> Maybe Text
documentName} -> Maybe Text
documentName) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:documentName:Command' :: Maybe Text
documentName = Maybe Text
a} :: Command)

-- | The Systems Manager document (SSM document) version.
command_documentVersion :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_documentVersion :: Lens' Command (Maybe Text)
command_documentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:Command' :: Command -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:documentVersion:Command' :: Maybe Text
documentVersion = Maybe Text
a} :: Command)

-- | The number of targets for which the status is Failed or Execution Timed
-- Out.
command_errorCount :: Lens.Lens' Command (Prelude.Maybe Prelude.Int)
command_errorCount :: Lens' Command (Maybe Int)
command_errorCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Int
errorCount :: Maybe Int
$sel:errorCount:Command' :: Command -> Maybe Int
errorCount} -> Maybe Int
errorCount) (\s :: Command
s@Command' {} Maybe Int
a -> Command
s {$sel:errorCount:Command' :: Maybe Int
errorCount = Maybe Int
a} :: Command)

-- | If a command expires, it changes status to @DeliveryTimedOut@ for all
-- invocations that have the status @InProgress@, @Pending@, or @Delayed@.
-- @ExpiresAfter@ is calculated based on the total timeout for the overall
-- command. For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html?icmpid=docs_ec2_console#monitor-about-status-timeouts Understanding command timeout values>
-- in the /Amazon Web Services Systems Manager User Guide/.
command_expiresAfter :: Lens.Lens' Command (Prelude.Maybe Prelude.UTCTime)
command_expiresAfter :: Lens' Command (Maybe UTCTime)
command_expiresAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe POSIX
expiresAfter :: Maybe POSIX
$sel:expiresAfter:Command' :: Command -> Maybe POSIX
expiresAfter} -> Maybe POSIX
expiresAfter) (\s :: Command
s@Command' {} Maybe POSIX
a -> Command
s {$sel:expiresAfter:Command' :: Maybe POSIX
expiresAfter = Maybe POSIX
a} :: Command) 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 managed node IDs against which this command was requested.
command_instanceIds :: Lens.Lens' Command (Prelude.Maybe [Prelude.Text])
command_instanceIds :: Lens' Command (Maybe [Text])
command_instanceIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe [Text]
instanceIds :: Maybe [Text]
$sel:instanceIds:Command' :: Command -> Maybe [Text]
instanceIds} -> Maybe [Text]
instanceIds) (\s :: Command
s@Command' {} Maybe [Text]
a -> Command
s {$sel:instanceIds:Command' :: Maybe [Text]
instanceIds = Maybe [Text]
a} :: Command) 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 maximum number of managed nodes that are allowed to run the command
-- at the same time. You can specify a number of managed nodes, such as 10,
-- or a percentage of nodes, such as 10%. The default value is 50. For more
-- information about how to use @MaxConcurrency@, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html Running commands using Systems Manager Run Command>
-- in the /Amazon Web Services Systems Manager User Guide/.
command_maxConcurrency :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_maxConcurrency :: Lens' Command (Maybe Text)
command_maxConcurrency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
maxConcurrency :: Maybe Text
$sel:maxConcurrency:Command' :: Command -> Maybe Text
maxConcurrency} -> Maybe Text
maxConcurrency) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:maxConcurrency:Command' :: Maybe Text
maxConcurrency = Maybe Text
a} :: Command)

-- | The maximum number of errors allowed before the system stops sending the
-- command to additional targets. You can specify a number of errors, such
-- as 10, or a percentage or errors, such as 10%. The default value is @0@.
-- For more information about how to use @MaxErrors@, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html Running commands using Systems Manager Run Command>
-- in the /Amazon Web Services Systems Manager User Guide/.
command_maxErrors :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_maxErrors :: Lens' Command (Maybe Text)
command_maxErrors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
maxErrors :: Maybe Text
$sel:maxErrors:Command' :: Command -> Maybe Text
maxErrors} -> Maybe Text
maxErrors) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:maxErrors:Command' :: Maybe Text
maxErrors = Maybe Text
a} :: Command)

-- | Configurations for sending notifications about command status changes.
command_notificationConfig :: Lens.Lens' Command (Prelude.Maybe NotificationConfig)
command_notificationConfig :: Lens' Command (Maybe NotificationConfig)
command_notificationConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe NotificationConfig
notificationConfig :: Maybe NotificationConfig
$sel:notificationConfig:Command' :: Command -> Maybe NotificationConfig
notificationConfig} -> Maybe NotificationConfig
notificationConfig) (\s :: Command
s@Command' {} Maybe NotificationConfig
a -> Command
s {$sel:notificationConfig:Command' :: Maybe NotificationConfig
notificationConfig = Maybe NotificationConfig
a} :: Command)

-- | The S3 bucket where the responses to the command executions should be
-- stored. This was requested when issuing the command.
command_outputS3BucketName :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_outputS3BucketName :: Lens' Command (Maybe Text)
command_outputS3BucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
outputS3BucketName :: Maybe Text
$sel:outputS3BucketName:Command' :: Command -> Maybe Text
outputS3BucketName} -> Maybe Text
outputS3BucketName) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:outputS3BucketName:Command' :: Maybe Text
outputS3BucketName = Maybe Text
a} :: Command)

-- | The S3 directory path inside the bucket where the responses to the
-- command executions should be stored. This was requested when issuing the
-- command.
command_outputS3KeyPrefix :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_outputS3KeyPrefix :: Lens' Command (Maybe Text)
command_outputS3KeyPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
outputS3KeyPrefix :: Maybe Text
$sel:outputS3KeyPrefix:Command' :: Command -> Maybe Text
outputS3KeyPrefix} -> Maybe Text
outputS3KeyPrefix) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:outputS3KeyPrefix:Command' :: Maybe Text
outputS3KeyPrefix = Maybe Text
a} :: Command)

-- | (Deprecated) You can no longer specify this parameter. The system
-- ignores it. Instead, Systems Manager automatically determines the Amazon
-- Web Services Region of the S3 bucket.
command_outputS3Region :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_outputS3Region :: Lens' Command (Maybe Text)
command_outputS3Region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
outputS3Region :: Maybe Text
$sel:outputS3Region:Command' :: Command -> Maybe Text
outputS3Region} -> Maybe Text
outputS3Region) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:outputS3Region:Command' :: Maybe Text
outputS3Region = Maybe Text
a} :: Command)

-- | The parameter values to be inserted in the document when running the
-- command.
command_parameters :: Lens.Lens' Command (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
command_parameters :: Lens' Command (Maybe (HashMap Text [Text]))
command_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe (Sensitive (HashMap Text [Text]))
parameters :: Maybe (Sensitive (HashMap Text [Text]))
$sel:parameters:Command' :: Command -> Maybe (Sensitive (HashMap Text [Text]))
parameters} -> Maybe (Sensitive (HashMap Text [Text]))
parameters) (\s :: Command
s@Command' {} Maybe (Sensitive (HashMap Text [Text]))
a -> Command
s {$sel:parameters:Command' :: Maybe (Sensitive (HashMap Text [Text]))
parameters = Maybe (Sensitive (HashMap Text [Text]))
a} :: Command) 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. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The date and time the command was requested.
command_requestedDateTime :: Lens.Lens' Command (Prelude.Maybe Prelude.UTCTime)
command_requestedDateTime :: Lens' Command (Maybe UTCTime)
command_requestedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe POSIX
requestedDateTime :: Maybe POSIX
$sel:requestedDateTime:Command' :: Command -> Maybe POSIX
requestedDateTime} -> Maybe POSIX
requestedDateTime) (\s :: Command
s@Command' {} Maybe POSIX
a -> Command
s {$sel:requestedDateTime:Command' :: Maybe POSIX
requestedDateTime = Maybe POSIX
a} :: Command) 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 Identity and Access Management (IAM) service role that Run Command,
-- a capability of Amazon Web Services Systems Manager, uses to act on your
-- behalf when sending notifications about command status changes.
command_serviceRole :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_serviceRole :: Lens' Command (Maybe Text)
command_serviceRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
serviceRole :: Maybe Text
$sel:serviceRole:Command' :: Command -> Maybe Text
serviceRole} -> Maybe Text
serviceRole) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:serviceRole:Command' :: Maybe Text
serviceRole = Maybe Text
a} :: Command)

-- | The status of the command.
command_status :: Lens.Lens' Command (Prelude.Maybe CommandStatus)
command_status :: Lens' Command (Maybe CommandStatus)
command_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe CommandStatus
status :: Maybe CommandStatus
$sel:status:Command' :: Command -> Maybe CommandStatus
status} -> Maybe CommandStatus
status) (\s :: Command
s@Command' {} Maybe CommandStatus
a -> Command
s {$sel:status:Command' :: Maybe CommandStatus
status = Maybe CommandStatus
a} :: Command)

-- | A detailed status of the command execution. @StatusDetails@ includes
-- more information than @Status@ because it includes states resulting from
-- error and concurrency control parameters. @StatusDetails@ can show
-- different results than Status. For more information about these
-- statuses, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html Understanding command statuses>
-- in the /Amazon Web Services Systems Manager User Guide/. StatusDetails
-- can be one of the following values:
--
-- -   Pending: The command hasn\'t been sent to any managed nodes.
--
-- -   In Progress: The command has been sent to at least one managed node
--     but hasn\'t reached a final state on all managed nodes.
--
-- -   Success: The command successfully ran on all invocations. This is a
--     terminal state.
--
-- -   Delivery Timed Out: The value of MaxErrors or more command
--     invocations shows a status of Delivery Timed Out. This is a terminal
--     state.
--
-- -   Execution Timed Out: The value of MaxErrors or more command
--     invocations shows a status of Execution Timed Out. This is a
--     terminal state.
--
-- -   Failed: The value of MaxErrors or more command invocations shows a
--     status of Failed. This is a terminal state.
--
-- -   Incomplete: The command was attempted on all managed nodes and one
--     or more invocations doesn\'t have a value of Success but not enough
--     invocations failed for the status to be Failed. This is a terminal
--     state.
--
-- -   Cancelled: The command was terminated before it was completed. This
--     is a terminal state.
--
-- -   Rate Exceeded: The number of managed nodes targeted by the command
--     exceeded the account limit for pending invocations. The system has
--     canceled the command before running it on any managed node. This is
--     a terminal state.
--
-- -   Delayed: The system attempted to send the command to the managed
--     node but wasn\'t successful. The system retries again.
command_statusDetails :: Lens.Lens' Command (Prelude.Maybe Prelude.Text)
command_statusDetails :: Lens' Command (Maybe Text)
command_statusDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Text
statusDetails :: Maybe Text
$sel:statusDetails:Command' :: Command -> Maybe Text
statusDetails} -> Maybe Text
statusDetails) (\s :: Command
s@Command' {} Maybe Text
a -> Command
s {$sel:statusDetails:Command' :: Maybe Text
statusDetails = Maybe Text
a} :: Command)

-- | The number of targets for the command.
command_targetCount :: Lens.Lens' Command (Prelude.Maybe Prelude.Int)
command_targetCount :: Lens' Command (Maybe Int)
command_targetCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Int
targetCount :: Maybe Int
$sel:targetCount:Command' :: Command -> Maybe Int
targetCount} -> Maybe Int
targetCount) (\s :: Command
s@Command' {} Maybe Int
a -> Command
s {$sel:targetCount:Command' :: Maybe Int
targetCount = Maybe Int
a} :: Command)

-- | An array of search criteria that targets managed nodes using a Key,Value
-- combination that you specify. Targets is required if you don\'t provide
-- one or more managed node IDs in the call.
command_targets :: Lens.Lens' Command (Prelude.Maybe [Target])
command_targets :: Lens' Command (Maybe [Target])
command_targets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:Command' :: Command -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: Command
s@Command' {} Maybe [Target]
a -> Command
s {$sel:targets:Command' :: Maybe [Target]
targets = Maybe [Target]
a} :: Command) 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 @TimeoutSeconds@ value specified for a command.
command_timeoutSeconds :: Lens.Lens' Command (Prelude.Maybe Prelude.Natural)
command_timeoutSeconds :: Lens' Command (Maybe Natural)
command_timeoutSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe Natural
timeoutSeconds :: Maybe Natural
$sel:timeoutSeconds:Command' :: Command -> Maybe Natural
timeoutSeconds} -> Maybe Natural
timeoutSeconds) (\s :: Command
s@Command' {} Maybe Natural
a -> Command
s {$sel:timeoutSeconds:Command' :: Maybe Natural
timeoutSeconds = Maybe Natural
a} :: Command)

-- | The CloudWatch alarm that was invoked by the command.
command_triggeredAlarms :: Lens.Lens' Command (Prelude.Maybe (Prelude.NonEmpty AlarmStateInformation))
command_triggeredAlarms :: Lens' Command (Maybe (NonEmpty AlarmStateInformation))
command_triggeredAlarms = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Command' {Maybe (NonEmpty AlarmStateInformation)
triggeredAlarms :: Maybe (NonEmpty AlarmStateInformation)
$sel:triggeredAlarms:Command' :: Command -> Maybe (NonEmpty AlarmStateInformation)
triggeredAlarms} -> Maybe (NonEmpty AlarmStateInformation)
triggeredAlarms) (\s :: Command
s@Command' {} Maybe (NonEmpty AlarmStateInformation)
a -> Command
s {$sel:triggeredAlarms:Command' :: Maybe (NonEmpty AlarmStateInformation)
triggeredAlarms = Maybe (NonEmpty AlarmStateInformation)
a} :: Command) 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

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 AlarmConfiguration
-> Maybe CloudWatchOutputConfig
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe NotificationConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive (HashMap Text [Text]))
-> Maybe POSIX
-> Maybe Text
-> Maybe CommandStatus
-> Maybe Text
-> Maybe Int
-> Maybe [Target]
-> Maybe Natural
-> Maybe (NonEmpty AlarmStateInformation)
-> 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
"AlarmConfiguration")
            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
"CloudWatchOutputConfig")
            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
"Comment")
            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
"CompletedCount")
            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
"DeliveryTimedOutCount")
            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
"DocumentName")
            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
"DocumentVersion")
            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
"ErrorCount")
            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
"ExpiresAfter")
            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
"InstanceIds" 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
"MaxConcurrency")
            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
"MaxErrors")
            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
"NotificationConfig")
            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
"OutputS3BucketName")
            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
"OutputS3KeyPrefix")
            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
"OutputS3Region")
            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
"Parameters" 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
"RequestedDateTime")
            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
"ServiceRole")
            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
"StatusDetails")
            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
"TargetCount")
            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
"Targets" 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
"TimeoutSeconds")
            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
"TriggeredAlarms")
      )

instance Prelude.Hashable Command where
  hashWithSalt :: Int -> Command -> Int
hashWithSalt Int
_salt Command' {Maybe Int
Maybe Natural
Maybe [Text]
Maybe [Target]
Maybe (NonEmpty AlarmStateInformation)
Maybe Text
Maybe (Sensitive (HashMap Text [Text]))
Maybe POSIX
Maybe AlarmConfiguration
Maybe CloudWatchOutputConfig
Maybe CommandStatus
Maybe NotificationConfig
triggeredAlarms :: Maybe (NonEmpty AlarmStateInformation)
timeoutSeconds :: Maybe Natural
targets :: Maybe [Target]
targetCount :: Maybe Int
statusDetails :: Maybe Text
status :: Maybe CommandStatus
serviceRole :: Maybe Text
requestedDateTime :: Maybe POSIX
parameters :: Maybe (Sensitive (HashMap Text [Text]))
outputS3Region :: Maybe Text
outputS3KeyPrefix :: Maybe Text
outputS3BucketName :: Maybe Text
notificationConfig :: Maybe NotificationConfig
maxErrors :: Maybe Text
maxConcurrency :: Maybe Text
instanceIds :: Maybe [Text]
expiresAfter :: Maybe POSIX
errorCount :: Maybe Int
documentVersion :: Maybe Text
documentName :: Maybe Text
deliveryTimedOutCount :: Maybe Int
completedCount :: Maybe Int
comment :: Maybe Text
commandId :: Maybe Text
cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig
alarmConfiguration :: Maybe AlarmConfiguration
$sel:triggeredAlarms:Command' :: Command -> Maybe (NonEmpty AlarmStateInformation)
$sel:timeoutSeconds:Command' :: Command -> Maybe Natural
$sel:targets:Command' :: Command -> Maybe [Target]
$sel:targetCount:Command' :: Command -> Maybe Int
$sel:statusDetails:Command' :: Command -> Maybe Text
$sel:status:Command' :: Command -> Maybe CommandStatus
$sel:serviceRole:Command' :: Command -> Maybe Text
$sel:requestedDateTime:Command' :: Command -> Maybe POSIX
$sel:parameters:Command' :: Command -> Maybe (Sensitive (HashMap Text [Text]))
$sel:outputS3Region:Command' :: Command -> Maybe Text
$sel:outputS3KeyPrefix:Command' :: Command -> Maybe Text
$sel:outputS3BucketName:Command' :: Command -> Maybe Text
$sel:notificationConfig:Command' :: Command -> Maybe NotificationConfig
$sel:maxErrors:Command' :: Command -> Maybe Text
$sel:maxConcurrency:Command' :: Command -> Maybe Text
$sel:instanceIds:Command' :: Command -> Maybe [Text]
$sel:expiresAfter:Command' :: Command -> Maybe POSIX
$sel:errorCount:Command' :: Command -> Maybe Int
$sel:documentVersion:Command' :: Command -> Maybe Text
$sel:documentName:Command' :: Command -> Maybe Text
$sel:deliveryTimedOutCount:Command' :: Command -> Maybe Int
$sel:completedCount:Command' :: Command -> Maybe Int
$sel:comment:Command' :: Command -> Maybe Text
$sel:commandId:Command' :: Command -> Maybe Text
$sel:cloudWatchOutputConfig:Command' :: Command -> Maybe CloudWatchOutputConfig
$sel:alarmConfiguration:Command' :: Command -> Maybe AlarmConfiguration
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlarmConfiguration
alarmConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudWatchOutputConfig
cloudWatchOutputConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
commandId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
completedCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
deliveryTimedOutCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
errorCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
expiresAfter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
instanceIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxConcurrency
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxErrors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotificationConfig
notificationConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputS3BucketName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputS3KeyPrefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputS3Region
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive (HashMap Text [Text]))
parameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
requestedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CommandStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
targetCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Target]
targets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeoutSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty AlarmStateInformation)
triggeredAlarms

instance Prelude.NFData Command where
  rnf :: Command -> ()
rnf Command' {Maybe Int
Maybe Natural
Maybe [Text]
Maybe [Target]
Maybe (NonEmpty AlarmStateInformation)
Maybe Text
Maybe (Sensitive (HashMap Text [Text]))
Maybe POSIX
Maybe AlarmConfiguration
Maybe CloudWatchOutputConfig
Maybe CommandStatus
Maybe NotificationConfig
triggeredAlarms :: Maybe (NonEmpty AlarmStateInformation)
timeoutSeconds :: Maybe Natural
targets :: Maybe [Target]
targetCount :: Maybe Int
statusDetails :: Maybe Text
status :: Maybe CommandStatus
serviceRole :: Maybe Text
requestedDateTime :: Maybe POSIX
parameters :: Maybe (Sensitive (HashMap Text [Text]))
outputS3Region :: Maybe Text
outputS3KeyPrefix :: Maybe Text
outputS3BucketName :: Maybe Text
notificationConfig :: Maybe NotificationConfig
maxErrors :: Maybe Text
maxConcurrency :: Maybe Text
instanceIds :: Maybe [Text]
expiresAfter :: Maybe POSIX
errorCount :: Maybe Int
documentVersion :: Maybe Text
documentName :: Maybe Text
deliveryTimedOutCount :: Maybe Int
completedCount :: Maybe Int
comment :: Maybe Text
commandId :: Maybe Text
cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig
alarmConfiguration :: Maybe AlarmConfiguration
$sel:triggeredAlarms:Command' :: Command -> Maybe (NonEmpty AlarmStateInformation)
$sel:timeoutSeconds:Command' :: Command -> Maybe Natural
$sel:targets:Command' :: Command -> Maybe [Target]
$sel:targetCount:Command' :: Command -> Maybe Int
$sel:statusDetails:Command' :: Command -> Maybe Text
$sel:status:Command' :: Command -> Maybe CommandStatus
$sel:serviceRole:Command' :: Command -> Maybe Text
$sel:requestedDateTime:Command' :: Command -> Maybe POSIX
$sel:parameters:Command' :: Command -> Maybe (Sensitive (HashMap Text [Text]))
$sel:outputS3Region:Command' :: Command -> Maybe Text
$sel:outputS3KeyPrefix:Command' :: Command -> Maybe Text
$sel:outputS3BucketName:Command' :: Command -> Maybe Text
$sel:notificationConfig:Command' :: Command -> Maybe NotificationConfig
$sel:maxErrors:Command' :: Command -> Maybe Text
$sel:maxConcurrency:Command' :: Command -> Maybe Text
$sel:instanceIds:Command' :: Command -> Maybe [Text]
$sel:expiresAfter:Command' :: Command -> Maybe POSIX
$sel:errorCount:Command' :: Command -> Maybe Int
$sel:documentVersion:Command' :: Command -> Maybe Text
$sel:documentName:Command' :: Command -> Maybe Text
$sel:deliveryTimedOutCount:Command' :: Command -> Maybe Int
$sel:completedCount:Command' :: Command -> Maybe Int
$sel:comment:Command' :: Command -> Maybe Text
$sel:commandId:Command' :: Command -> Maybe Text
$sel:cloudWatchOutputConfig:Command' :: Command -> Maybe CloudWatchOutputConfig
$sel:alarmConfiguration:Command' :: Command -> Maybe AlarmConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AlarmConfiguration
alarmConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CloudWatchOutputConfig
cloudWatchOutputConfig
      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
comment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
completedCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
deliveryTimedOutCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
errorCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
expiresAfter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
instanceIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxConcurrency
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxErrors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NotificationConfig
notificationConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputS3BucketName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputS3KeyPrefix
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputS3Region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (HashMap Text [Text]))
parameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
requestedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CommandStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
targetCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Target]
targets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe Natural
timeoutSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe (NonEmpty AlarmStateInformation)
triggeredAlarms