{-# 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.GetMaintenanceWindow
-- 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)
--
-- Retrieves a maintenance window.
module Amazonka.SSM.GetMaintenanceWindow
  ( -- * Creating a Request
    GetMaintenanceWindow (..),
    newGetMaintenanceWindow,

    -- * Request Lenses
    getMaintenanceWindow_windowId,

    -- * Destructuring the Response
    GetMaintenanceWindowResponse (..),
    newGetMaintenanceWindowResponse,

    -- * Response Lenses
    getMaintenanceWindowResponse_enabled,
    getMaintenanceWindowResponse_schedule,
    getMaintenanceWindowResponse_nextExecutionTime,
    getMaintenanceWindowResponse_scheduleOffset,
    getMaintenanceWindowResponse_endDate,
    getMaintenanceWindowResponse_scheduleTimezone,
    getMaintenanceWindowResponse_startDate,
    getMaintenanceWindowResponse_createdDate,
    getMaintenanceWindowResponse_name,
    getMaintenanceWindowResponse_modifiedDate,
    getMaintenanceWindowResponse_cutoff,
    getMaintenanceWindowResponse_allowUnassociatedTargets,
    getMaintenanceWindowResponse_description,
    getMaintenanceWindowResponse_duration,
    getMaintenanceWindowResponse_windowId,
    getMaintenanceWindowResponse_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:/ 'newGetMaintenanceWindow' smart constructor.
data GetMaintenanceWindow = GetMaintenanceWindow'
  { -- | The ID of the maintenance window for which you want to retrieve
    -- information.
    GetMaintenanceWindow -> Text
windowId :: Prelude.Text
  }
  deriving (GetMaintenanceWindow -> GetMaintenanceWindow -> Bool
(GetMaintenanceWindow -> GetMaintenanceWindow -> Bool)
-> (GetMaintenanceWindow -> GetMaintenanceWindow -> Bool)
-> Eq GetMaintenanceWindow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMaintenanceWindow -> GetMaintenanceWindow -> Bool
$c/= :: GetMaintenanceWindow -> GetMaintenanceWindow -> Bool
== :: GetMaintenanceWindow -> GetMaintenanceWindow -> Bool
$c== :: GetMaintenanceWindow -> GetMaintenanceWindow -> Bool
Prelude.Eq, ReadPrec [GetMaintenanceWindow]
ReadPrec GetMaintenanceWindow
Int -> ReadS GetMaintenanceWindow
ReadS [GetMaintenanceWindow]
(Int -> ReadS GetMaintenanceWindow)
-> ReadS [GetMaintenanceWindow]
-> ReadPrec GetMaintenanceWindow
-> ReadPrec [GetMaintenanceWindow]
-> Read GetMaintenanceWindow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMaintenanceWindow]
$creadListPrec :: ReadPrec [GetMaintenanceWindow]
readPrec :: ReadPrec GetMaintenanceWindow
$creadPrec :: ReadPrec GetMaintenanceWindow
readList :: ReadS [GetMaintenanceWindow]
$creadList :: ReadS [GetMaintenanceWindow]
readsPrec :: Int -> ReadS GetMaintenanceWindow
$creadsPrec :: Int -> ReadS GetMaintenanceWindow
Prelude.Read, Int -> GetMaintenanceWindow -> ShowS
[GetMaintenanceWindow] -> ShowS
GetMaintenanceWindow -> String
(Int -> GetMaintenanceWindow -> ShowS)
-> (GetMaintenanceWindow -> String)
-> ([GetMaintenanceWindow] -> ShowS)
-> Show GetMaintenanceWindow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMaintenanceWindow] -> ShowS
$cshowList :: [GetMaintenanceWindow] -> ShowS
show :: GetMaintenanceWindow -> String
$cshow :: GetMaintenanceWindow -> String
showsPrec :: Int -> GetMaintenanceWindow -> ShowS
$cshowsPrec :: Int -> GetMaintenanceWindow -> ShowS
Prelude.Show, (forall x. GetMaintenanceWindow -> Rep GetMaintenanceWindow x)
-> (forall x. Rep GetMaintenanceWindow x -> GetMaintenanceWindow)
-> Generic GetMaintenanceWindow
forall x. Rep GetMaintenanceWindow x -> GetMaintenanceWindow
forall x. GetMaintenanceWindow -> Rep GetMaintenanceWindow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMaintenanceWindow x -> GetMaintenanceWindow
$cfrom :: forall x. GetMaintenanceWindow -> Rep GetMaintenanceWindow x
Prelude.Generic)

