{-# 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.Batch.Types.ComputeResourceUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComputeResourceUpdate = ComputeResourceUpdate'
{
ComputeResourceUpdate -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
ComputeResourceUpdate -> Maybe [Text]
subnets :: Prelude.Maybe [Prelude.Text],
ComputeResourceUpdate -> Maybe Int
minvCpus :: Prelude.Maybe Prelude.Int,
ComputeResourceUpdate -> Maybe Int
maxvCpus :: Prelude.Maybe Prelude.Int,
ComputeResourceUpdate -> Maybe Int
desiredvCpus :: Prelude.Maybe Prelude.Int
}
deriving (ComputeResourceUpdate -> ComputeResourceUpdate -> Bool
(ComputeResourceUpdate -> ComputeResourceUpdate -> Bool)
-> (ComputeResourceUpdate -> ComputeResourceUpdate -> Bool)
-> Eq ComputeResourceUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeResourceUpdate -> ComputeResourceUpdate -> Bool
$c/= :: ComputeResourceUpdate -> ComputeResourceUpdate -> Bool
== :: ComputeResourceUpdate -> ComputeResourceUpdate -> Bool
$c== :: ComputeResourceUpdate -> ComputeResourceUpdate -> Bool
Prelude.Eq, ReadPrec [ComputeResourceUpdate]
ReadPrec ComputeResourceUpdate
Int -> ReadS ComputeResourceUpdate
ReadS [ComputeResourceUpdate]
(Int -> ReadS ComputeResourceUpdate)
-> ReadS [ComputeResourceUpdate]
-> ReadPrec ComputeResourceUpdate
-> ReadPrec [ComputeResourceUpdate]
-> Read ComputeResourceUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeResourceUpdate]
$creadListPrec :: ReadPrec [ComputeResourceUpdate]
readPrec :: ReadPrec ComputeResourceUpdate
$creadPrec :: ReadPrec ComputeResourceUpdate
readList :: ReadS [ComputeResourceUpdate]
$creadList :: ReadS [ComputeResourceUpdate]
readsPrec :: Int -> ReadS ComputeResourceUpdate
$creadsPrec :: Int -> ReadS ComputeResourceUpdate
Prelude.Read, Int -> ComputeResourceUpdate -> ShowS
[ComputeResourceUpdate] -> ShowS
ComputeResourceUpdate -> String
(Int -> ComputeResourceUpdate -> ShowS)
-> (ComputeResourceUpdate -> String)
-> ([ComputeResourceUpdate] -> ShowS)
-> Show ComputeResourceUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeResourceUpdate] -> ShowS
$cshowList :: [ComputeResourceUpdate] -> ShowS
show :: ComputeResourceUpdate -> String
$cshow :: ComputeResourceUpdate -> String
showsPrec :: Int -> ComputeResourceUpdate -> ShowS
$cshowsPrec :: Int -> ComputeResourceUpdate -> ShowS
Prelude.Show, (forall x. ComputeResourceUpdate -> Rep ComputeResourceUpdate x)
-> (forall x. Rep ComputeResourceUpdate x -> ComputeResourceUpdate)
-> Generic ComputeResourceUpdate
forall x. Rep ComputeResourceUpdate x -> ComputeResourceUpdate
forall x. ComputeResourceUpdate -> Rep ComputeResourceUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComputeResourceUpdate x -> ComputeResourceUpdate
$cfrom :: forall x. ComputeResourceUpdate -> Rep ComputeResourceUpdate x
Prelude.Generic)
newComputeResourceUpdate ::
ComputeResourceUpdate
newComputeResourceUpdate :: ComputeResourceUpdate
newComputeResourceUpdate =
ComputeResourceUpdate' :: Maybe [Text]
-> Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ComputeResourceUpdate
ComputeResourceUpdate'
{ $sel:securityGroupIds:ComputeResourceUpdate' :: Maybe [Text]
securityGroupIds =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:subnets:ComputeResourceUpdate' :: Maybe [Text]
subnets = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:minvCpus:ComputeResourceUpdate' :: Maybe Int
minvCpus = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:maxvCpus:ComputeResourceUpdate' :: Maybe Int
maxvCpus = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:desiredvCpus:ComputeResourceUpdate' :: Maybe Int
desiredvCpus = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
computeResourceUpdate_securityGroupIds :: Lens.Lens' ComputeResourceUpdate (Prelude.Maybe [Prelude.Text])
computeResourceUpdate_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ComputeResourceUpdate -> f ComputeResourceUpdate
computeResourceUpdate_securityGroupIds = (ComputeResourceUpdate -> Maybe [Text])
-> (ComputeResourceUpdate -> Maybe [Text] -> ComputeResourceUpdate)
-> Lens
ComputeResourceUpdate
ComputeResourceUpdate
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeResourceUpdate' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: ComputeResourceUpdate
s@ComputeResourceUpdate' {} Maybe [Text]
a -> ComputeResourceUpdate
s {$sel:securityGroupIds:ComputeResourceUpdate' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: ComputeResourceUpdate) ((Maybe [Text] -> f (Maybe [Text]))
-> ComputeResourceUpdate -> f ComputeResourceUpdate)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ComputeResourceUpdate
-> f ComputeResourceUpdate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
computeResourceUpdate_subnets :: Lens.Lens' ComputeResourceUpdate (Prelude.Maybe [Prelude.Text])
computeResourceUpdate_subnets :: (Maybe [Text] -> f (Maybe [Text]))
-> ComputeResourceUpdate -> f ComputeResourceUpdate
computeResourceUpdate_subnets = (ComputeResourceUpdate -> Maybe [Text])
-> (ComputeResourceUpdate -> Maybe [Text] -> ComputeResourceUpdate)
-> Lens
ComputeResourceUpdate
ComputeResourceUpdate
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeResourceUpdate' {Maybe [Text]
subnets :: Maybe [Text]
$sel:subnets:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe [Text]
subnets} -> Maybe [Text]
subnets) (\s :: ComputeResourceUpdate
s@ComputeResourceUpdate' {} Maybe [Text]
a -> ComputeResourceUpdate
s {$sel:subnets:ComputeResourceUpdate' :: Maybe [Text]
subnets = Maybe [Text]
a} :: ComputeResourceUpdate) ((Maybe [Text] -> f (Maybe [Text]))
-> ComputeResourceUpdate -> f ComputeResourceUpdate)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ComputeResourceUpdate
-> f ComputeResourceUpdate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
computeResourceUpdate_minvCpus :: Lens.Lens' ComputeResourceUpdate (Prelude.Maybe Prelude.Int)
computeResourceUpdate_minvCpus :: (Maybe Int -> f (Maybe Int))
-> ComputeResourceUpdate -> f ComputeResourceUpdate
computeResourceUpdate_minvCpus = (ComputeResourceUpdate -> Maybe Int)
-> (ComputeResourceUpdate -> Maybe Int -> ComputeResourceUpdate)
-> Lens
ComputeResourceUpdate ComputeResourceUpdate (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeResourceUpdate' {Maybe Int
minvCpus :: Maybe Int
$sel:minvCpus:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe Int
minvCpus} -> Maybe Int
minvCpus) (\s :: ComputeResourceUpdate
s@ComputeResourceUpdate' {} Maybe Int
a -> ComputeResourceUpdate
s {$sel:minvCpus:ComputeResourceUpdate' :: Maybe Int
minvCpus = Maybe Int
a} :: ComputeResourceUpdate)
computeResourceUpdate_maxvCpus :: Lens.Lens' ComputeResourceUpdate (Prelude.Maybe Prelude.Int)
computeResourceUpdate_maxvCpus :: (Maybe Int -> f (Maybe Int))
-> ComputeResourceUpdate -> f ComputeResourceUpdate
computeResourceUpdate_maxvCpus = (ComputeResourceUpdate -> Maybe Int)
-> (ComputeResourceUpdate -> Maybe Int -> ComputeResourceUpdate)
-> Lens
ComputeResourceUpdate ComputeResourceUpdate (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeResourceUpdate' {Maybe Int
maxvCpus :: Maybe Int
$sel:maxvCpus:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe Int
maxvCpus} -> Maybe Int
maxvCpus) (\s :: ComputeResourceUpdate
s@ComputeResourceUpdate' {} Maybe Int
a -> ComputeResourceUpdate
s {$sel:maxvCpus:ComputeResourceUpdate' :: Maybe Int
maxvCpus = Maybe Int
a} :: ComputeResourceUpdate)
computeResourceUpdate_desiredvCpus :: Lens.Lens' ComputeResourceUpdate (Prelude.Maybe Prelude.Int)
computeResourceUpdate_desiredvCpus :: (Maybe Int -> f (Maybe Int))
-> ComputeResourceUpdate -> f ComputeResourceUpdate
computeResourceUpdate_desiredvCpus = (ComputeResourceUpdate -> Maybe Int)
-> (ComputeResourceUpdate -> Maybe Int -> ComputeResourceUpdate)
-> Lens
ComputeResourceUpdate ComputeResourceUpdate (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeResourceUpdate' {Maybe Int
desiredvCpus :: Maybe Int
$sel:desiredvCpus:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe Int
desiredvCpus} -> Maybe Int
desiredvCpus) (\s :: ComputeResourceUpdate
s@ComputeResourceUpdate' {} Maybe Int
a -> ComputeResourceUpdate
s {$sel:desiredvCpus:ComputeResourceUpdate' :: Maybe Int
desiredvCpus = Maybe Int
a} :: ComputeResourceUpdate)
instance Prelude.Hashable ComputeResourceUpdate
instance Prelude.NFData ComputeResourceUpdate
instance Core.ToJSON ComputeResourceUpdate where
toJSON :: ComputeResourceUpdate -> Value
toJSON ComputeResourceUpdate' {Maybe Int
Maybe [Text]
desiredvCpus :: Maybe Int
maxvCpus :: Maybe Int
minvCpus :: Maybe Int
subnets :: Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:desiredvCpus:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe Int
$sel:maxvCpus:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe Int
$sel:minvCpus:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe Int
$sel:subnets:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe [Text]
$sel:securityGroupIds:ComputeResourceUpdate' :: ComputeResourceUpdate -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"securityGroupIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds,
(Text
"subnets" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnets,
(Text
"minvCpus" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
minvCpus,
(Text
"maxvCpus" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxvCpus,
(Text
"desiredvCpus" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
desiredvCpus
]
)