{-# 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.Forecast.DescribeWhatIfForecast
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the what-if forecast created using the CreateWhatIfForecast
-- operation.
--
-- In addition to listing the properties provided in the
-- @CreateWhatIfForecast@ request, this operation lists the following
-- properties:
--
-- -   @CreationTime@
--
-- -   @LastModificationTime@
--
-- -   @Message@ - If an error occurred, information about the error.
--
-- -   @Status@
module Amazonka.Forecast.DescribeWhatIfForecast
  ( -- * Creating a Request
    DescribeWhatIfForecast (..),
    newDescribeWhatIfForecast,

    -- * Request Lenses
    describeWhatIfForecast_whatIfForecastArn,

    -- * Destructuring the Response
    DescribeWhatIfForecastResponse (..),
    newDescribeWhatIfForecastResponse,

    -- * Response Lenses
    describeWhatIfForecastResponse_creationTime,
    describeWhatIfForecastResponse_estimatedTimeRemainingInMinutes,
    describeWhatIfForecastResponse_forecastTypes,
    describeWhatIfForecastResponse_lastModificationTime,
    describeWhatIfForecastResponse_message,
    describeWhatIfForecastResponse_status,
    describeWhatIfForecastResponse_timeSeriesReplacementsDataSource,
    describeWhatIfForecastResponse_timeSeriesTransformations,
    describeWhatIfForecastResponse_whatIfAnalysisArn,
    describeWhatIfForecastResponse_whatIfForecastArn,
    describeWhatIfForecastResponse_whatIfForecastName,
    describeWhatIfForecastResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Forecast.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeWhatIfForecast' smart constructor.
data DescribeWhatIfForecast = DescribeWhatIfForecast'
  { -- | The Amazon Resource Name (ARN) of the what-if forecast that you are
    -- interested in.
    DescribeWhatIfForecast -> Text
whatIfForecastArn :: Prelude.Text
  }
  deriving (DescribeWhatIfForecast -> DescribeWhatIfForecast -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeWhatIfForecast -> DescribeWhatIfForecast -> Bool
$c/= :: DescribeWhatIfForecast -> DescribeWhatIfForecast -> Bool
== :: DescribeWhatIfForecast -> DescribeWhatIfForecast -> Bool
$c== :: DescribeWhatIfForecast -> DescribeWhatIfForecast -> Bool
Prelude.Eq, ReadPrec [DescribeWhatIfForecast]
ReadPrec DescribeWhatIfForecast
Int -> ReadS DescribeWhatIfForecast
ReadS [DescribeWhatIfForecast]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeWhatIfForecast]
$creadListPrec :: ReadPrec [DescribeWhatIfForecast]
readPrec :: ReadPrec DescribeWhatIfForecast
$creadPrec :: ReadPrec DescribeWhatIfForecast
readList :: ReadS [DescribeWhatIfForecast]
$creadList :: ReadS [DescribeWhatIfForecast]
readsPrec :: Int -> ReadS DescribeWhatIfForecast
$creadsPrec :: Int -> ReadS DescribeWhatIfForecast
Prelude.Read, Int -> DescribeWhatIfForecast -> ShowS
[DescribeWhatIfForecast] -> ShowS
DescribeWhatIfForecast -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeWhatIfForecast] -> ShowS
$cshowList :: [DescribeWhatIfForecast] -> ShowS
show :: DescribeWhatIfForecast -> String
$cshow :: DescribeWhatIfForecast -> String
showsPrec :: Int -> DescribeWhatIfForecast -> ShowS
$cshowsPrec :: Int -> DescribeWhatIfForecast -> ShowS
Prelude.Show, forall x. Rep DescribeWhatIfForecast x -> DescribeWhatIfForecast
forall x. DescribeWhatIfForecast -> Rep DescribeWhatIfForecast x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeWhatIfForecast x -> DescribeWhatIfForecast
$cfrom :: forall x. DescribeWhatIfForecast -> Rep DescribeWhatIfForecast x
Prelude.Generic)

