{-# 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.DataSource
-- 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.DataSource where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.DataSourceErrorInfo
import Amazonka.QuickSight.Types.DataSourceParameters
import Amazonka.QuickSight.Types.DataSourceType
import Amazonka.QuickSight.Types.ResourceStatus
import Amazonka.QuickSight.Types.SslProperties
import Amazonka.QuickSight.Types.VpcConnectionProperties

-- | The structure of a data source.
--
-- /See:/ 'newDataSource' smart constructor.
data DataSource = DataSource'
  { -- | The HTTP status of the request.
    DataSource -> Maybe ResourceStatus
status :: Prelude.Maybe ResourceStatus,
    -- | The parameters that Amazon QuickSight uses to connect to your underlying
    -- source. This is a variant type structure. For this structure to be
    -- valid, only one of the attributes can be non-null.
    DataSource -> Maybe DataSourceParameters
dataSourceParameters :: Prelude.Maybe DataSourceParameters,
    -- | The last time that this data source was updated.
    DataSource -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the data source.
    DataSource -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time that this data source was created.
    DataSource -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | Secure Socket Layer (SSL) properties that apply when Amazon QuickSight
    -- connects to your underlying source.
    DataSource -> Maybe SslProperties
sslProperties :: Prelude.Maybe SslProperties,
    -- | The ID of the data source. This ID is unique per Amazon Web Services
    -- Region for each Amazon Web Services account.
    DataSource -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
    -- | A display name for the data source.
    DataSource -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A set of alternate data source parameters that you want to share for the
    -- credentials stored with this data source. The credentials are applied in
    -- tandem with the data source parameters when you copy a data source by
    -- using a create or update request. The API operation compares the
    -- @DataSourceParameters@ structure that\'s in the request with the
    -- structures in the @AlternateDataSourceParameters@ allow list. If the
    -- structures are an exact match, the request is allowed to use the
    -- credentials from this existing data source. If the
    -- @AlternateDataSourceParameters@ list is null, the @Credentials@
    -- originally used with this @DataSourceParameters@ are automatically
    -- allowed.
    DataSource -> Maybe (NonEmpty DataSourceParameters)
alternateDataSourceParameters :: Prelude.Maybe (Prelude.NonEmpty DataSourceParameters),
    -- | The VPC connection information. You need to use this parameter only when
    -- you want Amazon QuickSight to use a VPC connection when connecting to
    -- your underlying source.
    DataSource -> Maybe VpcConnectionProperties
vpcConnectionProperties :: Prelude.Maybe VpcConnectionProperties,
    -- | The type of the data source. This type indicates which database engine
    -- the data source connects to.
    DataSource -> Maybe DataSourceType
type' :: Prelude.Maybe DataSourceType,
    -- | Error information from the last update or the creation of the data
    -- source.
    DataSource -> Maybe DataSourceErrorInfo
errorInfo :: Prelude.Maybe DataSourceErrorInfo
  }
  deriving (DataSource -> DataSource -> Bool
(DataSource -> DataSource -> Bool)
-> (DataSource -> DataSource -> Bool) -> Eq DataSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataSource -> DataSource -> Bool
$c/= :: DataSource -> DataSource -> Bool
== :: DataSource -> DataSource -> Bool
$c== :: DataSource -> DataSource -> Bool
Prelude.Eq, ReadPrec [DataSource]
ReadPrec DataSource
Int -> ReadS DataSource
ReadS [DataSource]
(Int -> ReadS DataSource)
-> ReadS [DataSource]
-> ReadPrec DataSource
-> ReadPrec [DataSource]
-> Read DataSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataSource]
$creadListPrec :: ReadPrec [DataSource]
readPrec :: ReadPrec DataSource
$creadPrec :: ReadPrec DataSource
readList :: ReadS [DataSource]
$creadList :: ReadS [DataSource]
readsPrec :: Int -> ReadS DataSource
$creadsPrec :: Int -> ReadS DataSource
Prelude.Read, Int -> DataSource -> ShowS
[DataSource] -> ShowS
DataSource -> String
(Int -> DataSource -> ShowS)
-> (DataSource -> String)
-> ([DataSource] -> ShowS)
-> Show DataSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataSource] -> ShowS
$cshowList :: [DataSource] -> ShowS
show :: DataSource -> String
$cshow :: DataSource -> String
showsPrec :: Int -> DataSource -> ShowS
$cshowsPrec :: Int -> DataSource -> ShowS
Prelude.Show, (forall x. DataSource -> Rep DataSource x)
-> (forall x. Rep DataSource x -> DataSource) -> Generic DataSource
forall x. Rep DataSource x -> DataSource
forall x. DataSource -> Rep DataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataSource x -> DataSource
$cfrom :: forall x. DataSource -> Rep DataSource x
Prelude.Generic)

