{-# 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.MigrationHubStrategy.Types.RecommendationReportDetails
-- 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.MigrationHubStrategy.Types.RecommendationReportDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types.RecommendationReportStatus
import qualified Amazonka.Prelude as Prelude

-- | Contains detailed information about a recommendation report.
--
-- /See:/ 'newRecommendationReportDetails' smart constructor.
data RecommendationReportDetails = RecommendationReportDetails'
  { -- | The time that the recommendation report generation task completes.
    RecommendationReportDetails -> Maybe POSIX
completionTime :: Prelude.Maybe Data.POSIX,
    -- | The S3 bucket where the report file is located.
    RecommendationReportDetails -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 key name of the report file.
    RecommendationReportDetails -> Maybe [Text]
s3Keys :: Prelude.Maybe [Prelude.Text],
    -- | The time that the recommendation report generation task starts.
    RecommendationReportDetails -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
    -- | The status of the recommendation report generation task.
    RecommendationReportDetails -> Maybe RecommendationReportStatus
status :: Prelude.Maybe RecommendationReportStatus,
    -- | The status message for recommendation report generation.
    RecommendationReportDetails -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (RecommendationReportDetails -> RecommendationReportDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationReportDetails -> RecommendationReportDetails -> Bool
$c/= :: RecommendationReportDetails -> RecommendationReportDetails -> Bool
== :: RecommendationReportDetails -> RecommendationReportDetails -> Bool
$c== :: RecommendationReportDetails -> RecommendationReportDetails -> Bool
Prelude.Eq, ReadPrec [RecommendationReportDetails]
ReadPrec RecommendationReportDetails
Int -> ReadS RecommendationReportDetails
ReadS [RecommendationReportDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationReportDetails]
$creadListPrec :: ReadPrec [RecommendationReportDetails]
readPrec :: ReadPrec RecommendationReportDetails
$creadPrec :: ReadPrec RecommendationReportDetails
readList :: ReadS [RecommendationReportDetails]
$creadList :: ReadS [RecommendationReportDetails]
readsPrec :: Int -> ReadS RecommendationReportDetails
$creadsPrec :: Int -> ReadS RecommendationReportDetails
Prelude.Read, Int -> RecommendationReportDetails -> ShowS
[RecommendationReportDetails] -> ShowS
RecommendationReportDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationReportDetails] -> ShowS
$cshowList :: [RecommendationReportDetails] -> ShowS
show :: RecommendationReportDetails -> String
$cshow :: RecommendationReportDetails -> String
showsPrec :: Int -> RecommendationReportDetails -> ShowS
$cshowsPrec :: Int -> RecommendationReportDetails -> ShowS
Prelude.Show, forall x.
Rep RecommendationReportDetails x -> RecommendationReportDetails
forall x.
RecommendationReportDetails -> Rep RecommendationReportDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecommendationReportDetails x -> RecommendationReportDetails
$cfrom :: forall x.
RecommendationReportDetails -> Rep RecommendationReportDetails x
Prelude.Generic)

-- |
-- Create a value of 'RecommendationReportDetails' 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:
--
-- 'completionTime', 'recommendationReportDetails_completionTime' - The time that the recommendation report generation task completes.
--
-- 's3Bucket', 'recommendationReportDetails_s3Bucket' - The S3 bucket where the report file is located.
--
-- 's3Keys', 'recommendationReportDetails_s3Keys' - The Amazon S3 key name of the report file.
--
-- 'startTime', 'recommendationReportDetails_startTime' - The time that the recommendation report generation task starts.
--
-- 'status', 'recommendationReportDetails_status' - The status of the recommendation report generation task.
--
-- 'statusMessage', 'recommendationReportDetails_statusMessage' - The status message for recommendation report generation.
newRecommendationReportDetails ::
  RecommendationReportDetails
newRecommendationReportDetails :: RecommendationReportDetails
newRecommendationReportDetails =
  RecommendationReportDetails'
    { $sel:completionTime:RecommendationReportDetails' :: Maybe POSIX
completionTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:s3Bucket:RecommendationReportDetails' :: Maybe Text
s3Bucket = forall a. Maybe a
Prelude.Nothing,
      $sel:s3Keys:RecommendationReportDetails' :: Maybe [Text]
s3Keys = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:RecommendationReportDetails' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:RecommendationReportDetails' :: Maybe RecommendationReportStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:RecommendationReportDetails' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing
    }

-- | The time that the recommendation report generation task completes.
recommendationReportDetails_completionTime :: Lens.Lens' RecommendationReportDetails (Prelude.Maybe Prelude.UTCTime)
recommendationReportDetails_completionTime :: Lens' RecommendationReportDetails (Maybe UTCTime)
recommendationReportDetails_completionTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationReportDetails' {Maybe POSIX
completionTime :: Maybe POSIX
$sel:completionTime:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe POSIX
completionTime} -> Maybe POSIX
completionTime) (\s :: RecommendationReportDetails
s@RecommendationReportDetails' {} Maybe POSIX
a -> RecommendationReportDetails
s {$sel:completionTime:RecommendationReportDetails' :: Maybe POSIX
completionTime = Maybe POSIX
a} :: RecommendationReportDetails) 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 S3 bucket where the report file is located.
recommendationReportDetails_s3Bucket :: Lens.Lens' RecommendationReportDetails (Prelude.Maybe Prelude.Text)
recommendationReportDetails_s3Bucket :: Lens' RecommendationReportDetails (Maybe Text)
recommendationReportDetails_s3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationReportDetails' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: RecommendationReportDetails
s@RecommendationReportDetails' {} Maybe Text
a -> RecommendationReportDetails
s {$sel:s3Bucket:RecommendationReportDetails' :: Maybe Text
s3Bucket = Maybe Text
a} :: RecommendationReportDetails)

