{-# 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.DescribeForecast
-- 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)
--
-- Describes a forecast created using the CreateForecast operation.
--
-- In addition to listing the properties provided in the @CreateForecast@
-- request, this operation lists the following properties:
--
-- -   @DatasetGroupArn@ - The dataset group that provided the training
--     data.
--
-- -   @CreationTime@
--
-- -   @LastModificationTime@
--
-- -   @Status@
--
-- -   @Message@ - If an error occurred, information about the error.
module Amazonka.Forecast.DescribeForecast
  ( -- * Creating a Request
    DescribeForecast (..),
    newDescribeForecast,

    -- * Request Lenses
    describeForecast_forecastArn,

    -- * Destructuring the Response
    DescribeForecastResponse (..),
    newDescribeForecastResponse,

    -- * Response Lenses
    describeForecastResponse_creationTime,
    describeForecastResponse_status,
    describeForecastResponse_predictorArn,
    describeForecastResponse_forecastArn,
    describeForecastResponse_estimatedTimeRemainingInMinutes,
    describeForecastResponse_forecastName,
    describeForecastResponse_forecastTypes,
    describeForecastResponse_datasetGroupArn,
    describeForecastResponse_message,
    describeForecastResponse_lastModificationTime,
    describeForecastResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Forecast.Types
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:/ 'newDescribeForecast' smart constructor.
data DescribeForecast = DescribeForecast'
  { -- | The Amazon Resource Name (ARN) of the forecast.
    DescribeForecast -> Text
forecastArn :: Prelude.Text
  }
  deriving (DescribeForecast -> DescribeForecast -> Bool
(DescribeForecast -> DescribeForecast -> Bool)
-> (DescribeForecast -> DescribeForecast -> Bool)
-> Eq DescribeForecast
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeForecast -> DescribeForecast -> Bool
$c/= :: DescribeForecast -> DescribeForecast -> Bool
== :: DescribeForecast -> DescribeForecast -> Bool
$c== :: DescribeForecast -> DescribeForecast -> Bool
Prelude.Eq, ReadPrec [DescribeForecast]
ReadPrec DescribeForecast
Int -> ReadS DescribeForecast
ReadS [DescribeForecast]
(Int -> ReadS DescribeForecast)
-> ReadS [DescribeForecast]
-> ReadPrec DescribeForecast
-> ReadPrec [DescribeForecast]
-> Read DescribeForecast
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeForecast]
$creadListPrec :: ReadPrec [DescribeForecast]
readPrec :: ReadPrec DescribeForecast
$creadPrec :: ReadPrec DescribeForecast
readList :: ReadS [DescribeForecast]
$creadList :: ReadS [DescribeForecast]
readsPrec :: Int -> ReadS DescribeForecast
$creadsPrec :: Int -> ReadS DescribeForecast
Prelude.Read, Int -> DescribeForecast -> ShowS
[DescribeForecast] -> ShowS
DescribeForecast -> String
(Int -> DescribeForecast -> ShowS)
-> (DescribeForecast -> String)
-> ([DescribeForecast] -> ShowS)
-> Show DescribeForecast
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeForecast] -> ShowS
$cshowList :: [DescribeForecast] -> ShowS
show :: DescribeForecast -> String
$cshow :: DescribeForecast -> String
showsPrec :: Int -> DescribeForecast -> ShowS
$cshowsPrec :: Int -> DescribeForecast -> ShowS
Prelude.Show, (forall x. DescribeForecast -> Rep DescribeForecast x)
-> (forall x. Rep DescribeForecast x -> DescribeForecast)
-> Generic DescribeForecast
forall x. Rep DescribeForecast x -> DescribeForecast
forall x. DescribeForecast -> Rep DescribeForecast x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeForecast x -> DescribeForecast
$cfrom :: forall x. DescribeForecast -> Rep DescribeForecast x
Prelude.Generic)

-- |
-- Create a value of 'DescribeForecast' 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:
--
-- 'forecastArn', 'describeForecast_forecastArn' - The Amazon Resource Name (ARN) of the forecast.
newDescribeForecast ::
  -- | 'forecastArn'
  Prelude.Text ->
  DescribeForecast