-- |
-- Create a value of 'DataSource' 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', 'dataSource_status' - The HTTP status of the request.
--
-- 'dataSourceParameters', 'dataSource_dataSourceParameters' - The parameters that Amazon QuickSight uses to connect to your underlying
-- source. This is a variant type structure. For this structure to be
-- valid, only one of the attributes can be non-null.
--
-- 'lastUpdatedTime', 'dataSource_lastUpdatedTime' - The last time that this data source was updated.
--
-- 'arn', 'dataSource_arn' - The Amazon Resource Name (ARN) of the data source.
--
-- 'createdTime', 'dataSource_createdTime' - The time that this data source was created.
--
-- 'sslProperties', 'dataSource_sslProperties' - Secure Socket Layer (SSL) properties that apply when Amazon QuickSight
-- connects to your underlying source.
--
-- 'dataSourceId', 'dataSource_dataSourceId' - The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
--
-- 'name', 'dataSource_name' - A display name for the data source.
--
-- 'alternateDataSourceParameters', 'dataSource_alternateDataSourceParameters' - A set of alternate data source parameters that you want to share for the
-- credentials stored with this data source. The credentials are applied in
-- tandem with the data source parameters when you copy a data source by
-- using a create or update request. The API operation compares the
-- @DataSourceParameters@ structure that\'s in the request with the
-- structures in the @AlternateDataSourceParameters@ allow list. If the
-- structures are an exact match, the request is allowed to use the
-- credentials from this existing data source. If the
-- @AlternateDataSourceParameters@ list is null, the @Credentials@
-- originally used with this @DataSourceParameters@ are automatically
-- allowed.
--
-- 'vpcConnectionProperties', 'dataSource_vpcConnectionProperties' - The VPC connection information. You need to use this parameter only when
-- you want Amazon QuickSight to use a VPC connection when connecting to
-- your underlying source.
--
-- 'type'', 'dataSource_type' - The type of the data source. This type indicates which database engine
-- the data source connects to.
--
-- 'errorInfo', 'dataSource_errorInfo' - Error information from the last update or the creation of the data
-- source.
newDataSource ::
  DataSource
newDataSource :: DataSource
newDataSource =
  DataSource' :: Maybe ResourceStatus
-> Maybe DataSourceParameters
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe SslProperties
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty DataSourceParameters)
-> Maybe VpcConnectionProperties
-> Maybe DataSourceType
-> Maybe DataSourceErrorInfo
-> DataSource
DataSource'
    { $sel:status:DataSource' :: Maybe ResourceStatus
status = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSourceParameters:DataSource' :: Maybe DataSourceParameters
dataSourceParameters = Maybe DataSourceParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:DataSource' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DataSource' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:DataSource' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sslProperties:DataSource' :: Maybe SslProperties
sslProperties = Maybe SslProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSourceId:DataSource' :: Maybe Text
dataSourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DataSource' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alternateDataSourceParameters:DataSource' :: Maybe (NonEmpty DataSourceParameters)
alternateDataSourceParameters = Maybe (NonEmpty DataSourceParameters)
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcConnectionProperties:DataSource' :: Maybe VpcConnectionProperties
vpcConnectionProperties = Maybe VpcConnectionProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:type':DataSource' :: Maybe DataSourceType
type' = Maybe DataSourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:errorInfo:DataSource' :: Maybe DataSourceErrorInfo
errorInfo = Maybe DataSourceErrorInfo
forall a. Maybe a
Prelude.Nothing
    }

-- | The HTTP status of the request.
dataSource_status :: Lens.Lens' DataSource (Prelude.Maybe ResourceStatus)
dataSource_status :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> DataSource -> f DataSource
dataSource_status = (DataSource -> Maybe ResourceStatus)
-> (DataSource -> Maybe ResourceStatus -> DataSource)
-> Lens
     DataSource DataSource (Maybe ResourceStatus) (Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe ResourceStatus
status :: Maybe ResourceStatus
$sel:status:DataSource' :: DataSource -> Maybe ResourceStatus
status} -> Maybe ResourceStatus
status) (\s :: DataSource
s@DataSource' {} Maybe ResourceStatus
a -> DataSource
s {$sel:status:DataSource' :: Maybe ResourceStatus
status = Maybe ResourceStatus
a} :: DataSource)