-- |
-- Create a value of 'DescribeWhatIfForecast' 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:
--
-- 'whatIfForecastArn', 'describeWhatIfForecast_whatIfForecastArn' - The Amazon Resource Name (ARN) of the what-if forecast that you are
-- interested in.
newDescribeWhatIfForecast ::
  -- | 'whatIfForecastArn'
  Prelude.Text ->
  DescribeWhatIfForecast
newDescribeWhatIfForecast :: Text -> DescribeWhatIfForecast
newDescribeWhatIfForecast Text
pWhatIfForecastArn_ =
  DescribeWhatIfForecast'
    { $sel:whatIfForecastArn:DescribeWhatIfForecast' :: Text
whatIfForecastArn =
        Text
pWhatIfForecastArn_
    }

-- | The Amazon Resource Name (ARN) of the what-if forecast that you are
-- interested in.
describeWhatIfForecast_whatIfForecastArn :: Lens.Lens' DescribeWhatIfForecast Prelude.Text
describeWhatIfForecast_whatIfForecastArn :: Lens' DescribeWhatIfForecast Text
describeWhatIfForecast_whatIfForecastArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecast' {Text
whatIfForecastArn :: Text
$sel:whatIfForecastArn:DescribeWhatIfForecast' :: DescribeWhatIfForecast -> Text
whatIfForecastArn} -> Text
whatIfForecastArn) (\s :: DescribeWhatIfForecast
s@DescribeWhatIfForecast' {} Text
a -> DescribeWhatIfForecast
s {$sel:whatIfForecastArn:DescribeWhatIfForecast' :: Text
whatIfForecastArn = Text
a} :: DescribeWhatIfForecast)

instance Core.AWSRequest DescribeWhatIfForecast where
  type
    AWSResponse DescribeWhatIfForecast =
      DescribeWhatIfForecastResponse
  request :: (Service -> Service)
-> DescribeWhatIfForecast -> Request DescribeWhatIfForecast
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeWhatIfForecast
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeWhatIfForecast)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe Integer
-> Maybe (NonEmpty Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe TimeSeriesReplacementsDataSource
-> Maybe [TimeSeriesTransformation]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeWhatIfForecastResponse
DescribeWhatIfForecastResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EstimatedTimeRemainingInMinutes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ForecastTypes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModificationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Message")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TimeSeriesReplacementsDataSource")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TimeSeriesTransformations"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"WhatIfAnalysisArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"WhatIfForecastArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"WhatIfForecastName")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable DescribeWhatIfForecast where
  hashWithSalt :: Int -> DescribeWhatIfForecast -> Int
hashWithSalt Int
_salt DescribeWhatIfForecast' {Text
whatIfForecastArn :: Text
$sel:whatIfForecastArn:DescribeWhatIfForecast' :: DescribeWhatIfForecast -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
whatIfForecastArn

instance Prelude.NFData DescribeWhatIfForecast where
  rnf :: DescribeWhatIfForecast -> ()
rnf DescribeWhatIfForecast' {Text
whatIfForecastArn :: Text
$sel:whatIfForecastArn:DescribeWhatIfForecast' :: DescribeWhatIfForecast -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
whatIfForecastArn

instance Data.ToHeaders DescribeWhatIfForecast where
  toHeaders :: DescribeWhatIfForecast -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonForecast.DescribeWhatIfForecast" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeWhatIfForecast where
  toJSON :: DescribeWhatIfForecast -> Value
toJSON DescribeWhatIfForecast' {Text
whatIfForecastArn :: Text
$sel:whatIfForecastArn:DescribeWhatIfForecast' :: DescribeWhatIfForecast -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"WhatIfForecastArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
whatIfForecastArn)
          ]
      )

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

instance Data.ToQuery DescribeWhatIfForecast where
  toQuery :: DescribeWhatIfForecast -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeWhatIfForecastResponse' smart constructor.
