{-# 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.MaintenanceWindowRunCommandParameters
-- 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.MaintenanceWindowRunCommandParameters 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.CloudWatchOutputConfig
import Amazonka.SSM.Types.DocumentHashType
import Amazonka.SSM.Types.NotificationConfig

-- | The parameters for a @RUN_COMMAND@ task type.
--
-- For information about specifying and updating task parameters, see
-- RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask.
--
-- @LoggingInfo@ has been deprecated. To specify an Amazon Simple Storage
-- Service (Amazon S3) bucket to contain logs, instead use the
-- @OutputS3BucketName@ and @OutputS3KeyPrefix@ options in the
-- @TaskInvocationParameters@ structure. For information about how Amazon
-- Web Services Systems Manager handles these options for the supported
-- maintenance window task types, see
-- MaintenanceWindowTaskInvocationParameters.
--
-- @TaskParameters@ has been deprecated. To specify parameters to pass to a
-- task when it runs, instead use the @Parameters@ option in the
-- @TaskInvocationParameters@ structure. For information about how Systems
-- Manager handles these options for the supported maintenance window task
-- types, see MaintenanceWindowTaskInvocationParameters.
--
-- For @RUN_COMMAND@ tasks, Systems Manager uses specified values for
-- @TaskParameters@ and @LoggingInfo@ only if no values are specified for
-- @TaskInvocationParameters@.
--
-- /See:/ 'newMaintenanceWindowRunCommandParameters' smart constructor.
data MaintenanceWindowRunCommandParameters = MaintenanceWindowRunCommandParameters'
  { MaintenanceWindowRunCommandParameters
-> Maybe CloudWatchOutputConfig
cloudWatchOutputConfig :: Prelude.Maybe CloudWatchOutputConfig,
    -- | Information about the commands to run.
    MaintenanceWindowRunCommandParameters -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | The SHA-256 or SHA-1 hash created by the system when the document was
    -- created. SHA-1 hashes have been deprecated.
    MaintenanceWindowRunCommandParameters -> Maybe Text
documentHash :: Prelude.Maybe Prelude.Text,
    -- | SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
    MaintenanceWindowRunCommandParameters -> Maybe DocumentHashType
documentHashType :: Prelude.Maybe DocumentHashType,
    -- | The Amazon Web Services Systems Manager document (SSM document) version
    -- to use in the request. You can specify @$DEFAULT@, @$LATEST@, or a
    -- specific version number. If you run commands by using the Amazon Web
    -- Services CLI, then you must escape the first two options by using a
    -- backslash. If you specify a version number, then you don\'t need to use
    -- the backslash. For example:
    --
    -- @--document-version \"\\$DEFAULT\"@
    --
    -- @--document-version \"\\$LATEST\"@
    --
    -- @--document-version \"3\"@
    MaintenanceWindowRunCommandParameters -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | Configurations for sending notifications about command status changes on
    -- a per-managed node basis.
    MaintenanceWindowRunCommandParameters -> Maybe NotificationConfig
notificationConfig :: Prelude.Maybe NotificationConfig,
    -- | The name of the Amazon Simple Storage Service (Amazon S3) bucket.
    MaintenanceWindowRunCommandParameters -> Maybe Text
outputS3BucketName :: Prelude.Maybe Prelude.Text,
    -- | The S3 bucket subfolder.
    MaintenanceWindowRunCommandParameters -> Maybe Text
outputS3KeyPrefix :: Prelude.Maybe Prelude.Text,
    -- | The parameters for the @RUN_COMMAND@ task execution.
    MaintenanceWindowRunCommandParameters
-> Maybe (Sensitive (HashMap Text [Text]))
parameters :: Prelude.Maybe (Data.Sensitive (Prelude.HashMap Prelude.Text [Prelude.Text])),
    -- | The Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) service role to use to publish Amazon Simple Notification Service
    -- (Amazon SNS) notifications for maintenance window Run Command tasks.
    MaintenanceWindowRunCommandParameters -> Maybe Text
serviceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | If this time is reached and the command hasn\'t already started running,
    -- it doesn\'t run.
    MaintenanceWindowRunCommandParameters -> Maybe Natural
timeoutSeconds :: Prelude.Maybe Prelude.Natural
  }
  deriving (MaintenanceWindowRunCommandParameters
-> MaintenanceWindowRunCommandParameters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaintenanceWindowRunCommandParameters
-> MaintenanceWindowRunCommandParameters -> Bool
$c/= :: MaintenanceWindowRunCommandParameters
-> MaintenanceWindowRunCommandParameters -> Bool
== :: MaintenanceWindowRunCommandParameters
-> MaintenanceWindowRunCommandParameters -> Bool
$c== :: MaintenanceWindowRunCommandParameters
-> MaintenanceWindowRunCommandParameters -> Bool
Prelude.Eq, Int -> MaintenanceWindowRunCommandParameters -> ShowS
[MaintenanceWindowRunCommandParameters] -> ShowS
MaintenanceWindowRunCommandParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaintenanceWindowRunCommandParameters] -> ShowS
$cshowList :: [MaintenanceWindowRunCommandParameters] -> ShowS
show :: MaintenanceWindowRunCommandParameters -> String
$cshow :: MaintenanceWindowRunCommandParameters -> String
showsPrec :: Int -> MaintenanceWindowRunCommandParameters -> ShowS
$cshowsPrec :: Int -> MaintenanceWindowRunCommandParameters -> ShowS
Prelude.Show, forall x.
Rep MaintenanceWindowRunCommandParameters x
-> MaintenanceWindowRunCommandParameters
forall x.
MaintenanceWindowRunCommandParameters
-> Rep MaintenanceWindowRunCommandParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MaintenanceWindowRunCommandParameters x
-> MaintenanceWindowRunCommandParameters
$cfrom :: forall x.
MaintenanceWindowRunCommandParameters
-> Rep MaintenanceWindowRunCommandParameters x
Prelude.Generic)

-- |
-- Create a value of 'MaintenanceWindowRunCommandParameters' 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:
--
-- 'cloudWatchOutputConfig', 'maintenanceWindowRunCommandParameters_cloudWatchOutputConfig' - Undocumented member.
--
-- 'comment', 'maintenanceWindowRunCommandParameters_comment' - Information about the commands to run.
--
-- 'documentHash', 'maintenanceWindowRunCommandParameters_documentHash' - The SHA-256 or SHA-1 hash created by the system when the document was
-- created. SHA-1 hashes have been deprecated.
--
-- 'documentHashType', 'maintenanceWindowRunCommandParameters_documentHashType' - SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
--
-- 'documentVersion', 'maintenanceWindowRunCommandParameters_documentVersion' - The Amazon Web Services Systems Manager document (SSM document) version
-- to use in the request. You can specify @$DEFAULT@, @$LATEST@, or a
-- specific version number. If you run commands by using the Amazon Web
-- Services CLI, then you must escape the first two options by using a
-- backslash. If you specify a version number, then you don\'t need to use
-- the backslash. For example:
--
-- @--document-version \"\\$DEFAULT\"@
--
-- @--document-version \"\\$LATEST\"@
--
-- @--document-version \"3\"@
--
-- 'notificationConfig', 'maintenanceWindowRunCommandParameters_notificationConfig' - Configurations for sending notifications about command status changes on
-- a per-managed node basis.
--
-- 'outputS3BucketName', 'maintenanceWindowRunCommandParameters_outputS3BucketName' - The name of the Amazon Simple Storage Service (Amazon S3) bucket.
--
-- 'outputS3KeyPrefix', 'maintenanceWindowRunCommandParameters_outputS3KeyPrefix' - The S3 bucket subfolder.
--
-- 'parameters', 'maintenanceWindowRunCommandParameters_parameters' - The parameters for the @RUN_COMMAND@ task execution.
--
-- 'serviceRoleArn', 'maintenanceWindowRunCommandParameters_serviceRoleArn' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) service role to use to publish Amazon Simple Notification Service
-- (Amazon SNS) notifications for maintenance window Run Command tasks.
--
-- 'timeoutSeconds', 'maintenanceWindowRunCommandParameters_timeoutSeconds' - If this time is reached and the command hasn\'t already started running,
-- it doesn\'t run.
newMaintenanceWindowRunCommandParameters ::
  MaintenanceWindowRunCommandParameters
