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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes whether snapshots are enabled for a Flink-based Kinesis Data
-- Analytics application.
--
-- /See:/ 'newApplicationSnapshotConfiguration' smart constructor.
data ApplicationSnapshotConfiguration = ApplicationSnapshotConfiguration'
  { -- | Describes whether snapshots are enabled for a Flink-based Kinesis Data
    -- Analytics application.
    ApplicationSnapshotConfiguration -> Bool
snapshotsEnabled :: Prelude.Bool
  }
  deriving (ApplicationSnapshotConfiguration
-> ApplicationSnapshotConfiguration -> Bool
(ApplicationSnapshotConfiguration
 -> ApplicationSnapshotConfiguration -> Bool)
-> (ApplicationSnapshotConfiguration
    -> ApplicationSnapshotConfiguration -> Bool)
-> Eq ApplicationSnapshotConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationSnapshotConfiguration
-> ApplicationSnapshotConfiguration -> Bool
$c/= :: ApplicationSnapshotConfiguration
-> ApplicationSnapshotConfiguration -> Bool
== :: ApplicationSnapshotConfiguration
-> ApplicationSnapshotConfiguration -> Bool
$c== :: ApplicationSnapshotConfiguration
-> ApplicationSnapshotConfiguration -> Bool
Prelude.Eq, ReadPrec [ApplicationSnapshotConfiguration]
ReadPrec ApplicationSnapshotConfiguration
Int -> ReadS ApplicationSnapshotConfiguration
ReadS [ApplicationSnapshotConfiguration]
(Int -> ReadS ApplicationSnapshotConfiguration)
-> ReadS [ApplicationSnapshotConfiguration]
-> ReadPrec ApplicationSnapshotConfiguration
-> ReadPrec [ApplicationSnapshotConfiguration]
-> Read ApplicationSnapshotConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationSnapshotConfiguration]
$creadListPrec :: ReadPrec [ApplicationSnapshotConfiguration]
readPrec :: ReadPrec ApplicationSnapshotConfiguration
$creadPrec :: ReadPrec ApplicationSnapshotConfiguration
readList :: ReadS [ApplicationSnapshotConfiguration]
$creadList :: ReadS [ApplicationSnapshotConfiguration]
readsPrec :: Int -> ReadS ApplicationSnapshotConfiguration
$creadsPrec :: Int -> ReadS ApplicationSnapshotConfiguration
Prelude.Read, Int -> ApplicationSnapshotConfiguration -> ShowS
[ApplicationSnapshotConfiguration] -> ShowS
ApplicationSnapshotConfiguration -> String
(Int -> ApplicationSnapshotConfiguration -> ShowS)
-> (ApplicationSnapshotConfiguration -> String)
-> ([ApplicationSnapshotConfiguration] -> ShowS)
-> Show ApplicationSnapshotConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationSnapshotConfiguration] -> ShowS
$cshowList :: [ApplicationSnapshotConfiguration] -> ShowS
show :: ApplicationSnapshotConfiguration -> String
$cshow :: ApplicationSnapshotConfiguration -> String
showsPrec :: Int -> ApplicationSnapshotConfiguration -> ShowS
$cshowsPrec :: Int -> ApplicationSnapshotConfiguration -> ShowS
Prelude.Show, (forall x.
 ApplicationSnapshotConfiguration
 -> Rep ApplicationSnapshotConfiguration x)
-> (forall x.
    Rep ApplicationSnapshotConfiguration x
    -> ApplicationSnapshotConfiguration)
-> Generic ApplicationSnapshotConfiguration
forall x.
Rep ApplicationSnapshotConfiguration x
-> ApplicationSnapshotConfiguration
forall x.
ApplicationSnapshotConfiguration
-> Rep ApplicationSnapshotConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationSnapshotConfiguration x
-> ApplicationSnapshotConfiguration
$cfrom :: forall x.
ApplicationSnapshotConfiguration
-> Rep ApplicationSnapshotConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationSnapshotConfiguration' 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:
--
-- 'snapshotsEnabled', 'applicationSnapshotConfiguration_snapshotsEnabled' - Describes whether snapshots are enabled for a Flink-based Kinesis Data
-- Analytics application.
newApplicationSnapshotConfiguration ::
  -- | 'snapshotsEnabled'
  Prelude.Bool ->
  ApplicationSnapshotConfiguration
newApplicationSnapshotConfiguration :: Bool -> ApplicationSnapshotConfiguration
newApplicationSnapshotConfiguration
  Bool
pSnapshotsEnabled_ =
    ApplicationSnapshotConfiguration' :: Bool -> ApplicationSnapshotConfiguration
ApplicationSnapshotConfiguration'
      { $sel:snapshotsEnabled:ApplicationSnapshotConfiguration' :: Bool
snapshotsEnabled =
          Bool
pSnapshotsEnabled_
      }

-- | Describes whether snapshots are enabled for a Flink-based Kinesis Data
-- Analytics application.
applicationSnapshotConfiguration_snapshotsEnabled :: Lens.Lens' ApplicationSnapshotConfiguration Prelude.Bool
applicationSnapshotConfiguration_snapshotsEnabled :: (Bool -> f Bool)
-> ApplicationSnapshotConfiguration
-> f ApplicationSnapshotConfiguration
applicationSnapshotConfiguration_snapshotsEnabled = (ApplicationSnapshotConfiguration -> Bool)
-> (ApplicationSnapshotConfiguration
    -> Bool -> ApplicationSnapshotConfiguration)
-> Lens
     ApplicationSnapshotConfiguration
     ApplicationSnapshotConfiguration
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSnapshotConfiguration' {Bool
snapshotsEnabled :: Bool
$sel:snapshotsEnabled:ApplicationSnapshotConfiguration' :: ApplicationSnapshotConfiguration -> Bool
snapshotsEnabled} -> Bool
snapshotsEnabled) (\s :: ApplicationSnapshotConfiguration
s@ApplicationSnapshotConfiguration' {} Bool
a -> ApplicationSnapshotConfiguration
s {$sel:snapshotsEnabled:ApplicationSnapshotConfiguration' :: Bool
snapshotsEnabled = Bool
a} :: ApplicationSnapshotConfiguration)

instance
  Prelude.Hashable
    ApplicationSnapshotConfiguration

instance
  Prelude.NFData
    ApplicationSnapshotConfiguration

instance Core.ToJSON ApplicationSnapshotConfiguration where
  toJSON :: ApplicationSnapshotConfiguration -> Value
toJSON ApplicationSnapshotConfiguration' {Bool
snapshotsEnabled :: Bool
$sel:snapshotsEnabled:ApplicationSnapshotConfiguration' :: ApplicationSnapshotConfiguration -> Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SnapshotsEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
snapshotsEnabled)
          ]
      )