{-# 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.GetPredictiveScalingForecast
-- 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)
--
-- Retrieves the forecast data for a predictive scaling policy.
--
-- Load forecasts are predictions of the hourly load values using
-- historical load data from CloudWatch and an analysis of historical
-- trends. Capacity forecasts are represented as predicted values for the
-- minimum capacity that is needed on an hourly basis, based on the hourly
-- load forecast.
--
-- A minimum of 24 hours of data is required to create the initial
-- forecasts. However, having a full 14 days of historical data results in
-- more accurate forecasts.
--
-- For more information, see
-- <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html Predictive scaling for Amazon EC2 Auto Scaling>
-- in the /Amazon EC2 Auto Scaling User Guide/.
module Amazonka.AutoScaling.GetPredictiveScalingForecast
  ( -- * Creating a Request
    GetPredictiveScalingForecast (..),
    newGetPredictiveScalingForecast,

    -- * Request Lenses
    getPredictiveScalingForecast_autoScalingGroupName,
    getPredictiveScalingForecast_policyName,
    getPredictiveScalingForecast_startTime,
    getPredictiveScalingForecast_endTime,

    -- * Destructuring the Response
    GetPredictiveScalingForecastResponse (..),
    newGetPredictiveScalingForecastResponse,

    -- * Response Lenses
    getPredictiveScalingForecastResponse_httpStatus,
    getPredictiveScalingForecastResponse_loadForecast,
    getPredictiveScalingForecastResponse_capacityForecast,
    getPredictiveScalingForecastResponse_updateTime,
  )
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:/ 'newGetPredictiveScalingForecast' smart constructor.
data GetPredictiveScalingForecast = GetPredictiveScalingForecast'
  { -- | The name of the Auto Scaling group.
    GetPredictiveScalingForecast -> Text
autoScalingGroupName :: Prelude.Text,
    -- | The name of the policy.
    GetPredictiveScalingForecast -> Text
policyName :: Prelude.Text,
    -- | The inclusive start time of the time range for the forecast data to get.
    -- At most, the date and time can be one year before the current date and
    -- time.
    GetPredictiveScalingForecast -> ISO8601
startTime :: Core.ISO8601,
    -- | The exclusive end time of the time range for the forecast data to get.
    -- The maximum time duration between the start and end time is 30 days.
    --
    -- Although this parameter can accept a date and time that is more than two
    -- days in the future, the availability of forecast data has limits. Amazon
    -- EC2 Auto Scaling only issues forecasts for periods of two days in
    -- advance.
    GetPredictiveScalingForecast -> ISO8601
endTime :: Core.ISO8601
  }
  deriving (GetPredictiveScalingForecast
-> GetPredictiveScalingForecast -> Bool
(GetPredictiveScalingForecast
 -> GetPredictiveScalingForecast -> Bool)
-> (GetPredictiveScalingForecast
    -> GetPredictiveScalingForecast -> Bool)
-> Eq GetPredictiveScalingForecast
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPredictiveScalingForecast
-> GetPredictiveScalingForecast -> Bool
$c/= :: GetPredictiveScalingForecast
-> GetPredictiveScalingForecast -> Bool
== :: GetPredictiveScalingForecast
-> GetPredictiveScalingForecast -> Bool
$c== :: GetPredictiveScalingForecast
-> GetPredictiveScalingForecast -> Bool
Prelude.Eq, ReadPrec [GetPredictiveScalingForecast]
ReadPrec GetPredictiveScalingForecast
Int -> ReadS GetPredictiveScalingForecast
ReadS [GetPredictiveScalingForecast]
(Int -> ReadS GetPredictiveScalingForecast)
-> ReadS [GetPredictiveScalingForecast]
-> ReadPrec GetPredictiveScalingForecast
-> ReadPrec [GetPredictiveScalingForecast]
-> Read GetPredictiveScalingForecast
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPredictiveScalingForecast]
$creadListPrec :: ReadPrec [GetPredictiveScalingForecast]
readPrec :: ReadPrec GetPredictiveScalingForecast
$creadPrec :: ReadPrec GetPredictiveScalingForecast
readList :: ReadS [GetPredictiveScalingForecast]
$creadList :: ReadS [GetPredictiveScalingForecast]
readsPrec :: Int -> ReadS GetPredictiveScalingForecast
$creadsPrec :: Int -> ReadS GetPredictiveScalingForecast
Prelude.Read, Int -> GetPredictiveScalingForecast -> ShowS
[GetPredictiveScalingForecast] -> ShowS
GetPredictiveScalingForecast -> String
(Int -> GetPredictiveScalingForecast -> ShowS)
-> (GetPredictiveScalingForecast -> String)
-> ([GetPredictiveScalingForecast] -> ShowS)
-> Show GetPredictiveScalingForecast
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPredictiveScalingForecast] -> ShowS
$cshowList :: [GetPredictiveScalingForecast] -> ShowS
show :: GetPredictiveScalingForecast -> String
$cshow :: GetPredictiveScalingForecast -> String
showsPrec :: Int -> GetPredictiveScalingForecast -> ShowS
$cshowsPrec :: Int -> GetPredictiveScalingForecast -> ShowS
Prelude.Show, (forall x.
 GetPredictiveScalingForecast -> Rep GetPredictiveScalingForecast x)
-> (forall x.
    Rep GetPredictiveScalingForecast x -> GetPredictiveScalingForecast)
-> Generic GetPredictiveScalingForecast
forall x.
Rep GetPredictiveScalingForecast x -> GetPredictiveScalingForecast
forall x.
GetPredictiveScalingForecast -> Rep GetPredictiveScalingForecast x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPredictiveScalingForecast x -> GetPredictiveScalingForecast
$cfrom :: forall x.
GetPredictiveScalingForecast -> Rep GetPredictiveScalingForecast x
Prelude.Generic)

-- |
-- Create a value of 'GetPredictiveScalingForecast' 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:
--
-- 'autoScalingGroupName', 'getPredictiveScalingForecast_autoScalingGroupName' - The name of the Auto Scaling group.
--
-- 'policyName', 'getPredictiveScalingForecast_policyName' - The name of the policy.
--
-- 'startTime', 'getPredictiveScalingForecast_startTime' - The inclusive start time of the time range for the forecast data to get.
-- At most, the date and time can be one year before the current date and
-- time.
--
-- 'endTime', 'getPredictiveScalingForecast_endTime' - The exclusive end time of the time range for the forecast data to get.
-- The maximum time duration between the start and end time is 30 days.
--
-- Although this parameter can accept a date and time that is more than two
-- days in the future, the availability of forecast data has limits. Amazon
-- EC2 Auto Scaling only issues forecasts for periods of two days in
-- advance.
newGetPredictiveScalingForecast ::
  -- | 'autoScalingGroupName'
  Prelude.Text ->
  -- | 'policyName'
  Prelude.Text ->
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'endTime'
  Prelude.UTCTime ->
  GetPredictiveScalingForecast
newGetPredictiveScalingForecast :: Text -> Text -> UTCTime -> UTCTime -> GetPredictiveScalingForecast
newGetPredictiveScalingForecast
  Text
pAutoScalingGroupName_
  Text
pPolicyName_
  UTCTime
pStartTime_
  UTCTime
pEndTime_ =
    GetPredictiveScalingForecast' :: Text -> Text -> ISO8601 -> ISO8601 -> GetPredictiveScalingForecast
GetPredictiveScalingForecast'
      { $sel:autoScalingGroupName:GetPredictiveScalingForecast' :: Text
autoScalingGroupName =
          Text
pAutoScalingGroupName_,
        $sel:policyName:GetPredictiveScalingForecast' :: Text
policyName = Text
pPolicyName_,
        $sel:startTime:GetPredictiveScalingForecast' :: ISO8601
startTime = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
        $sel:endTime:GetPredictiveScalingForecast' :: ISO8601
endTime = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_
      }

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

