{-# 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.FileCacheLustreConfiguration
-- 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.FileCacheLustreConfiguration 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 Amazonka.FSx.Types.LustreLogConfiguration
import qualified Amazonka.Prelude as Prelude

-- | The configuration for the Amazon File Cache resource.
--
-- /See:/ 'newFileCacheLustreConfiguration' smart constructor.
data FileCacheLustreConfiguration = FileCacheLustreConfiguration'
  { -- | The deployment type of the Amazon File Cache resource, which must be
    -- @CACHE_1@.
    FileCacheLustreConfiguration -> Maybe FileCacheLustreDeploymentType
deploymentType :: Prelude.Maybe FileCacheLustreDeploymentType,
    -- | The configuration for Lustre logging used to write the enabled logging
    -- events for your Amazon File Cache resource to Amazon CloudWatch Logs.
    FileCacheLustreConfiguration -> Maybe LustreLogConfiguration
logConfiguration :: Prelude.Maybe LustreLogConfiguration,
    -- | The configuration for a Lustre MDT (Metadata Target) storage volume.
    FileCacheLustreConfiguration
-> Maybe FileCacheLustreMetadataConfiguration
metadataConfiguration :: Prelude.Maybe FileCacheLustreMetadataConfiguration,
    -- | You use the @MountName@ value when mounting the cache. If you pass a
    -- cache ID to the @DescribeFileCaches@ operation, it returns the the
    -- @MountName@ value as part of the cache\'s description.
    FileCacheLustreConfiguration -> Maybe Text
mountName :: Prelude.Maybe Prelude.Text,
    -- | Per unit storage throughput represents the megabytes per second of read
    -- or write throughput per 1 tebibyte of storage provisioned. Cache
    -- throughput capacity is equal to Storage capacity (TiB) *
    -- PerUnitStorageThroughput (MB\/s\/TiB). The only supported value is
    -- @1000@.
    FileCacheLustreConfiguration -> Maybe Natural
perUnitStorageThroughput :: Prelude.Maybe Prelude.Natural,
    FileCacheLustreConfiguration -> Maybe Text
weeklyMaintenanceStartTime :: Prelude.Maybe Prelude.Text
  }
  deriving (FileCacheLustreConfiguration
-> FileCacheLustreConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileCacheLustreConfiguration
-> FileCacheLustreConfiguration -> Bool
$c/= :: FileCacheLustreConfiguration
-> FileCacheLustreConfiguration -> Bool
== :: FileCacheLustreConfiguration
-> FileCacheLustreConfiguration -> Bool
$c== :: FileCacheLustreConfiguration
-> FileCacheLustreConfiguration -> Bool
Prelude.Eq, ReadPrec [FileCacheLustreConfiguration]
ReadPrec FileCacheLustreConfiguration
Int -> ReadS FileCacheLustreConfiguration
ReadS [FileCacheLustreConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FileCacheLustreConfiguration]
$creadListPrec :: ReadPrec [FileCacheLustreConfiguration]
readPrec :: ReadPrec FileCacheLustreConfiguration
$creadPrec :: ReadPrec FileCacheLustreConfiguration
readList :: ReadS [FileCacheLustreConfiguration]
$creadList :: ReadS [FileCacheLustreConfiguration]
readsPrec :: Int -> ReadS FileCacheLustreConfiguration
$creadsPrec :: Int -> ReadS FileCacheLustreConfiguration
Prelude.Read, Int -> FileCacheLustreConfiguration -> ShowS
[FileCacheLustreConfiguration] -> ShowS
FileCacheLustreConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileCacheLustreConfiguration] -> ShowS
$cshowList :: [FileCacheLustreConfiguration] -> ShowS
show :: FileCacheLustreConfiguration -> String
$cshow :: FileCacheLustreConfiguration -> String
showsPrec :: Int -> FileCacheLustreConfiguration -> ShowS
$cshowsPrec :: Int -> FileCacheLustreConfiguration -> ShowS
Prelude.Show, forall x.
Rep FileCacheLustreConfiguration x -> FileCacheLustreConfiguration
forall x.
FileCacheLustreConfiguration -> Rep FileCacheLustreConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FileCacheLustreConfiguration x -> FileCacheLustreConfiguration
$cfrom :: forall x.
FileCacheLustreConfiguration -> Rep FileCacheLustreConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'FileCacheLustreConfiguration' 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:
--
-- 'deploymentType', 'fileCacheLustreConfiguration_deploymentType' - The deployment type of the Amazon File Cache resource, which must be
-- @CACHE_1@.
--
-- 'logConfiguration', 'fileCacheLustreConfiguration_logConfiguration' - The configuration for Lustre logging used to write the enabled logging
-- events for your Amazon File Cache resource to Amazon CloudWatch Logs.
--
-- 'metadataConfiguration', 'fileCacheLustreConfiguration_metadataConfiguration' - The configuration for a Lustre MDT (Metadata Target) storage volume.
--
-- 'mountName', 'fileCacheLustreConfiguration_mountName' - You use the @MountName@ value when mounting the cache. If you pass a
-- cache ID to the @DescribeFileCaches@ operation, it returns the the
-- @MountName@ value as part of the cache\'s description.
--
-- 'perUnitStorageThroughput', 'fileCacheLustreConfiguration_perUnitStorageThroughput' - Per unit storage throughput represents the megabytes per second of read
-- or write throughput per 1 tebibyte of storage provisioned. Cache
-- throughput capacity is equal to Storage capacity (TiB) *
-- PerUnitStorageThroughput (MB\/s\/TiB). The only supported value is
-- @1000@.
--
-- 'weeklyMaintenanceStartTime', 'fileCacheLustreConfiguration_weeklyMaintenanceStartTime' - Undocumented member.
newFileCacheLustreConfiguration ::
  FileCacheLustreConfiguration
newFileCacheLustreConfiguration :: FileCacheLustreConfiguration
newFileCacheLustreConfiguration =
  FileCacheLustreConfiguration'
    { $sel:deploymentType:FileCacheLustreConfiguration' :: Maybe FileCacheLustreDeploymentType
deploymentType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:logConfiguration:FileCacheLustreConfiguration' :: Maybe LustreLogConfiguration
logConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:metadataConfiguration:FileCacheLustreConfiguration' :: Maybe FileCacheLustreMetadataConfiguration
metadataConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:mountName:FileCacheLustreConfiguration' :: Maybe Text
mountName = forall a. Maybe a
Prelude.Nothing,
      $sel:perUnitStorageThroughput:FileCacheLustreConfiguration' :: Maybe Natural
perUnitStorageThroughput = forall a. Maybe a
Prelude.Nothing,
      $sel:weeklyMaintenanceStartTime:FileCacheLustreConfiguration' :: Maybe Text
weeklyMaintenanceStartTime = forall a. Maybe a
Prelude.Nothing
    }

-- | The deployment type of the Amazon File Cache resource, which must be
-- @CACHE_1@.
fileCacheLustreConfiguration_deploymentType :: Lens.Lens' FileCacheLustreConfiguration (Prelude.Maybe FileCacheLustreDeploymentType)
fileCacheLustreConfiguration_deploymentType :: Lens'
  FileCacheLustreConfiguration (Maybe FileCacheLustreDeploymentType)
fileCacheLustreConfiguration_deploymentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileCacheLustreConfiguration' {Maybe FileCacheLustreDeploymentType
deploymentType :: Maybe FileCacheLustreDeploymentType
$sel:deploymentType:FileCacheLustreConfiguration' :: FileCacheLustreConfiguration -> Maybe FileCacheLustreDeploymentType
deploymentType} -> Maybe FileCacheLustreDeploymentType
deploymentType) (\s :: FileCacheLustreConfiguration
s@FileCacheLustreConfiguration' {} Maybe FileCacheLustreDeploymentType
a -> FileCacheLustreConfiguration
s {$sel:deploymentType:FileCacheLustreConfiguration' :: Maybe FileCacheLustreDeploymentType
deploymentType = Maybe FileCacheLustreDeploymentType
a} :: FileCacheLustreConfiguration)

-- | The configuration for Lustre logging used to write the enabled logging
-- events for your Amazon File Cache resource to Amazon CloudWatch Logs.
fileCacheLustreConfiguration_logConfiguration :: Lens.Lens' FileCacheLustreConfiguration (Prelude.Maybe LustreLogConfiguration)
fileCacheLustreConfiguration_logConfiguration :: Lens' FileCacheLustreConfiguration (Maybe LustreLogConfiguration)
fileCacheLustreConfiguration_logConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileCacheLustreConfiguration' {Maybe LustreLogConfiguration
logConfiguration :: Maybe LustreLogConfiguration
$sel:logConfiguration:FileCacheLustreConfiguration' :: FileCacheLustreConfiguration -> Maybe LustreLogConfiguration
logConfiguration} -> Maybe LustreLogConfiguration
logConfiguration) (\s :: FileCacheLustreConfiguration
s@FileCacheLustreConfiguration' {} Maybe LustreLogConfiguration
a -> FileCacheLustreConfiguration
s {$sel:logConfiguration:FileCacheLustreConfiguration' :: Maybe LustreLogConfiguration
logConfiguration = Maybe LustreLogConfiguration
a} :: FileCacheLustreConfiguration)

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

-- | You use the @MountName@ value when mounting the cache. If you pass a
-- cache ID to the @DescribeFileCaches@ operation, it returns the the
-- @MountName@ value as part of the cache\'s description.
fileCacheLustreConfiguration_mountName :: Lens.Lens' FileCacheLustreConfiguration (Prelude.Maybe Prelude.Text)
fileCacheLustreConfiguration_mountName :: Lens' FileCacheLustreConfiguration (Maybe Text)
fileCacheLustreConfiguration_mountName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileCacheLustreConfiguration' {Maybe Text
mountName :: Maybe Text
$sel:mountName:FileCacheLustreConfiguration' :: FileCacheLustreConfiguration -> Maybe Text
mountName} -> Maybe Text
mountName) (\s :: FileCacheLustreConfiguration
s@FileCacheLustreConfiguration' {} Maybe Text
a -> FileCacheLustreConfiguration
s {$sel:mountName:FileCacheLustreConfiguration' :: Maybe Text
mountName = Maybe Text
a} :: FileCacheLustreConfiguration)

-- | Per unit storage throughput represents the megabytes per second of read
-- or write throughput per 1 tebibyte of storage provisioned. Cache
-- throughput capacity is equal to Storage capacity (TiB) *
-- PerUnitStorageThroughput (MB\/s\/TiB). The only supported value is
-- @1000@.
fileCacheLustreConfiguration_perUnitStorageThroughput :: Lens.Lens' FileCacheLustreConfiguration (Prelude.Maybe Prelude.Natural)
fileCacheLustreConfiguration_perUnitStorageThroughput :: Lens' FileCacheLustreConfiguration (Maybe Natural)
fileCacheLustreConfiguration_perUnitStorageThroughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileCacheLustreConfiguration' {Maybe Natural
perUnitStorageThroughput :: Maybe Natural
$sel:perUnitStorageThroughput:FileCacheLustreConfiguration' :: FileCacheLustreConfiguration -> Maybe Natural
perUnitStorageThroughput} -> Maybe Natural
perUnitStorageThroughput) (\s :: FileCacheLustreConfiguration
s@FileCacheLustreConfiguration' {} Maybe Natural
a -> FileCacheLustreConfiguration
s {$sel:perUnitStorageThroughput:FileCacheLustreConfiguration' :: Maybe Natural
perUnitStorageThroughput = Maybe Natural
a} :: FileCacheLustreConfiguration)

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

instance Data.FromJSON FileCacheLustreConfiguration where
  parseJSON :: Value -> Parser FileCacheLustreConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FileCacheLustreConfiguration"
      ( \Object
x ->
          Maybe FileCacheLustreDeploymentType
-> Maybe LustreLogConfiguration
-> Maybe FileCacheLustreMetadataConfiguration
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> FileCacheLustreConfiguration
FileCacheLustreConfiguration'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DeploymentType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LogConfiguration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MetadataConfiguration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MountName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PerUnitStorageThroughput")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"WeeklyMaintenanceStartTime")
      )

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

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