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