{-# 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 #-}
module Amazonka.AppStream.Types.ComputeCapacity 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
data ComputeCapacity = ComputeCapacity'
{
ComputeCapacity -> Int
desiredInstances :: Prelude.Int
}
deriving (ComputeCapacity -> ComputeCapacity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeCapacity -> ComputeCapacity -> Bool
$c/= :: ComputeCapacity -> ComputeCapacity -> Bool
== :: ComputeCapacity -> ComputeCapacity -> Bool
$c== :: ComputeCapacity -> ComputeCapacity -> Bool
Prelude.Eq, ReadPrec [ComputeCapacity]
ReadPrec ComputeCapacity
Int -> ReadS ComputeCapacity
ReadS [ComputeCapacity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeCapacity]
$creadListPrec :: ReadPrec [ComputeCapacity]
readPrec :: ReadPrec ComputeCapacity
$creadPrec :: ReadPrec ComputeCapacity
readList :: ReadS [ComputeCapacity]
$creadList :: ReadS [ComputeCapacity]
readsPrec :: Int -> ReadS ComputeCapacity
$creadsPrec :: Int -> ReadS ComputeCapacity
Prelude.Read, Int -> ComputeCapacity -> ShowS
[ComputeCapacity] -> ShowS
ComputeCapacity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeCapacity] -> ShowS
$cshowList :: [ComputeCapacity] -> ShowS
show :: ComputeCapacity -> String
$cshow :: ComputeCapacity -> String
showsPrec :: Int -> ComputeCapacity -> ShowS
$cshowsPrec :: Int -> ComputeCapacity -> ShowS
Prelude.Show, forall x. Rep ComputeCapacity x -> ComputeCapacity
forall x. ComputeCapacity -> Rep ComputeCapacity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComputeCapacity x -> ComputeCapacity
$cfrom :: forall x. ComputeCapacity -> Rep ComputeCapacity x
Prelude.Generic)
newComputeCapacity ::
Prelude.Int ->
ComputeCapacity
newComputeCapacity :: Int -> ComputeCapacity
newComputeCapacity Int
pDesiredInstances_ =
ComputeCapacity'
{ $sel:desiredInstances:ComputeCapacity' :: Int
desiredInstances =
Int
pDesiredInstances_
}
computeCapacity_desiredInstances :: Lens.Lens' ComputeCapacity Prelude.Int
computeCapacity_desiredInstances :: Lens' ComputeCapacity Int
computeCapacity_desiredInstances = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeCapacity' {Int
desiredInstances :: Int
$sel:desiredInstances:ComputeCapacity' :: ComputeCapacity -> Int
desiredInstances} -> Int
desiredInstances) (\s :: ComputeCapacity
s@ComputeCapacity' {} Int
a -> ComputeCapacity
s {$sel:desiredInstances:ComputeCapacity' :: Int
desiredInstances = Int
a} :: ComputeCapacity)
instance Prelude.Hashable ComputeCapacity where
hashWithSalt :: Int -> ComputeCapacity -> Int
hashWithSalt Int
_salt ComputeCapacity' {Int
desiredInstances :: Int
$sel:desiredInstances:ComputeCapacity' :: ComputeCapacity -> Int
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
desiredInstances
instance Prelude.NFData ComputeCapacity where
rnf :: ComputeCapacity -> ()
rnf ComputeCapacity' {Int
desiredInstances :: Int
$sel:desiredInstances:ComputeCapacity' :: ComputeCapacity -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
desiredInstances
instance Data.ToJSON ComputeCapacity where
toJSON :: ComputeCapacity -> Value
toJSON ComputeCapacity' {Int
desiredInstances :: Int
$sel:desiredInstances:ComputeCapacity' :: ComputeCapacity -> Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"DesiredInstances" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
desiredInstances)
]
)