{-# 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 #-}
module Amazonka.QuickSight.Types.DataSourceCredentials where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.CredentialPair
data DataSourceCredentials = DataSourceCredentials'
{
DataSourceCredentials -> Maybe Text
copySourceArn :: Prelude.Maybe Prelude.Text,
DataSourceCredentials -> Maybe CredentialPair
credentialPair :: Prelude.Maybe CredentialPair
}
deriving (DataSourceCredentials -> DataSourceCredentials -> Bool
(DataSourceCredentials -> DataSourceCredentials -> Bool)
-> (DataSourceCredentials -> DataSourceCredentials -> Bool)
-> Eq DataSourceCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataSourceCredentials -> DataSourceCredentials -> Bool
$c/= :: DataSourceCredentials -> DataSourceCredentials -> Bool
== :: DataSourceCredentials -> DataSourceCredentials -> Bool
$c== :: DataSourceCredentials -> DataSourceCredentials -> Bool
Prelude.Eq, Int -> DataSourceCredentials -> ShowS
[DataSourceCredentials] -> ShowS
DataSourceCredentials -> String
(Int -> DataSourceCredentials -> ShowS)
-> (DataSourceCredentials -> String)
-> ([DataSourceCredentials] -> ShowS)
-> Show DataSourceCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataSourceCredentials] -> ShowS
$cshowList :: [DataSourceCredentials] -> ShowS
show :: DataSourceCredentials -> String
$cshow :: DataSourceCredentials -> String
showsPrec :: Int -> DataSourceCredentials -> ShowS
$cshowsPrec :: Int -> DataSourceCredentials -> ShowS
Prelude.Show, (forall x. DataSourceCredentials -> Rep DataSourceCredentials x)
-> (forall x. Rep DataSourceCredentials x -> DataSourceCredentials)
-> Generic DataSourceCredentials
forall x. Rep DataSourceCredentials x -> DataSourceCredentials
forall x. DataSourceCredentials -> Rep DataSourceCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataSourceCredentials x -> DataSourceCredentials
$cfrom :: forall x. DataSourceCredentials -> Rep DataSourceCredentials x
Prelude.Generic)
newDataSourceCredentials ::
DataSourceCredentials
newDataSourceCredentials :: DataSourceCredentials
newDataSourceCredentials =
DataSourceCredentials' :: Maybe Text -> Maybe CredentialPair -> DataSourceCredentials
DataSourceCredentials'
{ $sel:copySourceArn:DataSourceCredentials' :: Maybe Text
copySourceArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:credentialPair:DataSourceCredentials' :: Maybe CredentialPair
credentialPair = Maybe CredentialPair
forall a. Maybe a
Prelude.Nothing
}
dataSourceCredentials_copySourceArn :: Lens.Lens' DataSourceCredentials (Prelude.Maybe Prelude.Text)
dataSourceCredentials_copySourceArn :: (Maybe Text -> f (Maybe Text))
-> DataSourceCredentials -> f DataSourceCredentials
dataSourceCredentials_copySourceArn = (DataSourceCredentials -> Maybe Text)
-> (DataSourceCredentials -> Maybe Text -> DataSourceCredentials)
-> Lens
DataSourceCredentials
DataSourceCredentials
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceCredentials' {Maybe Text
copySourceArn :: Maybe Text
$sel:copySourceArn:DataSourceCredentials' :: DataSourceCredentials -> Maybe Text
copySourceArn} -> Maybe Text
copySourceArn) (\s :: DataSourceCredentials
s@DataSourceCredentials' {} Maybe Text
a -> DataSourceCredentials
s {$sel:copySourceArn:DataSourceCredentials' :: Maybe Text
copySourceArn = Maybe Text
a} :: DataSourceCredentials)
dataSourceCredentials_credentialPair :: Lens.Lens' DataSourceCredentials (Prelude.Maybe CredentialPair)
dataSourceCredentials_credentialPair :: (Maybe CredentialPair -> f (Maybe CredentialPair))
-> DataSourceCredentials -> f DataSourceCredentials
dataSourceCredentials_credentialPair = (DataSourceCredentials -> Maybe CredentialPair)
-> (DataSourceCredentials
-> Maybe CredentialPair -> DataSourceCredentials)
-> Lens
DataSourceCredentials
DataSourceCredentials
(Maybe CredentialPair)
(Maybe CredentialPair)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceCredentials' {Maybe CredentialPair
credentialPair :: Maybe CredentialPair
$sel:credentialPair:DataSourceCredentials' :: DataSourceCredentials -> Maybe CredentialPair
credentialPair} -> Maybe CredentialPair
credentialPair) (\s :: DataSourceCredentials
s@DataSourceCredentials' {} Maybe CredentialPair
a -> DataSourceCredentials
s {$sel:credentialPair:DataSourceCredentials' :: Maybe CredentialPair
credentialPair = Maybe CredentialPair
a} :: DataSourceCredentials)
instance Prelude.Hashable DataSourceCredentials
instance Prelude.NFData DataSourceCredentials
instance Core.ToJSON DataSourceCredentials where
toJSON :: DataSourceCredentials -> Value
toJSON DataSourceCredentials' {Maybe Text
Maybe CredentialPair
credentialPair :: Maybe CredentialPair
copySourceArn :: Maybe Text
$sel:credentialPair:DataSourceCredentials' :: DataSourceCredentials -> Maybe CredentialPair
$sel:copySourceArn:DataSourceCredentials' :: DataSourceCredentials -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CopySourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
copySourceArn,
(Text
"CredentialPair" Text -> CredentialPair -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CredentialPair -> Pair) -> Maybe CredentialPair -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CredentialPair
credentialPair
]
)