{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.KinesisAnalyticsV2.Types.GlueDataCatalogConfiguration 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

-- | 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
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]
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
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.
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'
    { $sel:databaseARN:GlueDataCatalogConfiguration' :: Text
databaseARN =
        Text
pDatabaseARN_
    }

-- | The Amazon Resource Name (ARN) of the database.
glueDataCatalogConfiguration_databaseARN :: Lens.Lens' GlueDataCatalogConfiguration Prelude.Text
glueDataCatalogConfiguration_databaseARN :: Lens' GlueDataCatalogConfiguration Text
glueDataCatalogConfiguration_databaseARN = 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
  where
  hashWithSalt :: Int -> GlueDataCatalogConfiguration -> Int
hashWithSalt Int
_salt GlueDataCatalogConfiguration' {Text
databaseARN :: Text
$sel:databaseARN:GlueDataCatalogConfiguration' :: GlueDataCatalogConfiguration -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
databaseARN

instance Prelude.NFData GlueDataCatalogConfiguration where
  rnf :: GlueDataCatalogConfiguration -> ()
rnf GlueDataCatalogConfiguration' {Text
databaseARN :: Text
$sel:databaseARN:GlueDataCatalogConfiguration' :: GlueDataCatalogConfiguration -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
databaseARN

instance Data.ToJSON GlueDataCatalogConfiguration where
  toJSON :: GlueDataCatalogConfiguration -> Value
toJSON GlueDataCatalogConfiguration' {Text
databaseARN :: Text
$sel:databaseARN:GlueDataCatalogConfiguration' :: GlueDataCatalogConfiguration -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"DatabaseARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
databaseARN)]
      )