{-# 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.CommandInvocation
-- 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.SSM.Types.CommandInvocation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.CloudWatchOutputConfig
import Amazonka.SSM.Types.CommandInvocationStatus
import Amazonka.SSM.Types.CommandPlugin
import Amazonka.SSM.Types.NotificationConfig

-- | An invocation is copy of a command sent to a specific instance. A
-- command can apply to one or more instances. A command invocation applies
-- to one instance. For example, if a user runs SendCommand against three
-- instances, then a command invocation is created for each requested
-- instance ID. A command invocation returns status and detail information
-- about a command you ran.
--
-- /See:/ 'newCommandInvocation' smart constructor.
data CommandInvocation = CommandInvocation'
  { -- | The instance ID in which this invocation was requested.
    CommandInvocation -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | Whether or not the invocation succeeded, failed, or is pending.
    CommandInvocation -> Maybe CommandInvocationStatus
status :: Prelude.Maybe CommandInvocationStatus,
    -- | Configurations for sending notifications about command status changes on
    -- a per instance basis.
    CommandInvocation -> Maybe NotificationConfig
notificationConfig :: Prelude.Maybe NotificationConfig,
    -- | Plugins processed by the command.
    CommandInvocation -> Maybe [CommandPlugin]
commandPlugins :: Prelude.Maybe [CommandPlugin],
    -- | Amazon CloudWatch Logs information where you want Amazon Web Services
    -- Systems Manager to send the command output.
    CommandInvocation -> Maybe CloudWatchOutputConfig
cloudWatchOutputConfig :: Prelude.Maybe CloudWatchOutputConfig,
    -- | The document name that was requested for execution.
    CommandInvocation -> Maybe Text
documentName :: Prelude.Maybe Prelude.Text,
    -- | The URL to the plugin\'s StdErr file in Amazon Simple Storage Service
    -- (Amazon S3), if the S3 bucket was defined for the parent command. For an
    -- invocation, @StandardErrorUrl@ is populated if there is just one plugin
    -- defined for the command, and the S3 bucket was defined for the command.
    CommandInvocation -> Maybe Text
standardErrorUrl :: Prelude.Maybe Prelude.Text,
    -- | A detailed status of the command execution for each invocation (each
    -- instance targeted by the command). 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 the instance.
    --
    -- -   In Progress: The command has been sent to the instance but hasn\'t
    --     reached a terminal state.
    --
    -- -   Success: The execution of the command or plugin was successfully
    --     completed. This is a terminal state.
    --
    -- -   Delivery Timed Out: The command wasn\'t delivered to the instance
    --     before the delivery timeout expired. Delivery timeouts don\'t count
    --     against the parent command\'s @MaxErrors@ limit, but they do
    --     contribute to whether the parent command status is Success or
    --     Incomplete. This is a terminal state.
    --
    -- -   Execution Timed Out: Command execution started on the instance, but
    --     the execution wasn\'t complete before the execution timeout expired.
    --     Execution timeouts count against the @MaxErrors@ limit of the parent
    --     command. This is a terminal state.
    --
    -- -   Failed: The command wasn\'t successful on the instance. For a
    --     plugin, this indicates that the result code wasn\'t zero. For a
    --     command invocation, this indicates that the result code for one or
    --     more plugins wasn\'t zero. Invocation failures count against the
    --     @MaxErrors@ limit of the parent command. This is a terminal state.
    --
    -- -   Canceled: The command was terminated before it was completed. This
    --     is a terminal state.
    --
    -- -   Undeliverable: The command can\'t be delivered to the instance. The
    --     instance might not exist or might not be responding. Undeliverable
    --     invocations don\'t count against the parent command\'s MaxErrors
    --     limit and don\'t contribute to whether the parent command status is
    --     Success or Incomplete. This is a terminal state.
    --
    -- -   Terminated: The parent command exceeded its MaxErrors limit and
    --     subsequent command invocations were canceled by the system. This is
    --     a terminal state.
    CommandInvocation -> Maybe Text
statusDetails :: Prelude.Maybe Prelude.Text,
    -- | The URL to the plugin\'s StdOut file in Amazon Simple Storage Service
    -- (Amazon S3), if the S3 bucket was defined for the parent command. For an
    -- invocation, @StandardOutputUrl@ is populated if there is just one plugin
    -- defined for the command, and the S3 bucket was defined for the command.
    CommandInvocation -> Maybe Text
standardOutputUrl :: Prelude.Maybe Prelude.Text,
    -- | The command against which this invocation was requested.
    CommandInvocation -> Maybe Text
commandId :: Prelude.Maybe Prelude.Text,
    -- | The Systems Manager document (SSM document) version.
    CommandInvocation -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | User-specified information about the command, such as a brief
    -- description of what the command should do.
    CommandInvocation -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | Gets the trace output sent by the agent.
    CommandInvocation -> Maybe Text
traceOutput :: Prelude.Maybe Prelude.Text,
    -- | The fully qualified host name of the managed instance.
    CommandInvocation -> Maybe Text
instanceName :: Prelude.Maybe Prelude.Text,
    -- | The time and date the request was sent to this instance.
    CommandInvocation -> Maybe POSIX
requestedDateTime :: Prelude.Maybe Core.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 on a per
    -- instance basis.
    CommandInvocation -> Maybe Text
serviceRole :: Prelude.Maybe Prelude.Text
  }
  deriving (CommandInvocation -> CommandInvocation -> Bool
(CommandInvocation -> CommandInvocation -> Bool)
-> (CommandInvocation -> CommandInvocation -> Bool)
-> Eq CommandInvocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommandInvocation -> CommandInvocation -> Bool
$c/= :: CommandInvocation -> CommandInvocation -> Bool
== :: CommandInvocation -> CommandInvocation -> Bool
$c== :: CommandInvocation -> CommandInvocation -> Bool
Prelude.Eq, ReadPrec [CommandInvocation]
ReadPrec CommandInvocation
Int -> ReadS CommandInvocation
ReadS [CommandInvocation]
(Int -> ReadS CommandInvocation)
-> ReadS [CommandInvocation]
-> ReadPrec CommandInvocation
-> ReadPrec [CommandInvocation]
-> Read CommandInvocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CommandInvocation]
$creadListPrec :: ReadPrec [CommandInvocation]
readPrec :: ReadPrec CommandInvocation
$creadPrec :: ReadPrec CommandInvocation
readList :: ReadS [CommandInvocation]
$creadList :: ReadS [CommandInvocation]
readsPrec :: Int -> ReadS CommandInvocation
$creadsPrec :: Int -> ReadS CommandInvocation
Prelude.Read, Int -> CommandInvocation -> ShowS
[CommandInvocation] -> ShowS
CommandInvocation -> String
(Int -> CommandInvocation -> ShowS)
-> (CommandInvocation -> String)
-> ([CommandInvocation] -> ShowS)
-> Show CommandInvocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommandInvocation] -> ShowS
$cshowList :: [CommandInvocation] -> ShowS
show :: CommandInvocation -> String
$cshow :: CommandInvocation -> String
showsPrec :: Int -> CommandInvocation -> ShowS
$cshowsPrec :: Int -> CommandInvocation -> ShowS
Prelude.Show, (forall x. CommandInvocation -> Rep CommandInvocation x)
-> (forall x. Rep CommandInvocation x -> CommandInvocation)
-> Generic CommandInvocation
forall x. Rep CommandInvocation x -> CommandInvocation
forall x. CommandInvocation -> Rep CommandInvocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CommandInvocation x -> CommandInvocation
$cfrom :: forall x. CommandInvocation -> Rep CommandInvocation x
Prelude.Generic)

