{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.RegisterTaskWithMaintenanceWindow
-- 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)
--
-- Adds a new task to a maintenance window.
module Amazonka.SSM.RegisterTaskWithMaintenanceWindow
  ( -- * Creating a Request
    RegisterTaskWithMaintenanceWindow (..),
    newRegisterTaskWithMaintenanceWindow,

    -- * Request Lenses
    registerTaskWithMaintenanceWindow_serviceRoleArn,
    registerTaskWithMaintenanceWindow_taskParameters,
    registerTaskWithMaintenanceWindow_priority,
    registerTaskWithMaintenanceWindow_clientToken,
    registerTaskWithMaintenanceWindow_cutoffBehavior,
    registerTaskWithMaintenanceWindow_maxErrors,
    registerTaskWithMaintenanceWindow_taskInvocationParameters,
    registerTaskWithMaintenanceWindow_name,
    registerTaskWithMaintenanceWindow_targets,
    registerTaskWithMaintenanceWindow_loggingInfo,
    registerTaskWithMaintenanceWindow_description,
    registerTaskWithMaintenanceWindow_maxConcurrency,
    registerTaskWithMaintenanceWindow_windowId,
    registerTaskWithMaintenanceWindow_taskArn,
    registerTaskWithMaintenanceWindow_taskType,

    -- * Destructuring the Response
    RegisterTaskWithMaintenanceWindowResponse (..),
    newRegisterTaskWithMaintenanceWindowResponse,

    -- * Response Lenses
    registerTaskWithMaintenanceWindowResponse_windowTaskId,
    registerTaskWithMaintenanceWindowResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types

-- | /See:/ 'newRegisterTaskWithMaintenanceWindow' smart constructor.
data RegisterTaskWithMaintenanceWindow = RegisterTaskWithMaintenanceWindow'
  { -- | The Amazon Resource Name (ARN) of the IAM service role for Amazon Web
    -- Services Systems Manager to assume when running a maintenance window
    -- task. If you do not specify a service role ARN, Systems Manager uses
    -- your account\'s service-linked role. If no service-linked role for
    -- Systems Manager exists in your account, it is created when you run
    -- @RegisterTaskWithMaintenanceWindow@.
    --
    -- For more information, see the following topics in the in the /Amazon Web
    -- Services Systems Manager User Guide/:
    --
    -- -   <https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions Using service-linked roles for Systems Manager>
    --
    -- -   <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role Should I use a service-linked role or a custom service role to run maintenance window tasks?>
    RegisterTaskWithMaintenanceWindow -> Maybe Text
serviceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The parameters that should be passed to the task when it is run.
    --
    -- @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.
    RegisterTaskWithMaintenanceWindow
-> Maybe
     (Sensitive
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
taskParameters :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text (Core.Sensitive MaintenanceWindowTaskParameterValueExpression))),
    -- | The priority of the task in the maintenance window, the lower the number
    -- the higher the priority. Tasks in a maintenance window are scheduled in
    -- priority order with tasks that have the same priority scheduled in
    -- parallel.
    RegisterTaskWithMaintenanceWindow -> Maybe Natural
priority :: Prelude.Maybe Prelude.Natural,
    -- | User-provided idempotency token.
    RegisterTaskWithMaintenanceWindow -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether tasks should continue to run after the cutoff time
    -- specified in the maintenance windows is reached.
    --
    -- -   @CONTINUE_TASK@: When the cutoff time is reached, any tasks that are
    --     running continue. The default value.
    --
    -- -   @CANCEL_TASK@:
    --
    --     -   For Automation, Lambda, Step Functions tasks: When the cutoff
    --         time is reached, any task invocations that are already running
    --         continue, but no new task invocations are started.
    --
    --     -   For Run Command tasks: When the cutoff time is reached, the
    --         system sends a CancelCommand operation that attempts to cancel
    --         the command associated with the task. However, there is no
    --         guarantee that the command will be terminated and the underlying
    --         process stopped.
    --
    --     The status for tasks that are not completed is @TIMED_OUT@.
    RegisterTaskWithMaintenanceWindow
-> Maybe MaintenanceWindowTaskCutoffBehavior
cutoffBehavior :: Prelude.Maybe MaintenanceWindowTaskCutoffBehavior,
    -- | The maximum number of errors allowed before this task stops being
    -- scheduled.
    --
    -- For maintenance window tasks without a target specified, you can\'t
    -- supply a value for this option. Instead, the system inserts a
    -- placeholder value of @1@. This value doesn\'t affect the running of your
    -- task.
    RegisterTaskWithMaintenanceWindow -> Maybe Text
maxErrors :: Prelude.Maybe Prelude.Text,
    -- | The parameters that the task should use during execution. Populate only
    -- the fields that match the task type. All other fields should be empty.
    RegisterTaskWithMaintenanceWindow
-> Maybe MaintenanceWindowTaskInvocationParameters
taskInvocationParameters :: Prelude.Maybe MaintenanceWindowTaskInvocationParameters,
    -- | An optional name for the task.
    RegisterTaskWithMaintenanceWindow -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The targets (either instances or maintenance window targets).
    --
    -- One or more targets must be specified for maintenance window Run
    -- Command-type tasks. Depending on the task, targets are optional for
    -- other maintenance window task types (Automation, Lambda, and Step
    -- Functions). For more information about running tasks that don\'t specify
    -- targets, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html Registering maintenance window tasks without targets>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    --
    -- Specify instances using the following format:
    --
    -- @Key=InstanceIds,Values=\<instance-id-1>,\<instance-id-2>@
    --
    -- Specify maintenance window targets using the following format:
    --
    -- @Key=WindowTargetIds,Values=\<window-target-id-1>,\<window-target-id-2>@
    RegisterTaskWithMaintenanceWindow -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | A structure containing information about an Amazon Simple Storage
    -- Service (Amazon S3) bucket to write instance-level logs to.
    --
    -- @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.
    RegisterTaskWithMaintenanceWindow -> Maybe LoggingInfo
loggingInfo :: Prelude.Maybe LoggingInfo,
    -- | An optional description for the task.
    RegisterTaskWithMaintenanceWindow -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The maximum number of targets this task can be run for in parallel.
    --
    -- For maintenance window tasks without a target specified, you can\'t
    -- supply a value for this option. Instead, the system inserts a
    -- placeholder value of @1@. This value doesn\'t affect the running of your
    -- task.
    RegisterTaskWithMaintenanceWindow -> Maybe Text
maxConcurrency :: Prelude.Maybe Prelude.Text,
    -- | The ID of the maintenance window the task should be added to.
    RegisterTaskWithMaintenanceWindow -> Text
windowId :: Prelude.Text,
    -- | The ARN of the task to run.
    RegisterTaskWithMaintenanceWindow -> Text
taskArn :: Prelude.Text,
    -- | The type of task being registered.
    RegisterTaskWithMaintenanceWindow -> MaintenanceWindowTaskType
taskType :: MaintenanceWindowTaskType
  }
  deriving (RegisterTaskWithMaintenanceWindow
-> RegisterTaskWithMaintenanceWindow -> Bool
(RegisterTaskWithMaintenanceWindow
 -> RegisterTaskWithMaintenanceWindow -> Bool)
-> (RegisterTaskWithMaintenanceWindow
    -> RegisterTaskWithMaintenanceWindow -> Bool)
-> Eq RegisterTaskWithMaintenanceWindow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterTaskWithMaintenanceWindow
-> RegisterTaskWithMaintenanceWindow -> Bool
$c/= :: RegisterTaskWithMaintenanceWindow
-> RegisterTaskWithMaintenanceWindow -> Bool
== :: RegisterTaskWithMaintenanceWindow
-> RegisterTaskWithMaintenanceWindow -> Bool
$c== :: RegisterTaskWithMaintenanceWindow
-> RegisterTaskWithMaintenanceWindow -> Bool
Prelude.Eq, Int -> RegisterTaskWithMaintenanceWindow -> ShowS
[RegisterTaskWithMaintenanceWindow] -> ShowS
RegisterTaskWithMaintenanceWindow -> String
(Int -> RegisterTaskWithMaintenanceWindow -> ShowS)
-> (RegisterTaskWithMaintenanceWindow -> String)
-> ([RegisterTaskWithMaintenanceWindow] -> ShowS)
-> Show RegisterTaskWithMaintenanceWindow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterTaskWithMaintenanceWindow] -> ShowS
$cshowList :: [RegisterTaskWithMaintenanceWindow] -> ShowS
show :: RegisterTaskWithMaintenanceWindow -> String
$cshow :: RegisterTaskWithMaintenanceWindow -> String
showsPrec :: Int -> RegisterTaskWithMaintenanceWindow -> ShowS
$cshowsPrec :: Int -> RegisterTaskWithMaintenanceWindow -> ShowS
Prelude.Show, (forall x.
 RegisterTaskWithMaintenanceWindow
 -> Rep RegisterTaskWithMaintenanceWindow x)