newDescribeForecast :: Text -> DescribeForecast
newDescribeForecast Text
pForecastArn_ =
  DescribeForecast' :: Text -> DescribeForecast
DescribeForecast' {$sel:forecastArn:DescribeForecast' :: Text
forecastArn = Text
pForecastArn_}

-- | The Amazon Resource Name (ARN) of the forecast.
describeForecast_forecastArn :: Lens.Lens' DescribeForecast Prelude.Text
describeForecast_forecastArn :: (Text -> f Text) -> DescribeForecast -> f DescribeForecast
describeForecast_forecastArn = (DescribeForecast -> Text)
-> (DescribeForecast -> Text -> DescribeForecast)
-> Lens DescribeForecast DescribeForecast Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecast' {Text
forecastArn :: Text
$sel:forecastArn:DescribeForecast' :: DescribeForecast -> Text
forecastArn} -> Text
forecastArn) (\s :: DescribeForecast
s@DescribeForecast' {} Text
a -> DescribeForecast
s {$sel:forecastArn:DescribeForecast' :: Text
forecastArn = Text
a} :: DescribeForecast)

instance Core.AWSRequest DescribeForecast where
  type
    AWSResponse DescribeForecast =
      DescribeForecastResponse
  request :: DescribeForecast -> Request DescribeForecast
