{-# 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.DataSourceSummary
-- 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.DataSourceSummary 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.DataSourceType

-- | A @DataSourceSummary@ object that returns a summary of a data source.
--
-- /See:/ 'newDataSourceSummary' smart constructor.
data DataSourceSummary = DataSourceSummary'
  { -- | The arn of the datasource.
    DataSourceSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the data source was created. This value is
    -- expressed in MM-DD-YYYY HH:MM:SS format.
    DataSourceSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
    -- | The unique ID of the data source.
    DataSourceSummary -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
    -- | The date and time the data source was last updated. This value is
    -- expressed in MM-DD-YYYY HH:MM:SS format.
    DataSourceSummary -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the data source.
    DataSourceSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of the data source.
    DataSourceSummary -> Maybe DataSourceType
type' :: Prelude.Maybe DataSourceType
  }
  deriving (DataSourceSummary -> DataSourceSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataSourceSummary -> DataSourceSummary -> Bool
$c/= :: DataSourceSummary -> DataSourceSummary -> Bool
== :: DataSourceSummary -> DataSourceSummary -> Bool
$c== :: DataSourceSummary -> DataSourceSummary -> Bool
Prelude.Eq, ReadPrec [DataSourceSummary]
ReadPrec DataSourceSummary
Int -> ReadS DataSourceSummary
ReadS [DataSourceSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataSourceSummary]
$creadListPrec :: ReadPrec [DataSourceSummary]
readPrec :: ReadPrec DataSourceSummary
$creadPrec :: ReadPrec DataSourceSummary
readList :: ReadS [DataSourceSummary]
$creadList :: ReadS [DataSourceSummary]
readsPrec :: Int -> ReadS DataSourceSummary
$creadsPrec :: Int -> ReadS DataSourceSummary
Prelude.Read, Int -> DataSourceSummary -> ShowS
[DataSourceSummary] -> ShowS
DataSourceSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataSourceSummary] -> ShowS
$cshowList :: [DataSourceSummary] -> ShowS
show :: DataSourceSummary -> String
$cshow :: DataSourceSummary -> String
showsPrec :: Int -> DataSourceSummary -> ShowS
$cshowsPrec :: Int -> DataSourceSummary -> ShowS
Prelude.Show, forall x. Rep DataSourceSummary x -> DataSourceSummary
forall x. DataSourceSummary -> Rep DataSourceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataSourceSummary x -> DataSourceSummary
$cfrom :: forall x. DataSourceSummary -> Rep DataSourceSummary x
Prelude.Generic)

-- |
-- Create a value of 'DataSourceSummary' 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:
--
-- 'arn', 'dataSourceSummary_arn' - The arn of the datasource.
--
-- 'createdTime', 'dataSourceSummary_createdTime' - The date and time that the data source was created. This value is
-- expressed in MM-DD-YYYY HH:MM:SS format.
--
-- 'dataSourceId', 'dataSourceSummary_dataSourceId' - The unique ID of the data source.
--
-- 'lastUpdatedTime', 'dataSourceSummary_lastUpdatedTime' - The date and time the data source was last updated. This value is
-- expressed in MM-DD-YYYY HH:MM:SS format.
--
-- 'name', 'dataSourceSummary_name' - The name of the data source.
--
-- 'type'', 'dataSourceSummary_type' - The type of the data source.
newDataSourceSummary ::
  DataSourceSummary
newDataSourceSummary :: DataSourceSummary
newDataSourceSummary =
  DataSourceSummary'
    { $sel:arn:DataSourceSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:DataSourceSummary' :: Maybe POSIX
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:dataSourceId:DataSourceSummary' :: Maybe Text
dataSourceId = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:DataSourceSummary' :: Maybe POSIX
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DataSourceSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:type':DataSourceSummary' :: Maybe DataSourceType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The arn of the datasource.
dataSourceSummary_arn :: Lens.Lens' DataSourceSummary (Prelude.Maybe Prelude.Text)
dataSourceSummary_arn :: Lens' DataSourceSummary (Maybe Text)
dataSourceSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:DataSourceSummary' :: DataSourceSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DataSourceSummary
s@DataSourceSummary' {} Maybe Text
a -> DataSourceSummary
s {$sel:arn:DataSourceSummary' :: Maybe Text
arn = Maybe Text
a} :: DataSourceSummary)

-- | The date and time that the data source was created. This value is
-- expressed in MM-DD-YYYY HH:MM:SS format.
dataSourceSummary_createdTime :: Lens.Lens' DataSourceSummary (Prelude.Maybe Prelude.UTCTime)
dataSourceSummary_createdTime :: Lens' DataSourceSummary (Maybe UTCTime)
dataSourceSummary_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:DataSourceSummary' :: DataSourceSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: DataSourceSummary
s@DataSourceSummary' {} Maybe POSIX
a -> DataSourceSummary
s {$sel:createdTime:DataSourceSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: DataSourceSummary) 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 unique ID of the data source.
dataSourceSummary_dataSourceId :: Lens.Lens' DataSourceSummary (Prelude.Maybe Prelude.Text)
dataSourceSummary_dataSourceId :: Lens' DataSourceSummary (Maybe Text)
dataSourceSummary_dataSourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceSummary' {Maybe Text
dataSourceId :: Maybe Text
$sel:dataSourceId:DataSourceSummary' :: DataSourceSummary -> Maybe Text
dataSourceId} -> Maybe Text
dataSourceId) (\s :: DataSourceSummary
s@DataSourceSummary' {} Maybe Text
a -> DataSourceSummary
s {$sel:dataSourceId:DataSourceSummary' :: Maybe Text
dataSourceId = Maybe Text
a} :: DataSourceSummary)