-- |
-- Create a value of 'GetMaintenanceWindow' 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:
--
-- 'windowId', 'getMaintenanceWindow_windowId' - The ID of the maintenance window for which you want to retrieve
-- information.
newGetMaintenanceWindow ::
  -- | 'windowId'
  Prelude.Text ->
  GetMaintenanceWindow
newGetMaintenanceWindow :: Text -> GetMaintenanceWindow
newGetMaintenanceWindow Text
pWindowId_ =
  GetMaintenanceWindow' :: Text -> GetMaintenanceWindow
GetMaintenanceWindow' {$sel:windowId:GetMaintenanceWindow' :: Text
windowId = Text
pWindowId_}

-- | The ID of the maintenance window for which you want to retrieve
-- information.
getMaintenanceWindow_windowId :: Lens.Lens' GetMaintenanceWindow Prelude.Text
getMaintenanceWindow_windowId :: (Text -> f Text) -> GetMaintenanceWindow -> f GetMaintenanceWindow
getMaintenanceWindow_windowId = (GetMaintenanceWindow -> Text)
-> (GetMaintenanceWindow -> Text -> GetMaintenanceWindow)
-> Lens GetMaintenanceWindow GetMaintenanceWindow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindow' {Text
windowId :: Text
$sel:windowId:GetMaintenanceWindow' :: GetMaintenanceWindow -> Text
windowId} -> Text
windowId) (\s :: GetMaintenanceWindow
s@GetMaintenanceWindow' {} Text
a -> GetMaintenanceWindow
s {$sel:windowId:GetMaintenanceWindow' :: Text
windowId = Text
a} :: GetMaintenanceWindow)

instance Core.AWSRequest GetMaintenanceWindow where
  type
    AWSResponse GetMaintenanceWindow =
      GetMaintenanceWindowResponse
  request :: GetMaintenanceWindow -> Request GetMaintenanceWindow
request = Service -> GetMaintenanceWindow -> Request GetMaintenanceWindow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetMaintenanceWindow)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetMaintenanceWindow))
-> Logger
-> Service
-> Proxy GetMaintenanceWindow
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetMaintenanceWindow)))
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 Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Text
-> Int
-> GetMaintenanceWindowResponse
GetMaintenanceWindowResponse'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Natural
 -> Maybe Bool
 -> Maybe (Sensitive Text)
 -> Maybe Natural
 -> Maybe Text
 -> Int
 -> GetMaintenanceWindowResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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 Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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 Text
   -> Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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
"NextExecutionTime")
            Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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 POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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 POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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 POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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 POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedDate")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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 POSIX
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Natural
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ModifiedDate")
            Either
  String
  (Maybe Natural
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetMaintenanceWindowResponse)
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
   -> GetMaintenanceWindowResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe Natural
      -> Maybe Text -> Int -> GetMaintenanceWindowResponse)
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 -> GetMaintenanceWindowResponse)
-> Either String (Maybe Natural)
-> Either
     String (Maybe Text -> Int -> GetMaintenanceWindowResponse)
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 -> GetMaintenanceWindowResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetMaintenanceWindowResponse)
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 -> GetMaintenanceWindowResponse)
-> Either String Int -> Either String GetMaintenanceWindowResponse
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 GetMaintenanceWindow

instance Prelude.NFData GetMaintenanceWindow

instance Core.ToHeaders GetMaintenanceWindow where
  toHeaders :: GetMaintenanceWindow -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetMaintenanceWindow -> 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.GetMaintenanceWindow" ::
                          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 GetMaintenanceWindow where
  toJSON :: GetMaintenanceWindow -> Value
toJSON GetMaintenanceWindow' {Text
windowId :: Text
$sel:windowId:GetMaintenanceWindow' :: GetMaintenanceWindow -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [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 GetMaintenanceWindow where
  toPath :: GetMaintenanceWindow -> ByteString
toPath = ByteString -> GetMaintenanceWindow -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetMaintenanceWindowResponse' smart constructor.
data GetMaintenanceWindowResponse = GetMaintenanceWindowResponse'
  { -- | Indicates whether the maintenance window is enabled.
    GetMaintenanceWindowResponse -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The schedule of the maintenance window in the form of a cron or rate
    -- expression.
    GetMaintenanceWindowResponse -> Maybe Text
schedule :: Prelude.Maybe Prelude.Text,
    -- | The next time the maintenance window will actually run, taking into
    -- account any specified times for the maintenance window to become active
    -- or inactive.
    GetMaintenanceWindowResponse -> Maybe Text
nextExecutionTime :: Prelude.Maybe Prelude.Text,
    -- | The number of days to wait to run a maintenance window after the
    -- scheduled cron expression date and time.
    GetMaintenanceWindowResponse -> 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.
    GetMaintenanceWindowResponse -> 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.
    GetMaintenanceWindowResponse -> 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.
    GetMaintenanceWindowResponse -> Maybe Text
startDate :: Prelude.Maybe Prelude.Text,
    -- | The date the maintenance window was created.
    GetMaintenanceWindowResponse -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the maintenance window.
    GetMaintenanceWindowResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The date the maintenance window was last modified.
    GetMaintenanceWindowResponse -> Maybe POSIX
modifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The number of hours before the end of the maintenance window that Amazon
    -- Web Services Systems Manager stops scheduling new tasks for execution.
    GetMaintenanceWindowResponse -> Maybe Natural
cutoff :: Prelude.Maybe Prelude.Natural,
    -- | Whether targets must be registered with the maintenance window before
    -- tasks can be defined for those targets.
    GetMaintenanceWindowResponse -> Maybe Bool
allowUnassociatedTargets :: Prelude.Maybe Prelude.Bool,
    -- | The description of the maintenance window.
    GetMaintenanceWindowResponse -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The duration of the maintenance window in hours.
    GetMaintenanceWindowResponse -> Maybe Natural
duration :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the created maintenance window.
    GetMaintenanceWindowResponse -> Maybe Text
windowId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetMaintenanceWindowResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMaintenanceWindowResponse
-> GetMaintenanceWindowResponse -> Bool
(GetMaintenanceWindowResponse
 -> GetMaintenanceWindowResponse -> Bool)
-> (GetMaintenanceWindowResponse
    -> GetMaintenanceWindowResponse -> Bool)
-> Eq GetMaintenanceWindowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMaintenanceWindowResponse
-> GetMaintenanceWindowResponse -> Bool
$c/= :: GetMaintenanceWindowResponse
-> GetMaintenanceWindowResponse -> Bool
== :: GetMaintenanceWindowResponse
-> GetMaintenanceWindowResponse -> Bool
$c== :: GetMaintenanceWindowResponse
-> GetMaintenanceWindowResponse -> Bool
Prelude.Eq, Int -> GetMaintenanceWindowResponse -> ShowS
[GetMaintenanceWindowResponse] -> ShowS
GetMaintenanceWindowResponse -> String
(Int -> GetMaintenanceWindowResponse -> ShowS)
-> (GetMaintenanceWindowResponse -> String)
-> ([GetMaintenanceWindowResponse] -> ShowS)
-> Show GetMaintenanceWindowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMaintenanceWindowResponse] -> ShowS
$cshowList :: [GetMaintenanceWindowResponse] -> ShowS
show :: GetMaintenanceWindowResponse -> String
$cshow :: GetMaintenanceWindowResponse -> String
showsPrec :: Int -> GetMaintenanceWindowResponse -> ShowS
$cshowsPrec :: Int -> GetMaintenanceWindowResponse -> ShowS
Prelude.Show, (forall x.
 GetMaintenanceWindowResponse -> Rep GetMaintenanceWindowResponse x)
-> (forall x.
    Rep GetMaintenanceWindowResponse x -> GetMaintenanceWindowResponse)
-> Generic GetMaintenanceWindowResponse
forall x.
Rep GetMaintenanceWindowResponse x -> GetMaintenanceWindowResponse
forall x.
GetMaintenanceWindowResponse -> Rep GetMaintenanceWindowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMaintenanceWindowResponse x -> GetMaintenanceWindowResponse
$cfrom :: forall x.
GetMaintenanceWindowResponse -> Rep GetMaintenanceWindowResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMaintenanceWindowResponse' 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', 'getMaintenanceWindowResponse_enabled' - Indicates whether the maintenance window is enabled.
--
-- 'schedule', 'getMaintenanceWindowResponse_schedule' - The schedule of the maintenance window in the form of a cron or rate
-- expression.
--
-- 'nextExecutionTime', 'getMaintenanceWindowResponse_nextExecutionTime' - The next time the maintenance window will actually run, taking into
-- account any specified times for the maintenance window to become active
-- or inactive.
--
-- 'scheduleOffset', 'getMaintenanceWindowResponse_scheduleOffset' - The number of days to wait to run a maintenance window after the
-- scheduled cron expression date and time.
--
-- 'endDate', 'getMaintenanceWindowResponse_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', 'getMaintenanceWindowResponse_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', 'getMaintenanceWindowResponse_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.
--
-- 'createdDate', 'getMaintenanceWindowResponse_createdDate' - The date the maintenance window was created.
--
-- 'name', 'getMaintenanceWindowResponse_name' - The name of the maintenance window.
--
-- 'modifiedDate', 'getMaintenanceWindowResponse_modifiedDate' - The date the maintenance window was last modified.
--
-- 'cutoff', 'getMaintenanceWindowResponse_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', 'getMaintenanceWindowResponse_allowUnassociatedTargets' - Whether targets must be registered with the maintenance window before
-- tasks can be defined for those targets.
--
-- 'description', 'getMaintenanceWindowResponse_description' - The description of the maintenance window.
--
-- 'duration', 'getMaintenanceWindowResponse_duration' - The duration of the maintenance window in hours.
--
-- 'windowId', 'getMaintenanceWindowResponse_windowId' - The ID of the created maintenance window.
--
-- 'httpStatus', 'getMaintenanceWindowResponse_httpStatus' - The response's http status code.
newGetMaintenanceWindowResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMaintenanceWindowResponse
newGetMaintenanceWindowResponse :: Int -> GetMaintenanceWindowResponse
newGetMaintenanceWindowResponse Int
pHttpStatus_ =
  GetMaintenanceWindowResponse' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Text
-> Int
-> GetMaintenanceWindowResponse
GetMaintenanceWindowResponse'
    { $sel:enabled:GetMaintenanceWindowResponse' :: Maybe Bool
enabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:schedule:GetMaintenanceWindowResponse' :: Maybe Text
schedule = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextExecutionTime:GetMaintenanceWindowResponse' :: Maybe Text
nextExecutionTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleOffset:GetMaintenanceWindowResponse' :: Maybe Natural
scheduleOffset = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:endDate:GetMaintenanceWindowResponse' :: Maybe Text
endDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleTimezone:GetMaintenanceWindowResponse' :: Maybe Text
scheduleTimezone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:GetMaintenanceWindowResponse' :: Maybe Text
startDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:GetMaintenanceWindowResponse' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetMaintenanceWindowResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:modifiedDate:GetMaintenanceWindowResponse' :: Maybe POSIX
modifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:cutoff:GetMaintenanceWindowResponse' :: Maybe Natural
cutoff = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:allowUnassociatedTargets:GetMaintenanceWindowResponse' :: Maybe Bool
allowUnassociatedTargets = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:GetMaintenanceWindowResponse' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:GetMaintenanceWindowResponse' :: Maybe Natural
duration = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:windowId:GetMaintenanceWindowResponse' :: Maybe Text
windowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMaintenanceWindowResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

-- | The next time the maintenance window will actually run, taking into
-- account any specified times for the maintenance window to become active
-- or inactive.
getMaintenanceWindowResponse_nextExecutionTime :: Lens.Lens' GetMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
getMaintenanceWindowResponse_nextExecutionTime :: (Maybe Text -> f (Maybe Text))
-> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse
getMaintenanceWindowResponse_nextExecutionTime = (GetMaintenanceWindowResponse -> Maybe Text)
-> (GetMaintenanceWindowResponse
    -> Maybe Text -> GetMaintenanceWindowResponse)
-> Lens
     GetMaintenanceWindowResponse
     GetMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindowResponse' {Maybe Text
nextExecutionTime :: Maybe Text
$sel:nextExecutionTime:GetMaintenanceWindowResponse' :: GetMaintenanceWindowResponse -> Maybe Text
nextExecutionTime} -> Maybe Text
nextExecutionTime) (\s :: GetMaintenanceWindowResponse
s@GetMaintenanceWindowResponse' {} Maybe Text
a -> GetMaintenanceWindowResponse
s {$sel:nextExecutionTime:GetMaintenanceWindowResponse' :: Maybe Text
nextExecutionTime = Maybe Text
a} :: GetMaintenanceWindowResponse)

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

-- | 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.
getMaintenanceWindowResponse_endDate :: Lens.Lens' GetMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
getMaintenanceWindowResponse_endDate :: (Maybe Text -> f (Maybe Text))
-> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse
getMaintenanceWindowResponse_endDate = (GetMaintenanceWindowResponse -> Maybe Text)
-> (GetMaintenanceWindowResponse
    -> Maybe Text -> GetMaintenanceWindowResponse)
-> Lens
     GetMaintenanceWindowResponse
     GetMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindowResponse' {Maybe Text
endDate :: Maybe Text
$sel:endDate:GetMaintenanceWindowResponse' :: GetMaintenanceWindowResponse -> Maybe Text
endDate} -> Maybe Text
endDate) (\s :: GetMaintenanceWindowResponse
s@GetMaintenanceWindowResponse' {} Maybe Text
a -> GetMaintenanceWindowResponse
s {$sel:endDate:GetMaintenanceWindowResponse' :: Maybe Text
endDate = Maybe Text
a} :: GetMaintenanceWindowResponse)

-- | 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.
getMaintenanceWindowResponse_scheduleTimezone :: Lens.Lens' GetMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
getMaintenanceWindowResponse_scheduleTimezone :: (Maybe Text -> f (Maybe Text))
-> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse
getMaintenanceWindowResponse_scheduleTimezone = (GetMaintenanceWindowResponse -> Maybe Text)
-> (GetMaintenanceWindowResponse
    -> Maybe Text -> GetMaintenanceWindowResponse)
-> Lens
     GetMaintenanceWindowResponse
     GetMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindowResponse' {Maybe Text
scheduleTimezone :: Maybe Text
$sel:scheduleTimezone:GetMaintenanceWindowResponse' :: GetMaintenanceWindowResponse -> Maybe Text
scheduleTimezone} -> Maybe Text
scheduleTimezone) (\s :: GetMaintenanceWindowResponse
s@GetMaintenanceWindowResponse' {} Maybe Text
a -> GetMaintenanceWindowResponse
s {$sel:scheduleTimezone:GetMaintenanceWindowResponse' :: Maybe Text
scheduleTimezone = Maybe Text
a} :: GetMaintenanceWindowResponse)

-- | 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.
getMaintenanceWindowResponse_startDate :: Lens.Lens' GetMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
getMaintenanceWindowResponse_startDate :: (Maybe Text -> f (Maybe Text))
-> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse
getMaintenanceWindowResponse_startDate = (GetMaintenanceWindowResponse -> Maybe Text)
-> (GetMaintenanceWindowResponse
    -> Maybe Text -> GetMaintenanceWindowResponse)
-> Lens
     GetMaintenanceWindowResponse
     GetMaintenanceWindowResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindowResponse' {Maybe Text
startDate :: Maybe Text
$sel:startDate:GetMaintenanceWindowResponse' :: GetMaintenanceWindowResponse -> Maybe Text
startDate} -> Maybe Text
startDate) (\s :: GetMaintenanceWindowResponse
s@GetMaintenanceWindowResponse' {} Maybe Text
a -> GetMaintenanceWindowResponse
s {$sel:startDate:GetMaintenanceWindowResponse' :: Maybe Text
startDate = Maybe Text
a} :: GetMaintenanceWindowResponse)

-- | The date the maintenance window was created.
getMaintenanceWindowResponse_createdDate :: Lens.Lens' GetMaintenanceWindowResponse (Prelude.Maybe Prelude.UTCTime)
getMaintenanceWindowResponse_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse
getMaintenanceWindowResponse_createdDate = (GetMaintenanceWindowResponse -> Maybe POSIX)
-> (GetMaintenanceWindowResponse
    -> Maybe POSIX -> GetMaintenanceWindowResponse)
-> Lens
     GetMaintenanceWindowResponse
     GetMaintenanceWindowResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindowResponse' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:GetMaintenanceWindowResponse' :: GetMaintenanceWindowResponse -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: GetMaintenanceWindowResponse
s@GetMaintenanceWindowResponse' {} Maybe POSIX
a -> GetMaintenanceWindowResponse
s {$sel:createdDate:GetMaintenanceWindowResponse' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: GetMaintenanceWindowResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMaintenanceWindowResponse
-> f GetMaintenanceWindowResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | The date the maintenance window was last modified.
getMaintenanceWindowResponse_modifiedDate :: Lens.Lens' GetMaintenanceWindowResponse (Prelude.Maybe Prelude.UTCTime)
getMaintenanceWindowResponse_modifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse
getMaintenanceWindowResponse_modifiedDate = (GetMaintenanceWindowResponse -> Maybe POSIX)
-> (GetMaintenanceWindowResponse
    -> Maybe POSIX -> GetMaintenanceWindowResponse)
-> Lens
     GetMaintenanceWindowResponse
     GetMaintenanceWindowResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindowResponse' {Maybe POSIX
modifiedDate :: Maybe POSIX
$sel:modifiedDate:GetMaintenanceWindowResponse' :: GetMaintenanceWindowResponse -> Maybe POSIX
modifiedDate} -> Maybe POSIX
modifiedDate) (\s :: GetMaintenanceWindowResponse
s@GetMaintenanceWindowResponse' {} Maybe POSIX
a -> GetMaintenanceWindowResponse
s {$sel:modifiedDate:GetMaintenanceWindowResponse' :: Maybe POSIX
modifiedDate = Maybe POSIX
a} :: GetMaintenanceWindowResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMaintenanceWindowResponse
-> f GetMaintenanceWindowResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

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

-- | The description of the maintenance window.
getMaintenanceWindowResponse_description :: Lens.Lens' GetMaintenanceWindowResponse (Prelude.Maybe Prelude.Text)
getMaintenanceWindowResponse_description :: (Maybe Text -> f (Maybe Text))
-> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse
getMaintenanceWindowResponse_description = (GetMaintenanceWindowResponse -> Maybe (Sensitive Text))
-> (GetMaintenanceWindowResponse
    -> Maybe (Sensitive Text) -> GetMaintenanceWindowResponse)
-> Lens
     GetMaintenanceWindowResponse
     GetMaintenanceWindowResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindowResponse' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:GetMaintenanceWindowResponse' :: GetMaintenanceWindowResponse -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: GetMaintenanceWindowResponse
s@GetMaintenanceWindowResponse' {} Maybe (Sensitive Text)
a -> GetMaintenanceWindowResponse
s {$sel:description:GetMaintenanceWindowResponse' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: GetMaintenanceWindowResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> GetMaintenanceWindowResponse
-> f GetMaintenanceWindowResponse
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.
getMaintenanceWindowResponse_duration :: Lens.Lens' GetMaintenanceWindowResponse (Prelude.Maybe Prelude.Natural)
getMaintenanceWindowResponse_duration :: (Maybe Natural -> f (Maybe Natural))
-> GetMaintenanceWindowResponse -> f GetMaintenanceWindowResponse
getMaintenanceWindowResponse_duration = (GetMaintenanceWindowResponse -> Maybe Natural)
-> (GetMaintenanceWindowResponse
    -> Maybe Natural -> GetMaintenanceWindowResponse)
-> Lens
     GetMaintenanceWindowResponse
     GetMaintenanceWindowResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMaintenanceWindowResponse' {Maybe Natural
duration :: Maybe Natural
$sel:duration:GetMaintenanceWindowResponse' :: GetMaintenanceWindowResponse -> Maybe Natural
duration} -> Maybe Natural
duration) (\s :: GetMaintenanceWindowResponse
s@GetMaintenanceWindowResponse' {} Maybe Natural
a -> GetMaintenanceWindowResponse
s {$sel:duration:GetMaintenanceWindowResponse' :: Maybe Natural
duration = Maybe Natural
a} :: GetMaintenanceWindowResponse)

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

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

instance Prelude.NFData GetMaintenanceWindowResponse