{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AutoScaling.PutScheduledUpdateGroupAction
-- 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)
--
-- Creates or updates a scheduled scaling action for an Auto Scaling group.
--
-- For more information, see
-- <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html Scheduled scaling>
-- in the /Amazon EC2 Auto Scaling User Guide/.
--
-- You can view the scheduled actions for an Auto Scaling group using the
-- DescribeScheduledActions API call. If you are no longer using a
-- scheduled action, you can delete it by calling the DeleteScheduledAction
-- API.
module Amazonka.AutoScaling.PutScheduledUpdateGroupAction
  ( -- * Creating a Request
    PutScheduledUpdateGroupAction (..),
    newPutScheduledUpdateGroupAction,

    -- * Request Lenses
    putScheduledUpdateGroupAction_startTime,
    putScheduledUpdateGroupAction_time,
    putScheduledUpdateGroupAction_maxSize,
    putScheduledUpdateGroupAction_recurrence,
    putScheduledUpdateGroupAction_desiredCapacity,
    putScheduledUpdateGroupAction_minSize,
    putScheduledUpdateGroupAction_endTime,
    putScheduledUpdateGroupAction_timeZone,
    putScheduledUpdateGroupAction_autoScalingGroupName,
    putScheduledUpdateGroupAction_scheduledActionName,

    -- * Destructuring the Response
    PutScheduledUpdateGroupActionResponse (..),
    newPutScheduledUpdateGroupActionResponse,
  )
where

