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

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

-- | The configuration for a Lustre MDT (Metadata Target) storage volume. The
-- metadata on Amazon File Cache is managed by a Lustre Metadata Server
-- (MDS) while the actual metadata is persisted on an MDT.
--
-- /See:/ 'newFileCacheLustreMetadataConfiguration' smart constructor.
data FileCacheLustreMetadataConfiguration = FileCacheLustreMetadataConfiguration'
  { -- | The storage capacity of the Lustre MDT (Metadata Target) storage volume
    -- in gibibytes (GiB). The only supported value is @2400@ GiB.
    FileCacheLustreMetadataConfiguration -> Natural
storageCapacity :: Prelude.Natural
  }
  deriving (FileCacheLustreMetadataConfiguration
-> FileCacheLustreMetadataConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileCacheLustreMetadataConfiguration
-> FileCacheLustreMetadataConfiguration -> Bool
$c/= :: FileCacheLustreMetadataConfiguration
-> FileCacheLustreMetadataConfiguration -> Bool
== :: FileCacheLustreMetadataConfiguration
-> FileCacheLustreMetadataConfiguration -> Bool
$c== :: FileCacheLustreMetadataConfiguration
-> FileCacheLustreMetadataConfiguration -> Bool
Prelude.Eq, ReadPrec [FileCacheLustreMetadataConfiguration]
ReadPrec FileCacheLustreMetadataConfiguration
Int -> ReadS FileCacheLustreMetadataConfiguration
ReadS [FileCacheLustreMetadataConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FileCacheLustreMetadataConfiguration]
$creadListPrec :: ReadPrec [FileCacheLustreMetadataConfiguration]
readPrec :: ReadPrec FileCacheLustreMetadataConfiguration
$creadPrec :: ReadPrec FileCacheLustreMetadataConfiguration
readList :: ReadS [FileCacheLustreMetadataConfiguration]
$creadList :: ReadS [FileCacheLustreMetadataConfiguration]
readsPrec :: Int -> ReadS FileCacheLustreMetadataConfiguration
$creadsPrec :: Int -> ReadS FileCacheLustreMetadataConfiguration
Prelude.Read, Int -> FileCacheLustreMetadataConfiguration -> ShowS
[FileCacheLustreMetadataConfiguration] -> ShowS
FileCacheLustreMetadataConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileCacheLustreMetadataConfiguration] -> ShowS
$cshowList :: [FileCacheLustreMetadataConfiguration] -> ShowS
show :: FileCacheLustreMetadataConfiguration -> String
$cshow :: FileCacheLustreMetadataConfiguration -> String
showsPrec :: Int -> FileCacheLustreMetadataConfiguration -> ShowS
$cshowsPrec :: Int -> FileCacheLustreMetadataConfiguration -> ShowS
Prelude.Show, forall x.
Rep FileCacheLustreMetadataConfiguration x
-> FileCacheLustreMetadataConfiguration
forall x.
FileCacheLustreMetadataConfiguration
-> Rep FileCacheLustreMetadataConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FileCacheLustreMetadataConfiguration x
-> FileCacheLustreMetadataConfiguration
$cfrom :: forall x.
FileCacheLustreMetadataConfiguration
-> Rep FileCacheLustreMetadataConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'FileCacheLustreMetadataConfiguration' 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:
--
-- 'storageCapacity', 'fileCacheLustreMetadataConfiguration_storageCapacity' - The storage capacity of the Lustre MDT (Metadata Target) storage volume
-- in gibibytes (GiB). The only supported value is @2400@ GiB.
newFileCacheLustreMetadataConfiguration ::
  -- | 'storageCapacity'
  Prelude.Natural ->
  FileCacheLustreMetadataConfiguration
newFileCacheLustreMetadataConfiguration :: Natural -> FileCacheLustreMetadataConfiguration
newFileCacheLustreMetadataConfiguration
  Natural
pStorageCapacity_ =
    FileCacheLustreMetadataConfiguration'
      { $sel:storageCapacity:FileCacheLustreMetadataConfiguration' :: Natural
storageCapacity =
          Natural
pStorageCapacity_
      }

-- | The storage capacity of the Lustre MDT (Metadata Target) storage volume
-- in gibibytes (GiB). The only supported value is @2400@ GiB.
fileCacheLustreMetadataConfiguration_storageCapacity :: Lens.Lens' FileCacheLustreMetadataConfiguration Prelude.Natural
fileCacheLustreMetadataConfiguration_storageCapacity :: Lens' FileCacheLustreMetadataConfiguration Natural
fileCacheLustreMetadataConfiguration_storageCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileCacheLustreMetadataConfiguration' {Natural
storageCapacity :: Natural
$sel:storageCapacity:FileCacheLustreMetadataConfiguration' :: FileCacheLustreMetadataConfiguration -> Natural
storageCapacity} -> Natural
storageCapacity) (\s :: FileCacheLustreMetadataConfiguration
s@FileCacheLustreMetadataConfiguration' {} Natural
a -> FileCacheLustreMetadataConfiguration
s {$sel:storageCapacity:FileCacheLustreMetadataConfiguration' :: Natural
storageCapacity = Natural
a} :: FileCacheLustreMetadataConfiguration)

instance
  Data.FromJSON
    FileCacheLustreMetadataConfiguration
  where
  parseJSON :: Value -> Parser FileCacheLustreMetadataConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FileCacheLustreMetadataConfiguration"
      ( \Object
x ->
          Natural -> FileCacheLustreMetadataConfiguration
FileCacheLustreMetadataConfiguration'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"StorageCapacity")
      )

instance
  Prelude.Hashable
    FileCacheLustreMetadataConfiguration
  where
  hashWithSalt :: Int -> FileCacheLustreMetadataConfiguration -> Int
hashWithSalt
    Int
_salt
    FileCacheLustreMetadataConfiguration' {Natural
storageCapacity :: Natural
$sel:storageCapacity:FileCacheLustreMetadataConfiguration' :: FileCacheLustreMetadataConfiguration -> Natural
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
storageCapacity

instance
  Prelude.NFData
    FileCacheLustreMetadataConfiguration
  where
  rnf :: FileCacheLustreMetadataConfiguration -> ()
rnf FileCacheLustreMetadataConfiguration' {Natural
storageCapacity :: Natural
$sel:storageCapacity:FileCacheLustreMetadataConfiguration' :: FileCacheLustreMetadataConfiguration -> Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Natural
storageCapacity

instance
  Data.ToJSON
    FileCacheLustreMetadataConfiguration
  where
  toJSON :: FileCacheLustreMetadataConfiguration -> Value
toJSON FileCacheLustreMetadataConfiguration' {Natural
storageCapacity :: Natural
$sel:storageCapacity:FileCacheLustreMetadataConfiguration' :: FileCacheLustreMetadataConfiguration -> Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"StorageCapacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
storageCapacity)
          ]
      )