{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 :: Data.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 :: Data.ISO8601
  }
  deriving (GetPredictiveScalingForecast
-> GetPredictiveScalingForecast -> Bool
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]
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
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.
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'
      { $sel:autoScalingGroupName:GetPredictiveScalingForecast' :: Text
autoScalingGroupName =
          Text
pAutoScalingGroupName_,
        $sel:policyName:GetPredictiveScalingForecast' :: Text
policyName = Text
pPolicyName_,
        $sel:startTime:GetPredictiveScalingForecast' :: ISO8601
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
        $sel:endTime:GetPredictiveScalingForecast' :: ISO8601
endTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' GetPredictiveScalingForecast Text
getPredictiveScalingForecast_autoScalingGroupName = 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 :: Lens' GetPredictiveScalingForecast Text
getPredictiveScalingForecast_policyName = 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 :: Lens' GetPredictiveScalingForecast UTCTime
getPredictiveScalingForecast_startTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._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 :: Lens' GetPredictiveScalingForecast UTCTime
getPredictiveScalingForecast_endTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance
  Prelude.Hashable
    GetPredictiveScalingForecast
  where
  hashWithSalt :: Int -> GetPredictiveScalingForecast -> Int
hashWithSalt Int
_salt 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
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
autoScalingGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
policyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
endTime

instance Prelude.NFData GetPredictiveScalingForecast where
  rnf :: GetPredictiveScalingForecast -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
autoScalingGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
policyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
endTime

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

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

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"GetPredictiveScalingForecast" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"AutoScalingGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
autoScalingGroupName,
        ByteString
"PolicyName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
policyName,
        ByteString
"StartTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
startTime,
        ByteString
"EndTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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 :: Data.ISO8601
  }
  deriving (GetPredictiveScalingForecastResponse
-> GetPredictiveScalingForecastResponse -> Bool
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]
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
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.
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'
      { $sel:httpStatus:GetPredictiveScalingForecastResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:loadForecast:GetPredictiveScalingForecastResponse' :: [LoadForecast]
loadForecast = forall a. Monoid a => a
Prelude.mempty,
        $sel:capacityForecast:GetPredictiveScalingForecastResponse' :: CapacityForecast
capacityForecast = CapacityForecast
pCapacityForecast_,
        $sel:updateTime:GetPredictiveScalingForecastResponse' :: ISO8601
updateTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' GetPredictiveScalingForecastResponse Int
getPredictiveScalingForecastResponse_httpStatus = 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 :: Lens' GetPredictiveScalingForecastResponse [LoadForecast]
getPredictiveScalingForecastResponse_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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: Lens' GetPredictiveScalingForecastResponse CapacityForecast
getPredictiveScalingForecastResponse_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 :: Lens' GetPredictiveScalingForecastResponse UTCTime
getPredictiveScalingForecastResponse_updateTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance
  Prelude.NFData
    GetPredictiveScalingForecastResponse
  where
  rnf :: GetPredictiveScalingForecastResponse -> ()
rnf GetPredictiveScalingForecastResponse' {Int
[LoadForecast]
ISO8601
CapacityForecast
updateTime :: ISO8601
capacityForecast :: CapacityForecast
loadForecast :: [LoadForecast]
httpStatus :: Int
$sel:updateTime:GetPredictiveScalingForecastResponse' :: GetPredictiveScalingForecastResponse -> ISO8601
$sel:capacityForecast:GetPredictiveScalingForecastResponse' :: GetPredictiveScalingForecastResponse -> CapacityForecast
$sel:loadForecast:GetPredictiveScalingForecastResponse' :: GetPredictiveScalingForecastResponse -> [LoadForecast]
$sel:httpStatus:GetPredictiveScalingForecastResponse' :: GetPredictiveScalingForecastResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [LoadForecast]
loadForecast
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CapacityForecast
capacityForecast
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
updateTime