{-# 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.CreateFileCacheLustreConfiguration
-- 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.CreateFileCacheLustreConfiguration 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.FileCacheLustreDeploymentType
import Amazonka.FSx.Types.FileCacheLustreMetadataConfiguration
import qualified Amazonka.Prelude as Prelude

-- | The Amazon File Cache configuration for the cache that you are creating.
--
-- /See:/ 'newCreateFileCacheLustreConfiguration' smart constructor.
data CreateFileCacheLustreConfiguration = CreateFileCacheLustreConfiguration'
  { CreateFileCacheLustreConfiguration -> Maybe Text
weeklyMaintenanceStartTime :: Prelude.Maybe Prelude.Text,
    -- | Provisions the amount of read and write throughput for each 1 tebibyte
    -- (TiB) of cache storage capacity, in MB\/s\/TiB. The only supported value
    -- is @1000@.
    CreateFileCacheLustreConfiguration -> Natural
perUnitStorageThroughput :: Prelude.Natural,
    -- | Specifies the cache deployment type, which must be @CACHE_1@.
    CreateFileCacheLustreConfiguration -> FileCacheLustreDeploymentType
deploymentType :: FileCacheLustreDeploymentType,
    -- | The configuration for a Lustre MDT (Metadata Target) storage volume.
    CreateFileCacheLustreConfiguration
-> FileCacheLustreMetadataConfiguration
metadataConfiguration :: FileCacheLustreMetadataConfiguration
  }
  deriving (CreateFileCacheLustreConfiguration
-> CreateFileCacheLustreConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFileCacheLustreConfiguration
-> CreateFileCacheLustreConfiguration -> Bool
$c/= :: CreateFileCacheLustreConfiguration
-> CreateFileCacheLustreConfiguration -> Bool
== :: CreateFileCacheLustreConfiguration
-> CreateFileCacheLustreConfiguration -> Bool
$c== :: CreateFileCacheLustreConfiguration
-> CreateFileCacheLustreConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateFileCacheLustreConfiguration]
ReadPrec CreateFileCacheLustreConfiguration
Int -> ReadS CreateFileCacheLustreConfiguration
ReadS [CreateFileCacheLustreConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFileCacheLustreConfiguration]
$creadListPrec :: ReadPrec [CreateFileCacheLustreConfiguration]
readPrec :: ReadPrec CreateFileCacheLustreConfiguration
$creadPrec :: ReadPrec CreateFileCacheLustreConfiguration
readList :: ReadS [CreateFileCacheLustreConfiguration]
$creadList :: ReadS [CreateFileCacheLustreConfiguration]
readsPrec :: Int -> ReadS CreateFileCacheLustreConfiguration
$creadsPrec :: Int -> ReadS CreateFileCacheLustreConfiguration
Prelude.Read, Int -> CreateFileCacheLustreConfiguration -> ShowS
[CreateFileCacheLustreConfiguration] -> ShowS
CreateFileCacheLustreConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFileCacheLustreConfiguration] -> ShowS
$cshowList :: [CreateFileCacheLustreConfiguration] -> ShowS
show :: CreateFileCacheLustreConfiguration -> String
$cshow :: CreateFileCacheLustreConfiguration -> String
showsPrec :: Int -> CreateFileCacheLustreConfiguration -> ShowS
$cshowsPrec :: Int -> CreateFileCacheLustreConfiguration -> ShowS
Prelude.Show, forall x.
Rep CreateFileCacheLustreConfiguration x
-> CreateFileCacheLustreConfiguration
forall x.
CreateFileCacheLustreConfiguration
-> Rep CreateFileCacheLustreConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateFileCacheLustreConfiguration x
-> CreateFileCacheLustreConfiguration
$cfrom :: forall x.
CreateFileCacheLustreConfiguration
-> Rep CreateFileCacheLustreConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateFileCacheLustreConfiguration' 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:
--
-- 'weeklyMaintenanceStartTime', 'createFileCacheLustreConfiguration_weeklyMaintenanceStartTime' - Undocumented member.
--
-- 'perUnitStorageThroughput', 'createFileCacheLustreConfiguration_perUnitStorageThroughput' - Provisions the amount of read and write throughput for each 1 tebibyte
-- (TiB) of cache storage capacity, in MB\/s\/TiB. The only supported value
-- is @1000@.
--
-- 'deploymentType', 'createFileCacheLustreConfiguration_deploymentType' - Specifies the cache deployment type, which must be @CACHE_1@.
--
-- 'metadataConfiguration', 'createFileCacheLustreConfiguration_metadataConfiguration' - The configuration for a Lustre MDT (Metadata Target) storage volume.
newCreateFileCacheLustreConfiguration ::
  -- | 'perUnitStorageThroughput'
  Prelude.Natural ->
  -- | 'deploymentType'
  FileCacheLustreDeploymentType ->
  -- | 'metadataConfiguration'
  FileCacheLustreMetadataConfiguration ->
  CreateFileCacheLustreConfiguration
newCreateFileCacheLustreConfiguration :: Natural
-> FileCacheLustreDeploymentType
-> FileCacheLustreMetadataConfiguration
-> CreateFileCacheLustreConfiguration
newCreateFileCacheLustreConfiguration
  Natural
pPerUnitStorageThroughput_
  FileCacheLustreDeploymentType
pDeploymentType_
  FileCacheLustreMetadataConfiguration
pMetadataConfiguration_ =
    CreateFileCacheLustreConfiguration'
      { $sel:weeklyMaintenanceStartTime:CreateFileCacheLustreConfiguration' :: Maybe Text
weeklyMaintenanceStartTime =
          forall a. Maybe a
Prelude.Nothing,
        $sel:perUnitStorageThroughput:CreateFileCacheLustreConfiguration' :: Natural
perUnitStorageThroughput =
          Natural
pPerUnitStorageThroughput_,
        $sel:deploymentType:CreateFileCacheLustreConfiguration' :: FileCacheLustreDeploymentType
deploymentType = FileCacheLustreDeploymentType
pDeploymentType_,
        $sel:metadataConfiguration:CreateFileCacheLustreConfiguration' :: FileCacheLustreMetadataConfiguration
metadataConfiguration =
          FileCacheLustreMetadataConfiguration
pMetadataConfiguration_
      }

-- | Undocumented member.
createFileCacheLustreConfiguration_weeklyMaintenanceStartTime :: Lens.Lens' CreateFileCacheLustreConfiguration (Prelude.Maybe Prelude.Text)
createFileCacheLustreConfiguration_weeklyMaintenanceStartTime :: Lens' CreateFileCacheLustreConfiguration (Maybe Text)
createFileCacheLustreConfiguration_weeklyMaintenanceStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFileCacheLustreConfiguration' {Maybe Text
weeklyMaintenanceStartTime :: Maybe Text
$sel:weeklyMaintenanceStartTime:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> Maybe Text
weeklyMaintenanceStartTime} -> Maybe Text
weeklyMaintenanceStartTime) (\s :: CreateFileCacheLustreConfiguration
s@CreateFileCacheLustreConfiguration' {} Maybe Text
a -> CreateFileCacheLustreConfiguration
s {$sel:weeklyMaintenanceStartTime:CreateFileCacheLustreConfiguration' :: Maybe Text
weeklyMaintenanceStartTime = Maybe Text
a} :: CreateFileCacheLustreConfiguration)

-- | Provisions the amount of read and write throughput for each 1 tebibyte
-- (TiB) of cache storage capacity, in MB\/s\/TiB. The only supported value
-- is @1000@.
createFileCacheLustreConfiguration_perUnitStorageThroughput :: Lens.Lens' CreateFileCacheLustreConfiguration Prelude.Natural
createFileCacheLustreConfiguration_perUnitStorageThroughput :: Lens' CreateFileCacheLustreConfiguration Natural
createFileCacheLustreConfiguration_perUnitStorageThroughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFileCacheLustreConfiguration' {Natural
perUnitStorageThroughput :: Natural
$sel:perUnitStorageThroughput:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> Natural
perUnitStorageThroughput} -> Natural
perUnitStorageThroughput) (\s :: CreateFileCacheLustreConfiguration
s@CreateFileCacheLustreConfiguration' {} Natural
a -> CreateFileCacheLustreConfiguration
s {$sel:perUnitStorageThroughput:CreateFileCacheLustreConfiguration' :: Natural
perUnitStorageThroughput = Natural
a} :: CreateFileCacheLustreConfiguration)

-- | Specifies the cache deployment type, which must be @CACHE_1@.
createFileCacheLustreConfiguration_deploymentType :: Lens.Lens' CreateFileCacheLustreConfiguration FileCacheLustreDeploymentType
createFileCacheLustreConfiguration_deploymentType :: Lens'
  CreateFileCacheLustreConfiguration FileCacheLustreDeploymentType
createFileCacheLustreConfiguration_deploymentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFileCacheLustreConfiguration' {FileCacheLustreDeploymentType
deploymentType :: FileCacheLustreDeploymentType
$sel:deploymentType:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> FileCacheLustreDeploymentType
deploymentType} -> FileCacheLustreDeploymentType
deploymentType) (\s :: CreateFileCacheLustreConfiguration
s@CreateFileCacheLustreConfiguration' {} FileCacheLustreDeploymentType
a -> CreateFileCacheLustreConfiguration
s {$sel:deploymentType:CreateFileCacheLustreConfiguration' :: FileCacheLustreDeploymentType
deploymentType = FileCacheLustreDeploymentType
a} :: CreateFileCacheLustreConfiguration)

-- | The configuration for a Lustre MDT (Metadata Target) storage volume.
createFileCacheLustreConfiguration_metadataConfiguration :: Lens.Lens' CreateFileCacheLustreConfiguration FileCacheLustreMetadataConfiguration
createFileCacheLustreConfiguration_metadataConfiguration :: Lens'
  CreateFileCacheLustreConfiguration
  FileCacheLustreMetadataConfiguration
createFileCacheLustreConfiguration_metadataConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFileCacheLustreConfiguration' {FileCacheLustreMetadataConfiguration
metadataConfiguration :: FileCacheLustreMetadataConfiguration
$sel:metadataConfiguration:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration
-> FileCacheLustreMetadataConfiguration
metadataConfiguration} -> FileCacheLustreMetadataConfiguration
metadataConfiguration) (\s :: CreateFileCacheLustreConfiguration
s@CreateFileCacheLustreConfiguration' {} FileCacheLustreMetadataConfiguration
a -> CreateFileCacheLustreConfiguration
s {$sel:metadataConfiguration:CreateFileCacheLustreConfiguration' :: FileCacheLustreMetadataConfiguration
metadataConfiguration = FileCacheLustreMetadataConfiguration
a} :: CreateFileCacheLustreConfiguration)

instance
  Prelude.Hashable
    CreateFileCacheLustreConfiguration
  where
  hashWithSalt :: Int -> CreateFileCacheLustreConfiguration -> Int
hashWithSalt
    Int
_salt
    CreateFileCacheLustreConfiguration' {Natural
Maybe Text
FileCacheLustreDeploymentType
FileCacheLustreMetadataConfiguration
metadataConfiguration :: FileCacheLustreMetadataConfiguration
deploymentType :: FileCacheLustreDeploymentType
perUnitStorageThroughput :: Natural
weeklyMaintenanceStartTime :: Maybe Text
$sel:metadataConfiguration:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration
-> FileCacheLustreMetadataConfiguration
$sel:deploymentType:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> FileCacheLustreDeploymentType
$sel:perUnitStorageThroughput:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> Natural
$sel:weeklyMaintenanceStartTime:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
weeklyMaintenanceStartTime
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
perUnitStorageThroughput
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FileCacheLustreDeploymentType
deploymentType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FileCacheLustreMetadataConfiguration
metadataConfiguration

instance
  Prelude.NFData
    CreateFileCacheLustreConfiguration
  where
  rnf :: CreateFileCacheLustreConfiguration -> ()
rnf CreateFileCacheLustreConfiguration' {Natural
Maybe Text
FileCacheLustreDeploymentType
FileCacheLustreMetadataConfiguration
metadataConfiguration :: FileCacheLustreMetadataConfiguration
deploymentType :: FileCacheLustreDeploymentType
perUnitStorageThroughput :: Natural
weeklyMaintenanceStartTime :: Maybe Text
$sel:metadataConfiguration:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration
-> FileCacheLustreMetadataConfiguration
$sel:deploymentType:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> FileCacheLustreDeploymentType
$sel:perUnitStorageThroughput:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> Natural
$sel:weeklyMaintenanceStartTime:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
weeklyMaintenanceStartTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
perUnitStorageThroughput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FileCacheLustreDeploymentType
deploymentType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FileCacheLustreMetadataConfiguration
metadataConfiguration

instance
  Data.ToJSON
    CreateFileCacheLustreConfiguration
  where
  toJSON :: CreateFileCacheLustreConfiguration -> Value
toJSON CreateFileCacheLustreConfiguration' {Natural
Maybe Text
FileCacheLustreDeploymentType
FileCacheLustreMetadataConfiguration
metadataConfiguration :: FileCacheLustreMetadataConfiguration
deploymentType :: FileCacheLustreDeploymentType
perUnitStorageThroughput :: Natural
weeklyMaintenanceStartTime :: Maybe Text
$sel:metadataConfiguration:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration
-> FileCacheLustreMetadataConfiguration
$sel:deploymentType:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> FileCacheLustreDeploymentType
$sel:perUnitStorageThroughput:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> Natural
$sel:weeklyMaintenanceStartTime:CreateFileCacheLustreConfiguration' :: CreateFileCacheLustreConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"WeeklyMaintenanceStartTime" 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 Text
weeklyMaintenanceStartTime,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"PerUnitStorageThroughput"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
perUnitStorageThroughput
              ),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"DeploymentType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= FileCacheLustreDeploymentType
deploymentType),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"MetadataConfiguration"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= FileCacheLustreMetadataConfiguration
metadataConfiguration
              )
          ]
      )