{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComputeCapacity = ComputeCapacity'
{
ComputeCapacity -> Int
desiredInstances :: Prelude.Int
}
deriving (ComputeCapacity -> ComputeCapacity -> Bool
(ComputeCapacity -> ComputeCapacity -> Bool)
-> (ComputeCapacity -> ComputeCapacity -> Bool)
-> Eq ComputeCapacity
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]
(Int -> ReadS ComputeCapacity)
-> ReadS [ComputeCapacity]
-> ReadPrec ComputeCapacity
-> ReadPrec [ComputeCapacity]
-> Read 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
(Int -> ComputeCapacity -> ShowS)
-> (ComputeCapacity -> String)
-> ([ComputeCapacity] -> ShowS)
-> Show ComputeCapacity
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. ComputeCapacity -> Rep ComputeCapacity x)
-> (forall x. Rep ComputeCapacity x -> ComputeCapacity)
-> Generic ComputeCapacity
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' :: Int -> ComputeCapacity
ComputeCapacity'
{ $sel:desiredInstances:ComputeCapacity' :: Int
desiredInstances =
Int
pDesiredInstances_
}
computeCapacity_desiredInstances :: Lens.Lens' ComputeCapacity Prelude.Int
computeCapacity_desiredInstances :: (Int -> f Int) -> ComputeCapacity -> f ComputeCapacity
computeCapacity_desiredInstances = (ComputeCapacity -> Int)
-> (ComputeCapacity -> Int -> ComputeCapacity)
-> Lens ComputeCapacity ComputeCapacity Int Int
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
instance Prelude.NFData ComputeCapacity
instance Core.ToJSON ComputeCapacity where
toJSON :: ComputeCapacity -> Value
toJSON ComputeCapacity' {Int
desiredInstances :: Int
$sel:desiredInstances:ComputeCapacity' :: ComputeCapacity -> Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DesiredInstances" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
desiredInstances)
]
)