{-# 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.KinesisAnalyticsV2.Types.GlueDataCatalogConfiguration
-- 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.KinesisAnalyticsV2.Types.GlueDataCatalogConfiguration where

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

-- | The configuration of the Glue Data Catalog that you use for Apache Flink
-- SQL queries and table API transforms that you write in an application.
--
-- /See:/ 'newGlueDataCatalogConfiguration' smart constructor.
data GlueDataCatalogConfiguration = GlueDataCatalogConfiguration'
  { -- | The Amazon Resource Name (ARN) of the database.
    GlueDataCatalogConfiguration -> Text
databaseARN :: Prelude.Text
  }
  deriving (GlueDataCatalogConfiguration
-> GlueDataCatalogConfiguration -> Bool
(GlueDataCatalogConfiguration
 -> GlueDataCatalogConfiguration -> Bool)
-> (GlueDataCatalogConfiguration
    -> GlueDataCatalogConfiguration -> Bool)
-> Eq GlueDataCatalogConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlueDataCatalogConfiguration
-> GlueDataCatalogConfiguration -> Bool
$c/= :: GlueDataCatalogConfiguration
-> GlueDataCatalogConfiguration -> Bool
== :: GlueDataCatalogConfiguration
-> GlueDataCatalogConfiguration -> Bool
$c== :: GlueDataCatalogConfiguration
-> GlueDataCatalogConfiguration -> Bool
Prelude.Eq, ReadPrec [GlueDataCatalogConfiguration]
ReadPrec GlueDataCatalogConfiguration
Int -> ReadS GlueDataCatalogConfiguration
ReadS [GlueDataCatalogConfiguration]
(Int -> ReadS GlueDataCatalogConfiguration)
-> ReadS [GlueDataCatalogConfiguration]
-> ReadPrec GlueDataCatalogConfiguration
-> ReadPrec [GlueDataCatalogConfiguration]
-> Read GlueDataCatalogConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlueDataCatalogConfiguration]
$creadListPrec :: ReadPrec [GlueDataCatalogConfiguration]
readPrec :: ReadPrec GlueDataCatalogConfiguration
$creadPrec :: ReadPrec GlueDataCatalogConfiguration
readList :: ReadS [GlueDataCatalogConfiguration]
$creadList :: ReadS [GlueDataCatalogConfiguration]
readsPrec :: Int -> ReadS GlueDataCatalogConfiguration
$creadsPrec :: Int -> ReadS GlueDataCatalogConfiguration
Prelude.Read, Int -> GlueDataCatalogConfiguration -> ShowS
[GlueDataCatalogConfiguration] -> ShowS
GlueDataCatalogConfiguration -> String
(Int -> GlueDataCatalogConfiguration -> ShowS)
-> (GlueDataCatalogConfiguration -> String)
-> ([GlueDataCatalogConfiguration] -> ShowS)
-> Show GlueDataCatalogConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlueDataCatalogConfiguration] -> ShowS
$cshowList :: [GlueDataCatalogConfiguration] -> ShowS
show :: GlueDataCatalogConfiguration -> String
$cshow :: GlueDataCatalogConfiguration -> String
showsPrec :: Int -> GlueDataCatalogConfiguration -> ShowS
$cshowsPrec :: Int -> GlueDataCatalogConfiguration -> ShowS
Prelude.Show, (forall x.
 GlueDataCatalogConfiguration -> Rep GlueDataCatalogConfiguration x)
-> (forall x.
    Rep GlueDataCatalogConfiguration x -> GlueDataCatalogConfiguration)
-> Generic GlueDataCatalogConfiguration
forall x.
Rep GlueDataCatalogConfiguration x -> GlueDataCatalogConfiguration
forall x.
GlueDataCatalogConfiguration -> Rep GlueDataCatalogConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GlueDataCatalogConfiguration x -> GlueDataCatalogConfiguration
$cfrom :: forall x.
GlueDataCatalogConfiguration -> Rep GlueDataCatalogConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'GlueDataCatalogConfiguration' 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:
--
-- 'databaseARN', 'glueDataCatalogConfiguration_databaseARN' - The Amazon Resource Name (ARN) of the database.
newGlueDataCatalogConfiguration ::
  -- | 'databaseARN'
  Prelude.Text ->
  GlueDataCatalogConfiguration
newGlueDataCatalogConfiguration :: Text -> GlueDataCatalogConfiguration
newGlueDataCatalogConfiguration Text
pDatabaseARN_ =
  GlueDataCatalogConfiguration' :: Text -> GlueDataCatalogConfiguration
GlueDataCatalogConfiguration'
    { $sel:databaseARN:GlueDataCatalogConfiguration' :: Text
databaseARN =
        Text
pDatabaseARN_
    }

-- | The Amazon Resource Name (ARN) of the database.
glueDataCatalogConfiguration_databaseARN :: Lens.Lens' GlueDataCatalogConfiguration Prelude.Text
glueDataCatalogConfiguration_databaseARN :: (Text -> f Text)
-> GlueDataCatalogConfiguration -> f GlueDataCatalogConfiguration
glueDataCatalogConfiguration_databaseARN = (GlueDataCatalogConfiguration -> Text)
-> (GlueDataCatalogConfiguration
    -> Text -> GlueDataCatalogConfiguration)
-> Lens
     GlueDataCatalogConfiguration GlueDataCatalogConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlueDataCatalogConfiguration' {Text
databaseARN :: Text
$sel:databaseARN:GlueDataCatalogConfiguration' :: GlueDataCatalogConfiguration -> Text
databaseARN} -> Text
databaseARN) (\s :: GlueDataCatalogConfiguration
s@GlueDataCatalogConfiguration' {} Text
a -> GlueDataCatalogConfiguration
s {$sel:databaseARN:GlueDataCatalogConfiguration' :: Text
databaseARN = Text
a} :: GlueDataCatalogConfiguration)

instance
  Prelude.Hashable
    GlueDataCatalogConfiguration

instance Prelude.NFData GlueDataCatalogConfiguration

instance Core.ToJSON GlueDataCatalogConfiguration where
  toJSON :: GlueDataCatalogConfiguration -> Value
toJSON GlueDataCatalogConfiguration' {Text
databaseARN :: Text
$sel:databaseARN:GlueDataCatalogConfiguration' :: GlueDataCatalogConfiguration -> 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
"DatabaseARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
databaseARN)]
      )