data DescribeWhatIfForecastResponse = DescribeWhatIfForecastResponse'
  { -- | When the what-if forecast was created.
    DescribeWhatIfForecastResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The approximate time remaining to complete the what-if forecast, in
    -- minutes.
    DescribeWhatIfForecastResponse -> Maybe Integer
estimatedTimeRemainingInMinutes :: Prelude.Maybe Prelude.Integer,
    -- | The quantiles at which probabilistic forecasts are generated. You can
    -- specify up to 5 quantiles per what-if forecast in the
    -- CreateWhatIfForecast operation. If you didn\'t specify quantiles, the
    -- default values are @[\"0.1\", \"0.5\", \"0.9\"]@.
    DescribeWhatIfForecastResponse -> Maybe (NonEmpty Text)
forecastTypes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The last time the resource was modified. The timestamp depends on the
    -- status of the job:
    --
    -- -   @CREATE_PENDING@ - The @CreationTime@.
    --
    -- -   @CREATE_IN_PROGRESS@ - The current timestamp.
    --
    -- -   @CREATE_STOPPING@ - The current timestamp.
    --
    -- -   @CREATE_STOPPED@ - When the job stopped.
    --
    -- -   @ACTIVE@ or @CREATE_FAILED@ - When the job finished or failed.
    DescribeWhatIfForecastResponse -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Data.POSIX,
    -- | If an error occurred, an informational message about the error.
    DescribeWhatIfForecastResponse -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The status of the what-if forecast. States include:
    --
    -- -   @ACTIVE@
    --
    -- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
    --
    -- -   @CREATE_STOPPING@, @CREATE_STOPPED@
    --
    -- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
    --
    -- The @Status@ of the what-if forecast must be @ACTIVE@ before you can
    -- access the forecast.
    DescribeWhatIfForecastResponse -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | An array of @S3Config@, @Schema@, and @Format@ elements that describe
    -- the replacement time series.
    DescribeWhatIfForecastResponse
-> Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource :: Prelude.Maybe TimeSeriesReplacementsDataSource,
    -- | An array of @Action@ and @TimeSeriesConditions@ elements that describe
    -- what transformations were applied to which time series.
    DescribeWhatIfForecastResponse -> Maybe [TimeSeriesTransformation]
timeSeriesTransformations :: Prelude.Maybe [TimeSeriesTransformation],
    -- | The Amazon Resource Name (ARN) of the what-if analysis that contains
    -- this forecast.
    DescribeWhatIfForecastResponse -> Maybe Text
whatIfAnalysisArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the what-if forecast.
    DescribeWhatIfForecastResponse -> Maybe Text
whatIfForecastArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the what-if forecast.
    DescribeWhatIfForecastResponse -> Maybe Text
whatIfForecastName :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeWhatIfForecastResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeWhatIfForecastResponse
-> DescribeWhatIfForecastResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeWhatIfForecastResponse
-> DescribeWhatIfForecastResponse -> Bool
$c/= :: DescribeWhatIfForecastResponse
-> DescribeWhatIfForecastResponse -> Bool
== :: DescribeWhatIfForecastResponse
-> DescribeWhatIfForecastResponse -> Bool
$c== :: DescribeWhatIfForecastResponse
-> DescribeWhatIfForecastResponse -> Bool
Prelude.Eq, ReadPrec [DescribeWhatIfForecastResponse]
ReadPrec DescribeWhatIfForecastResponse
Int -> ReadS DescribeWhatIfForecastResponse
ReadS [DescribeWhatIfForecastResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeWhatIfForecastResponse]
$creadListPrec :: ReadPrec [DescribeWhatIfForecastResponse]
readPrec :: ReadPrec DescribeWhatIfForecastResponse
$creadPrec :: ReadPrec DescribeWhatIfForecastResponse
readList :: ReadS [DescribeWhatIfForecastResponse]
$creadList :: ReadS [DescribeWhatIfForecastResponse]
readsPrec :: Int -> ReadS DescribeWhatIfForecastResponse
$creadsPrec :: Int -> ReadS DescribeWhatIfForecastResponse
Prelude.Read, Int -> DescribeWhatIfForecastResponse -> ShowS
[DescribeWhatIfForecastResponse] -> ShowS
DescribeWhatIfForecastResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeWhatIfForecastResponse] -> ShowS
$cshowList :: [DescribeWhatIfForecastResponse] -> ShowS
show :: DescribeWhatIfForecastResponse -> String
$cshow :: DescribeWhatIfForecastResponse -> String
showsPrec :: Int -> DescribeWhatIfForecastResponse -> ShowS
$cshowsPrec :: Int -> DescribeWhatIfForecastResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeWhatIfForecastResponse x
-> DescribeWhatIfForecastResponse
forall x.
DescribeWhatIfForecastResponse
-> Rep DescribeWhatIfForecastResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeWhatIfForecastResponse x
-> DescribeWhatIfForecastResponse
$cfrom :: forall x.
DescribeWhatIfForecastResponse
-> Rep DescribeWhatIfForecastResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeWhatIfForecastResponse' 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:
--
-- 'creationTime', 'describeWhatIfForecastResponse_creationTime' - When the what-if forecast was created.
--
-- 'estimatedTimeRemainingInMinutes', 'describeWhatIfForecastResponse_estimatedTimeRemainingInMinutes' - The approximate time remaining to complete the what-if forecast, in
-- minutes.
--
-- 'forecastTypes', 'describeWhatIfForecastResponse_forecastTypes' - The quantiles at which probabilistic forecasts are generated. You can
-- specify up to 5 quantiles per what-if forecast in the
-- CreateWhatIfForecast operation. If you didn\'t specify quantiles, the
-- default values are @[\"0.1\", \"0.5\", \"0.9\"]@.
--
-- 'lastModificationTime', 'describeWhatIfForecastResponse_lastModificationTime' - The last time the resource was modified. The timestamp depends on the
-- status of the job:
--
-- -   @CREATE_PENDING@ - The @CreationTime@.
--
-- -   @CREATE_IN_PROGRESS@ - The current timestamp.
--
-- -   @CREATE_STOPPING@ - The current timestamp.
--
-- -   @CREATE_STOPPED@ - When the job stopped.
--
-- -   @ACTIVE@ or @CREATE_FAILED@ - When the job finished or failed.
--
-- 'message', 'describeWhatIfForecastResponse_message' - If an error occurred, an informational message about the error.
--
-- 'status', 'describeWhatIfForecastResponse_status' - The status of the what-if forecast. States include:
--
-- -   @ACTIVE@
--
-- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
--
-- -   @CREATE_STOPPING@, @CREATE_STOPPED@
--
-- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
--
-- The @Status@ of the what-if forecast must be @ACTIVE@ before you can
-- access the forecast.
--
-- 'timeSeriesReplacementsDataSource', 'describeWhatIfForecastResponse_timeSeriesReplacementsDataSource' - An array of @S3Config@, @Schema@, and @Format@ elements that describe
-- the replacement time series.
--
-- 'timeSeriesTransformations', 'describeWhatIfForecastResponse_timeSeriesTransformations' - An array of @Action@ and @TimeSeriesConditions@ elements that describe
-- what transformations were applied to which time series.
--
-- 'whatIfAnalysisArn', 'describeWhatIfForecastResponse_whatIfAnalysisArn' - The Amazon Resource Name (ARN) of the what-if analysis that contains
-- this forecast.
--
-- 'whatIfForecastArn', 'describeWhatIfForecastResponse_whatIfForecastArn' - The Amazon Resource Name (ARN) of the what-if forecast.
--
-- 'whatIfForecastName', 'describeWhatIfForecastResponse_whatIfForecastName' - The name of the what-if forecast.
--
-- 'httpStatus', 'describeWhatIfForecastResponse_httpStatus' - The response's http status code.
newDescribeWhatIfForecastResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeWhatIfForecastResponse
newDescribeWhatIfForecastResponse :: Int -> DescribeWhatIfForecastResponse
newDescribeWhatIfForecastResponse Int
pHttpStatus_ =
  DescribeWhatIfForecastResponse'
    { $sel:creationTime:DescribeWhatIfForecastResponse' :: Maybe POSIX
creationTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:estimatedTimeRemainingInMinutes:DescribeWhatIfForecastResponse' :: Maybe Integer
estimatedTimeRemainingInMinutes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:forecastTypes:DescribeWhatIfForecastResponse' :: Maybe (NonEmpty Text)
forecastTypes = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:DescribeWhatIfForecastResponse' :: Maybe POSIX
lastModificationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:message:DescribeWhatIfForecastResponse' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeWhatIfForecastResponse' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
      $sel:timeSeriesReplacementsDataSource:DescribeWhatIfForecastResponse' :: Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource =
        forall a. Maybe a
Prelude.Nothing,
      $sel:timeSeriesTransformations:DescribeWhatIfForecastResponse' :: Maybe [TimeSeriesTransformation]
timeSeriesTransformations = forall a. Maybe a
Prelude.Nothing,
      $sel:whatIfAnalysisArn:DescribeWhatIfForecastResponse' :: Maybe Text
whatIfAnalysisArn = forall a. Maybe a
Prelude.Nothing,
      $sel:whatIfForecastArn:DescribeWhatIfForecastResponse' :: Maybe Text
whatIfForecastArn = forall a. Maybe a
Prelude.Nothing,
      $sel:whatIfForecastName:DescribeWhatIfForecastResponse' :: Maybe Text
whatIfForecastName = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeWhatIfForecastResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | When the what-if forecast was created.
describeWhatIfForecastResponse_creationTime :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe Prelude.UTCTime)
describeWhatIfForecastResponse_creationTime :: Lens' DescribeWhatIfForecastResponse (Maybe UTCTime)
describeWhatIfForecastResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe POSIX
a -> DescribeWhatIfForecastResponse
s {$sel:creationTime:DescribeWhatIfForecastResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeWhatIfForecastResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The approximate time remaining to complete the what-if forecast, in
-- minutes.
describeWhatIfForecastResponse_estimatedTimeRemainingInMinutes :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe Prelude.Integer)
describeWhatIfForecastResponse_estimatedTimeRemainingInMinutes :: Lens' DescribeWhatIfForecastResponse (Maybe Integer)
describeWhatIfForecastResponse_estimatedTimeRemainingInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe Integer
estimatedTimeRemainingInMinutes :: Maybe Integer
$sel:estimatedTimeRemainingInMinutes:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Integer
estimatedTimeRemainingInMinutes} -> Maybe Integer
estimatedTimeRemainingInMinutes) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe Integer
a -> DescribeWhatIfForecastResponse
s {$sel:estimatedTimeRemainingInMinutes:DescribeWhatIfForecastResponse' :: Maybe Integer
estimatedTimeRemainingInMinutes = Maybe Integer
a} :: DescribeWhatIfForecastResponse)

