{-# 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.CommandPlugin
-- 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.CommandPlugin 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.CommandPluginStatus

-- | Describes plugin details.
--
-- /See:/ 'newCommandPlugin' smart constructor.
data CommandPlugin = CommandPlugin'
  { -- | The name of the plugin. Must be one of the following: @aws:updateAgent@,
    -- @aws:domainjoin@, @aws:applications@, @aws:runPowerShellScript@,
    -- @aws:psmodule@, @aws:cloudWatch@, @aws:runShellScript@, or
    -- @aws:updateSSMAgent@.
    CommandPlugin -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Output of the plugin execution.
    CommandPlugin -> Maybe Text
output :: Prelude.Maybe Prelude.Text,
    -- | The S3 bucket where the responses to the command executions should be
    -- stored. This was requested when issuing the command. For example, in the
    -- following response:
    --
    -- @doc-example-bucket\/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix\/i-02573cafcfEXAMPLE\/awsrunShellScript@
    --
    -- @doc-example-bucket@ is the name of the S3 bucket;
    --
    -- @ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix@ is the name of the S3 prefix;
    --
    -- @i-02573cafcfEXAMPLE@ is the managed node ID;
    --
    -- @awsrunShellScript@ is the name of the plugin.
    CommandPlugin -> 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. For example, in the following response:
    --
    -- @doc-example-bucket\/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix\/i-02573cafcfEXAMPLE\/awsrunShellScript@
    --
    -- @doc-example-bucket@ is the name of the S3 bucket;
    --
    -- @ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix@ is the name of the S3 prefix;
    --
    -- @i-02573cafcfEXAMPLE@ is the managed node ID;
    --
    -- @awsrunShellScript@ is the name of the plugin.
    CommandPlugin -> Maybe Text
outputS3KeyPrefix :: Prelude.Maybe Prelude.Text,
    -- | (Deprecated) You can no longer specify this parameter. The system
    -- ignores it. Instead, Amazon Web Services Systems Manager automatically
    -- determines the S3 bucket region.
    CommandPlugin -> Maybe Text
outputS3Region :: Prelude.Maybe Prelude.Text,
    -- | A numeric response code generated after running the plugin.
    CommandPlugin -> Maybe Int
responseCode :: Prelude.Maybe Prelude.Int,
    -- | The time the plugin stopped running. Could stop prematurely if, for
    -- example, a cancel command was sent.
    CommandPlugin -> Maybe POSIX
responseFinishDateTime :: Prelude.Maybe Data.POSIX,
    -- | The time the plugin started running.
    CommandPlugin -> Maybe POSIX
responseStartDateTime :: Prelude.Maybe Data.POSIX,
    -- | The URL for the complete text written by the plugin to stderr. If
    -- execution isn\'t yet complete, then this string is empty.
    CommandPlugin -> Maybe Text
standardErrorUrl :: Prelude.Maybe Prelude.Text,
    -- | The URL for the complete text written by the plugin to stdout in Amazon
    -- S3. If the S3 bucket for the command wasn\'t specified, then this string
    -- is empty.
    CommandPlugin -> Maybe Text
standardOutputUrl :: Prelude.Maybe Prelude.Text,
    -- | The status of this plugin. You can run a document with multiple plugins.
    CommandPlugin -> Maybe CommandPluginStatus
status :: Prelude.Maybe CommandPluginStatus,
    -- | A detailed status of the plugin 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 the managed node.
    --
    -- -   In Progress: The command has been sent to the managed node 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 managed
    --     node 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 managed node,
    --     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 managed node. 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.
    --
    -- -   Cancelled: The command was terminated before it was completed. This
    --     is a terminal state.
    --
    -- -   Undeliverable: The command can\'t be delivered to the managed node.
    --     The managed node might not exist, or it might not be responding.
    --     Undeliverable invocations don\'t count against the parent command\'s
    --     MaxErrors limit, and they 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.
    CommandPlugin -> Maybe Text
statusDetails :: Prelude.Maybe Prelude.Text
  }
  deriving (CommandPlugin -> CommandPlugin -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommandPlugin -> CommandPlugin -> Bool
$c/= :: CommandPlugin -> CommandPlugin -> Bool
== :: CommandPlugin -> CommandPlugin -> Bool
$c== :: CommandPlugin -> CommandPlugin -> Bool
Prelude.Eq, ReadPrec [CommandPlugin]
ReadPrec CommandPlugin
Int -> ReadS CommandPlugin
ReadS [CommandPlugin]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CommandPlugin]
$creadListPrec :: ReadPrec [CommandPlugin]
readPrec :: ReadPrec CommandPlugin
$creadPrec :: ReadPrec CommandPlugin
readList :: ReadS [CommandPlugin]
$creadList :: ReadS [CommandPlugin]
readsPrec :: Int -> ReadS CommandPlugin
$creadsPrec :: Int -> ReadS CommandPlugin
Prelude.Read, Int -> CommandPlugin -> ShowS
[CommandPlugin] -> ShowS
CommandPlugin -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommandPlugin] -> ShowS
$cshowList :: [CommandPlugin] -> ShowS
show :: CommandPlugin -> String
$cshow :: CommandPlugin -> String
showsPrec :: Int -> CommandPlugin -> ShowS
$cshowsPrec :: Int -> CommandPlugin -> ShowS
Prelude.Show, forall x. Rep CommandPlugin x -> CommandPlugin
forall x. CommandPlugin -> Rep CommandPlugin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CommandPlugin x -> CommandPlugin
$cfrom :: forall x. CommandPlugin -> Rep CommandPlugin x
Prelude.Generic)

