{-# 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.QuickSight.Types.AnalysisSummary
-- 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.QuickSight.Types.AnalysisSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.ResourceStatus

-- | The summary metadata that describes an analysis.
--
-- /See:/ 'newAnalysisSummary' smart constructor.
data AnalysisSummary = AnalysisSummary'
  { -- | The ID of the analysis. This ID displays in the URL.
    AnalysisSummary -> Maybe Text
analysisId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the analysis.
    AnalysisSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time that the analysis was created.
    AnalysisSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
    -- | The time that the analysis was last updated.
    AnalysisSummary -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the analysis. This name is displayed in the Amazon
    -- QuickSight console.
    AnalysisSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The last known status for the analysis.
    AnalysisSummary -> Maybe ResourceStatus
status :: Prelude.Maybe ResourceStatus
  }
  deriving (AnalysisSummary -> AnalysisSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalysisSummary -> AnalysisSummary -> Bool
$c/= :: AnalysisSummary -> AnalysisSummary -> Bool
== :: AnalysisSummary -> AnalysisSummary -> Bool
$c== :: AnalysisSummary -> AnalysisSummary -> Bool
Prelude.Eq, ReadPrec [AnalysisSummary]
ReadPrec AnalysisSummary
Int -> ReadS AnalysisSummary
ReadS [AnalysisSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnalysisSummary]
$creadListPrec :: ReadPrec [AnalysisSummary]
readPrec :: ReadPrec AnalysisSummary
$creadPrec :: ReadPrec AnalysisSummary
readList :: ReadS [AnalysisSummary]
$creadList :: ReadS [AnalysisSummary]
readsPrec :: Int -> ReadS AnalysisSummary
$creadsPrec :: Int -> ReadS AnalysisSummary
Prelude.Read, Int -> AnalysisSummary -> ShowS
[AnalysisSummary] -> ShowS
AnalysisSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalysisSummary] -> ShowS
$cshowList :: [AnalysisSummary] -> ShowS
show :: AnalysisSummary -> String
$cshow :: AnalysisSummary -> String
showsPrec :: Int -> AnalysisSummary -> ShowS
$cshowsPrec :: Int -> AnalysisSummary -> ShowS
Prelude.Show, forall x. Rep AnalysisSummary x -> AnalysisSummary
forall x. AnalysisSummary -> Rep AnalysisSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnalysisSummary x -> AnalysisSummary
$cfrom :: forall x. AnalysisSummary -> Rep AnalysisSummary x
Prelude.Generic)

-- |
-- Create a value of 'AnalysisSummary' 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:
--
-- 'analysisId', 'analysisSummary_analysisId' - The ID of the analysis. This ID displays in the URL.
--
-- 'arn', 'analysisSummary_arn' - The Amazon Resource Name (ARN) for the analysis.
--
-- 'createdTime', 'analysisSummary_createdTime' - The time that the analysis was created.
--
-- 'lastUpdatedTime', 'analysisSummary_lastUpdatedTime' - The time that the analysis was last updated.
--
-- 'name', 'analysisSummary_name' - The name of the analysis. This name is displayed in the Amazon
-- QuickSight console.
--
-- 'status', 'analysisSummary_status' - The last known status for the analysis.
newAnalysisSummary ::
  AnalysisSummary
newAnalysisSummary :: AnalysisSummary
newAnalysisSummary =
  AnalysisSummary'
    { $sel:analysisId:AnalysisSummary' :: Maybe Text
analysisId = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:AnalysisSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:AnalysisSummary' :: Maybe POSIX
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:AnalysisSummary' :: Maybe POSIX
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:AnalysisSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:AnalysisSummary' :: Maybe ResourceStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the analysis. This ID displays in the URL.
analysisSummary_analysisId :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.Text)
analysisSummary_analysisId :: Lens' AnalysisSummary (Maybe Text)
analysisSummary_analysisId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisSummary' {Maybe Text
analysisId :: Maybe Text
$sel:analysisId:AnalysisSummary' :: AnalysisSummary -> Maybe Text
analysisId} -> Maybe Text
analysisId) (\s :: AnalysisSummary
s@AnalysisSummary' {} Maybe Text
a -> AnalysisSummary
s {$sel:analysisId:AnalysisSummary' :: Maybe Text
analysisId = Maybe Text
a} :: AnalysisSummary)

-- | The Amazon Resource Name (ARN) for the analysis.
analysisSummary_arn :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.Text)
analysisSummary_arn :: Lens' AnalysisSummary (Maybe Text)
analysisSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:AnalysisSummary' :: AnalysisSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: AnalysisSummary
s@AnalysisSummary' {} Maybe Text
a -> AnalysisSummary
s {$sel:arn:AnalysisSummary' :: Maybe Text
arn = Maybe Text
a} :: AnalysisSummary)

-- | The time that the analysis was created.
analysisSummary_createdTime :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.UTCTime)
analysisSummary_createdTime :: Lens' AnalysisSummary (Maybe UTCTime)
analysisSummary_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:AnalysisSummary' :: AnalysisSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: AnalysisSummary
s@AnalysisSummary' {} Maybe POSIX
a -> AnalysisSummary
s {$sel:createdTime:AnalysisSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: AnalysisSummary) 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 time that the analysis was last updated.
analysisSummary_lastUpdatedTime :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.UTCTime)
analysisSummary_lastUpdatedTime :: Lens' AnalysisSummary (Maybe UTCTime)
analysisSummary_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisSummary' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:AnalysisSummary' :: AnalysisSummary -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: AnalysisSummary
s@AnalysisSummary' {} Maybe POSIX
a -> AnalysisSummary
s {$sel:lastUpdatedTime:AnalysisSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: AnalysisSummary) 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 name of the analysis. This name is displayed in the Amazon
-- QuickSight console.
analysisSummary_name :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.Text)
analysisSummary_name :: Lens' AnalysisSummary (Maybe Text)
analysisSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisSummary' {Maybe Text
name :: Maybe Text
$sel:name:AnalysisSummary' :: AnalysisSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: AnalysisSummary
s@AnalysisSummary' {} Maybe Text
a -> AnalysisSummary
s {$sel:name:AnalysisSummary' :: Maybe Text
name = Maybe Text
a} :: AnalysisSummary)

-- | The last known status for the analysis.
analysisSummary_status :: Lens.Lens' AnalysisSummary (Prelude.Maybe ResourceStatus)
analysisSummary_status :: Lens' AnalysisSummary (Maybe ResourceStatus)
analysisSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisSummary' {Maybe ResourceStatus
status :: Maybe ResourceStatus
$sel:status:AnalysisSummary' :: AnalysisSummary -> Maybe ResourceStatus
status} -> Maybe ResourceStatus
status) (\s :: AnalysisSummary
s@AnalysisSummary' {} Maybe ResourceStatus
a -> AnalysisSummary
s {$sel:status:AnalysisSummary' :: Maybe ResourceStatus
status = Maybe ResourceStatus
a} :: AnalysisSummary)

instance Data.FromJSON AnalysisSummary where
  parseJSON :: Value -> Parser AnalysisSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AnalysisSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ResourceStatus
-> AnalysisSummary
AnalysisSummary'
            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
"AnalysisId")
            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
"Arn")
            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
"CreatedTime")
            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
"LastUpdatedTime")
            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
"Name")
            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 AnalysisSummary where
  hashWithSalt :: Int -> AnalysisSummary -> Int
hashWithSalt Int
_salt AnalysisSummary' {Maybe Text
Maybe POSIX
Maybe ResourceStatus
status :: Maybe ResourceStatus
name :: Maybe Text
lastUpdatedTime :: Maybe POSIX
createdTime :: Maybe POSIX
arn :: Maybe Text
analysisId :: Maybe Text
$sel:status:AnalysisSummary' :: AnalysisSummary -> Maybe ResourceStatus
$sel:name:AnalysisSummary' :: AnalysisSummary -> Maybe Text
$sel:lastUpdatedTime:AnalysisSummary' :: AnalysisSummary -> Maybe POSIX
$sel:createdTime:AnalysisSummary' :: AnalysisSummary -> Maybe POSIX
$sel:arn:AnalysisSummary' :: AnalysisSummary -> Maybe Text
$sel:analysisId:AnalysisSummary' :: AnalysisSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
analysisId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceStatus
status

instance Prelude.NFData AnalysisSummary where
  rnf :: AnalysisSummary -> ()
rnf AnalysisSummary' {Maybe Text
Maybe POSIX
Maybe ResourceStatus
status :: Maybe ResourceStatus
name :: Maybe Text
lastUpdatedTime :: Maybe POSIX
createdTime :: Maybe POSIX
arn :: Maybe Text
analysisId :: Maybe Text
$sel:status:AnalysisSummary' :: AnalysisSummary -> Maybe ResourceStatus
$sel:name:AnalysisSummary' :: AnalysisSummary -> Maybe Text
$sel:lastUpdatedTime:AnalysisSummary' :: AnalysisSummary -> Maybe POSIX
$sel:createdTime:AnalysisSummary' :: AnalysisSummary -> Maybe POSIX
$sel:arn:AnalysisSummary' :: AnalysisSummary -> Maybe Text
$sel:analysisId:AnalysisSummary' :: AnalysisSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
analysisId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceStatus
status