{-# 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.Athena.Types.DataCatalogSummary
-- 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.Athena.Types.DataCatalogSummary where

import Amazonka.Athena.Types.DataCatalogType
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 summary information for the data catalog, which includes its name
-- and type.
--
-- /See:/ 'newDataCatalogSummary' smart constructor.
data DataCatalogSummary = DataCatalogSummary'
  { -- | The name of the data catalog. The catalog name is unique for the Amazon
    -- Web Services account and can use a maximum of 127 alphanumeric,
    -- underscore, at sign, or hyphen characters. The remainder of the length
    -- constraint of 256 is reserved for use by Athena.
    DataCatalogSummary -> Maybe Text
catalogName :: Prelude.Maybe Prelude.Text,
    -- | The data catalog type.
    DataCatalogSummary -> Maybe DataCatalogType
type' :: Prelude.Maybe DataCatalogType
  }
  deriving (DataCatalogSummary -> DataCatalogSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataCatalogSummary -> DataCatalogSummary -> Bool
$c/= :: DataCatalogSummary -> DataCatalogSummary -> Bool
== :: DataCatalogSummary -> DataCatalogSummary -> Bool
$c== :: DataCatalogSummary -> DataCatalogSummary -> Bool
Prelude.Eq, ReadPrec [DataCatalogSummary]
ReadPrec DataCatalogSummary
Int -> ReadS DataCatalogSummary
ReadS [DataCatalogSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataCatalogSummary]
$creadListPrec :: ReadPrec [DataCatalogSummary]
readPrec :: ReadPrec DataCatalogSummary
$creadPrec :: ReadPrec DataCatalogSummary
readList :: ReadS [DataCatalogSummary]
$creadList :: ReadS [DataCatalogSummary]
readsPrec :: Int -> ReadS DataCatalogSummary
$creadsPrec :: Int -> ReadS DataCatalogSummary
Prelude.Read, Int -> DataCatalogSummary -> ShowS
[DataCatalogSummary] -> ShowS
DataCatalogSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataCatalogSummary] -> ShowS
$cshowList :: [DataCatalogSummary] -> ShowS
show :: DataCatalogSummary -> String
$cshow :: DataCatalogSummary -> String
showsPrec :: Int -> DataCatalogSummary -> ShowS
$cshowsPrec :: Int -> DataCatalogSummary -> ShowS
Prelude.Show, forall x. Rep DataCatalogSummary x -> DataCatalogSummary
forall x. DataCatalogSummary -> Rep DataCatalogSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataCatalogSummary x -> DataCatalogSummary
$cfrom :: forall x. DataCatalogSummary -> Rep DataCatalogSummary x
Prelude.Generic)

-- |
-- Create a value of 'DataCatalogSummary' 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:
--
-- 'catalogName', 'dataCatalogSummary_catalogName' - The name of the data catalog. The catalog name is unique for the Amazon
-- Web Services account and can use a maximum of 127 alphanumeric,
-- underscore, at sign, or hyphen characters. The remainder of the length
-- constraint of 256 is reserved for use by Athena.
--
-- 'type'', 'dataCatalogSummary_type' - The data catalog type.
newDataCatalogSummary ::
  DataCatalogSummary
newDataCatalogSummary :: DataCatalogSummary
newDataCatalogSummary =
  DataCatalogSummary'
    { $sel:catalogName:DataCatalogSummary' :: Maybe Text
catalogName = forall a. Maybe a
Prelude.Nothing,
      $sel:type':DataCatalogSummary' :: Maybe DataCatalogType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the data catalog. The catalog name is unique for the Amazon
-- Web Services account and can use a maximum of 127 alphanumeric,
-- underscore, at sign, or hyphen characters. The remainder of the length
-- constraint of 256 is reserved for use by Athena.
dataCatalogSummary_catalogName :: Lens.Lens' DataCatalogSummary (Prelude.Maybe Prelude.Text)
dataCatalogSummary_catalogName :: Lens' DataCatalogSummary (Maybe Text)
dataCatalogSummary_catalogName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCatalogSummary' {Maybe Text
catalogName :: Maybe Text
$sel:catalogName:DataCatalogSummary' :: DataCatalogSummary -> Maybe Text
catalogName} -> Maybe Text
catalogName) (\s :: DataCatalogSummary
s@DataCatalogSummary' {} Maybe Text
a -> DataCatalogSummary
s {$sel:catalogName:DataCatalogSummary' :: Maybe Text
catalogName = Maybe Text
a} :: DataCatalogSummary)

-- | The data catalog type.
dataCatalogSummary_type :: Lens.Lens' DataCatalogSummary (Prelude.Maybe DataCatalogType)
dataCatalogSummary_type :: Lens' DataCatalogSummary (Maybe DataCatalogType)
dataCatalogSummary_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataCatalogSummary' {Maybe DataCatalogType
type' :: Maybe DataCatalogType
$sel:type':DataCatalogSummary' :: DataCatalogSummary -> Maybe DataCatalogType
type'} -> Maybe DataCatalogType
type') (\s :: DataCatalogSummary
s@DataCatalogSummary' {} Maybe DataCatalogType
a -> DataCatalogSummary
s {$sel:type':DataCatalogSummary' :: Maybe DataCatalogType
type' = Maybe DataCatalogType
a} :: DataCatalogSummary)

instance Data.FromJSON DataCatalogSummary where
  parseJSON :: Value -> Parser DataCatalogSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DataCatalogSummary"
      ( \Object
x ->
          Maybe Text -> Maybe DataCatalogType -> DataCatalogSummary
DataCatalogSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CatalogName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
      )

instance Prelude.Hashable DataCatalogSummary where
  hashWithSalt :: Int -> DataCatalogSummary -> Int
hashWithSalt Int
_salt DataCatalogSummary' {Maybe Text
Maybe DataCatalogType
type' :: Maybe DataCatalogType
catalogName :: Maybe Text
$sel:type':DataCatalogSummary' :: DataCatalogSummary -> Maybe DataCatalogType
$sel:catalogName:DataCatalogSummary' :: DataCatalogSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
catalogName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataCatalogType
type'

instance Prelude.NFData DataCatalogSummary where
  rnf :: DataCatalogSummary -> ()
rnf DataCatalogSummary' {Maybe Text
Maybe DataCatalogType
type' :: Maybe DataCatalogType
catalogName :: Maybe Text
$sel:type':DataCatalogSummary' :: DataCatalogSummary -> Maybe DataCatalogType
$sel:catalogName:DataCatalogSummary' :: DataCatalogSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
catalogName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DataCatalogType
type'