request = Service -> DescribeForecast -> Request DescribeForecast
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeForecast
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeForecast)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeForecast))
-> Logger
-> Service
-> Proxy DescribeForecast
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeForecast)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DescribeForecastResponse
DescribeForecastResponse'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Text
 -> Maybe (NonEmpty Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Int
 -> DescribeForecastResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeForecastResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeForecastResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeForecastResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PredictorArn")
            Either
  String
  (Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeForecastResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ForecastArn")
            Either
  String
  (Maybe Integer
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeForecastResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EstimatedTimeRemainingInMinutes")
            Either
  String
  (Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeForecastResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (NonEmpty Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ForecastName")
            Either
  String
  (Maybe (NonEmpty Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> DescribeForecastResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> Int -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ForecastTypes")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe POSIX -> Int -> DescribeForecastResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe POSIX -> Int -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DatasetGroupArn")
            Either
  String
  (Maybe Text -> Maybe POSIX -> Int -> DescribeForecastResponse)
-> Either String (Maybe Text)
-> Either String (Maybe POSIX -> Int -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Message")
            Either String (Maybe POSIX -> Int -> DescribeForecastResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> DescribeForecastResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastModificationTime")
            Either String (Int -> DescribeForecastResponse)
-> Either String Int -> Either String DescribeForecastResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable DescribeForecast

instance Prelude.NFData DescribeForecast

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

instance Core.ToJSON DescribeForecast where
  toJSON :: DescribeForecast -> Value
toJSON DescribeForecast' {Text
forecastArn :: Text
$sel:forecastArn:DescribeForecast' :: DescribeForecast -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ForecastArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
forecastArn)]
      )

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

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

-- | /See:/ 'newDescribeForecastResponse' smart constructor.
data DescribeForecastResponse = DescribeForecastResponse'
  { -- | When the forecast creation task was created.
    DescribeForecastResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the 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 forecast must be @ACTIVE@ before you can query or
    -- export the forecast.
    DescribeForecastResponse -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the predictor used to generate the forecast.
    DescribeForecastResponse -> Maybe Text
predictorArn :: Prelude.Maybe Prelude.Text,
    -- | The forecast ARN as specified in the request.
    DescribeForecastResponse -> Maybe Text
forecastArn :: Prelude.Maybe Prelude.Text,
    -- | The estimated time remaining in minutes for the forecast job to
    -- complete.
    DescribeForecastResponse -> Maybe Integer
estimatedTimeRemainingInMinutes :: Prelude.Maybe Prelude.Integer,
    -- | The name of the forecast.
    DescribeForecastResponse -> Maybe Text
forecastName :: Prelude.Maybe Prelude.Text,
    -- | The quantiles at which probabilistic forecasts were generated.
    DescribeForecastResponse -> Maybe (NonEmpty Text)
forecastTypes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The ARN of the dataset group that provided the data used to train the
    -- predictor.
    DescribeForecastResponse -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | If an error occurred, an informational message about the error.
    DescribeForecastResponse -> Maybe Text
message :: Prelude.Maybe 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.
    DescribeForecastResponse -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    DescribeForecastResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeForecastResponse -> DescribeForecastResponse -> Bool
(DescribeForecastResponse -> DescribeForecastResponse -> Bool)
-> (DescribeForecastResponse -> DescribeForecastResponse -> Bool)
-> Eq DescribeForecastResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeForecastResponse -> DescribeForecastResponse -> Bool
$c/= :: DescribeForecastResponse -> DescribeForecastResponse -> Bool
== :: DescribeForecastResponse -> DescribeForecastResponse -> Bool
$c== :: DescribeForecastResponse -> DescribeForecastResponse -> Bool
Prelude.Eq, ReadPrec [DescribeForecastResponse]
ReadPrec DescribeForecastResponse
Int -> ReadS DescribeForecastResponse
ReadS [DescribeForecastResponse]
(Int -> ReadS DescribeForecastResponse)
-> ReadS [DescribeForecastResponse]
-> ReadPrec DescribeForecastResponse
-> ReadPrec [DescribeForecastResponse]
-> Read DescribeForecastResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeForecastResponse]
$creadListPrec :: ReadPrec [DescribeForecastResponse]
readPrec :: ReadPrec DescribeForecastResponse
$creadPrec :: ReadPrec DescribeForecastResponse
readList :: ReadS [DescribeForecastResponse]
$creadList :: ReadS [DescribeForecastResponse]
readsPrec :: Int -> ReadS DescribeForecastResponse
$creadsPrec :: Int -> ReadS DescribeForecastResponse
Prelude.Read, Int -> DescribeForecastResponse -> ShowS
[DescribeForecastResponse] -> ShowS
DescribeForecastResponse -> String
(Int -> DescribeForecastResponse -> ShowS)
-> (DescribeForecastResponse -> String)
-> ([DescribeForecastResponse] -> ShowS)
-> Show DescribeForecastResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeForecastResponse] -> ShowS
$cshowList :: [DescribeForecastResponse] -> ShowS
show :: DescribeForecastResponse -> String
$cshow :: DescribeForecastResponse -> String
showsPrec :: Int -> DescribeForecastResponse -> ShowS
$cshowsPrec :: Int -> DescribeForecastResponse -> ShowS
Prelude.Show, (forall x.
 DescribeForecastResponse -> Rep DescribeForecastResponse x)
-> (forall x.
    Rep DescribeForecastResponse x -> DescribeForecastResponse)
-> Generic DescribeForecastResponse
forall x.
Rep DescribeForecastResponse x -> DescribeForecastResponse
forall x.
DescribeForecastResponse -> Rep DescribeForecastResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeForecastResponse x -> DescribeForecastResponse
$cfrom :: forall x.
DescribeForecastResponse -> Rep DescribeForecastResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeForecastResponse' 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', 'describeForecastResponse_creationTime' - When the forecast creation task was created.
--
-- 'status', 'describeForecastResponse_status' - The status of the 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 forecast must be @ACTIVE@ before you can query or
-- export the forecast.
--
-- 'predictorArn', 'describeForecastResponse_predictorArn' - The ARN of the predictor used to generate the forecast.
--
-- 'forecastArn', 'describeForecastResponse_forecastArn' - The forecast ARN as specified in the request.
--
-- 'estimatedTimeRemainingInMinutes', 'describeForecastResponse_estimatedTimeRemainingInMinutes' - The estimated time remaining in minutes for the forecast job to
-- complete.
--
-- 'forecastName', 'describeForecastResponse_forecastName' - The name of the forecast.
--
-- 'forecastTypes', 'describeForecastResponse_forecastTypes' - The quantiles at which probabilistic forecasts were generated.
--
-- 'datasetGroupArn', 'describeForecastResponse_datasetGroupArn' - The ARN of the dataset group that provided the data used to train the
-- predictor.
--
-- 'message', 'describeForecastResponse_message' - If an error occurred, an informational message about the error.
--
-- 'lastModificationTime', 'describeForecastResponse_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.
--
-- 'httpStatus', 'describeForecastResponse_httpStatus' - The response's http status code.
newDescribeForecastResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeForecastResponse
newDescribeForecastResponse :: Int -> DescribeForecastResponse
newDescribeForecastResponse Int
pHttpStatus_ =
  DescribeForecastResponse' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DescribeForecastResponse
DescribeForecastResponse'
    { $sel:creationTime:DescribeForecastResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeForecastResponse' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:predictorArn:DescribeForecastResponse' :: Maybe Text
predictorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:forecastArn:DescribeForecastResponse' :: Maybe Text
forecastArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:estimatedTimeRemainingInMinutes:DescribeForecastResponse' :: Maybe Integer
estimatedTimeRemainingInMinutes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:forecastName:DescribeForecastResponse' :: Maybe Text
forecastName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:forecastTypes:DescribeForecastResponse' :: Maybe (NonEmpty Text)
forecastTypes = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupArn:DescribeForecastResponse' :: Maybe Text
datasetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:message:DescribeForecastResponse' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:DescribeForecastResponse' :: Maybe POSIX
lastModificationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeForecastResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | When the forecast creation task was created.
describeForecastResponse_creationTime :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe Prelude.UTCTime)
describeForecastResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_creationTime = (DescribeForecastResponse -> Maybe POSIX)
-> (DescribeForecastResponse
    -> Maybe POSIX -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe POSIX
a -> DescribeForecastResponse
s {$sel:creationTime:DescribeForecastResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeForecastResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeForecastResponse -> f DescribeForecastResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeForecastResponse
-> f DescribeForecastResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of the 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 forecast must be @ACTIVE@ before you can query or
-- export the forecast.
describeForecastResponse_status :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe Prelude.Text)
describeForecastResponse_status :: (Maybe Text -> f (Maybe Text))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_status = (DescribeForecastResponse -> Maybe Text)
-> (DescribeForecastResponse
    -> Maybe Text -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe Text
status :: Maybe Text
$sel:status:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe Text
a -> DescribeForecastResponse
s {$sel:status:DescribeForecastResponse' :: Maybe Text
status = Maybe Text
a} :: DescribeForecastResponse)

-- | The ARN of the predictor used to generate the forecast.
describeForecastResponse_predictorArn :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe Prelude.Text)
describeForecastResponse_predictorArn :: (Maybe Text -> f (Maybe Text))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_predictorArn = (DescribeForecastResponse -> Maybe Text)
-> (DescribeForecastResponse
    -> Maybe Text -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe Text
predictorArn :: Maybe Text
$sel:predictorArn:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe Text
predictorArn} -> Maybe Text
predictorArn) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe Text
a -> DescribeForecastResponse
s {$sel:predictorArn:DescribeForecastResponse' :: Maybe Text
predictorArn = Maybe Text
a} :: DescribeForecastResponse)

-- | The forecast ARN as specified in the request.
describeForecastResponse_forecastArn :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe Prelude.Text)
describeForecastResponse_forecastArn :: (Maybe Text -> f (Maybe Text))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_forecastArn = (DescribeForecastResponse -> Maybe Text)
-> (DescribeForecastResponse
    -> Maybe Text -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe Text
forecastArn :: Maybe Text
$sel:forecastArn:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe Text
forecastArn} -> Maybe Text
forecastArn) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe Text
a -> DescribeForecastResponse
s {$sel:forecastArn:DescribeForecastResponse' :: Maybe Text
forecastArn = Maybe Text
a} :: DescribeForecastResponse)

-- | The estimated time remaining in minutes for the forecast job to
-- complete.
describeForecastResponse_estimatedTimeRemainingInMinutes :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe Prelude.Integer)
describeForecastResponse_estimatedTimeRemainingInMinutes :: (Maybe Integer -> f (Maybe Integer))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_estimatedTimeRemainingInMinutes = (DescribeForecastResponse -> Maybe Integer)
-> (DescribeForecastResponse
    -> Maybe Integer -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe Integer
estimatedTimeRemainingInMinutes :: Maybe Integer
$sel:estimatedTimeRemainingInMinutes:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe Integer
estimatedTimeRemainingInMinutes} -> Maybe Integer
estimatedTimeRemainingInMinutes) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe Integer
a -> DescribeForecastResponse
s {$sel:estimatedTimeRemainingInMinutes:DescribeForecastResponse' :: Maybe Integer
estimatedTimeRemainingInMinutes = Maybe Integer
a} :: DescribeForecastResponse)

-- | The name of the forecast.
describeForecastResponse_forecastName :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe Prelude.Text)
describeForecastResponse_forecastName :: (Maybe Text -> f (Maybe Text))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_forecastName = (DescribeForecastResponse -> Maybe Text)
-> (DescribeForecastResponse
    -> Maybe Text -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe Text
forecastName :: Maybe Text
$sel:forecastName:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe Text
forecastName} -> Maybe Text
forecastName) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe Text
a -> DescribeForecastResponse
s {$sel:forecastName:DescribeForecastResponse' :: Maybe Text
forecastName = Maybe Text
a} :: DescribeForecastResponse)

-- | The quantiles at which probabilistic forecasts were generated.
describeForecastResponse_forecastTypes :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeForecastResponse_forecastTypes :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_forecastTypes = (DescribeForecastResponse -> Maybe (NonEmpty Text))
-> (DescribeForecastResponse
    -> Maybe (NonEmpty Text) -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe (NonEmpty Text)
forecastTypes :: Maybe (NonEmpty Text)
$sel:forecastTypes:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe (NonEmpty Text)
forecastTypes} -> Maybe (NonEmpty Text)
forecastTypes) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe (NonEmpty Text)
a -> DescribeForecastResponse
s {$sel:forecastTypes:DescribeForecastResponse' :: Maybe (NonEmpty Text)
forecastTypes = Maybe (NonEmpty Text)
a} :: DescribeForecastResponse) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> DescribeForecastResponse -> f DescribeForecastResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DescribeForecastResponse
-> f DescribeForecastResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the dataset group that provided the data used to train the
-- predictor.
describeForecastResponse_datasetGroupArn :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe Prelude.Text)
describeForecastResponse_datasetGroupArn :: (Maybe Text -> f (Maybe Text))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_datasetGroupArn = (DescribeForecastResponse -> Maybe Text)
-> (DescribeForecastResponse
    -> Maybe Text -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe Text
datasetGroupArn :: Maybe Text
$sel:datasetGroupArn:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe Text
datasetGroupArn} -> Maybe Text
datasetGroupArn) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe Text
a -> DescribeForecastResponse
s {$sel:datasetGroupArn:DescribeForecastResponse' :: Maybe Text
datasetGroupArn = Maybe Text
a} :: DescribeForecastResponse)

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

-- | 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.
describeForecastResponse_lastModificationTime :: Lens.Lens' DescribeForecastResponse (Prelude.Maybe Prelude.UTCTime)
describeForecastResponse_lastModificationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeForecastResponse -> f DescribeForecastResponse
describeForecastResponse_lastModificationTime = (DescribeForecastResponse -> Maybe POSIX)
-> (DescribeForecastResponse
    -> Maybe POSIX -> DescribeForecastResponse)
-> Lens
     DescribeForecastResponse
     DescribeForecastResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeForecastResponse' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:DescribeForecastResponse' :: DescribeForecastResponse -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: DescribeForecastResponse
s@DescribeForecastResponse' {} Maybe POSIX
a -> DescribeForecastResponse
s {$sel:lastModificationTime:DescribeForecastResponse' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: DescribeForecastResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeForecastResponse -> f DescribeForecastResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeForecastResponse
-> f DescribeForecastResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Prelude.NFData DescribeForecastResponse