-- | The quantiles at which probabilistic forecasts are generated. You can
-- specify up to 5 quantiles per what-if forecast in the
-- CreateWhatIfForecast operation. If you didn\'t specify quantiles, the
-- default values are @[\"0.1\", \"0.5\", \"0.9\"]@.
describeWhatIfForecastResponse_forecastTypes :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeWhatIfForecastResponse_forecastTypes :: Lens' DescribeWhatIfForecastResponse (Maybe (NonEmpty Text))
describeWhatIfForecastResponse_forecastTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe (NonEmpty Text)
forecastTypes :: Maybe (NonEmpty Text)
$sel:forecastTypes:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe (NonEmpty Text)
forecastTypes} -> Maybe (NonEmpty Text)
forecastTypes) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe (NonEmpty Text)
a -> DescribeWhatIfForecastResponse
s {$sel:forecastTypes:DescribeWhatIfForecastResponse' :: Maybe (NonEmpty Text)
forecastTypes = Maybe (NonEmpty Text)
a} :: DescribeWhatIfForecastResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The last time the resource was modified. The timestamp depends on the
-- status of the job:
--
-- -   @CREATE_PENDING@ - The @CreationTime@.
--
-- -   @CREATE_IN_PROGRESS@ - The current timestamp.
--
-- -   @CREATE_STOPPING@ - The current timestamp.
--
-- -   @CREATE_STOPPED@ - When the job stopped.
--
-- -   @ACTIVE@ or @CREATE_FAILED@ - When the job finished or failed.
describeWhatIfForecastResponse_lastModificationTime :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe Prelude.UTCTime)
describeWhatIfForecastResponse_lastModificationTime :: Lens' DescribeWhatIfForecastResponse (Maybe UTCTime)
describeWhatIfForecastResponse_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe POSIX
a -> DescribeWhatIfForecastResponse
s {$sel:lastModificationTime:DescribeWhatIfForecastResponse' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: DescribeWhatIfForecastResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | If an error occurred, an informational message about the error.
describeWhatIfForecastResponse_message :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe Prelude.Text)
describeWhatIfForecastResponse_message :: Lens' DescribeWhatIfForecastResponse (Maybe Text)
describeWhatIfForecastResponse_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe Text
message :: Maybe Text
$sel:message:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
message} -> Maybe Text
message) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe Text
a -> DescribeWhatIfForecastResponse
s {$sel:message:DescribeWhatIfForecastResponse' :: Maybe Text
message = Maybe Text
a} :: DescribeWhatIfForecastResponse)

-- | The status of the what-if forecast. States include:
--
-- -   @ACTIVE@
--
-- -   @CREATE_PENDING@, @CREATE_IN_PROGRESS@, @CREATE_FAILED@
--
-- -   @CREATE_STOPPING@, @CREATE_STOPPED@
--
-- -   @DELETE_PENDING@, @DELETE_IN_PROGRESS@, @DELETE_FAILED@
--
-- The @Status@ of the what-if forecast must be @ACTIVE@ before you can
-- access the forecast.
describeWhatIfForecastResponse_status :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe Prelude.Text)
describeWhatIfForecastResponse_status :: Lens' DescribeWhatIfForecastResponse (Maybe Text)
describeWhatIfForecastResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe Text
status :: Maybe Text
$sel:status:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe Text
a -> DescribeWhatIfForecastResponse
s {$sel:status:DescribeWhatIfForecastResponse' :: Maybe Text
status = Maybe Text
a} :: DescribeWhatIfForecastResponse)

-- | An array of @S3Config@, @Schema@, and @Format@ elements that describe
-- the replacement time series.
describeWhatIfForecastResponse_timeSeriesReplacementsDataSource :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe TimeSeriesReplacementsDataSource)
describeWhatIfForecastResponse_timeSeriesReplacementsDataSource :: Lens'
  DescribeWhatIfForecastResponse
  (Maybe TimeSeriesReplacementsDataSource)
