{-# 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.RunConfigurationDescription
-- 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.RunConfigurationDescription where

import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types.ApplicationRestoreConfiguration
import Amazonka.KinesisAnalyticsV2.Types.FlinkRunConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the starting properties for a Kinesis Data Analytics
-- application.
--
-- /See:/ 'newRunConfigurationDescription' smart constructor.
data RunConfigurationDescription = RunConfigurationDescription'
  { -- | Describes the restore behavior of a restarting application.
    RunConfigurationDescription
-> Maybe ApplicationRestoreConfiguration
applicationRestoreConfigurationDescription :: Prelude.Maybe ApplicationRestoreConfiguration,
    RunConfigurationDescription -> Maybe FlinkRunConfiguration
flinkRunConfigurationDescription :: Prelude.Maybe FlinkRunConfiguration
  }
  deriving (RunConfigurationDescription -> RunConfigurationDescription -> Bool
(RunConfigurationDescription
 -> RunConfigurationDescription -> Bool)
-> (RunConfigurationDescription
    -> RunConfigurationDescription -> Bool)
-> Eq RunConfigurationDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RunConfigurationDescription -> RunConfigurationDescription -> Bool
$c/= :: RunConfigurationDescription -> RunConfigurationDescription -> Bool
== :: RunConfigurationDescription -> RunConfigurationDescription -> Bool
$c== :: RunConfigurationDescription -> RunConfigurationDescription -> Bool
Prelude.Eq, ReadPrec [RunConfigurationDescription]
ReadPrec RunConfigurationDescription
Int -> ReadS RunConfigurationDescription
ReadS [RunConfigurationDescription]
(Int -> ReadS RunConfigurationDescription)
-> ReadS [RunConfigurationDescription]
-> ReadPrec RunConfigurationDescription
-> ReadPrec [RunConfigurationDescription]
-> Read RunConfigurationDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RunConfigurationDescription]
$creadListPrec :: ReadPrec [RunConfigurationDescription]
readPrec :: ReadPrec RunConfigurationDescription
$creadPrec :: ReadPrec RunConfigurationDescription
readList :: ReadS [RunConfigurationDescription]
$creadList :: ReadS [RunConfigurationDescription]
readsPrec :: Int -> ReadS RunConfigurationDescription
$creadsPrec :: Int -> ReadS RunConfigurationDescription
Prelude.Read, Int -> RunConfigurationDescription -> ShowS
[RunConfigurationDescription] -> ShowS
RunConfigurationDescription -> String
(Int -> RunConfigurationDescription -> ShowS)
-> (RunConfigurationDescription -> String)
-> ([RunConfigurationDescription] -> ShowS)
-> Show RunConfigurationDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RunConfigurationDescription] -> ShowS
$cshowList :: [RunConfigurationDescription] -> ShowS
show :: RunConfigurationDescription -> String
$cshow :: RunConfigurationDescription -> String
showsPrec :: Int -> RunConfigurationDescription -> ShowS
$cshowsPrec :: Int -> RunConfigurationDescription -> ShowS
Prelude.Show, (forall x.
 RunConfigurationDescription -> Rep RunConfigurationDescription x)
-> (forall x.
    Rep RunConfigurationDescription x -> RunConfigurationDescription)
-> Generic RunConfigurationDescription
forall x.
Rep RunConfigurationDescription x -> RunConfigurationDescription
forall x.
RunConfigurationDescription -> Rep RunConfigurationDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RunConfigurationDescription x -> RunConfigurationDescription
$cfrom :: forall x.
RunConfigurationDescription -> Rep RunConfigurationDescription x
Prelude.Generic)

-- |
-- Create a value of 'RunConfigurationDescription' 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:
--
-- 'applicationRestoreConfigurationDescription', 'runConfigurationDescription_applicationRestoreConfigurationDescription' - Describes the restore behavior of a restarting application.
--
-- 'flinkRunConfigurationDescription', 'runConfigurationDescription_flinkRunConfigurationDescription' - Undocumented member.
newRunConfigurationDescription ::
  RunConfigurationDescription
newRunConfigurationDescription :: RunConfigurationDescription
newRunConfigurationDescription =
  RunConfigurationDescription' :: Maybe ApplicationRestoreConfiguration
-> Maybe FlinkRunConfiguration -> RunConfigurationDescription
RunConfigurationDescription'
    { $sel:applicationRestoreConfigurationDescription:RunConfigurationDescription' :: Maybe ApplicationRestoreConfiguration
applicationRestoreConfigurationDescription =
        Maybe ApplicationRestoreConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:flinkRunConfigurationDescription:RunConfigurationDescription' :: Maybe FlinkRunConfiguration
flinkRunConfigurationDescription =
        Maybe FlinkRunConfiguration
forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the restore behavior of a restarting application.
runConfigurationDescription_applicationRestoreConfigurationDescription :: Lens.Lens' RunConfigurationDescription (Prelude.Maybe ApplicationRestoreConfiguration)
runConfigurationDescription_applicationRestoreConfigurationDescription :: (Maybe ApplicationRestoreConfiguration
 -> f (Maybe ApplicationRestoreConfiguration))
-> RunConfigurationDescription -> f RunConfigurationDescription
runConfigurationDescription_applicationRestoreConfigurationDescription = (RunConfigurationDescription
 -> Maybe ApplicationRestoreConfiguration)
-> (RunConfigurationDescription
    -> Maybe ApplicationRestoreConfiguration
    -> RunConfigurationDescription)
-> Lens
     RunConfigurationDescription
     RunConfigurationDescription
     (Maybe ApplicationRestoreConfiguration)
     (Maybe ApplicationRestoreConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunConfigurationDescription' {Maybe ApplicationRestoreConfiguration
applicationRestoreConfigurationDescription :: Maybe ApplicationRestoreConfiguration
$sel:applicationRestoreConfigurationDescription:RunConfigurationDescription' :: RunConfigurationDescription
-> Maybe ApplicationRestoreConfiguration
applicationRestoreConfigurationDescription} -> Maybe ApplicationRestoreConfiguration
applicationRestoreConfigurationDescription) (\s :: RunConfigurationDescription
s@RunConfigurationDescription' {} Maybe ApplicationRestoreConfiguration
a -> RunConfigurationDescription
s {$sel:applicationRestoreConfigurationDescription:RunConfigurationDescription' :: Maybe ApplicationRestoreConfiguration
applicationRestoreConfigurationDescription = Maybe ApplicationRestoreConfiguration
a} :: RunConfigurationDescription)

-- | Undocumented member.
runConfigurationDescription_flinkRunConfigurationDescription :: Lens.Lens' RunConfigurationDescription (Prelude.Maybe FlinkRunConfiguration)
runConfigurationDescription_flinkRunConfigurationDescription :: (Maybe FlinkRunConfiguration -> f (Maybe FlinkRunConfiguration))
-> RunConfigurationDescription -> f RunConfigurationDescription
runConfigurationDescription_flinkRunConfigurationDescription = (RunConfigurationDescription -> Maybe FlinkRunConfiguration)
-> (RunConfigurationDescription
    -> Maybe FlinkRunConfiguration -> RunConfigurationDescription)
-> Lens
     RunConfigurationDescription
     RunConfigurationDescription
     (Maybe FlinkRunConfiguration)
     (Maybe FlinkRunConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RunConfigurationDescription' {Maybe FlinkRunConfiguration
flinkRunConfigurationDescription :: Maybe FlinkRunConfiguration
$sel:flinkRunConfigurationDescription:RunConfigurationDescription' :: RunConfigurationDescription -> Maybe FlinkRunConfiguration
flinkRunConfigurationDescription} -> Maybe FlinkRunConfiguration
flinkRunConfigurationDescription) (\s :: RunConfigurationDescription
s@RunConfigurationDescription' {} Maybe FlinkRunConfiguration
a -> RunConfigurationDescription
s {$sel:flinkRunConfigurationDescription:RunConfigurationDescription' :: Maybe FlinkRunConfiguration
flinkRunConfigurationDescription = Maybe FlinkRunConfiguration
a} :: RunConfigurationDescription)

instance Core.FromJSON RunConfigurationDescription where
  parseJSON :: Value -> Parser RunConfigurationDescription
parseJSON =
    String
-> (Object -> Parser RunConfigurationDescription)
-> Value
-> Parser RunConfigurationDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RunConfigurationDescription"
      ( \Object
x ->
          Maybe ApplicationRestoreConfiguration
-> Maybe FlinkRunConfiguration -> RunConfigurationDescription
RunConfigurationDescription'
            (Maybe ApplicationRestoreConfiguration
 -> Maybe FlinkRunConfiguration -> RunConfigurationDescription)
-> Parser (Maybe ApplicationRestoreConfiguration)
-> Parser
     (Maybe FlinkRunConfiguration -> RunConfigurationDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            Object -> Text -> Parser (Maybe ApplicationRestoreConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApplicationRestoreConfigurationDescription"
                        )
            Parser (Maybe FlinkRunConfiguration -> RunConfigurationDescription)
-> Parser (Maybe FlinkRunConfiguration)
-> Parser RunConfigurationDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FlinkRunConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FlinkRunConfigurationDescription")
      )

instance Prelude.Hashable RunConfigurationDescription

instance Prelude.NFData RunConfigurationDescription