-- | The parameters that Amazon QuickSight uses to connect to your underlying
-- source. This is a variant type structure. For this structure to be
-- valid, only one of the attributes can be non-null.
dataSource_dataSourceParameters :: Lens.Lens' DataSource (Prelude.Maybe DataSourceParameters)
dataSource_dataSourceParameters :: (Maybe DataSourceParameters -> f (Maybe DataSourceParameters))
-> DataSource -> f DataSource
dataSource_dataSourceParameters = (DataSource -> Maybe DataSourceParameters)
-> (DataSource -> Maybe DataSourceParameters -> DataSource)
-> Lens
     DataSource
     DataSource
     (Maybe DataSourceParameters)
     (Maybe DataSourceParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe DataSourceParameters
dataSourceParameters :: Maybe DataSourceParameters
$sel:dataSourceParameters:DataSource' :: DataSource -> Maybe DataSourceParameters
dataSourceParameters} -> Maybe DataSourceParameters
dataSourceParameters) (\s :: DataSource
s@DataSource' {} Maybe DataSourceParameters
a -> DataSource
s {$sel:dataSourceParameters:DataSource' :: Maybe DataSourceParameters
dataSourceParameters = Maybe DataSourceParameters
a} :: DataSource)

-- | The last time that this data source was updated.
dataSource_lastUpdatedTime :: Lens.Lens' DataSource (Prelude.Maybe Prelude.UTCTime)
dataSource_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> DataSource -> f DataSource
dataSource_lastUpdatedTime = (DataSource -> Maybe POSIX)
-> (DataSource -> Maybe POSIX -> DataSource)
-> Lens DataSource DataSource (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:DataSource' :: DataSource -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: DataSource
s@DataSource' {} Maybe POSIX
a -> DataSource
s {$sel:lastUpdatedTime:DataSource' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: DataSource) ((Maybe POSIX -> f (Maybe POSIX)) -> DataSource -> f DataSource)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DataSource
-> f DataSource
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) of the data source.
dataSource_arn :: Lens.Lens' DataSource (Prelude.Maybe Prelude.Text)
dataSource_arn :: (Maybe Text -> f (Maybe Text)) -> DataSource -> f DataSource
dataSource_arn = (DataSource -> Maybe Text)
-> (DataSource -> Maybe Text -> DataSource)
-> Lens DataSource DataSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe Text
arn :: Maybe Text
$sel:arn:DataSource' :: DataSource -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DataSource
s@DataSource' {} Maybe Text
a -> DataSource
s {$sel:arn:DataSource' :: Maybe Text
arn = Maybe Text
a} :: DataSource)

-- | The time that this data source was created.
dataSource_createdTime :: Lens.Lens' DataSource (Prelude.Maybe Prelude.UTCTime)
dataSource_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> DataSource -> f DataSource
dataSource_createdTime = (DataSource -> Maybe POSIX)
-> (DataSource -> Maybe POSIX -> DataSource)
-> Lens DataSource DataSource (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:DataSource' :: DataSource -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: DataSource
s@DataSource' {} Maybe POSIX
a -> DataSource
s {$sel:createdTime:DataSource' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: DataSource) ((Maybe POSIX -> f (Maybe POSIX)) -> DataSource -> f DataSource)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DataSource
-> f DataSource
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

-- | Secure Socket Layer (SSL) properties that apply when Amazon QuickSight
-- connects to your underlying source.
dataSource_sslProperties :: Lens.Lens' DataSource (Prelude.Maybe SslProperties)
dataSource_sslProperties :: (Maybe SslProperties -> f (Maybe SslProperties))
-> DataSource -> f DataSource
dataSource_sslProperties = (DataSource -> Maybe SslProperties)
-> (DataSource -> Maybe SslProperties -> DataSource)
-> Lens
     DataSource DataSource (Maybe SslProperties) (Maybe SslProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe SslProperties
sslProperties :: Maybe SslProperties
$sel:sslProperties:DataSource' :: DataSource -> Maybe SslProperties
sslProperties} -> Maybe SslProperties
sslProperties) (\s :: DataSource
s@DataSource' {} Maybe SslProperties
a -> DataSource
s {$sel:sslProperties:DataSource' :: Maybe SslProperties
sslProperties = Maybe SslProperties
a} :: DataSource)

-- | The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
dataSource_dataSourceId :: Lens.Lens' DataSource (Prelude.Maybe Prelude.Text)
dataSource_dataSourceId :: (Maybe Text -> f (Maybe Text)) -> DataSource -> f DataSource
dataSource_dataSourceId = (DataSource -> Maybe Text)
-> (DataSource -> Maybe Text -> DataSource)
-> Lens DataSource DataSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe Text
dataSourceId :: Maybe Text
$sel:dataSourceId:DataSource' :: DataSource -> Maybe Text
dataSourceId} -> Maybe Text
dataSourceId) (\s :: DataSource
s@DataSource' {} Maybe Text
a -> DataSource
s {$sel:dataSourceId:DataSource' :: Maybe Text
dataSourceId = Maybe Text
a} :: DataSource)