describeWhatIfForecastResponse_timeSeriesReplacementsDataSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource :: Maybe TimeSeriesReplacementsDataSource
$sel:timeSeriesReplacementsDataSource:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse
-> Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource} -> Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe TimeSeriesReplacementsDataSource
a -> DescribeWhatIfForecastResponse
s {$sel:timeSeriesReplacementsDataSource:DescribeWhatIfForecastResponse' :: Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource = Maybe TimeSeriesReplacementsDataSource
a} :: DescribeWhatIfForecastResponse)

-- | An array of @Action@ and @TimeSeriesConditions@ elements that describe
-- what transformations were applied to which time series.
describeWhatIfForecastResponse_timeSeriesTransformations :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe [TimeSeriesTransformation])
describeWhatIfForecastResponse_timeSeriesTransformations :: Lens'
  DescribeWhatIfForecastResponse (Maybe [TimeSeriesTransformation])
describeWhatIfForecastResponse_timeSeriesTransformations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe [TimeSeriesTransformation]
timeSeriesTransformations :: Maybe [TimeSeriesTransformation]
$sel:timeSeriesTransformations:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe [TimeSeriesTransformation]
timeSeriesTransformations} -> Maybe [TimeSeriesTransformation]
timeSeriesTransformations) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe [TimeSeriesTransformation]
a -> DescribeWhatIfForecastResponse
s {$sel:timeSeriesTransformations:DescribeWhatIfForecastResponse' :: Maybe [TimeSeriesTransformation]
timeSeriesTransformations = Maybe [TimeSeriesTransformation]
a} :: DescribeWhatIfForecastResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the what-if analysis that contains
-- this forecast.
describeWhatIfForecastResponse_whatIfAnalysisArn :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe Prelude.Text)
describeWhatIfForecastResponse_whatIfAnalysisArn :: Lens' DescribeWhatIfForecastResponse (Maybe Text)
describeWhatIfForecastResponse_whatIfAnalysisArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe Text
whatIfAnalysisArn :: Maybe Text
$sel:whatIfAnalysisArn:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
whatIfAnalysisArn} -> Maybe Text
whatIfAnalysisArn) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe Text
a -> DescribeWhatIfForecastResponse
s {$sel:whatIfAnalysisArn:DescribeWhatIfForecastResponse' :: Maybe Text
whatIfAnalysisArn = Maybe Text
a} :: DescribeWhatIfForecastResponse)

-- | The Amazon Resource Name (ARN) of the what-if forecast.
describeWhatIfForecastResponse_whatIfForecastArn :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe Prelude.Text)
describeWhatIfForecastResponse_whatIfForecastArn :: Lens' DescribeWhatIfForecastResponse (Maybe Text)
describeWhatIfForecastResponse_whatIfForecastArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe Text
whatIfForecastArn :: Maybe Text
$sel:whatIfForecastArn:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
whatIfForecastArn} -> Maybe Text
whatIfForecastArn) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe Text
a -> DescribeWhatIfForecastResponse
s {$sel:whatIfForecastArn:DescribeWhatIfForecastResponse' :: Maybe Text
whatIfForecastArn = Maybe Text
a} :: DescribeWhatIfForecastResponse)

-- | The name of the what-if forecast.
describeWhatIfForecastResponse_whatIfForecastName :: Lens.Lens' DescribeWhatIfForecastResponse (Prelude.Maybe Prelude.Text)
describeWhatIfForecastResponse_whatIfForecastName :: Lens' DescribeWhatIfForecastResponse (Maybe Text)
describeWhatIfForecastResponse_whatIfForecastName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeWhatIfForecastResponse' {Maybe Text
whatIfForecastName :: Maybe Text
$sel:whatIfForecastName:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
whatIfForecastName} -> Maybe Text
whatIfForecastName) (\s :: DescribeWhatIfForecastResponse
s@DescribeWhatIfForecastResponse' {} Maybe Text
a -> DescribeWhatIfForecastResponse
s {$sel:whatIfForecastName:DescribeWhatIfForecastResponse' :: Maybe Text
whatIfForecastName = Maybe Text
a} :: DescribeWhatIfForecastResponse)

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

instance
  Prelude.NFData
    DescribeWhatIfForecastResponse
  where
  rnf :: DescribeWhatIfForecastResponse -> ()
rnf DescribeWhatIfForecastResponse' {Int
Maybe Integer
Maybe [TimeSeriesTransformation]
Maybe (NonEmpty Text)
Maybe Text
Maybe POSIX
Maybe TimeSeriesReplacementsDataSource
httpStatus :: Int
whatIfForecastName :: Maybe Text
whatIfForecastArn :: Maybe Text
whatIfAnalysisArn :: Maybe Text
timeSeriesTransformations :: Maybe [TimeSeriesTransformation]
timeSeriesReplacementsDataSource :: Maybe TimeSeriesReplacementsDataSource
status :: Maybe Text
message :: Maybe Text
lastModificationTime :: Maybe POSIX
forecastTypes :: Maybe (NonEmpty Text)
estimatedTimeRemainingInMinutes :: Maybe Integer
creationTime :: Maybe POSIX
$sel:httpStatus:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Int
$sel:whatIfForecastName:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
$sel:whatIfForecastArn:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
$sel:whatIfAnalysisArn:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
$sel:timeSeriesTransformations:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe [TimeSeriesTransformation]
$sel:timeSeriesReplacementsDataSource:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse
-> Maybe TimeSeriesReplacementsDataSource
$sel:status:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
$sel:message:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Text
$sel:lastModificationTime:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe POSIX
$sel:forecastTypes:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe (NonEmpty Text)
$sel:estimatedTimeRemainingInMinutes:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe Integer
$sel:creationTime:DescribeWhatIfForecastResponse' :: DescribeWhatIfForecastResponse -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
estimatedTimeRemainingInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
forecastTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModificationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TimeSeriesReplacementsDataSource
timeSeriesReplacementsDataSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TimeSeriesTransformation]
timeSeriesTransformations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
whatIfAnalysisArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
whatIfForecastArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
whatIfForecastName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus