{-# 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.UpdateMaintenanceWindow
-- 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)
--
-- Updates an existing maintenance window. Only specified parameters are
-- modified.
--
-- The value you specify for @Duration@ determines the specific end time
-- for the maintenance window based on the time it begins. No maintenance
-- window tasks are permitted to start after the resulting endtime minus
-- the number of hours you specify for @Cutoff@. For example, if the
-- maintenance window starts at 3 PM, the duration is three hours, and the
-- value you specify for @Cutoff@ is one hour, no maintenance window tasks
-- can start after 5 PM.
module Amazonka.SSM.UpdateMaintenanceWindow
  ( -- * Creating a Request
    UpdateMaintenanceWindow (..),
    newUpdateMaintenanceWindow,

    -- * Request Lenses
    updateMaintenanceWindow_replace,
    updateMaintenanceWindow_enabled,
    updateMaintenanceWindow_schedule,
    updateMaintenanceWindow_scheduleOffset,
    updateMaintenanceWindow_endDate,
    updateMaintenanceWindow_scheduleTimezone,
    updateMaintenanceWindow_startDate,
    updateMaintenanceWindow_name,
    updateMaintenanceWindow_cutoff,
    updateMaintenanceWindow_allowUnassociatedTargets,
    updateMaintenanceWindow_description,
    updateMaintenanceWindow_duration,
    updateMaintenanceWindow_windowId,

    -- * Destructuring the Response
    UpdateMaintenanceWindowResponse (..),
    newUpdateMaintenanceWindowResponse,

    -- * Response Lenses
    updateMaintenanceWindowResponse_enabled,
    updateMaintenanceWindowResponse_schedule,
    updateMaintenanceWindowResponse_scheduleOffset,
    updateMaintenanceWindowResponse_endDate,
    updateMaintenanceWindowResponse_scheduleTimezone,
    updateMaintenanceWindowResponse_startDate,
    updateMaintenanceWindowResponse_name,
    updateMaintenanceWindowResponse_cutoff,
    updateMaintenanceWindowResponse_allowUnassociatedTargets,
    updateMaintenanceWindowResponse_description,
    updateMaintenanceWindowResponse_duration,
    updateMaintenanceWindowResponse_windowId,
    updateMaintenanceWindowResponse_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:/ 'newUpdateMaintenanceWindow' smart constructor.
data UpdateMaintenanceWindow = UpdateMaintenanceWindow'
  { -- | If @True@, then all fields that are required by the
    -- CreateMaintenanceWindow operation are also required for this API
    -- request. Optional fields that aren\'t specified are set to null.
    UpdateMaintenanceWindow -> Maybe Bool
replace :: Prelude.Maybe Prelude.Bool,
    -- | Whether the maintenance window is enabled.
    UpdateMaintenanceWindow -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The schedule of the maintenance window in the form of a cron or rate
    -- expression.
    UpdateMaintenanceWindow -> Maybe Text
schedule :: Prelude.Maybe Prelude.Text,
    -- | The number of days to wait after the date and time specified by a cron
    -- expression before running the maintenance window.
    --
    -- For example, the following cron expression schedules a maintenance
    -- window to run the third Tuesday of every month at 11:30 PM.
    --
    -- @cron(30 23 ? * TUE#3 *)@
    --
    -- If the schedule offset is @2@, the maintenance window won\'t run until
    -- two days later.
    UpdateMaintenanceWindow -> Maybe Natural
scheduleOffset :: Prelude.Maybe Prelude.Natural,
    -- | The date and time, in ISO-8601 Extended format, for when you want the
    -- maintenance window to become inactive. @EndDate@ allows you to set a
    -- date and time in the future when the maintenance window will no longer
    -- run.
    UpdateMaintenanceWindow -> Maybe Text
endDate :: Prelude.Maybe Prelude.Text,
    -- | The time zone that the scheduled maintenance window executions are based
    -- on, in Internet Assigned Numbers Authority (IANA) format. For example:
    -- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
    -- information, see the
    -- <https://www.iana.org/time-zones Time Zone Database> on the IANA
    -- website.
    UpdateMaintenanceWindow -> Maybe Text
scheduleTimezone :: Prelude.Maybe Prelude.Text,
    -- | The time zone that the scheduled maintenance window executions are based
    -- on, in Internet Assigned Numbers Authority (IANA) format. For example:
    -- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
    -- information, see the
    -- <https://www.iana.org/time-zones Time Zone Database> on the IANA
    -- website.
    UpdateMaintenanceWindow -> Maybe Text
startDate :: Prelude.Maybe Prelude.Text,
    -- | The name of the maintenance window.
    UpdateMaintenanceWindow -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The number of hours before the end of the maintenance window that Amazon
    -- Web Services Systems Manager stops scheduling new tasks for execution.
    UpdateMaintenanceWindow -> Maybe Natural
cutoff :: Prelude.Maybe Prelude.Natural,
    -- | Whether targets must be registered with the maintenance window before
    -- tasks can be defined for those targets.
    UpdateMaintenanceWindow -> Maybe Bool
allowUnassociatedTargets :: Prelude.Maybe Prelude.Bool,
    -- | An optional description for the update request.
    UpdateMaintenanceWindow -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The duration of the maintenance window in hours.
    UpdateMaintenanceWindow -> Maybe Natural
duration :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the maintenance window to update.
    UpdateMaintenanceWindow -> Text
windowId :: Prelude.Text
  }
  deriving (UpdateMaintenanceWindow -> UpdateMaintenanceWindow -> Bool
(UpdateMaintenanceWindow -> UpdateMaintenanceWindow -> Bool)
-> (UpdateMaintenanceWindow -> UpdateMaintenanceWindow -> Bool)
-> Eq UpdateMaintenanceWindow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMaintenanceWindow -> UpdateMaintenanceWindow -> Bool
$c/= :: UpdateMaintenanceWindow -> UpdateMaintenanceWindow -> Bool
== :: UpdateMaintenanceWindow -> UpdateMaintenanceWindow -> Bool
$c== :: UpdateMaintenanceWindow -> UpdateMaintenanceWindow -> Bool
Prelude.Eq, Int -> UpdateMaintenanceWindow -> ShowS
[UpdateMaintenanceWindow] -> ShowS
UpdateMaintenanceWindow -> String
(Int -> UpdateMaintenanceWindow -> ShowS)
-> (UpdateMaintenanceWindow -> String)
-> ([UpdateMaintenanceWindow] -> ShowS)
-> Show UpdateMaintenanceWindow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMaintenanceWindow] -> ShowS
$cshowList :: [UpdateMaintenanceWindow] -> ShowS
show :: UpdateMaintenanceWindow -> String
$cshow :: UpdateMaintenanceWindow -> String
showsPrec :: Int -> UpdateMaintenanceWindow -> ShowS
$cshowsPrec :: Int -> UpdateMaintenanceWindow -> ShowS
Prelude.Show, (forall x.
 UpdateMaintenanceWindow -> Rep UpdateMaintenanceWindow x)
-> (forall x.
    Rep UpdateMaintenanceWindow x -> UpdateMaintenanceWindow)
-> Generic UpdateMaintenanceWindow
forall x. Rep UpdateMaintenanceWindow x -> UpdateMaintenanceWindow
forall x. UpdateMaintenanceWindow -> Rep UpdateMaintenanceWindow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMaintenanceWindow x -> UpdateMaintenanceWindow
$cfrom :: forall x. UpdateMaintenanceWindow -> Rep UpdateMaintenanceWindow x
Prelude.Generic)

-- |
-- Create a value of 'UpdateMaintenanceWindow' 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:
--
-- 'replace', 'updateMaintenanceWindow_replace' - If @True@, then all fields that are required by the
-- CreateMaintenanceWindow operation are also required for this API
-- request. Optional fields that aren\'t specified are set to null.
--
-- 'enabled', 'updateMaintenanceWindow_enabled' - Whether the maintenance window is enabled.
--
-- 'schedule', 'updateMaintenanceWindow_schedule' - The schedule of the maintenance window in the form of a cron or rate
-- expression.
--
-- 'scheduleOffset', 'updateMaintenanceWindow_scheduleOffset' - The number of days to wait after the date and time specified by a cron
-- expression before running the maintenance window.
--
-- For example, the following cron expression schedules a maintenance
-- window to run the third Tuesday of every month at 11:30 PM.
--
-- @cron(30 23 ? * TUE#3 *)@
--
-- If the schedule offset is @2@, the maintenance window won\'t run until
-- two days later.
--
-- 'endDate', 'updateMaintenanceWindow_endDate' - The date and time, in ISO-8601 Extended format, for when you want the
-- maintenance window to become inactive. @EndDate@ allows you to set a
-- date and time in the future when the maintenance window will no longer
-- run.
--
-- 'scheduleTimezone', 'updateMaintenanceWindow_scheduleTimezone' - The time zone that the scheduled maintenance window executions are based
-- on, in Internet Assigned Numbers Authority (IANA) format. For example:
-- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
-- information, see the
-- <https://www.iana.org/time-zones Time Zone Database> on the IANA
-- website.
--
-- 'startDate', 'updateMaintenanceWindow_startDate' - The time zone that the scheduled maintenance window executions are based
-- on, in Internet Assigned Numbers Authority (IANA) format. For example:
-- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
-- information, see the
-- <https://www.iana.org/time-zones Time Zone Database> on the IANA
-- website.
--
-- 'name', 'updateMaintenanceWindow_name' - The name of the maintenance window.
--
-- 'cutoff', 'updateMaintenanceWindow_cutoff' - The number of hours before the end of the maintenance window that Amazon
-- Web Services Systems Manager stops scheduling new tasks for execution.
--
-- 'allowUnassociatedTargets', 'updateMaintenanceWindow_allowUnassociatedTargets' - Whether targets must be registered with the maintenance window before
-- tasks can be defined for those targets.
--
-- 'description', 'updateMaintenanceWindow_description' - An optional description for the update request.
--
-- 'duration', 'updateMaintenanceWindow_duration' - The duration of the maintenance window in hours.
--
-- 'windowId', 'updateMaintenanceWindow_windowId' - The ID of the maintenance window to update.
newUpdateMaintenanceWindow ::
  -- | 'windowId'
  Prelude.Text ->
  UpdateMaintenanceWindow
newUpdateMaintenanceWindow :: Text -> UpdateMaintenanceWindow
newUpdateMaintenanceWindow Text
pWindowId_ =
  UpdateMaintenanceWindow' :: Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Natural
-> Text
-> UpdateMaintenanceWindow
UpdateMaintenanceWindow'
    { $sel:replace:UpdateMaintenanceWindow' :: Maybe Bool
replace = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:UpdateMaintenanceWindow' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:schedule:UpdateMaintenanceWindow' :: Maybe Text
schedule = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleOffset:UpdateMaintenanceWindow' :: Maybe Natural
scheduleOffset = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:endDate:UpdateMaintenanceWindow' :: Maybe Text
endDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleTimezone:UpdateMaintenanceWindow' :: Maybe Text
scheduleTimezone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:UpdateMaintenanceWindow' :: Maybe Text
startDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateMaintenanceWindow' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cutoff:UpdateMaintenanceWindow' :: Maybe Natural
cutoff = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:allowUnassociatedTargets:UpdateMaintenanceWindow' :: Maybe Bool
allowUnassociatedTargets = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateMaintenanceWindow' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:UpdateMaintenanceWindow' :: Maybe Natural
duration = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:windowId:UpdateMaintenanceWindow' :: Text
windowId = Text
pWindowId_
    }

-- | If @True@, then all fields that are required by the
-- CreateMaintenanceWindow operation are also required for this API
-- request. Optional fields that aren\'t specified are set to null.
updateMaintenanceWindow_replace :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Bool)
updateMaintenanceWindow_replace :: (Maybe Bool -> f (Maybe Bool))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_replace = (UpdateMaintenanceWindow -> Maybe Bool)
-> (UpdateMaintenanceWindow
    -> Maybe Bool -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Bool
replace :: Maybe Bool
$sel:replace:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Bool
replace} -> Maybe Bool
replace) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Bool
a -> UpdateMaintenanceWindow
s {$sel:replace:UpdateMaintenanceWindow' :: Maybe Bool
replace = Maybe Bool
a} :: UpdateMaintenanceWindow)

-- | Whether the maintenance window is enabled.
updateMaintenanceWindow_enabled :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Bool)
updateMaintenanceWindow_enabled :: (Maybe Bool -> f (Maybe Bool))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_enabled = (UpdateMaintenanceWindow -> Maybe Bool)
-> (UpdateMaintenanceWindow
    -> Maybe Bool -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Bool
a -> UpdateMaintenanceWindow
s {$sel:enabled:UpdateMaintenanceWindow' :: Maybe Bool
enabled = Maybe Bool
a} :: UpdateMaintenanceWindow)

-- | The schedule of the maintenance window in the form of a cron or rate
-- expression.
updateMaintenanceWindow_schedule :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Text)
updateMaintenanceWindow_schedule :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_schedule = (UpdateMaintenanceWindow -> Maybe Text)
-> (UpdateMaintenanceWindow
    -> Maybe Text -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Text
schedule :: Maybe Text
$sel:schedule:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
schedule} -> Maybe Text
schedule) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Text
a -> UpdateMaintenanceWindow
s {$sel:schedule:UpdateMaintenanceWindow' :: Maybe Text
schedule = Maybe Text
a} :: UpdateMaintenanceWindow)

-- | The number of days to wait after the date and time specified by a cron
-- expression before running the maintenance window.
--
-- For example, the following cron expression schedules a maintenance
-- window to run the third Tuesday of every month at 11:30 PM.
--
-- @cron(30 23 ? * TUE#3 *)@
--
-- If the schedule offset is @2@, the maintenance window won\'t run until
-- two days later.
updateMaintenanceWindow_scheduleOffset :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Natural)
updateMaintenanceWindow_scheduleOffset :: (Maybe Natural -> f (Maybe Natural))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_scheduleOffset = (UpdateMaintenanceWindow -> Maybe Natural)
-> (UpdateMaintenanceWindow
    -> Maybe Natural -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Natural
scheduleOffset :: Maybe Natural
$sel:scheduleOffset:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Natural
scheduleOffset} -> Maybe Natural
scheduleOffset) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Natural
a -> UpdateMaintenanceWindow
s {$sel:scheduleOffset:UpdateMaintenanceWindow' :: Maybe Natural
scheduleOffset = Maybe Natural
a} :: UpdateMaintenanceWindow)

-- | The date and time, in ISO-8601 Extended format, for when you want the
-- maintenance window to become inactive. @EndDate@ allows you to set a
-- date and time in the future when the maintenance window will no longer
-- run.
updateMaintenanceWindow_endDate :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Text)
updateMaintenanceWindow_endDate :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_endDate = (UpdateMaintenanceWindow -> Maybe Text)
-> (UpdateMaintenanceWindow
    -> Maybe Text -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Text
endDate :: Maybe Text
$sel:endDate:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
endDate} -> Maybe Text
endDate) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Text
a -> UpdateMaintenanceWindow
s {$sel:endDate:UpdateMaintenanceWindow' :: Maybe Text
endDate = Maybe Text
a} :: UpdateMaintenanceWindow)

-- | The time zone that the scheduled maintenance window executions are based
-- on, in Internet Assigned Numbers Authority (IANA) format. For example:
-- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
-- information, see the
-- <https://www.iana.org/time-zones Time Zone Database> on the IANA
-- website.
updateMaintenanceWindow_scheduleTimezone :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Text)
updateMaintenanceWindow_scheduleTimezone :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_scheduleTimezone = (UpdateMaintenanceWindow -> Maybe Text)
-> (UpdateMaintenanceWindow
    -> Maybe Text -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Text
scheduleTimezone :: Maybe Text
$sel:scheduleTimezone:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
scheduleTimezone} -> Maybe Text
scheduleTimezone) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Text
a -> UpdateMaintenanceWindow
s {$sel:scheduleTimezone:UpdateMaintenanceWindow' :: Maybe Text
scheduleTimezone = Maybe Text
a} :: UpdateMaintenanceWindow)

-- | The time zone that the scheduled maintenance window executions are based
-- on, in Internet Assigned Numbers Authority (IANA) format. For example:
-- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
-- information, see the
-- <https://www.iana.org/time-zones Time Zone Database> on the IANA
-- website.
updateMaintenanceWindow_startDate :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Text)
updateMaintenanceWindow_startDate :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_startDate = (UpdateMaintenanceWindow -> Maybe Text)
-> (UpdateMaintenanceWindow
    -> Maybe Text -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Text
startDate :: Maybe Text
$sel:startDate:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
startDate} -> Maybe Text
startDate) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Text
a -> UpdateMaintenanceWindow
s {$sel:startDate:UpdateMaintenanceWindow' :: Maybe Text
startDate = Maybe Text
a} :: UpdateMaintenanceWindow)

-- | The name of the maintenance window.
updateMaintenanceWindow_name :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Text)
updateMaintenanceWindow_name :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_name = (UpdateMaintenanceWindow -> Maybe Text)
-> (UpdateMaintenanceWindow
    -> Maybe Text -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Text
name :: Maybe Text
$sel:name:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Text
a -> UpdateMaintenanceWindow
s {$sel:name:UpdateMaintenanceWindow' :: Maybe Text
name = Maybe Text
a} :: UpdateMaintenanceWindow)

-- | The number of hours before the end of the maintenance window that Amazon
-- Web Services Systems Manager stops scheduling new tasks for execution.
updateMaintenanceWindow_cutoff :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Natural)
updateMaintenanceWindow_cutoff :: (Maybe Natural -> f (Maybe Natural))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_cutoff = (UpdateMaintenanceWindow -> Maybe Natural)
-> (UpdateMaintenanceWindow
    -> Maybe Natural -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Natural
cutoff :: Maybe Natural
$sel:cutoff:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Natural
cutoff} -> Maybe Natural
cutoff) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Natural
a -> UpdateMaintenanceWindow
s {$sel:cutoff:UpdateMaintenanceWindow' :: Maybe Natural
cutoff = Maybe Natural
a} :: UpdateMaintenanceWindow)

-- | Whether targets must be registered with the maintenance window before
-- tasks can be defined for those targets.
updateMaintenanceWindow_allowUnassociatedTargets :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Bool)
updateMaintenanceWindow_allowUnassociatedTargets :: (Maybe Bool -> f (Maybe Bool))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_allowUnassociatedTargets = (UpdateMaintenanceWindow -> Maybe Bool)
-> (UpdateMaintenanceWindow
    -> Maybe Bool -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Bool
allowUnassociatedTargets :: Maybe Bool
$sel:allowUnassociatedTargets:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Bool
allowUnassociatedTargets} -> Maybe Bool
allowUnassociatedTargets) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Bool
a -> UpdateMaintenanceWindow
s {$sel:allowUnassociatedTargets:UpdateMaintenanceWindow' :: Maybe Bool
allowUnassociatedTargets = Maybe Bool
a} :: UpdateMaintenanceWindow)

-- | An optional description for the update request.
updateMaintenanceWindow_description :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Text)
updateMaintenanceWindow_description :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_description = (UpdateMaintenanceWindow -> Maybe (Sensitive Text))
-> (UpdateMaintenanceWindow
    -> Maybe (Sensitive Text) -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe (Sensitive Text)
a -> UpdateMaintenanceWindow
s {$sel:description:UpdateMaintenanceWindow' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateMaintenanceWindow) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindow
-> f UpdateMaintenanceWindow
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 duration of the maintenance window in hours.
updateMaintenanceWindow_duration :: Lens.Lens' UpdateMaintenanceWindow (Prelude.Maybe Prelude.Natural)
updateMaintenanceWindow_duration :: (Maybe Natural -> f (Maybe Natural))
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_duration = (UpdateMaintenanceWindow -> Maybe Natural)
-> (UpdateMaintenanceWindow
    -> Maybe Natural -> UpdateMaintenanceWindow)
-> Lens
     UpdateMaintenanceWindow
     UpdateMaintenanceWindow
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Maybe Natural
duration :: Maybe Natural
$sel:duration:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Natural
duration} -> Maybe Natural
duration) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Maybe Natural
a -> UpdateMaintenanceWindow
s {$sel:duration:UpdateMaintenanceWindow' :: Maybe Natural
duration = Maybe Natural
a} :: UpdateMaintenanceWindow)

-- | The ID of the maintenance window to update.
updateMaintenanceWindow_windowId :: Lens.Lens' UpdateMaintenanceWindow Prelude.Text
updateMaintenanceWindow_windowId :: (Text -> f Text)
-> UpdateMaintenanceWindow -> f UpdateMaintenanceWindow
updateMaintenanceWindow_windowId = (UpdateMaintenanceWindow -> Text)
-> (UpdateMaintenanceWindow -> Text -> UpdateMaintenanceWindow)
-> Lens UpdateMaintenanceWindow UpdateMaintenanceWindow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindow' {Text
windowId :: Text
$sel:windowId:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Text
windowId} -> Text
windowId) (\s :: UpdateMaintenanceWindow
s@UpdateMaintenanceWindow' {} Text
a -> UpdateMaintenanceWindow
s {$sel:windowId:UpdateMaintenanceWindow' :: Text
windowId = Text
a} :: UpdateMaintenanceWindow)

instance Core.AWSRequest UpdateMaintenanceWindow where
  type
    AWSResponse UpdateMaintenanceWindow =
      UpdateMaintenanceWindowResponse
  request :: UpdateMaintenanceWindow -> Request UpdateMaintenanceWindow
request = Service
-> UpdateMaintenanceWindow -> Request UpdateMaintenanceWindow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateMaintenanceWindow)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateMaintenanceWindow))
-> Logger
-> Service
-> Proxy UpdateMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateMaintenanceWindow)))
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 Bool
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Text
-> Int
-> UpdateMaintenanceWindowResponse
UpdateMaintenanceWindowResponse'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Bool
 -> Maybe (Sensitive Text)
 -> Maybe Natural
 -> Maybe Text
 -> Int
 -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Enabled")
            Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Schedule")
            Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ScheduleOffset")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => 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
"EndDate")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => 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
"ScheduleTimezone")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => 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
"StartDate")
            Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Name")
            Either
  String
  (Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Cutoff")
            Either
  String
  (Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AllowUnassociatedTargets")
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe Natural
      -> Maybe Text -> Int -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
            Either
  String
  (Maybe Natural
   -> Maybe Text -> Int -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Natural)
-> Either
     String (Maybe Text -> Int -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Duration")
            Either
  String (Maybe Text -> Int -> UpdateMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => 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
"WindowId")
            Either String (Int -> UpdateMaintenanceWindowResponse)
-> Either String Int
-> Either String UpdateMaintenanceWindowResponse
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 UpdateMaintenanceWindow

instance Prelude.NFData UpdateMaintenanceWindow

instance Core.ToHeaders UpdateMaintenanceWindow where
  toHeaders :: UpdateMaintenanceWindow -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateMaintenanceWindow -> 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.UpdateMaintenanceWindow" ::
                          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 UpdateMaintenanceWindow where
  toJSON :: UpdateMaintenanceWindow -> Value
toJSON UpdateMaintenanceWindow' {Maybe Bool
Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
windowId :: Text
duration :: Maybe Natural
description :: Maybe (Sensitive Text)
allowUnassociatedTargets :: Maybe Bool
cutoff :: Maybe Natural
name :: Maybe Text
startDate :: Maybe Text
scheduleTimezone :: Maybe Text
endDate :: Maybe Text
scheduleOffset :: Maybe Natural
schedule :: Maybe Text
enabled :: Maybe Bool
replace :: Maybe Bool
$sel:windowId:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Text
$sel:duration:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Natural
$sel:description:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe (Sensitive Text)
$sel:allowUnassociatedTargets:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Bool
$sel:cutoff:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Natural
$sel:name:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
$sel:startDate:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
$sel:scheduleTimezone:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
$sel:endDate:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
$sel:scheduleOffset:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Natural
$sel:schedule:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Text
$sel:enabled:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Bool
$sel:replace:UpdateMaintenanceWindow' :: UpdateMaintenanceWindow -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Replace" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
replace,
            (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled,
            (Text
"Schedule" 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
schedule,
            (Text
"ScheduleOffset" 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
scheduleOffset,
            (Text
"EndDate" 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
endDate,
            (Text
"ScheduleTimezone" 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
scheduleTimezone,
            (Text
"StartDate" 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
startDate,
            (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
"Cutoff" 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
cutoff,
            (Text
"AllowUnassociatedTargets" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
allowUnassociatedTargets,
            (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
"Duration" 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
duration,
            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)
          ]
      )

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

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

-- | /See:/ 'newUpdateMaintenanceWindowResponse' smart constructor.
data UpdateMaintenanceWindowResponse = UpdateMaintenanceWindowResponse'
  { -- | Whether the maintenance window is enabled.
    UpdateMaintenanceWindowResponse -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The schedule of the maintenance window in the form of a cron or rate
    -- expression.
    UpdateMaintenanceWindowResponse -> Maybe Text
schedule :: Prelude.Maybe Prelude.Text,
    -- | The number of days to wait to run a maintenance window after the
    -- scheduled cron expression date and time.
    UpdateMaintenanceWindowResponse -> Maybe Natural
scheduleOffset :: Prelude.Maybe Prelude.Natural,
    -- | The date and time, in ISO-8601 Extended format, for when the maintenance
    -- window is scheduled to become inactive. The maintenance window won\'t
    -- run after this specified time.
    UpdateMaintenanceWindowResponse -> Maybe Text
endDate :: Prelude.Maybe Prelude.Text,
    -- | The time zone that the scheduled maintenance window executions are based
    -- on, in Internet Assigned Numbers Authority (IANA) format. For example:
    -- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
    -- information, see the
    -- <https://www.iana.org/time-zones Time Zone Database> on the IANA
    -- website.
    UpdateMaintenanceWindowResponse -> Maybe Text
scheduleTimezone :: Prelude.Maybe Prelude.Text,
    -- | The date and time, in ISO-8601 Extended format, for when the maintenance
    -- window is scheduled to become active. The maintenance window won\'t run
    -- before this specified time.
    UpdateMaintenanceWindowResponse -> Maybe Text
startDate :: Prelude.Maybe Prelude.Text,
    -- | The name of the maintenance window.
    UpdateMaintenanceWindowResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The number of hours before the end of the maintenance window that Amazon
    -- Web Services Systems Manager stops scheduling new tasks for execution.
    UpdateMaintenanceWindowResponse -> Maybe Natural
cutoff :: Prelude.Maybe Prelude.Natural,
    -- | Whether targets must be registered with the maintenance window before
    -- tasks can be defined for those targets.
    UpdateMaintenanceWindowResponse -> Maybe Bool
allowUnassociatedTargets :: Prelude.Maybe Prelude.Bool,
    -- | An optional description of the update.
    UpdateMaintenanceWindowResponse -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The duration of the maintenance window in hours.
    UpdateMaintenanceWindowResponse -> Maybe Natural
duration :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the created maintenance window.
    UpdateMaintenanceWindowResponse -> Maybe Text
windowId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateMaintenanceWindowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateMaintenanceWindowResponse
-> UpdateMaintenanceWindowResponse -> Bool
(UpdateMaintenanceWindowResponse
 -> UpdateMaintenanceWindowResponse -> Bool)
-> (UpdateMaintenanceWindowResponse
    -> UpdateMaintenanceWindowResponse -> Bool)
-> Eq UpdateMaintenanceWindowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMaintenanceWindowResponse
-> UpdateMaintenanceWindowResponse -> Bool
$c/= :: UpdateMaintenanceWindowResponse
-> UpdateMaintenanceWindowResponse -> Bool
== :: UpdateMaintenanceWindowResponse
-> UpdateMaintenanceWindowResponse -> Bool
$c== :: UpdateMaintenanceWindowResponse
-> UpdateMaintenanceWindowResponse -> Bool
Prelude.Eq, Int -> UpdateMaintenanceWindowResponse -> ShowS
[UpdateMaintenanceWindowResponse] -> ShowS
UpdateMaintenanceWindowResponse -> String
(Int -> UpdateMaintenanceWindowResponse -> ShowS)
-> (UpdateMaintenanceWindowResponse -> String)
-> ([UpdateMaintenanceWindowResponse] -> ShowS)
-> Show UpdateMaintenanceWindowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMaintenanceWindowResponse] -> ShowS
$cshowList :: [UpdateMaintenanceWindowResponse] -> ShowS
show :: UpdateMaintenanceWindowResponse -> String
$cshow :: UpdateMaintenanceWindowResponse -> String
showsPrec :: Int -> UpdateMaintenanceWindowResponse -> ShowS
$cshowsPrec :: Int -> UpdateMaintenanceWindowResponse -> ShowS
Prelude.Show, (forall x.
 UpdateMaintenanceWindowResponse
 -> Rep UpdateMaintenanceWindowResponse x)
-> (forall x.
    Rep UpdateMaintenanceWindowResponse x
    -> UpdateMaintenanceWindowResponse)
-> Generic UpdateMaintenanceWindowResponse
forall x.
Rep UpdateMaintenanceWindowResponse x
-> UpdateMaintenanceWindowResponse
forall x.
UpdateMaintenanceWindowResponse
-> Rep UpdateMaintenanceWindowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateMaintenanceWindowResponse x
-> UpdateMaintenanceWindowResponse
$cfrom :: forall x.
UpdateMaintenanceWindowResponse
-> Rep UpdateMaintenanceWindowResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateMaintenanceWindowResponse' 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:
--
-- 'enabled', 'updateMaintenanceWindowResponse_enabled' - Whether the maintenance window is enabled.
--
-- 'schedule', 'updateMaintenanceWindowResponse_schedule' - The schedule of the maintenance window in the form of a cron or rate
-- expression.
--
-- 'scheduleOffset', 'updateMaintenanceWindowResponse_scheduleOffset' - The number of days to wait to run a maintenance window after the
-- scheduled cron expression date and time.
--
-- 'endDate', 'updateMaintenanceWindowResponse_endDate' - The date and time, in ISO-8601 Extended format, for when the maintenance
-- window is scheduled to become inactive. The maintenance window won\'t
-- run after this specified time.
--
-- 'scheduleTimezone', 'updateMaintenanceWindowResponse_scheduleTimezone' - The time zone that the scheduled maintenance window executions are based
-- on, in Internet Assigned Numbers Authority (IANA) format. For example:
-- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
-- information, see the
-- <https://www.iana.org/time-zones Time Zone Database> on the IANA
-- website.
--
-- 'startDate', 'updateMaintenanceWindowResponse_startDate' - The date and time, in ISO-8601 Extended format, for when the maintenance
-- window is scheduled to become active. The maintenance window won\'t run
-- before this specified time.
--
-- 'name', 'updateMaintenanceWindowResponse_name' - The name of the maintenance window.
--
-- 'cutoff', 'updateMaintenanceWindowResponse_cutoff' - The number of hours before the end of the maintenance window that Amazon
-- Web Services Systems Manager stops scheduling new tasks for execution.
--
-- 'allowUnassociatedTargets', 'updateMaintenanceWindowResponse_allowUnassociatedTargets' - Whether targets must be registered with the maintenance window before
-- tasks can be defined for those targets.
--
-- 'description', 'updateMaintenanceWindowResponse_description' - An optional description of the update.
--
-- 'duration', 'updateMaintenanceWindowResponse_duration' - The duration of the maintenance window in hours.
--
-- 'windowId', 'updateMaintenanceWindowResponse_windowId' - The ID of the created maintenance window.
--
-- 'httpStatus', 'updateMaintenanceWindowResponse_httpStatus' - The response's http status code.
newUpdateMaintenanceWindowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateMaintenanceWindowResponse
newUpdateMaintenanceWindowResponse :: Int -> UpdateMaintenanceWindowResponse
newUpdateMaintenanceWindowResponse Int
pHttpStatus_ =
  UpdateMaintenanceWindowResponse' :: Maybe Bool
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Text
-> Int
-> UpdateMaintenanceWindowResponse
UpdateMaintenanceWindowResponse'
    { $sel:enabled:UpdateMaintenanceWindowResponse' :: Maybe Bool
enabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:schedule:UpdateMaintenanceWindowResponse' :: Maybe Text
schedule = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleOffset:UpdateMaintenanceWindowResponse' :: Maybe Natural
scheduleOffset = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:endDate:UpdateMaintenanceWindowResponse' :: Maybe Text
endDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleTimezone:UpdateMaintenanceWindowResponse' :: Maybe Text
scheduleTimezone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:UpdateMaintenanceWindowResponse' :: Maybe Text
startDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateMaintenanceWindowResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cutoff:UpdateMaintenanceWindowResponse' :: Maybe Natural
cutoff = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:allowUnassociatedTargets:UpdateMaintenanceWindowResponse' :: Maybe Bool
allowUnassociatedTargets = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateMaintenanceWindowResponse' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:UpdateMaintenanceWindowResponse' :: Maybe Natural
duration = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:windowId:UpdateMaintenanceWindowResponse' :: Maybe Text
windowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateMaintenanceWindowResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Whether the maintenance window is enabled.
updateMaintenanceWindowResponse_enabled :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Bool)
updateMaintenanceWindowResponse_enabled :: (Maybe Bool -> f (Maybe Bool))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_enabled = (UpdateMaintenanceWindowResponse -> Maybe Bool)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Bool -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Bool
a -> UpdateMaintenanceWindowResponse
s {$sel:enabled:UpdateMaintenanceWindowResponse' :: Maybe Bool
enabled = Maybe Bool
a} :: UpdateMaintenanceWindowResponse)

-- | The schedule of the maintenance window in the form of a cron or rate
-- expression.
updateMaintenanceWindowResponse_schedule :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowResponse_schedule :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_schedule = (UpdateMaintenanceWindowResponse -> Maybe Text)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Text -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Text
schedule :: Maybe Text
$sel:schedule:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Text
schedule} -> Maybe Text
schedule) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Text
a -> UpdateMaintenanceWindowResponse
s {$sel:schedule:UpdateMaintenanceWindowResponse' :: Maybe Text
schedule = Maybe Text
a} :: UpdateMaintenanceWindowResponse)

-- | The number of days to wait to run a maintenance window after the
-- scheduled cron expression date and time.
updateMaintenanceWindowResponse_scheduleOffset :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Natural)
updateMaintenanceWindowResponse_scheduleOffset :: (Maybe Natural -> f (Maybe Natural))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_scheduleOffset = (UpdateMaintenanceWindowResponse -> Maybe Natural)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Natural -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Natural
scheduleOffset :: Maybe Natural
$sel:scheduleOffset:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Natural
scheduleOffset} -> Maybe Natural
scheduleOffset) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Natural
a -> UpdateMaintenanceWindowResponse
s {$sel:scheduleOffset:UpdateMaintenanceWindowResponse' :: Maybe Natural
scheduleOffset = Maybe Natural
a} :: UpdateMaintenanceWindowResponse)

-- | The date and time, in ISO-8601 Extended format, for when the maintenance
-- window is scheduled to become inactive. The maintenance window won\'t
-- run after this specified time.
updateMaintenanceWindowResponse_endDate :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowResponse_endDate :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_endDate = (UpdateMaintenanceWindowResponse -> Maybe Text)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Text -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Text
endDate :: Maybe Text
$sel:endDate:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Text
endDate} -> Maybe Text
endDate) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Text
a -> UpdateMaintenanceWindowResponse
s {$sel:endDate:UpdateMaintenanceWindowResponse' :: Maybe Text
endDate = Maybe Text
a} :: UpdateMaintenanceWindowResponse)

