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

import Amazonka.Athena.Types.DataCatalogType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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.
    DataCatalogSummary -> Maybe Text
catalogName :: Prelude.Maybe Prelude.Text,
    -- | The data catalog type.
    DataCatalogSummary -> Maybe DataCatalogType
type' :: Prelude.Maybe DataCatalogType
  }
  deriving (DataCatalogSummary -> DataCatalogSummary -> Bool
(DataCatalogSummary -> DataCatalogSummary -> Bool)
-> (DataCatalogSummary -> DataCatalogSummary -> Bool)
-> Eq DataCatalogSummary
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]
(Int -> ReadS DataCatalogSummary)
-> ReadS [DataCatalogSummary]
-> ReadPrec DataCatalogSummary
-> ReadPrec [DataCatalogSummary]
-> Read 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
(Int -> DataCatalogSummary -> ShowS)
-> (DataCatalogSummary -> String)
-> ([DataCatalogSummary] -> ShowS)
-> Show DataCatalogSummary
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. DataCatalogSummary -> Rep DataCatalogSummary x)
-> (forall x. Rep DataCatalogSummary x -> DataCatalogSummary)
-> Generic DataCatalogSummary
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.
--
-- 'type'', 'dataCatalogSummary_type' - The data catalog type.
newDataCatalogSummary ::
  DataCatalogSummary
newDataCatalogSummary :: DataCatalogSummary
newDataCatalogSummary =
  DataCatalogSummary' :: Maybe Text -> Maybe DataCatalogType -> DataCatalogSummary
DataCatalogSummary'
    { $sel:catalogName:DataCatalogSummary' :: Maybe Text
catalogName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':DataCatalogSummary' :: Maybe DataCatalogType
type' = Maybe DataCatalogType
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the data catalog.
dataCatalogSummary_catalogName :: Lens.Lens' DataCatalogSummary (Prelude.Maybe Prelude.Text)
dataCatalogSummary_catalogName :: (Maybe Text -> f (Maybe Text))
-> DataCatalogSummary -> f DataCatalogSummary
dataCatalogSummary_catalogName = (DataCatalogSummary -> Maybe Text)
-> (DataCatalogSummary -> Maybe Text -> DataCatalogSummary)
-> Lens
     DataCatalogSummary DataCatalogSummary (Maybe Text) (Maybe Text)
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 :: (Maybe DataCatalogType -> f (Maybe DataCatalogType))
-> DataCatalogSummary -> f DataCatalogSummary
dataCatalogSummary_type = (DataCatalogSummary -> Maybe DataCatalogType)
-> (DataCatalogSummary
    -> Maybe DataCatalogType -> DataCatalogSummary)
-> Lens
     DataCatalogSummary
     DataCatalogSummary
     (Maybe DataCatalogType)
     (Maybe DataCatalogType)
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 Core.FromJSON DataCatalogSummary where
  parseJSON :: Value -> Parser DataCatalogSummary
parseJSON =
    String
-> (Object -> Parser DataCatalogSummary)
-> Value
-> Parser DataCatalogSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DataCatalogSummary"
      ( \Object
x ->
          Maybe Text -> Maybe DataCatalogType -> DataCatalogSummary
DataCatalogSummary'
            (Maybe Text -> Maybe DataCatalogType -> DataCatalogSummary)
-> Parser (Maybe Text)
-> Parser (Maybe DataCatalogType -> DataCatalogSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CatalogName")
            Parser (Maybe DataCatalogType -> DataCatalogSummary)
-> Parser (Maybe DataCatalogType) -> Parser DataCatalogSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataCatalogType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance Prelude.Hashable DataCatalogSummary

instance Prelude.NFData DataCatalogSummary