{-# 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.DeleteVolumeOpenZFSConfiguration
-- 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.DeleteVolumeOpenZFSConfiguration 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.DeleteOpenZFSVolumeOption
import qualified Amazonka.Prelude as Prelude

-- | A value that specifies whether to delete all child volumes and
-- snapshots.
--
-- /See:/ 'newDeleteVolumeOpenZFSConfiguration' smart constructor.
data DeleteVolumeOpenZFSConfiguration = DeleteVolumeOpenZFSConfiguration'
  { -- | To delete the volume\'s child volumes, snapshots, and clones, use the
    -- string @DELETE_CHILD_VOLUMES_AND_SNAPSHOTS@.
    DeleteVolumeOpenZFSConfiguration
-> Maybe [DeleteOpenZFSVolumeOption]
options :: Prelude.Maybe [DeleteOpenZFSVolumeOption]
  }
  deriving (DeleteVolumeOpenZFSConfiguration
-> DeleteVolumeOpenZFSConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVolumeOpenZFSConfiguration
-> DeleteVolumeOpenZFSConfiguration -> Bool
$c/= :: DeleteVolumeOpenZFSConfiguration
-> DeleteVolumeOpenZFSConfiguration -> Bool
== :: DeleteVolumeOpenZFSConfiguration
-> DeleteVolumeOpenZFSConfiguration -> Bool
$c== :: DeleteVolumeOpenZFSConfiguration
-> DeleteVolumeOpenZFSConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteVolumeOpenZFSConfiguration]
ReadPrec DeleteVolumeOpenZFSConfiguration
Int -> ReadS DeleteVolumeOpenZFSConfiguration
ReadS [DeleteVolumeOpenZFSConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVolumeOpenZFSConfiguration]
$creadListPrec :: ReadPrec [DeleteVolumeOpenZFSConfiguration]
readPrec :: ReadPrec DeleteVolumeOpenZFSConfiguration
$creadPrec :: ReadPrec DeleteVolumeOpenZFSConfiguration
readList :: ReadS [DeleteVolumeOpenZFSConfiguration]
$creadList :: ReadS [DeleteVolumeOpenZFSConfiguration]
readsPrec :: Int -> ReadS DeleteVolumeOpenZFSConfiguration
$creadsPrec :: Int -> ReadS DeleteVolumeOpenZFSConfiguration
Prelude.Read, Int -> DeleteVolumeOpenZFSConfiguration -> ShowS
[DeleteVolumeOpenZFSConfiguration] -> ShowS
DeleteVolumeOpenZFSConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVolumeOpenZFSConfiguration] -> ShowS
$cshowList :: [DeleteVolumeOpenZFSConfiguration] -> ShowS
show :: DeleteVolumeOpenZFSConfiguration -> String
$cshow :: DeleteVolumeOpenZFSConfiguration -> String
showsPrec :: Int -> DeleteVolumeOpenZFSConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteVolumeOpenZFSConfiguration -> ShowS
Prelude.Show, forall x.
Rep DeleteVolumeOpenZFSConfiguration x
-> DeleteVolumeOpenZFSConfiguration
forall x.
DeleteVolumeOpenZFSConfiguration
-> Rep DeleteVolumeOpenZFSConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteVolumeOpenZFSConfiguration x
-> DeleteVolumeOpenZFSConfiguration
$cfrom :: forall x.
DeleteVolumeOpenZFSConfiguration
-> Rep DeleteVolumeOpenZFSConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteVolumeOpenZFSConfiguration' 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:
--
-- 'options', 'deleteVolumeOpenZFSConfiguration_options' - To delete the volume\'s child volumes, snapshots, and clones, use the
-- string @DELETE_CHILD_VOLUMES_AND_SNAPSHOTS@.
newDeleteVolumeOpenZFSConfiguration ::
  DeleteVolumeOpenZFSConfiguration
newDeleteVolumeOpenZFSConfiguration :: DeleteVolumeOpenZFSConfiguration
newDeleteVolumeOpenZFSConfiguration =
  DeleteVolumeOpenZFSConfiguration'
    { $sel:options:DeleteVolumeOpenZFSConfiguration' :: Maybe [DeleteOpenZFSVolumeOption]
options =
        forall a. Maybe a
Prelude.Nothing
    }

-- | To delete the volume\'s child volumes, snapshots, and clones, use the
-- string @DELETE_CHILD_VOLUMES_AND_SNAPSHOTS@.
deleteVolumeOpenZFSConfiguration_options :: Lens.Lens' DeleteVolumeOpenZFSConfiguration (Prelude.Maybe [DeleteOpenZFSVolumeOption])
deleteVolumeOpenZFSConfiguration_options :: Lens'
  DeleteVolumeOpenZFSConfiguration
  (Maybe [DeleteOpenZFSVolumeOption])
deleteVolumeOpenZFSConfiguration_options = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVolumeOpenZFSConfiguration' {Maybe [DeleteOpenZFSVolumeOption]
options :: Maybe [DeleteOpenZFSVolumeOption]
$sel:options:DeleteVolumeOpenZFSConfiguration' :: DeleteVolumeOpenZFSConfiguration
-> Maybe [DeleteOpenZFSVolumeOption]
options} -> Maybe [DeleteOpenZFSVolumeOption]
options) (\s :: DeleteVolumeOpenZFSConfiguration
s@DeleteVolumeOpenZFSConfiguration' {} Maybe [DeleteOpenZFSVolumeOption]
a -> DeleteVolumeOpenZFSConfiguration
s {$sel:options:DeleteVolumeOpenZFSConfiguration' :: Maybe [DeleteOpenZFSVolumeOption]
options = Maybe [DeleteOpenZFSVolumeOption]
a} :: DeleteVolumeOpenZFSConfiguration) 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

instance
  Prelude.Hashable
    DeleteVolumeOpenZFSConfiguration
  where
  hashWithSalt :: Int -> DeleteVolumeOpenZFSConfiguration -> Int
hashWithSalt
    Int
_salt
    DeleteVolumeOpenZFSConfiguration' {Maybe [DeleteOpenZFSVolumeOption]
options :: Maybe [DeleteOpenZFSVolumeOption]
$sel:options:DeleteVolumeOpenZFSConfiguration' :: DeleteVolumeOpenZFSConfiguration
-> Maybe [DeleteOpenZFSVolumeOption]
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DeleteOpenZFSVolumeOption]
options

instance
  Prelude.NFData
    DeleteVolumeOpenZFSConfiguration
  where
  rnf :: DeleteVolumeOpenZFSConfiguration -> ()
rnf DeleteVolumeOpenZFSConfiguration' {Maybe [DeleteOpenZFSVolumeOption]
options :: Maybe [DeleteOpenZFSVolumeOption]
$sel:options:DeleteVolumeOpenZFSConfiguration' :: DeleteVolumeOpenZFSConfiguration
-> Maybe [DeleteOpenZFSVolumeOption]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DeleteOpenZFSVolumeOption]
options

instance Data.ToJSON DeleteVolumeOpenZFSConfiguration where
  toJSON :: DeleteVolumeOpenZFSConfiguration -> Value
toJSON DeleteVolumeOpenZFSConfiguration' {Maybe [DeleteOpenZFSVolumeOption]
options :: Maybe [DeleteOpenZFSVolumeOption]
$sel:options:DeleteVolumeOpenZFSConfiguration' :: DeleteVolumeOpenZFSConfiguration
-> Maybe [DeleteOpenZFSVolumeOption]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"Options" 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 [DeleteOpenZFSVolumeOption]
options]
      )