{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSM.Types.ScheduledWindowExecution
-- 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)
module Amazonka.SSM.Types.ScheduledWindowExecution where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a scheduled execution for a maintenance window.
--
-- /See:/ 'newScheduledWindowExecution' smart constructor.
data ScheduledWindowExecution = ScheduledWindowExecution'
  { -- | The time, in ISO-8601 Extended format, that the maintenance window is
    -- scheduled to be run.
    ScheduledWindowExecution -> Maybe Text
executionTime :: Prelude.Maybe Prelude.Text,
    -- | The name of the maintenance window to be run.
    ScheduledWindowExecution -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the maintenance window to be run.
    ScheduledWindowExecution -> Maybe Text
windowId :: Prelude.Maybe Prelude.Text
  }
  deriving (ScheduledWindowExecution -> ScheduledWindowExecution -> Bool
(ScheduledWindowExecution -> ScheduledWindowExecution -> Bool)
-> (ScheduledWindowExecution -> ScheduledWindowExecution -> Bool)
-> Eq ScheduledWindowExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScheduledWindowExecution -> ScheduledWindowExecution -> Bool
$c/= :: ScheduledWindowExecution -> ScheduledWindowExecution -> Bool
== :: ScheduledWindowExecution -> ScheduledWindowExecution -> Bool
$c== :: ScheduledWindowExecution -> ScheduledWindowExecution -> Bool
Prelude.Eq, ReadPrec [ScheduledWindowExecution]
ReadPrec ScheduledWindowExecution
Int -> ReadS ScheduledWindowExecution
ReadS [ScheduledWindowExecution]
(Int -> ReadS ScheduledWindowExecution)
-> ReadS [ScheduledWindowExecution]
-> ReadPrec ScheduledWindowExecution
-> ReadPrec [ScheduledWindowExecution]
-> Read ScheduledWindowExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScheduledWindowExecution]
$creadListPrec :: ReadPrec [ScheduledWindowExecution]
readPrec :: ReadPrec ScheduledWindowExecution
$creadPrec :: ReadPrec ScheduledWindowExecution
readList :: ReadS [ScheduledWindowExecution]
$creadList :: ReadS [ScheduledWindowExecution]
readsPrec :: Int -> ReadS ScheduledWindowExecution
$creadsPrec :: Int -> ReadS ScheduledWindowExecution
Prelude.Read, Int -> ScheduledWindowExecution -> ShowS
[ScheduledWindowExecution] -> ShowS
ScheduledWindowExecution -> String
(Int -> ScheduledWindowExecution -> ShowS)
-> (ScheduledWindowExecution -> String)
-> ([ScheduledWindowExecution] -> ShowS)
-> Show ScheduledWindowExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScheduledWindowExecution] -> ShowS
$cshowList :: [ScheduledWindowExecution] -> ShowS
show :: ScheduledWindowExecution -> String
$cshow :: ScheduledWindowExecution -> String
showsPrec :: Int -> ScheduledWindowExecution -> ShowS
$cshowsPrec :: Int -> ScheduledWindowExecution -> ShowS
Prelude.Show, (forall x.
 ScheduledWindowExecution -> Rep ScheduledWindowExecution x)
-> (forall x.
    Rep ScheduledWindowExecution x -> ScheduledWindowExecution)
-> Generic ScheduledWindowExecution
forall x.
Rep ScheduledWindowExecution x -> ScheduledWindowExecution
forall x.
ScheduledWindowExecution -> Rep ScheduledWindowExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ScheduledWindowExecution x -> ScheduledWindowExecution
$cfrom :: forall x.
ScheduledWindowExecution -> Rep ScheduledWindowExecution x
Prelude.Generic)

-- |
-- Create a value of 'ScheduledWindowExecution' 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:
--
-- 'executionTime', 'scheduledWindowExecution_executionTime' - The time, in ISO-8601 Extended format, that the maintenance window is
-- scheduled to be run.
--
-- 'name', 'scheduledWindowExecution_name' - The name of the maintenance window to be run.
--
-- 'windowId', 'scheduledWindowExecution_windowId' - The ID of the maintenance window to be run.
newScheduledWindowExecution ::
  ScheduledWindowExecution
newScheduledWindowExecution :: ScheduledWindowExecution
newScheduledWindowExecution =
  ScheduledWindowExecution' :: Maybe Text -> Maybe Text -> Maybe Text -> ScheduledWindowExecution
ScheduledWindowExecution'
    { $sel:executionTime:ScheduledWindowExecution' :: Maybe Text
executionTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ScheduledWindowExecution' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:windowId:ScheduledWindowExecution' :: Maybe Text
windowId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time, in ISO-8601 Extended format, that the maintenance window is
-- scheduled to be run.
scheduledWindowExecution_executionTime :: Lens.Lens' ScheduledWindowExecution (Prelude.Maybe Prelude.Text)
scheduledWindowExecution_executionTime :: (Maybe Text -> f (Maybe Text))
-> ScheduledWindowExecution -> f ScheduledWindowExecution
scheduledWindowExecution_executionTime = (ScheduledWindowExecution -> Maybe Text)
-> (ScheduledWindowExecution
    -> Maybe Text -> ScheduledWindowExecution)
-> Lens
     ScheduledWindowExecution
     ScheduledWindowExecution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduledWindowExecution' {Maybe Text
executionTime :: Maybe Text
$sel:executionTime:ScheduledWindowExecution' :: ScheduledWindowExecution -> Maybe Text
executionTime} -> Maybe Text
executionTime) (\s :: ScheduledWindowExecution
s@ScheduledWindowExecution' {} Maybe Text
a -> ScheduledWindowExecution
s {$sel:executionTime:ScheduledWindowExecution' :: Maybe Text
executionTime = Maybe Text
a} :: ScheduledWindowExecution)

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

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

instance Core.FromJSON ScheduledWindowExecution where
  parseJSON :: Value -> Parser ScheduledWindowExecution
parseJSON =
    String
-> (Object -> Parser ScheduledWindowExecution)
-> Value
-> Parser ScheduledWindowExecution
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ScheduledWindowExecution"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ScheduledWindowExecution
ScheduledWindowExecution'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> ScheduledWindowExecution)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ScheduledWindowExecution)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExecutionTime")
            Parser (Maybe Text -> Maybe Text -> ScheduledWindowExecution)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ScheduledWindowExecution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> ScheduledWindowExecution)
-> Parser (Maybe Text) -> Parser ScheduledWindowExecution
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WindowId")
      )

instance Prelude.Hashable ScheduledWindowExecution

instance Prelude.NFData ScheduledWindowExecution