{-# 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.ComputeCapacityStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComputeCapacityStatus = ComputeCapacityStatus'
{
ComputeCapacityStatus -> Maybe Int
inUse :: Prelude.Maybe Prelude.Int,
ComputeCapacityStatus -> Maybe Int
running :: Prelude.Maybe Prelude.Int,
ComputeCapacityStatus -> Maybe Int
available :: Prelude.Maybe Prelude.Int,
ComputeCapacityStatus -> Int
desired :: Prelude.Int
}
deriving (ComputeCapacityStatus -> ComputeCapacityStatus -> Bool
(ComputeCapacityStatus -> ComputeCapacityStatus -> Bool)
-> (ComputeCapacityStatus -> ComputeCapacityStatus -> Bool)
-> Eq ComputeCapacityStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeCapacityStatus -> ComputeCapacityStatus -> Bool
$c/= :: ComputeCapacityStatus -> ComputeCapacityStatus -> Bool
== :: ComputeCapacityStatus -> ComputeCapacityStatus -> Bool
$c== :: ComputeCapacityStatus -> ComputeCapacityStatus -> Bool
Prelude.Eq, ReadPrec [ComputeCapacityStatus]
ReadPrec ComputeCapacityStatus
Int -> ReadS ComputeCapacityStatus
ReadS [ComputeCapacityStatus]
(Int -> ReadS ComputeCapacityStatus)
-> ReadS [ComputeCapacityStatus]
-> ReadPrec ComputeCapacityStatus
-> ReadPrec [ComputeCapacityStatus]
-> Read ComputeCapacityStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeCapacityStatus]
$creadListPrec :: ReadPrec [ComputeCapacityStatus]
readPrec :: ReadPrec ComputeCapacityStatus
$creadPrec :: ReadPrec ComputeCapacityStatus
readList :: ReadS [ComputeCapacityStatus]
$creadList :: ReadS [ComputeCapacityStatus]
readsPrec :: Int -> ReadS ComputeCapacityStatus
$creadsPrec :: Int -> ReadS ComputeCapacityStatus
Prelude.Read, Int -> ComputeCapacityStatus -> ShowS
[ComputeCapacityStatus] -> ShowS
ComputeCapacityStatus -> String
(Int -> ComputeCapacityStatus -> ShowS)
-> (ComputeCapacityStatus -> String)
-> ([ComputeCapacityStatus] -> ShowS)
-> Show ComputeCapacityStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeCapacityStatus] -> ShowS
$cshowList :: [ComputeCapacityStatus] -> ShowS
show :: ComputeCapacityStatus -> String
$cshow :: ComputeCapacityStatus -> String
showsPrec :: Int -> ComputeCapacityStatus -> ShowS
$cshowsPrec :: Int -> ComputeCapacityStatus -> ShowS
Prelude.Show, (forall x. ComputeCapacityStatus -> Rep ComputeCapacityStatus x)
-> (forall x. Rep ComputeCapacityStatus x -> ComputeCapacityStatus)
-> Generic ComputeCapacityStatus
forall x. Rep ComputeCapacityStatus x -> ComputeCapacityStatus
forall x. ComputeCapacityStatus -> Rep ComputeCapacityStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComputeCapacityStatus x -> ComputeCapacityStatus
$cfrom :: forall x. ComputeCapacityStatus -> Rep ComputeCapacityStatus x
Prelude.Generic)
newComputeCapacityStatus ::
Prelude.Int ->
ComputeCapacityStatus
newComputeCapacityStatus :: Int -> ComputeCapacityStatus
newComputeCapacityStatus Int
pDesired_ =
ComputeCapacityStatus' :: Maybe Int -> Maybe Int -> Maybe Int -> Int -> ComputeCapacityStatus
ComputeCapacityStatus'
{ $sel:inUse:ComputeCapacityStatus' :: Maybe Int
inUse = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:running:ComputeCapacityStatus' :: Maybe Int
running = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:available:ComputeCapacityStatus' :: Maybe Int
available = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:desired:ComputeCapacityStatus' :: Int
desired = Int
pDesired_
}
computeCapacityStatus_inUse :: Lens.Lens' ComputeCapacityStatus (Prelude.Maybe Prelude.Int)
computeCapacityStatus_inUse :: (Maybe Int -> f (Maybe Int))
-> ComputeCapacityStatus -> f ComputeCapacityStatus
computeCapacityStatus_inUse = (ComputeCapacityStatus -> Maybe Int)
-> (ComputeCapacityStatus -> Maybe Int -> ComputeCapacityStatus)
-> Lens
ComputeCapacityStatus ComputeCapacityStatus (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeCapacityStatus' {Maybe Int
inUse :: Maybe Int
$sel:inUse:ComputeCapacityStatus' :: ComputeCapacityStatus -> Maybe Int
inUse} -> Maybe Int
inUse) (\s :: ComputeCapacityStatus
s@ComputeCapacityStatus' {} Maybe Int
a -> ComputeCapacityStatus
s {$sel:inUse:ComputeCapacityStatus' :: Maybe Int
inUse = Maybe Int
a} :: ComputeCapacityStatus)
computeCapacityStatus_running :: Lens.Lens' ComputeCapacityStatus (Prelude.Maybe Prelude.Int)
computeCapacityStatus_running :: (Maybe Int -> f (Maybe Int))
-> ComputeCapacityStatus -> f ComputeCapacityStatus
computeCapacityStatus_running = (ComputeCapacityStatus -> Maybe Int)
-> (ComputeCapacityStatus -> Maybe Int -> ComputeCapacityStatus)
-> Lens
ComputeCapacityStatus ComputeCapacityStatus (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeCapacityStatus' {Maybe Int
running :: Maybe Int
$sel:running:ComputeCapacityStatus' :: ComputeCapacityStatus -> Maybe Int
running} -> Maybe Int
running) (\s :: ComputeCapacityStatus
s@ComputeCapacityStatus' {} Maybe Int
a -> ComputeCapacityStatus
s {$sel:running:ComputeCapacityStatus' :: Maybe Int
running = Maybe Int
a} :: ComputeCapacityStatus)
computeCapacityStatus_available :: Lens.Lens' ComputeCapacityStatus (Prelude.Maybe Prelude.Int)
computeCapacityStatus_available :: (Maybe Int -> f (Maybe Int))
-> ComputeCapacityStatus -> f ComputeCapacityStatus
computeCapacityStatus_available = (ComputeCapacityStatus -> Maybe Int)
-> (ComputeCapacityStatus -> Maybe Int -> ComputeCapacityStatus)
-> Lens
ComputeCapacityStatus ComputeCapacityStatus (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeCapacityStatus' {Maybe Int
available :: Maybe Int
$sel:available:ComputeCapacityStatus' :: ComputeCapacityStatus -> Maybe Int
available} -> Maybe Int
available) (\s :: ComputeCapacityStatus
s@ComputeCapacityStatus' {} Maybe Int
a -> ComputeCapacityStatus
s {$sel:available:ComputeCapacityStatus' :: Maybe Int
available = Maybe Int
a} :: ComputeCapacityStatus)
computeCapacityStatus_desired :: Lens.Lens' ComputeCapacityStatus Prelude.Int
computeCapacityStatus_desired :: (Int -> f Int) -> ComputeCapacityStatus -> f ComputeCapacityStatus
computeCapacityStatus_desired = (ComputeCapacityStatus -> Int)
-> (ComputeCapacityStatus -> Int -> ComputeCapacityStatus)
-> Lens ComputeCapacityStatus ComputeCapacityStatus Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeCapacityStatus' {Int
desired :: Int
$sel:desired:ComputeCapacityStatus' :: ComputeCapacityStatus -> Int
desired} -> Int
desired) (\s :: ComputeCapacityStatus
s@ComputeCapacityStatus' {} Int
a -> ComputeCapacityStatus
s {$sel:desired:ComputeCapacityStatus' :: Int
desired = Int
a} :: ComputeCapacityStatus)
instance Core.FromJSON ComputeCapacityStatus where
parseJSON :: Value -> Parser ComputeCapacityStatus
parseJSON =
String
-> (Object -> Parser ComputeCapacityStatus)
-> Value
-> Parser ComputeCapacityStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComputeCapacityStatus"
( \Object
x ->
Maybe Int -> Maybe Int -> Maybe Int -> Int -> ComputeCapacityStatus
ComputeCapacityStatus'
(Maybe Int
-> Maybe Int -> Maybe Int -> Int -> ComputeCapacityStatus)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> Int -> ComputeCapacityStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InUse")
Parser (Maybe Int -> Maybe Int -> Int -> ComputeCapacityStatus)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Int -> ComputeCapacityStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Running")
Parser (Maybe Int -> Int -> ComputeCapacityStatus)
-> Parser (Maybe Int) -> Parser (Int -> ComputeCapacityStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Available")
Parser (Int -> ComputeCapacityStatus)
-> Parser Int -> Parser ComputeCapacityStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Desired")
)
instance Prelude.Hashable ComputeCapacityStatus
instance Prelude.NFData ComputeCapacityStatus