{-# 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.MaintenanceStatus
-- 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.MaintenanceStatus 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 MaintenanceStatus
--
-- /See:/ 'newMaintenanceStatus' smart constructor.
data MaintenanceStatus = MaintenanceStatus'
  { -- | The currently selected maintenance day.
    MaintenanceStatus -> Maybe MaintenanceDay
maintenanceDay :: Prelude.Maybe MaintenanceDay,
    -- | Maintenance is required by the displayed date and time. Date and time is
    -- in ISO.
    MaintenanceStatus -> Maybe Text
maintenanceDeadline :: Prelude.Maybe Prelude.Text,
    -- | The currently scheduled maintenance date and time. Date and time is in
    -- ISO.
    MaintenanceStatus -> Maybe Text
maintenanceScheduledDate :: Prelude.Maybe Prelude.Text,
    -- | The currently selected maintenance start time. Time is in UTC.
    MaintenanceStatus -> Maybe Text
maintenanceStartTime :: Prelude.Maybe Prelude.Text
  }
  deriving (MaintenanceStatus -> MaintenanceStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaintenanceStatus -> MaintenanceStatus -> Bool
$c/= :: MaintenanceStatus -> MaintenanceStatus -> Bool
== :: MaintenanceStatus -> MaintenanceStatus -> Bool
$c== :: MaintenanceStatus -> MaintenanceStatus -> Bool
Prelude.Eq, ReadPrec [MaintenanceStatus]
ReadPrec MaintenanceStatus
Int -> ReadS MaintenanceStatus
ReadS [MaintenanceStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MaintenanceStatus]
$creadListPrec :: ReadPrec [MaintenanceStatus]
readPrec :: ReadPrec MaintenanceStatus
$creadPrec :: ReadPrec MaintenanceStatus
readList :: ReadS [MaintenanceStatus]
$creadList :: ReadS [MaintenanceStatus]
readsPrec :: Int -> ReadS MaintenanceStatus
$creadsPrec :: Int -> ReadS MaintenanceStatus
Prelude.Read, Int -> MaintenanceStatus -> ShowS
[MaintenanceStatus] -> ShowS
MaintenanceStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaintenanceStatus] -> ShowS
$cshowList :: [MaintenanceStatus] -> ShowS
show :: MaintenanceStatus -> String
$cshow :: MaintenanceStatus -> String
showsPrec :: Int -> MaintenanceStatus -> ShowS
$cshowsPrec :: Int -> MaintenanceStatus -> ShowS
Prelude.Show, forall x. Rep MaintenanceStatus x -> MaintenanceStatus
forall x. MaintenanceStatus -> Rep MaintenanceStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MaintenanceStatus x -> MaintenanceStatus
$cfrom :: forall x. MaintenanceStatus -> Rep MaintenanceStatus x
Prelude.Generic)

-- |
-- Create a value of 'MaintenanceStatus' 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', 'maintenanceStatus_maintenanceDay' - The currently selected maintenance day.
--
-- 'maintenanceDeadline', 'maintenanceStatus_maintenanceDeadline' - Maintenance is required by the displayed date and time. Date and time is
-- in ISO.
--
-- 'maintenanceScheduledDate', 'maintenanceStatus_maintenanceScheduledDate' - The currently scheduled maintenance date and time. Date and time is in
-- ISO.
--
-- 'maintenanceStartTime', 'maintenanceStatus_maintenanceStartTime' - The currently selected maintenance start time. Time is in UTC.
newMaintenanceStatus ::
  MaintenanceStatus
newMaintenanceStatus :: MaintenanceStatus
newMaintenanceStatus =
  MaintenanceStatus'
    { $sel:maintenanceDay:MaintenanceStatus' :: Maybe MaintenanceDay
maintenanceDay =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceDeadline:MaintenanceStatus' :: Maybe Text
maintenanceDeadline = forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceScheduledDate:MaintenanceStatus' :: Maybe Text
maintenanceScheduledDate = forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceStartTime:MaintenanceStatus' :: Maybe Text
maintenanceStartTime = forall a. Maybe a
Prelude.Nothing
    }

-- | The currently selected maintenance day.
maintenanceStatus_maintenanceDay :: Lens.Lens' MaintenanceStatus (Prelude.Maybe MaintenanceDay)
maintenanceStatus_maintenanceDay :: Lens' MaintenanceStatus (Maybe MaintenanceDay)
maintenanceStatus_maintenanceDay = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceStatus' {Maybe MaintenanceDay
maintenanceDay :: Maybe MaintenanceDay
$sel:maintenanceDay:MaintenanceStatus' :: MaintenanceStatus -> Maybe MaintenanceDay
maintenanceDay} -> Maybe MaintenanceDay
maintenanceDay) (\s :: MaintenanceStatus
s@MaintenanceStatus' {} Maybe MaintenanceDay
a -> MaintenanceStatus
s {$sel:maintenanceDay:MaintenanceStatus' :: Maybe MaintenanceDay
maintenanceDay = Maybe MaintenanceDay
a} :: MaintenanceStatus)

-- | Maintenance is required by the displayed date and time. Date and time is
-- in ISO.
maintenanceStatus_maintenanceDeadline :: Lens.Lens' MaintenanceStatus (Prelude.Maybe Prelude.Text)
maintenanceStatus_maintenanceDeadline :: Lens' MaintenanceStatus (Maybe Text)
maintenanceStatus_maintenanceDeadline = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceStatus' {Maybe Text
maintenanceDeadline :: Maybe Text
$sel:maintenanceDeadline:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
maintenanceDeadline} -> Maybe Text
maintenanceDeadline) (\s :: MaintenanceStatus
s@MaintenanceStatus' {} Maybe Text
a -> MaintenanceStatus
s {$sel:maintenanceDeadline:MaintenanceStatus' :: Maybe Text
maintenanceDeadline = Maybe Text
a} :: MaintenanceStatus)

-- | The currently scheduled maintenance date and time. Date and time is in
-- ISO.
maintenanceStatus_maintenanceScheduledDate :: Lens.Lens' MaintenanceStatus (Prelude.Maybe Prelude.Text)
maintenanceStatus_maintenanceScheduledDate :: Lens' MaintenanceStatus (Maybe Text)
maintenanceStatus_maintenanceScheduledDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceStatus' {Maybe Text
maintenanceScheduledDate :: Maybe Text
$sel:maintenanceScheduledDate:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
maintenanceScheduledDate} -> Maybe Text
maintenanceScheduledDate) (\s :: MaintenanceStatus
s@MaintenanceStatus' {} Maybe Text
a -> MaintenanceStatus
s {$sel:maintenanceScheduledDate:MaintenanceStatus' :: Maybe Text
maintenanceScheduledDate = Maybe Text
a} :: MaintenanceStatus)

-- | The currently selected maintenance start time. Time is in UTC.
maintenanceStatus_maintenanceStartTime :: Lens.Lens' MaintenanceStatus (Prelude.Maybe Prelude.Text)
maintenanceStatus_maintenanceStartTime :: Lens' MaintenanceStatus (Maybe Text)
maintenanceStatus_maintenanceStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MaintenanceStatus' {Maybe Text
maintenanceStartTime :: Maybe Text
$sel:maintenanceStartTime:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
maintenanceStartTime} -> Maybe Text
maintenanceStartTime) (\s :: MaintenanceStatus
s@MaintenanceStatus' {} Maybe Text
a -> MaintenanceStatus
s {$sel:maintenanceStartTime:MaintenanceStatus' :: Maybe Text
maintenanceStartTime = Maybe Text
a} :: MaintenanceStatus)

instance Data.FromJSON MaintenanceStatus where
  parseJSON :: Value -> Parser MaintenanceStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MaintenanceStatus"
      ( \Object
x ->
          Maybe MaintenanceDay
-> Maybe Text -> Maybe Text -> Maybe Text -> MaintenanceStatus
MaintenanceStatus'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"maintenanceDay")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"maintenanceDeadline")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"maintenanceScheduledDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"maintenanceStartTime")
      )

instance Prelude.Hashable MaintenanceStatus where
  hashWithSalt :: Int -> MaintenanceStatus -> Int
hashWithSalt Int
_salt MaintenanceStatus' {Maybe Text
Maybe MaintenanceDay
maintenanceStartTime :: Maybe Text
maintenanceScheduledDate :: Maybe Text
maintenanceDeadline :: Maybe Text
maintenanceDay :: Maybe MaintenanceDay
$sel:maintenanceStartTime:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
$sel:maintenanceScheduledDate:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
$sel:maintenanceDeadline:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
$sel:maintenanceDay:MaintenanceStatus' :: MaintenanceStatus -> 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
maintenanceDeadline
      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 MaintenanceStatus where
  rnf :: MaintenanceStatus -> ()
rnf MaintenanceStatus' {Maybe Text
Maybe MaintenanceDay
maintenanceStartTime :: Maybe Text
maintenanceScheduledDate :: Maybe Text
maintenanceDeadline :: Maybe Text
maintenanceDay :: Maybe MaintenanceDay
$sel:maintenanceStartTime:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
$sel:maintenanceScheduledDate:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
$sel:maintenanceDeadline:MaintenanceStatus' :: MaintenanceStatus -> Maybe Text
$sel:maintenanceDay:MaintenanceStatus' :: MaintenanceStatus -> 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
maintenanceDeadline
      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