-- |
-- Create a value of 'CommandPlugin' 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:
--
-- 'name', 'commandPlugin_name' - The name of the plugin. Must be one of the following: @aws:updateAgent@,
-- @aws:domainjoin@, @aws:applications@, @aws:runPowerShellScript@,
-- @aws:psmodule@, @aws:cloudWatch@, @aws:runShellScript@, or
-- @aws:updateSSMAgent@.
--
-- 'output', 'commandPlugin_output' - Output of the plugin execution.
--
-- 'outputS3BucketName', 'commandPlugin_outputS3BucketName' - The S3 bucket where the responses to the command executions should be
-- stored. This was requested when issuing the command. For example, in the
-- following response:
--
-- @doc-example-bucket\/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix\/i-02573cafcfEXAMPLE\/awsrunShellScript@
--
-- @doc-example-bucket@ is the name of the S3 bucket;
--
-- @ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix@ is the name of the S3 prefix;
--
-- @i-02573cafcfEXAMPLE@ is the managed node ID;
--
-- @awsrunShellScript@ is the name of the plugin.
--
-- 'outputS3KeyPrefix', 'commandPlugin_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. For example, in the following response:
--
-- @doc-example-bucket\/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix\/i-02573cafcfEXAMPLE\/awsrunShellScript@
--
-- @doc-example-bucket@ is the name of the S3 bucket;
--
-- @ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix@ is the name of the S3 prefix;
--
-- @i-02573cafcfEXAMPLE@ is the managed node ID;
--
-- @awsrunShellScript@ is the name of the plugin.
--
-- 'outputS3Region', 'commandPlugin_outputS3Region' - (Deprecated) You can no longer specify this parameter. The system
-- ignores it. Instead, Amazon Web Services Systems Manager automatically
-- determines the S3 bucket region.
--
-- 'responseCode', 'commandPlugin_responseCode' - A numeric response code generated after running the plugin.
--
-- 'responseFinishDateTime', 'commandPlugin_responseFinishDateTime' - The time the plugin stopped running. Could stop prematurely if, for
-- example, a cancel command was sent.
--
-- 'responseStartDateTime', 'commandPlugin_responseStartDateTime' - The time the plugin started running.
--
-- 'standardErrorUrl', 'commandPlugin_standardErrorUrl' - The URL for the complete text written by the plugin to stderr. If
-- execution isn\'t yet complete, then this string is empty.
--
-- 'standardOutputUrl', 'commandPlugin_standardOutputUrl' - The URL for the complete text written by the plugin to stdout in Amazon
-- S3. If the S3 bucket for the command wasn\'t specified, then this string
-- is empty.
--
-- 'status', 'commandPlugin_status' - The status of this plugin. You can run a document with multiple plugins.
--
-- 'statusDetails', 'commandPlugin_statusDetails' - A detailed status of the plugin 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 the managed node.
--
-- -   In Progress: The command has been sent to the managed node 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 managed
--     node 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 managed node,
--     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 managed node. 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.
--
-- -   Cancelled: The command was terminated before it was completed. This
--     is a terminal state.
--
-- -   Undeliverable: The command can\'t be delivered to the managed node.
--     The managed node might not exist, or it might not be responding.
--     Undeliverable invocations don\'t count against the parent command\'s
--     MaxErrors limit, and they 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.
newCommandPlugin ::
  CommandPlugin