-> (forall x.
    Rep RegisterTaskWithMaintenanceWindow x
    -> RegisterTaskWithMaintenanceWindow)
-> Generic RegisterTaskWithMaintenanceWindow
forall x.
Rep RegisterTaskWithMaintenanceWindow x
-> RegisterTaskWithMaintenanceWindow
forall x.
RegisterTaskWithMaintenanceWindow
-> Rep RegisterTaskWithMaintenanceWindow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterTaskWithMaintenanceWindow x
-> RegisterTaskWithMaintenanceWindow
$cfrom :: forall x.
RegisterTaskWithMaintenanceWindow
-> Rep RegisterTaskWithMaintenanceWindow x
Prelude.Generic)

-- |
-- Create a value of 'RegisterTaskWithMaintenanceWindow' 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:
--
-- 'serviceRoleArn', 'registerTaskWithMaintenanceWindow_serviceRoleArn' - The Amazon Resource Name (ARN) of the IAM service role for Amazon Web
-- Services Systems Manager to assume when running a maintenance window
-- task. If you do not specify a service role ARN, Systems Manager uses
-- your account\'s service-linked role. If no service-linked role for
-- Systems Manager exists in your account, it is created when you run
-- @RegisterTaskWithMaintenanceWindow@.
--
-- For more information, see the following topics in the in the /Amazon Web
-- Services Systems Manager User Guide/:
--
-- -   <https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions Using service-linked roles for Systems Manager>
--
-- -   <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role Should I use a service-linked role or a custom service role to run maintenance window tasks?>
--
-- 'taskParameters', 'registerTaskWithMaintenanceWindow_taskParameters' - The parameters that should be passed to the task when it is run.
--
-- @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.
--
-- 'priority', 'registerTaskWithMaintenanceWindow_priority' - The priority of the task in the maintenance window, the lower the number
-- the higher the priority. Tasks in a maintenance window are scheduled in
-- priority order with tasks that have the same priority scheduled in
-- parallel.
--
-- 'clientToken', 'registerTaskWithMaintenanceWindow_clientToken' - User-provided idempotency token.
--
-- 'cutoffBehavior', 'registerTaskWithMaintenanceWindow_cutoffBehavior' - Indicates whether tasks should continue to run after the cutoff time
-- specified in the maintenance windows is reached.
--
-- -   @CONTINUE_TASK@: When the cutoff time is reached, any tasks that are
--     running continue. The default value.
--
-- -   @CANCEL_TASK@:
--
--     -   For Automation, Lambda, Step Functions tasks: When the cutoff
--         time is reached, any task invocations that are already running
--         continue, but no new task invocations are started.
--
--     -   For Run Command tasks: When the cutoff time is reached, the
--         system sends a CancelCommand operation that attempts to cancel
--         the command associated with the task. However, there is no
--         guarantee that the command will be terminated and the underlying
--         process stopped.
--
--     The status for tasks that are not completed is @TIMED_OUT@.
--
-- 'maxErrors', 'registerTaskWithMaintenanceWindow_maxErrors' - The maximum number of errors allowed before this task stops being
-- scheduled.
--
-- For maintenance window tasks without a target specified, you can\'t
-- supply a value for this option. Instead, the system inserts a
-- placeholder value of @1@. This value doesn\'t affect the running of your
-- task.
--
-- 'taskInvocationParameters', 'registerTaskWithMaintenanceWindow_taskInvocationParameters' - The parameters that the task should use during execution. Populate only
-- the fields that match the task type. All other fields should be empty.
--
-- 'name', 'registerTaskWithMaintenanceWindow_name' - An optional name for the task.
--
-- 'targets', 'registerTaskWithMaintenanceWindow_targets' - The targets (either instances or maintenance window targets).
--
-- One or more targets must be specified for maintenance window Run
-- Command-type tasks. Depending on the task, targets are optional for
-- other maintenance window task types (Automation, Lambda, and Step
-- Functions). For more information about running tasks that don\'t specify
-- targets, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html Registering maintenance window tasks without targets>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- Specify instances using the following format:
--
-- @Key=InstanceIds,Values=\<instance-id-1>,\<instance-id-2>@
--
-- Specify maintenance window targets using the following format:
--
-- @Key=WindowTargetIds,Values=\<window-target-id-1>,\<window-target-id-2>@
--
-- 'loggingInfo', 'registerTaskWithMaintenanceWindow_loggingInfo' - A structure containing information about an Amazon Simple Storage
-- Service (Amazon S3) bucket to write instance-level logs to.
--
-- @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.
--
-- 'description', 'registerTaskWithMaintenanceWindow_description' - An optional description for the task.
--
-- 'maxConcurrency', 'registerTaskWithMaintenanceWindow_maxConcurrency' - The maximum number of targets this task can be run for in parallel.
--
-- For maintenance window tasks without a target specified, you can\'t
-- supply a value for this option. Instead, the system inserts a
-- placeholder value of @1@. This value doesn\'t affect the running of your
-- task.
--
-- 'windowId', 'registerTaskWithMaintenanceWindow_windowId' - The ID of the maintenance window the task should be added to.
--
-- 'taskArn', 'registerTaskWithMaintenanceWindow_taskArn' - The ARN of the task to run.
--
-- 'taskType', 'registerTaskWithMaintenanceWindow_taskType' - The type of task being registered.
newRegisterTaskWithMaintenanceWindow ::
  -- | 'windowId'
  Prelude.Text ->
  -- | 'taskArn'
  Prelude.Text ->
  -- | 'taskType'
  MaintenanceWindowTaskType ->
  RegisterTaskWithMaintenanceWindow
