{-# 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.AcceleratorCountRequest
-- 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.AcceleratorCountRequest 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 @AcceleratorCount@ object when
-- you specify InstanceRequirements for an Auto Scaling group.
--
-- /See:/ 'newAcceleratorCountRequest' smart constructor.
data AcceleratorCountRequest = AcceleratorCountRequest'
  { -- | The maximum value.
    AcceleratorCountRequest -> Maybe Natural
max :: Prelude.Maybe Prelude.Natural,
    -- | The minimum value.
    AcceleratorCountRequest -> Maybe Natural
min :: Prelude.Maybe Prelude.Natural
  }
  deriving (AcceleratorCountRequest -> AcceleratorCountRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceleratorCountRequest -> AcceleratorCountRequest -> Bool
$c/= :: AcceleratorCountRequest -> AcceleratorCountRequest -> Bool
== :: AcceleratorCountRequest -> AcceleratorCountRequest -> Bool
$c== :: AcceleratorCountRequest -> AcceleratorCountRequest -> Bool
Prelude.Eq, ReadPrec [AcceleratorCountRequest]
ReadPrec AcceleratorCountRequest
Int -> ReadS AcceleratorCountRequest
ReadS [AcceleratorCountRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceleratorCountRequest]
$creadListPrec :: ReadPrec [AcceleratorCountRequest]
readPrec :: ReadPrec AcceleratorCountRequest
$creadPrec :: ReadPrec AcceleratorCountRequest
readList :: ReadS [AcceleratorCountRequest]
$creadList :: ReadS [AcceleratorCountRequest]
readsPrec :: Int -> ReadS AcceleratorCountRequest
$creadsPrec :: Int -> ReadS AcceleratorCountRequest
Prelude.Read, Int -> AcceleratorCountRequest -> ShowS
[AcceleratorCountRequest] -> ShowS
AcceleratorCountRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceleratorCountRequest] -> ShowS
$cshowList :: [AcceleratorCountRequest] -> ShowS
show :: AcceleratorCountRequest -> String
$cshow :: AcceleratorCountRequest -> String
showsPrec :: Int -> AcceleratorCountRequest -> ShowS
$cshowsPrec :: Int -> AcceleratorCountRequest -> ShowS
Prelude.Show, forall x. Rep AcceleratorCountRequest x -> AcceleratorCountRequest
forall x. AcceleratorCountRequest -> Rep AcceleratorCountRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AcceleratorCountRequest x -> AcceleratorCountRequest
$cfrom :: forall x. AcceleratorCountRequest -> Rep AcceleratorCountRequest x
Prelude.Generic)

-- |
-- Create a value of 'AcceleratorCountRequest' 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', 'acceleratorCountRequest_max' - The maximum value.
--
-- 'min', 'acceleratorCountRequest_min' - The minimum value.
newAcceleratorCountRequest ::
  AcceleratorCountRequest
newAcceleratorCountRequest :: AcceleratorCountRequest
newAcceleratorCountRequest =
  AcceleratorCountRequest'
    { $sel:max:AcceleratorCountRequest' :: Maybe Natural
max = forall a. Maybe a
Prelude.Nothing,
      $sel:min:AcceleratorCountRequest' :: Maybe Natural
min = forall a. Maybe a
Prelude.Nothing
    }

-- | The maximum value.
acceleratorCountRequest_max :: Lens.Lens' AcceleratorCountRequest (Prelude.Maybe Prelude.Natural)
acceleratorCountRequest_max :: Lens' AcceleratorCountRequest (Maybe Natural)
acceleratorCountRequest_max = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceleratorCountRequest' {Maybe Natural
max :: Maybe Natural
$sel:max:AcceleratorCountRequest' :: AcceleratorCountRequest -> Maybe Natural
max} -> Maybe Natural
max) (\s :: AcceleratorCountRequest
s@AcceleratorCountRequest' {} Maybe Natural
a -> AcceleratorCountRequest
s {$sel:max:AcceleratorCountRequest' :: Maybe Natural
max = Maybe Natural
a} :: AcceleratorCountRequest)

-- | The minimum value.
acceleratorCountRequest_min :: Lens.Lens' AcceleratorCountRequest (Prelude.Maybe Prelude.Natural)
acceleratorCountRequest_min :: Lens' AcceleratorCountRequest (Maybe Natural)
acceleratorCountRequest_min = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceleratorCountRequest' {Maybe Natural
min :: Maybe Natural
$sel:min:AcceleratorCountRequest' :: AcceleratorCountRequest -> Maybe Natural
min} -> Maybe Natural
min) (\s :: AcceleratorCountRequest
s@AcceleratorCountRequest' {} Maybe Natural
a -> AcceleratorCountRequest
s {$sel:min:AcceleratorCountRequest' :: Maybe Natural
min = Maybe Natural
a} :: AcceleratorCountRequest)

instance Data.FromXML AcceleratorCountRequest where
  parseXML :: [Node] -> Either String AcceleratorCountRequest
parseXML [Node]
x =
    Maybe Natural -> Maybe Natural -> AcceleratorCountRequest
AcceleratorCountRequest'
      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 AcceleratorCountRequest where
  hashWithSalt :: Int -> AcceleratorCountRequest -> Int
hashWithSalt Int
_salt AcceleratorCountRequest' {Maybe Natural
min :: Maybe Natural
max :: Maybe Natural
$sel:min:AcceleratorCountRequest' :: AcceleratorCountRequest -> Maybe Natural
$sel:max:AcceleratorCountRequest' :: AcceleratorCountRequest -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
max
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
min

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

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