{-# 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.ComputeEnvironmentOrder where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComputeEnvironmentOrder = ComputeEnvironmentOrder'
{
ComputeEnvironmentOrder -> Int
order :: Prelude.Int,
ComputeEnvironmentOrder -> Text
computeEnvironment :: Prelude.Text
}
deriving (ComputeEnvironmentOrder -> ComputeEnvironmentOrder -> Bool
(ComputeEnvironmentOrder -> ComputeEnvironmentOrder -> Bool)
-> (ComputeEnvironmentOrder -> ComputeEnvironmentOrder -> Bool)
-> Eq ComputeEnvironmentOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeEnvironmentOrder -> ComputeEnvironmentOrder -> Bool
$c/= :: ComputeEnvironmentOrder -> ComputeEnvironmentOrder -> Bool
== :: ComputeEnvironmentOrder -> ComputeEnvironmentOrder -> Bool
$c== :: ComputeEnvironmentOrder -> ComputeEnvironmentOrder -> Bool
Prelude.Eq, ReadPrec [ComputeEnvironmentOrder]
ReadPrec ComputeEnvironmentOrder
Int -> ReadS ComputeEnvironmentOrder
ReadS [ComputeEnvironmentOrder]
(Int -> ReadS ComputeEnvironmentOrder)
-> ReadS [ComputeEnvironmentOrder]
-> ReadPrec ComputeEnvironmentOrder
-> ReadPrec [ComputeEnvironmentOrder]
-> Read ComputeEnvironmentOrder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeEnvironmentOrder]
$creadListPrec :: ReadPrec [ComputeEnvironmentOrder]
readPrec :: ReadPrec ComputeEnvironmentOrder
$creadPrec :: ReadPrec ComputeEnvironmentOrder
readList :: ReadS [ComputeEnvironmentOrder]
$creadList :: ReadS [ComputeEnvironmentOrder]
readsPrec :: Int -> ReadS ComputeEnvironmentOrder
$creadsPrec :: Int -> ReadS ComputeEnvironmentOrder
Prelude.Read, Int -> ComputeEnvironmentOrder -> ShowS
[ComputeEnvironmentOrder] -> ShowS
ComputeEnvironmentOrder -> String
(Int -> ComputeEnvironmentOrder -> ShowS)
-> (ComputeEnvironmentOrder -> String)
-> ([ComputeEnvironmentOrder] -> ShowS)
-> Show ComputeEnvironmentOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeEnvironmentOrder] -> ShowS
$cshowList :: [ComputeEnvironmentOrder] -> ShowS
show :: ComputeEnvironmentOrder -> String
$cshow :: ComputeEnvironmentOrder -> String
showsPrec :: Int -> ComputeEnvironmentOrder -> ShowS
$cshowsPrec :: Int -> ComputeEnvironmentOrder -> ShowS
Prelude.Show, (forall x.
ComputeEnvironmentOrder -> Rep ComputeEnvironmentOrder x)
-> (forall x.
Rep ComputeEnvironmentOrder x -> ComputeEnvironmentOrder)
-> Generic ComputeEnvironmentOrder
forall x. Rep ComputeEnvironmentOrder x -> ComputeEnvironmentOrder
forall x. ComputeEnvironmentOrder -> Rep ComputeEnvironmentOrder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComputeEnvironmentOrder x -> ComputeEnvironmentOrder
$cfrom :: forall x. ComputeEnvironmentOrder -> Rep ComputeEnvironmentOrder x
Prelude.Generic)
newComputeEnvironmentOrder ::
Prelude.Int ->
Prelude.Text ->
ComputeEnvironmentOrder
newComputeEnvironmentOrder :: Int -> Text -> ComputeEnvironmentOrder
newComputeEnvironmentOrder
Int
pOrder_
Text
pComputeEnvironment_ =
ComputeEnvironmentOrder' :: Int -> Text -> ComputeEnvironmentOrder
ComputeEnvironmentOrder'
{ $sel:order:ComputeEnvironmentOrder' :: Int
order = Int
pOrder_,
$sel:computeEnvironment:ComputeEnvironmentOrder' :: Text
computeEnvironment = Text
pComputeEnvironment_
}
computeEnvironmentOrder_order :: Lens.Lens' ComputeEnvironmentOrder Prelude.Int
computeEnvironmentOrder_order :: (Int -> f Int)
-> ComputeEnvironmentOrder -> f ComputeEnvironmentOrder
computeEnvironmentOrder_order = (ComputeEnvironmentOrder -> Int)
-> (ComputeEnvironmentOrder -> Int -> ComputeEnvironmentOrder)
-> Lens ComputeEnvironmentOrder ComputeEnvironmentOrder Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentOrder' {Int
order :: Int
$sel:order:ComputeEnvironmentOrder' :: ComputeEnvironmentOrder -> Int
order} -> Int
order) (\s :: ComputeEnvironmentOrder
s@ComputeEnvironmentOrder' {} Int
a -> ComputeEnvironmentOrder
s {$sel:order:ComputeEnvironmentOrder' :: Int
order = Int
a} :: ComputeEnvironmentOrder)
computeEnvironmentOrder_computeEnvironment :: Lens.Lens' ComputeEnvironmentOrder Prelude.Text
computeEnvironmentOrder_computeEnvironment :: (Text -> f Text)
-> ComputeEnvironmentOrder -> f ComputeEnvironmentOrder
computeEnvironmentOrder_computeEnvironment = (ComputeEnvironmentOrder -> Text)
-> (ComputeEnvironmentOrder -> Text -> ComputeEnvironmentOrder)
-> Lens ComputeEnvironmentOrder ComputeEnvironmentOrder Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentOrder' {Text
computeEnvironment :: Text
$sel:computeEnvironment:ComputeEnvironmentOrder' :: ComputeEnvironmentOrder -> Text
computeEnvironment} -> Text
computeEnvironment) (\s :: ComputeEnvironmentOrder
s@ComputeEnvironmentOrder' {} Text
a -> ComputeEnvironmentOrder
s {$sel:computeEnvironment:ComputeEnvironmentOrder' :: Text
computeEnvironment = Text
a} :: ComputeEnvironmentOrder)
instance Core.FromJSON ComputeEnvironmentOrder where
parseJSON :: Value -> Parser ComputeEnvironmentOrder
parseJSON =
String
-> (Object -> Parser ComputeEnvironmentOrder)
-> Value
-> Parser ComputeEnvironmentOrder
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComputeEnvironmentOrder"
( \Object
x ->
Int -> Text -> ComputeEnvironmentOrder
ComputeEnvironmentOrder'
(Int -> Text -> ComputeEnvironmentOrder)
-> Parser Int -> Parser (Text -> ComputeEnvironmentOrder)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"order")
Parser (Text -> ComputeEnvironmentOrder)
-> Parser Text -> Parser ComputeEnvironmentOrder
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"computeEnvironment")
)
instance Prelude.Hashable ComputeEnvironmentOrder
instance Prelude.NFData ComputeEnvironmentOrder
instance Core.ToJSON ComputeEnvironmentOrder where
toJSON :: ComputeEnvironmentOrder -> Value
toJSON ComputeEnvironmentOrder' {Int
Text
computeEnvironment :: Text
order :: Int
$sel:computeEnvironment:ComputeEnvironmentOrder' :: ComputeEnvironmentOrder -> Text
$sel:order:ComputeEnvironmentOrder' :: ComputeEnvironmentOrder -> 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
"order" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
order),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"computeEnvironment" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
computeEnvironment)
]
)