-- |
-- Create a value of 'CommandInvocation' 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:
--
-- 'instanceId', 'commandInvocation_instanceId' - The instance ID in which this invocation was requested.
--
-- 'status', 'commandInvocation_status' - Whether or not the invocation succeeded, failed, or is pending.
--
-- 'notificationConfig', 'commandInvocation_notificationConfig' - Configurations for sending notifications about command status changes on
-- a per instance basis.
--
-- 'commandPlugins', 'commandInvocation_commandPlugins' - Plugins processed by the command.
--
-- 'cloudWatchOutputConfig', 'commandInvocation_cloudWatchOutputConfig' - Amazon CloudWatch Logs information where you want Amazon Web Services
-- Systems Manager to send the command output.
--
-- 'documentName', 'commandInvocation_documentName' - The document name that was requested for execution.
--
-- 'standardErrorUrl', 'commandInvocation_standardErrorUrl' - The URL to the plugin\'s StdErr file in Amazon Simple Storage Service
-- (Amazon S3), if the S3 bucket was defined for the parent command. For an
-- invocation, @StandardErrorUrl@ is populated if there is just one plugin
-- defined for the command, and the S3 bucket was defined for the command.
--
-- 'statusDetails', 'commandInvocation_statusDetails' - A detailed status of the command execution for each invocation (each
-- instance targeted by the command). 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 the instance.
--
-- -   In Progress: The command has been sent to the instance but hasn\'t
--     reached a terminal state.
--
-- -   Success: The execution of the command or plugin was successfully
--     completed. This is a terminal state.
--
-- -   Delivery Timed Out: The command wasn\'t delivered to the instance
--     before the delivery timeout expired. Delivery timeouts don\'t count
--     against the parent command\'s @MaxErrors@ limit, but they do
--     contribute to whether the parent command status is Success or
--     Incomplete. This is a terminal state.
--
-- -   Execution Timed Out: Command execution started on the instance, but
--     the execution wasn\'t complete before the execution timeout expired.
--     Execution timeouts count against the @MaxErrors@ limit of the parent
--     command. This is a terminal state.
--
-- -   Failed: The command wasn\'t successful on the instance. For a
--     plugin, this indicates that the result code wasn\'t zero. For a
--     command invocation, this indicates that the result code for one or
--     more plugins wasn\'t zero. Invocation failures count against the
--     @MaxErrors@ limit of the parent command. This is a terminal state.
--
-- -   Canceled: The command was terminated before it was completed. This
--     is a terminal state.
--
-- -   Undeliverable: The command can\'t be delivered to the instance. The
--     instance might not exist or might not be responding. Undeliverable
--     invocations don\'t count against the parent command\'s MaxErrors
--     limit and don\'t contribute to whether the parent command status is
--     Success or Incomplete. This is a terminal state.
--
-- -   Terminated: The parent command exceeded its MaxErrors limit and
--     subsequent command invocations were canceled by the system. This is
--     a terminal state.
--
-- 'standardOutputUrl', 'commandInvocation_standardOutputUrl' - The URL to the plugin\'s StdOut file in Amazon Simple Storage Service
-- (Amazon S3), if the S3 bucket was defined for the parent command. For an
-- invocation, @StandardOutputUrl@ is populated if there is just one plugin
-- defined for the command, and the S3 bucket was defined for the command.
--
-- 'commandId', 'commandInvocation_commandId' - The command against which this invocation was requested.
--
-- 'documentVersion', 'commandInvocation_documentVersion' - The Systems Manager document (SSM document) version.
--
-- 'comment', 'commandInvocation_comment' - User-specified information about the command, such as a brief
-- description of what the command should do.
--
-- 'traceOutput', 'commandInvocation_traceOutput' - Gets the trace output sent by the agent.
--
-- 'instanceName', 'commandInvocation_instanceName' - The fully qualified host name of the managed instance.
--
-- 'requestedDateTime', 'commandInvocation_requestedDateTime' - The time and date the request was sent to this instance.
--
-- 'serviceRole', 'commandInvocation_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 on a per
-- instance basis.
newCommandInvocation ::
  CommandInvocation
newCommandInvocation :: CommandInvocation
newCommandInvocation =
  CommandInvocation' :: Maybe Text
-> Maybe CommandInvocationStatus
-> Maybe NotificationConfig
-> Maybe [CommandPlugin]
-> Maybe CloudWatchOutputConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CommandInvocation
CommandInvocation'
    { $sel:instanceId:CommandInvocation' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:CommandInvocation' :: Maybe CommandInvocationStatus
status = Maybe CommandInvocationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationConfig:CommandInvocation' :: Maybe NotificationConfig
notificationConfig = Maybe NotificationConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:commandPlugins:CommandInvocation' :: Maybe [CommandPlugin]
commandPlugins = Maybe [CommandPlugin]
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchOutputConfig:CommandInvocation' :: Maybe CloudWatchOutputConfig
cloudWatchOutputConfig = Maybe CloudWatchOutputConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:documentName:CommandInvocation' :: Maybe Text
documentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:standardErrorUrl:CommandInvocation' :: Maybe Text
standardErrorUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetails:CommandInvocation' :: Maybe Text
statusDetails = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:standardOutputUrl:CommandInvocation' :: Maybe Text
standardOutputUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:commandId:CommandInvocation' :: Maybe Text
commandId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:documentVersion:CommandInvocation' :: Maybe Text
documentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:CommandInvocation' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:traceOutput:CommandInvocation' :: Maybe Text
traceOutput = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceName:CommandInvocation' :: Maybe Text
instanceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestedDateTime:CommandInvocation' :: Maybe POSIX
requestedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceRole:CommandInvocation' :: Maybe Text
serviceRole = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The instance ID in which this invocation was requested.
commandInvocation_instanceId :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_instanceId :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_instanceId = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:CommandInvocation' :: CommandInvocation -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:instanceId:CommandInvocation' :: Maybe Text
instanceId = Maybe Text
a} :: CommandInvocation)

