{-# 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.SecurityHub.Types.AwsRedshiftClusterDeferredMaintenanceWindow
-- 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.SecurityHub.Types.AwsRedshiftClusterDeferredMaintenanceWindow where

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

-- | A time windows during which maintenance was deferred for an Amazon
-- Redshift cluster.
--
-- /See:/ 'newAwsRedshiftClusterDeferredMaintenanceWindow' smart constructor.
data AwsRedshiftClusterDeferredMaintenanceWindow = AwsRedshiftClusterDeferredMaintenanceWindow'
  { -- | The end of the time window for which maintenance was deferred.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text
deferMaintenanceEndTime :: Prelude.Maybe Prelude.Text,
    -- | The start of the time window for which maintenance was deferred.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text
deferMaintenanceStartTime :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the maintenance window.
    AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text
deferMaintenanceIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRedshiftClusterDeferredMaintenanceWindow
-> AwsRedshiftClusterDeferredMaintenanceWindow -> Bool
(AwsRedshiftClusterDeferredMaintenanceWindow
 -> AwsRedshiftClusterDeferredMaintenanceWindow -> Bool)
-> (AwsRedshiftClusterDeferredMaintenanceWindow
    -> AwsRedshiftClusterDeferredMaintenanceWindow -> Bool)
-> Eq AwsRedshiftClusterDeferredMaintenanceWindow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRedshiftClusterDeferredMaintenanceWindow
-> AwsRedshiftClusterDeferredMaintenanceWindow -> Bool
$c/= :: AwsRedshiftClusterDeferredMaintenanceWindow
-> AwsRedshiftClusterDeferredMaintenanceWindow -> Bool
== :: AwsRedshiftClusterDeferredMaintenanceWindow
-> AwsRedshiftClusterDeferredMaintenanceWindow -> Bool
$c== :: AwsRedshiftClusterDeferredMaintenanceWindow
-> AwsRedshiftClusterDeferredMaintenanceWindow -> Bool
Prelude.Eq, ReadPrec [AwsRedshiftClusterDeferredMaintenanceWindow]
ReadPrec AwsRedshiftClusterDeferredMaintenanceWindow
Int -> ReadS AwsRedshiftClusterDeferredMaintenanceWindow
ReadS [AwsRedshiftClusterDeferredMaintenanceWindow]
(Int -> ReadS AwsRedshiftClusterDeferredMaintenanceWindow)
-> ReadS [AwsRedshiftClusterDeferredMaintenanceWindow]
-> ReadPrec AwsRedshiftClusterDeferredMaintenanceWindow
-> ReadPrec [AwsRedshiftClusterDeferredMaintenanceWindow]
-> Read AwsRedshiftClusterDeferredMaintenanceWindow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRedshiftClusterDeferredMaintenanceWindow]
$creadListPrec :: ReadPrec [AwsRedshiftClusterDeferredMaintenanceWindow]
readPrec :: ReadPrec AwsRedshiftClusterDeferredMaintenanceWindow
$creadPrec :: ReadPrec AwsRedshiftClusterDeferredMaintenanceWindow
readList :: ReadS [AwsRedshiftClusterDeferredMaintenanceWindow]
$creadList :: ReadS [AwsRedshiftClusterDeferredMaintenanceWindow]
readsPrec :: Int -> ReadS AwsRedshiftClusterDeferredMaintenanceWindow
$creadsPrec :: Int -> ReadS AwsRedshiftClusterDeferredMaintenanceWindow
Prelude.Read, Int -> AwsRedshiftClusterDeferredMaintenanceWindow -> ShowS
[AwsRedshiftClusterDeferredMaintenanceWindow] -> ShowS
AwsRedshiftClusterDeferredMaintenanceWindow -> String
(Int -> AwsRedshiftClusterDeferredMaintenanceWindow -> ShowS)
-> (AwsRedshiftClusterDeferredMaintenanceWindow -> String)
-> ([AwsRedshiftClusterDeferredMaintenanceWindow] -> ShowS)
-> Show AwsRedshiftClusterDeferredMaintenanceWindow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRedshiftClusterDeferredMaintenanceWindow] -> ShowS
$cshowList :: [AwsRedshiftClusterDeferredMaintenanceWindow] -> ShowS
show :: AwsRedshiftClusterDeferredMaintenanceWindow -> String
$cshow :: AwsRedshiftClusterDeferredMaintenanceWindow -> String
showsPrec :: Int -> AwsRedshiftClusterDeferredMaintenanceWindow -> ShowS
$cshowsPrec :: Int -> AwsRedshiftClusterDeferredMaintenanceWindow -> ShowS
Prelude.Show, (forall x.
 AwsRedshiftClusterDeferredMaintenanceWindow
 -> Rep AwsRedshiftClusterDeferredMaintenanceWindow x)
-> (forall x.
    Rep AwsRedshiftClusterDeferredMaintenanceWindow x
    -> AwsRedshiftClusterDeferredMaintenanceWindow)
-> Generic AwsRedshiftClusterDeferredMaintenanceWindow
forall x.
Rep AwsRedshiftClusterDeferredMaintenanceWindow x
-> AwsRedshiftClusterDeferredMaintenanceWindow
forall x.
AwsRedshiftClusterDeferredMaintenanceWindow
-> Rep AwsRedshiftClusterDeferredMaintenanceWindow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRedshiftClusterDeferredMaintenanceWindow x
-> AwsRedshiftClusterDeferredMaintenanceWindow
$cfrom :: forall x.
AwsRedshiftClusterDeferredMaintenanceWindow
-> Rep AwsRedshiftClusterDeferredMaintenanceWindow x
Prelude.Generic)

-- |
-- Create a value of 'AwsRedshiftClusterDeferredMaintenanceWindow' 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:
--
-- 'deferMaintenanceEndTime', 'awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceEndTime' - The end of the time window for which maintenance was deferred.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'deferMaintenanceStartTime', 'awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceStartTime' - The start of the time window for which maintenance was deferred.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'deferMaintenanceIdentifier', 'awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceIdentifier' - The identifier of the maintenance window.
newAwsRedshiftClusterDeferredMaintenanceWindow ::
  AwsRedshiftClusterDeferredMaintenanceWindow
newAwsRedshiftClusterDeferredMaintenanceWindow :: AwsRedshiftClusterDeferredMaintenanceWindow
newAwsRedshiftClusterDeferredMaintenanceWindow =
  AwsRedshiftClusterDeferredMaintenanceWindow' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsRedshiftClusterDeferredMaintenanceWindow
AwsRedshiftClusterDeferredMaintenanceWindow'
    { $sel:deferMaintenanceEndTime:AwsRedshiftClusterDeferredMaintenanceWindow' :: Maybe Text
deferMaintenanceEndTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deferMaintenanceStartTime:AwsRedshiftClusterDeferredMaintenanceWindow' :: Maybe Text
deferMaintenanceStartTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deferMaintenanceIdentifier:AwsRedshiftClusterDeferredMaintenanceWindow' :: Maybe Text
deferMaintenanceIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The end of the time window for which maintenance was deferred.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceEndTime :: Lens.Lens' AwsRedshiftClusterDeferredMaintenanceWindow (Prelude.Maybe Prelude.Text)
awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceEndTime :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterDeferredMaintenanceWindow
-> f AwsRedshiftClusterDeferredMaintenanceWindow
awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceEndTime = (AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text)
-> (AwsRedshiftClusterDeferredMaintenanceWindow
    -> Maybe Text -> AwsRedshiftClusterDeferredMaintenanceWindow)
-> Lens
     AwsRedshiftClusterDeferredMaintenanceWindow
     AwsRedshiftClusterDeferredMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterDeferredMaintenanceWindow' {Maybe Text
deferMaintenanceEndTime :: Maybe Text
$sel:deferMaintenanceEndTime:AwsRedshiftClusterDeferredMaintenanceWindow' :: AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text
deferMaintenanceEndTime} -> Maybe Text
deferMaintenanceEndTime) (\s :: AwsRedshiftClusterDeferredMaintenanceWindow
s@AwsRedshiftClusterDeferredMaintenanceWindow' {} Maybe Text
a -> AwsRedshiftClusterDeferredMaintenanceWindow
s {$sel:deferMaintenanceEndTime:AwsRedshiftClusterDeferredMaintenanceWindow' :: Maybe Text
deferMaintenanceEndTime = Maybe Text
a} :: AwsRedshiftClusterDeferredMaintenanceWindow)

-- | The start of the time window for which maintenance was deferred.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceStartTime :: Lens.Lens' AwsRedshiftClusterDeferredMaintenanceWindow (Prelude.Maybe Prelude.Text)
awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceStartTime :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterDeferredMaintenanceWindow
-> f AwsRedshiftClusterDeferredMaintenanceWindow
awsRedshiftClusterDeferredMaintenanceWindow_deferMaintenanceStartTime = (AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text)
-> (AwsRedshiftClusterDeferredMaintenanceWindow
    -> Maybe Text -> AwsRedshiftClusterDeferredMaintenanceWindow)
-> Lens
     AwsRedshiftClusterDeferredMaintenanceWindow
     AwsRedshiftClusterDeferredMaintenanceWindow
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterDeferredMaintenanceWindow' {Maybe Text
deferMaintenanceStartTime :: Maybe Text
$sel:deferMaintenanceStartTime:AwsRedshiftClusterDeferredMaintenanceWindow' :: AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text
deferMaintenanceStartTime} -> Maybe Text
deferMaintenanceStartTime) (\s :: AwsRedshiftClusterDeferredMaintenanceWindow
s@AwsRedshiftClusterDeferredMaintenanceWindow' {} Maybe Text
a -> AwsRedshiftClusterDeferredMaintenanceWindow
s {$sel:deferMaintenanceStartTime:AwsRedshiftClusterDeferredMaintenanceWindow' :: Maybe Text
deferMaintenanceStartTime = Maybe Text
a} :: AwsRedshiftClusterDeferredMaintenanceWindow)

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

instance
  Core.FromJSON
    AwsRedshiftClusterDeferredMaintenanceWindow
  where
  parseJSON :: Value -> Parser AwsRedshiftClusterDeferredMaintenanceWindow
parseJSON =
    String
-> (Object -> Parser AwsRedshiftClusterDeferredMaintenanceWindow)
-> Value
-> Parser AwsRedshiftClusterDeferredMaintenanceWindow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRedshiftClusterDeferredMaintenanceWindow"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsRedshiftClusterDeferredMaintenanceWindow
AwsRedshiftClusterDeferredMaintenanceWindow'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsRedshiftClusterDeferredMaintenanceWindow)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> AwsRedshiftClusterDeferredMaintenanceWindow)
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
"DeferMaintenanceEndTime")
              Parser
  (Maybe Text
   -> Maybe Text -> AwsRedshiftClusterDeferredMaintenanceWindow)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> AwsRedshiftClusterDeferredMaintenanceWindow)
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
"DeferMaintenanceStartTime")
              Parser (Maybe Text -> AwsRedshiftClusterDeferredMaintenanceWindow)
-> Parser (Maybe Text)
-> Parser AwsRedshiftClusterDeferredMaintenanceWindow
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
"DeferMaintenanceIdentifier")
      )

instance
  Prelude.Hashable
    AwsRedshiftClusterDeferredMaintenanceWindow

instance
  Prelude.NFData
    AwsRedshiftClusterDeferredMaintenanceWindow

instance
  Core.ToJSON
    AwsRedshiftClusterDeferredMaintenanceWindow
  where
  toJSON :: AwsRedshiftClusterDeferredMaintenanceWindow -> Value
toJSON
    AwsRedshiftClusterDeferredMaintenanceWindow' {Maybe Text
deferMaintenanceIdentifier :: Maybe Text
deferMaintenanceStartTime :: Maybe Text
deferMaintenanceEndTime :: Maybe Text
$sel:deferMaintenanceIdentifier:AwsRedshiftClusterDeferredMaintenanceWindow' :: AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text
$sel:deferMaintenanceStartTime:AwsRedshiftClusterDeferredMaintenanceWindow' :: AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text
$sel:deferMaintenanceEndTime:AwsRedshiftClusterDeferredMaintenanceWindow' :: AwsRedshiftClusterDeferredMaintenanceWindow -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"DeferMaintenanceEndTime" 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
deferMaintenanceEndTime,
              (Text
"DeferMaintenanceStartTime" 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
deferMaintenanceStartTime,
              (Text
"DeferMaintenanceIdentifier" 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
deferMaintenanceIdentifier
            ]
        )