newRegisterTaskWithMaintenanceWindow :: Text
-> Text
-> MaintenanceWindowTaskType
-> RegisterTaskWithMaintenanceWindow
newRegisterTaskWithMaintenanceWindow
  Text
pWindowId_
  Text
pTaskArn_
  MaintenanceWindowTaskType
pTaskType_ =
    RegisterTaskWithMaintenanceWindow' :: Maybe Text
-> Maybe
     (Sensitive
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
-> Maybe Natural
-> Maybe Text
-> Maybe MaintenanceWindowTaskCutoffBehavior
-> Maybe Text
-> Maybe MaintenanceWindowTaskInvocationParameters
-> Maybe Text
-> Maybe [Target]
-> Maybe LoggingInfo
-> Maybe (Sensitive Text)
-> Maybe Text
-> Text
-> Text
-> MaintenanceWindowTaskType
-> RegisterTaskWithMaintenanceWindow
RegisterTaskWithMaintenanceWindow'
      { $sel:serviceRoleArn:RegisterTaskWithMaintenanceWindow' :: Maybe Text
serviceRoleArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:taskParameters:RegisterTaskWithMaintenanceWindow' :: Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
taskParameters = Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
forall a. Maybe a
Prelude.Nothing,
        $sel:priority:RegisterTaskWithMaintenanceWindow' :: Maybe Natural
priority = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:RegisterTaskWithMaintenanceWindow' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:cutoffBehavior:RegisterTaskWithMaintenanceWindow' :: Maybe MaintenanceWindowTaskCutoffBehavior
cutoffBehavior = Maybe MaintenanceWindowTaskCutoffBehavior
forall a. Maybe a
Prelude.Nothing,
        $sel:maxErrors:RegisterTaskWithMaintenanceWindow' :: Maybe Text
maxErrors = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:taskInvocationParameters:RegisterTaskWithMaintenanceWindow' :: Maybe MaintenanceWindowTaskInvocationParameters
taskInvocationParameters =
          Maybe MaintenanceWindowTaskInvocationParameters
forall a. Maybe a
Prelude.Nothing,
        $sel:name:RegisterTaskWithMaintenanceWindow' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:targets:RegisterTaskWithMaintenanceWindow' :: Maybe [Target]
targets = Maybe [Target]
forall a. Maybe a
Prelude.Nothing,
        $sel:loggingInfo:RegisterTaskWithMaintenanceWindow' :: Maybe LoggingInfo
loggingInfo = Maybe LoggingInfo
forall a. Maybe a
Prelude.Nothing,
        $sel:description:RegisterTaskWithMaintenanceWindow' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:maxConcurrency:RegisterTaskWithMaintenanceWindow' :: Maybe Text
maxConcurrency = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:windowId:RegisterTaskWithMaintenanceWindow' :: Text
windowId = Text
pWindowId_,
        $sel:taskArn:RegisterTaskWithMaintenanceWindow' :: Text
taskArn = Text
pTaskArn_,
        $sel:taskType:RegisterTaskWithMaintenanceWindow' :: MaintenanceWindowTaskType
taskType = MaintenanceWindowTaskType
pTaskType_
      }

-- | The Amazon Resource Name (ARN) of the IAM service role for Amazon Web
-- Services Systems Manager to assume when running a maintenance window
-- task. If you do not specify a service role ARN, Systems Manager uses
-- your account\'s service-linked role. If no service-linked role for
-- Systems Manager exists in your account, it is created when you run
-- @RegisterTaskWithMaintenanceWindow@.
--
-- For more information, see the following topics in the in the /Amazon Web
-- Services Systems Manager User Guide/:
--
-- -   <https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions Using service-linked roles for Systems Manager>
--
-- -   <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role Should I use a service-linked role or a custom service role to run maintenance window tasks?>
registerTaskWithMaintenanceWindow_serviceRoleArn :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe Prelude.Text)
registerTaskWithMaintenanceWindow_serviceRoleArn :: (Maybe Text -> f (Maybe Text))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_serviceRoleArn = (RegisterTaskWithMaintenanceWindow -> Maybe Text)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe Text -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe Text
serviceRoleArn :: Maybe Text
$sel:serviceRoleArn:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
serviceRoleArn} -> Maybe Text
serviceRoleArn) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe Text
a -> RegisterTaskWithMaintenanceWindow
s {$sel:serviceRoleArn:RegisterTaskWithMaintenanceWindow' :: Maybe Text
serviceRoleArn = Maybe Text
a} :: RegisterTaskWithMaintenanceWindow)