-- | A display name for the data source.
dataSource_name :: Lens.Lens' DataSource (Prelude.Maybe Prelude.Text)
dataSource_name :: (Maybe Text -> f (Maybe Text)) -> DataSource -> f DataSource
dataSource_name = (DataSource -> Maybe Text)
-> (DataSource -> Maybe Text -> DataSource)
-> Lens DataSource DataSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe Text
name :: Maybe Text
$sel:name:DataSource' :: DataSource -> Maybe Text
name} -> Maybe Text
name) (\s :: DataSource
s@DataSource' {} Maybe Text
a -> DataSource
s {$sel:name:DataSource' :: Maybe Text
name = Maybe Text
a} :: DataSource)

-- | A set of alternate data source parameters that you want to share for the
-- credentials stored with this data source. The credentials are applied in
-- tandem with the data source parameters when you copy a data source by
-- using a create or update request. The API operation compares the
-- @DataSourceParameters@ structure that\'s in the request with the
-- structures in the @AlternateDataSourceParameters@ allow list. If the
-- structures are an exact match, the request is allowed to use the
-- credentials from this existing data source. If the
-- @AlternateDataSourceParameters@ list is null, the @Credentials@
-- originally used with this @DataSourceParameters@ are automatically
-- allowed.
dataSource_alternateDataSourceParameters :: Lens.Lens' DataSource (Prelude.Maybe (Prelude.NonEmpty DataSourceParameters))
dataSource_alternateDataSourceParameters :: (Maybe (NonEmpty DataSourceParameters)
 -> f (Maybe (NonEmpty DataSourceParameters)))
-> DataSource -> f DataSource
dataSource_alternateDataSourceParameters = (DataSource -> Maybe (NonEmpty DataSourceParameters))
-> (DataSource
    -> Maybe (NonEmpty DataSourceParameters) -> DataSource)
-> Lens
     DataSource
     DataSource
     (Maybe (NonEmpty DataSourceParameters))
     (Maybe (NonEmpty DataSourceParameters))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe (NonEmpty DataSourceParameters)
alternateDataSourceParameters :: Maybe (NonEmpty DataSourceParameters)
$sel:alternateDataSourceParameters:DataSource' :: DataSource -> Maybe (NonEmpty DataSourceParameters)
alternateDataSourceParameters} -> Maybe (NonEmpty DataSourceParameters)
alternateDataSourceParameters) (\s :: DataSource
s@DataSource' {} Maybe (NonEmpty DataSourceParameters)
a -> DataSource
s {$sel:alternateDataSourceParameters:DataSource' :: Maybe (NonEmpty DataSourceParameters)
alternateDataSourceParameters = Maybe (NonEmpty DataSourceParameters)
a} :: DataSource) ((Maybe (NonEmpty DataSourceParameters)
  -> f (Maybe (NonEmpty DataSourceParameters)))
 -> DataSource -> f DataSource)
-> ((Maybe (NonEmpty DataSourceParameters)
     -> f (Maybe (NonEmpty DataSourceParameters)))
    -> Maybe (NonEmpty DataSourceParameters)
    -> f (Maybe (NonEmpty DataSourceParameters)))
-> (Maybe (NonEmpty DataSourceParameters)
    -> f (Maybe (NonEmpty DataSourceParameters)))
-> DataSource
-> f DataSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty DataSourceParameters)
  (NonEmpty DataSourceParameters)
  (NonEmpty DataSourceParameters)
  (NonEmpty DataSourceParameters)
-> Iso
     (Maybe (NonEmpty DataSourceParameters))
     (Maybe (NonEmpty DataSourceParameters))
     (Maybe (NonEmpty DataSourceParameters))
     (Maybe (NonEmpty DataSourceParameters))
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
  (NonEmpty DataSourceParameters)
  (NonEmpty DataSourceParameters)
  (NonEmpty DataSourceParameters)
  (NonEmpty DataSourceParameters)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The VPC connection information. You need to use this parameter only when
-- you want Amazon QuickSight to use a VPC connection when connecting to
-- your underlying source.
dataSource_vpcConnectionProperties :: Lens.Lens' DataSource (Prelude.Maybe VpcConnectionProperties)
dataSource_vpcConnectionProperties :: (Maybe VpcConnectionProperties
 -> f (Maybe VpcConnectionProperties))
-> DataSource -> f DataSource
dataSource_vpcConnectionProperties = (DataSource -> Maybe VpcConnectionProperties)
-> (DataSource -> Maybe VpcConnectionProperties -> DataSource)
-> Lens
     DataSource
     DataSource
     (Maybe VpcConnectionProperties)
     (Maybe VpcConnectionProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe VpcConnectionProperties
vpcConnectionProperties :: Maybe VpcConnectionProperties
$sel:vpcConnectionProperties:DataSource' :: DataSource -> Maybe VpcConnectionProperties
vpcConnectionProperties} -> Maybe VpcConnectionProperties
vpcConnectionProperties) (\s :: DataSource
s@DataSource' {} Maybe VpcConnectionProperties
a -> DataSource
s {$sel:vpcConnectionProperties:DataSource' :: Maybe VpcConnectionProperties
vpcConnectionProperties = Maybe VpcConnectionProperties
a} :: DataSource)

-- | The type of the data source. This type indicates which database engine
-- the data source connects to.
dataSource_type :: Lens.Lens' DataSource (Prelude.Maybe DataSourceType)
dataSource_type :: (Maybe DataSourceType -> f (Maybe DataSourceType))
-> DataSource -> f DataSource
dataSource_type = (DataSource -> Maybe DataSourceType)
-> (DataSource -> Maybe DataSourceType -> DataSource)
-> Lens
     DataSource DataSource (Maybe DataSourceType) (Maybe DataSourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe DataSourceType
type' :: Maybe DataSourceType
$sel:type':DataSource' :: DataSource -> Maybe DataSourceType
type'} -> Maybe DataSourceType
type') (\s :: DataSource
s@DataSource' {} Maybe DataSourceType
a -> DataSource
s {$sel:type':DataSource' :: Maybe DataSourceType
type' = Maybe DataSourceType
a} :: DataSource)

-- | Error information from the last update or the creation of the data
-- source.
dataSource_errorInfo :: Lens.Lens' DataSource (Prelude.Maybe DataSourceErrorInfo)
dataSource_errorInfo :: (Maybe DataSourceErrorInfo -> f (Maybe DataSourceErrorInfo))
-> DataSource -> f DataSource
dataSource_errorInfo = (DataSource -> Maybe DataSourceErrorInfo)
-> (DataSource -> Maybe DataSourceErrorInfo -> DataSource)
-> Lens
     DataSource
     DataSource
     (Maybe DataSourceErrorInfo)
     (Maybe DataSourceErrorInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe DataSourceErrorInfo
errorInfo :: Maybe DataSourceErrorInfo
$sel:errorInfo:DataSource' :: DataSource -> Maybe DataSourceErrorInfo
errorInfo} -> Maybe DataSourceErrorInfo
errorInfo) (\s :: DataSource
s@DataSource' {} Maybe DataSourceErrorInfo
a -> DataSource
s {$sel:errorInfo:DataSource' :: Maybe DataSourceErrorInfo
errorInfo = Maybe DataSourceErrorInfo
a} :: DataSource)

instance Core.FromJSON DataSource where
  parseJSON :: Value -> Parser DataSource
parseJSON =
    String
-> (Object -> Parser DataSource) -> Value -> Parser DataSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DataSource"
      ( \Object
x ->
          Maybe ResourceStatus
-> Maybe DataSourceParameters
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe SslProperties
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty DataSourceParameters)
-> Maybe VpcConnectionProperties
-> Maybe DataSourceType
-> Maybe DataSourceErrorInfo
-> DataSource
DataSource'
            (Maybe ResourceStatus
 -> Maybe DataSourceParameters
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe SslProperties
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty DataSourceParameters)
 -> Maybe VpcConnectionProperties
 -> Maybe DataSourceType
 -> Maybe DataSourceErrorInfo
 -> DataSource)
-> Parser (Maybe ResourceStatus)
-> Parser
     (Maybe DataSourceParameters
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe SslProperties
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DataSourceParameters)
      -> Maybe VpcConnectionProperties
      -> Maybe DataSourceType
      -> Maybe DataSourceErrorInfo
      -> DataSource)
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 DataSourceParameters
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe SslProperties
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DataSourceParameters)
   -> Maybe VpcConnectionProperties
   -> Maybe DataSourceType
   -> Maybe DataSourceErrorInfo
   -> DataSource)
-> Parser (Maybe DataSourceParameters)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe SslProperties
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DataSourceParameters)
      -> Maybe VpcConnectionProperties
      -> Maybe DataSourceType
      -> Maybe DataSourceErrorInfo
      -> DataSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataSourceParameters)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DataSourceParameters")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe SslProperties
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DataSourceParameters)
   -> Maybe VpcConnectionProperties
   -> Maybe DataSourceType
   -> Maybe DataSourceErrorInfo
   -> DataSource)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe SslProperties
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DataSourceParameters)
      -> Maybe VpcConnectionProperties
      -> Maybe DataSourceType
      -> Maybe DataSourceErrorInfo
      -> DataSource)
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 SslProperties
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DataSourceParameters)
   -> Maybe VpcConnectionProperties
   -> Maybe DataSourceType
   -> Maybe DataSourceErrorInfo
   -> DataSource)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe SslProperties
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DataSourceParameters)
      -> Maybe VpcConnectionProperties
      -> Maybe DataSourceType
      -> Maybe DataSourceErrorInfo
      -> DataSource)
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 SslProperties
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DataSourceParameters)
   -> Maybe VpcConnectionProperties
   -> Maybe DataSourceType
   -> Maybe DataSourceErrorInfo
   -> DataSource)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe SslProperties
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DataSourceParameters)
      -> Maybe VpcConnectionProperties
      -> Maybe DataSourceType
      -> Maybe DataSourceErrorInfo
      -> DataSource)
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 SslProperties
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DataSourceParameters)
   -> Maybe VpcConnectionProperties
   -> Maybe DataSourceType
   -> Maybe DataSourceErrorInfo
   -> DataSource)
-> Parser (Maybe SslProperties)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty DataSourceParameters)
      -> Maybe VpcConnectionProperties
      -> Maybe DataSourceType
      -> Maybe DataSourceErrorInfo
      -> DataSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SslProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SslProperties")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty DataSourceParameters)
   -> Maybe VpcConnectionProperties
   -> Maybe DataSourceType
   -> Maybe DataSourceErrorInfo
   -> DataSource)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty DataSourceParameters)
      -> Maybe VpcConnectionProperties
      -> Maybe DataSourceType
      -> Maybe DataSourceErrorInfo
      -> DataSource)
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
"DataSourceId")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty DataSourceParameters)
   -> Maybe VpcConnectionProperties
   -> Maybe DataSourceType
   -> Maybe DataSourceErrorInfo
   -> DataSource)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty DataSourceParameters)
      -> Maybe VpcConnectionProperties
      -> Maybe DataSourceType
      -> Maybe DataSourceErrorInfo
      -> DataSource)
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")
            Parser
  (Maybe (NonEmpty DataSourceParameters)
   -> Maybe VpcConnectionProperties
   -> Maybe DataSourceType
   -> Maybe DataSourceErrorInfo
   -> DataSource)
-> Parser (Maybe (NonEmpty DataSourceParameters))
-> Parser
     (Maybe VpcConnectionProperties
      -> Maybe DataSourceType -> Maybe DataSourceErrorInfo -> DataSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty DataSourceParameters))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AlternateDataSourceParameters")
            Parser
  (Maybe VpcConnectionProperties
   -> Maybe DataSourceType -> Maybe DataSourceErrorInfo -> DataSource)
-> Parser (Maybe VpcConnectionProperties)
-> Parser
     (Maybe DataSourceType -> Maybe DataSourceErrorInfo -> DataSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VpcConnectionProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VpcConnectionProperties")
            Parser
  (Maybe DataSourceType -> Maybe DataSourceErrorInfo -> DataSource)
-> Parser (Maybe DataSourceType)
-> Parser (Maybe DataSourceErrorInfo -> DataSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataSourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
            Parser (Maybe DataSourceErrorInfo -> DataSource)
-> Parser (Maybe DataSourceErrorInfo) -> Parser DataSource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataSourceErrorInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorInfo")
      )

instance Prelude.Hashable DataSource

instance Prelude.NFData DataSource