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

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

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

-- |
-- Create a value of 'ApplicationSnapshotConfigurationUpdate' 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:
--
-- 'snapshotsEnabledUpdate', 'applicationSnapshotConfigurationUpdate_snapshotsEnabledUpdate' - Describes updates to whether snapshots are enabled for an application.
newApplicationSnapshotConfigurationUpdate ::
  -- | 'snapshotsEnabledUpdate'
  Prelude.Bool ->
  ApplicationSnapshotConfigurationUpdate
newApplicationSnapshotConfigurationUpdate :: Bool -> ApplicationSnapshotConfigurationUpdate
newApplicationSnapshotConfigurationUpdate
  Bool
pSnapshotsEnabledUpdate_ =
    ApplicationSnapshotConfigurationUpdate' :: Bool -> ApplicationSnapshotConfigurationUpdate
ApplicationSnapshotConfigurationUpdate'
      { $sel:snapshotsEnabledUpdate:ApplicationSnapshotConfigurationUpdate' :: Bool
snapshotsEnabledUpdate =
          Bool
pSnapshotsEnabledUpdate_
      }

-- | Describes updates to whether snapshots are enabled for an application.
applicationSnapshotConfigurationUpdate_snapshotsEnabledUpdate :: Lens.Lens' ApplicationSnapshotConfigurationUpdate Prelude.Bool
applicationSnapshotConfigurationUpdate_snapshotsEnabledUpdate :: (Bool -> f Bool)
-> ApplicationSnapshotConfigurationUpdate
-> f ApplicationSnapshotConfigurationUpdate
applicationSnapshotConfigurationUpdate_snapshotsEnabledUpdate = (ApplicationSnapshotConfigurationUpdate -> Bool)
-> (ApplicationSnapshotConfigurationUpdate
    -> Bool -> ApplicationSnapshotConfigurationUpdate)
-> Lens
     ApplicationSnapshotConfigurationUpdate
     ApplicationSnapshotConfigurationUpdate
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSnapshotConfigurationUpdate' {Bool
snapshotsEnabledUpdate :: Bool
$sel:snapshotsEnabledUpdate:ApplicationSnapshotConfigurationUpdate' :: ApplicationSnapshotConfigurationUpdate -> Bool
snapshotsEnabledUpdate} -> Bool
snapshotsEnabledUpdate) (\s :: ApplicationSnapshotConfigurationUpdate
s@ApplicationSnapshotConfigurationUpdate' {} Bool
a -> ApplicationSnapshotConfigurationUpdate
s {$sel:snapshotsEnabledUpdate:ApplicationSnapshotConfigurationUpdate' :: Bool
snapshotsEnabledUpdate = Bool
a} :: ApplicationSnapshotConfigurationUpdate)

instance
  Prelude.Hashable
    ApplicationSnapshotConfigurationUpdate

instance
  Prelude.NFData
    ApplicationSnapshotConfigurationUpdate

instance
  Core.ToJSON
    ApplicationSnapshotConfigurationUpdate
  where
  toJSON :: ApplicationSnapshotConfigurationUpdate -> Value
toJSON ApplicationSnapshotConfigurationUpdate' {Bool
snapshotsEnabledUpdate :: Bool
$sel:snapshotsEnabledUpdate:ApplicationSnapshotConfigurationUpdate' :: ApplicationSnapshotConfigurationUpdate -> 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
"SnapshotsEnabledUpdate"
                  Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
snapshotsEnabledUpdate
              )
          ]
      )