import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newPutScheduledUpdateGroupAction' smart constructor.
data PutScheduledUpdateGroupAction = PutScheduledUpdateGroupAction'
  { -- | The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ
    -- format in UTC\/GMT only and in quotes (for example,
    -- @\"2019-06-01T00:00:00Z\"@).
    --
    -- If you specify @Recurrence@ and @StartTime@, Amazon EC2 Auto Scaling
    -- performs the action at this time, and then performs the action based on
    -- the specified recurrence.
    --
    -- If you try to schedule your action in the past, Amazon EC2 Auto Scaling
    -- returns an error message.
    PutScheduledUpdateGroupAction -> Maybe ISO8601
startTime :: Prelude.Maybe Core.ISO8601,
    -- | This parameter is no longer used.
    PutScheduledUpdateGroupAction -> Maybe ISO8601
time :: Prelude.Maybe Core.ISO8601,
    -- | The maximum size of the Auto Scaling group.
    PutScheduledUpdateGroupAction -> Maybe Int
maxSize :: Prelude.Maybe Prelude.Int,
    -- | The recurring schedule for this action. This format consists of five
    -- fields separated by white spaces: [Minute] [Hour] [Day_of_Month]
    -- [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example,
    -- @\"30 0 1 1,6,12 *\"@). For more information about this format, see
    -- <http://crontab.org Crontab>.
    --
    -- When @StartTime@ and @EndTime@ are specified with @Recurrence@, they
    -- form the boundaries of when the recurring action starts and stops.
    --
    -- Cron expressions use Universal Coordinated Time (UTC) by default.
    PutScheduledUpdateGroupAction -> Maybe Text
recurrence :: Prelude.Maybe Prelude.Text,
    -- | The desired capacity is the initial capacity of the Auto Scaling group
    -- after the scheduled action runs and the capacity it attempts to
    -- maintain. It can scale beyond this capacity if you add more scaling
    -- conditions.
    PutScheduledUpdateGroupAction -> Maybe Int
desiredCapacity :: Prelude.Maybe Prelude.Int,
    -- | The minimum size of the Auto Scaling group.
    PutScheduledUpdateGroupAction -> Maybe Int
minSize :: Prelude.Maybe Prelude.Int,
    -- | The date and time for the recurring schedule to end, in UTC.
    PutScheduledUpdateGroupAction -> Maybe ISO8601
endTime :: Prelude.Maybe Core.ISO8601,
    -- | Specifies the time zone for a cron expression. If a time zone is not
    -- provided, UTC is used by default.
    --
    -- Valid values are the canonical names of the IANA time zones, derived
    -- from the IANA Time Zone Database (such as @Etc\/GMT+9@ or
    -- @Pacific\/Tahiti@). For more information, see
    -- <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>.
    PutScheduledUpdateGroupAction -> Maybe Text
timeZone :: Prelude.Maybe Prelude.Text,
    -- | The name of the Auto Scaling group.
    PutScheduledUpdateGroupAction -> Text
autoScalingGroupName :: Prelude.Text,
    -- | The name of this scaling action.
    PutScheduledUpdateGroupAction -> Text
scheduledActionName :: Prelude.Text
  }
  deriving (PutScheduledUpdateGroupAction
-> PutScheduledUpdateGroupAction -> Bool
(PutScheduledUpdateGroupAction
 -> PutScheduledUpdateGroupAction -> Bool)
-> (PutScheduledUpdateGroupAction
    -> PutScheduledUpdateGroupAction -> Bool)
-> Eq PutScheduledUpdateGroupAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutScheduledUpdateGroupAction
-> PutScheduledUpdateGroupAction -> Bool
$c/= :: PutScheduledUpdateGroupAction
-> PutScheduledUpdateGroupAction -> Bool
== :: PutScheduledUpdateGroupAction
-> PutScheduledUpdateGroupAction -> Bool
$c== :: PutScheduledUpdateGroupAction
-> PutScheduledUpdateGroupAction -> Bool
Prelude.Eq, ReadPrec [PutScheduledUpdateGroupAction]
ReadPrec PutScheduledUpdateGroupAction
Int -> ReadS PutScheduledUpdateGroupAction
ReadS [PutScheduledUpdateGroupAction]
(Int -> ReadS PutScheduledUpdateGroupAction)
-> ReadS [PutScheduledUpdateGroupAction]
-> ReadPrec PutScheduledUpdateGroupAction
-> ReadPrec [PutScheduledUpdateGroupAction]
-> Read PutScheduledUpdateGroupAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutScheduledUpdateGroupAction]
$creadListPrec :: ReadPrec [PutScheduledUpdateGroupAction]
readPrec :: ReadPrec PutScheduledUpdateGroupAction
$creadPrec :: ReadPrec PutScheduledUpdateGroupAction
readList :: ReadS [PutScheduledUpdateGroupAction]
$creadList :: ReadS [PutScheduledUpdateGroupAction]
readsPrec :: Int -> ReadS PutScheduledUpdateGroupAction
$creadsPrec :: Int -> ReadS PutScheduledUpdateGroupAction
Prelude.Read, Int -> PutScheduledUpdateGroupAction -> ShowS
[PutScheduledUpdateGroupAction] -> ShowS
PutScheduledUpdateGroupAction -> String
(Int -> PutScheduledUpdateGroupAction -> ShowS)
-> (PutScheduledUpdateGroupAction -> String)
-> ([PutScheduledUpdateGroupAction] -> ShowS)
-> Show PutScheduledUpdateGroupAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutScheduledUpdateGroupAction] -> ShowS
$cshowList :: [PutScheduledUpdateGroupAction] -> ShowS
show :: PutScheduledUpdateGroupAction -> String
$cshow :: PutScheduledUpdateGroupAction -> String
showsPrec :: Int -> PutScheduledUpdateGroupAction -> ShowS
$cshowsPrec :: Int -> PutScheduledUpdateGroupAction -> ShowS
Prelude.Show, (forall x.
 PutScheduledUpdateGroupAction
 -> Rep PutScheduledUpdateGroupAction x)
-> (forall x.
    Rep PutScheduledUpdateGroupAction x
    -> PutScheduledUpdateGroupAction)
-> Generic PutScheduledUpdateGroupAction
forall x.
Rep PutScheduledUpdateGroupAction x
-> PutScheduledUpdateGroupAction
forall x.
PutScheduledUpdateGroupAction
-> Rep PutScheduledUpdateGroupAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutScheduledUpdateGroupAction x
-> PutScheduledUpdateGroupAction
$cfrom :: forall x.
PutScheduledUpdateGroupAction
-> Rep PutScheduledUpdateGroupAction x
Prelude.Generic)

