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

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

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

instance
  Core.FromJSON
    ApplicationSnapshotConfigurationDescription
  where
  parseJSON :: Value -> Parser ApplicationSnapshotConfigurationDescription
parseJSON =
    String
-> (Object -> Parser ApplicationSnapshotConfigurationDescription)
-> Value
-> Parser ApplicationSnapshotConfigurationDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApplicationSnapshotConfigurationDescription"
      ( \Object
x ->
          Bool -> ApplicationSnapshotConfigurationDescription
ApplicationSnapshotConfigurationDescription'
            (Bool -> ApplicationSnapshotConfigurationDescription)
-> Parser Bool
-> Parser ApplicationSnapshotConfigurationDescription
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SnapshotsEnabled")
      )

instance
  Prelude.Hashable
    ApplicationSnapshotConfigurationDescription

instance
  Prelude.NFData
    ApplicationSnapshotConfigurationDescription