-- | Whether or not the invocation succeeded, failed, or is pending.
commandInvocation_status :: Lens.Lens' CommandInvocation (Prelude.Maybe CommandInvocationStatus)
commandInvocation_status :: (Maybe CommandInvocationStatus
 -> f (Maybe CommandInvocationStatus))
-> CommandInvocation -> f CommandInvocation
commandInvocation_status = (CommandInvocation -> Maybe CommandInvocationStatus)
-> (CommandInvocation
    -> Maybe CommandInvocationStatus -> CommandInvocation)
-> Lens
     CommandInvocation
     CommandInvocation
     (Maybe CommandInvocationStatus)
     (Maybe CommandInvocationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe CommandInvocationStatus
status :: Maybe CommandInvocationStatus
$sel:status:CommandInvocation' :: CommandInvocation -> Maybe CommandInvocationStatus
status} -> Maybe CommandInvocationStatus
status) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe CommandInvocationStatus
a -> CommandInvocation
s {$sel:status:CommandInvocation' :: Maybe CommandInvocationStatus
status = Maybe CommandInvocationStatus
a} :: CommandInvocation)

-- | Configurations for sending notifications about command status changes on
-- a per instance basis.
commandInvocation_notificationConfig :: Lens.Lens' CommandInvocation (Prelude.Maybe NotificationConfig)
commandInvocation_notificationConfig :: (Maybe NotificationConfig -> f (Maybe NotificationConfig))
-> CommandInvocation -> f CommandInvocation
commandInvocation_notificationConfig = (CommandInvocation -> Maybe NotificationConfig)
-> (CommandInvocation
    -> Maybe NotificationConfig -> CommandInvocation)
-> Lens
     CommandInvocation
     CommandInvocation
     (Maybe NotificationConfig)
     (Maybe NotificationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe NotificationConfig
notificationConfig :: Maybe NotificationConfig
$sel:notificationConfig:CommandInvocation' :: CommandInvocation -> Maybe NotificationConfig
notificationConfig} -> Maybe NotificationConfig
notificationConfig) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe NotificationConfig
a -> CommandInvocation
s {$sel:notificationConfig:CommandInvocation' :: Maybe NotificationConfig
notificationConfig = Maybe NotificationConfig
a} :: CommandInvocation)

-- | Plugins processed by the command.
commandInvocation_commandPlugins :: Lens.Lens' CommandInvocation (Prelude.Maybe [CommandPlugin])
commandInvocation_commandPlugins :: (Maybe [CommandPlugin] -> f (Maybe [CommandPlugin]))
-> CommandInvocation -> f CommandInvocation
commandInvocation_commandPlugins = (CommandInvocation -> Maybe [CommandPlugin])
-> (CommandInvocation
    -> Maybe [CommandPlugin] -> CommandInvocation)
-> Lens
     CommandInvocation
     CommandInvocation
     (Maybe [CommandPlugin])
     (Maybe [CommandPlugin])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe [CommandPlugin]
commandPlugins :: Maybe [CommandPlugin]
$sel:commandPlugins:CommandInvocation' :: CommandInvocation -> Maybe [CommandPlugin]
commandPlugins} -> Maybe [CommandPlugin]
commandPlugins) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe [CommandPlugin]
a -> CommandInvocation
s {$sel:commandPlugins:CommandInvocation' :: Maybe [CommandPlugin]
commandPlugins = Maybe [CommandPlugin]
a} :: CommandInvocation) ((Maybe [CommandPlugin] -> f (Maybe [CommandPlugin]))
 -> CommandInvocation -> f CommandInvocation)
-> ((Maybe [CommandPlugin] -> f (Maybe [CommandPlugin]))
    -> Maybe [CommandPlugin] -> f (Maybe [CommandPlugin]))
-> (Maybe [CommandPlugin] -> f (Maybe [CommandPlugin]))
-> CommandInvocation
-> f CommandInvocation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CommandPlugin] [CommandPlugin] [CommandPlugin] [CommandPlugin]
-> Iso
     (Maybe [CommandPlugin])
     (Maybe [CommandPlugin])
     (Maybe [CommandPlugin])
     (Maybe [CommandPlugin])
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
  [CommandPlugin] [CommandPlugin] [CommandPlugin] [CommandPlugin]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The document name that was requested for execution.
commandInvocation_documentName :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_documentName :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_documentName = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
documentName :: Maybe Text
$sel:documentName:CommandInvocation' :: CommandInvocation -> Maybe Text
documentName} -> Maybe Text
documentName) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:documentName:CommandInvocation' :: Maybe Text
documentName = Maybe Text
a} :: CommandInvocation)

-- | The URL to the plugin\'s StdErr file in Amazon Simple Storage Service
-- (Amazon S3), if the S3 bucket was defined for the parent command. For an
-- invocation, @StandardErrorUrl@ is populated if there is just one plugin
-- defined for the command, and the S3 bucket was defined for the command.
commandInvocation_standardErrorUrl :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_standardErrorUrl :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_standardErrorUrl = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
standardErrorUrl :: Maybe Text
$sel:standardErrorUrl:CommandInvocation' :: CommandInvocation -> Maybe Text
standardErrorUrl} -> Maybe Text
standardErrorUrl) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:standardErrorUrl:CommandInvocation' :: Maybe Text
standardErrorUrl = Maybe Text
a} :: CommandInvocation)