newCommandPlugin :: CommandPlugin
newCommandPlugin =
  CommandPlugin'
    { $sel:name:CommandPlugin' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:output:CommandPlugin' :: Maybe Text
output = forall a. Maybe a
Prelude.Nothing,
      $sel:outputS3BucketName:CommandPlugin' :: Maybe Text
outputS3BucketName = forall a. Maybe a
Prelude.Nothing,
      $sel:outputS3KeyPrefix:CommandPlugin' :: Maybe Text
outputS3KeyPrefix = forall a. Maybe a
Prelude.Nothing,
      $sel:outputS3Region:CommandPlugin' :: Maybe Text
outputS3Region = forall a. Maybe a
Prelude.Nothing,
      $sel:responseCode:CommandPlugin' :: Maybe Int
responseCode = forall a. Maybe a
Prelude.Nothing,
      $sel:responseFinishDateTime:CommandPlugin' :: Maybe POSIX
responseFinishDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:responseStartDateTime:CommandPlugin' :: Maybe POSIX
responseStartDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:standardErrorUrl:CommandPlugin' :: Maybe Text
standardErrorUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:standardOutputUrl:CommandPlugin' :: Maybe Text
standardOutputUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:status:CommandPlugin' :: Maybe CommandPluginStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetails:CommandPlugin' :: Maybe Text
statusDetails = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the plugin. Must be one of the following: @aws:updateAgent@,
-- @aws:domainjoin@, @aws:applications@, @aws:runPowerShellScript@,
-- @aws:psmodule@, @aws:cloudWatch@, @aws:runShellScript@, or
-- @aws:updateSSMAgent@.
commandPlugin_name :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.Text)
commandPlugin_name :: Lens' CommandPlugin (Maybe Text)
commandPlugin_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe Text
name :: Maybe Text
$sel:name:CommandPlugin' :: CommandPlugin -> Maybe Text
name} -> Maybe Text
name) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe Text
a -> CommandPlugin
s {$sel:name:CommandPlugin' :: Maybe Text
name = Maybe Text
a} :: CommandPlugin)

-- | Output of the plugin execution.
commandPlugin_output :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.Text)
commandPlugin_output :: Lens' CommandPlugin (Maybe Text)
commandPlugin_output = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe Text
output :: Maybe Text
$sel:output:CommandPlugin' :: CommandPlugin -> Maybe Text
output} -> Maybe Text
output) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe Text
a -> CommandPlugin
s {$sel:output:CommandPlugin' :: Maybe Text
output = Maybe Text
a} :: CommandPlugin)

-- | The S3 bucket where the responses to the command executions should be
-- stored. This was requested when issuing the command. For example, in the
-- following response:
--
-- @doc-example-bucket\/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix\/i-02573cafcfEXAMPLE\/awsrunShellScript@
--
-- @doc-example-bucket@ is the name of the S3 bucket;
--
-- @ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix@ is the name of the S3 prefix;
--
-- @i-02573cafcfEXAMPLE@ is the managed node ID;
--
-- @awsrunShellScript@ is the name of the plugin.
commandPlugin_outputS3BucketName :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.Text)
commandPlugin_outputS3BucketName :: Lens' CommandPlugin (Maybe Text)
commandPlugin_outputS3BucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe Text
outputS3BucketName :: Maybe Text
$sel:outputS3BucketName:CommandPlugin' :: CommandPlugin -> Maybe Text
outputS3BucketName} -> Maybe Text
outputS3BucketName) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe Text
a -> CommandPlugin
s {$sel:outputS3BucketName:CommandPlugin' :: Maybe Text
outputS3BucketName = Maybe Text
a} :: CommandPlugin)

-- | The S3 directory path inside the bucket where the responses to the
-- command executions should be stored. This was requested when issuing the
-- command. For example, in the following response:
--
-- @doc-example-bucket\/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix\/i-02573cafcfEXAMPLE\/awsrunShellScript@
--
-- @doc-example-bucket@ is the name of the S3 bucket;
--
-- @ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix@ is the name of the S3 prefix;
--
-- @i-02573cafcfEXAMPLE@ is the managed node ID;
--
-- @awsrunShellScript@ is the name of the plugin.
commandPlugin_outputS3KeyPrefix :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.Text)
commandPlugin_outputS3KeyPrefix :: Lens' CommandPlugin (Maybe Text)
commandPlugin_outputS3KeyPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe Text
outputS3KeyPrefix :: Maybe Text
$sel:outputS3KeyPrefix:CommandPlugin' :: CommandPlugin -> Maybe Text
outputS3KeyPrefix} -> Maybe Text
outputS3KeyPrefix) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe Text
a -> CommandPlugin
s {$sel:outputS3KeyPrefix:CommandPlugin' :: Maybe Text
outputS3KeyPrefix = Maybe Text
a} :: CommandPlugin)

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