-- | The time zone that the scheduled maintenance window executions are based
-- on, in Internet Assigned Numbers Authority (IANA) format. For example:
-- \"America\/Los_Angeles\", \"UTC\", or \"Asia\/Seoul\". For more
-- information, see the
-- <https://www.iana.org/time-zones Time Zone Database> on the IANA
-- website.
updateMaintenanceWindowResponse_scheduleTimezone :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowResponse_scheduleTimezone :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_scheduleTimezone = (UpdateMaintenanceWindowResponse -> Maybe Text)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Text -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Text
scheduleTimezone :: Maybe Text
$sel:scheduleTimezone:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Text
scheduleTimezone} -> Maybe Text
scheduleTimezone) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Text
a -> UpdateMaintenanceWindowResponse
s {$sel:scheduleTimezone:UpdateMaintenanceWindowResponse' :: Maybe Text
scheduleTimezone = Maybe Text
a} :: UpdateMaintenanceWindowResponse)

-- | The date and time, in ISO-8601 Extended format, for when the maintenance
-- window is scheduled to become active. The maintenance window won\'t run
-- before this specified time.
updateMaintenanceWindowResponse_startDate :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowResponse_startDate :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_startDate = (UpdateMaintenanceWindowResponse -> Maybe Text)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Text -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Text
startDate :: Maybe Text
$sel:startDate:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Text
startDate} -> Maybe Text
startDate) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Text
a -> UpdateMaintenanceWindowResponse
s {$sel:startDate:UpdateMaintenanceWindowResponse' :: Maybe Text
startDate = Maybe Text
a} :: UpdateMaintenanceWindowResponse)

-- | The name of the maintenance window.
updateMaintenanceWindowResponse_name :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_name = (UpdateMaintenanceWindowResponse -> Maybe Text)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Text -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Text
a -> UpdateMaintenanceWindowResponse
s {$sel:name:UpdateMaintenanceWindowResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateMaintenanceWindowResponse)

-- | The number of hours before the end of the maintenance window that Amazon
-- Web Services Systems Manager stops scheduling new tasks for execution.
updateMaintenanceWindowResponse_cutoff :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Natural)
updateMaintenanceWindowResponse_cutoff :: (Maybe Natural -> f (Maybe Natural))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_cutoff = (UpdateMaintenanceWindowResponse -> Maybe Natural)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Natural -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Natural
cutoff :: Maybe Natural
$sel:cutoff:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Natural
cutoff} -> Maybe Natural
cutoff) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Natural
a -> UpdateMaintenanceWindowResponse
s {$sel:cutoff:UpdateMaintenanceWindowResponse' :: Maybe Natural
cutoff = Maybe Natural
a} :: UpdateMaintenanceWindowResponse)

-- | Whether targets must be registered with the maintenance window before
-- tasks can be defined for those targets.
updateMaintenanceWindowResponse_allowUnassociatedTargets :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Bool)
updateMaintenanceWindowResponse_allowUnassociatedTargets :: (Maybe Bool -> f (Maybe Bool))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_allowUnassociatedTargets = (UpdateMaintenanceWindowResponse -> Maybe Bool)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Bool -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Bool
allowUnassociatedTargets :: Maybe Bool
$sel:allowUnassociatedTargets:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Bool
allowUnassociatedTargets} -> Maybe Bool
allowUnassociatedTargets) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Bool
a -> UpdateMaintenanceWindowResponse
s {$sel:allowUnassociatedTargets:UpdateMaintenanceWindowResponse' :: Maybe Bool
allowUnassociatedTargets = Maybe Bool
a} :: UpdateMaintenanceWindowResponse)

