{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ForecastExportJobSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Forecast.Types.ForecastExportJobSummary 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.DataDestination
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of the forecast export job properties used in the
-- ListForecastExportJobs operation. To get the complete set of properties,
-- call the DescribeForecastExportJob operation, and provide the listed
-- @ForecastExportJobArn@.
--
-- /See:/ 'newForecastExportJobSummary' smart constructor.
data ForecastExportJobSummary = ForecastExportJobSummary'
  { -- | When the forecast export job was created.
    ForecastExportJobSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The path to the Amazon Simple Storage Service (Amazon S3) bucket where
    -- the forecast is exported.
    ForecastExportJobSummary -> Maybe DataDestination
destination :: Prelude.Maybe DataDestination,
    -- | The Amazon Resource Name (ARN) of the forecast export job.
    ForecastExportJobSummary -> Maybe Text
forecastExportJobArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the forecast export job.
    ForecastExportJobSummary -> Maybe Text
forecastExportJobName :: 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.
    ForecastExportJobSummary -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Data.POSIX,
    -- | If an error occurred, an informational message about the error.
    ForecastExportJobSummary -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The status of the forecast export job. 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 export job must be @ACTIVE@ before you can
    -- access the forecast in your S3 bucket.
    ForecastExportJobSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (ForecastExportJobSummary -> ForecastExportJobSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ForecastExportJobSummary -> ForecastExportJobSummary -> Bool
$c/= :: ForecastExportJobSummary -> ForecastExportJobSummary -> Bool
== :: ForecastExportJobSummary -> ForecastExportJobSummary -> Bool
$c== :: ForecastExportJobSummary -> ForecastExportJobSummary -> Bool
Prelude.Eq, ReadPrec [ForecastExportJobSummary]
ReadPrec ForecastExportJobSummary
Int -> ReadS ForecastExportJobSummary
ReadS [ForecastExportJobSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ForecastExportJobSummary]
$creadListPrec :: ReadPrec [ForecastExportJobSummary]
readPrec :: ReadPrec ForecastExportJobSummary
$creadPrec :: ReadPrec ForecastExportJobSummary
readList :: ReadS [ForecastExportJobSummary]
$creadList :: ReadS [ForecastExportJobSummary]
readsPrec :: Int -> ReadS ForecastExportJobSummary
$creadsPrec :: Int -> ReadS ForecastExportJobSummary
Prelude.Read, Int -> ForecastExportJobSummary -> ShowS
[ForecastExportJobSummary] -> ShowS
ForecastExportJobSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ForecastExportJobSummary] -> ShowS
$cshowList :: [ForecastExportJobSummary] -> ShowS
show :: ForecastExportJobSummary -> String
$cshow :: ForecastExportJobSummary -> String
showsPrec :: Int -> ForecastExportJobSummary -> ShowS
$cshowsPrec :: Int -> ForecastExportJobSummary -> ShowS
Prelude.Show, forall x.
Rep ForecastExportJobSummary x -> ForecastExportJobSummary
forall x.
ForecastExportJobSummary -> Rep ForecastExportJobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ForecastExportJobSummary x -> ForecastExportJobSummary
$cfrom :: forall x.
ForecastExportJobSummary -> Rep ForecastExportJobSummary x
Prelude.Generic)

-- |
-- Create a value of 'ForecastExportJobSummary' 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', 'forecastExportJobSummary_creationTime' - When the forecast export job was created.
--
-- 'destination', 'forecastExportJobSummary_destination' - The path to the Amazon Simple Storage Service (Amazon S3) bucket where
-- the forecast is exported.
--
-- 'forecastExportJobArn', 'forecastExportJobSummary_forecastExportJobArn' - The Amazon Resource Name (ARN) of the forecast export job.
--
-- 'forecastExportJobName', 'forecastExportJobSummary_forecastExportJobName' - The name of the forecast export job.
--
-- 'lastModificationTime', 'forecastExportJobSummary_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', 'forecastExportJobSummary_message' - If an error occurred, an informational message about the error.
--
-- 'status', 'forecastExportJobSummary_status' - The status of the forecast export job. 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 export job must be @ACTIVE@ before you can
-- access the forecast in your S3 bucket.
newForecastExportJobSummary ::
  ForecastExportJobSummary
newForecastExportJobSummary :: ForecastExportJobSummary
newForecastExportJobSummary =
  ForecastExportJobSummary'
    { $sel:creationTime:ForecastExportJobSummary' :: Maybe POSIX
creationTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:destination:ForecastExportJobSummary' :: Maybe DataDestination
destination = forall a. Maybe a
Prelude.Nothing,
      $sel:forecastExportJobArn:ForecastExportJobSummary' :: Maybe Text
forecastExportJobArn = forall a. Maybe a
Prelude.Nothing,
      $sel:forecastExportJobName:ForecastExportJobSummary' :: Maybe Text
forecastExportJobName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:ForecastExportJobSummary' :: Maybe POSIX
lastModificationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:message:ForecastExportJobSummary' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ForecastExportJobSummary' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | When the forecast export job was created.
forecastExportJobSummary_creationTime :: Lens.Lens' ForecastExportJobSummary (Prelude.Maybe Prelude.UTCTime)
forecastExportJobSummary_creationTime :: Lens' ForecastExportJobSummary (Maybe UTCTime)
forecastExportJobSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ForecastExportJobSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ForecastExportJobSummary
s@ForecastExportJobSummary' {} Maybe POSIX
a -> ForecastExportJobSummary
s {$sel:creationTime:ForecastExportJobSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ForecastExportJobSummary) 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 path to the Amazon Simple Storage Service (Amazon S3) bucket where
-- the forecast is exported.
forecastExportJobSummary_destination :: Lens.Lens' ForecastExportJobSummary (Prelude.Maybe DataDestination)
forecastExportJobSummary_destination :: Lens' ForecastExportJobSummary (Maybe DataDestination)
forecastExportJobSummary_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ForecastExportJobSummary' {Maybe DataDestination
destination :: Maybe DataDestination
$sel:destination:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe DataDestination
destination} -> Maybe DataDestination
destination) (\s :: ForecastExportJobSummary
s@ForecastExportJobSummary' {} Maybe DataDestination
a -> ForecastExportJobSummary
s {$sel:destination:ForecastExportJobSummary' :: Maybe DataDestination
destination = Maybe DataDestination
a} :: ForecastExportJobSummary)

