{-# 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.ComputeOptimizer.Types.VolumeConfiguration
-- 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.ComputeOptimizer.Types.VolumeConfiguration 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

-- | Describes the configuration of an Amazon Elastic Block Store (Amazon
-- EBS) volume.
--
-- /See:/ 'newVolumeConfiguration' smart constructor.
data VolumeConfiguration = VolumeConfiguration'
  { -- | The baseline IOPS of the volume.
    VolumeConfiguration -> Maybe Int
volumeBaselineIOPS :: Prelude.Maybe Prelude.Int,
    -- | The baseline throughput of the volume.
    VolumeConfiguration -> Maybe Int
volumeBaselineThroughput :: Prelude.Maybe Prelude.Int,
    -- | The burst IOPS of the volume.
    VolumeConfiguration -> Maybe Int
volumeBurstIOPS :: Prelude.Maybe Prelude.Int,
    -- | The burst throughput of the volume.
    VolumeConfiguration -> Maybe Int
volumeBurstThroughput :: Prelude.Maybe Prelude.Int,
    -- | The size of the volume, in GiB.
    VolumeConfiguration -> Maybe Int
volumeSize :: Prelude.Maybe Prelude.Int,
    -- | The volume type.
    --
    -- This can be @gp2@ for General Purpose SSD, @io1@ or @io2@ for
    -- Provisioned IOPS SSD, @st1@ for Throughput Optimized HDD, @sc1@ for Cold
    -- HDD, or @standard@ for Magnetic volumes.
    VolumeConfiguration -> Maybe Text
volumeType :: Prelude.Maybe Prelude.Text
  }
  deriving (VolumeConfiguration -> VolumeConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeConfiguration -> VolumeConfiguration -> Bool
$c/= :: VolumeConfiguration -> VolumeConfiguration -> Bool
== :: VolumeConfiguration -> VolumeConfiguration -> Bool
$c== :: VolumeConfiguration -> VolumeConfiguration -> Bool
Prelude.Eq, ReadPrec [VolumeConfiguration]
ReadPrec VolumeConfiguration
Int -> ReadS VolumeConfiguration
ReadS [VolumeConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeConfiguration]
$creadListPrec :: ReadPrec [VolumeConfiguration]
readPrec :: ReadPrec VolumeConfiguration
$creadPrec :: ReadPrec VolumeConfiguration
readList :: ReadS [VolumeConfiguration]
$creadList :: ReadS [VolumeConfiguration]
readsPrec :: Int -> ReadS VolumeConfiguration
$creadsPrec :: Int -> ReadS VolumeConfiguration
Prelude.Read, Int -> VolumeConfiguration -> ShowS
[VolumeConfiguration] -> ShowS
VolumeConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeConfiguration] -> ShowS
$cshowList :: [VolumeConfiguration] -> ShowS
show :: VolumeConfiguration -> String
$cshow :: VolumeConfiguration -> String
showsPrec :: Int -> VolumeConfiguration -> ShowS
$cshowsPrec :: Int -> VolumeConfiguration -> ShowS
Prelude.Show, forall x. Rep VolumeConfiguration x -> VolumeConfiguration
forall x. VolumeConfiguration -> Rep VolumeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeConfiguration x -> VolumeConfiguration
$cfrom :: forall x. VolumeConfiguration -> Rep VolumeConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'VolumeConfiguration' 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:
--
-- 'volumeBaselineIOPS', 'volumeConfiguration_volumeBaselineIOPS' - The baseline IOPS of the volume.
--
-- 'volumeBaselineThroughput', 'volumeConfiguration_volumeBaselineThroughput' - The baseline throughput of the volume.
--
-- 'volumeBurstIOPS', 'volumeConfiguration_volumeBurstIOPS' - The burst IOPS of the volume.
--
-- 'volumeBurstThroughput', 'volumeConfiguration_volumeBurstThroughput' - The burst throughput of the volume.
--
-- 'volumeSize', 'volumeConfiguration_volumeSize' - The size of the volume, in GiB.
--
-- 'volumeType', 'volumeConfiguration_volumeType' - The volume type.
--
-- This can be @gp2@ for General Purpose SSD, @io1@ or @io2@ for
-- Provisioned IOPS SSD, @st1@ for Throughput Optimized HDD, @sc1@ for Cold
-- HDD, or @standard@ for Magnetic volumes.
newVolumeConfiguration ::
  VolumeConfiguration
newVolumeConfiguration :: VolumeConfiguration
newVolumeConfiguration =
  VolumeConfiguration'
    { $sel:volumeBaselineIOPS:VolumeConfiguration' :: Maybe Int
volumeBaselineIOPS =
        forall a. Maybe a
Prelude.Nothing,
      $sel:volumeBaselineThroughput:VolumeConfiguration' :: Maybe Int
volumeBaselineThroughput = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeBurstIOPS:VolumeConfiguration' :: Maybe Int
volumeBurstIOPS = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeBurstThroughput:VolumeConfiguration' :: Maybe Int
volumeBurstThroughput = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeSize:VolumeConfiguration' :: Maybe Int
volumeSize = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeType:VolumeConfiguration' :: Maybe Text
volumeType = forall a. Maybe a
Prelude.Nothing
    }

-- | The baseline IOPS of the volume.
volumeConfiguration_volumeBaselineIOPS :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_volumeBaselineIOPS :: Lens' VolumeConfiguration (Maybe Int)
volumeConfiguration_volumeBaselineIOPS = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Int
volumeBaselineIOPS :: Maybe Int
$sel:volumeBaselineIOPS:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
volumeBaselineIOPS} -> Maybe Int
volumeBaselineIOPS) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Int
a -> VolumeConfiguration
s {$sel:volumeBaselineIOPS:VolumeConfiguration' :: Maybe Int
volumeBaselineIOPS = Maybe Int
a} :: VolumeConfiguration)

-- | The baseline throughput of the volume.
volumeConfiguration_volumeBaselineThroughput :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_volumeBaselineThroughput :: Lens' VolumeConfiguration (Maybe Int)
volumeConfiguration_volumeBaselineThroughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Int
volumeBaselineThroughput :: Maybe Int
$sel:volumeBaselineThroughput:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
volumeBaselineThroughput} -> Maybe Int
volumeBaselineThroughput) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Int
a -> VolumeConfiguration
s {$sel:volumeBaselineThroughput:VolumeConfiguration' :: Maybe Int
volumeBaselineThroughput = Maybe Int
a} :: VolumeConfiguration)

-- | The burst IOPS of the volume.
volumeConfiguration_volumeBurstIOPS :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_volumeBurstIOPS :: Lens' VolumeConfiguration (Maybe Int)
volumeConfiguration_volumeBurstIOPS = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Int
volumeBurstIOPS :: Maybe Int
$sel:volumeBurstIOPS:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
volumeBurstIOPS} -> Maybe Int
volumeBurstIOPS) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Int
a -> VolumeConfiguration
s {$sel:volumeBurstIOPS:VolumeConfiguration' :: Maybe Int
volumeBurstIOPS = Maybe Int
a} :: VolumeConfiguration)

-- | The burst throughput of the volume.
volumeConfiguration_volumeBurstThroughput :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_volumeBurstThroughput :: Lens' VolumeConfiguration (Maybe Int)
volumeConfiguration_volumeBurstThroughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Int
volumeBurstThroughput :: Maybe Int
$sel:volumeBurstThroughput:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
volumeBurstThroughput} -> Maybe Int
volumeBurstThroughput) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Int
a -> VolumeConfiguration
s {$sel:volumeBurstThroughput:VolumeConfiguration' :: Maybe Int
volumeBurstThroughput = Maybe Int
a} :: VolumeConfiguration)

-- | The size of the volume, in GiB.
volumeConfiguration_volumeSize :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Int)
volumeConfiguration_volumeSize :: Lens' VolumeConfiguration (Maybe Int)
volumeConfiguration_volumeSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Int
volumeSize :: Maybe Int
$sel:volumeSize:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
volumeSize} -> Maybe Int
volumeSize) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Int
a -> VolumeConfiguration
s {$sel:volumeSize:VolumeConfiguration' :: Maybe Int
volumeSize = Maybe Int
a} :: VolumeConfiguration)

-- | The volume type.
--
-- This can be @gp2@ for General Purpose SSD, @io1@ or @io2@ for
-- Provisioned IOPS SSD, @st1@ for Throughput Optimized HDD, @sc1@ for Cold
-- HDD, or @standard@ for Magnetic volumes.
volumeConfiguration_volumeType :: Lens.Lens' VolumeConfiguration (Prelude.Maybe Prelude.Text)
volumeConfiguration_volumeType :: Lens' VolumeConfiguration (Maybe Text)
volumeConfiguration_volumeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeConfiguration' {Maybe Text
volumeType :: Maybe Text
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
volumeType} -> Maybe Text
volumeType) (\s :: VolumeConfiguration
s@VolumeConfiguration' {} Maybe Text
a -> VolumeConfiguration
s {$sel:volumeType:VolumeConfiguration' :: Maybe Text
volumeType = Maybe Text
a} :: VolumeConfiguration)

instance Data.FromJSON VolumeConfiguration where
  parseJSON :: Value -> Parser VolumeConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VolumeConfiguration"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> VolumeConfiguration
VolumeConfiguration'
            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
"volumeBaselineIOPS")
            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
"volumeBaselineThroughput")
            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
"volumeBurstIOPS")
            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
"volumeBurstThroughput")
            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
"volumeSize")
            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
"volumeType")
      )

instance Prelude.Hashable VolumeConfiguration where
  hashWithSalt :: Int -> VolumeConfiguration -> Int
hashWithSalt Int
_salt VolumeConfiguration' {Maybe Int
Maybe Text
volumeType :: Maybe Text
volumeSize :: Maybe Int
volumeBurstThroughput :: Maybe Int
volumeBurstIOPS :: Maybe Int
volumeBaselineThroughput :: Maybe Int
volumeBaselineIOPS :: Maybe Int
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:volumeSize:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:volumeBurstThroughput:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:volumeBurstIOPS:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:volumeBaselineThroughput:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:volumeBaselineIOPS:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
volumeBaselineIOPS
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
volumeBaselineThroughput
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
volumeBurstIOPS
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
volumeBurstThroughput
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
volumeSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeType

instance Prelude.NFData VolumeConfiguration where
  rnf :: VolumeConfiguration -> ()
rnf VolumeConfiguration' {Maybe Int
Maybe Text
volumeType :: Maybe Text
volumeSize :: Maybe Int
volumeBurstThroughput :: Maybe Int
volumeBurstIOPS :: Maybe Int
volumeBaselineThroughput :: Maybe Int
volumeBaselineIOPS :: Maybe Int
$sel:volumeType:VolumeConfiguration' :: VolumeConfiguration -> Maybe Text
$sel:volumeSize:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:volumeBurstThroughput:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:volumeBurstIOPS:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:volumeBaselineThroughput:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
$sel:volumeBaselineIOPS:VolumeConfiguration' :: VolumeConfiguration -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumeBaselineIOPS
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumeBaselineThroughput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumeBurstIOPS
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumeBurstThroughput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumeSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeType