{-# 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.Discovery.Types.ContinuousExportDescription
-- 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.Discovery.Types.ContinuousExportDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Discovery.Types.ContinuousExportStatus
import Amazonka.Discovery.Types.DataSource
import qualified Amazonka.Prelude as Prelude

-- | A list of continuous export descriptions.
--
-- /See:/ 'newContinuousExportDescription' smart constructor.
data ContinuousExportDescription = ContinuousExportDescription'
  { -- | The type of data collector used to gather this data (currently only
    -- offered for AGENT).
    ContinuousExportDescription -> Maybe DataSource
dataSource :: Prelude.Maybe DataSource,
    -- | The unique ID assigned to this export.
    ContinuousExportDescription -> Maybe Text
exportId :: Prelude.Maybe Prelude.Text,
    -- | The name of the s3 bucket where the export data parquet files are
    -- stored.
    ContinuousExportDescription -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
    -- | An object which describes how the data is stored.
    --
    -- -   @databaseName@ - the name of the Glue database used to store the
    --     schema.
    ContinuousExportDescription -> Maybe (HashMap Text Text)
schemaStorageConfig :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The timestamp representing when the continuous export was started.
    ContinuousExportDescription -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
    -- | Describes the status of the export. Can be one of the following values:
    --
    -- -   START_IN_PROGRESS - setting up resources to start continuous export.
    --
    -- -   START_FAILED - an error occurred setting up continuous export. To
    --     recover, call start-continuous-export again.
    --
    -- -   ACTIVE - data is being exported to the customer bucket.
    --
    -- -   ERROR - an error occurred during export. To fix the issue, call
    --     stop-continuous-export and start-continuous-export.
    --
    -- -   STOP_IN_PROGRESS - stopping the export.
    --
    -- -   STOP_FAILED - an error occurred stopping the export. To recover,
    --     call stop-continuous-export again.
    --
    -- -   INACTIVE - the continuous export has been stopped. Data is no longer
    --     being exported to the customer bucket.
    ContinuousExportDescription -> Maybe ContinuousExportStatus
status :: Prelude.Maybe ContinuousExportStatus,
    -- | Contains information about any errors that have occurred. This data type
    -- can have the following values:
    --
    -- -   ACCESS_DENIED - You don’t have permission to start Data Exploration
    --     in Amazon Athena. Contact your Amazon Web Services administrator for
    --     help. For more information, see
    --     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html Setting Up Amazon Web Services Application Discovery Service>
    --     in the Application Discovery Service User Guide.
    --
    -- -   DELIVERY_STREAM_LIMIT_FAILURE - You reached the limit for Amazon
    --     Kinesis Data Firehose delivery streams. Reduce the number of streams
    --     or request a limit increase and try again. For more information, see
    --     <http://docs.aws.amazon.com/streams/latest/dev/service-sizes-and-limits.html Kinesis Data Streams Limits>
    --     in the Amazon Kinesis Data Streams Developer Guide.
    --
    -- -   FIREHOSE_ROLE_MISSING - The Data Exploration feature is in an error
    --     state because your IAM User is missing the
    --     AWSApplicationDiscoveryServiceFirehose role. Turn on Data
    --     Exploration in Amazon Athena and try again. For more information,
    --     see
    --     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html#setting-up-user-policy Step 3: Provide Application Discovery Service Access to Non-Administrator Users by Attaching Policies>
    --     in the Application Discovery Service User Guide.
    --
    -- -   FIREHOSE_STREAM_DOES_NOT_EXIST - The Data Exploration feature is in
    --     an error state because your IAM User is missing one or more of the
    --     Kinesis data delivery streams.
    --
    -- -   INTERNAL_FAILURE - The Data Exploration feature is in an error state
    --     because of an internal failure. Try again later. If this problem
    --     persists, contact Amazon Web Services Support.
    --
    -- -   LAKE_FORMATION_ACCESS_DENIED - You don\'t have sufficient lake
    --     formation permissions to start continuous export. For more
    --     information, see
    --     <http://docs.aws.amazon.com/lake-formation/latest/dg/upgrade-glue-lake-formation.html Upgrading Amazon Web Services Glue Data Permissions to the Amazon Web Services Lake Formation Model>
    --     in the Amazon Web Services /Lake Formation Developer Guide/.
    --
    --     You can use one of the following two ways to resolve this issue.
    --
    --     1.  If you don’t want to use the Lake Formation permission model,
    --         you can change the default Data Catalog settings to use only
    --         Amazon Web Services Identity and Access Management (IAM) access
    --         control for new databases. For more information, see
    --         <https://docs.aws.amazon.com/lake-formation/latest/dg/getting-started-setup.html#setup-change-cat-settings Change Data Catalog Settings>
    --         in the /Lake Formation Developer Guide/.
    --
    --     2.  You can give the service-linked IAM roles
    --         AWSServiceRoleForApplicationDiscoveryServiceContinuousExport and
    --         AWSApplicationDiscoveryServiceFirehose the required Lake
    --         Formation permissions. For more information, see
    --         <https://docs.aws.amazon.com/lake-formation/latest/dg/granting-database-permissions.html Granting Database Permissions>
    --         in the /Lake Formation Developer Guide/.
    --
    --         1.  AWSServiceRoleForApplicationDiscoveryServiceContinuousExport
    --             - Grant database creator permissions, which gives the role
    --             database creation ability and implicit permissions for any
    --             created tables. For more information, see
    --             <https://docs.aws.amazon.com/lake-formation/latest/dg/implicit-permissions.html Implicit Lake Formation Permissions>
    --             in the /Lake Formation Developer Guide/.
    --
    --         2.  AWSApplicationDiscoveryServiceFirehose - Grant describe
    --             permissions for all tables in the database.
    --
    -- -   S3_BUCKET_LIMIT_FAILURE - You reached the limit for Amazon S3
    --     buckets. Reduce the number of S3 buckets or request a limit increase
    --     and try again. For more information, see
    --     <http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html Bucket Restrictions and Limitations>
    --     in the Amazon Simple Storage Service Developer Guide.
    --
    -- -   S3_NOT_SIGNED_UP - Your account is not signed up for the Amazon S3
    --     service. You must sign up before you can use Amazon S3. You can sign
    --     up at the following URL: <https://aws.amazon.com/s3>.
    ContinuousExportDescription -> Maybe Text
statusDetail :: Prelude.Maybe Prelude.Text,
    -- | The timestamp that represents when this continuous export was stopped.
    ContinuousExportDescription -> Maybe POSIX
stopTime :: Prelude.Maybe Data.POSIX
  }
  deriving (ContinuousExportDescription -> ContinuousExportDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContinuousExportDescription -> ContinuousExportDescription -> Bool
$c/= :: ContinuousExportDescription -> ContinuousExportDescription -> Bool
== :: ContinuousExportDescription -> ContinuousExportDescription -> Bool
$c== :: ContinuousExportDescription -> ContinuousExportDescription -> Bool
Prelude.Eq, ReadPrec [ContinuousExportDescription]
ReadPrec ContinuousExportDescription
Int -> ReadS ContinuousExportDescription
ReadS [ContinuousExportDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContinuousExportDescription]
$creadListPrec :: ReadPrec [ContinuousExportDescription]
readPrec :: ReadPrec ContinuousExportDescription
$creadPrec :: ReadPrec ContinuousExportDescription
readList :: ReadS [ContinuousExportDescription]
$creadList :: ReadS [ContinuousExportDescription]
readsPrec :: Int -> ReadS ContinuousExportDescription
$creadsPrec :: Int -> ReadS ContinuousExportDescription
Prelude.Read, Int -> ContinuousExportDescription -> ShowS
[ContinuousExportDescription] -> ShowS
ContinuousExportDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContinuousExportDescription] -> ShowS
$cshowList :: [ContinuousExportDescription] -> ShowS
show :: ContinuousExportDescription -> String
$cshow :: ContinuousExportDescription -> String
showsPrec :: Int -> ContinuousExportDescription -> ShowS
$cshowsPrec :: Int -> ContinuousExportDescription -> ShowS
Prelude.Show, forall x.
Rep ContinuousExportDescription x -> ContinuousExportDescription
forall x.
ContinuousExportDescription -> Rep ContinuousExportDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContinuousExportDescription x -> ContinuousExportDescription
$cfrom :: forall x.
ContinuousExportDescription -> Rep ContinuousExportDescription x
Prelude.Generic)

-- |
-- Create a value of 'ContinuousExportDescription' 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:
--
-- 'dataSource', 'continuousExportDescription_dataSource' - The type of data collector used to gather this data (currently only
-- offered for AGENT).
--
-- 'exportId', 'continuousExportDescription_exportId' - The unique ID assigned to this export.
--
-- 's3Bucket', 'continuousExportDescription_s3Bucket' - The name of the s3 bucket where the export data parquet files are
-- stored.
--
-- 'schemaStorageConfig', 'continuousExportDescription_schemaStorageConfig' - An object which describes how the data is stored.
--
-- -   @databaseName@ - the name of the Glue database used to store the
--     schema.
--
-- 'startTime', 'continuousExportDescription_startTime' - The timestamp representing when the continuous export was started.
--
-- 'status', 'continuousExportDescription_status' - Describes the status of the export. Can be one of the following values:
--
-- -   START_IN_PROGRESS - setting up resources to start continuous export.
--
-- -   START_FAILED - an error occurred setting up continuous export. To
--     recover, call start-continuous-export again.
--
-- -   ACTIVE - data is being exported to the customer bucket.
--
-- -   ERROR - an error occurred during export. To fix the issue, call
--     stop-continuous-export and start-continuous-export.
--
-- -   STOP_IN_PROGRESS - stopping the export.
--
-- -   STOP_FAILED - an error occurred stopping the export. To recover,
--     call stop-continuous-export again.
--
-- -   INACTIVE - the continuous export has been stopped. Data is no longer
--     being exported to the customer bucket.
--
-- 'statusDetail', 'continuousExportDescription_statusDetail' - Contains information about any errors that have occurred. This data type
-- can have the following values:
--
-- -   ACCESS_DENIED - You don’t have permission to start Data Exploration
--     in Amazon Athena. Contact your Amazon Web Services administrator for
--     help. For more information, see
--     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html Setting Up Amazon Web Services Application Discovery Service>
--     in the Application Discovery Service User Guide.
--
-- -   DELIVERY_STREAM_LIMIT_FAILURE - You reached the limit for Amazon
--     Kinesis Data Firehose delivery streams. Reduce the number of streams
--     or request a limit increase and try again. For more information, see
--     <http://docs.aws.amazon.com/streams/latest/dev/service-sizes-and-limits.html Kinesis Data Streams Limits>
--     in the Amazon Kinesis Data Streams Developer Guide.
--
-- -   FIREHOSE_ROLE_MISSING - The Data Exploration feature is in an error
--     state because your IAM User is missing the
--     AWSApplicationDiscoveryServiceFirehose role. Turn on Data
--     Exploration in Amazon Athena and try again. For more information,
--     see
--     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html#setting-up-user-policy Step 3: Provide Application Discovery Service Access to Non-Administrator Users by Attaching Policies>
--     in the Application Discovery Service User Guide.
--
-- -   FIREHOSE_STREAM_DOES_NOT_EXIST - The Data Exploration feature is in
--     an error state because your IAM User is missing one or more of the
--     Kinesis data delivery streams.
--
-- -   INTERNAL_FAILURE - The Data Exploration feature is in an error state
--     because of an internal failure. Try again later. If this problem
--     persists, contact Amazon Web Services Support.
--
-- -   LAKE_FORMATION_ACCESS_DENIED - You don\'t have sufficient lake
--     formation permissions to start continuous export. For more
--     information, see
--     <http://docs.aws.amazon.com/lake-formation/latest/dg/upgrade-glue-lake-formation.html Upgrading Amazon Web Services Glue Data Permissions to the Amazon Web Services Lake Formation Model>
--     in the Amazon Web Services /Lake Formation Developer Guide/.
--
--     You can use one of the following two ways to resolve this issue.
--
--     1.  If you don’t want to use the Lake Formation permission model,
--         you can change the default Data Catalog settings to use only
--         Amazon Web Services Identity and Access Management (IAM) access
--         control for new databases. For more information, see
--         <https://docs.aws.amazon.com/lake-formation/latest/dg/getting-started-setup.html#setup-change-cat-settings Change Data Catalog Settings>
--         in the /Lake Formation Developer Guide/.
--
--     2.  You can give the service-linked IAM roles
--         AWSServiceRoleForApplicationDiscoveryServiceContinuousExport and
--         AWSApplicationDiscoveryServiceFirehose the required Lake
--         Formation permissions. For more information, see
--         <https://docs.aws.amazon.com/lake-formation/latest/dg/granting-database-permissions.html Granting Database Permissions>
--         in the /Lake Formation Developer Guide/.
--
--         1.  AWSServiceRoleForApplicationDiscoveryServiceContinuousExport
--             - Grant database creator permissions, which gives the role
--             database creation ability and implicit permissions for any
--             created tables. For more information, see
--             <https://docs.aws.amazon.com/lake-formation/latest/dg/implicit-permissions.html Implicit Lake Formation Permissions>
--             in the /Lake Formation Developer Guide/.
--
--         2.  AWSApplicationDiscoveryServiceFirehose - Grant describe
--             permissions for all tables in the database.
--
-- -   S3_BUCKET_LIMIT_FAILURE - You reached the limit for Amazon S3
--     buckets. Reduce the number of S3 buckets or request a limit increase
--     and try again. For more information, see
--     <http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html Bucket Restrictions and Limitations>
--     in the Amazon Simple Storage Service Developer Guide.
--
-- -   S3_NOT_SIGNED_UP - Your account is not signed up for the Amazon S3
--     service. You must sign up before you can use Amazon S3. You can sign
--     up at the following URL: <https://aws.amazon.com/s3>.
--
-- 'stopTime', 'continuousExportDescription_stopTime' - The timestamp that represents when this continuous export was stopped.
newContinuousExportDescription ::
  ContinuousExportDescription
newContinuousExportDescription :: ContinuousExportDescription
newContinuousExportDescription =
  ContinuousExportDescription'
    { $sel:dataSource:ContinuousExportDescription' :: Maybe DataSource
dataSource =
        forall a. Maybe a
Prelude.Nothing,
      $sel:exportId:ContinuousExportDescription' :: Maybe Text
exportId = forall a. Maybe a
Prelude.Nothing,
      $sel:s3Bucket:ContinuousExportDescription' :: Maybe Text
s3Bucket = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaStorageConfig:ContinuousExportDescription' :: Maybe (HashMap Text Text)
schemaStorageConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:ContinuousExportDescription' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ContinuousExportDescription' :: Maybe ContinuousExportStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetail:ContinuousExportDescription' :: Maybe Text
statusDetail = forall a. Maybe a
Prelude.Nothing,
      $sel:stopTime:ContinuousExportDescription' :: Maybe POSIX
stopTime = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of data collector used to gather this data (currently only
-- offered for AGENT).
continuousExportDescription_dataSource :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe DataSource)
continuousExportDescription_dataSource :: Lens' ContinuousExportDescription (Maybe DataSource)
continuousExportDescription_dataSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousExportDescription' {Maybe DataSource
dataSource :: Maybe DataSource
$sel:dataSource:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe DataSource
dataSource} -> Maybe DataSource
dataSource) (\s :: ContinuousExportDescription
s@ContinuousExportDescription' {} Maybe DataSource
a -> ContinuousExportDescription
s {$sel:dataSource:ContinuousExportDescription' :: Maybe DataSource
dataSource = Maybe DataSource
a} :: ContinuousExportDescription)

-- | The unique ID assigned to this export.
continuousExportDescription_exportId :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe Prelude.Text)
continuousExportDescription_exportId :: Lens' ContinuousExportDescription (Maybe Text)
continuousExportDescription_exportId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousExportDescription' {Maybe Text
exportId :: Maybe Text
$sel:exportId:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
exportId} -> Maybe Text
exportId) (\s :: ContinuousExportDescription
s@ContinuousExportDescription' {} Maybe Text
a -> ContinuousExportDescription
s {$sel:exportId:ContinuousExportDescription' :: Maybe Text
exportId = Maybe Text
a} :: ContinuousExportDescription)

-- | The name of the s3 bucket where the export data parquet files are
-- stored.
continuousExportDescription_s3Bucket :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe Prelude.Text)
continuousExportDescription_s3Bucket :: Lens' ContinuousExportDescription (Maybe Text)
continuousExportDescription_s3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousExportDescription' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: ContinuousExportDescription
s@ContinuousExportDescription' {} Maybe Text
a -> ContinuousExportDescription
s {$sel:s3Bucket:ContinuousExportDescription' :: Maybe Text
s3Bucket = Maybe Text
a} :: ContinuousExportDescription)

-- | An object which describes how the data is stored.
--
-- -   @databaseName@ - the name of the Glue database used to store the
--     schema.
continuousExportDescription_schemaStorageConfig :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
continuousExportDescription_schemaStorageConfig :: Lens' ContinuousExportDescription (Maybe (HashMap Text Text))
continuousExportDescription_schemaStorageConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousExportDescription' {Maybe (HashMap Text Text)
schemaStorageConfig :: Maybe (HashMap Text Text)
$sel:schemaStorageConfig:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe (HashMap Text Text)
schemaStorageConfig} -> Maybe (HashMap Text Text)
schemaStorageConfig) (\s :: ContinuousExportDescription
s@ContinuousExportDescription' {} Maybe (HashMap Text Text)
a -> ContinuousExportDescription
s {$sel:schemaStorageConfig:ContinuousExportDescription' :: Maybe (HashMap Text Text)
schemaStorageConfig = Maybe (HashMap Text Text)
a} :: ContinuousExportDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The timestamp representing when the continuous export was started.
continuousExportDescription_startTime :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe Prelude.UTCTime)
continuousExportDescription_startTime :: Lens' ContinuousExportDescription (Maybe UTCTime)
continuousExportDescription_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousExportDescription' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: ContinuousExportDescription
s@ContinuousExportDescription' {} Maybe POSIX
a -> ContinuousExportDescription
s {$sel:startTime:ContinuousExportDescription' :: Maybe POSIX
startTime = Maybe POSIX
a} :: ContinuousExportDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Describes the status of the export. Can be one of the following values:
--
-- -   START_IN_PROGRESS - setting up resources to start continuous export.
--
-- -   START_FAILED - an error occurred setting up continuous export. To
--     recover, call start-continuous-export again.
--
-- -   ACTIVE - data is being exported to the customer bucket.
--
-- -   ERROR - an error occurred during export. To fix the issue, call
--     stop-continuous-export and start-continuous-export.
--
-- -   STOP_IN_PROGRESS - stopping the export.
--
-- -   STOP_FAILED - an error occurred stopping the export. To recover,
--     call stop-continuous-export again.
--
-- -   INACTIVE - the continuous export has been stopped. Data is no longer
--     being exported to the customer bucket.
continuousExportDescription_status :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe ContinuousExportStatus)
continuousExportDescription_status :: Lens' ContinuousExportDescription (Maybe ContinuousExportStatus)
continuousExportDescription_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousExportDescription' {Maybe ContinuousExportStatus
status :: Maybe ContinuousExportStatus
$sel:status:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe ContinuousExportStatus
status} -> Maybe ContinuousExportStatus
status) (\s :: ContinuousExportDescription
s@ContinuousExportDescription' {} Maybe ContinuousExportStatus
a -> ContinuousExportDescription
s {$sel:status:ContinuousExportDescription' :: Maybe ContinuousExportStatus
status = Maybe ContinuousExportStatus
a} :: ContinuousExportDescription)

-- | Contains information about any errors that have occurred. This data type
-- can have the following values:
--
-- -   ACCESS_DENIED - You don’t have permission to start Data Exploration
--     in Amazon Athena. Contact your Amazon Web Services administrator for
--     help. For more information, see
--     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html Setting Up Amazon Web Services Application Discovery Service>
--     in the Application Discovery Service User Guide.
--
-- -   DELIVERY_STREAM_LIMIT_FAILURE - You reached the limit for Amazon
--     Kinesis Data Firehose delivery streams. Reduce the number of streams
--     or request a limit increase and try again. For more information, see
--     <http://docs.aws.amazon.com/streams/latest/dev/service-sizes-and-limits.html Kinesis Data Streams Limits>
--     in the Amazon Kinesis Data Streams Developer Guide.
--
-- -   FIREHOSE_ROLE_MISSING - The Data Exploration feature is in an error
--     state because your IAM User is missing the
--     AWSApplicationDiscoveryServiceFirehose role. Turn on Data
--     Exploration in Amazon Athena and try again. For more information,
--     see
--     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html#setting-up-user-policy Step 3: Provide Application Discovery Service Access to Non-Administrator Users by Attaching Policies>
--     in the Application Discovery Service User Guide.
--
-- -   FIREHOSE_STREAM_DOES_NOT_EXIST - The Data Exploration feature is in
--     an error state because your IAM User is missing one or more of the
--     Kinesis data delivery streams.
--
-- -   INTERNAL_FAILURE - The Data Exploration feature is in an error state
--     because of an internal failure. Try again later. If this problem
--     persists, contact Amazon Web Services Support.
--
-- -   LAKE_FORMATION_ACCESS_DENIED - You don\'t have sufficient lake
--     formation permissions to start continuous export. For more
--     information, see
--     <http://docs.aws.amazon.com/lake-formation/latest/dg/upgrade-glue-lake-formation.html Upgrading Amazon Web Services Glue Data Permissions to the Amazon Web Services Lake Formation Model>
--     in the Amazon Web Services /Lake Formation Developer Guide/.
--
--     You can use one of the following two ways to resolve this issue.
--
--     1.  If you don’t want to use the Lake Formation permission model,
--         you can change the default Data Catalog settings to use only
--         Amazon Web Services Identity and Access Management (IAM) access
--         control for new databases. For more information, see
--         <https://docs.aws.amazon.com/lake-formation/latest/dg/getting-started-setup.html#setup-change-cat-settings Change Data Catalog Settings>
--         in the /Lake Formation Developer Guide/.
--
--     2.  You can give the service-linked IAM roles
--         AWSServiceRoleForApplicationDiscoveryServiceContinuousExport and
--         AWSApplicationDiscoveryServiceFirehose the required Lake
--         Formation permissions. For more information, see
--         <https://docs.aws.amazon.com/lake-formation/latest/dg/granting-database-permissions.html Granting Database Permissions>
--         in the /Lake Formation Developer Guide/.
--
--         1.  AWSServiceRoleForApplicationDiscoveryServiceContinuousExport
--             - Grant database creator permissions, which gives the role
--             database creation ability and implicit permissions for any
--             created tables. For more information, see
--             <https://docs.aws.amazon.com/lake-formation/latest/dg/implicit-permissions.html Implicit Lake Formation Permissions>
--             in the /Lake Formation Developer Guide/.
--
--         2.  AWSApplicationDiscoveryServiceFirehose - Grant describe
--             permissions for all tables in the database.
--
-- -   S3_BUCKET_LIMIT_FAILURE - You reached the limit for Amazon S3
--     buckets. Reduce the number of S3 buckets or request a limit increase
--     and try again. For more information, see
--     <http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html Bucket Restrictions and Limitations>
--     in the Amazon Simple Storage Service Developer Guide.
--
-- -   S3_NOT_SIGNED_UP - Your account is not signed up for the Amazon S3
--     service. You must sign up before you can use Amazon S3. You can sign
--     up at the following URL: <https://aws.amazon.com/s3>.
continuousExportDescription_statusDetail :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe Prelude.Text)
continuousExportDescription_statusDetail :: Lens' ContinuousExportDescription (Maybe Text)
continuousExportDescription_statusDetail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousExportDescription' {Maybe Text
statusDetail :: Maybe Text
$sel:statusDetail:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
statusDetail} -> Maybe Text
statusDetail) (\s :: ContinuousExportDescription
s@ContinuousExportDescription' {} Maybe Text
a -> ContinuousExportDescription
s {$sel:statusDetail:ContinuousExportDescription' :: Maybe Text
statusDetail = Maybe Text
a} :: ContinuousExportDescription)

-- | The timestamp that represents when this continuous export was stopped.
continuousExportDescription_stopTime :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe Prelude.UTCTime)
continuousExportDescription_stopTime :: Lens' ContinuousExportDescription (Maybe UTCTime)
continuousExportDescription_stopTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousExportDescription' {Maybe POSIX
stopTime :: Maybe POSIX
$sel:stopTime:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe POSIX
stopTime} -> Maybe POSIX
stopTime) (\s :: ContinuousExportDescription
s@ContinuousExportDescription' {} Maybe POSIX
a -> ContinuousExportDescription
s {$sel:stopTime:ContinuousExportDescription' :: Maybe POSIX
stopTime = Maybe POSIX
a} :: ContinuousExportDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON ContinuousExportDescription where
  parseJSON :: Value -> Parser ContinuousExportDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContinuousExportDescription"
      ( \Object
x ->
          Maybe DataSource
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe POSIX
-> Maybe ContinuousExportStatus
-> Maybe Text
-> Maybe POSIX
-> ContinuousExportDescription
ContinuousExportDescription'
            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
"dataSource")
            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
"exportId")
            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
"s3Bucket")
            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
"schemaStorageConfig"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"startTime")
            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
"status")
            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
"statusDetail")
            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
"stopTime")
      )

instance Prelude.Hashable ContinuousExportDescription where
  hashWithSalt :: Int -> ContinuousExportDescription -> Int
hashWithSalt Int
_salt ContinuousExportDescription' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe ContinuousExportStatus
Maybe DataSource
stopTime :: Maybe POSIX
statusDetail :: Maybe Text
status :: Maybe ContinuousExportStatus
startTime :: Maybe POSIX
schemaStorageConfig :: Maybe (HashMap Text Text)
s3Bucket :: Maybe Text
exportId :: Maybe Text
dataSource :: Maybe DataSource
$sel:stopTime:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe POSIX
$sel:statusDetail:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
$sel:status:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe ContinuousExportStatus
$sel:startTime:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe POSIX
$sel:schemaStorageConfig:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe (HashMap Text Text)
$sel:s3Bucket:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
$sel:exportId:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
$sel:dataSource:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe DataSource
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataSource
dataSource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
exportId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
schemaStorageConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContinuousExportStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusDetail
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
stopTime

instance Prelude.NFData ContinuousExportDescription where
  rnf :: ContinuousExportDescription -> ()
rnf ContinuousExportDescription' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe ContinuousExportStatus
Maybe DataSource
stopTime :: Maybe POSIX
statusDetail :: Maybe Text
status :: Maybe ContinuousExportStatus
startTime :: Maybe POSIX
schemaStorageConfig :: Maybe (HashMap Text Text)
s3Bucket :: Maybe Text
exportId :: Maybe Text
dataSource :: Maybe DataSource
$sel:stopTime:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe POSIX
$sel:statusDetail:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
$sel:status:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe ContinuousExportStatus
$sel:startTime:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe POSIX
$sel:schemaStorageConfig:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe (HashMap Text Text)
$sel:s3Bucket:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
$sel:exportId:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe Text
$sel:dataSource:ContinuousExportDescription' :: ContinuousExportDescription -> Maybe DataSource
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe DataSource
dataSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
exportId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
schemaStorageConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContinuousExportStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusDetail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
stopTime