newMaintenanceWindowRunCommandParameters :: MaintenanceWindowRunCommandParameters
newMaintenanceWindowRunCommandParameters =
  MaintenanceWindowRunCommandParameters'
    { $sel:cloudWatchOutputConfig:MaintenanceWindowRunCommandParameters' :: Maybe CloudWatchOutputConfig
cloudWatchOutputConfig =
        forall a. Maybe a
Prelude.Nothing,
      $sel:comment:MaintenanceWindowRunCommandParameters' :: Maybe Text
comment = forall a. Maybe a
Prelude.Nothing,
      $sel:documentHash:MaintenanceWindowRunCommandParameters' :: Maybe Text
documentHash = forall a. Maybe a
Prelude.Nothing,
      $sel:documentHashType:MaintenanceWindowRunCommandParameters' :: Maybe DocumentHashType
documentHashType = forall a. Maybe a
Prelude.Nothing,
      $sel:documentVersion:MaintenanceWindowRunCommandParameters' :: Maybe Text
documentVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:notificationConfig:MaintenanceWindowRunCommandParameters' :: Maybe NotificationConfig
notificationConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:outputS3BucketName:MaintenanceWindowRunCommandParameters' :: Maybe Text
outputS3BucketName = forall a. Maybe a
Prelude.Nothing,
      $sel:outputS3KeyPrefix:MaintenanceWindowRunCommandParameters' :: Maybe Text
outputS3KeyPrefix = forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:MaintenanceWindowRunCommandParameters' :: Maybe (Sensitive (HashMap Text [Text]))
parameters = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceRoleArn:MaintenanceWindowRunCommandParameters' :: Maybe Text
serviceRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutSeconds:MaintenanceWindowRunCommandParameters' :: Maybe Natural
timeoutSeconds = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
maintenanceWindowRunCommandParameters_cloudWatchOutputConfig :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe CloudWatchOutputConfig)
maintenanceWindowRunCommandParameters_cloudWatchOutputConfig :: Lens'
  MaintenanceWindowRunCommandParameters
  (Maybe CloudWatchOutputConfig)
maintenanceWindowRunCommandParameters_cloudWatchOutputConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe CloudWatchOutputConfig
cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig
$sel:cloudWatchOutputConfig:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters
-> Maybe CloudWatchOutputConfig
cloudWatchOutputConfig} -> Maybe CloudWatchOutputConfig
cloudWatchOutputConfig) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe CloudWatchOutputConfig
a -> MaintenanceWindowRunCommandParameters
s {$sel:cloudWatchOutputConfig:MaintenanceWindowRunCommandParameters' :: Maybe CloudWatchOutputConfig
cloudWatchOutputConfig = Maybe CloudWatchOutputConfig
a} :: MaintenanceWindowRunCommandParameters)

-- | Information about the commands to run.
maintenanceWindowRunCommandParameters_comment :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowRunCommandParameters_comment :: Lens' MaintenanceWindowRunCommandParameters (Maybe Text)
maintenanceWindowRunCommandParameters_comment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe Text
comment :: Maybe Text
$sel:comment:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
comment} -> Maybe Text
comment) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe Text
a -> MaintenanceWindowRunCommandParameters
s {$sel:comment:MaintenanceWindowRunCommandParameters' :: Maybe Text
comment = Maybe Text
a} :: MaintenanceWindowRunCommandParameters)

-- | The SHA-256 or SHA-1 hash created by the system when the document was
-- created. SHA-1 hashes have been deprecated.
maintenanceWindowRunCommandParameters_documentHash :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowRunCommandParameters_documentHash :: Lens' MaintenanceWindowRunCommandParameters (Maybe Text)
maintenanceWindowRunCommandParameters_documentHash = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe Text
documentHash :: Maybe Text
$sel:documentHash:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
documentHash} -> Maybe Text
documentHash) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe Text
a -> MaintenanceWindowRunCommandParameters
s {$sel:documentHash:MaintenanceWindowRunCommandParameters' :: Maybe Text
documentHash = Maybe Text
a} :: MaintenanceWindowRunCommandParameters)

-- | SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
maintenanceWindowRunCommandParameters_documentHashType :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe DocumentHashType)
maintenanceWindowRunCommandParameters_documentHashType :: Lens'
  MaintenanceWindowRunCommandParameters (Maybe DocumentHashType)
maintenanceWindowRunCommandParameters_documentHashType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe DocumentHashType
documentHashType :: Maybe DocumentHashType
$sel:documentHashType:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe DocumentHashType
documentHashType} -> Maybe DocumentHashType
documentHashType) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe DocumentHashType
a -> MaintenanceWindowRunCommandParameters
s {$sel:documentHashType:MaintenanceWindowRunCommandParameters' :: Maybe DocumentHashType
documentHashType = Maybe DocumentHashType
a} :: MaintenanceWindowRunCommandParameters)

-- | The Amazon Web Services Systems Manager document (SSM document) version
-- to use in the request. You can specify @$DEFAULT@, @$LATEST@, or a
-- specific version number. If you run commands by using the Amazon Web
-- Services CLI, then you must escape the first two options by using a
-- backslash. If you specify a version number, then you don\'t need to use
-- the backslash. For example:
--
-- @--document-version \"\\$DEFAULT\"@
--
-- @--document-version \"\\$LATEST\"@
--
-- @--document-version \"3\"@
maintenanceWindowRunCommandParameters_documentVersion :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowRunCommandParameters_documentVersion :: Lens' MaintenanceWindowRunCommandParameters (Maybe Text)
maintenanceWindowRunCommandParameters_documentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe Text
a -> MaintenanceWindowRunCommandParameters
s {$sel:documentVersion:MaintenanceWindowRunCommandParameters' :: Maybe Text
documentVersion = Maybe Text
a} :: MaintenanceWindowRunCommandParameters)

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

-- | The name of the Amazon Simple Storage Service (Amazon S3) bucket.
maintenanceWindowRunCommandParameters_outputS3BucketName :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowRunCommandParameters_outputS3BucketName :: Lens' MaintenanceWindowRunCommandParameters (Maybe Text)
maintenanceWindowRunCommandParameters_outputS3BucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe Text
outputS3BucketName :: Maybe Text
$sel:outputS3BucketName:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
outputS3BucketName} -> Maybe Text
outputS3BucketName) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe Text
a -> MaintenanceWindowRunCommandParameters
s {$sel:outputS3BucketName:MaintenanceWindowRunCommandParameters' :: Maybe Text
outputS3BucketName = Maybe Text
a} :: MaintenanceWindowRunCommandParameters)

-- | The S3 bucket subfolder.
maintenanceWindowRunCommandParameters_outputS3KeyPrefix :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowRunCommandParameters_outputS3KeyPrefix :: Lens' MaintenanceWindowRunCommandParameters (Maybe Text)
maintenanceWindowRunCommandParameters_outputS3KeyPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe Text
outputS3KeyPrefix :: Maybe Text
$sel:outputS3KeyPrefix:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
outputS3KeyPrefix} -> Maybe Text
outputS3KeyPrefix) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe Text
a -> MaintenanceWindowRunCommandParameters
s {$sel:outputS3KeyPrefix:MaintenanceWindowRunCommandParameters' :: Maybe Text
outputS3KeyPrefix = Maybe Text
a} :: MaintenanceWindowRunCommandParameters)

-- | The parameters for the @RUN_COMMAND@ task execution.
maintenanceWindowRunCommandParameters_parameters :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
maintenanceWindowRunCommandParameters_parameters :: Lens'
  MaintenanceWindowRunCommandParameters (Maybe (HashMap Text [Text]))