-- | The Amazon S3 key name of the report file.
recommendationReportDetails_s3Keys :: Lens.Lens' RecommendationReportDetails (Prelude.Maybe [Prelude.Text])
recommendationReportDetails_s3Keys :: Lens' RecommendationReportDetails (Maybe [Text])
recommendationReportDetails_s3Keys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationReportDetails' {Maybe [Text]
s3Keys :: Maybe [Text]
$sel:s3Keys:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe [Text]
s3Keys} -> Maybe [Text]
s3Keys) (\s :: RecommendationReportDetails
s@RecommendationReportDetails' {} Maybe [Text]
a -> RecommendationReportDetails
s {$sel:s3Keys:RecommendationReportDetails' :: Maybe [Text]
s3Keys = Maybe [Text]
a} :: RecommendationReportDetails) 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 time that the recommendation report generation task starts.
recommendationReportDetails_startTime :: Lens.Lens' RecommendationReportDetails (Prelude.Maybe Prelude.UTCTime)
recommendationReportDetails_startTime :: Lens' RecommendationReportDetails (Maybe UTCTime)
recommendationReportDetails_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationReportDetails' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: RecommendationReportDetails
s@RecommendationReportDetails' {} Maybe POSIX
a -> RecommendationReportDetails
s {$sel:startTime:RecommendationReportDetails' :: Maybe POSIX
startTime = Maybe POSIX
a} :: RecommendationReportDetails) 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 status of the recommendation report generation task.
recommendationReportDetails_status :: Lens.Lens' RecommendationReportDetails (Prelude.Maybe RecommendationReportStatus)
recommendationReportDetails_status :: Lens'
  RecommendationReportDetails (Maybe RecommendationReportStatus)
recommendationReportDetails_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationReportDetails' {Maybe RecommendationReportStatus
status :: Maybe RecommendationReportStatus
$sel:status:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe RecommendationReportStatus
status} -> Maybe RecommendationReportStatus
status) (\s :: RecommendationReportDetails
s@RecommendationReportDetails' {} Maybe RecommendationReportStatus
a -> RecommendationReportDetails
s {$sel:status:RecommendationReportDetails' :: Maybe RecommendationReportStatus
status = Maybe RecommendationReportStatus
a} :: RecommendationReportDetails)

-- | The status message for recommendation report generation.
recommendationReportDetails_statusMessage :: Lens.Lens' RecommendationReportDetails (Prelude.Maybe Prelude.Text)
recommendationReportDetails_statusMessage :: Lens' RecommendationReportDetails (Maybe Text)
recommendationReportDetails_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationReportDetails' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: RecommendationReportDetails
s@RecommendationReportDetails' {} Maybe Text
a -> RecommendationReportDetails
s {$sel:statusMessage:RecommendationReportDetails' :: Maybe Text
statusMessage = Maybe Text
a} :: RecommendationReportDetails)

instance Data.FromJSON RecommendationReportDetails where
  parseJSON :: Value -> Parser RecommendationReportDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RecommendationReportDetails"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe RecommendationReportStatus
-> Maybe Text
-> RecommendationReportDetails
RecommendationReportDetails'
            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
"completionTime")
            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
"s3Bucket")
            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
"s3Keys" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"startTime")
            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")
            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
"statusMessage")
      )

instance Prelude.Hashable RecommendationReportDetails where
  hashWithSalt :: Int -> RecommendationReportDetails -> Int
hashWithSalt Int
_salt RecommendationReportDetails' {Maybe [Text]
Maybe Text
Maybe POSIX
Maybe RecommendationReportStatus
statusMessage :: Maybe Text
status :: Maybe RecommendationReportStatus
startTime :: Maybe POSIX
s3Keys :: Maybe [Text]
s3Bucket :: Maybe Text
completionTime :: Maybe POSIX
$sel:statusMessage:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe Text
$sel:status:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe RecommendationReportStatus
$sel:startTime:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe POSIX
$sel:s3Keys:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe [Text]
$sel:s3Bucket:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe Text
$sel:completionTime:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
completionTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
s3Keys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RecommendationReportStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage

instance Prelude.NFData RecommendationReportDetails where
  rnf :: RecommendationReportDetails -> ()
rnf RecommendationReportDetails' {Maybe [Text]
Maybe Text
Maybe POSIX
Maybe RecommendationReportStatus
statusMessage :: Maybe Text
status :: Maybe RecommendationReportStatus
startTime :: Maybe POSIX
s3Keys :: Maybe [Text]
s3Bucket :: Maybe Text
completionTime :: Maybe POSIX
$sel:statusMessage:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe Text
$sel:status:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe RecommendationReportStatus
$sel:startTime:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe POSIX
$sel:s3Keys:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe [Text]
$sel:s3Bucket:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe Text
$sel:completionTime:RecommendationReportDetails' :: RecommendationReportDetails -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
completionTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
s3Keys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RecommendationReportStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage