{-# 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.DeleteFileSystemLustreConfiguration
-- 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.DeleteFileSystemLustreConfiguration 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 Amazon FSx for Lustre file system being
-- deleted in the @DeleteFileSystem@ operation.
--
-- /See:/ 'newDeleteFileSystemLustreConfiguration' smart constructor.
data DeleteFileSystemLustreConfiguration = DeleteFileSystemLustreConfiguration'
  { -- | Use if @SkipFinalBackup@ is set to @false@, and you want to apply an
    -- array of tags to the final backup. If you have set the file system
    -- property @CopyTagsToBackups@ to true, and you specify one or more
    -- @FinalBackupTags@ when deleting a file system, Amazon FSx will not copy
    -- any existing file system tags to the backup.
    DeleteFileSystemLustreConfiguration -> Maybe (NonEmpty Tag)
finalBackupTags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | Set @SkipFinalBackup@ to false if you want to take a final backup of the
    -- file system you are deleting. By default, Amazon FSx will not take a
    -- final backup on your behalf when the @DeleteFileSystem@ operation is
    -- invoked. (Default = true)
    --
    -- The @fsx:CreateBackup@ permission is required if you set
    -- @SkipFinalBackup@ to @false@ in order to delete the file system and take
    -- a final backup.
    DeleteFileSystemLustreConfiguration -> Maybe Bool
skipFinalBackup :: Prelude.Maybe Prelude.Bool
  }
  deriving (DeleteFileSystemLustreConfiguration
-> DeleteFileSystemLustreConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFileSystemLustreConfiguration
-> DeleteFileSystemLustreConfiguration -> Bool
$c/= :: DeleteFileSystemLustreConfiguration
-> DeleteFileSystemLustreConfiguration -> Bool
== :: DeleteFileSystemLustreConfiguration
-> DeleteFileSystemLustreConfiguration -> Bool
$c== :: DeleteFileSystemLustreConfiguration
-> DeleteFileSystemLustreConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteFileSystemLustreConfiguration]
ReadPrec DeleteFileSystemLustreConfiguration
Int -> ReadS DeleteFileSystemLustreConfiguration
ReadS [DeleteFileSystemLustreConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFileSystemLustreConfiguration]
$creadListPrec :: ReadPrec [DeleteFileSystemLustreConfiguration]
readPrec :: ReadPrec DeleteFileSystemLustreConfiguration
$creadPrec :: ReadPrec DeleteFileSystemLustreConfiguration
readList :: ReadS [DeleteFileSystemLustreConfiguration]
$creadList :: ReadS [DeleteFileSystemLustreConfiguration]
readsPrec :: Int -> ReadS DeleteFileSystemLustreConfiguration
$creadsPrec :: Int -> ReadS DeleteFileSystemLustreConfiguration
Prelude.Read, Int -> DeleteFileSystemLustreConfiguration -> ShowS
[DeleteFileSystemLustreConfiguration] -> ShowS
DeleteFileSystemLustreConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFileSystemLustreConfiguration] -> ShowS
$cshowList :: [DeleteFileSystemLustreConfiguration] -> ShowS
show :: DeleteFileSystemLustreConfiguration -> String
$cshow :: DeleteFileSystemLustreConfiguration -> String
showsPrec :: Int -> DeleteFileSystemLustreConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteFileSystemLustreConfiguration -> ShowS
Prelude.Show, forall x.
Rep DeleteFileSystemLustreConfiguration x
-> DeleteFileSystemLustreConfiguration
forall x.
DeleteFileSystemLustreConfiguration
-> Rep DeleteFileSystemLustreConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFileSystemLustreConfiguration x
-> DeleteFileSystemLustreConfiguration
$cfrom :: forall x.
DeleteFileSystemLustreConfiguration
-> Rep DeleteFileSystemLustreConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFileSystemLustreConfiguration' 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', 'deleteFileSystemLustreConfiguration_finalBackupTags' - Use if @SkipFinalBackup@ is set to @false@, and you want to apply an
-- array of tags to the final backup. If you have set the file system
-- property @CopyTagsToBackups@ to true, and you specify one or more
-- @FinalBackupTags@ when deleting a file system, Amazon FSx will not copy
-- any existing file system tags to the backup.
--
-- 'skipFinalBackup', 'deleteFileSystemLustreConfiguration_skipFinalBackup' - Set @SkipFinalBackup@ to false if you want to take a final backup of the
-- file system you are deleting. By default, Amazon FSx will not take a
-- final backup on your behalf when the @DeleteFileSystem@ operation is
-- invoked. (Default = true)
--
-- The @fsx:CreateBackup@ permission is required if you set
-- @SkipFinalBackup@ to @false@ in order to delete the file system and take
-- a final backup.
newDeleteFileSystemLustreConfiguration ::
  DeleteFileSystemLustreConfiguration
newDeleteFileSystemLustreConfiguration :: DeleteFileSystemLustreConfiguration
newDeleteFileSystemLustreConfiguration =
  DeleteFileSystemLustreConfiguration'
    { $sel:finalBackupTags:DeleteFileSystemLustreConfiguration' :: Maybe (NonEmpty Tag)
finalBackupTags =
        forall a. Maybe a
Prelude.Nothing,
      $sel:skipFinalBackup:DeleteFileSystemLustreConfiguration' :: Maybe Bool
skipFinalBackup = forall a. Maybe a
Prelude.Nothing
    }

-- | Use if @SkipFinalBackup@ is set to @false@, and you want to apply an
-- array of tags to the final backup. If you have set the file system
-- property @CopyTagsToBackups@ to true, and you specify one or more
-- @FinalBackupTags@ when deleting a file system, Amazon FSx will not copy
-- any existing file system tags to the backup.
deleteFileSystemLustreConfiguration_finalBackupTags :: Lens.Lens' DeleteFileSystemLustreConfiguration (Prelude.Maybe (Prelude.NonEmpty Tag))
deleteFileSystemLustreConfiguration_finalBackupTags :: Lens' DeleteFileSystemLustreConfiguration (Maybe (NonEmpty Tag))
deleteFileSystemLustreConfiguration_finalBackupTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileSystemLustreConfiguration' {Maybe (NonEmpty Tag)
finalBackupTags :: Maybe (NonEmpty Tag)
$sel:finalBackupTags:DeleteFileSystemLustreConfiguration' :: DeleteFileSystemLustreConfiguration -> Maybe (NonEmpty Tag)
finalBackupTags} -> Maybe (NonEmpty Tag)
finalBackupTags) (\s :: DeleteFileSystemLustreConfiguration
s@DeleteFileSystemLustreConfiguration' {} Maybe (NonEmpty Tag)
a -> DeleteFileSystemLustreConfiguration
s {$sel:finalBackupTags:DeleteFileSystemLustreConfiguration' :: Maybe (NonEmpty Tag)
finalBackupTags = Maybe (NonEmpty Tag)
a} :: DeleteFileSystemLustreConfiguration) 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

-- | Set @SkipFinalBackup@ to false if you want to take a final backup of the
-- file system you are deleting. By default, Amazon FSx will not take a
-- final backup on your behalf when the @DeleteFileSystem@ operation is
-- invoked. (Default = true)
--
-- The @fsx:CreateBackup@ permission is required if you set
-- @SkipFinalBackup@ to @false@ in order to delete the file system and take
-- a final backup.
deleteFileSystemLustreConfiguration_skipFinalBackup :: Lens.Lens' DeleteFileSystemLustreConfiguration (Prelude.Maybe Prelude.Bool)
deleteFileSystemLustreConfiguration_skipFinalBackup :: Lens' DeleteFileSystemLustreConfiguration (Maybe Bool)
deleteFileSystemLustreConfiguration_skipFinalBackup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileSystemLustreConfiguration' {Maybe Bool
skipFinalBackup :: Maybe Bool
$sel:skipFinalBackup:DeleteFileSystemLustreConfiguration' :: DeleteFileSystemLustreConfiguration -> Maybe Bool
skipFinalBackup} -> Maybe Bool
skipFinalBackup) (\s :: DeleteFileSystemLustreConfiguration
s@DeleteFileSystemLustreConfiguration' {} Maybe Bool
a -> DeleteFileSystemLustreConfiguration
s {$sel:skipFinalBackup:DeleteFileSystemLustreConfiguration' :: Maybe Bool
skipFinalBackup = Maybe Bool
a} :: DeleteFileSystemLustreConfiguration)

instance
  Prelude.Hashable
    DeleteFileSystemLustreConfiguration
  where
  hashWithSalt :: Int -> DeleteFileSystemLustreConfiguration -> Int
hashWithSalt
    Int
_salt
    DeleteFileSystemLustreConfiguration' {Maybe Bool
Maybe (NonEmpty Tag)
skipFinalBackup :: Maybe Bool
finalBackupTags :: Maybe (NonEmpty Tag)
$sel:skipFinalBackup:DeleteFileSystemLustreConfiguration' :: DeleteFileSystemLustreConfiguration -> Maybe Bool
$sel:finalBackupTags:DeleteFileSystemLustreConfiguration' :: DeleteFileSystemLustreConfiguration -> 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
    DeleteFileSystemLustreConfiguration
  where
  rnf :: DeleteFileSystemLustreConfiguration -> ()
rnf DeleteFileSystemLustreConfiguration' {Maybe Bool
Maybe (NonEmpty Tag)
skipFinalBackup :: Maybe Bool
finalBackupTags :: Maybe (NonEmpty Tag)
$sel:skipFinalBackup:DeleteFileSystemLustreConfiguration' :: DeleteFileSystemLustreConfiguration -> Maybe Bool
$sel:finalBackupTags:DeleteFileSystemLustreConfiguration' :: DeleteFileSystemLustreConfiguration -> 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
    DeleteFileSystemLustreConfiguration
  where
  toJSON :: DeleteFileSystemLustreConfiguration -> Value
toJSON DeleteFileSystemLustreConfiguration' {Maybe Bool
Maybe (NonEmpty Tag)
skipFinalBackup :: Maybe Bool
finalBackupTags :: Maybe (NonEmpty Tag)
$sel:skipFinalBackup:DeleteFileSystemLustreConfiguration' :: DeleteFileSystemLustreConfiguration -> Maybe Bool
$sel:finalBackupTags:DeleteFileSystemLustreConfiguration' :: DeleteFileSystemLustreConfiguration -> 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
          ]
      )