-- | The parameters that should be passed to the task when it is run.
--
-- @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.
registerTaskWithMaintenanceWindow_taskParameters :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe (Prelude.HashMap Prelude.Text MaintenanceWindowTaskParameterValueExpression))
registerTaskWithMaintenanceWindow_taskParameters :: (Maybe (HashMap Text MaintenanceWindowTaskParameterValueExpression)
 -> f (Maybe
         (HashMap Text MaintenanceWindowTaskParameterValueExpression)))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_taskParameters = (RegisterTaskWithMaintenanceWindow
 -> Maybe
      (Sensitive
         (HashMap
            Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe
         (Sensitive
            (HashMap
               Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
    -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe
        (Sensitive
           (HashMap
              Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
     (Maybe
        (Sensitive
           (HashMap
              Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
taskParameters :: Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
$sel:taskParameters:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow
-> Maybe
     (Sensitive
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
taskParameters} -> Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
taskParameters) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
a -> RegisterTaskWithMaintenanceWindow
s {$sel:taskParameters:RegisterTaskWithMaintenanceWindow' :: Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
taskParameters = Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
a} :: RegisterTaskWithMaintenanceWindow) ((Maybe
    (Sensitive
       (HashMap
          Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
  -> f (Maybe
          (Sensitive
             (HashMap
                Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))))
 -> RegisterTaskWithMaintenanceWindow
 -> f RegisterTaskWithMaintenanceWindow)
-> ((Maybe
       (HashMap Text MaintenanceWindowTaskParameterValueExpression)
     -> f (Maybe
             (HashMap Text MaintenanceWindowTaskParameterValueExpression)))
    -> Maybe
         (Sensitive
            (HashMap
               Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
    -> f (Maybe
            (Sensitive
               (HashMap
                  Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))))
-> (Maybe
      (HashMap Text MaintenanceWindowTaskParameterValueExpression)
    -> f (Maybe
            (HashMap Text MaintenanceWindowTaskParameterValueExpression)))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
  (HashMap Text MaintenanceWindowTaskParameterValueExpression)
  (HashMap Text MaintenanceWindowTaskParameterValueExpression)
-> Iso
     (Maybe
        (Sensitive
           (HashMap
              Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
     (Maybe
        (Sensitive
           (HashMap
              Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
     (Maybe
        (HashMap Text MaintenanceWindowTaskParameterValueExpression))
     (Maybe
        (HashMap Text MaintenanceWindowTaskParameterValueExpression))
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 (Exchange
  (HashMap Text MaintenanceWindowTaskParameterValueExpression)
  (HashMap Text MaintenanceWindowTaskParameterValueExpression)
  (HashMap
     Text (Sensitive MaintenanceWindowTaskParameterValueExpression))
  (Identity
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
-> Exchange
     (HashMap Text MaintenanceWindowTaskParameterValueExpression)
     (HashMap Text MaintenanceWindowTaskParameterValueExpression)
     (Sensitive
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
     (Identity
        (Sensitive
           (HashMap
              Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange
   (HashMap Text MaintenanceWindowTaskParameterValueExpression)
   (HashMap Text MaintenanceWindowTaskParameterValueExpression)
   (HashMap
      Text (Sensitive MaintenanceWindowTaskParameterValueExpression))
   (Identity
      (HashMap
         Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
 -> Exchange
      (HashMap Text MaintenanceWindowTaskParameterValueExpression)
      (HashMap Text MaintenanceWindowTaskParameterValueExpression)
      (Sensitive
         (HashMap
            Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
      (Identity
         (Sensitive
            (HashMap
               Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))))
-> (Exchange
      (HashMap Text MaintenanceWindowTaskParameterValueExpression)
      (HashMap Text MaintenanceWindowTaskParameterValueExpression)
      (HashMap Text MaintenanceWindowTaskParameterValueExpression)
      (Identity
         (HashMap Text MaintenanceWindowTaskParameterValueExpression))
    -> Exchange
         (HashMap Text MaintenanceWindowTaskParameterValueExpression)
         (HashMap Text MaintenanceWindowTaskParameterValueExpression)
         (HashMap
            Text (Sensitive MaintenanceWindowTaskParameterValueExpression))
         (Identity
            (HashMap
               Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
-> AnIso
     (Sensitive
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
     (Sensitive
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
     (HashMap Text MaintenanceWindowTaskParameterValueExpression)
     (HashMap Text MaintenanceWindowTaskParameterValueExpression)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
  (HashMap Text MaintenanceWindowTaskParameterValueExpression)
  (HashMap Text MaintenanceWindowTaskParameterValueExpression)
  (HashMap Text MaintenanceWindowTaskParameterValueExpression)
  (Identity
     (HashMap Text MaintenanceWindowTaskParameterValueExpression))
-> Exchange
     (HashMap Text MaintenanceWindowTaskParameterValueExpression)
     (HashMap Text MaintenanceWindowTaskParameterValueExpression)
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression))
     (Identity
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The priority of the task in the maintenance window, the lower the number
-- the higher the priority. Tasks in a maintenance window are scheduled in
-- priority order with tasks that have the same priority scheduled in
-- parallel.
registerTaskWithMaintenanceWindow_priority :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe Prelude.Natural)
registerTaskWithMaintenanceWindow_priority :: (Maybe Natural -> f (Maybe Natural))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_priority = (RegisterTaskWithMaintenanceWindow -> Maybe Natural)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe Natural -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe Natural
priority :: Maybe Natural
$sel:priority:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Natural
priority} -> Maybe Natural
priority) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe Natural
a -> RegisterTaskWithMaintenanceWindow
s {$sel:priority:RegisterTaskWithMaintenanceWindow' :: Maybe Natural
priority = Maybe Natural
a} :: RegisterTaskWithMaintenanceWindow)

-- | User-provided idempotency token.
registerTaskWithMaintenanceWindow_clientToken :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe Prelude.Text)
registerTaskWithMaintenanceWindow_clientToken :: (Maybe Text -> f (Maybe Text))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_clientToken = (RegisterTaskWithMaintenanceWindow -> Maybe Text)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe Text -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe Text
a -> RegisterTaskWithMaintenanceWindow
s {$sel:clientToken:RegisterTaskWithMaintenanceWindow' :: Maybe Text
clientToken = Maybe Text
a} :: RegisterTaskWithMaintenanceWindow)

-- | Indicates whether tasks should continue to run after the cutoff time
-- specified in the maintenance windows is reached.
--
-- -   @CONTINUE_TASK@: When the cutoff time is reached, any tasks that are
--     running continue. The default value.
--
-- -   @CANCEL_TASK@:
--
--     -   For Automation, Lambda, Step Functions tasks: When the cutoff
--         time is reached, any task invocations that are already running
--         continue, but no new task invocations are started.
--
--     -   For Run Command tasks: When the cutoff time is reached, the
--         system sends a CancelCommand operation that attempts to cancel
--         the command associated with the task. However, there is no
--         guarantee that the command will be terminated and the underlying
--         process stopped.
--
--     The status for tasks that are not completed is @TIMED_OUT@.
registerTaskWithMaintenanceWindow_cutoffBehavior :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe MaintenanceWindowTaskCutoffBehavior)
registerTaskWithMaintenanceWindow_cutoffBehavior :: (Maybe MaintenanceWindowTaskCutoffBehavior
 -> f (Maybe MaintenanceWindowTaskCutoffBehavior))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_cutoffBehavior = (RegisterTaskWithMaintenanceWindow
 -> Maybe MaintenanceWindowTaskCutoffBehavior)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe MaintenanceWindowTaskCutoffBehavior
    -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe MaintenanceWindowTaskCutoffBehavior)
     (Maybe MaintenanceWindowTaskCutoffBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe MaintenanceWindowTaskCutoffBehavior
cutoffBehavior :: Maybe MaintenanceWindowTaskCutoffBehavior
$sel:cutoffBehavior:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow
-> Maybe MaintenanceWindowTaskCutoffBehavior
cutoffBehavior} -> Maybe MaintenanceWindowTaskCutoffBehavior
cutoffBehavior) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe MaintenanceWindowTaskCutoffBehavior
a -> RegisterTaskWithMaintenanceWindow
s {$sel:cutoffBehavior:RegisterTaskWithMaintenanceWindow' :: Maybe MaintenanceWindowTaskCutoffBehavior
cutoffBehavior = Maybe MaintenanceWindowTaskCutoffBehavior
a} :: RegisterTaskWithMaintenanceWindow)

-- | The maximum number of errors allowed before this task stops being
-- scheduled.
--
-- For maintenance window tasks without a target specified, you can\'t
-- supply a value for this option. Instead, the system inserts a
-- placeholder value of @1@. This value doesn\'t affect the running of your
-- task.
registerTaskWithMaintenanceWindow_maxErrors :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe Prelude.Text)
registerTaskWithMaintenanceWindow_maxErrors :: (Maybe Text -> f (Maybe Text))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_maxErrors = (RegisterTaskWithMaintenanceWindow -> Maybe Text)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe Text -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe Text
maxErrors :: Maybe Text
$sel:maxErrors:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
maxErrors} -> Maybe Text
maxErrors) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe Text
a -> RegisterTaskWithMaintenanceWindow
s {$sel:maxErrors:RegisterTaskWithMaintenanceWindow' :: Maybe Text
maxErrors = Maybe Text
a} :: RegisterTaskWithMaintenanceWindow)

-- | The parameters that the task should use during execution. Populate only
-- the fields that match the task type. All other fields should be empty.
registerTaskWithMaintenanceWindow_taskInvocationParameters :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe MaintenanceWindowTaskInvocationParameters)
registerTaskWithMaintenanceWindow_taskInvocationParameters :: (Maybe MaintenanceWindowTaskInvocationParameters
 -> f (Maybe MaintenanceWindowTaskInvocationParameters))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_taskInvocationParameters = (RegisterTaskWithMaintenanceWindow
 -> Maybe MaintenanceWindowTaskInvocationParameters)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe MaintenanceWindowTaskInvocationParameters
    -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe MaintenanceWindowTaskInvocationParameters)
     (Maybe MaintenanceWindowTaskInvocationParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe MaintenanceWindowTaskInvocationParameters
taskInvocationParameters :: Maybe MaintenanceWindowTaskInvocationParameters
$sel:taskInvocationParameters:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow
-> Maybe MaintenanceWindowTaskInvocationParameters
taskInvocationParameters} -> Maybe MaintenanceWindowTaskInvocationParameters
taskInvocationParameters) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe MaintenanceWindowTaskInvocationParameters
a -> RegisterTaskWithMaintenanceWindow
s {$sel:taskInvocationParameters:RegisterTaskWithMaintenanceWindow' :: Maybe MaintenanceWindowTaskInvocationParameters
taskInvocationParameters = Maybe MaintenanceWindowTaskInvocationParameters
a} :: RegisterTaskWithMaintenanceWindow)

-- | An optional name for the task.
registerTaskWithMaintenanceWindow_name :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe Prelude.Text)
registerTaskWithMaintenanceWindow_name :: (Maybe Text -> f (Maybe Text))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_name = (RegisterTaskWithMaintenanceWindow -> Maybe Text)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe Text -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe Text
name :: Maybe Text
$sel:name:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
name} -> Maybe Text
name) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe Text
a -> RegisterTaskWithMaintenanceWindow
s {$sel:name:RegisterTaskWithMaintenanceWindow' :: Maybe Text
name = Maybe Text
a} :: RegisterTaskWithMaintenanceWindow)

-- | The targets (either instances or maintenance window targets).
--
-- One or more targets must be specified for maintenance window Run
-- Command-type tasks. Depending on the task, targets are optional for
-- other maintenance window task types (Automation, Lambda, and Step
-- Functions). For more information about running tasks that don\'t specify
-- targets, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html Registering maintenance window tasks without targets>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- Specify instances using the following format:
--
-- @Key=InstanceIds,Values=\<instance-id-1>,\<instance-id-2>@
--
-- Specify maintenance window targets using the following format:
--
-- @Key=WindowTargetIds,Values=\<window-target-id-1>,\<window-target-id-2>@
registerTaskWithMaintenanceWindow_targets :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe [Target])
registerTaskWithMaintenanceWindow_targets :: (Maybe [Target] -> f (Maybe [Target]))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_targets = (RegisterTaskWithMaintenanceWindow -> Maybe [Target])
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe [Target] -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe [Target])
     (Maybe [Target])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe [Target]
a -> RegisterTaskWithMaintenanceWindow
s {$sel:targets:RegisterTaskWithMaintenanceWindow' :: Maybe [Target]
targets = Maybe [Target]
a} :: RegisterTaskWithMaintenanceWindow) ((Maybe [Target] -> f (Maybe [Target]))
 -> RegisterTaskWithMaintenanceWindow
 -> f RegisterTaskWithMaintenanceWindow)
-> ((Maybe [Target] -> f (Maybe [Target]))
    -> Maybe [Target] -> f (Maybe [Target]))
-> (Maybe [Target] -> f (Maybe [Target]))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Target] [Target] [Target] [Target]
-> Iso
     (Maybe [Target]) (Maybe [Target]) (Maybe [Target]) (Maybe [Target])
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 [Target] [Target] [Target] [Target]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A structure containing information about an Amazon Simple Storage
-- Service (Amazon S3) bucket to write instance-level logs to.
--
-- @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.
registerTaskWithMaintenanceWindow_loggingInfo :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe LoggingInfo)
registerTaskWithMaintenanceWindow_loggingInfo :: (Maybe LoggingInfo -> f (Maybe LoggingInfo))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_loggingInfo = (RegisterTaskWithMaintenanceWindow -> Maybe LoggingInfo)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe LoggingInfo -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe LoggingInfo)
     (Maybe LoggingInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe LoggingInfo
loggingInfo :: Maybe LoggingInfo
$sel:loggingInfo:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe LoggingInfo
loggingInfo} -> Maybe LoggingInfo
loggingInfo) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe LoggingInfo
a -> RegisterTaskWithMaintenanceWindow
s {$sel:loggingInfo:RegisterTaskWithMaintenanceWindow' :: Maybe LoggingInfo
loggingInfo = Maybe LoggingInfo
a} :: RegisterTaskWithMaintenanceWindow)

-- | An optional description for the task.
registerTaskWithMaintenanceWindow_description :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe Prelude.Text)
registerTaskWithMaintenanceWindow_description :: (Maybe Text -> f (Maybe Text))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_description = (RegisterTaskWithMaintenanceWindow -> Maybe (Sensitive Text))
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe (Sensitive Text) -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe (Sensitive Text)
a -> RegisterTaskWithMaintenanceWindow
s {$sel:description:RegisterTaskWithMaintenanceWindow' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: RegisterTaskWithMaintenanceWindow) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> RegisterTaskWithMaintenanceWindow
 -> f RegisterTaskWithMaintenanceWindow)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The maximum number of targets this task can be run for in parallel.
