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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Dataset reference.
--
-- /See:/ 'newDataSetReference' smart constructor.
data DataSetReference = DataSetReference'
  { -- | Dataset placeholder.
    DataSetReference -> Text
dataSetPlaceholder :: Prelude.Text,
    -- | Dataset Amazon Resource Name (ARN).
    DataSetReference -> Text
dataSetArn :: Prelude.Text
  }
  deriving (DataSetReference -> DataSetReference -> Bool
(DataSetReference -> DataSetReference -> Bool)
-> (DataSetReference -> DataSetReference -> Bool)
-> Eq DataSetReference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataSetReference -> DataSetReference -> Bool
$c/= :: DataSetReference -> DataSetReference -> Bool
== :: DataSetReference -> DataSetReference -> Bool
$c== :: DataSetReference -> DataSetReference -> Bool
Prelude.Eq, ReadPrec [DataSetReference]
ReadPrec DataSetReference
Int -> ReadS DataSetReference
ReadS [DataSetReference]
(Int -> ReadS DataSetReference)
-> ReadS [DataSetReference]
-> ReadPrec DataSetReference
-> ReadPrec [DataSetReference]
-> Read DataSetReference
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataSetReference]
$creadListPrec :: ReadPrec [DataSetReference]
readPrec :: ReadPrec DataSetReference
$creadPrec :: ReadPrec DataSetReference
readList :: ReadS [DataSetReference]
$creadList :: ReadS [DataSetReference]
readsPrec :: Int -> ReadS DataSetReference
$creadsPrec :: Int -> ReadS DataSetReference
Prelude.Read, Int -> DataSetReference -> ShowS
[DataSetReference] -> ShowS
DataSetReference -> String
(Int -> DataSetReference -> ShowS)
-> (DataSetReference -> String)
-> ([DataSetReference] -> ShowS)
-> Show DataSetReference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataSetReference] -> ShowS
$cshowList :: [DataSetReference] -> ShowS
show :: DataSetReference -> String
$cshow :: DataSetReference -> String
showsPrec :: Int -> DataSetReference -> ShowS
$cshowsPrec :: Int -> DataSetReference -> ShowS
Prelude.Show, (forall x. DataSetReference -> Rep DataSetReference x)
-> (forall x. Rep DataSetReference x -> DataSetReference)
-> Generic DataSetReference
forall x. Rep DataSetReference x -> DataSetReference
forall x. DataSetReference -> Rep DataSetReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataSetReference x -> DataSetReference
$cfrom :: forall x. DataSetReference -> Rep DataSetReference x
Prelude.Generic)

-- |
-- Create a value of 'DataSetReference' 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:
--
-- 'dataSetPlaceholder', 'dataSetReference_dataSetPlaceholder' - Dataset placeholder.
--
-- 'dataSetArn', 'dataSetReference_dataSetArn' - Dataset Amazon Resource Name (ARN).
newDataSetReference ::
  -- | 'dataSetPlaceholder'
  Prelude.Text ->
  -- | 'dataSetArn'
  Prelude.Text ->
  DataSetReference
newDataSetReference :: Text -> Text -> DataSetReference
newDataSetReference Text
pDataSetPlaceholder_ Text
pDataSetArn_ =
  DataSetReference' :: Text -> Text -> DataSetReference
DataSetReference'
    { $sel:dataSetPlaceholder:DataSetReference' :: Text
dataSetPlaceholder =
        Text
pDataSetPlaceholder_,
      $sel:dataSetArn:DataSetReference' :: Text
dataSetArn = Text
pDataSetArn_
    }

-- | Dataset placeholder.
dataSetReference_dataSetPlaceholder :: Lens.Lens' DataSetReference Prelude.Text
dataSetReference_dataSetPlaceholder :: (Text -> f Text) -> DataSetReference -> f DataSetReference
dataSetReference_dataSetPlaceholder = (DataSetReference -> Text)
-> (DataSetReference -> Text -> DataSetReference)
-> Lens DataSetReference DataSetReference Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSetReference' {Text
dataSetPlaceholder :: Text
$sel:dataSetPlaceholder:DataSetReference' :: DataSetReference -> Text
dataSetPlaceholder} -> Text
dataSetPlaceholder) (\s :: DataSetReference
s@DataSetReference' {} Text
a -> DataSetReference
s {$sel:dataSetPlaceholder:DataSetReference' :: Text
dataSetPlaceholder = Text
a} :: DataSetReference)

-- | Dataset Amazon Resource Name (ARN).
dataSetReference_dataSetArn :: Lens.Lens' DataSetReference Prelude.Text
dataSetReference_dataSetArn :: (Text -> f Text) -> DataSetReference -> f DataSetReference
dataSetReference_dataSetArn = (DataSetReference -> Text)
-> (DataSetReference -> Text -> DataSetReference)
-> Lens DataSetReference DataSetReference Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSetReference' {Text
dataSetArn :: Text
$sel:dataSetArn:DataSetReference' :: DataSetReference -> Text
dataSetArn} -> Text
dataSetArn) (\s :: DataSetReference
s@DataSetReference' {} Text
a -> DataSetReference
s {$sel:dataSetArn:DataSetReference' :: Text
dataSetArn = Text
a} :: DataSetReference)

instance Prelude.Hashable DataSetReference

instance Prelude.NFData DataSetReference

instance Core.ToJSON DataSetReference where
  toJSON :: DataSetReference -> Value
toJSON DataSetReference' {Text
dataSetArn :: Text
dataSetPlaceholder :: Text
$sel:dataSetArn:DataSetReference' :: DataSetReference -> Text
$sel:dataSetPlaceholder:DataSetReference' :: DataSetReference -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DataSetPlaceholder" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataSetPlaceholder),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DataSetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataSetArn)
          ]
      )