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