{-# 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.EC2.Types.TotalLocalStorageGB
-- 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.EC2.Types.TotalLocalStorageGB where

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

-- | The minimum and maximum amount of total local storage, in GB.
--
-- /See:/ 'newTotalLocalStorageGB' smart constructor.
data TotalLocalStorageGB = TotalLocalStorageGB'
  { -- | The maximum amount of total local storage, in GB. If this parameter is
    -- not specified, there is no maximum limit.
    TotalLocalStorageGB -> Maybe Double
max :: Prelude.Maybe Prelude.Double,
    -- | The minimum amount of total local storage, in GB. If this parameter is
    -- not specified, there is no minimum limit.
    TotalLocalStorageGB -> Maybe Double
min :: Prelude.Maybe Prelude.Double
  }
  deriving (TotalLocalStorageGB -> TotalLocalStorageGB -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TotalLocalStorageGB -> TotalLocalStorageGB -> Bool
$c/= :: TotalLocalStorageGB -> TotalLocalStorageGB -> Bool
== :: TotalLocalStorageGB -> TotalLocalStorageGB -> Bool
$c== :: TotalLocalStorageGB -> TotalLocalStorageGB -> Bool
Prelude.Eq, ReadPrec [TotalLocalStorageGB]
ReadPrec TotalLocalStorageGB
Int -> ReadS TotalLocalStorageGB
ReadS [TotalLocalStorageGB]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TotalLocalStorageGB]
$creadListPrec :: ReadPrec [TotalLocalStorageGB]
readPrec :: ReadPrec TotalLocalStorageGB
$creadPrec :: ReadPrec TotalLocalStorageGB
readList :: ReadS [TotalLocalStorageGB]
$creadList :: ReadS [TotalLocalStorageGB]
readsPrec :: Int -> ReadS TotalLocalStorageGB
$creadsPrec :: Int -> ReadS TotalLocalStorageGB
Prelude.Read, Int -> TotalLocalStorageGB -> ShowS
[TotalLocalStorageGB] -> ShowS
TotalLocalStorageGB -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TotalLocalStorageGB] -> ShowS
$cshowList :: [TotalLocalStorageGB] -> ShowS
show :: TotalLocalStorageGB -> String
$cshow :: TotalLocalStorageGB -> String
showsPrec :: Int -> TotalLocalStorageGB -> ShowS
$cshowsPrec :: Int -> TotalLocalStorageGB -> ShowS
Prelude.Show, forall x. Rep TotalLocalStorageGB x -> TotalLocalStorageGB
forall x. TotalLocalStorageGB -> Rep TotalLocalStorageGB x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TotalLocalStorageGB x -> TotalLocalStorageGB
$cfrom :: forall x. TotalLocalStorageGB -> Rep TotalLocalStorageGB x
Prelude.Generic)

-- |
-- Create a value of 'TotalLocalStorageGB' 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:
--
-- 'max', 'totalLocalStorageGB_max' - The maximum amount of total local storage, in GB. If this parameter is
-- not specified, there is no maximum limit.
--
-- 'min', 'totalLocalStorageGB_min' - The minimum amount of total local storage, in GB. If this parameter is
-- not specified, there is no minimum limit.
newTotalLocalStorageGB ::
  TotalLocalStorageGB
newTotalLocalStorageGB :: TotalLocalStorageGB
newTotalLocalStorageGB =
  TotalLocalStorageGB'
    { $sel:max:TotalLocalStorageGB' :: Maybe Double
max = forall a. Maybe a
Prelude.Nothing,
      $sel:min:TotalLocalStorageGB' :: Maybe Double
min = forall a. Maybe a
Prelude.Nothing
    }

-- | The maximum amount of total local storage, in GB. If this parameter is
-- not specified, there is no maximum limit.
totalLocalStorageGB_max :: Lens.Lens' TotalLocalStorageGB (Prelude.Maybe Prelude.Double)
totalLocalStorageGB_max :: Lens' TotalLocalStorageGB (Maybe Double)
totalLocalStorageGB_max = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TotalLocalStorageGB' {Maybe Double
max :: Maybe Double
$sel:max:TotalLocalStorageGB' :: TotalLocalStorageGB -> Maybe Double
max} -> Maybe Double
max) (\s :: TotalLocalStorageGB
s@TotalLocalStorageGB' {} Maybe Double
a -> TotalLocalStorageGB
s {$sel:max:TotalLocalStorageGB' :: Maybe Double
max = Maybe Double
a} :: TotalLocalStorageGB)

-- | The minimum amount of total local storage, in GB. If this parameter is
-- not specified, there is no minimum limit.
totalLocalStorageGB_min :: Lens.Lens' TotalLocalStorageGB (Prelude.Maybe Prelude.Double)
totalLocalStorageGB_min :: Lens' TotalLocalStorageGB (Maybe Double)
totalLocalStorageGB_min = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TotalLocalStorageGB' {Maybe Double
min :: Maybe Double
$sel:min:TotalLocalStorageGB' :: TotalLocalStorageGB -> Maybe Double
min} -> Maybe Double
min) (\s :: TotalLocalStorageGB
s@TotalLocalStorageGB' {} Maybe Double
a -> TotalLocalStorageGB
s {$sel:min:TotalLocalStorageGB' :: Maybe Double
min = Maybe Double
a} :: TotalLocalStorageGB)

instance Data.FromXML TotalLocalStorageGB where
  parseXML :: [Node] -> Either String TotalLocalStorageGB
parseXML [Node]
x =
    Maybe Double -> Maybe Double -> TotalLocalStorageGB
TotalLocalStorageGB'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"max")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"min")

instance Prelude.Hashable TotalLocalStorageGB where
  hashWithSalt :: Int -> TotalLocalStorageGB -> Int
hashWithSalt Int
_salt TotalLocalStorageGB' {Maybe Double
min :: Maybe Double
max :: Maybe Double
$sel:min:TotalLocalStorageGB' :: TotalLocalStorageGB -> Maybe Double
$sel:max:TotalLocalStorageGB' :: TotalLocalStorageGB -> Maybe Double
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
max
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
min

instance Prelude.NFData TotalLocalStorageGB where
  rnf :: TotalLocalStorageGB -> ()
rnf TotalLocalStorageGB' {Maybe Double
min :: Maybe Double
max :: Maybe Double
$sel:min:TotalLocalStorageGB' :: TotalLocalStorageGB -> Maybe Double
$sel:max:TotalLocalStorageGB' :: TotalLocalStorageGB -> Maybe Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
max seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
min

instance Data.ToQuery TotalLocalStorageGB where
  toQuery :: TotalLocalStorageGB -> QueryString
toQuery TotalLocalStorageGB' {Maybe Double
min :: Maybe Double
max :: Maybe Double
$sel:min:TotalLocalStorageGB' :: TotalLocalStorageGB -> Maybe Double
$sel:max:TotalLocalStorageGB' :: TotalLocalStorageGB -> Maybe Double
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"Max" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Double
max, ByteString
"Min" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Double
min]