{-# 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.OpsWorks.Types.WeeklyAutoScalingSchedule
-- 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.OpsWorks.Types.WeeklyAutoScalingSchedule where

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

-- | Describes a time-based instance\'s auto scaling schedule. The schedule
-- consists of a set of key-value pairs.
--
-- -   The key is the time period (a UTC hour) and must be an integer from
--     0 - 23.
--
-- -   The value indicates whether the instance should be online or offline
--     for the specified period, and must be set to \"on\" or \"off\"
--
-- The default setting for all time periods is off, so you use the
-- following parameters primarily to specify the online periods. You don\'t
-- have to explicitly specify offline periods unless you want to change an
-- online period to an offline period.
--
-- The following example specifies that the instance should be online for
-- four hours, from UTC 1200 - 1600. It will be off for the remainder of
-- the day.
--
-- @ { \"12\":\"on\", \"13\":\"on\", \"14\":\"on\", \"15\":\"on\" } @
--
-- /See:/ 'newWeeklyAutoScalingSchedule' smart constructor.
data WeeklyAutoScalingSchedule = WeeklyAutoScalingSchedule'
  { -- | The schedule for Thursday.
    WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
thursday :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The schedule for Wednesday.
    WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
wednesday :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The schedule for Saturday.
    WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
saturday :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The schedule for Monday.
    WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
monday :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The schedule for Friday.
    WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
friday :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The schedule for Sunday.
    WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
sunday :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The schedule for Tuesday.
    WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
tuesday :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (WeeklyAutoScalingSchedule -> WeeklyAutoScalingSchedule -> Bool
(WeeklyAutoScalingSchedule -> WeeklyAutoScalingSchedule -> Bool)
-> (WeeklyAutoScalingSchedule -> WeeklyAutoScalingSchedule -> Bool)
-> Eq WeeklyAutoScalingSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WeeklyAutoScalingSchedule -> WeeklyAutoScalingSchedule -> Bool
$c/= :: WeeklyAutoScalingSchedule -> WeeklyAutoScalingSchedule -> Bool
== :: WeeklyAutoScalingSchedule -> WeeklyAutoScalingSchedule -> Bool
$c== :: WeeklyAutoScalingSchedule -> WeeklyAutoScalingSchedule -> Bool
Prelude.Eq, ReadPrec [WeeklyAutoScalingSchedule]
ReadPrec WeeklyAutoScalingSchedule
Int -> ReadS WeeklyAutoScalingSchedule
ReadS [WeeklyAutoScalingSchedule]
(Int -> ReadS WeeklyAutoScalingSchedule)
-> ReadS [WeeklyAutoScalingSchedule]
-> ReadPrec WeeklyAutoScalingSchedule
-> ReadPrec [WeeklyAutoScalingSchedule]
-> Read WeeklyAutoScalingSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WeeklyAutoScalingSchedule]
$creadListPrec :: ReadPrec [WeeklyAutoScalingSchedule]
readPrec :: ReadPrec WeeklyAutoScalingSchedule
$creadPrec :: ReadPrec WeeklyAutoScalingSchedule
readList :: ReadS [WeeklyAutoScalingSchedule]
$creadList :: ReadS [WeeklyAutoScalingSchedule]
readsPrec :: Int -> ReadS WeeklyAutoScalingSchedule
$creadsPrec :: Int -> ReadS WeeklyAutoScalingSchedule
Prelude.Read, Int -> WeeklyAutoScalingSchedule -> ShowS
[WeeklyAutoScalingSchedule] -> ShowS
WeeklyAutoScalingSchedule -> String
(Int -> WeeklyAutoScalingSchedule -> ShowS)
-> (WeeklyAutoScalingSchedule -> String)
-> ([WeeklyAutoScalingSchedule] -> ShowS)
-> Show WeeklyAutoScalingSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WeeklyAutoScalingSchedule] -> ShowS
$cshowList :: [WeeklyAutoScalingSchedule] -> ShowS
show :: WeeklyAutoScalingSchedule -> String
$cshow :: WeeklyAutoScalingSchedule -> String
showsPrec :: Int -> WeeklyAutoScalingSchedule -> ShowS
$cshowsPrec :: Int -> WeeklyAutoScalingSchedule -> ShowS
Prelude.Show, (forall x.
 WeeklyAutoScalingSchedule -> Rep WeeklyAutoScalingSchedule x)
-> (forall x.
    Rep WeeklyAutoScalingSchedule x -> WeeklyAutoScalingSchedule)
-> Generic WeeklyAutoScalingSchedule
forall x.
Rep WeeklyAutoScalingSchedule x -> WeeklyAutoScalingSchedule
forall x.
WeeklyAutoScalingSchedule -> Rep WeeklyAutoScalingSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WeeklyAutoScalingSchedule x -> WeeklyAutoScalingSchedule
$cfrom :: forall x.
WeeklyAutoScalingSchedule -> Rep WeeklyAutoScalingSchedule x
Prelude.Generic)

-- |
-- Create a value of 'WeeklyAutoScalingSchedule' 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:
--
-- 'thursday', 'weeklyAutoScalingSchedule_thursday' - The schedule for Thursday.
--
-- 'wednesday', 'weeklyAutoScalingSchedule_wednesday' - The schedule for Wednesday.
--
-- 'saturday', 'weeklyAutoScalingSchedule_saturday' - The schedule for Saturday.
--
-- 'monday', 'weeklyAutoScalingSchedule_monday' - The schedule for Monday.
--
-- 'friday', 'weeklyAutoScalingSchedule_friday' - The schedule for Friday.
--
-- 'sunday', 'weeklyAutoScalingSchedule_sunday' - The schedule for Sunday.
--
-- 'tuesday', 'weeklyAutoScalingSchedule_tuesday' - The schedule for Tuesday.
newWeeklyAutoScalingSchedule ::
  WeeklyAutoScalingSchedule
newWeeklyAutoScalingSchedule :: WeeklyAutoScalingSchedule
newWeeklyAutoScalingSchedule =
  WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> WeeklyAutoScalingSchedule
WeeklyAutoScalingSchedule'
    { $sel:thursday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
thursday =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:wednesday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
wednesday = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:saturday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
saturday = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:monday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
monday = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:friday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
friday = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:sunday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
sunday = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tuesday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
tuesday = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The schedule for Thursday.
weeklyAutoScalingSchedule_thursday :: Lens.Lens' WeeklyAutoScalingSchedule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
weeklyAutoScalingSchedule_thursday :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule
weeklyAutoScalingSchedule_thursday = (WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text))
-> (WeeklyAutoScalingSchedule
    -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Lens
     WeeklyAutoScalingSchedule
     WeeklyAutoScalingSchedule
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeeklyAutoScalingSchedule' {Maybe (HashMap Text Text)
thursday :: Maybe (HashMap Text Text)
$sel:thursday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
thursday} -> Maybe (HashMap Text Text)
thursday) (\s :: WeeklyAutoScalingSchedule
s@WeeklyAutoScalingSchedule' {} Maybe (HashMap Text Text)
a -> WeeklyAutoScalingSchedule
s {$sel:thursday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
thursday = Maybe (HashMap Text Text)
a} :: WeeklyAutoScalingSchedule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule
-> f WeeklyAutoScalingSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The schedule for Wednesday.
weeklyAutoScalingSchedule_wednesday :: Lens.Lens' WeeklyAutoScalingSchedule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
weeklyAutoScalingSchedule_wednesday :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule
weeklyAutoScalingSchedule_wednesday = (WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text))
-> (WeeklyAutoScalingSchedule
    -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Lens
     WeeklyAutoScalingSchedule
     WeeklyAutoScalingSchedule
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeeklyAutoScalingSchedule' {Maybe (HashMap Text Text)
wednesday :: Maybe (HashMap Text Text)
$sel:wednesday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
wednesday} -> Maybe (HashMap Text Text)
wednesday) (\s :: WeeklyAutoScalingSchedule
s@WeeklyAutoScalingSchedule' {} Maybe (HashMap Text Text)
a -> WeeklyAutoScalingSchedule
s {$sel:wednesday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
wednesday = Maybe (HashMap Text Text)
a} :: WeeklyAutoScalingSchedule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule
-> f WeeklyAutoScalingSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The schedule for Saturday.
weeklyAutoScalingSchedule_saturday :: Lens.Lens' WeeklyAutoScalingSchedule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
weeklyAutoScalingSchedule_saturday :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule
weeklyAutoScalingSchedule_saturday = (WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text))
-> (WeeklyAutoScalingSchedule
    -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Lens
     WeeklyAutoScalingSchedule
     WeeklyAutoScalingSchedule
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeeklyAutoScalingSchedule' {Maybe (HashMap Text Text)
saturday :: Maybe (HashMap Text Text)
$sel:saturday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
saturday} -> Maybe (HashMap Text Text)
saturday) (\s :: WeeklyAutoScalingSchedule
s@WeeklyAutoScalingSchedule' {} Maybe (HashMap Text Text)
a -> WeeklyAutoScalingSchedule
s {$sel:saturday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
saturday = Maybe (HashMap Text Text)
a} :: WeeklyAutoScalingSchedule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule
-> f WeeklyAutoScalingSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The schedule for Monday.
weeklyAutoScalingSchedule_monday :: Lens.Lens' WeeklyAutoScalingSchedule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
weeklyAutoScalingSchedule_monday :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule
weeklyAutoScalingSchedule_monday = (WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text))
-> (WeeklyAutoScalingSchedule
    -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Lens
     WeeklyAutoScalingSchedule
     WeeklyAutoScalingSchedule
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeeklyAutoScalingSchedule' {Maybe (HashMap Text Text)
monday :: Maybe (HashMap Text Text)
$sel:monday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
monday} -> Maybe (HashMap Text Text)
monday) (\s :: WeeklyAutoScalingSchedule
s@WeeklyAutoScalingSchedule' {} Maybe (HashMap Text Text)
a -> WeeklyAutoScalingSchedule
s {$sel:monday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
monday = Maybe (HashMap Text Text)
a} :: WeeklyAutoScalingSchedule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule
-> f WeeklyAutoScalingSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The schedule for Friday.
weeklyAutoScalingSchedule_friday :: Lens.Lens' WeeklyAutoScalingSchedule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
weeklyAutoScalingSchedule_friday :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule
weeklyAutoScalingSchedule_friday = (WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text))
-> (WeeklyAutoScalingSchedule
    -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Lens
     WeeklyAutoScalingSchedule
     WeeklyAutoScalingSchedule
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeeklyAutoScalingSchedule' {Maybe (HashMap Text Text)
friday :: Maybe (HashMap Text Text)
$sel:friday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
friday} -> Maybe (HashMap Text Text)
friday) (\s :: WeeklyAutoScalingSchedule
s@WeeklyAutoScalingSchedule' {} Maybe (HashMap Text Text)
a -> WeeklyAutoScalingSchedule
s {$sel:friday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
friday = Maybe (HashMap Text Text)
a} :: WeeklyAutoScalingSchedule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule
-> f WeeklyAutoScalingSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The schedule for Sunday.
weeklyAutoScalingSchedule_sunday :: Lens.Lens' WeeklyAutoScalingSchedule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
weeklyAutoScalingSchedule_sunday :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule
weeklyAutoScalingSchedule_sunday = (WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text))
-> (WeeklyAutoScalingSchedule
    -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Lens
     WeeklyAutoScalingSchedule
     WeeklyAutoScalingSchedule
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeeklyAutoScalingSchedule' {Maybe (HashMap Text Text)
sunday :: Maybe (HashMap Text Text)
$sel:sunday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
sunday} -> Maybe (HashMap Text Text)
sunday) (\s :: WeeklyAutoScalingSchedule
s@WeeklyAutoScalingSchedule' {} Maybe (HashMap Text Text)
a -> WeeklyAutoScalingSchedule
s {$sel:sunday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
sunday = Maybe (HashMap Text Text)
a} :: WeeklyAutoScalingSchedule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule
-> f WeeklyAutoScalingSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The schedule for Tuesday.
weeklyAutoScalingSchedule_tuesday :: Lens.Lens' WeeklyAutoScalingSchedule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
weeklyAutoScalingSchedule_tuesday :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule
weeklyAutoScalingSchedule_tuesday = (WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text))
-> (WeeklyAutoScalingSchedule
    -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Lens
     WeeklyAutoScalingSchedule
     WeeklyAutoScalingSchedule
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeeklyAutoScalingSchedule' {Maybe (HashMap Text Text)
tuesday :: Maybe (HashMap Text Text)
$sel:tuesday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
tuesday} -> Maybe (HashMap Text Text)
tuesday) (\s :: WeeklyAutoScalingSchedule
s@WeeklyAutoScalingSchedule' {} Maybe (HashMap Text Text)
a -> WeeklyAutoScalingSchedule
s {$sel:tuesday:WeeklyAutoScalingSchedule' :: Maybe (HashMap Text Text)
tuesday = Maybe (HashMap Text Text)
a} :: WeeklyAutoScalingSchedule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WeeklyAutoScalingSchedule -> f WeeklyAutoScalingSchedule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WeeklyAutoScalingSchedule
-> f WeeklyAutoScalingSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON WeeklyAutoScalingSchedule where
  parseJSON :: Value -> Parser WeeklyAutoScalingSchedule
parseJSON =
    String
-> (Object -> Parser WeeklyAutoScalingSchedule)
-> Value
-> Parser WeeklyAutoScalingSchedule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WeeklyAutoScalingSchedule"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> WeeklyAutoScalingSchedule
WeeklyAutoScalingSchedule'
            (Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> WeeklyAutoScalingSchedule)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> WeeklyAutoScalingSchedule)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Thursday" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> WeeklyAutoScalingSchedule)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> WeeklyAutoScalingSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Wednesday" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> WeeklyAutoScalingSchedule)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> WeeklyAutoScalingSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Saturday" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> WeeklyAutoScalingSchedule)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> WeeklyAutoScalingSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Monday" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> WeeklyAutoScalingSchedule)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Friday" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Sunday" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe (HashMap Text Text) -> WeeklyAutoScalingSchedule)