maintenanceWindowRunCommandParameters_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe (Sensitive (HashMap Text [Text]))
parameters :: Maybe (Sensitive (HashMap Text [Text]))
$sel:parameters:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters
-> Maybe (Sensitive (HashMap Text [Text]))
parameters} -> Maybe (Sensitive (HashMap Text [Text]))
parameters) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe (Sensitive (HashMap Text [Text]))
a -> MaintenanceWindowRunCommandParameters
s {$sel:parameters:MaintenanceWindowRunCommandParameters' :: Maybe (Sensitive (HashMap Text [Text]))
parameters = Maybe (Sensitive (HashMap Text [Text]))
a} :: MaintenanceWindowRunCommandParameters) 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 Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) service role to use to publish Amazon Simple Notification Service
-- (Amazon SNS) notifications for maintenance window Run Command tasks.
maintenanceWindowRunCommandParameters_serviceRoleArn :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe Prelude.Text)
maintenanceWindowRunCommandParameters_serviceRoleArn :: Lens' MaintenanceWindowRunCommandParameters (Maybe Text)
maintenanceWindowRunCommandParameters_serviceRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe Text
serviceRoleArn :: Maybe Text
$sel:serviceRoleArn:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
serviceRoleArn} -> Maybe Text
serviceRoleArn) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe Text
a -> MaintenanceWindowRunCommandParameters
s {$sel:serviceRoleArn:MaintenanceWindowRunCommandParameters' :: Maybe Text
serviceRoleArn = Maybe Text
a} :: MaintenanceWindowRunCommandParameters)

-- | If this time is reached and the command hasn\'t already started running,
-- it doesn\'t run.
maintenanceWindowRunCommandParameters_timeoutSeconds :: Lens.Lens' MaintenanceWindowRunCommandParameters (Prelude.Maybe Prelude.Natural)
maintenanceWindowRunCommandParameters_timeoutSeconds :: Lens' MaintenanceWindowRunCommandParameters (Maybe Natural)
maintenanceWindowRunCommandParameters_timeoutSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceWindowRunCommandParameters' {Maybe Natural
timeoutSeconds :: Maybe Natural
$sel:timeoutSeconds:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Natural
timeoutSeconds} -> Maybe Natural
timeoutSeconds) (\s :: MaintenanceWindowRunCommandParameters
s@MaintenanceWindowRunCommandParameters' {} Maybe Natural
a -> MaintenanceWindowRunCommandParameters
s {$sel:timeoutSeconds:MaintenanceWindowRunCommandParameters' :: Maybe Natural
timeoutSeconds = Maybe Natural
a} :: MaintenanceWindowRunCommandParameters)

instance
  Data.FromJSON
    MaintenanceWindowRunCommandParameters
  where
  parseJSON :: Value -> Parser MaintenanceWindowRunCommandParameters
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MaintenanceWindowRunCommandParameters"
      ( \Object
x ->
          Maybe CloudWatchOutputConfig
-> Maybe Text
-> Maybe Text
-> Maybe DocumentHashType
-> Maybe Text
-> Maybe NotificationConfig
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive (HashMap Text [Text]))
-> Maybe Text
-> Maybe Natural
-> MaintenanceWindowRunCommandParameters
MaintenanceWindowRunCommandParameters'
            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
"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
"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
"DocumentHash")
            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
"DocumentHashType")
            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
"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
"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
"ServiceRoleArn")
            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")
      )

instance
  Prelude.Hashable
    MaintenanceWindowRunCommandParameters
  where
  hashWithSalt :: Int -> MaintenanceWindowRunCommandParameters -> Int
hashWithSalt
    Int
_salt
    MaintenanceWindowRunCommandParameters' {Maybe Natural
Maybe Text
Maybe (Sensitive (HashMap Text [Text]))
Maybe CloudWatchOutputConfig
Maybe DocumentHashType
Maybe NotificationConfig
timeoutSeconds :: Maybe Natural
serviceRoleArn :: Maybe Text
parameters :: Maybe (Sensitive (HashMap Text [Text]))
outputS3KeyPrefix :: Maybe Text
outputS3BucketName :: Maybe Text
notificationConfig :: Maybe NotificationConfig
documentVersion :: Maybe Text
documentHashType :: Maybe DocumentHashType
documentHash :: Maybe Text
comment :: Maybe Text
cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig
$sel:timeoutSeconds:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Natural
$sel:serviceRoleArn:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:parameters:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters
-> Maybe (Sensitive (HashMap Text [Text]))
$sel:outputS3KeyPrefix:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:outputS3BucketName:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:notificationConfig:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe NotificationConfig
$sel:documentVersion:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:documentHashType:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe DocumentHashType
$sel:documentHash:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:comment:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:cloudWatchOutputConfig:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters
-> Maybe CloudWatchOutputConfig
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudWatchOutputConfig
cloudWatchOutputConfig
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentHash
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DocumentHashType
documentHashType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentVersion
        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 (Sensitive (HashMap Text [Text]))
parameters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceRoleArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeoutSeconds

instance
  Prelude.NFData
    MaintenanceWindowRunCommandParameters
  where
  rnf :: MaintenanceWindowRunCommandParameters -> ()
rnf MaintenanceWindowRunCommandParameters' {Maybe Natural
Maybe Text
Maybe (Sensitive (HashMap Text [Text]))
Maybe CloudWatchOutputConfig
Maybe DocumentHashType
Maybe NotificationConfig
timeoutSeconds :: Maybe Natural
serviceRoleArn :: Maybe Text
parameters :: Maybe (Sensitive (HashMap Text [Text]))
outputS3KeyPrefix :: Maybe Text
outputS3BucketName :: Maybe Text
notificationConfig :: Maybe NotificationConfig
documentVersion :: Maybe Text
documentHashType :: Maybe DocumentHashType
documentHash :: Maybe Text
comment :: Maybe Text
cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig
$sel:timeoutSeconds:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Natural
$sel:serviceRoleArn:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:parameters:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters
-> Maybe (Sensitive (HashMap Text [Text]))
$sel:outputS3KeyPrefix:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:outputS3BucketName:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:notificationConfig:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe NotificationConfig
$sel:documentVersion:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:documentHashType:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe DocumentHashType
$sel:documentHash:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:comment:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:cloudWatchOutputConfig:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters
-> Maybe CloudWatchOutputConfig
..} =
    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
comment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentHash
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DocumentHashType
documentHashType
      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 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 (Sensitive (HashMap Text [Text]))
parameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
timeoutSeconds

instance
  Data.ToJSON
    MaintenanceWindowRunCommandParameters
  where
  toJSON :: MaintenanceWindowRunCommandParameters -> Value
toJSON MaintenanceWindowRunCommandParameters' {Maybe Natural
Maybe Text
Maybe (Sensitive (HashMap Text [Text]))
Maybe CloudWatchOutputConfig
Maybe DocumentHashType
Maybe NotificationConfig
timeoutSeconds :: Maybe Natural
serviceRoleArn :: Maybe Text
parameters :: Maybe (Sensitive (HashMap Text [Text]))
outputS3KeyPrefix :: Maybe Text
outputS3BucketName :: Maybe Text
notificationConfig :: Maybe NotificationConfig
documentVersion :: Maybe Text
documentHashType :: Maybe DocumentHashType
documentHash :: Maybe Text
comment :: Maybe Text
cloudWatchOutputConfig :: Maybe CloudWatchOutputConfig
$sel:timeoutSeconds:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Natural
$sel:serviceRoleArn:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:parameters:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters
-> Maybe (Sensitive (HashMap Text [Text]))
$sel:outputS3KeyPrefix:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:outputS3BucketName:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:notificationConfig:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe NotificationConfig
$sel:documentVersion:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:documentHashType:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe DocumentHashType
$sel:documentHash:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:comment:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters -> Maybe Text
$sel:cloudWatchOutputConfig:MaintenanceWindowRunCommandParameters' :: MaintenanceWindowRunCommandParameters
-> Maybe CloudWatchOutputConfig
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CloudWatchOutputConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchOutputConfig
cloudWatchOutputConfig,
            (Key
"Comment" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
comment,
            (Key
"DocumentHash" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
documentHash,
            (Key
"DocumentHashType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DocumentHashType
documentHashType,
            (Key
"DocumentVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
documentVersion,
            (Key
"NotificationConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationConfig
notificationConfig,
            (Key
"OutputS3BucketName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
outputS3BucketName,
            (Key
"OutputS3KeyPrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
outputS3KeyPrefix,
            (Key
"Parameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (HashMap Text [Text]))
parameters,
            (Key
"ServiceRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serviceRoleArn,
            (Key
"TimeoutSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeoutSeconds
          ]
      )