-- | A numeric response code generated after running the plugin.
commandPlugin_responseCode :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.Int)
commandPlugin_responseCode :: Lens' CommandPlugin (Maybe Int)
commandPlugin_responseCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe Int
responseCode :: Maybe Int
$sel:responseCode:CommandPlugin' :: CommandPlugin -> Maybe Int
responseCode} -> Maybe Int
responseCode) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe Int
a -> CommandPlugin
s {$sel:responseCode:CommandPlugin' :: Maybe Int
responseCode = Maybe Int
a} :: CommandPlugin)

-- | The time the plugin stopped running. Could stop prematurely if, for
-- example, a cancel command was sent.
commandPlugin_responseFinishDateTime :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.UTCTime)
commandPlugin_responseFinishDateTime :: Lens' CommandPlugin (Maybe UTCTime)
commandPlugin_responseFinishDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe POSIX
responseFinishDateTime :: Maybe POSIX
$sel:responseFinishDateTime:CommandPlugin' :: CommandPlugin -> Maybe POSIX
responseFinishDateTime} -> Maybe POSIX
responseFinishDateTime) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe POSIX
a -> CommandPlugin
s {$sel:responseFinishDateTime:CommandPlugin' :: Maybe POSIX
responseFinishDateTime = Maybe POSIX
a} :: CommandPlugin) 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 time the plugin started running.
commandPlugin_responseStartDateTime :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.UTCTime)
commandPlugin_responseStartDateTime :: Lens' CommandPlugin (Maybe UTCTime)
commandPlugin_responseStartDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe POSIX
responseStartDateTime :: Maybe POSIX
$sel:responseStartDateTime:CommandPlugin' :: CommandPlugin -> Maybe POSIX
responseStartDateTime} -> Maybe POSIX
responseStartDateTime) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe POSIX
a -> CommandPlugin
s {$sel:responseStartDateTime:CommandPlugin' :: Maybe POSIX
responseStartDateTime = Maybe POSIX
a} :: CommandPlugin) 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 URL for the complete text written by the plugin to stderr. If
-- execution isn\'t yet complete, then this string is empty.
commandPlugin_standardErrorUrl :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.Text)
commandPlugin_standardErrorUrl :: Lens' CommandPlugin (Maybe Text)
commandPlugin_standardErrorUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe Text
standardErrorUrl :: Maybe Text
$sel:standardErrorUrl:CommandPlugin' :: CommandPlugin -> Maybe Text
standardErrorUrl} -> Maybe Text
standardErrorUrl) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe Text
a -> CommandPlugin
s {$sel:standardErrorUrl:CommandPlugin' :: Maybe Text
standardErrorUrl = Maybe Text
a} :: CommandPlugin)

-- | The URL for the complete text written by the plugin to stdout in Amazon
-- S3. If the S3 bucket for the command wasn\'t specified, then this string
-- is empty.
commandPlugin_standardOutputUrl :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.Text)
commandPlugin_standardOutputUrl :: Lens' CommandPlugin (Maybe Text)
commandPlugin_standardOutputUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe Text
standardOutputUrl :: Maybe Text
$sel:standardOutputUrl:CommandPlugin' :: CommandPlugin -> Maybe Text
standardOutputUrl} -> Maybe Text
standardOutputUrl) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe Text
a -> CommandPlugin
s {$sel:standardOutputUrl:CommandPlugin' :: Maybe Text
standardOutputUrl = Maybe Text
a} :: CommandPlugin)

-- | The status of this plugin. You can run a document with multiple plugins.
commandPlugin_status :: Lens.Lens' CommandPlugin (Prelude.Maybe CommandPluginStatus)
commandPlugin_status :: Lens' CommandPlugin (Maybe CommandPluginStatus)
commandPlugin_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe CommandPluginStatus
status :: Maybe CommandPluginStatus
$sel:status:CommandPlugin' :: CommandPlugin -> Maybe CommandPluginStatus
status} -> Maybe CommandPluginStatus
status) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe CommandPluginStatus
a -> CommandPlugin
s {$sel:status:CommandPlugin' :: Maybe CommandPluginStatus
status = Maybe CommandPluginStatus
a} :: CommandPlugin)