-- | A detailed status of the command execution for each invocation (each
-- instance targeted by the command). 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 the instance.
--
-- -   In Progress: The command has been sent to the instance but hasn\'t
--     reached a terminal state.
--
-- -   Success: The execution of the command or plugin was successfully
--     completed. This is a terminal state.
--
-- -   Delivery Timed Out: The command wasn\'t delivered to the instance
--     before the delivery timeout expired. Delivery timeouts don\'t count
--     against the parent command\'s @MaxErrors@ limit, but they do
--     contribute to whether the parent command status is Success or
--     Incomplete. This is a terminal state.
--
-- -   Execution Timed Out: Command execution started on the instance, but
--     the execution wasn\'t complete before the execution timeout expired.
--     Execution timeouts count against the @MaxErrors@ limit of the parent
--     command. This is a terminal state.
--
-- -   Failed: The command wasn\'t successful on the instance. For a
--     plugin, this indicates that the result code wasn\'t zero. For a
--     command invocation, this indicates that the result code for one or
--     more plugins wasn\'t zero. Invocation failures count against the
--     @MaxErrors@ limit of the parent command. This is a terminal state.
--
-- -   Canceled: The command was terminated before it was completed. This
--     is a terminal state.
--
-- -   Undeliverable: The command can\'t be delivered to the instance. The
--     instance might not exist or might not be responding. Undeliverable
--     invocations don\'t count against the parent command\'s MaxErrors
--     limit and don\'t contribute to whether the parent command status is
--     Success or Incomplete. This is a terminal state.
--
-- -   Terminated: The parent command exceeded its MaxErrors limit and
--     subsequent command invocations were canceled by the system. This is
--     a terminal state.
commandInvocation_statusDetails :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_statusDetails :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_statusDetails = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
statusDetails :: Maybe Text
$sel:statusDetails:CommandInvocation' :: CommandInvocation -> Maybe Text
statusDetails} -> Maybe Text
statusDetails) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:statusDetails:CommandInvocation' :: Maybe Text
statusDetails = Maybe Text
a} :: CommandInvocation)

-- | The URL to the plugin\'s StdOut file in Amazon Simple Storage Service
-- (Amazon S3), if the S3 bucket was defined for the parent command. For an
-- invocation, @StandardOutputUrl@ is populated if there is just one plugin
-- defined for the command, and the S3 bucket was defined for the command.
commandInvocation_standardOutputUrl :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_standardOutputUrl :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_standardOutputUrl = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
standardOutputUrl :: Maybe Text
$sel:standardOutputUrl:CommandInvocation' :: CommandInvocation -> Maybe Text
standardOutputUrl} -> Maybe Text
standardOutputUrl) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:standardOutputUrl:CommandInvocation' :: Maybe Text
standardOutputUrl = Maybe Text
a} :: CommandInvocation)

-- | The command against which this invocation was requested.
commandInvocation_commandId :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_commandId :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_commandId = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
commandId :: Maybe Text
$sel:commandId:CommandInvocation' :: CommandInvocation -> Maybe Text
commandId} -> Maybe Text
commandId) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:commandId:CommandInvocation' :: Maybe Text
commandId = Maybe Text
a} :: CommandInvocation)

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

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

-- | Gets the trace output sent by the agent.
commandInvocation_traceOutput :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_traceOutput :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_traceOutput = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
traceOutput :: Maybe Text
$sel:traceOutput:CommandInvocation' :: CommandInvocation -> Maybe Text
traceOutput} -> Maybe Text
traceOutput) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:traceOutput:CommandInvocation' :: Maybe Text
traceOutput = Maybe Text
a} :: CommandInvocation)

-- | The fully qualified host name of the managed instance.
commandInvocation_instanceName :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_instanceName :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_instanceName = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
instanceName :: Maybe Text
$sel:instanceName:CommandInvocation' :: CommandInvocation -> Maybe Text
instanceName} -> Maybe Text
instanceName) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:instanceName:CommandInvocation' :: Maybe Text
instanceName = Maybe Text
a} :: CommandInvocation)

-- | The time and date the request was sent to this instance.
commandInvocation_requestedDateTime :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.UTCTime)
commandInvocation_requestedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CommandInvocation -> f CommandInvocation
commandInvocation_requestedDateTime = (CommandInvocation -> Maybe POSIX)
-> (CommandInvocation -> Maybe POSIX -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe POSIX
requestedDateTime :: Maybe POSIX
$sel:requestedDateTime:CommandInvocation' :: CommandInvocation -> Maybe POSIX
requestedDateTime} -> Maybe POSIX
requestedDateTime) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe POSIX
a -> CommandInvocation
s {$sel:requestedDateTime:CommandInvocation' :: Maybe POSIX
requestedDateTime = Maybe POSIX
a} :: CommandInvocation) ((Maybe POSIX -> f (Maybe POSIX))
 -> CommandInvocation -> f CommandInvocation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CommandInvocation
-> f CommandInvocation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._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 on a per
-- instance basis.
commandInvocation_serviceRole :: Lens.Lens' CommandInvocation (Prelude.Maybe Prelude.Text)
commandInvocation_serviceRole :: (Maybe Text -> f (Maybe Text))
-> CommandInvocation -> f CommandInvocation
commandInvocation_serviceRole = (CommandInvocation -> Maybe Text)
-> (CommandInvocation -> Maybe Text -> CommandInvocation)
-> Lens
     CommandInvocation CommandInvocation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandInvocation' {Maybe Text
serviceRole :: Maybe Text
$sel:serviceRole:CommandInvocation' :: CommandInvocation -> Maybe Text
serviceRole} -> Maybe Text
serviceRole) (\s :: CommandInvocation
s@CommandInvocation' {} Maybe Text
a -> CommandInvocation
s {$sel:serviceRole:CommandInvocation' :: Maybe Text
serviceRole = Maybe Text
a} :: CommandInvocation)

instance Core.FromJSON CommandInvocation where
  parseJSON :: Value -> Parser CommandInvocation
parseJSON =
    String
-> (Object -> Parser CommandInvocation)
-> Value
-> Parser CommandInvocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CommandInvocation"
      ( \Object
x ->
          Maybe Text
-> Maybe CommandInvocationStatus
-> Maybe NotificationConfig
-> Maybe [CommandPlugin]
-> Maybe CloudWatchOutputConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CommandInvocation
CommandInvocation'
            (Maybe Text
 -> Maybe CommandInvocationStatus
 -> Maybe NotificationConfig
 -> Maybe [CommandPlugin]
 -> Maybe CloudWatchOutputConfig
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe CommandInvocationStatus
      -> Maybe NotificationConfig
      -> Maybe [CommandPlugin]
      -> Maybe CloudWatchOutputConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
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
"InstanceId")
            Parser
  (Maybe CommandInvocationStatus
   -> Maybe NotificationConfig
   -> Maybe [CommandPlugin]
   -> Maybe CloudWatchOutputConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe CommandInvocationStatus)
-> Parser
     (Maybe NotificationConfig
      -> Maybe [CommandPlugin]
      -> Maybe CloudWatchOutputConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CommandInvocationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe NotificationConfig
   -> Maybe [CommandPlugin]
   -> Maybe CloudWatchOutputConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe NotificationConfig)
-> Parser
     (Maybe [CommandPlugin]
      -> Maybe CloudWatchOutputConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NotificationConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotificationConfig")
            Parser
  (Maybe [CommandPlugin]
   -> Maybe CloudWatchOutputConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe [CommandPlugin])
-> Parser
     (Maybe CloudWatchOutputConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [CommandPlugin]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CommandPlugins" Parser (Maybe (Maybe [CommandPlugin]))
-> Maybe [CommandPlugin] -> Parser (Maybe [CommandPlugin])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CommandPlugin]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe CloudWatchOutputConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe CloudWatchOutputConfig)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CloudWatchOutputConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CloudWatchOutputConfig")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
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
"DocumentName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
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
"StandardErrorUrl")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
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
"StatusDetails")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
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
"StandardOutputUrl")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> CommandInvocation)
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
"DocumentVersion")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> CommandInvocation)
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 Text
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> CommandInvocation)
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
"TraceOutput")
            Parser
  (Maybe Text -> Maybe POSIX -> Maybe Text -> CommandInvocation)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> CommandInvocation)
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
"InstanceName")
            Parser (Maybe POSIX -> Maybe Text -> CommandInvocation)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> CommandInvocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequestedDateTime")
            Parser (Maybe Text -> CommandInvocation)
-> Parser (Maybe Text) -> Parser CommandInvocation
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
"ServiceRole")
      )

instance Prelude.Hashable CommandInvocation

instance Prelude.NFData CommandInvocation