-- | An optional description of the update.
updateMaintenanceWindowResponse_description :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowResponse_description :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_description = (UpdateMaintenanceWindowResponse -> Maybe (Sensitive Text))
-> (UpdateMaintenanceWindowResponse
    -> Maybe (Sensitive Text) -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe (Sensitive Text)
a -> UpdateMaintenanceWindowResponse
s {$sel:description:UpdateMaintenanceWindowResponse' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateMaintenanceWindowResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateMaintenanceWindowResponse
 -> f UpdateMaintenanceWindowResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
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 duration of the maintenance window in hours.
updateMaintenanceWindowResponse_duration :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Natural)
updateMaintenanceWindowResponse_duration :: (Maybe Natural -> f (Maybe Natural))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_duration = (UpdateMaintenanceWindowResponse -> Maybe Natural)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Natural -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Natural
duration :: Maybe Natural
$sel:duration:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Natural
duration} -> Maybe Natural
duration) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Natural
a -> UpdateMaintenanceWindowResponse
s {$sel:duration:UpdateMaintenanceWindowResponse' :: Maybe Natural
duration = Maybe Natural
a} :: UpdateMaintenanceWindowResponse)

-- | The ID of the created maintenance window.
updateMaintenanceWindowResponse_windowId :: Lens.Lens' UpdateMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
updateMaintenanceWindowResponse_windowId :: (Maybe Text -> f (Maybe Text))
-> UpdateMaintenanceWindowResponse
-> f UpdateMaintenanceWindowResponse
updateMaintenanceWindowResponse_windowId = (UpdateMaintenanceWindowResponse -> Maybe Text)
-> (UpdateMaintenanceWindowResponse
    -> Maybe Text -> UpdateMaintenanceWindowResponse)
-> Lens
     UpdateMaintenanceWindowResponse
     UpdateMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMaintenanceWindowResponse' {Maybe Text
windowId :: Maybe Text
$sel:windowId:UpdateMaintenanceWindowResponse' :: UpdateMaintenanceWindowResponse -> Maybe Text
windowId} -> Maybe Text
windowId) (\s :: UpdateMaintenanceWindowResponse
s@UpdateMaintenanceWindowResponse' {} Maybe Text
a -> UpdateMaintenanceWindowResponse
s {$sel:windowId:UpdateMaintenanceWindowResponse' :: Maybe Text
windowId = Maybe Text
a} :: UpdateMaintenanceWindowResponse)

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

instance
  Prelude.NFData
    UpdateMaintenanceWindowResponse