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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 last known status for the analysis.
    AnalysisSummary -> Maybe ResourceStatus
status :: Prelude.Maybe ResourceStatus,
    -- | The ID of the analysis. This ID displays in the URL.
    AnalysisSummary -> Maybe Text
analysisId :: Prelude.Maybe Prelude.Text,
    -- | The time that the analysis was last updated.
    AnalysisSummary -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | 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 Core.POSIX,
    -- | The name of the analysis. This name is displayed in the Amazon
    -- QuickSight console.
    AnalysisSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (AnalysisSummary -> AnalysisSummary -> Bool
(AnalysisSummary -> AnalysisSummary -> Bool)
-> (AnalysisSummary -> AnalysisSummary -> Bool)
-> Eq AnalysisSummary
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]
(Int -> ReadS AnalysisSummary)
-> ReadS [AnalysisSummary]
-> ReadPrec AnalysisSummary
-> ReadPrec [AnalysisSummary]
-> Read 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
(Int -> AnalysisSummary -> ShowS)
-> (AnalysisSummary -> String)
-> ([AnalysisSummary] -> ShowS)
-> Show AnalysisSummary
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. AnalysisSummary -> Rep AnalysisSummary x)
-> (forall x. Rep AnalysisSummary x -> AnalysisSummary)
-> Generic AnalysisSummary
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:
--
-- 'status', 'analysisSummary_status' - The last known status for the analysis.
--
-- 'analysisId', 'analysisSummary_analysisId' - The ID of the analysis. This ID displays in the URL.
--
-- 'lastUpdatedTime', 'analysisSummary_lastUpdatedTime' - The time that the analysis was last updated.
--
-- 'arn', 'analysisSummary_arn' - The Amazon Resource Name (ARN) for the analysis.
--
-- 'createdTime', 'analysisSummary_createdTime' - The time that the analysis was created.
--
-- 'name', 'analysisSummary_name' - The name of the analysis. This name is displayed in the Amazon
-- QuickSight console.
newAnalysisSummary ::
  AnalysisSummary
newAnalysisSummary :: AnalysisSummary
newAnalysisSummary =
  AnalysisSummary' :: Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> AnalysisSummary
AnalysisSummary'
    { $sel:status:AnalysisSummary' :: Maybe ResourceStatus
status = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:analysisId:AnalysisSummary' :: Maybe Text
analysisId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:AnalysisSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:AnalysisSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:AnalysisSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AnalysisSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The last known status for the analysis.
analysisSummary_status :: Lens.Lens' AnalysisSummary (Prelude.Maybe ResourceStatus)
analysisSummary_status :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> AnalysisSummary -> f AnalysisSummary
analysisSummary_status = (AnalysisSummary -> Maybe ResourceStatus)
-> (AnalysisSummary -> Maybe ResourceStatus -> AnalysisSummary)
-> Lens
     AnalysisSummary
     AnalysisSummary
     (Maybe ResourceStatus)
     (Maybe ResourceStatus)
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)

-- | The ID of the analysis. This ID displays in the URL.
analysisSummary_analysisId :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.Text)
analysisSummary_analysisId :: (Maybe Text -> f (Maybe Text))
-> AnalysisSummary -> f AnalysisSummary
analysisSummary_analysisId = (AnalysisSummary -> Maybe Text)
-> (AnalysisSummary -> Maybe Text -> AnalysisSummary)
-> Lens AnalysisSummary AnalysisSummary (Maybe Text) (Maybe Text)
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 time that the analysis was last updated.
analysisSummary_lastUpdatedTime :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.UTCTime)
analysisSummary_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AnalysisSummary -> f AnalysisSummary
analysisSummary_lastUpdatedTime = (AnalysisSummary -> Maybe POSIX)
-> (AnalysisSummary -> Maybe POSIX -> AnalysisSummary)
-> Lens AnalysisSummary AnalysisSummary (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> AnalysisSummary -> f AnalysisSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AnalysisSummary
-> f AnalysisSummary
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 Amazon Resource Name (ARN) for the analysis.
analysisSummary_arn :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.Text)
analysisSummary_arn :: (Maybe Text -> f (Maybe Text))
-> AnalysisSummary -> f AnalysisSummary
analysisSummary_arn = (AnalysisSummary -> Maybe Text)
-> (AnalysisSummary -> Maybe Text -> AnalysisSummary)
-> Lens AnalysisSummary AnalysisSummary (Maybe Text) (Maybe Text)
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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AnalysisSummary -> f AnalysisSummary
analysisSummary_createdTime = (AnalysisSummary -> Maybe POSIX)
-> (AnalysisSummary -> Maybe POSIX -> AnalysisSummary)
-> Lens AnalysisSummary AnalysisSummary (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> AnalysisSummary -> f AnalysisSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AnalysisSummary
-> f AnalysisSummary
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 name of the analysis. This name is displayed in the Amazon
-- QuickSight console.
analysisSummary_name :: Lens.Lens' AnalysisSummary (Prelude.Maybe Prelude.Text)
analysisSummary_name :: (Maybe Text -> f (Maybe Text))
-> AnalysisSummary -> f AnalysisSummary
analysisSummary_name = (AnalysisSummary -> Maybe Text)
-> (AnalysisSummary -> Maybe Text -> AnalysisSummary)
-> Lens AnalysisSummary AnalysisSummary (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON AnalysisSummary where
  parseJSON :: Value -> Parser AnalysisSummary
parseJSON =
    String
-> (Object -> Parser AnalysisSummary)
-> Value
-> Parser AnalysisSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AnalysisSummary"
      ( \Object
x ->
          Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> AnalysisSummary
AnalysisSummary'
            (Maybe ResourceStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> AnalysisSummary)
-> Parser (Maybe ResourceStatus)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> AnalysisSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> AnalysisSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> AnalysisSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AnalysisId")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> AnalysisSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> AnalysisSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdatedTime")
            Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> AnalysisSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> AnalysisSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser (Maybe POSIX -> Maybe Text -> AnalysisSummary)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> AnalysisSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
            Parser (Maybe Text -> AnalysisSummary)
-> Parser (Maybe Text) -> Parser AnalysisSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
      )

instance Prelude.Hashable AnalysisSummary

instance Prelude.NFData AnalysisSummary