-- | The date and time the data source was last updated. This value is
-- expressed in MM-DD-YYYY HH:MM:SS format.
dataSourceSummary_lastUpdatedTime :: Lens.Lens' DataSourceSummary (Prelude.Maybe Prelude.UTCTime)
dataSourceSummary_lastUpdatedTime :: Lens' DataSourceSummary (Maybe UTCTime)
dataSourceSummary_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceSummary' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:DataSourceSummary' :: DataSourceSummary -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: DataSourceSummary
s@DataSourceSummary' {} Maybe POSIX
a -> DataSourceSummary
s {$sel:lastUpdatedTime:DataSourceSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: DataSourceSummary) 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 data source.
dataSourceSummary_name :: Lens.Lens' DataSourceSummary (Prelude.Maybe Prelude.Text)
dataSourceSummary_name :: Lens' DataSourceSummary (Maybe Text)
dataSourceSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceSummary' {Maybe Text
name :: Maybe Text
$sel:name:DataSourceSummary' :: DataSourceSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: DataSourceSummary
s@DataSourceSummary' {} Maybe Text
a -> DataSourceSummary
s {$sel:name:DataSourceSummary' :: Maybe Text
name = Maybe Text
a} :: DataSourceSummary)

-- | The type of the data source.
dataSourceSummary_type :: Lens.Lens' DataSourceSummary (Prelude.Maybe DataSourceType)
dataSourceSummary_type :: Lens' DataSourceSummary (Maybe DataSourceType)
dataSourceSummary_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceSummary' {Maybe DataSourceType
type' :: Maybe DataSourceType
$sel:type':DataSourceSummary' :: DataSourceSummary -> Maybe DataSourceType
type'} -> Maybe DataSourceType
type') (\s :: DataSourceSummary
s@DataSourceSummary' {} Maybe DataSourceType
a -> DataSourceSummary
s {$sel:type':DataSourceSummary' :: Maybe DataSourceType
type' = Maybe DataSourceType
a} :: DataSourceSummary)

instance Data.FromJSON DataSourceSummary where
  parseJSON :: Value -> Parser DataSourceSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DataSourceSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe DataSourceType
-> DataSourceSummary
DataSourceSummary'
            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
"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
"DataSourceId")
            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
"Type")
      )

instance Prelude.Hashable DataSourceSummary where
  hashWithSalt :: Int -> DataSourceSummary -> Int
hashWithSalt Int
_salt DataSourceSummary' {Maybe Text
Maybe POSIX
Maybe DataSourceType
type' :: Maybe DataSourceType
name :: Maybe Text
lastUpdatedTime :: Maybe POSIX
dataSourceId :: Maybe Text
createdTime :: Maybe POSIX
arn :: Maybe Text
$sel:type':DataSourceSummary' :: DataSourceSummary -> Maybe DataSourceType
$sel:name:DataSourceSummary' :: DataSourceSummary -> Maybe Text
$sel:lastUpdatedTime:DataSourceSummary' :: DataSourceSummary -> Maybe POSIX
$sel:dataSourceId:DataSourceSummary' :: DataSourceSummary -> Maybe Text
$sel:createdTime:DataSourceSummary' :: DataSourceSummary -> Maybe POSIX
$sel:arn:DataSourceSummary' :: DataSourceSummary -> Maybe Text
..} =
    Int
_salt
      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 Text
dataSourceId
      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 DataSourceType
type'

instance Prelude.NFData DataSourceSummary where
  rnf :: DataSourceSummary -> ()
rnf DataSourceSummary' {Maybe Text
Maybe POSIX
Maybe DataSourceType
type' :: Maybe DataSourceType
name :: Maybe Text
lastUpdatedTime :: Maybe POSIX
dataSourceId :: Maybe Text
createdTime :: Maybe POSIX
arn :: Maybe Text
$sel:type':DataSourceSummary' :: DataSourceSummary -> Maybe DataSourceType
$sel:name:DataSourceSummary' :: DataSourceSummary -> Maybe Text
$sel:lastUpdatedTime:DataSourceSummary' :: DataSourceSummary -> Maybe POSIX
$sel:dataSourceId:DataSourceSummary' :: DataSourceSummary -> Maybe Text
$sel:createdTime:DataSourceSummary' :: DataSourceSummary -> Maybe POSIX
$sel:arn:DataSourceSummary' :: DataSourceSummary -> Maybe Text
..} =
    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 Text
dataSourceId
      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 DataSourceType
type'