{-# 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.DataBrew.Types.DataCatalogOutput -- 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.DataBrew.Types.DataCatalogOutput where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.DataBrew.Types.DatabaseTableOutputOptions import Amazonka.DataBrew.Types.S3TableOutputOptions import qualified Amazonka.Prelude as Prelude -- | Represents options that specify how and where in the Glue Data Catalog -- DataBrew writes the output generated by recipe jobs. -- -- /See:/ 'newDataCatalogOutput' smart constructor. data DataCatalogOutput = DataCatalogOutput' { -- | The unique identifier of the Amazon Web Services account that holds the -- Data Catalog that stores the data. catalogId :: Prelude.Maybe Prelude.Text, -- | Represents options that specify how and where DataBrew writes the -- database output generated by recipe jobs. databaseOptions :: Prelude.Maybe DatabaseTableOutputOptions, -- | A value that, if true, means that any data in the location specified for -- output is overwritten with new output. Not supported with -- DatabaseOptions. overwrite :: Prelude.Maybe Prelude.Bool, -- | Represents options that specify how and where DataBrew writes the Amazon -- S3 output generated by recipe jobs. s3Options :: Prelude.Maybe S3TableOutputOptions, -- | The name of a database in the Data Catalog. databaseName :: Prelude.Text, -- | The name of a table in the Data Catalog. tableName :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DataCatalogOutput' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'catalogId', 'dataCatalogOutput_catalogId' - The unique identifier of the Amazon Web Services account that holds the -- Data Catalog that stores the data. -- -- 'databaseOptions', 'dataCatalogOutput_databaseOptions' - Represents options that specify how and where DataBrew writes the -- database output generated by recipe jobs. -- -- 'overwrite', 'dataCatalogOutput_overwrite' - A value that, if true, means that any data in the location specified for -- output is overwritten with new output. Not supported with -- DatabaseOptions. -- -- 's3Options', 'dataCatalogOutput_s3Options' - Represents options that specify how and where DataBrew writes the Amazon -- S3 output generated by recipe jobs. -- -- 'databaseName', 'dataCatalogOutput_databaseName' - The name of a database in the Data Catalog. -- -- 'tableName', 'dataCatalogOutput_tableName' - The name of a table in the Data Catalog. newDataCatalogOutput :: -- | 'databaseName' Prelude.Text -> -- | 'tableName' Prelude.Text -> DataCatalogOutput newDataCatalogOutput pDatabaseName_ pTableName_ = DataCatalogOutput' { catalogId = Prelude.Nothing, databaseOptions = Prelude.Nothing, overwrite = Prelude.Nothing, s3Options = Prelude.Nothing, databaseName = pDatabaseName_, tableName = pTableName_ } -- | The unique identifier of the Amazon Web Services account that holds the -- Data Catalog that stores the data. dataCatalogOutput_catalogId :: Lens.Lens' DataCatalogOutput (Prelude.Maybe Prelude.Text) dataCatalogOutput_catalogId = Lens.lens (\DataCatalogOutput' {catalogId} -> catalogId) (\s@DataCatalogOutput' {} a -> s {catalogId = a} :: DataCatalogOutput) -- | Represents options that specify how and where DataBrew writes the -- database output generated by recipe jobs. dataCatalogOutput_databaseOptions :: Lens.Lens' DataCatalogOutput (Prelude.Maybe DatabaseTableOutputOptions) dataCatalogOutput_databaseOptions = Lens.lens (\DataCatalogOutput' {databaseOptions} -> databaseOptions) (\s@DataCatalogOutput' {} a -> s {databaseOptions = a} :: DataCatalogOutput) -- | A value that, if true, means that any data in the location specified for -- output is overwritten with new output. Not supported with -- DatabaseOptions. dataCatalogOutput_overwrite :: Lens.Lens' DataCatalogOutput (Prelude.Maybe Prelude.Bool) dataCatalogOutput_overwrite = Lens.lens (\DataCatalogOutput' {overwrite} -> overwrite) (\s@DataCatalogOutput' {} a -> s {overwrite = a} :: DataCatalogOutput) -- | Represents options that specify how and where DataBrew writes the Amazon -- S3 output generated by recipe jobs. dataCatalogOutput_s3Options :: Lens.Lens' DataCatalogOutput (Prelude.Maybe S3TableOutputOptions) dataCatalogOutput_s3Options = Lens.lens (\DataCatalogOutput' {s3Options} -> s3Options) (\s@DataCatalogOutput' {} a -> s {s3Options = a} :: DataCatalogOutput) -- | The name of a database in the Data Catalog. dataCatalogOutput_databaseName :: Lens.Lens' DataCatalogOutput Prelude.Text dataCatalogOutput_databaseName = Lens.lens (\DataCatalogOutput' {databaseName} -> databaseName) (\s@DataCatalogOutput' {} a -> s {databaseName = a} :: DataCatalogOutput) -- | The name of a table in the Data Catalog. dataCatalogOutput_tableName :: Lens.Lens' DataCatalogOutput Prelude.Text dataCatalogOutput_tableName = Lens.lens (\DataCatalogOutput' {tableName} -> tableName) (\s@DataCatalogOutput' {} a -> s {tableName = a} :: DataCatalogOutput) instance Data.FromJSON DataCatalogOutput where parseJSON = Data.withObject "DataCatalogOutput" ( \x -> DataCatalogOutput' Prelude.<$> (x Data..:? "CatalogId") Prelude.<*> (x Data..:? "DatabaseOptions") Prelude.<*> (x Data..:? "Overwrite") Prelude.<*> (x Data..:? "S3Options") Prelude.<*> (x Data..: "DatabaseName") Prelude.<*> (x Data..: "TableName") ) instance Prelude.Hashable DataCatalogOutput where hashWithSalt _salt DataCatalogOutput' {..} = _salt `Prelude.hashWithSalt` catalogId `Prelude.hashWithSalt` databaseOptions `Prelude.hashWithSalt` overwrite `Prelude.hashWithSalt` s3Options `Prelude.hashWithSalt` databaseName `Prelude.hashWithSalt` tableName instance Prelude.NFData DataCatalogOutput where rnf DataCatalogOutput' {..} = Prelude.rnf catalogId `Prelude.seq` Prelude.rnf databaseOptions `Prelude.seq` Prelude.rnf overwrite `Prelude.seq` Prelude.rnf s3Options `Prelude.seq` Prelude.rnf databaseName `Prelude.seq` Prelude.rnf tableName instance Data.ToJSON DataCatalogOutput where toJSON DataCatalogOutput' {..} = Data.object ( Prelude.catMaybes [ ("CatalogId" Data..=) Prelude.<$> catalogId, ("DatabaseOptions" Data..=) Prelude.<$> databaseOptions, ("Overwrite" Data..=) Prelude.<$> overwrite, ("S3Options" Data..=) Prelude.<$> s3Options, Prelude.Just ("DatabaseName" Data..= databaseName), Prelude.Just ("TableName" Data..= tableName) ] )