-- | The Amazon Resource Name (ARN) of the forecast export job.
forecastExportJobSummary_forecastExportJobArn :: Lens.Lens' ForecastExportJobSummary (Prelude.Maybe Prelude.Text)
forecastExportJobSummary_forecastExportJobArn :: Lens' ForecastExportJobSummary (Maybe Text)
forecastExportJobSummary_forecastExportJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ForecastExportJobSummary' {Maybe Text
forecastExportJobArn :: Maybe Text
$sel:forecastExportJobArn:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
forecastExportJobArn} -> Maybe Text
forecastExportJobArn) (\s :: ForecastExportJobSummary
s@ForecastExportJobSummary' {} Maybe Text
a -> ForecastExportJobSummary
s {$sel:forecastExportJobArn:ForecastExportJobSummary' :: Maybe Text
forecastExportJobArn = Maybe Text
a} :: ForecastExportJobSummary)

-- | The name of the forecast export job.
forecastExportJobSummary_forecastExportJobName :: Lens.Lens' ForecastExportJobSummary (Prelude.Maybe Prelude.Text)
forecastExportJobSummary_forecastExportJobName :: Lens' ForecastExportJobSummary (Maybe Text)
forecastExportJobSummary_forecastExportJobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ForecastExportJobSummary' {Maybe Text
forecastExportJobName :: Maybe Text
$sel:forecastExportJobName:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
forecastExportJobName} -> Maybe Text
forecastExportJobName) (\s :: ForecastExportJobSummary
s@ForecastExportJobSummary' {} Maybe Text
a -> ForecastExportJobSummary
s {$sel:forecastExportJobName:ForecastExportJobSummary' :: Maybe Text
forecastExportJobName = Maybe Text
a} :: ForecastExportJobSummary)

-- | 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.
forecastExportJobSummary_lastModificationTime :: Lens.Lens' ForecastExportJobSummary (Prelude.Maybe Prelude.UTCTime)
forecastExportJobSummary_lastModificationTime :: Lens' ForecastExportJobSummary (Maybe UTCTime)
forecastExportJobSummary_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ForecastExportJobSummary' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: ForecastExportJobSummary
s@ForecastExportJobSummary' {} Maybe POSIX
a -> ForecastExportJobSummary
s {$sel:lastModificationTime:ForecastExportJobSummary' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: ForecastExportJobSummary) 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.
forecastExportJobSummary_message :: Lens.Lens' ForecastExportJobSummary (Prelude.Maybe Prelude.Text)
forecastExportJobSummary_message :: Lens' ForecastExportJobSummary (Maybe Text)
forecastExportJobSummary_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ForecastExportJobSummary' {Maybe Text
message :: Maybe Text
$sel:message:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
message} -> Maybe Text
message) (\s :: ForecastExportJobSummary
s@ForecastExportJobSummary' {} Maybe Text
a -> ForecastExportJobSummary
s {$sel:message:ForecastExportJobSummary' :: Maybe Text
message = Maybe Text
a} :: ForecastExportJobSummary)

-- | The status of the forecast export job. 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 export job must be @ACTIVE@ before you can
-- access the forecast in your S3 bucket.
forecastExportJobSummary_status :: Lens.Lens' ForecastExportJobSummary (Prelude.Maybe Prelude.Text)
forecastExportJobSummary_status :: Lens' ForecastExportJobSummary (Maybe Text)
forecastExportJobSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ForecastExportJobSummary' {Maybe Text
status :: Maybe Text
$sel:status:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
status} -> Maybe Text
status) (\s :: ForecastExportJobSummary
s@ForecastExportJobSummary' {} Maybe Text
a -> ForecastExportJobSummary
s {$sel:status:ForecastExportJobSummary' :: Maybe Text
status = Maybe Text
a} :: ForecastExportJobSummary)

instance Data.FromJSON ForecastExportJobSummary where
  parseJSON :: Value -> Parser ForecastExportJobSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ForecastExportJobSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe DataDestination
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ForecastExportJobSummary
ForecastExportJobSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"Destination")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ForecastExportJobArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ForecastExportJobName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"Status")
      )

instance Prelude.Hashable ForecastExportJobSummary where
  hashWithSalt :: Int -> ForecastExportJobSummary -> Int
hashWithSalt Int
_salt ForecastExportJobSummary' {Maybe Text
Maybe POSIX
Maybe DataDestination
status :: Maybe Text
message :: Maybe Text
lastModificationTime :: Maybe POSIX
forecastExportJobName :: Maybe Text
forecastExportJobArn :: Maybe Text
destination :: Maybe DataDestination
creationTime :: Maybe POSIX
$sel:status:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
$sel:message:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
$sel:lastModificationTime:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe POSIX
$sel:forecastExportJobName:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
$sel:forecastExportJobArn:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
$sel:destination:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe DataDestination
$sel:creationTime:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataDestination
destination
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
forecastExportJobArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
forecastExportJobName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModificationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status

instance Prelude.NFData ForecastExportJobSummary where
  rnf :: ForecastExportJobSummary -> ()
rnf ForecastExportJobSummary' {Maybe Text
Maybe POSIX
Maybe DataDestination
status :: Maybe Text
message :: Maybe Text
lastModificationTime :: Maybe POSIX
forecastExportJobName :: Maybe Text
forecastExportJobArn :: Maybe Text
destination :: Maybe DataDestination
creationTime :: Maybe POSIX
$sel:status:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
$sel:message:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
$sel:lastModificationTime:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe POSIX
$sel:forecastExportJobName:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
$sel:forecastExportJobArn:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe Text
$sel:destination:ForecastExportJobSummary' :: ForecastExportJobSummary -> Maybe DataDestination
$sel:creationTime:ForecastExportJobSummary' :: ForecastExportJobSummary -> 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 DataDestination
destination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
forecastExportJobArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
forecastExportJobName
      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