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

import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.GlueDataCatalogConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration parameters for the default Amazon Glue database. You
-- use this database for SQL queries that you write in a Kinesis Data
-- Analytics Studio notebook.
--
-- /See:/ 'newCatalogConfiguration' smart constructor.
data CatalogConfiguration = CatalogConfiguration'
  { -- | The configuration parameters for the default Amazon Glue database. You
    -- use this database for Apache Flink SQL queries and table API transforms
    -- that you write in a Kinesis Data Analytics Studio notebook.
    CatalogConfiguration -> GlueDataCatalogConfiguration
glueDataCatalogConfiguration :: GlueDataCatalogConfiguration
  }
  deriving (CatalogConfiguration -> CatalogConfiguration -> Bool
(CatalogConfiguration -> CatalogConfiguration -> Bool)
-> (CatalogConfiguration -> CatalogConfiguration -> Bool)
-> Eq CatalogConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CatalogConfiguration -> CatalogConfiguration -> Bool
$c/= :: CatalogConfiguration -> CatalogConfiguration -> Bool
== :: CatalogConfiguration -> CatalogConfiguration -> Bool
$c== :: CatalogConfiguration -> CatalogConfiguration -> Bool
Prelude.Eq, ReadPrec [CatalogConfiguration]
ReadPrec CatalogConfiguration
Int -> ReadS CatalogConfiguration
ReadS [CatalogConfiguration]
(Int -> ReadS CatalogConfiguration)
-> ReadS [CatalogConfiguration]
-> ReadPrec CatalogConfiguration
-> ReadPrec [CatalogConfiguration]
-> Read CatalogConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CatalogConfiguration]
$creadListPrec :: ReadPrec [CatalogConfiguration]
readPrec :: ReadPrec CatalogConfiguration
$creadPrec :: ReadPrec CatalogConfiguration
readList :: ReadS [CatalogConfiguration]
$creadList :: ReadS [CatalogConfiguration]
readsPrec :: Int -> ReadS CatalogConfiguration
$creadsPrec :: Int -> ReadS CatalogConfiguration
Prelude.Read, Int -> CatalogConfiguration -> ShowS
[CatalogConfiguration] -> ShowS
CatalogConfiguration -> String
(Int -> CatalogConfiguration -> ShowS)
-> (CatalogConfiguration -> String)
-> ([CatalogConfiguration] -> ShowS)
-> Show CatalogConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CatalogConfiguration] -> ShowS
$cshowList :: [CatalogConfiguration] -> ShowS
show :: CatalogConfiguration -> String
$cshow :: CatalogConfiguration -> String
showsPrec :: Int -> CatalogConfiguration -> ShowS
$cshowsPrec :: Int -> CatalogConfiguration -> ShowS
Prelude.Show, (forall x. CatalogConfiguration -> Rep CatalogConfiguration x)
-> (forall x. Rep CatalogConfiguration x -> CatalogConfiguration)
-> Generic CatalogConfiguration
forall x. Rep CatalogConfiguration x -> CatalogConfiguration
forall x. CatalogConfiguration -> Rep CatalogConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CatalogConfiguration x -> CatalogConfiguration
$cfrom :: forall x. CatalogConfiguration -> Rep CatalogConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CatalogConfiguration' 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:
--
-- 'glueDataCatalogConfiguration', 'catalogConfiguration_glueDataCatalogConfiguration' - The configuration parameters for the default Amazon Glue database. You
-- use this database for Apache Flink SQL queries and table API transforms
-- that you write in a Kinesis Data Analytics Studio notebook.
newCatalogConfiguration ::
  -- | 'glueDataCatalogConfiguration'
  GlueDataCatalogConfiguration ->
  CatalogConfiguration
newCatalogConfiguration :: GlueDataCatalogConfiguration -> CatalogConfiguration
newCatalogConfiguration
  GlueDataCatalogConfiguration
pGlueDataCatalogConfiguration_ =
    CatalogConfiguration' :: GlueDataCatalogConfiguration -> CatalogConfiguration
CatalogConfiguration'
      { $sel:glueDataCatalogConfiguration:CatalogConfiguration' :: GlueDataCatalogConfiguration
glueDataCatalogConfiguration =
          GlueDataCatalogConfiguration
pGlueDataCatalogConfiguration_
      }

-- | The configuration parameters for the default Amazon Glue database. You
-- use this database for Apache Flink SQL queries and table API transforms
-- that you write in a Kinesis Data Analytics Studio notebook.
catalogConfiguration_glueDataCatalogConfiguration :: Lens.Lens' CatalogConfiguration GlueDataCatalogConfiguration
catalogConfiguration_glueDataCatalogConfiguration :: (GlueDataCatalogConfiguration -> f GlueDataCatalogConfiguration)
-> CatalogConfiguration -> f CatalogConfiguration
catalogConfiguration_glueDataCatalogConfiguration = (CatalogConfiguration -> GlueDataCatalogConfiguration)
-> (CatalogConfiguration
    -> GlueDataCatalogConfiguration -> CatalogConfiguration)
-> Lens
     CatalogConfiguration
     CatalogConfiguration
     GlueDataCatalogConfiguration
     GlueDataCatalogConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CatalogConfiguration' {GlueDataCatalogConfiguration
glueDataCatalogConfiguration :: GlueDataCatalogConfiguration
$sel:glueDataCatalogConfiguration:CatalogConfiguration' :: CatalogConfiguration -> GlueDataCatalogConfiguration
glueDataCatalogConfiguration} -> GlueDataCatalogConfiguration
glueDataCatalogConfiguration) (\s :: CatalogConfiguration
s@CatalogConfiguration' {} GlueDataCatalogConfiguration
a -> CatalogConfiguration
s {$sel:glueDataCatalogConfiguration:CatalogConfiguration' :: GlueDataCatalogConfiguration
glueDataCatalogConfiguration = GlueDataCatalogConfiguration
a} :: CatalogConfiguration)

instance Prelude.Hashable CatalogConfiguration

instance Prelude.NFData CatalogConfiguration

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