{-# 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.AutoScaling.Types.TotalLocalStorageGBRequest
-- 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.AutoScaling.Types.TotalLocalStorageGBRequest 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

-- | Specifies the minimum and maximum for the @TotalLocalStorageGB@ object
-- when you specify InstanceRequirements for an Auto Scaling group.
--
-- /See:/ 'newTotalLocalStorageGBRequest' smart constructor.
data TotalLocalStorageGBRequest = TotalLocalStorageGBRequest'
  { -- | The storage maximum in GB.
    TotalLocalStorageGBRequest -> Maybe Double
max :: Prelude.Maybe Prelude.Double,
    -- | The storage minimum in GB.
    TotalLocalStorageGBRequest -> Maybe Double
min :: Prelude.Maybe Prelude.Double
  }
  deriving (TotalLocalStorageGBRequest -> TotalLocalStorageGBRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TotalLocalStorageGBRequest -> TotalLocalStorageGBRequest -> Bool
$c/= :: TotalLocalStorageGBRequest -> TotalLocalStorageGBRequest -> Bool
== :: TotalLocalStorageGBRequest -> TotalLocalStorageGBRequest -> Bool
$c== :: TotalLocalStorageGBRequest -> TotalLocalStorageGBRequest -> Bool
Prelude.Eq, ReadPrec [TotalLocalStorageGBRequest]
ReadPrec TotalLocalStorageGBRequest
Int -> ReadS TotalLocalStorageGBRequest
ReadS [TotalLocalStorageGBRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TotalLocalStorageGBRequest]
$creadListPrec :: ReadPrec [TotalLocalStorageGBRequest]
readPrec :: ReadPrec TotalLocalStorageGBRequest
$creadPrec :: ReadPrec TotalLocalStorageGBRequest
readList :: ReadS [TotalLocalStorageGBRequest]
$creadList :: ReadS [TotalLocalStorageGBRequest]
readsPrec :: Int -> ReadS TotalLocalStorageGBRequest
$creadsPrec :: Int -> ReadS TotalLocalStorageGBRequest
Prelude.Read, Int -> TotalLocalStorageGBRequest -> ShowS
[TotalLocalStorageGBRequest] -> ShowS
TotalLocalStorageGBRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TotalLocalStorageGBRequest] -> ShowS
$cshowList :: [TotalLocalStorageGBRequest] -> ShowS
show :: TotalLocalStorageGBRequest -> String
$cshow :: TotalLocalStorageGBRequest -> String
showsPrec :: Int -> TotalLocalStorageGBRequest -> ShowS
$cshowsPrec :: Int -> TotalLocalStorageGBRequest -> ShowS
Prelude.Show, forall x.
Rep TotalLocalStorageGBRequest x -> TotalLocalStorageGBRequest
forall x.
TotalLocalStorageGBRequest -> Rep TotalLocalStorageGBRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TotalLocalStorageGBRequest x -> TotalLocalStorageGBRequest
$cfrom :: forall x.
TotalLocalStorageGBRequest -> Rep TotalLocalStorageGBRequest x
Prelude.Generic)

-- |
-- Create a value of 'TotalLocalStorageGBRequest' 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', 'totalLocalStorageGBRequest_max' - The storage maximum in GB.
--
-- 'min', 'totalLocalStorageGBRequest_min' - The storage minimum in GB.
newTotalLocalStorageGBRequest ::
  TotalLocalStorageGBRequest
newTotalLocalStorageGBRequest :: TotalLocalStorageGBRequest
newTotalLocalStorageGBRequest =
  TotalLocalStorageGBRequest'
    { $sel:max:TotalLocalStorageGBRequest' :: Maybe Double
max = forall a. Maybe a
Prelude.Nothing,
      $sel:min:TotalLocalStorageGBRequest' :: Maybe Double
min = forall a. Maybe a
Prelude.Nothing
    }

-- | The storage maximum in GB.
totalLocalStorageGBRequest_max :: Lens.Lens' TotalLocalStorageGBRequest (Prelude.Maybe Prelude.Double)
totalLocalStorageGBRequest_max :: Lens' TotalLocalStorageGBRequest (Maybe Double)
totalLocalStorageGBRequest_max = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TotalLocalStorageGBRequest' {Maybe Double
max :: Maybe Double
$sel:max:TotalLocalStorageGBRequest' :: TotalLocalStorageGBRequest -> Maybe Double
max} -> Maybe Double
max) (\s :: TotalLocalStorageGBRequest
s@TotalLocalStorageGBRequest' {} Maybe Double
a -> TotalLocalStorageGBRequest
s {$sel:max:TotalLocalStorageGBRequest' :: Maybe Double
max = Maybe Double
a} :: TotalLocalStorageGBRequest)

-- | The storage minimum in GB.
totalLocalStorageGBRequest_min :: Lens.Lens' TotalLocalStorageGBRequest (Prelude.Maybe Prelude.Double)
totalLocalStorageGBRequest_min :: Lens' TotalLocalStorageGBRequest (Maybe Double)
totalLocalStorageGBRequest_min = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TotalLocalStorageGBRequest' {Maybe Double
min :: Maybe Double
$sel:min:TotalLocalStorageGBRequest' :: TotalLocalStorageGBRequest -> Maybe Double
min} -> Maybe Double
min) (\s :: TotalLocalStorageGBRequest
s@TotalLocalStorageGBRequest' {} Maybe Double
a -> TotalLocalStorageGBRequest
s {$sel:min:TotalLocalStorageGBRequest' :: Maybe Double
min = Maybe Double
a} :: TotalLocalStorageGBRequest)

instance Data.FromXML TotalLocalStorageGBRequest where
  parseXML :: [Node] -> Either String TotalLocalStorageGBRequest
parseXML [Node]
x =
    Maybe Double -> Maybe Double -> TotalLocalStorageGBRequest
TotalLocalStorageGBRequest'
      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 TotalLocalStorageGBRequest where
  hashWithSalt :: Int -> TotalLocalStorageGBRequest -> Int
hashWithSalt Int
_salt TotalLocalStorageGBRequest' {Maybe Double
min :: Maybe Double
max :: Maybe Double
$sel:min:TotalLocalStorageGBRequest' :: TotalLocalStorageGBRequest -> Maybe Double
$sel:max:TotalLocalStorageGBRequest' :: TotalLocalStorageGBRequest -> 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 TotalLocalStorageGBRequest where
  rnf :: TotalLocalStorageGBRequest -> ()
rnf TotalLocalStorageGBRequest' {Maybe Double
min :: Maybe Double
max :: Maybe Double
$sel:min:TotalLocalStorageGBRequest' :: TotalLocalStorageGBRequest -> Maybe Double
$sel:max:TotalLocalStorageGBRequest' :: TotalLocalStorageGBRequest -> 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 TotalLocalStorageGBRequest where
  toQuery :: TotalLocalStorageGBRequest -> QueryString
toQuery TotalLocalStorageGBRequest' {Maybe Double
min :: Maybe Double
max :: Maybe Double
$sel:min:TotalLocalStorageGBRequest' :: TotalLocalStorageGBRequest -> Maybe Double
$sel:max:TotalLocalStorageGBRequest' :: TotalLocalStorageGBRequest -> 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]