-- |
-- Create a value of 'PutScheduledUpdateGroupAction' 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:
--
-- 'startTime', 'putScheduledUpdateGroupAction_startTime' - The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ
-- format in UTC\/GMT only and in quotes (for example,
-- @\"2019-06-01T00:00:00Z\"@).
--
-- If you specify @Recurrence@ and @StartTime@, Amazon EC2 Auto Scaling
-- performs the action at this time, and then performs the action based on
-- the specified recurrence.
--
-- If you try to schedule your action in the past, Amazon EC2 Auto Scaling
-- returns an error message.
--
-- 'time', 'putScheduledUpdateGroupAction_time' - This parameter is no longer used.
--
-- 'maxSize', 'putScheduledUpdateGroupAction_maxSize' - The maximum size of the Auto Scaling group.
--
-- 'recurrence', 'putScheduledUpdateGroupAction_recurrence' - The recurring schedule for this action. This format consists of five
-- fields separated by white spaces: [Minute] [Hour] [Day_of_Month]
-- [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example,
-- @\"30 0 1 1,6,12 *\"@). For more information about this format, see
-- <http://crontab.org Crontab>.
--
-- When @StartTime@ and @EndTime@ are specified with @Recurrence@, they
-- form the boundaries of when the recurring action starts and stops.
--
-- Cron expressions use Universal Coordinated Time (UTC) by default.
--
-- 'desiredCapacity', 'putScheduledUpdateGroupAction_desiredCapacity' - The desired capacity is the initial capacity of the Auto Scaling group
-- after the scheduled action runs and the capacity it attempts to
-- maintain. It can scale beyond this capacity if you add more scaling
-- conditions.
--
-- 'minSize', 'putScheduledUpdateGroupAction_minSize' - The minimum size of the Auto Scaling group.
--
-- 'endTime', 'putScheduledUpdateGroupAction_endTime' - The date and time for the recurring schedule to end, in UTC.
--
-- 'timeZone', 'putScheduledUpdateGroupAction_timeZone' - Specifies the time zone for a cron expression. If a time zone is not
-- provided, UTC is used by default.
--
-- Valid values are the canonical names of the IANA time zones, derived
-- from the IANA Time Zone Database (such as @Etc\/GMT+9@ or
-- @Pacific\/Tahiti@). For more information, see
-- <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>.
--
-- 'autoScalingGroupName', 'putScheduledUpdateGroupAction_autoScalingGroupName' - The name of the Auto Scaling group.
--
-- 'scheduledActionName', 'putScheduledUpdateGroupAction_scheduledActionName' - The name of this scaling action.
newPutScheduledUpdateGroupAction ::
  -- | 'autoScalingGroupName'
  Prelude.Text ->
  -- | 'scheduledActionName'
  Prelude.Text ->
  PutScheduledUpdateGroupAction
newPutScheduledUpdateGroupAction :: Text -> Text -> PutScheduledUpdateGroupAction
newPutScheduledUpdateGroupAction
  Text
pAutoScalingGroupName_
  Text
pScheduledActionName_ =
    PutScheduledUpdateGroupAction' :: Maybe ISO8601
-> Maybe ISO8601
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe ISO8601
-> Maybe Text
-> Text
-> Text
-> PutScheduledUpdateGroupAction
PutScheduledUpdateGroupAction'
      { $sel:startTime:PutScheduledUpdateGroupAction' :: Maybe ISO8601
startTime =
          Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
        $sel:time:PutScheduledUpdateGroupAction' :: Maybe ISO8601
time = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
        $sel:maxSize:PutScheduledUpdateGroupAction' :: Maybe Int
maxSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:recurrence:PutScheduledUpdateGroupAction' :: Maybe Text
recurrence = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:desiredCapacity:PutScheduledUpdateGroupAction' :: Maybe Int
desiredCapacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:minSize:PutScheduledUpdateGroupAction' :: Maybe Int
minSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:endTime:PutScheduledUpdateGroupAction' :: Maybe ISO8601
endTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
        $sel:timeZone:PutScheduledUpdateGroupAction' :: Maybe Text
timeZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:autoScalingGroupName:PutScheduledUpdateGroupAction' :: Text
autoScalingGroupName =
          Text
pAutoScalingGroupName_,
        $sel:scheduledActionName:PutScheduledUpdateGroupAction' :: Text
scheduledActionName = Text
pScheduledActionName_
      }

-- | The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ
-- format in UTC\/GMT only and in quotes (for example,
-- @\"2019-06-01T00:00:00Z\"@).
--
-- If you specify @Recurrence@ and @StartTime@, Amazon EC2 Auto Scaling
-- performs the action at this time, and then performs the action based on
-- the specified recurrence.
--
-- If you try to schedule your action in the past, Amazon EC2 Auto Scaling
-- returns an error message.
putScheduledUpdateGroupAction_startTime :: Lens.Lens' PutScheduledUpdateGroupAction (Prelude.Maybe Prelude.UTCTime)
putScheduledUpdateGroupAction_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_startTime = (PutScheduledUpdateGroupAction -> Maybe ISO8601)
-> (PutScheduledUpdateGroupAction
    -> Maybe ISO8601 -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Maybe ISO8601
startTime :: Maybe ISO8601
$sel:startTime:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe ISO8601
startTime} -> Maybe ISO8601
startTime) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Maybe ISO8601
a -> PutScheduledUpdateGroupAction
s {$sel:startTime:PutScheduledUpdateGroupAction' :: Maybe ISO8601
startTime = Maybe ISO8601
a} :: PutScheduledUpdateGroupAction) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> PutScheduledUpdateGroupAction
 -> f PutScheduledUpdateGroupAction)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PutScheduledUpdateGroupAction
-> f PutScheduledUpdateGroupAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | This parameter is no longer used.
putScheduledUpdateGroupAction_time :: Lens.Lens' PutScheduledUpdateGroupAction (Prelude.Maybe Prelude.UTCTime)
putScheduledUpdateGroupAction_time :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_time = (PutScheduledUpdateGroupAction -> Maybe ISO8601)
-> (PutScheduledUpdateGroupAction
    -> Maybe ISO8601 -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Maybe ISO8601
time :: Maybe ISO8601
$sel:time:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe ISO8601
time} -> Maybe ISO8601
time) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Maybe ISO8601
a -> PutScheduledUpdateGroupAction
s {$sel:time:PutScheduledUpdateGroupAction' :: Maybe ISO8601
time = Maybe ISO8601
a} :: PutScheduledUpdateGroupAction) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> PutScheduledUpdateGroupAction
 -> f PutScheduledUpdateGroupAction)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PutScheduledUpdateGroupAction
-> f PutScheduledUpdateGroupAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The maximum size of the Auto Scaling group.
putScheduledUpdateGroupAction_maxSize :: Lens.Lens' PutScheduledUpdateGroupAction (Prelude.Maybe Prelude.Int)
putScheduledUpdateGroupAction_maxSize :: (Maybe Int -> f (Maybe Int))
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_maxSize = (PutScheduledUpdateGroupAction -> Maybe Int)
-> (PutScheduledUpdateGroupAction
    -> Maybe Int -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Maybe Int
maxSize :: Maybe Int
$sel:maxSize:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Int
maxSize} -> Maybe Int
maxSize) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Maybe Int
a -> PutScheduledUpdateGroupAction
s {$sel:maxSize:PutScheduledUpdateGroupAction' :: Maybe Int
maxSize = Maybe Int
a} :: PutScheduledUpdateGroupAction)

-- | The recurring schedule for this action. This format consists of five
-- fields separated by white spaces: [Minute] [Hour] [Day_of_Month]
-- [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example,
-- @\"30 0 1 1,6,12 *\"@). For more information about this format, see
-- <http://crontab.org Crontab>.
--
-- When @StartTime@ and @EndTime@ are specified with @Recurrence@, they
-- form the boundaries of when the recurring action starts and stops.
--
-- Cron expressions use Universal Coordinated Time (UTC) by default.
putScheduledUpdateGroupAction_recurrence :: Lens.Lens' PutScheduledUpdateGroupAction (Prelude.Maybe Prelude.Text)
putScheduledUpdateGroupAction_recurrence :: (Maybe Text -> f (Maybe Text))
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_recurrence = (PutScheduledUpdateGroupAction -> Maybe Text)
-> (PutScheduledUpdateGroupAction
    -> Maybe Text -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Maybe Text
recurrence :: Maybe Text
$sel:recurrence:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Text
recurrence} -> Maybe Text
recurrence) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Maybe Text
a -> PutScheduledUpdateGroupAction
s {$sel:recurrence:PutScheduledUpdateGroupAction' :: Maybe Text
recurrence = Maybe Text
a} :: PutScheduledUpdateGroupAction)

-- | The desired capacity is the initial capacity of the Auto Scaling group
-- after the scheduled action runs and the capacity it attempts to
-- maintain. It can scale beyond this capacity if you add more scaling
-- conditions.
putScheduledUpdateGroupAction_desiredCapacity :: Lens.Lens' PutScheduledUpdateGroupAction (Prelude.Maybe Prelude.Int)
putScheduledUpdateGroupAction_desiredCapacity :: (Maybe Int -> f (Maybe Int))
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_desiredCapacity = (PutScheduledUpdateGroupAction -> Maybe Int)
-> (PutScheduledUpdateGroupAction
    -> Maybe Int -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Maybe Int
desiredCapacity :: Maybe Int
$sel:desiredCapacity:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Int
desiredCapacity} -> Maybe Int
desiredCapacity) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Maybe Int
a -> PutScheduledUpdateGroupAction
s {$sel:desiredCapacity:PutScheduledUpdateGroupAction' :: Maybe Int
desiredCapacity = Maybe Int
a} :: PutScheduledUpdateGroupAction)

-- | The minimum size of the Auto Scaling group.
putScheduledUpdateGroupAction_minSize :: Lens.Lens' PutScheduledUpdateGroupAction (Prelude.Maybe Prelude.Int)
putScheduledUpdateGroupAction_minSize :: (Maybe Int -> f (Maybe Int))
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_minSize = (PutScheduledUpdateGroupAction -> Maybe Int)
-> (PutScheduledUpdateGroupAction
    -> Maybe Int -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Maybe Int
minSize :: Maybe Int
$sel:minSize:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Int
minSize} -> Maybe Int
minSize) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Maybe Int
a -> PutScheduledUpdateGroupAction
s {$sel:minSize:PutScheduledUpdateGroupAction' :: Maybe Int
minSize = Maybe Int
a} :: PutScheduledUpdateGroupAction)

-- | The date and time for the recurring schedule to end, in UTC.
putScheduledUpdateGroupAction_endTime :: Lens.Lens' PutScheduledUpdateGroupAction (Prelude.Maybe Prelude.UTCTime)
putScheduledUpdateGroupAction_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_endTime = (PutScheduledUpdateGroupAction -> Maybe ISO8601)
-> (PutScheduledUpdateGroupAction
    -> Maybe ISO8601 -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Maybe ISO8601
endTime :: Maybe ISO8601
$sel:endTime:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe ISO8601
endTime} -> Maybe ISO8601
endTime) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Maybe ISO8601
a -> PutScheduledUpdateGroupAction
s {$sel:endTime:PutScheduledUpdateGroupAction' :: Maybe ISO8601
endTime = Maybe ISO8601
a} :: PutScheduledUpdateGroupAction) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> PutScheduledUpdateGroupAction
 -> f PutScheduledUpdateGroupAction)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PutScheduledUpdateGroupAction
-> f PutScheduledUpdateGroupAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the time zone for a cron expression. If a time zone is not
-- provided, UTC is used by default.
--
-- Valid values are the canonical names of the IANA time zones, derived
-- from the IANA Time Zone Database (such as @Etc\/GMT+9@ or
-- @Pacific\/Tahiti@). For more information, see
-- <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>.
putScheduledUpdateGroupAction_timeZone :: Lens.Lens' PutScheduledUpdateGroupAction (Prelude.Maybe Prelude.Text)
putScheduledUpdateGroupAction_timeZone :: (Maybe Text -> f (Maybe Text))
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_timeZone = (PutScheduledUpdateGroupAction -> Maybe Text)
-> (PutScheduledUpdateGroupAction
    -> Maybe Text -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Maybe Text
timeZone :: Maybe Text
$sel:timeZone:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Text
timeZone} -> Maybe Text
timeZone) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Maybe Text
a -> PutScheduledUpdateGroupAction
s {$sel:timeZone:PutScheduledUpdateGroupAction' :: Maybe Text
timeZone = Maybe Text
a} :: PutScheduledUpdateGroupAction)

-- | The name of the Auto Scaling group.
putScheduledUpdateGroupAction_autoScalingGroupName :: Lens.Lens' PutScheduledUpdateGroupAction Prelude.Text
putScheduledUpdateGroupAction_autoScalingGroupName :: (Text -> f Text)
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_autoScalingGroupName = (PutScheduledUpdateGroupAction -> Text)
-> (PutScheduledUpdateGroupAction
    -> Text -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Text
a -> PutScheduledUpdateGroupAction
s {$sel:autoScalingGroupName:PutScheduledUpdateGroupAction' :: Text
autoScalingGroupName = Text
a} :: PutScheduledUpdateGroupAction)

-- | The name of this scaling action.
putScheduledUpdateGroupAction_scheduledActionName :: Lens.Lens' PutScheduledUpdateGroupAction Prelude.Text
putScheduledUpdateGroupAction_scheduledActionName :: (Text -> f Text)
-> PutScheduledUpdateGroupAction -> f PutScheduledUpdateGroupAction
putScheduledUpdateGroupAction_scheduledActionName = (PutScheduledUpdateGroupAction -> Text)
-> (PutScheduledUpdateGroupAction
    -> Text -> PutScheduledUpdateGroupAction)
-> Lens
     PutScheduledUpdateGroupAction
     PutScheduledUpdateGroupAction
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScheduledUpdateGroupAction' {Text
scheduledActionName :: Text
$sel:scheduledActionName:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Text
scheduledActionName} -> Text
scheduledActionName) (\s :: PutScheduledUpdateGroupAction
s@PutScheduledUpdateGroupAction' {} Text
a -> PutScheduledUpdateGroupAction
s {$sel:scheduledActionName:PutScheduledUpdateGroupAction' :: Text
scheduledActionName = Text
a} :: PutScheduledUpdateGroupAction)

instance
  Core.AWSRequest
    PutScheduledUpdateGroupAction
  where
  type
    AWSResponse PutScheduledUpdateGroupAction =
      PutScheduledUpdateGroupActionResponse
  request :: PutScheduledUpdateGroupAction
-> Request PutScheduledUpdateGroupAction
request = Service
-> PutScheduledUpdateGroupAction
-> Request PutScheduledUpdateGroupAction
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy PutScheduledUpdateGroupAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutScheduledUpdateGroupAction)))
response =
    AWSResponse PutScheduledUpdateGroupAction
-> Logger
-> Service
-> Proxy PutScheduledUpdateGroupAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutScheduledUpdateGroupAction)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse PutScheduledUpdateGroupAction
PutScheduledUpdateGroupActionResponse
PutScheduledUpdateGroupActionResponse'

instance
  Prelude.Hashable
    PutScheduledUpdateGroupAction

instance Prelude.NFData PutScheduledUpdateGroupAction

instance Core.ToHeaders PutScheduledUpdateGroupAction where
  toHeaders :: PutScheduledUpdateGroupAction -> [Header]
toHeaders = [Header] -> PutScheduledUpdateGroupAction -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath PutScheduledUpdateGroupAction where
  toPath :: PutScheduledUpdateGroupAction -> ByteString
toPath = ByteString -> PutScheduledUpdateGroupAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery PutScheduledUpdateGroupAction where
  toQuery :: PutScheduledUpdateGroupAction -> QueryString
toQuery PutScheduledUpdateGroupAction' {Maybe Int
Maybe Text
Maybe ISO8601
Text
scheduledActionName :: Text
autoScalingGroupName :: Text
timeZone :: Maybe Text
endTime :: Maybe ISO8601
minSize :: Maybe Int
desiredCapacity :: Maybe Int
recurrence :: Maybe Text
maxSize :: Maybe Int
time :: Maybe ISO8601
startTime :: Maybe ISO8601
$sel:scheduledActionName:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Text
$sel:autoScalingGroupName:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Text
$sel:timeZone:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Text
$sel:endTime:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe ISO8601
$sel:minSize:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Int
$sel:desiredCapacity:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Int
$sel:recurrence:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Text
$sel:maxSize:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe Int
$sel:time:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe ISO8601
$sel:startTime:PutScheduledUpdateGroupAction' :: PutScheduledUpdateGroupAction -> Maybe ISO8601
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"PutScheduledUpdateGroupAction" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"StartTime" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
startTime,
        ByteString
"Time" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
time,
        ByteString
"MaxSize" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxSize,
        ByteString
"Recurrence" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
recurrence,
        ByteString
"DesiredCapacity" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
desiredCapacity,
        ByteString
"MinSize" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
minSize,
        ByteString
"EndTime" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
endTime,
        ByteString
"TimeZone" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
timeZone,
        ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
        ByteString
"ScheduledActionName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
scheduledActionName
      ]

-- | /See:/ 'newPutScheduledUpdateGroupActionResponse' smart constructor.
data PutScheduledUpdateGroupActionResponse = PutScheduledUpdateGroupActionResponse'
  {
  }
  deriving (PutScheduledUpdateGroupActionResponse
-> PutScheduledUpdateGroupActionResponse -> Bool
(PutScheduledUpdateGroupActionResponse
 -> PutScheduledUpdateGroupActionResponse -> Bool)
-> (PutScheduledUpdateGroupActionResponse
    -> PutScheduledUpdateGroupActionResponse -> Bool)
-> Eq PutScheduledUpdateGroupActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutScheduledUpdateGroupActionResponse
-> PutScheduledUpdateGroupActionResponse -> Bool
$c/= :: PutScheduledUpdateGroupActionResponse
-> PutScheduledUpdateGroupActionResponse -> Bool
== :: PutScheduledUpdateGroupActionResponse
-> PutScheduledUpdateGroupActionResponse -> Bool
$c== :: PutScheduledUpdateGroupActionResponse
-> PutScheduledUpdateGroupActionResponse -> Bool
Prelude.Eq, ReadPrec [PutScheduledUpdateGroupActionResponse]
ReadPrec PutScheduledUpdateGroupActionResponse
Int -> ReadS PutScheduledUpdateGroupActionResponse
ReadS [PutScheduledUpdateGroupActionResponse]
(Int -> ReadS PutScheduledUpdateGroupActionResponse)
-> ReadS [PutScheduledUpdateGroupActionResponse]
-> ReadPrec PutScheduledUpdateGroupActionResponse
-> ReadPrec [PutScheduledUpdateGroupActionResponse]
-> Read PutScheduledUpdateGroupActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutScheduledUpdateGroupActionResponse]
$creadListPrec :: ReadPrec [PutScheduledUpdateGroupActionResponse]
readPrec :: ReadPrec PutScheduledUpdateGroupActionResponse
$creadPrec :: ReadPrec PutScheduledUpdateGroupActionResponse
readList :: ReadS [PutScheduledUpdateGroupActionResponse]
$creadList :: ReadS [PutScheduledUpdateGroupActionResponse]
readsPrec :: Int -> ReadS PutScheduledUpdateGroupActionResponse
$creadsPrec :: Int -> ReadS PutScheduledUpdateGroupActionResponse
Prelude.Read, Int -> PutScheduledUpdateGroupActionResponse -> ShowS
[PutScheduledUpdateGroupActionResponse] -> ShowS
PutScheduledUpdateGroupActionResponse -> String
(Int -> PutScheduledUpdateGroupActionResponse -> ShowS)
-> (PutScheduledUpdateGroupActionResponse -> String)
-> ([PutScheduledUpdateGroupActionResponse] -> ShowS)
-> Show PutScheduledUpdateGroupActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutScheduledUpdateGroupActionResponse] -> ShowS
$cshowList :: [PutScheduledUpdateGroupActionResponse] -> ShowS
show :: PutScheduledUpdateGroupActionResponse -> String
$cshow :: PutScheduledUpdateGroupActionResponse -> String
showsPrec :: Int -> PutScheduledUpdateGroupActionResponse -> ShowS
$cshowsPrec :: Int -> PutScheduledUpdateGroupActionResponse -> ShowS
Prelude.Show, (forall x.
 PutScheduledUpdateGroupActionResponse
 -> Rep PutScheduledUpdateGroupActionResponse x)
-> (forall x.
    Rep PutScheduledUpdateGroupActionResponse x
    -> PutScheduledUpdateGroupActionResponse)
-> Generic PutScheduledUpdateGroupActionResponse
forall x.
Rep PutScheduledUpdateGroupActionResponse x
-> PutScheduledUpdateGroupActionResponse
forall x.
PutScheduledUpdateGroupActionResponse
-> Rep PutScheduledUpdateGroupActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutScheduledUpdateGroupActionResponse x
-> PutScheduledUpdateGroupActionResponse
$cfrom :: forall x.
PutScheduledUpdateGroupActionResponse
-> Rep PutScheduledUpdateGroupActionResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutScheduledUpdateGroupActionResponse' 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.
newPutScheduledUpdateGroupActionResponse ::
  PutScheduledUpdateGroupActionResponse
newPutScheduledUpdateGroupActionResponse :: PutScheduledUpdateGroupActionResponse
newPutScheduledUpdateGroupActionResponse =
  PutScheduledUpdateGroupActionResponse
PutScheduledUpdateGroupActionResponse'

instance
  Prelude.NFData
    PutScheduledUpdateGroupActionResponse