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

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

-- | A list of continuous export descriptions.
--
-- /See:/ 'newContinuousExportDescription' smart constructor.
data ContinuousExportDescription = ContinuousExportDescription'
  { -- | 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,
    -- | The timestamp representing when the continuous export was started.
    ContinuousExportDescription -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | 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),
    -- | 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 AWS administrator for help. For more
    --     information, see
    --     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html Setting Up AWS 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 AWS Support.
    --
    -- -   S3_BUCKET_LIMIT_FAILURE - You reached the limit for Amazon S3
    --     buckets. Reduce the number of Amazon 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 Core.POSIX,
    -- | The type of data collector used to gather this data (currently only
    -- offered for AGENT).
    ContinuousExportDescription -> Maybe DataSource
dataSource :: Prelude.Maybe DataSource,
    -- | The name of the s3 bucket where the export data parquet files are
    -- stored.
    ContinuousExportDescription -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
    -- | The unique ID assigned to this export.
    ContinuousExportDescription -> Maybe Text
exportId :: Prelude.Maybe Prelude.Text
  }
  deriving (ContinuousExportDescription -> ContinuousExportDescription -> Bool
(ContinuousExportDescription
 -> ContinuousExportDescription -> Bool)
-> (ContinuousExportDescription
    -> ContinuousExportDescription -> Bool)
-> Eq ContinuousExportDescription
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]
(Int -> ReadS ContinuousExportDescription)
-> ReadS [ContinuousExportDescription]
-> ReadPrec ContinuousExportDescription
-> ReadPrec [ContinuousExportDescription]
-> Read 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
(Int -> ContinuousExportDescription -> ShowS)
-> (ContinuousExportDescription -> String)
-> ([ContinuousExportDescription] -> ShowS)
-> Show ContinuousExportDescription
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.
 ContinuousExportDescription -> Rep ContinuousExportDescription x)
-> (forall x.
    Rep ContinuousExportDescription x -> ContinuousExportDescription)
-> Generic ContinuousExportDescription
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:
--
-- '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.
--
-- 'startTime', 'continuousExportDescription_startTime' - The timestamp representing when the continuous export was started.
--
-- 'schemaStorageConfig', 'continuousExportDescription_schemaStorageConfig' - An object which describes how the data is stored.
--
-- -   @databaseName@ - the name of the Glue database used to store the
--     schema.
--
-- '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 AWS administrator for help. For more
--     information, see
--     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html Setting Up AWS 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 AWS Support.
--
-- -   S3_BUCKET_LIMIT_FAILURE - You reached the limit for Amazon S3
--     buckets. Reduce the number of Amazon 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.
--
-- 'dataSource', 'continuousExportDescription_dataSource' - The type of data collector used to gather this data (currently only
-- offered for AGENT).
--
-- 's3Bucket', 'continuousExportDescription_s3Bucket' - The name of the s3 bucket where the export data parquet files are
-- stored.
--
-- 'exportId', 'continuousExportDescription_exportId' - The unique ID assigned to this export.
newContinuousExportDescription ::
  ContinuousExportDescription
newContinuousExportDescription :: ContinuousExportDescription
newContinuousExportDescription =
  ContinuousExportDescription' :: Maybe ContinuousExportStatus
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe DataSource
-> Maybe Text
-> Maybe Text
-> ContinuousExportDescription
ContinuousExportDescription'
    { $sel:status:ContinuousExportDescription' :: Maybe ContinuousExportStatus
status =
        Maybe ContinuousExportStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:ContinuousExportDescription' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaStorageConfig:ContinuousExportDescription' :: Maybe (HashMap Text Text)
schemaStorageConfig = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:statusDetail:ContinuousExportDescription' :: Maybe Text
statusDetail = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stopTime:ContinuousExportDescription' :: Maybe POSIX
stopTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSource:ContinuousExportDescription' :: Maybe DataSource
dataSource = Maybe DataSource
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Bucket:ContinuousExportDescription' :: Maybe Text
s3Bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:exportId:ContinuousExportDescription' :: Maybe Text
exportId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe ContinuousExportStatus -> f (Maybe ContinuousExportStatus))
-> ContinuousExportDescription -> f ContinuousExportDescription
continuousExportDescription_status = (ContinuousExportDescription -> Maybe ContinuousExportStatus)
-> (ContinuousExportDescription
    -> Maybe ContinuousExportStatus -> ContinuousExportDescription)
-> Lens
     ContinuousExportDescription
     ContinuousExportDescription
     (Maybe ContinuousExportStatus)
     (Maybe ContinuousExportStatus)
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)

-- | The timestamp representing when the continuous export was started.
continuousExportDescription_startTime :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe Prelude.UTCTime)
continuousExportDescription_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ContinuousExportDescription -> f ContinuousExportDescription
continuousExportDescription_startTime = (ContinuousExportDescription -> Maybe POSIX)
-> (ContinuousExportDescription
    -> Maybe POSIX -> ContinuousExportDescription)
-> Lens
     ContinuousExportDescription
     ContinuousExportDescription
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> ContinuousExportDescription -> f ContinuousExportDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ContinuousExportDescription
-> f ContinuousExportDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ContinuousExportDescription -> f ContinuousExportDescription
continuousExportDescription_schemaStorageConfig = (ContinuousExportDescription -> Maybe (HashMap Text Text))
-> (ContinuousExportDescription
    -> Maybe (HashMap Text Text) -> ContinuousExportDescription)
-> Lens
     ContinuousExportDescription
     ContinuousExportDescription
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ContinuousExportDescription -> f ContinuousExportDescription)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ContinuousExportDescription
-> f ContinuousExportDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 AWS administrator for help. For more
--     information, see
--     <http://docs.aws.amazon.com/application-discovery/latest/userguide/setting-up.html Setting Up AWS 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 AWS Support.
--
-- -   S3_BUCKET_LIMIT_FAILURE - You reached the limit for Amazon S3
--     buckets. Reduce the number of Amazon 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 :: (Maybe Text -> f (Maybe Text))
-> ContinuousExportDescription -> f ContinuousExportDescription
continuousExportDescription_statusDetail = (ContinuousExportDescription -> Maybe Text)
-> (ContinuousExportDescription
    -> Maybe Text -> ContinuousExportDescription)
-> Lens
     ContinuousExportDescription
     ContinuousExportDescription
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ContinuousExportDescription -> f ContinuousExportDescription
continuousExportDescription_stopTime = (ContinuousExportDescription -> Maybe POSIX)
-> (ContinuousExportDescription
    -> Maybe POSIX -> ContinuousExportDescription)
-> Lens
     ContinuousExportDescription
     ContinuousExportDescription
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> ContinuousExportDescription -> f ContinuousExportDescription)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ContinuousExportDescription
-> f ContinuousExportDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | 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 :: (Maybe DataSource -> f (Maybe DataSource))
-> ContinuousExportDescription -> f ContinuousExportDescription
continuousExportDescription_dataSource = (ContinuousExportDescription -> Maybe DataSource)
-> (ContinuousExportDescription
    -> Maybe DataSource -> ContinuousExportDescription)
-> Lens
     ContinuousExportDescription
     ContinuousExportDescription
     (Maybe DataSource)
     (Maybe 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 name of the s3 bucket where the export data parquet files are
-- stored.
continuousExportDescription_s3Bucket :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe Prelude.Text)
continuousExportDescription_s3Bucket :: (Maybe Text -> f (Maybe Text))
-> ContinuousExportDescription -> f ContinuousExportDescription
continuousExportDescription_s3Bucket = (ContinuousExportDescription -> Maybe Text)
-> (ContinuousExportDescription
    -> Maybe Text -> ContinuousExportDescription)
-> Lens
     ContinuousExportDescription
     ContinuousExportDescription
     (Maybe Text)
     (Maybe Text)
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)

-- | The unique ID assigned to this export.
continuousExportDescription_exportId :: Lens.Lens' ContinuousExportDescription (Prelude.Maybe Prelude.Text)
continuousExportDescription_exportId :: (Maybe Text -> f (Maybe Text))
-> ContinuousExportDescription -> f ContinuousExportDescription
continuousExportDescription_exportId = (ContinuousExportDescription -> Maybe Text)
-> (ContinuousExportDescription
    -> Maybe Text -> ContinuousExportDescription)
-> Lens
     ContinuousExportDescription
     ContinuousExportDescription
     (Maybe Text)
     (Maybe Text)
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)

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

instance Prelude.Hashable ContinuousExportDescription

instance Prelude.NFData ContinuousExportDescription