-- | The name of the policy.
getPredictiveScalingForecast_policyName :: Lens.Lens' GetPredictiveScalingForecast Prelude.Text
getPredictiveScalingForecast_policyName :: (Text -> f Text)
-> GetPredictiveScalingForecast -> f GetPredictiveScalingForecast
getPredictiveScalingForecast_policyName = (GetPredictiveScalingForecast -> Text)
-> (GetPredictiveScalingForecast
    -> Text -> GetPredictiveScalingForecast)
-> Lens
     GetPredictiveScalingForecast GetPredictiveScalingForecast Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPredictiveScalingForecast' {Text
policyName :: Text
$sel:policyName:GetPredictiveScalingForecast' :: GetPredictiveScalingForecast -> Text
policyName} -> Text
policyName) (\s :: GetPredictiveScalingForecast
s@GetPredictiveScalingForecast' {} Text
a -> GetPredictiveScalingForecast
s {$sel:policyName:GetPredictiveScalingForecast' :: Text
policyName = Text
a} :: GetPredictiveScalingForecast)

-- | The inclusive start time of the time range for the forecast data to get.
-- At most, the date and time can be one year before the current date and
-- time.
getPredictiveScalingForecast_startTime :: Lens.Lens' GetPredictiveScalingForecast Prelude.UTCTime
getPredictiveScalingForecast_startTime :: (UTCTime -> f UTCTime)
-> GetPredictiveScalingForecast -> f GetPredictiveScalingForecast
getPredictiveScalingForecast_startTime = (GetPredictiveScalingForecast -> ISO8601)
-> (GetPredictiveScalingForecast
    -> ISO8601 -> GetPredictiveScalingForecast)
-> Lens
     GetPredictiveScalingForecast
     GetPredictiveScalingForecast
     ISO8601
     ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPredictiveScalingForecast' {ISO8601
startTime :: ISO8601
$sel:startTime:GetPredictiveScalingForecast' :: GetPredictiveScalingForecast -> ISO8601
startTime} -> ISO8601
startTime) (\s :: GetPredictiveScalingForecast
s@GetPredictiveScalingForecast' {} ISO8601
a -> GetPredictiveScalingForecast
s {$sel:startTime:GetPredictiveScalingForecast' :: ISO8601
startTime = ISO8601
a} :: GetPredictiveScalingForecast) ((ISO8601 -> f ISO8601)
 -> GetPredictiveScalingForecast -> f GetPredictiveScalingForecast)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> GetPredictiveScalingForecast
-> f GetPredictiveScalingForecast
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The exclusive end time of the time range for the forecast data to get.
-- The maximum time duration between the start and end time is 30 days.
--
-- Although this parameter can accept a date and time that is more than two
-- days in the future, the availability of forecast data has limits. Amazon
-- EC2 Auto Scaling only issues forecasts for periods of two days in
-- advance.
getPredictiveScalingForecast_endTime :: Lens.Lens' GetPredictiveScalingForecast Prelude.UTCTime
getPredictiveScalingForecast_endTime :: (UTCTime -> f UTCTime)
-> GetPredictiveScalingForecast -> f GetPredictiveScalingForecast
getPredictiveScalingForecast_endTime = (GetPredictiveScalingForecast -> ISO8601)
-> (GetPredictiveScalingForecast
    -> ISO8601 -> GetPredictiveScalingForecast)
-> Lens
     GetPredictiveScalingForecast
     GetPredictiveScalingForecast
     ISO8601
     ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPredictiveScalingForecast' {ISO8601
endTime :: ISO8601
$sel:endTime:GetPredictiveScalingForecast' :: GetPredictiveScalingForecast -> ISO8601
endTime} -> ISO8601
endTime) (\s :: GetPredictiveScalingForecast
s@GetPredictiveScalingForecast' {} ISO8601
a -> GetPredictiveScalingForecast
s {$sel:endTime:GetPredictiveScalingForecast' :: ISO8601
endTime = ISO8601
a} :: GetPredictiveScalingForecast) ((ISO8601 -> f ISO8601)
 -> GetPredictiveScalingForecast -> f GetPredictiveScalingForecast)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> GetPredictiveScalingForecast
-> f GetPredictiveScalingForecast
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.AWSRequest GetPredictiveScalingForecast where
  type
    AWSResponse GetPredictiveScalingForecast =
      GetPredictiveScalingForecastResponse
  request :: GetPredictiveScalingForecast
-> Request GetPredictiveScalingForecast
request = Service
-> GetPredictiveScalingForecast
-> Request GetPredictiveScalingForecast
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy GetPredictiveScalingForecast
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetPredictiveScalingForecast)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse GetPredictiveScalingForecast))
-> Logger
-> Service
-> Proxy GetPredictiveScalingForecast
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetPredictiveScalingForecast)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"GetPredictiveScalingForecastResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int
-> [LoadForecast]
-> CapacityForecast
-> ISO8601
-> GetPredictiveScalingForecastResponse
GetPredictiveScalingForecastResponse'
            (Int
 -> [LoadForecast]
 -> CapacityForecast
 -> ISO8601
 -> GetPredictiveScalingForecastResponse)
-> Either String Int
-> Either
     String
     ([LoadForecast]
      -> CapacityForecast
      -> ISO8601
      -> GetPredictiveScalingForecastResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([LoadForecast]
   -> CapacityForecast
   -> ISO8601
   -> GetPredictiveScalingForecastResponse)
-> Either String [LoadForecast]
-> Either
     String
     (CapacityForecast
      -> ISO8601 -> GetPredictiveScalingForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LoadForecast" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [LoadForecast])
-> Either String [LoadForecast]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [LoadForecast]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
            Either
  String
  (CapacityForecast
   -> ISO8601 -> GetPredictiveScalingForecastResponse)
-> Either String CapacityForecast
-> Either String (ISO8601 -> GetPredictiveScalingForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String CapacityForecast
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CapacityForecast")
            Either String (ISO8601 -> GetPredictiveScalingForecastResponse)
-> Either String ISO8601
-> Either String GetPredictiveScalingForecastResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"UpdateTime")
      )

instance
  Prelude.Hashable
    GetPredictiveScalingForecast

instance Prelude.NFData GetPredictiveScalingForecast

instance Core.ToHeaders GetPredictiveScalingForecast where
  toHeaders :: GetPredictiveScalingForecast -> ResponseHeaders
toHeaders = ResponseHeaders -> GetPredictiveScalingForecast -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery GetPredictiveScalingForecast where
  toQuery :: GetPredictiveScalingForecast -> QueryString
toQuery GetPredictiveScalingForecast' {Text
ISO8601
endTime :: ISO8601
startTime :: ISO8601
policyName :: Text
autoScalingGroupName :: Text
$sel:endTime:GetPredictiveScalingForecast' :: GetPredictiveScalingForecast -> ISO8601
$sel:startTime:GetPredictiveScalingForecast' :: GetPredictiveScalingForecast -> ISO8601
$sel:policyName:GetPredictiveScalingForecast' :: GetPredictiveScalingForecast -> Text
$sel:autoScalingGroupName:GetPredictiveScalingForecast' :: GetPredictiveScalingForecast -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"GetPredictiveScalingForecast" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
        ByteString
"PolicyName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyName,
        ByteString
"StartTime" ByteString -> ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ISO8601
startTime,
        ByteString
"EndTime" ByteString -> ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ISO8601
endTime
      ]

-- | /See:/ 'newGetPredictiveScalingForecastResponse' smart constructor.
data GetPredictiveScalingForecastResponse = GetPredictiveScalingForecastResponse'
  { -- | The response's http status code.
    GetPredictiveScalingForecastResponse -> Int
httpStatus :: Prelude.Int,
    -- | The load forecast.
    GetPredictiveScalingForecastResponse -> [LoadForecast]
loadForecast :: [LoadForecast],
    -- | The capacity forecast.
    GetPredictiveScalingForecastResponse -> CapacityForecast
capacityForecast :: CapacityForecast,
    -- | The time the forecast was made.
    GetPredictiveScalingForecastResponse -> ISO8601
updateTime :: Core.ISO8601
  }
  deriving (GetPredictiveScalingForecastResponse
-> GetPredictiveScalingForecastResponse -> Bool
(GetPredictiveScalingForecastResponse
 -> GetPredictiveScalingForecastResponse -> Bool)
-> (GetPredictiveScalingForecastResponse
    -> GetPredictiveScalingForecastResponse -> Bool)
-> Eq GetPredictiveScalingForecastResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPredictiveScalingForecastResponse
-> GetPredictiveScalingForecastResponse -> Bool
$c/= :: GetPredictiveScalingForecastResponse
-> GetPredictiveScalingForecastResponse -> Bool
== :: GetPredictiveScalingForecastResponse
-> GetPredictiveScalingForecastResponse -> Bool
$c== :: GetPredictiveScalingForecastResponse
-> GetPredictiveScalingForecastResponse -> Bool
Prelude.Eq, ReadPrec [GetPredictiveScalingForecastResponse]
ReadPrec GetPredictiveScalingForecastResponse
Int -> ReadS GetPredictiveScalingForecastResponse
ReadS [GetPredictiveScalingForecastResponse]
(Int -> ReadS GetPredictiveScalingForecastResponse)
-> ReadS [GetPredictiveScalingForecastResponse]
-> ReadPrec GetPredictiveScalingForecastResponse
-> ReadPrec [GetPredictiveScalingForecastResponse]
-> Read GetPredictiveScalingForecastResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPredictiveScalingForecastResponse]
$creadListPrec :: ReadPrec [GetPredictiveScalingForecastResponse]
readPrec :: ReadPrec GetPredictiveScalingForecastResponse
$creadPrec :: ReadPrec GetPredictiveScalingForecastResponse
readList :: ReadS [GetPredictiveScalingForecastResponse]
$creadList :: ReadS [GetPredictiveScalingForecastResponse]
readsPrec :: Int -> ReadS GetPredictiveScalingForecastResponse
$creadsPrec :: Int -> ReadS GetPredictiveScalingForecastResponse
Prelude.Read, Int -> GetPredictiveScalingForecastResponse -> ShowS
[GetPredictiveScalingForecastResponse] -> ShowS
GetPredictiveScalingForecastResponse -> String
(Int -> GetPredictiveScalingForecastResponse -> ShowS)
-> (GetPredictiveScalingForecastResponse -> String)
-> ([GetPredictiveScalingForecastResponse] -> ShowS)
-> Show GetPredictiveScalingForecastResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPredictiveScalingForecastResponse] -> ShowS
$cshowList :: [GetPredictiveScalingForecastResponse] -> ShowS
show :: GetPredictiveScalingForecastResponse -> String
$cshow :: GetPredictiveScalingForecastResponse -> String
showsPrec :: Int -> GetPredictiveScalingForecastResponse -> ShowS
$cshowsPrec :: Int -> GetPredictiveScalingForecastResponse -> ShowS
Prelude.Show, (forall x.
 GetPredictiveScalingForecastResponse
 -> Rep GetPredictiveScalingForecastResponse x)
-> (forall x.
    Rep GetPredictiveScalingForecastResponse x
    -> GetPredictiveScalingForecastResponse)
-> Generic GetPredictiveScalingForecastResponse
forall x.
Rep GetPredictiveScalingForecastResponse x
-> GetPredictiveScalingForecastResponse
forall x.
GetPredictiveScalingForecastResponse
-> Rep GetPredictiveScalingForecastResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPredictiveScalingForecastResponse x
-> GetPredictiveScalingForecastResponse
$cfrom :: forall x.
GetPredictiveScalingForecastResponse
-> Rep GetPredictiveScalingForecastResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetPredictiveScalingForecastResponse' 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:
--
-- 'httpStatus', 'getPredictiveScalingForecastResponse_httpStatus' - The response's http status code.
--
-- 'loadForecast', 'getPredictiveScalingForecastResponse_loadForecast' - The load forecast.
--
-- 'capacityForecast', 'getPredictiveScalingForecastResponse_capacityForecast' - The capacity forecast.
--
-- 'updateTime', 'getPredictiveScalingForecastResponse_updateTime' - The time the forecast was made.
newGetPredictiveScalingForecastResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'capacityForecast'
  CapacityForecast ->
  -- | 'updateTime'
  Prelude.UTCTime ->
  GetPredictiveScalingForecastResponse
newGetPredictiveScalingForecastResponse :: Int
-> CapacityForecast
-> UTCTime
-> GetPredictiveScalingForecastResponse
newGetPredictiveScalingForecastResponse
  Int
pHttpStatus_
  CapacityForecast
pCapacityForecast_
  UTCTime
pUpdateTime_ =
    GetPredictiveScalingForecastResponse' :: Int
-> [LoadForecast]
-> CapacityForecast
-> ISO8601
-> GetPredictiveScalingForecastResponse
GetPredictiveScalingForecastResponse'
      { $sel:httpStatus:GetPredictiveScalingForecastResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:loadForecast:GetPredictiveScalingForecastResponse' :: [LoadForecast]
loadForecast = [LoadForecast]
forall a. Monoid a => a
Prelude.mempty,
        $sel:capacityForecast:GetPredictiveScalingForecastResponse' :: CapacityForecast
capacityForecast = CapacityForecast
pCapacityForecast_,
        $sel:updateTime:GetPredictiveScalingForecastResponse' :: ISO8601
updateTime =
          Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateTime_
      }

-- | The response's http status code.
getPredictiveScalingForecastResponse_httpStatus :: Lens.Lens' GetPredictiveScalingForecastResponse Prelude.Int
getPredictiveScalingForecastResponse_httpStatus :: (Int -> f Int)
-> GetPredictiveScalingForecastResponse
-> f GetPredictiveScalingForecastResponse
getPredictiveScalingForecastResponse_httpStatus = (GetPredictiveScalingForecastResponse -> Int)
-> (GetPredictiveScalingForecastResponse
    -> Int -> GetPredictiveScalingForecastResponse)
-> Lens
     GetPredictiveScalingForecastResponse
     GetPredictiveScalingForecastResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPredictiveScalingForecastResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetPredictiveScalingForecastResponse' :: GetPredictiveScalingForecastResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetPredictiveScalingForecastResponse
s@GetPredictiveScalingForecastResponse' {} Int
a -> GetPredictiveScalingForecastResponse
s {$sel:httpStatus:GetPredictiveScalingForecastResponse' :: Int
httpStatus = Int
a} :: GetPredictiveScalingForecastResponse)

-- | The load forecast.
getPredictiveScalingForecastResponse_loadForecast :: Lens.Lens' GetPredictiveScalingForecastResponse [LoadForecast]
getPredictiveScalingForecastResponse_loadForecast :: ([LoadForecast] -> f [LoadForecast])
-> GetPredictiveScalingForecastResponse
-> f GetPredictiveScalingForecastResponse
getPredictiveScalingForecastResponse_loadForecast = (GetPredictiveScalingForecastResponse -> [LoadForecast])
-> (GetPredictiveScalingForecastResponse
    -> [LoadForecast] -> GetPredictiveScalingForecastResponse)
-> Lens
     GetPredictiveScalingForecastResponse
     GetPredictiveScalingForecastResponse
     [LoadForecast]
     [LoadForecast]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPredictiveScalingForecastResponse' {[LoadForecast]
loadForecast :: [LoadForecast]
$sel:loadForecast:GetPredictiveScalingForecastResponse' :: GetPredictiveScalingForecastResponse -> [LoadForecast]
loadForecast} -> [LoadForecast]
loadForecast) (\s :: GetPredictiveScalingForecastResponse
s@GetPredictiveScalingForecastResponse' {} [LoadForecast]
a -> GetPredictiveScalingForecastResponse
s {$sel:loadForecast:GetPredictiveScalingForecastResponse' :: [LoadForecast]
loadForecast = [LoadForecast]
a} :: GetPredictiveScalingForecastResponse) (([LoadForecast] -> f [LoadForecast])
 -> GetPredictiveScalingForecastResponse
 -> f GetPredictiveScalingForecastResponse)
-> (([LoadForecast] -> f [LoadForecast])
    -> [LoadForecast] -> f [LoadForecast])
-> ([LoadForecast] -> f [LoadForecast])
-> GetPredictiveScalingForecastResponse
-> f GetPredictiveScalingForecastResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([LoadForecast] -> f [LoadForecast])
-> [LoadForecast] -> f [LoadForecast]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The capacity forecast.
getPredictiveScalingForecastResponse_capacityForecast :: Lens.Lens' GetPredictiveScalingForecastResponse CapacityForecast
getPredictiveScalingForecastResponse_capacityForecast :: (CapacityForecast -> f CapacityForecast)
-> GetPredictiveScalingForecastResponse
-> f GetPredictiveScalingForecastResponse
getPredictiveScalingForecastResponse_capacityForecast = (GetPredictiveScalingForecastResponse -> CapacityForecast)
-> (GetPredictiveScalingForecastResponse
    -> CapacityForecast -> GetPredictiveScalingForecastResponse)
-> Lens
     GetPredictiveScalingForecastResponse
     GetPredictiveScalingForecastResponse
     CapacityForecast
     CapacityForecast
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPredictiveScalingForecastResponse' {CapacityForecast
capacityForecast :: CapacityForecast
$sel:capacityForecast:GetPredictiveScalingForecastResponse' :: GetPredictiveScalingForecastResponse -> CapacityForecast
capacityForecast} -> CapacityForecast
capacityForecast) (\s :: GetPredictiveScalingForecastResponse
s@GetPredictiveScalingForecastResponse' {} CapacityForecast
a -> GetPredictiveScalingForecastResponse
s {$sel:capacityForecast:GetPredictiveScalingForecastResponse' :: CapacityForecast
capacityForecast = CapacityForecast
a} :: GetPredictiveScalingForecastResponse)

-- | The time the forecast was made.
getPredictiveScalingForecastResponse_updateTime :: Lens.Lens' GetPredictiveScalingForecastResponse Prelude.UTCTime
getPredictiveScalingForecastResponse_updateTime :: (UTCTime -> f UTCTime)
-> GetPredictiveScalingForecastResponse
-> f GetPredictiveScalingForecastResponse
getPredictiveScalingForecastResponse_updateTime = (GetPredictiveScalingForecastResponse -> ISO8601)
-> (GetPredictiveScalingForecastResponse
    -> ISO8601 -> GetPredictiveScalingForecastResponse)
-> Lens
     GetPredictiveScalingForecastResponse
     GetPredictiveScalingForecastResponse
     ISO8601
     ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPredictiveScalingForecastResponse' {ISO8601
updateTime :: ISO8601
$sel:updateTime:GetPredictiveScalingForecastResponse' :: GetPredictiveScalingForecastResponse -> ISO8601
updateTime} -> ISO8601
updateTime) (\s :: GetPredictiveScalingForecastResponse
s@GetPredictiveScalingForecastResponse' {} ISO8601
a -> GetPredictiveScalingForecastResponse
s {$sel:updateTime:GetPredictiveScalingForecastResponse' :: ISO8601
updateTime = ISO8601
a} :: GetPredictiveScalingForecastResponse) ((ISO8601 -> f ISO8601)
 -> GetPredictiveScalingForecastResponse
 -> f GetPredictiveScalingForecastResponse)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> GetPredictiveScalingForecastResponse
-> f GetPredictiveScalingForecastResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance
  Prelude.NFData
    GetPredictiveScalingForecastResponse