{-# 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.KinesisAnalyticsV2.Types.FlinkApplicationConfigurationDescription
-- 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.KinesisAnalyticsV2.Types.FlinkApplicationConfigurationDescription where

import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.CheckpointConfigurationDescription
import Amazonka.KinesisAnalyticsV2.Types.MonitoringConfigurationDescription
import Amazonka.KinesisAnalyticsV2.Types.ParallelismConfigurationDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes configuration parameters for a Flink-based Kinesis Data
-- Analytics application.
--
-- /See:/ 'newFlinkApplicationConfigurationDescription' smart constructor.
data FlinkApplicationConfigurationDescription = FlinkApplicationConfigurationDescription'
  { -- | Describes configuration parameters for Amazon CloudWatch logging for an
    -- application.
    FlinkApplicationConfigurationDescription
-> Maybe MonitoringConfigurationDescription
monitoringConfigurationDescription :: Prelude.Maybe MonitoringConfigurationDescription,
    -- | Describes parameters for how an application executes multiple tasks
    -- simultaneously.
    FlinkApplicationConfigurationDescription
-> Maybe ParallelismConfigurationDescription
parallelismConfigurationDescription :: Prelude.Maybe ParallelismConfigurationDescription,
    -- | Describes an application\'s checkpointing configuration. Checkpointing
    -- is the process of persisting application state for fault tolerance.
    FlinkApplicationConfigurationDescription
-> Maybe CheckpointConfigurationDescription
checkpointConfigurationDescription :: Prelude.Maybe CheckpointConfigurationDescription,
    -- | The job plan for an application. For more information about the job
    -- plan, see
    -- <https://ci.apache.org/projects/flink/flink-docs-release-1.8/internals/job_scheduling.html Jobs and Scheduling>
    -- in the
    -- <https://ci.apache.org/projects/flink/flink-docs-release-1.8/ Apache Flink Documentation>.
    -- To retrieve the job plan for the application, use the
    -- DescribeApplicationRequest$IncludeAdditionalDetails parameter of the
    -- DescribeApplication operation.
    FlinkApplicationConfigurationDescription -> Maybe Text
jobPlanDescription :: Prelude.Maybe Prelude.Text
  }
  deriving (FlinkApplicationConfigurationDescription
-> FlinkApplicationConfigurationDescription -> Bool
(FlinkApplicationConfigurationDescription
 -> FlinkApplicationConfigurationDescription -> Bool)
-> (FlinkApplicationConfigurationDescription
    -> FlinkApplicationConfigurationDescription -> Bool)
-> Eq FlinkApplicationConfigurationDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FlinkApplicationConfigurationDescription
-> FlinkApplicationConfigurationDescription -> Bool
$c/= :: FlinkApplicationConfigurationDescription
-> FlinkApplicationConfigurationDescription -> Bool
== :: FlinkApplicationConfigurationDescription
-> FlinkApplicationConfigurationDescription -> Bool
$c== :: FlinkApplicationConfigurationDescription
-> FlinkApplicationConfigurationDescription -> Bool
Prelude.Eq, ReadPrec [FlinkApplicationConfigurationDescription]
ReadPrec FlinkApplicationConfigurationDescription
Int -> ReadS FlinkApplicationConfigurationDescription
ReadS [FlinkApplicationConfigurationDescription]
(Int -> ReadS FlinkApplicationConfigurationDescription)
-> ReadS [FlinkApplicationConfigurationDescription]
-> ReadPrec FlinkApplicationConfigurationDescription
-> ReadPrec [FlinkApplicationConfigurationDescription]
-> Read FlinkApplicationConfigurationDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FlinkApplicationConfigurationDescription]
$creadListPrec :: ReadPrec [FlinkApplicationConfigurationDescription]
readPrec :: ReadPrec FlinkApplicationConfigurationDescription
$creadPrec :: ReadPrec FlinkApplicationConfigurationDescription
readList :: ReadS [FlinkApplicationConfigurationDescription]
$creadList :: ReadS [FlinkApplicationConfigurationDescription]
readsPrec :: Int -> ReadS FlinkApplicationConfigurationDescription
$creadsPrec :: Int -> ReadS FlinkApplicationConfigurationDescription
Prelude.Read, Int -> FlinkApplicationConfigurationDescription -> ShowS
[FlinkApplicationConfigurationDescription] -> ShowS
FlinkApplicationConfigurationDescription -> String
(Int -> FlinkApplicationConfigurationDescription -> ShowS)
-> (FlinkApplicationConfigurationDescription -> String)
-> ([FlinkApplicationConfigurationDescription] -> ShowS)
-> Show FlinkApplicationConfigurationDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FlinkApplicationConfigurationDescription] -> ShowS
$cshowList :: [FlinkApplicationConfigurationDescription] -> ShowS
show :: FlinkApplicationConfigurationDescription -> String
$cshow :: FlinkApplicationConfigurationDescription -> String
showsPrec :: Int -> FlinkApplicationConfigurationDescription -> ShowS
$cshowsPrec :: Int -> FlinkApplicationConfigurationDescription -> ShowS
Prelude.Show, (forall x.
 FlinkApplicationConfigurationDescription
 -> Rep FlinkApplicationConfigurationDescription x)
-> (forall x.
    Rep FlinkApplicationConfigurationDescription x
    -> FlinkApplicationConfigurationDescription)
-> Generic FlinkApplicationConfigurationDescription
forall x.
Rep FlinkApplicationConfigurationDescription x
-> FlinkApplicationConfigurationDescription
forall x.
FlinkApplicationConfigurationDescription
-> Rep FlinkApplicationConfigurationDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FlinkApplicationConfigurationDescription x
-> FlinkApplicationConfigurationDescription
$cfrom :: forall x.
FlinkApplicationConfigurationDescription
-> Rep FlinkApplicationConfigurationDescription x
Prelude.Generic)

-- |
-- Create a value of 'FlinkApplicationConfigurationDescription' 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:
--
-- 'monitoringConfigurationDescription', 'flinkApplicationConfigurationDescription_monitoringConfigurationDescription' - Describes configuration parameters for Amazon CloudWatch logging for an
-- application.
--
-- 'parallelismConfigurationDescription', 'flinkApplicationConfigurationDescription_parallelismConfigurationDescription' - Describes parameters for how an application executes multiple tasks
-- simultaneously.
--
-- 'checkpointConfigurationDescription', 'flinkApplicationConfigurationDescription_checkpointConfigurationDescription' - Describes an application\'s checkpointing configuration. Checkpointing
-- is the process of persisting application state for fault tolerance.
--
-- 'jobPlanDescription', 'flinkApplicationConfigurationDescription_jobPlanDescription' - The job plan for an application. For more information about the job
-- plan, see
-- <https://ci.apache.org/projects/flink/flink-docs-release-1.8/internals/job_scheduling.html Jobs and Scheduling>
-- in the
-- <https://ci.apache.org/projects/flink/flink-docs-release-1.8/ Apache Flink Documentation>.
-- To retrieve the job plan for the application, use the
-- DescribeApplicationRequest$IncludeAdditionalDetails parameter of the
-- DescribeApplication operation.
newFlinkApplicationConfigurationDescription ::
  FlinkApplicationConfigurationDescription
newFlinkApplicationConfigurationDescription :: FlinkApplicationConfigurationDescription
newFlinkApplicationConfigurationDescription =
  FlinkApplicationConfigurationDescription' :: Maybe MonitoringConfigurationDescription
-> Maybe ParallelismConfigurationDescription
-> Maybe CheckpointConfigurationDescription
-> Maybe Text
-> FlinkApplicationConfigurationDescription
FlinkApplicationConfigurationDescription'
    { $sel:monitoringConfigurationDescription:FlinkApplicationConfigurationDescription' :: Maybe MonitoringConfigurationDescription
monitoringConfigurationDescription =
        Maybe MonitoringConfigurationDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:parallelismConfigurationDescription:FlinkApplicationConfigurationDescription' :: Maybe ParallelismConfigurationDescription
parallelismConfigurationDescription =
        Maybe ParallelismConfigurationDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:checkpointConfigurationDescription:FlinkApplicationConfigurationDescription' :: Maybe CheckpointConfigurationDescription
checkpointConfigurationDescription =
        Maybe CheckpointConfigurationDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:jobPlanDescription:FlinkApplicationConfigurationDescription' :: Maybe Text
jobPlanDescription =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Describes configuration parameters for Amazon CloudWatch logging for an
-- application.
flinkApplicationConfigurationDescription_monitoringConfigurationDescription :: Lens.Lens' FlinkApplicationConfigurationDescription (Prelude.Maybe MonitoringConfigurationDescription)
flinkApplicationConfigurationDescription_monitoringConfigurationDescription :: (Maybe MonitoringConfigurationDescription
 -> f (Maybe MonitoringConfigurationDescription))
-> FlinkApplicationConfigurationDescription
-> f FlinkApplicationConfigurationDescription
flinkApplicationConfigurationDescription_monitoringConfigurationDescription = (FlinkApplicationConfigurationDescription
 -> Maybe MonitoringConfigurationDescription)
-> (FlinkApplicationConfigurationDescription
    -> Maybe MonitoringConfigurationDescription
    -> FlinkApplicationConfigurationDescription)
-> Lens
     FlinkApplicationConfigurationDescription
     FlinkApplicationConfigurationDescription
     (Maybe MonitoringConfigurationDescription)
     (Maybe MonitoringConfigurationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlinkApplicationConfigurationDescription' {Maybe MonitoringConfigurationDescription
monitoringConfigurationDescription :: Maybe MonitoringConfigurationDescription
$sel:monitoringConfigurationDescription:FlinkApplicationConfigurationDescription' :: FlinkApplicationConfigurationDescription
-> Maybe MonitoringConfigurationDescription
monitoringConfigurationDescription} -> Maybe MonitoringConfigurationDescription
monitoringConfigurationDescription) (\s :: FlinkApplicationConfigurationDescription
s@FlinkApplicationConfigurationDescription' {} Maybe MonitoringConfigurationDescription
a -> FlinkApplicationConfigurationDescription
s {$sel:monitoringConfigurationDescription:FlinkApplicationConfigurationDescription' :: Maybe MonitoringConfigurationDescription
monitoringConfigurationDescription = Maybe MonitoringConfigurationDescription
a} :: FlinkApplicationConfigurationDescription)

-- | Describes parameters for how an application executes multiple tasks
-- simultaneously.
flinkApplicationConfigurationDescription_parallelismConfigurationDescription :: Lens.Lens' FlinkApplicationConfigurationDescription (Prelude.Maybe ParallelismConfigurationDescription)
flinkApplicationConfigurationDescription_parallelismConfigurationDescription :: (Maybe ParallelismConfigurationDescription
 -> f (Maybe ParallelismConfigurationDescription))
-> FlinkApplicationConfigurationDescription
-> f FlinkApplicationConfigurationDescription
flinkApplicationConfigurationDescription_parallelismConfigurationDescription = (FlinkApplicationConfigurationDescription
 -> Maybe ParallelismConfigurationDescription)
-> (FlinkApplicationConfigurationDescription
    -> Maybe ParallelismConfigurationDescription
    -> FlinkApplicationConfigurationDescription)
-> Lens
     FlinkApplicationConfigurationDescription
     FlinkApplicationConfigurationDescription
     (Maybe ParallelismConfigurationDescription)
     (Maybe ParallelismConfigurationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlinkApplicationConfigurationDescription' {Maybe ParallelismConfigurationDescription
parallelismConfigurationDescription :: Maybe ParallelismConfigurationDescription
$sel:parallelismConfigurationDescription:FlinkApplicationConfigurationDescription' :: FlinkApplicationConfigurationDescription
-> Maybe ParallelismConfigurationDescription
parallelismConfigurationDescription} -> Maybe ParallelismConfigurationDescription
parallelismConfigurationDescription) (\s :: FlinkApplicationConfigurationDescription
s@FlinkApplicationConfigurationDescription' {} Maybe ParallelismConfigurationDescription
a -> FlinkApplicationConfigurationDescription
s {$sel:parallelismConfigurationDescription:FlinkApplicationConfigurationDescription' :: Maybe ParallelismConfigurationDescription
parallelismConfigurationDescription = Maybe ParallelismConfigurationDescription
a} :: FlinkApplicationConfigurationDescription)

-- | Describes an application\'s checkpointing configuration. Checkpointing
-- is the process of persisting application state for fault tolerance.
flinkApplicationConfigurationDescription_checkpointConfigurationDescription :: Lens.Lens' FlinkApplicationConfigurationDescription (Prelude.Maybe CheckpointConfigurationDescription)
flinkApplicationConfigurationDescription_checkpointConfigurationDescription :: (Maybe CheckpointConfigurationDescription
 -> f (Maybe CheckpointConfigurationDescription))
-> FlinkApplicationConfigurationDescription
-> f FlinkApplicationConfigurationDescription
flinkApplicationConfigurationDescription_checkpointConfigurationDescription = (FlinkApplicationConfigurationDescription
 -> Maybe CheckpointConfigurationDescription)
-> (FlinkApplicationConfigurationDescription
    -> Maybe CheckpointConfigurationDescription
    -> FlinkApplicationConfigurationDescription)
-> Lens
     FlinkApplicationConfigurationDescription
     FlinkApplicationConfigurationDescription
     (Maybe CheckpointConfigurationDescription)
     (Maybe CheckpointConfigurationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlinkApplicationConfigurationDescription' {Maybe CheckpointConfigurationDescription
checkpointConfigurationDescription :: Maybe CheckpointConfigurationDescription
$sel:checkpointConfigurationDescription:FlinkApplicationConfigurationDescription' :: FlinkApplicationConfigurationDescription
-> Maybe CheckpointConfigurationDescription
checkpointConfigurationDescription} -> Maybe CheckpointConfigurationDescription
checkpointConfigurationDescription) (\s :: FlinkApplicationConfigurationDescription
s@FlinkApplicationConfigurationDescription' {} Maybe CheckpointConfigurationDescription
a -> FlinkApplicationConfigurationDescription
s {$sel:checkpointConfigurationDescription:FlinkApplicationConfigurationDescription' :: Maybe CheckpointConfigurationDescription
checkpointConfigurationDescription = Maybe CheckpointConfigurationDescription
a} :: FlinkApplicationConfigurationDescription)

-- | The job plan for an application. For more information about the job
-- plan, see
-- <https://ci.apache.org/projects/flink/flink-docs-release-1.8/internals/job_scheduling.html Jobs and Scheduling>
-- in the
-- <https://ci.apache.org/projects/flink/flink-docs-release-1.8/ Apache Flink Documentation>.
-- To retrieve the job plan for the application, use the
-- DescribeApplicationRequest$IncludeAdditionalDetails parameter of the
-- DescribeApplication operation.
flinkApplicationConfigurationDescription_jobPlanDescription :: Lens.Lens' FlinkApplicationConfigurationDescription (Prelude.Maybe Prelude.Text)
flinkApplicationConfigurationDescription_jobPlanDescription :: (Maybe Text -> f (Maybe Text))
-> FlinkApplicationConfigurationDescription
-> f FlinkApplicationConfigurationDescription
flinkApplicationConfigurationDescription_jobPlanDescription = (FlinkApplicationConfigurationDescription -> Maybe Text)
-> (FlinkApplicationConfigurationDescription
    -> Maybe Text -> FlinkApplicationConfigurationDescription)
-> Lens
     FlinkApplicationConfigurationDescription
     FlinkApplicationConfigurationDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlinkApplicationConfigurationDescription' {Maybe Text
jobPlanDescription :: Maybe Text
$sel:jobPlanDescription:FlinkApplicationConfigurationDescription' :: FlinkApplicationConfigurationDescription -> Maybe Text
jobPlanDescription} -> Maybe Text
jobPlanDescription) (\s :: FlinkApplicationConfigurationDescription
s@FlinkApplicationConfigurationDescription' {} Maybe Text
a -> FlinkApplicationConfigurationDescription
s {$sel:jobPlanDescription:FlinkApplicationConfigurationDescription' :: Maybe Text
jobPlanDescription = Maybe Text
a} :: FlinkApplicationConfigurationDescription)

instance
  Core.FromJSON
    FlinkApplicationConfigurationDescription
  where
  parseJSON :: Value -> Parser FlinkApplicationConfigurationDescription
parseJSON =
    String
-> (Object -> Parser FlinkApplicationConfigurationDescription)
-> Value
-> Parser FlinkApplicationConfigurationDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FlinkApplicationConfigurationDescription"
      ( \Object
x ->
          Maybe MonitoringConfigurationDescription
-> Maybe ParallelismConfigurationDescription
-> Maybe CheckpointConfigurationDescription
-> Maybe Text
-> FlinkApplicationConfigurationDescription
FlinkApplicationConfigurationDescription'
            (Maybe MonitoringConfigurationDescription
 -> Maybe ParallelismConfigurationDescription
 -> Maybe CheckpointConfigurationDescription
 -> Maybe Text
 -> FlinkApplicationConfigurationDescription)
-> Parser (Maybe MonitoringConfigurationDescription)
-> Parser
     (Maybe ParallelismConfigurationDescription
      -> Maybe CheckpointConfigurationDescription
      -> Maybe Text
      -> FlinkApplicationConfigurationDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MonitoringConfigurationDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MonitoringConfigurationDescription")
            Parser
  (Maybe ParallelismConfigurationDescription
   -> Maybe CheckpointConfigurationDescription
   -> Maybe Text
   -> FlinkApplicationConfigurationDescription)
-> Parser (Maybe ParallelismConfigurationDescription)
-> Parser
     (Maybe CheckpointConfigurationDescription
      -> Maybe Text -> FlinkApplicationConfigurationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe ParallelismConfigurationDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParallelismConfigurationDescription")
            Parser
  (Maybe CheckpointConfigurationDescription
   -> Maybe Text -> FlinkApplicationConfigurationDescription)
-> Parser (Maybe CheckpointConfigurationDescription)
-> Parser (Maybe Text -> FlinkApplicationConfigurationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CheckpointConfigurationDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CheckpointConfigurationDescription")
            Parser (Maybe Text -> FlinkApplicationConfigurationDescription)
-> Parser (Maybe Text)
-> Parser FlinkApplicationConfigurationDescription
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
"JobPlanDescription")
      )

instance
  Prelude.Hashable
    FlinkApplicationConfigurationDescription

instance
  Prelude.NFData
    FlinkApplicationConfigurationDescription