--
-- For maintenance window tasks without a target specified, you can\'t
-- supply a value for this option. Instead, the system inserts a
-- placeholder value of @1@. This value doesn\'t affect the running of your
-- task.
registerTaskWithMaintenanceWindow_maxConcurrency :: Lens.Lens' RegisterTaskWithMaintenanceWindow (Prelude.Maybe Prelude.Text)
registerTaskWithMaintenanceWindow_maxConcurrency :: (Maybe Text -> f (Maybe Text))
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_maxConcurrency = (RegisterTaskWithMaintenanceWindow -> Maybe Text)
-> (RegisterTaskWithMaintenanceWindow
    -> Maybe Text -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Maybe Text
maxConcurrency :: Maybe Text
$sel:maxConcurrency:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
maxConcurrency} -> Maybe Text
maxConcurrency) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Maybe Text
a -> RegisterTaskWithMaintenanceWindow
s {$sel:maxConcurrency:RegisterTaskWithMaintenanceWindow' :: Maybe Text
maxConcurrency = Maybe Text
a} :: RegisterTaskWithMaintenanceWindow)

-- | The ID of the maintenance window the task should be added to.
registerTaskWithMaintenanceWindow_windowId :: Lens.Lens' RegisterTaskWithMaintenanceWindow Prelude.Text
registerTaskWithMaintenanceWindow_windowId :: (Text -> f Text)
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_windowId = (RegisterTaskWithMaintenanceWindow -> Text)
-> (RegisterTaskWithMaintenanceWindow
    -> Text -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Text
windowId :: Text
$sel:windowId:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Text
windowId} -> Text
windowId) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Text
a -> RegisterTaskWithMaintenanceWindow
s {$sel:windowId:RegisterTaskWithMaintenanceWindow' :: Text
windowId = Text
a} :: RegisterTaskWithMaintenanceWindow)

-- | The ARN of the task to run.
registerTaskWithMaintenanceWindow_taskArn :: Lens.Lens' RegisterTaskWithMaintenanceWindow Prelude.Text
registerTaskWithMaintenanceWindow_taskArn :: (Text -> f Text)
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_taskArn = (RegisterTaskWithMaintenanceWindow -> Text)
-> (RegisterTaskWithMaintenanceWindow
    -> Text -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {Text
taskArn :: Text
$sel:taskArn:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Text
taskArn} -> Text
taskArn) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} Text
a -> RegisterTaskWithMaintenanceWindow
s {$sel:taskArn:RegisterTaskWithMaintenanceWindow' :: Text
taskArn = Text
a} :: RegisterTaskWithMaintenanceWindow)

-- | The type of task being registered.
registerTaskWithMaintenanceWindow_taskType :: Lens.Lens' RegisterTaskWithMaintenanceWindow MaintenanceWindowTaskType
registerTaskWithMaintenanceWindow_taskType :: (MaintenanceWindowTaskType -> f MaintenanceWindowTaskType)
-> RegisterTaskWithMaintenanceWindow
-> f RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow_taskType = (RegisterTaskWithMaintenanceWindow -> MaintenanceWindowTaskType)
-> (RegisterTaskWithMaintenanceWindow
    -> MaintenanceWindowTaskType -> RegisterTaskWithMaintenanceWindow)
-> Lens
     RegisterTaskWithMaintenanceWindow
     RegisterTaskWithMaintenanceWindow
     MaintenanceWindowTaskType
     MaintenanceWindowTaskType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindow' {MaintenanceWindowTaskType
taskType :: MaintenanceWindowTaskType
$sel:taskType:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> MaintenanceWindowTaskType
taskType} -> MaintenanceWindowTaskType
taskType) (\s :: RegisterTaskWithMaintenanceWindow
s@RegisterTaskWithMaintenanceWindow' {} MaintenanceWindowTaskType
a -> RegisterTaskWithMaintenanceWindow
s {$sel:taskType:RegisterTaskWithMaintenanceWindow' :: MaintenanceWindowTaskType
taskType = MaintenanceWindowTaskType
a} :: RegisterTaskWithMaintenanceWindow)

instance
  Core.AWSRequest
    RegisterTaskWithMaintenanceWindow
  where
  type
    AWSResponse RegisterTaskWithMaintenanceWindow =
      RegisterTaskWithMaintenanceWindowResponse
  request :: RegisterTaskWithMaintenanceWindow
-> Request RegisterTaskWithMaintenanceWindow
request = Service
-> RegisterTaskWithMaintenanceWindow
-> Request RegisterTaskWithMaintenanceWindow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy RegisterTaskWithMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse RegisterTaskWithMaintenanceWindow)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse RegisterTaskWithMaintenanceWindow))
-> Logger
-> Service
-> Proxy RegisterTaskWithMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse RegisterTaskWithMaintenanceWindow)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> RegisterTaskWithMaintenanceWindowResponse
RegisterTaskWithMaintenanceWindowResponse'
            (Maybe Text -> Int -> RegisterTaskWithMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RegisterTaskWithMaintenanceWindowResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"WindowTaskId")
              Either String (Int -> RegisterTaskWithMaintenanceWindowResponse)
-> Either String Int
-> Either String RegisterTaskWithMaintenanceWindowResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    RegisterTaskWithMaintenanceWindow

instance
  Prelude.NFData
    RegisterTaskWithMaintenanceWindow