-- | A detailed status of the plugin 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 the managed node.
--
-- -   In Progress: The command has been sent to the managed node 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 managed
--     node 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 managed node,
--     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 managed node. 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.
--
-- -   Cancelled: The command was terminated before it was completed. This
--     is a terminal state.
--
-- -   Undeliverable: The command can\'t be delivered to the managed node.
--     The managed node might not exist, or it might not be responding.
--     Undeliverable invocations don\'t count against the parent command\'s
--     MaxErrors limit, and they 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.
commandPlugin_statusDetails :: Lens.Lens' CommandPlugin (Prelude.Maybe Prelude.Text)
commandPlugin_statusDetails :: Lens' CommandPlugin (Maybe Text)
commandPlugin_statusDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommandPlugin' {Maybe Text
statusDetails :: Maybe Text
$sel:statusDetails:CommandPlugin' :: CommandPlugin -> Maybe Text
statusDetails} -> Maybe Text
statusDetails) (\s :: CommandPlugin
s@CommandPlugin' {} Maybe Text
a -> CommandPlugin
s {$sel:statusDetails:CommandPlugin' :: Maybe Text
statusDetails = Maybe Text
a} :: CommandPlugin)

instance Data.FromJSON CommandPlugin where
  parseJSON :: Value -> Parser CommandPlugin
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CommandPlugin"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe CommandPluginStatus
-> Maybe Text
-> CommandPlugin
CommandPlugin'
            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
"Name")
            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
"Output")
            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
"ResponseCode")
            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
"ResponseFinishDateTime")
            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
"ResponseStartDateTime")
            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
"StandardErrorUrl")
            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
"StandardOutputUrl")
            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")
      )

instance Prelude.Hashable CommandPlugin where
  hashWithSalt :: Int -> CommandPlugin -> Int
hashWithSalt Int
_salt CommandPlugin' {Maybe Int
Maybe Text
Maybe POSIX
Maybe CommandPluginStatus
statusDetails :: Maybe Text
status :: Maybe CommandPluginStatus
standardOutputUrl :: Maybe Text
standardErrorUrl :: Maybe Text
responseStartDateTime :: Maybe POSIX
responseFinishDateTime :: Maybe POSIX
responseCode :: Maybe Int
outputS3Region :: Maybe Text
outputS3KeyPrefix :: Maybe Text
outputS3BucketName :: Maybe Text
output :: Maybe Text
name :: Maybe Text
$sel:statusDetails:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:status:CommandPlugin' :: CommandPlugin -> Maybe CommandPluginStatus
$sel:standardOutputUrl:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:standardErrorUrl:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:responseStartDateTime:CommandPlugin' :: CommandPlugin -> Maybe POSIX
$sel:responseFinishDateTime:CommandPlugin' :: CommandPlugin -> Maybe POSIX
$sel:responseCode:CommandPlugin' :: CommandPlugin -> Maybe Int
$sel:outputS3Region:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:outputS3KeyPrefix:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:outputS3BucketName:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:output:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:name:CommandPlugin' :: CommandPlugin -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
output
      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 Int
responseCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
responseFinishDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
responseStartDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
standardErrorUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
standardOutputUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CommandPluginStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusDetails

instance Prelude.NFData CommandPlugin where
  rnf :: CommandPlugin -> ()
rnf CommandPlugin' {Maybe Int
Maybe Text
Maybe POSIX
Maybe CommandPluginStatus
statusDetails :: Maybe Text
status :: Maybe CommandPluginStatus
standardOutputUrl :: Maybe Text
standardErrorUrl :: Maybe Text
responseStartDateTime :: Maybe POSIX
responseFinishDateTime :: Maybe POSIX
responseCode :: Maybe Int
outputS3Region :: Maybe Text
outputS3KeyPrefix :: Maybe Text
outputS3BucketName :: Maybe Text
output :: Maybe Text
name :: Maybe Text
$sel:statusDetails:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:status:CommandPlugin' :: CommandPlugin -> Maybe CommandPluginStatus
$sel:standardOutputUrl:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:standardErrorUrl:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:responseStartDateTime:CommandPlugin' :: CommandPlugin -> Maybe POSIX
$sel:responseFinishDateTime:CommandPlugin' :: CommandPlugin -> Maybe POSIX
$sel:responseCode:CommandPlugin' :: CommandPlugin -> Maybe Int
$sel:outputS3Region:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:outputS3KeyPrefix:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:outputS3BucketName:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:output:CommandPlugin' :: CommandPlugin -> Maybe Text
$sel:name:CommandPlugin' :: CommandPlugin -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
output
      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 Int
responseCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
responseFinishDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
responseStartDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
standardErrorUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
standardOutputUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CommandPluginStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusDetails