{-# 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.FSx.Types.DeleteFileSystemWindowsConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.FSx.Types.DeleteFileSystemWindowsConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FSx.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | The configuration object for the Microsoft Windows file system used in
-- the @DeleteFileSystem@ operation.
--
-- /See:/ 'newDeleteFileSystemWindowsConfiguration' smart constructor.
data DeleteFileSystemWindowsConfiguration = DeleteFileSystemWindowsConfiguration'
  { -- | A set of tags for your final backup.
    DeleteFileSystemWindowsConfiguration -> Maybe (NonEmpty Tag)
finalBackupTags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | By default, Amazon FSx for Windows takes a final backup on your behalf
    -- when the @DeleteFileSystem@ operation is invoked. Doing this helps
    -- protect you from data loss, and we highly recommend taking the final
    -- backup. If you want to skip this backup, use this flag to do so.
    DeleteFileSystemWindowsConfiguration -> Maybe Bool
skipFinalBackup :: Prelude.Maybe Prelude.Bool
  }
  deriving (DeleteFileSystemWindowsConfiguration
-> DeleteFileSystemWindowsConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFileSystemWindowsConfiguration
-> DeleteFileSystemWindowsConfiguration -> Bool
$c/= :: DeleteFileSystemWindowsConfiguration
-> DeleteFileSystemWindowsConfiguration -> Bool
== :: DeleteFileSystemWindowsConfiguration
-> DeleteFileSystemWindowsConfiguration -> Bool
$c== :: DeleteFileSystemWindowsConfiguration
-> DeleteFileSystemWindowsConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteFileSystemWindowsConfiguration]
ReadPrec DeleteFileSystemWindowsConfiguration
Int -> ReadS DeleteFileSystemWindowsConfiguration
ReadS [DeleteFileSystemWindowsConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFileSystemWindowsConfiguration]
$creadListPrec :: ReadPrec [DeleteFileSystemWindowsConfiguration]
readPrec :: ReadPrec DeleteFileSystemWindowsConfiguration
$creadPrec :: ReadPrec DeleteFileSystemWindowsConfiguration
readList :: ReadS [DeleteFileSystemWindowsConfiguration]
$creadList :: ReadS [DeleteFileSystemWindowsConfiguration]
readsPrec :: Int -> ReadS DeleteFileSystemWindowsConfiguration
$creadsPrec :: Int -> ReadS DeleteFileSystemWindowsConfiguration
Prelude.Read, Int -> DeleteFileSystemWindowsConfiguration -> ShowS
[DeleteFileSystemWindowsConfiguration] -> ShowS
DeleteFileSystemWindowsConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFileSystemWindowsConfiguration] -> ShowS
$cshowList :: [DeleteFileSystemWindowsConfiguration] -> ShowS
show :: DeleteFileSystemWindowsConfiguration -> String
$cshow :: DeleteFileSystemWindowsConfiguration -> String
showsPrec :: Int -> DeleteFileSystemWindowsConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteFileSystemWindowsConfiguration -> ShowS
Prelude.Show, forall x.
Rep DeleteFileSystemWindowsConfiguration x
-> DeleteFileSystemWindowsConfiguration
forall x.
DeleteFileSystemWindowsConfiguration
-> Rep DeleteFileSystemWindowsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFileSystemWindowsConfiguration x
-> DeleteFileSystemWindowsConfiguration
$cfrom :: forall x.
DeleteFileSystemWindowsConfiguration
-> Rep DeleteFileSystemWindowsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFileSystemWindowsConfiguration' 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:
--
-- 'finalBackupTags', 'deleteFileSystemWindowsConfiguration_finalBackupTags' - A set of tags for your final backup.
--
-- 'skipFinalBackup', 'deleteFileSystemWindowsConfiguration_skipFinalBackup' - By default, Amazon FSx for Windows takes a final backup on your behalf
-- when the @DeleteFileSystem@ operation is invoked. Doing this helps
-- protect you from data loss, and we highly recommend taking the final
-- backup. If you want to skip this backup, use this flag to do so.
newDeleteFileSystemWindowsConfiguration ::
  DeleteFileSystemWindowsConfiguration
newDeleteFileSystemWindowsConfiguration :: DeleteFileSystemWindowsConfiguration
newDeleteFileSystemWindowsConfiguration =
  DeleteFileSystemWindowsConfiguration'
    { $sel:finalBackupTags:DeleteFileSystemWindowsConfiguration' :: Maybe (NonEmpty Tag)
finalBackupTags =
        forall a. Maybe a
Prelude.Nothing,
      $sel:skipFinalBackup:DeleteFileSystemWindowsConfiguration' :: Maybe Bool
skipFinalBackup = forall a. Maybe a
Prelude.Nothing
    }

-- | A set of tags for your final backup.
deleteFileSystemWindowsConfiguration_finalBackupTags :: Lens.Lens' DeleteFileSystemWindowsConfiguration (Prelude.Maybe (Prelude.NonEmpty Tag))
deleteFileSystemWindowsConfiguration_finalBackupTags :: Lens' DeleteFileSystemWindowsConfiguration (Maybe (NonEmpty Tag))
deleteFileSystemWindowsConfiguration_finalBackupTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileSystemWindowsConfiguration' {Maybe (NonEmpty Tag)
finalBackupTags :: Maybe (NonEmpty Tag)
$sel:finalBackupTags:DeleteFileSystemWindowsConfiguration' :: DeleteFileSystemWindowsConfiguration -> Maybe (NonEmpty Tag)
finalBackupTags} -> Maybe (NonEmpty Tag)
finalBackupTags) (\s :: DeleteFileSystemWindowsConfiguration
s@DeleteFileSystemWindowsConfiguration' {} Maybe (NonEmpty Tag)
a -> DeleteFileSystemWindowsConfiguration
s {$sel:finalBackupTags:DeleteFileSystemWindowsConfiguration' :: Maybe (NonEmpty Tag)
finalBackupTags = Maybe (NonEmpty Tag)
a} :: DeleteFileSystemWindowsConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | By default, Amazon FSx for Windows takes a final backup on your behalf
-- when the @DeleteFileSystem@ operation is invoked. Doing this helps
-- protect you from data loss, and we highly recommend taking the final
-- backup. If you want to skip this backup, use this flag to do so.
deleteFileSystemWindowsConfiguration_skipFinalBackup :: Lens.Lens' DeleteFileSystemWindowsConfiguration (Prelude.Maybe Prelude.Bool)
deleteFileSystemWindowsConfiguration_skipFinalBackup :: Lens' DeleteFileSystemWindowsConfiguration (Maybe Bool)
deleteFileSystemWindowsConfiguration_skipFinalBackup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileSystemWindowsConfiguration' {Maybe Bool
skipFinalBackup :: Maybe Bool
$sel:skipFinalBackup:DeleteFileSystemWindowsConfiguration' :: DeleteFileSystemWindowsConfiguration -> Maybe Bool
skipFinalBackup} -> Maybe Bool
skipFinalBackup) (\s :: DeleteFileSystemWindowsConfiguration
s@DeleteFileSystemWindowsConfiguration' {} Maybe Bool
a -> DeleteFileSystemWindowsConfiguration
s {$sel:skipFinalBackup:DeleteFileSystemWindowsConfiguration' :: Maybe Bool
skipFinalBackup = Maybe Bool
a} :: DeleteFileSystemWindowsConfiguration)

instance
  Prelude.Hashable
    DeleteFileSystemWindowsConfiguration
  where
  hashWithSalt :: Int -> DeleteFileSystemWindowsConfiguration -> Int
hashWithSalt
    Int
_salt
    DeleteFileSystemWindowsConfiguration' {Maybe Bool
Maybe (NonEmpty Tag)
skipFinalBackup :: Maybe Bool
finalBackupTags :: Maybe (NonEmpty Tag)
$sel:skipFinalBackup:DeleteFileSystemWindowsConfiguration' :: DeleteFileSystemWindowsConfiguration -> Maybe Bool
$sel:finalBackupTags:DeleteFileSystemWindowsConfiguration' :: DeleteFileSystemWindowsConfiguration -> Maybe (NonEmpty Tag)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
finalBackupTags
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
skipFinalBackup

instance
  Prelude.NFData
    DeleteFileSystemWindowsConfiguration
  where
  rnf :: DeleteFileSystemWindowsConfiguration -> ()
rnf DeleteFileSystemWindowsConfiguration' {Maybe Bool
Maybe (NonEmpty Tag)
skipFinalBackup :: Maybe Bool
finalBackupTags :: Maybe (NonEmpty Tag)
$sel:skipFinalBackup:DeleteFileSystemWindowsConfiguration' :: DeleteFileSystemWindowsConfiguration -> Maybe Bool
$sel:finalBackupTags:DeleteFileSystemWindowsConfiguration' :: DeleteFileSystemWindowsConfiguration -> Maybe (NonEmpty Tag)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
finalBackupTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
skipFinalBackup

instance
  Data.ToJSON
    DeleteFileSystemWindowsConfiguration
  where
  toJSON :: DeleteFileSystemWindowsConfiguration -> Value
toJSON DeleteFileSystemWindowsConfiguration' {Maybe Bool
Maybe (NonEmpty Tag)
skipFinalBackup :: Maybe Bool
finalBackupTags :: Maybe (NonEmpty Tag)
$sel:skipFinalBackup:DeleteFileSystemWindowsConfiguration' :: DeleteFileSystemWindowsConfiguration -> Maybe Bool
$sel:finalBackupTags:DeleteFileSystemWindowsConfiguration' :: DeleteFileSystemWindowsConfiguration -> Maybe (NonEmpty Tag)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"FinalBackupTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
finalBackupTags,
            (Key
"SkipFinalBackup" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
skipFinalBackup
          ]
      )