{-# 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.AppFlow.Types.MetadataCatalogDetail
-- 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.AppFlow.Types.MetadataCatalogDetail where

import Amazonka.AppFlow.Types.CatalogType
import Amazonka.AppFlow.Types.RegistrationOutput
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

-- | Describes the metadata catalog, metadata table, and data partitions that
-- Amazon AppFlow used for the associated flow run.
--
-- /See:/ 'newMetadataCatalogDetail' smart constructor.
data MetadataCatalogDetail = MetadataCatalogDetail'
  { -- | The type of metadata catalog that Amazon AppFlow used for the associated
    -- flow run. This parameter returns the following value:
    --
    -- [GLUE]
    --     The metadata catalog is provided by the Glue Data Catalog. Glue
    --     includes the Glue Data Catalog as a component.
    MetadataCatalogDetail -> Maybe CatalogType
catalogType :: Prelude.Maybe CatalogType,
    -- | Describes the status of the attempt from Amazon AppFlow to register the
    -- data partitions with the metadata catalog. The data partitions organize
    -- the flow output into a hierarchical path, such as a folder path in an S3
    -- bucket. Amazon AppFlow creates the partitions (if they don\'t already
    -- exist) based on your flow configuration.
    MetadataCatalogDetail -> Maybe RegistrationOutput
partitionRegistrationOutput :: Prelude.Maybe RegistrationOutput,
    -- | The name of the table that stores the metadata for the associated flow
    -- run. The table stores metadata that represents the data that the flow
    -- transferred. Amazon AppFlow stores the table in the metadata catalog.
    MetadataCatalogDetail -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text,
    -- | Describes the status of the attempt from Amazon AppFlow to register the
    -- metadata table with the metadata catalog. Amazon AppFlow creates or
    -- updates this table for the associated flow run.
    MetadataCatalogDetail -> Maybe RegistrationOutput
tableRegistrationOutput :: Prelude.Maybe RegistrationOutput
  }
  deriving (MetadataCatalogDetail -> MetadataCatalogDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetadataCatalogDetail -> MetadataCatalogDetail -> Bool
$c/= :: MetadataCatalogDetail -> MetadataCatalogDetail -> Bool
== :: MetadataCatalogDetail -> MetadataCatalogDetail -> Bool
$c== :: MetadataCatalogDetail -> MetadataCatalogDetail -> Bool
Prelude.Eq, ReadPrec [MetadataCatalogDetail]
ReadPrec MetadataCatalogDetail
Int -> ReadS MetadataCatalogDetail
ReadS [MetadataCatalogDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetadataCatalogDetail]
$creadListPrec :: ReadPrec [MetadataCatalogDetail]
readPrec :: ReadPrec MetadataCatalogDetail
$creadPrec :: ReadPrec MetadataCatalogDetail
readList :: ReadS [MetadataCatalogDetail]
$creadList :: ReadS [MetadataCatalogDetail]
readsPrec :: Int -> ReadS MetadataCatalogDetail
$creadsPrec :: Int -> ReadS MetadataCatalogDetail
Prelude.Read, Int -> MetadataCatalogDetail -> ShowS
[MetadataCatalogDetail] -> ShowS
MetadataCatalogDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetadataCatalogDetail] -> ShowS
$cshowList :: [MetadataCatalogDetail] -> ShowS
show :: MetadataCatalogDetail -> String
$cshow :: MetadataCatalogDetail -> String
showsPrec :: Int -> MetadataCatalogDetail -> ShowS
$cshowsPrec :: Int -> MetadataCatalogDetail -> ShowS
Prelude.Show, forall x. Rep MetadataCatalogDetail x -> MetadataCatalogDetail
forall x. MetadataCatalogDetail -> Rep MetadataCatalogDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetadataCatalogDetail x -> MetadataCatalogDetail
$cfrom :: forall x. MetadataCatalogDetail -> Rep MetadataCatalogDetail x
Prelude.Generic)

-- |
-- Create a value of 'MetadataCatalogDetail' 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:
--
-- 'catalogType', 'metadataCatalogDetail_catalogType' - The type of metadata catalog that Amazon AppFlow used for the associated
-- flow run. This parameter returns the following value:
--
-- [GLUE]
--     The metadata catalog is provided by the Glue Data Catalog. Glue
--     includes the Glue Data Catalog as a component.
--
-- 'partitionRegistrationOutput', 'metadataCatalogDetail_partitionRegistrationOutput' - Describes the status of the attempt from Amazon AppFlow to register the
-- data partitions with the metadata catalog. The data partitions organize
-- the flow output into a hierarchical path, such as a folder path in an S3
-- bucket. Amazon AppFlow creates the partitions (if they don\'t already
-- exist) based on your flow configuration.
--
-- 'tableName', 'metadataCatalogDetail_tableName' - The name of the table that stores the metadata for the associated flow
-- run. The table stores metadata that represents the data that the flow
-- transferred. Amazon AppFlow stores the table in the metadata catalog.
--
-- 'tableRegistrationOutput', 'metadataCatalogDetail_tableRegistrationOutput' - Describes the status of the attempt from Amazon AppFlow to register the
-- metadata table with the metadata catalog. Amazon AppFlow creates or
-- updates this table for the associated flow run.
newMetadataCatalogDetail ::
  MetadataCatalogDetail
newMetadataCatalogDetail :: MetadataCatalogDetail
newMetadataCatalogDetail =
  MetadataCatalogDetail'
    { $sel:catalogType:MetadataCatalogDetail' :: Maybe CatalogType
catalogType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:partitionRegistrationOutput:MetadataCatalogDetail' :: Maybe RegistrationOutput
partitionRegistrationOutput = forall a. Maybe a
Prelude.Nothing,
      $sel:tableName:MetadataCatalogDetail' :: Maybe Text
tableName = forall a. Maybe a
Prelude.Nothing,
      $sel:tableRegistrationOutput:MetadataCatalogDetail' :: Maybe RegistrationOutput
tableRegistrationOutput = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of metadata catalog that Amazon AppFlow used for the associated
-- flow run. This parameter returns the following value:
--
-- [GLUE]
--     The metadata catalog is provided by the Glue Data Catalog. Glue
--     includes the Glue Data Catalog as a component.
metadataCatalogDetail_catalogType :: Lens.Lens' MetadataCatalogDetail (Prelude.Maybe CatalogType)
metadataCatalogDetail_catalogType :: Lens' MetadataCatalogDetail (Maybe CatalogType)
metadataCatalogDetail_catalogType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataCatalogDetail' {Maybe CatalogType
catalogType :: Maybe CatalogType
$sel:catalogType:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe CatalogType
catalogType} -> Maybe CatalogType
catalogType) (\s :: MetadataCatalogDetail
s@MetadataCatalogDetail' {} Maybe CatalogType
a -> MetadataCatalogDetail
s {$sel:catalogType:MetadataCatalogDetail' :: Maybe CatalogType
catalogType = Maybe CatalogType
a} :: MetadataCatalogDetail)

-- | Describes the status of the attempt from Amazon AppFlow to register the
-- data partitions with the metadata catalog. The data partitions organize
-- the flow output into a hierarchical path, such as a folder path in an S3
-- bucket. Amazon AppFlow creates the partitions (if they don\'t already
-- exist) based on your flow configuration.
metadataCatalogDetail_partitionRegistrationOutput :: Lens.Lens' MetadataCatalogDetail (Prelude.Maybe RegistrationOutput)
metadataCatalogDetail_partitionRegistrationOutput :: Lens' MetadataCatalogDetail (Maybe RegistrationOutput)
metadataCatalogDetail_partitionRegistrationOutput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataCatalogDetail' {Maybe RegistrationOutput
partitionRegistrationOutput :: Maybe RegistrationOutput
$sel:partitionRegistrationOutput:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe RegistrationOutput
partitionRegistrationOutput} -> Maybe RegistrationOutput
partitionRegistrationOutput) (\s :: MetadataCatalogDetail
s@MetadataCatalogDetail' {} Maybe RegistrationOutput
a -> MetadataCatalogDetail
s {$sel:partitionRegistrationOutput:MetadataCatalogDetail' :: Maybe RegistrationOutput
partitionRegistrationOutput = Maybe RegistrationOutput
a} :: MetadataCatalogDetail)

-- | The name of the table that stores the metadata for the associated flow
-- run. The table stores metadata that represents the data that the flow
-- transferred. Amazon AppFlow stores the table in the metadata catalog.
metadataCatalogDetail_tableName :: Lens.Lens' MetadataCatalogDetail (Prelude.Maybe Prelude.Text)
metadataCatalogDetail_tableName :: Lens' MetadataCatalogDetail (Maybe Text)
metadataCatalogDetail_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataCatalogDetail' {Maybe Text
tableName :: Maybe Text
$sel:tableName:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: MetadataCatalogDetail
s@MetadataCatalogDetail' {} Maybe Text
a -> MetadataCatalogDetail
s {$sel:tableName:MetadataCatalogDetail' :: Maybe Text
tableName = Maybe Text
a} :: MetadataCatalogDetail)

-- | Describes the status of the attempt from Amazon AppFlow to register the
-- metadata table with the metadata catalog. Amazon AppFlow creates or
-- updates this table for the associated flow run.
metadataCatalogDetail_tableRegistrationOutput :: Lens.Lens' MetadataCatalogDetail (Prelude.Maybe RegistrationOutput)
metadataCatalogDetail_tableRegistrationOutput :: Lens' MetadataCatalogDetail (Maybe RegistrationOutput)
metadataCatalogDetail_tableRegistrationOutput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetadataCatalogDetail' {Maybe RegistrationOutput
tableRegistrationOutput :: Maybe RegistrationOutput
$sel:tableRegistrationOutput:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe RegistrationOutput
tableRegistrationOutput} -> Maybe RegistrationOutput
tableRegistrationOutput) (\s :: MetadataCatalogDetail
s@MetadataCatalogDetail' {} Maybe RegistrationOutput
a -> MetadataCatalogDetail
s {$sel:tableRegistrationOutput:MetadataCatalogDetail' :: Maybe RegistrationOutput
tableRegistrationOutput = Maybe RegistrationOutput
a} :: MetadataCatalogDetail)

instance Data.FromJSON MetadataCatalogDetail where
  parseJSON :: Value -> Parser MetadataCatalogDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MetadataCatalogDetail"
      ( \Object
x ->
          Maybe CatalogType
-> Maybe RegistrationOutput
-> Maybe Text
-> Maybe RegistrationOutput
-> MetadataCatalogDetail
MetadataCatalogDetail'
            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
"catalogType")
            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
"partitionRegistrationOutput")
            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
"tableName")
            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
"tableRegistrationOutput")
      )

instance Prelude.Hashable MetadataCatalogDetail where
  hashWithSalt :: Int -> MetadataCatalogDetail -> Int
hashWithSalt Int
_salt MetadataCatalogDetail' {Maybe Text
Maybe CatalogType
Maybe RegistrationOutput
tableRegistrationOutput :: Maybe RegistrationOutput
tableName :: Maybe Text
partitionRegistrationOutput :: Maybe RegistrationOutput
catalogType :: Maybe CatalogType
$sel:tableRegistrationOutput:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe RegistrationOutput
$sel:tableName:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe Text
$sel:partitionRegistrationOutput:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe RegistrationOutput
$sel:catalogType:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe CatalogType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CatalogType
catalogType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RegistrationOutput
partitionRegistrationOutput
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
tableName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RegistrationOutput
tableRegistrationOutput

instance Prelude.NFData MetadataCatalogDetail where
  rnf :: MetadataCatalogDetail -> ()
rnf MetadataCatalogDetail' {Maybe Text
Maybe CatalogType
Maybe RegistrationOutput
tableRegistrationOutput :: Maybe RegistrationOutput
tableName :: Maybe Text
partitionRegistrationOutput :: Maybe RegistrationOutput
catalogType :: Maybe CatalogType
$sel:tableRegistrationOutput:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe RegistrationOutput
$sel:tableName:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe Text
$sel:partitionRegistrationOutput:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe RegistrationOutput
$sel:catalogType:MetadataCatalogDetail' :: MetadataCatalogDetail -> Maybe CatalogType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CatalogType
catalogType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RegistrationOutput
partitionRegistrationOutput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tableName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RegistrationOutput
tableRegistrationOutput