-> Parser (Maybe (HashMap Text Text))
-> Parser WeeklyAutoScalingSchedule
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tuesday" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable WeeklyAutoScalingSchedule

instance Prelude.NFData WeeklyAutoScalingSchedule

instance Core.ToJSON WeeklyAutoScalingSchedule where
  toJSON :: WeeklyAutoScalingSchedule -> Value
toJSON WeeklyAutoScalingSchedule' {Maybe (HashMap Text Text)
tuesday :: Maybe (HashMap Text Text)
sunday :: Maybe (HashMap Text Text)
friday :: Maybe (HashMap Text Text)
monday :: Maybe (HashMap Text Text)
saturday :: Maybe (HashMap Text Text)
wednesday :: Maybe (HashMap Text Text)
thursday :: Maybe (HashMap Text Text)
$sel:tuesday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
$sel:sunday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
$sel:friday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
$sel:monday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
$sel:saturday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
$sel:wednesday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
$sel:thursday:WeeklyAutoScalingSchedule' :: WeeklyAutoScalingSchedule -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Thursday" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
thursday,
            (Text
"Wednesday" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
wednesday,
            (Text
"Saturday" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
saturday,
            (Text
"Monday" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
monday,
            (Text
"Friday" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
friday,
            (Text
"Sunday" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
sunday,
            (Text
"Tuesday" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tuesday
          ]
      )