{-# 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.KinesisAnalyticsV2.Types.ApplicationMaintenanceConfigurationDescription
-- 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.KinesisAnalyticsV2.Types.ApplicationMaintenanceConfigurationDescription where

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

-- | The details of the maintenance configuration for the application.
--
-- /See:/ 'newApplicationMaintenanceConfigurationDescription' smart constructor.
data ApplicationMaintenanceConfigurationDescription = ApplicationMaintenanceConfigurationDescription'
  { -- | The start time for the maintenance window.
    ApplicationMaintenanceConfigurationDescription -> Text
applicationMaintenanceWindowStartTime :: Prelude.Text,
    -- | The end time for the maintenance window.
    ApplicationMaintenanceConfigurationDescription -> Text
applicationMaintenanceWindowEndTime :: Prelude.Text
  }
  deriving (ApplicationMaintenanceConfigurationDescription
-> ApplicationMaintenanceConfigurationDescription -> Bool
(ApplicationMaintenanceConfigurationDescription
 -> ApplicationMaintenanceConfigurationDescription -> Bool)
-> (ApplicationMaintenanceConfigurationDescription
    -> ApplicationMaintenanceConfigurationDescription -> Bool)
-> Eq ApplicationMaintenanceConfigurationDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationMaintenanceConfigurationDescription
-> ApplicationMaintenanceConfigurationDescription -> Bool
$c/= :: ApplicationMaintenanceConfigurationDescription
-> ApplicationMaintenanceConfigurationDescription -> Bool
== :: ApplicationMaintenanceConfigurationDescription
-> ApplicationMaintenanceConfigurationDescription -> Bool
$c== :: ApplicationMaintenanceConfigurationDescription
-> ApplicationMaintenanceConfigurationDescription -> Bool
Prelude.Eq, ReadPrec [ApplicationMaintenanceConfigurationDescription]
ReadPrec ApplicationMaintenanceConfigurationDescription
Int -> ReadS ApplicationMaintenanceConfigurationDescription
ReadS [ApplicationMaintenanceConfigurationDescription]
(Int -> ReadS ApplicationMaintenanceConfigurationDescription)
-> ReadS [ApplicationMaintenanceConfigurationDescription]
-> ReadPrec ApplicationMaintenanceConfigurationDescription
-> ReadPrec [ApplicationMaintenanceConfigurationDescription]
-> Read ApplicationMaintenanceConfigurationDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationMaintenanceConfigurationDescription]
$creadListPrec :: ReadPrec [ApplicationMaintenanceConfigurationDescription]
readPrec :: ReadPrec ApplicationMaintenanceConfigurationDescription
$creadPrec :: ReadPrec ApplicationMaintenanceConfigurationDescription
readList :: ReadS [ApplicationMaintenanceConfigurationDescription]
$creadList :: ReadS [ApplicationMaintenanceConfigurationDescription]
readsPrec :: Int -> ReadS ApplicationMaintenanceConfigurationDescription
$creadsPrec :: Int -> ReadS ApplicationMaintenanceConfigurationDescription
Prelude.Read, Int -> ApplicationMaintenanceConfigurationDescription -> ShowS
[ApplicationMaintenanceConfigurationDescription] -> ShowS
ApplicationMaintenanceConfigurationDescription -> String
(Int -> ApplicationMaintenanceConfigurationDescription -> ShowS)
-> (ApplicationMaintenanceConfigurationDescription -> String)
-> ([ApplicationMaintenanceConfigurationDescription] -> ShowS)
-> Show ApplicationMaintenanceConfigurationDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationMaintenanceConfigurationDescription] -> ShowS
$cshowList :: [ApplicationMaintenanceConfigurationDescription] -> ShowS
show :: ApplicationMaintenanceConfigurationDescription -> String
$cshow :: ApplicationMaintenanceConfigurationDescription -> String
showsPrec :: Int -> ApplicationMaintenanceConfigurationDescription -> ShowS
$cshowsPrec :: Int -> ApplicationMaintenanceConfigurationDescription -> ShowS
Prelude.Show, (forall x.
 ApplicationMaintenanceConfigurationDescription
 -> Rep ApplicationMaintenanceConfigurationDescription x)
-> (forall x.
    Rep ApplicationMaintenanceConfigurationDescription x
    -> ApplicationMaintenanceConfigurationDescription)
-> Generic ApplicationMaintenanceConfigurationDescription
forall x.
Rep ApplicationMaintenanceConfigurationDescription x
-> ApplicationMaintenanceConfigurationDescription
forall x.
ApplicationMaintenanceConfigurationDescription
-> Rep ApplicationMaintenanceConfigurationDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationMaintenanceConfigurationDescription x
-> ApplicationMaintenanceConfigurationDescription
$cfrom :: forall x.
ApplicationMaintenanceConfigurationDescription
-> Rep ApplicationMaintenanceConfigurationDescription x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationMaintenanceConfigurationDescription' 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:
--
-- 'applicationMaintenanceWindowStartTime', 'applicationMaintenanceConfigurationDescription_applicationMaintenanceWindowStartTime' - The start time for the maintenance window.
--
-- 'applicationMaintenanceWindowEndTime', 'applicationMaintenanceConfigurationDescription_applicationMaintenanceWindowEndTime' - The end time for the maintenance window.
newApplicationMaintenanceConfigurationDescription ::
  -- | 'applicationMaintenanceWindowStartTime'
  Prelude.Text ->
  -- | 'applicationMaintenanceWindowEndTime'
  Prelude.Text ->
  ApplicationMaintenanceConfigurationDescription
newApplicationMaintenanceConfigurationDescription :: Text -> Text -> ApplicationMaintenanceConfigurationDescription
newApplicationMaintenanceConfigurationDescription
  Text
pApplicationMaintenanceWindowStartTime_
  Text
pApplicationMaintenanceWindowEndTime_ =
    ApplicationMaintenanceConfigurationDescription' :: Text -> Text -> ApplicationMaintenanceConfigurationDescription
ApplicationMaintenanceConfigurationDescription'
      { $sel:applicationMaintenanceWindowStartTime:ApplicationMaintenanceConfigurationDescription' :: Text
applicationMaintenanceWindowStartTime =
          Text
pApplicationMaintenanceWindowStartTime_,
        $sel:applicationMaintenanceWindowEndTime:ApplicationMaintenanceConfigurationDescription' :: Text
applicationMaintenanceWindowEndTime =
          Text
pApplicationMaintenanceWindowEndTime_
      }

-- | The start time for the maintenance window.
applicationMaintenanceConfigurationDescription_applicationMaintenanceWindowStartTime :: Lens.Lens' ApplicationMaintenanceConfigurationDescription Prelude.Text
applicationMaintenanceConfigurationDescription_applicationMaintenanceWindowStartTime :: (Text -> f Text)
-> ApplicationMaintenanceConfigurationDescription
-> f ApplicationMaintenanceConfigurationDescription
applicationMaintenanceConfigurationDescription_applicationMaintenanceWindowStartTime = (ApplicationMaintenanceConfigurationDescription -> Text)
-> (ApplicationMaintenanceConfigurationDescription
    -> Text -> ApplicationMaintenanceConfigurationDescription)
-> Lens
     ApplicationMaintenanceConfigurationDescription
     ApplicationMaintenanceConfigurationDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationMaintenanceConfigurationDescription' {Text
applicationMaintenanceWindowStartTime :: Text
$sel:applicationMaintenanceWindowStartTime:ApplicationMaintenanceConfigurationDescription' :: ApplicationMaintenanceConfigurationDescription -> Text
applicationMaintenanceWindowStartTime} -> Text
applicationMaintenanceWindowStartTime) (\s :: ApplicationMaintenanceConfigurationDescription
s@ApplicationMaintenanceConfigurationDescription' {} Text
a -> ApplicationMaintenanceConfigurationDescription
s {$sel:applicationMaintenanceWindowStartTime:ApplicationMaintenanceConfigurationDescription' :: Text
applicationMaintenanceWindowStartTime = Text
a} :: ApplicationMaintenanceConfigurationDescription)

-- | The end time for the maintenance window.
applicationMaintenanceConfigurationDescription_applicationMaintenanceWindowEndTime :: Lens.Lens' ApplicationMaintenanceConfigurationDescription Prelude.Text
applicationMaintenanceConfigurationDescription_applicationMaintenanceWindowEndTime :: (Text -> f Text)
-> ApplicationMaintenanceConfigurationDescription
-> f ApplicationMaintenanceConfigurationDescription
applicationMaintenanceConfigurationDescription_applicationMaintenanceWindowEndTime = (ApplicationMaintenanceConfigurationDescription -> Text)
-> (ApplicationMaintenanceConfigurationDescription
    -> Text -> ApplicationMaintenanceConfigurationDescription)
-> Lens
     ApplicationMaintenanceConfigurationDescription
     ApplicationMaintenanceConfigurationDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationMaintenanceConfigurationDescription' {Text
applicationMaintenanceWindowEndTime :: Text
$sel:applicationMaintenanceWindowEndTime:ApplicationMaintenanceConfigurationDescription' :: ApplicationMaintenanceConfigurationDescription -> Text
applicationMaintenanceWindowEndTime} -> Text
applicationMaintenanceWindowEndTime) (\s :: ApplicationMaintenanceConfigurationDescription
s@ApplicationMaintenanceConfigurationDescription' {} Text
a -> ApplicationMaintenanceConfigurationDescription
s {$sel:applicationMaintenanceWindowEndTime:ApplicationMaintenanceConfigurationDescription' :: Text
applicationMaintenanceWindowEndTime = Text
a} :: ApplicationMaintenanceConfigurationDescription)

instance
  Core.FromJSON
    ApplicationMaintenanceConfigurationDescription
  where
  parseJSON :: Value -> Parser ApplicationMaintenanceConfigurationDescription
parseJSON =
    String
-> (Object
    -> Parser ApplicationMaintenanceConfigurationDescription)
-> Value
-> Parser ApplicationMaintenanceConfigurationDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApplicationMaintenanceConfigurationDescription"
      ( \Object
x ->
          Text -> Text -> ApplicationMaintenanceConfigurationDescription
ApplicationMaintenanceConfigurationDescription'
            (Text -> Text -> ApplicationMaintenanceConfigurationDescription)
-> Parser Text
-> Parser (Text -> ApplicationMaintenanceConfigurationDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationMaintenanceWindowStartTime")
              Parser (Text -> ApplicationMaintenanceConfigurationDescription)
-> Parser Text
-> Parser ApplicationMaintenanceConfigurationDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ApplicationMaintenanceWindowEndTime")
      )

instance
  Prelude.Hashable
    ApplicationMaintenanceConfigurationDescription

instance
  Prelude.NFData
    ApplicationMaintenanceConfigurationDescription