instance
  Core.ToHeaders
    RegisterTaskWithMaintenanceWindow
  where
  toHeaders :: RegisterTaskWithMaintenanceWindow -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> RegisterTaskWithMaintenanceWindow -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonSSM.RegisterTaskWithMaintenanceWindow" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToJSON
    RegisterTaskWithMaintenanceWindow
  where
  toJSON :: RegisterTaskWithMaintenanceWindow -> Value
toJSON RegisterTaskWithMaintenanceWindow' {Maybe Natural
Maybe [Target]
Maybe Text
Maybe (Sensitive Text)
Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
Maybe LoggingInfo
Maybe MaintenanceWindowTaskCutoffBehavior
Maybe MaintenanceWindowTaskInvocationParameters
Text
MaintenanceWindowTaskType
taskType :: MaintenanceWindowTaskType
taskArn :: Text
windowId :: Text
maxConcurrency :: Maybe Text
description :: Maybe (Sensitive Text)
loggingInfo :: Maybe LoggingInfo
targets :: Maybe [Target]
name :: Maybe Text
taskInvocationParameters :: Maybe MaintenanceWindowTaskInvocationParameters
maxErrors :: Maybe Text
cutoffBehavior :: Maybe MaintenanceWindowTaskCutoffBehavior
clientToken :: Maybe Text
priority :: Maybe Natural
taskParameters :: Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
serviceRoleArn :: Maybe Text
$sel:taskType:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> MaintenanceWindowTaskType
$sel:taskArn:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Text
$sel:windowId:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Text
$sel:maxConcurrency:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
$sel:description:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe (Sensitive Text)
$sel:loggingInfo:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe LoggingInfo
$sel:targets:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe [Target]
$sel:name:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
$sel:taskInvocationParameters:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow
-> Maybe MaintenanceWindowTaskInvocationParameters
$sel:maxErrors:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
$sel:cutoffBehavior:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow
-> Maybe MaintenanceWindowTaskCutoffBehavior
$sel:clientToken:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
$sel:priority:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Natural
$sel:taskParameters:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow
-> Maybe
     (Sensitive
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
$sel:serviceRoleArn:RegisterTaskWithMaintenanceWindow' :: RegisterTaskWithMaintenanceWindow -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ServiceRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serviceRoleArn,
            (Text
"TaskParameters" Text
-> Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression))
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive
   (HashMap
      Text (Sensitive MaintenanceWindowTaskParameterValueExpression))
 -> Pair)
-> Maybe
     (Sensitive
        (HashMap
           Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe
  (Sensitive
     (HashMap
        Text (Sensitive MaintenanceWindowTaskParameterValueExpression)))
taskParameters,
            (Text
"Priority" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
priority,
            (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Text
"CutoffBehavior" Text -> MaintenanceWindowTaskCutoffBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MaintenanceWindowTaskCutoffBehavior -> Pair)
-> Maybe MaintenanceWindowTaskCutoffBehavior -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MaintenanceWindowTaskCutoffBehavior
cutoffBehavior,
            (Text
"MaxErrors" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maxErrors,
            (Text
"TaskInvocationParameters" Text -> MaintenanceWindowTaskInvocationParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MaintenanceWindowTaskInvocationParameters -> Pair)
-> Maybe MaintenanceWindowTaskInvocationParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MaintenanceWindowTaskInvocationParameters
taskInvocationParameters,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"Targets" Text -> [Target] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Target] -> Pair) -> Maybe [Target] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Target]
targets,
            (Text
"LoggingInfo" Text -> LoggingInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LoggingInfo -> Pair) -> Maybe LoggingInfo -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LoggingInfo
loggingInfo,
            (Text
"Description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
            (Text
"MaxConcurrency" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maxConcurrency,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WindowId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
windowId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TaskArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TaskType" Text -> MaintenanceWindowTaskType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MaintenanceWindowTaskType
taskType)
          ]
      )

instance
  Core.ToPath
    RegisterTaskWithMaintenanceWindow
  where
  toPath :: RegisterTaskWithMaintenanceWindow -> ByteString
toPath = ByteString -> RegisterTaskWithMaintenanceWindow -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Core.ToQuery
    RegisterTaskWithMaintenanceWindow
  where
  toQuery :: RegisterTaskWithMaintenanceWindow -> QueryString
toQuery = QueryString -> RegisterTaskWithMaintenanceWindow -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newRegisterTaskWithMaintenanceWindowResponse' smart constructor.
data RegisterTaskWithMaintenanceWindowResponse = RegisterTaskWithMaintenanceWindowResponse'
  { -- | The ID of the task in the maintenance window.
    RegisterTaskWithMaintenanceWindowResponse -> Maybe Text
windowTaskId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    RegisterTaskWithMaintenanceWindowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RegisterTaskWithMaintenanceWindowResponse
-> RegisterTaskWithMaintenanceWindowResponse -> Bool
(RegisterTaskWithMaintenanceWindowResponse
 -> RegisterTaskWithMaintenanceWindowResponse -> Bool)
-> (RegisterTaskWithMaintenanceWindowResponse
    -> RegisterTaskWithMaintenanceWindowResponse -> Bool)
-> Eq RegisterTaskWithMaintenanceWindowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterTaskWithMaintenanceWindowResponse
-> RegisterTaskWithMaintenanceWindowResponse -> Bool
$c/= :: RegisterTaskWithMaintenanceWindowResponse
-> RegisterTaskWithMaintenanceWindowResponse -> Bool
== :: RegisterTaskWithMaintenanceWindowResponse
-> RegisterTaskWithMaintenanceWindowResponse -> Bool
$c== :: RegisterTaskWithMaintenanceWindowResponse
-> RegisterTaskWithMaintenanceWindowResponse -> Bool
Prelude.Eq, ReadPrec [RegisterTaskWithMaintenanceWindowResponse]
ReadPrec RegisterTaskWithMaintenanceWindowResponse
Int -> ReadS RegisterTaskWithMaintenanceWindowResponse
ReadS [RegisterTaskWithMaintenanceWindowResponse]
(Int -> ReadS RegisterTaskWithMaintenanceWindowResponse)
-> ReadS [RegisterTaskWithMaintenanceWindowResponse]
-> ReadPrec RegisterTaskWithMaintenanceWindowResponse
-> ReadPrec [RegisterTaskWithMaintenanceWindowResponse]
-> Read RegisterTaskWithMaintenanceWindowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterTaskWithMaintenanceWindowResponse]
$creadListPrec :: ReadPrec [RegisterTaskWithMaintenanceWindowResponse]
readPrec :: ReadPrec RegisterTaskWithMaintenanceWindowResponse
$creadPrec :: ReadPrec RegisterTaskWithMaintenanceWindowResponse
readList :: ReadS [RegisterTaskWithMaintenanceWindowResponse]
$creadList :: ReadS [RegisterTaskWithMaintenanceWindowResponse]
readsPrec :: Int -> ReadS RegisterTaskWithMaintenanceWindowResponse
$creadsPrec :: Int -> ReadS RegisterTaskWithMaintenanceWindowResponse
Prelude.Read, Int -> RegisterTaskWithMaintenanceWindowResponse -> ShowS
[RegisterTaskWithMaintenanceWindowResponse] -> ShowS
RegisterTaskWithMaintenanceWindowResponse -> String
(Int -> RegisterTaskWithMaintenanceWindowResponse -> ShowS)
-> (RegisterTaskWithMaintenanceWindowResponse -> String)
-> ([RegisterTaskWithMaintenanceWindowResponse] -> ShowS)
-> Show RegisterTaskWithMaintenanceWindowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterTaskWithMaintenanceWindowResponse] -> ShowS
$cshowList :: [RegisterTaskWithMaintenanceWindowResponse] -> ShowS
show :: RegisterTaskWithMaintenanceWindowResponse -> String
$cshow :: RegisterTaskWithMaintenanceWindowResponse -> String
showsPrec :: Int -> RegisterTaskWithMaintenanceWindowResponse -> ShowS
$cshowsPrec :: Int -> RegisterTaskWithMaintenanceWindowResponse -> ShowS
Prelude.Show, (forall x.
 RegisterTaskWithMaintenanceWindowResponse
 -> Rep RegisterTaskWithMaintenanceWindowResponse x)
-> (forall x.
    Rep RegisterTaskWithMaintenanceWindowResponse x
    -> RegisterTaskWithMaintenanceWindowResponse)
-> Generic RegisterTaskWithMaintenanceWindowResponse
forall x.
Rep RegisterTaskWithMaintenanceWindowResponse x
-> RegisterTaskWithMaintenanceWindowResponse
forall x.
RegisterTaskWithMaintenanceWindowResponse
-> Rep RegisterTaskWithMaintenanceWindowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterTaskWithMaintenanceWindowResponse x
-> RegisterTaskWithMaintenanceWindowResponse
$cfrom :: forall x.
RegisterTaskWithMaintenanceWindowResponse
-> Rep RegisterTaskWithMaintenanceWindowResponse x
Prelude.Generic)

-- |
-- Create a value of 'RegisterTaskWithMaintenanceWindowResponse' 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:
--
-- 'windowTaskId', 'registerTaskWithMaintenanceWindowResponse_windowTaskId' - The ID of the task in the maintenance window.
--
-- 'httpStatus', 'registerTaskWithMaintenanceWindowResponse_httpStatus' - The response's http status code.
newRegisterTaskWithMaintenanceWindowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RegisterTaskWithMaintenanceWindowResponse
newRegisterTaskWithMaintenanceWindowResponse :: Int -> RegisterTaskWithMaintenanceWindowResponse
newRegisterTaskWithMaintenanceWindowResponse
  Int
pHttpStatus_ =
    RegisterTaskWithMaintenanceWindowResponse' :: Maybe Text -> Int -> RegisterTaskWithMaintenanceWindowResponse
RegisterTaskWithMaintenanceWindowResponse'
      { $sel:windowTaskId:RegisterTaskWithMaintenanceWindowResponse' :: Maybe Text
windowTaskId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:RegisterTaskWithMaintenanceWindowResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The ID of the task in the maintenance window.
registerTaskWithMaintenanceWindowResponse_windowTaskId :: Lens.Lens' RegisterTaskWithMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
registerTaskWithMaintenanceWindowResponse_windowTaskId :: (Maybe Text -> f (Maybe Text))
-> RegisterTaskWithMaintenanceWindowResponse
-> f RegisterTaskWithMaintenanceWindowResponse
registerTaskWithMaintenanceWindowResponse_windowTaskId = (RegisterTaskWithMaintenanceWindowResponse -> Maybe Text)
-> (RegisterTaskWithMaintenanceWindowResponse
    -> Maybe Text -> RegisterTaskWithMaintenanceWindowResponse)
-> Lens
     RegisterTaskWithMaintenanceWindowResponse
     RegisterTaskWithMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindowResponse' {Maybe Text
windowTaskId :: Maybe Text
$sel:windowTaskId:RegisterTaskWithMaintenanceWindowResponse' :: RegisterTaskWithMaintenanceWindowResponse -> Maybe Text
windowTaskId} -> Maybe Text
windowTaskId) (\s :: RegisterTaskWithMaintenanceWindowResponse
s@RegisterTaskWithMaintenanceWindowResponse' {} Maybe Text
a -> RegisterTaskWithMaintenanceWindowResponse
s {$sel:windowTaskId:RegisterTaskWithMaintenanceWindowResponse' :: Maybe Text
windowTaskId = Maybe Text
a} :: RegisterTaskWithMaintenanceWindowResponse)

-- | The response's http status code.
registerTaskWithMaintenanceWindowResponse_httpStatus :: Lens.Lens' RegisterTaskWithMaintenanceWindowResponse Prelude.Int
registerTaskWithMaintenanceWindowResponse_httpStatus :: (Int -> f Int)
-> RegisterTaskWithMaintenanceWindowResponse
-> f RegisterTaskWithMaintenanceWindowResponse
registerTaskWithMaintenanceWindowResponse_httpStatus = (RegisterTaskWithMaintenanceWindowResponse -> Int)
-> (RegisterTaskWithMaintenanceWindowResponse
    -> Int -> RegisterTaskWithMaintenanceWindowResponse)
-> Lens
     RegisterTaskWithMaintenanceWindowResponse
     RegisterTaskWithMaintenanceWindowResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTaskWithMaintenanceWindowResponse' {Int
httpStatus :: Int
$sel:httpStatus:RegisterTaskWithMaintenanceWindowResponse' :: RegisterTaskWithMaintenanceWindowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RegisterTaskWithMaintenanceWindowResponse
s@RegisterTaskWithMaintenanceWindowResponse' {} Int
a -> RegisterTaskWithMaintenanceWindowResponse
s {$sel:httpStatus:RegisterTaskWithMaintenanceWindowResponse' :: Int
httpStatus = Int
a} :: RegisterTaskWithMaintenanceWindowResponse)

instance
  Prelude.NFData
    RegisterTaskWithMaintenanceWindowResponse