{-# 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.MediaLive.Types.MaintenanceUpdateSettings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.MaintenanceUpdateSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.MaintenanceDay
import qualified Amazonka.Prelude as Prelude

-- | Placeholder documentation for MaintenanceUpdateSettings
--
-- /See:/ 'newMaintenanceUpdateSettings' smart constructor.
data MaintenanceUpdateSettings = MaintenanceUpdateSettings'
  { -- | Choose one day of the week for maintenance. The chosen day is used for
    -- all future maintenance windows.
    MaintenanceUpdateSettings -> Maybe MaintenanceDay
maintenanceDay :: Prelude.Maybe MaintenanceDay,
    -- | Choose a specific date for maintenance to occur. The chosen date is used
    -- for the next maintenance window only.
    MaintenanceUpdateSettings -> Maybe Text
maintenanceScheduledDate :: Prelude.Maybe Prelude.Text,
    -- | Choose the hour that maintenance will start. The chosen time is used for
    -- all future maintenance windows.
    MaintenanceUpdateSettings -> Maybe Text
maintenanceStartTime :: Prelude.Maybe Prelude.Text
  }
  deriving (MaintenanceUpdateSettings -> MaintenanceUpdateSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaintenanceUpdateSettings -> MaintenanceUpdateSettings -> Bool
$c/= :: MaintenanceUpdateSettings -> MaintenanceUpdateSettings -> Bool
== :: MaintenanceUpdateSettings -> MaintenanceUpdateSettings -> Bool
$c== :: MaintenanceUpdateSettings -> MaintenanceUpdateSettings -> Bool
Prelude.Eq, ReadPrec [MaintenanceUpdateSettings]
ReadPrec MaintenanceUpdateSettings
Int -> ReadS MaintenanceUpdateSettings
ReadS [MaintenanceUpdateSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MaintenanceUpdateSettings]
$creadListPrec :: ReadPrec [MaintenanceUpdateSettings]
readPrec :: ReadPrec MaintenanceUpdateSettings
$creadPrec :: ReadPrec MaintenanceUpdateSettings
readList :: ReadS [MaintenanceUpdateSettings]
$creadList :: ReadS [MaintenanceUpdateSettings]
readsPrec :: Int -> ReadS MaintenanceUpdateSettings
$creadsPrec :: Int -> ReadS MaintenanceUpdateSettings
Prelude.Read, Int -> MaintenanceUpdateSettings -> ShowS
[MaintenanceUpdateSettings] -> ShowS
MaintenanceUpdateSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaintenanceUpdateSettings] -> ShowS
$cshowList :: [MaintenanceUpdateSettings] -> ShowS
show :: MaintenanceUpdateSettings -> String
$cshow :: MaintenanceUpdateSettings -> String
showsPrec :: Int -> MaintenanceUpdateSettings -> ShowS
$cshowsPrec :: Int -> MaintenanceUpdateSettings -> ShowS
Prelude.Show, forall x.
Rep MaintenanceUpdateSettings x -> MaintenanceUpdateSettings
forall x.
MaintenanceUpdateSettings -> Rep MaintenanceUpdateSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MaintenanceUpdateSettings x -> MaintenanceUpdateSettings
$cfrom :: forall x.
MaintenanceUpdateSettings -> Rep MaintenanceUpdateSettings x
Prelude.Generic)

-- |
-- Create a value of 'MaintenanceUpdateSettings' 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:
--
-- 'maintenanceDay', 'maintenanceUpdateSettings_maintenanceDay' - Choose one day of the week for maintenance. The chosen day is used for
-- all future maintenance windows.
--
-- 'maintenanceScheduledDate', 'maintenanceUpdateSettings_maintenanceScheduledDate' - Choose a specific date for maintenance to occur. The chosen date is used
-- for the next maintenance window only.
--
-- 'maintenanceStartTime', 'maintenanceUpdateSettings_maintenanceStartTime' - Choose the hour that maintenance will start. The chosen time is used for
-- all future maintenance windows.
newMaintenanceUpdateSettings ::
  MaintenanceUpdateSettings
newMaintenanceUpdateSettings :: MaintenanceUpdateSettings
newMaintenanceUpdateSettings =
  MaintenanceUpdateSettings'
    { $sel:maintenanceDay:MaintenanceUpdateSettings' :: Maybe MaintenanceDay
maintenanceDay =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceScheduledDate:MaintenanceUpdateSettings' :: Maybe Text
maintenanceScheduledDate = forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceStartTime:MaintenanceUpdateSettings' :: Maybe Text
maintenanceStartTime = forall a. Maybe a
Prelude.Nothing
    }

-- | Choose one day of the week for maintenance. The chosen day is used for
-- all future maintenance windows.
maintenanceUpdateSettings_maintenanceDay :: Lens.Lens' MaintenanceUpdateSettings (Prelude.Maybe MaintenanceDay)
maintenanceUpdateSettings_maintenanceDay :: Lens' MaintenanceUpdateSettings (Maybe MaintenanceDay)
maintenanceUpdateSettings_maintenanceDay = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceUpdateSettings' {Maybe MaintenanceDay
maintenanceDay :: Maybe MaintenanceDay
$sel:maintenanceDay:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe MaintenanceDay
maintenanceDay} -> Maybe MaintenanceDay
maintenanceDay) (\s :: MaintenanceUpdateSettings
s@MaintenanceUpdateSettings' {} Maybe MaintenanceDay
a -> MaintenanceUpdateSettings
s {$sel:maintenanceDay:MaintenanceUpdateSettings' :: Maybe MaintenanceDay
maintenanceDay = Maybe MaintenanceDay
a} :: MaintenanceUpdateSettings)

-- | Choose a specific date for maintenance to occur. The chosen date is used
-- for the next maintenance window only.
maintenanceUpdateSettings_maintenanceScheduledDate :: Lens.Lens' MaintenanceUpdateSettings (Prelude.Maybe Prelude.Text)
maintenanceUpdateSettings_maintenanceScheduledDate :: Lens' MaintenanceUpdateSettings (Maybe Text)
maintenanceUpdateSettings_maintenanceScheduledDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceUpdateSettings' {Maybe Text
maintenanceScheduledDate :: Maybe Text
$sel:maintenanceScheduledDate:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe Text
maintenanceScheduledDate} -> Maybe Text
maintenanceScheduledDate) (\s :: MaintenanceUpdateSettings
s@MaintenanceUpdateSettings' {} Maybe Text
a -> MaintenanceUpdateSettings
s {$sel:maintenanceScheduledDate:MaintenanceUpdateSettings' :: Maybe Text
maintenanceScheduledDate = Maybe Text
a} :: MaintenanceUpdateSettings)

-- | Choose the hour that maintenance will start. The chosen time is used for
-- all future maintenance windows.
maintenanceUpdateSettings_maintenanceStartTime :: Lens.Lens' MaintenanceUpdateSettings (Prelude.Maybe Prelude.Text)
maintenanceUpdateSettings_maintenanceStartTime :: Lens' MaintenanceUpdateSettings (Maybe Text)
maintenanceUpdateSettings_maintenanceStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceUpdateSettings' {Maybe Text
maintenanceStartTime :: Maybe Text
$sel:maintenanceStartTime:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe Text
maintenanceStartTime} -> Maybe Text
maintenanceStartTime) (\s :: MaintenanceUpdateSettings
s@MaintenanceUpdateSettings' {} Maybe Text
a -> MaintenanceUpdateSettings
s {$sel:maintenanceStartTime:MaintenanceUpdateSettings' :: Maybe Text
maintenanceStartTime = Maybe Text
a} :: MaintenanceUpdateSettings)

instance Prelude.Hashable MaintenanceUpdateSettings where
  hashWithSalt :: Int -> MaintenanceUpdateSettings -> Int
hashWithSalt Int
_salt MaintenanceUpdateSettings' {Maybe Text
Maybe MaintenanceDay
maintenanceStartTime :: Maybe Text
maintenanceScheduledDate :: Maybe Text
maintenanceDay :: Maybe MaintenanceDay
$sel:maintenanceStartTime:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe Text
$sel:maintenanceScheduledDate:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe Text
$sel:maintenanceDay:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe MaintenanceDay
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MaintenanceDay
maintenanceDay
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maintenanceScheduledDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maintenanceStartTime

instance Prelude.NFData MaintenanceUpdateSettings where
  rnf :: MaintenanceUpdateSettings -> ()
rnf MaintenanceUpdateSettings' {Maybe Text
Maybe MaintenanceDay
maintenanceStartTime :: Maybe Text
maintenanceScheduledDate :: Maybe Text
maintenanceDay :: Maybe MaintenanceDay
$sel:maintenanceStartTime:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe Text
$sel:maintenanceScheduledDate:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe Text
$sel:maintenanceDay:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe MaintenanceDay
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MaintenanceDay
maintenanceDay
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maintenanceScheduledDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maintenanceStartTime

instance Data.ToJSON MaintenanceUpdateSettings where
  toJSON :: MaintenanceUpdateSettings -> Value
toJSON MaintenanceUpdateSettings' {Maybe Text
Maybe MaintenanceDay
maintenanceStartTime :: Maybe Text
maintenanceScheduledDate :: Maybe Text
maintenanceDay :: Maybe MaintenanceDay
$sel:maintenanceStartTime:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe Text
$sel:maintenanceScheduledDate:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe Text
$sel:maintenanceDay:MaintenanceUpdateSettings' :: MaintenanceUpdateSettings -> Maybe MaintenanceDay
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"maintenanceDay" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MaintenanceDay
maintenanceDay,
            (Key
"maintenanceScheduledDate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maintenanceScheduledDate,
            (Key
"maintenanceStartTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maintenanceStartTime
          ]
      )