{-# 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.MigrationHubOrchestrator.Types.PlatformScriptKey where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data PlatformScriptKey = PlatformScriptKey'
{
PlatformScriptKey -> Maybe Text
linux :: Prelude.Maybe Prelude.Text,
PlatformScriptKey -> Maybe Text
windows :: Prelude.Maybe Prelude.Text
}
deriving (PlatformScriptKey -> PlatformScriptKey -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlatformScriptKey -> PlatformScriptKey -> Bool
$c/= :: PlatformScriptKey -> PlatformScriptKey -> Bool
== :: PlatformScriptKey -> PlatformScriptKey -> Bool
$c== :: PlatformScriptKey -> PlatformScriptKey -> Bool
Prelude.Eq, ReadPrec [PlatformScriptKey]
ReadPrec PlatformScriptKey
Int -> ReadS PlatformScriptKey
ReadS [PlatformScriptKey]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlatformScriptKey]
$creadListPrec :: ReadPrec [PlatformScriptKey]
readPrec :: ReadPrec PlatformScriptKey
$creadPrec :: ReadPrec PlatformScriptKey
readList :: ReadS [PlatformScriptKey]
$creadList :: ReadS [PlatformScriptKey]
readsPrec :: Int -> ReadS PlatformScriptKey
$creadsPrec :: Int -> ReadS PlatformScriptKey
Prelude.Read, Int -> PlatformScriptKey -> ShowS
[PlatformScriptKey] -> ShowS
PlatformScriptKey -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlatformScriptKey] -> ShowS
$cshowList :: [PlatformScriptKey] -> ShowS
show :: PlatformScriptKey -> String
$cshow :: PlatformScriptKey -> String
showsPrec :: Int -> PlatformScriptKey -> ShowS
$cshowsPrec :: Int -> PlatformScriptKey -> ShowS
Prelude.Show, forall x. Rep PlatformScriptKey x -> PlatformScriptKey
forall x. PlatformScriptKey -> Rep PlatformScriptKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlatformScriptKey x -> PlatformScriptKey
$cfrom :: forall x. PlatformScriptKey -> Rep PlatformScriptKey x
Prelude.Generic)
newPlatformScriptKey ::
PlatformScriptKey
newPlatformScriptKey :: PlatformScriptKey
newPlatformScriptKey =
PlatformScriptKey'
{ $sel:linux:PlatformScriptKey' :: Maybe Text
linux = forall a. Maybe a
Prelude.Nothing,
$sel:windows:PlatformScriptKey' :: Maybe Text
windows = forall a. Maybe a
Prelude.Nothing
}
platformScriptKey_linux :: Lens.Lens' PlatformScriptKey (Prelude.Maybe Prelude.Text)
platformScriptKey_linux :: Lens' PlatformScriptKey (Maybe Text)
platformScriptKey_linux = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformScriptKey' {Maybe Text
linux :: Maybe Text
$sel:linux:PlatformScriptKey' :: PlatformScriptKey -> Maybe Text
linux} -> Maybe Text
linux) (\s :: PlatformScriptKey
s@PlatformScriptKey' {} Maybe Text
a -> PlatformScriptKey
s {$sel:linux:PlatformScriptKey' :: Maybe Text
linux = Maybe Text
a} :: PlatformScriptKey)
platformScriptKey_windows :: Lens.Lens' PlatformScriptKey (Prelude.Maybe Prelude.Text)
platformScriptKey_windows :: Lens' PlatformScriptKey (Maybe Text)
platformScriptKey_windows = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformScriptKey' {Maybe Text
windows :: Maybe Text
$sel:windows:PlatformScriptKey' :: PlatformScriptKey -> Maybe Text
windows} -> Maybe Text
windows) (\s :: PlatformScriptKey
s@PlatformScriptKey' {} Maybe Text
a -> PlatformScriptKey
s {$sel:windows:PlatformScriptKey' :: Maybe Text
windows = Maybe Text
a} :: PlatformScriptKey)
instance Data.FromJSON PlatformScriptKey where
parseJSON :: Value -> Parser PlatformScriptKey
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PlatformScriptKey"
( \Object
x ->
Maybe Text -> Maybe Text -> PlatformScriptKey
PlatformScriptKey'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"linux")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"windows")
)
instance Prelude.Hashable PlatformScriptKey where
hashWithSalt :: Int -> PlatformScriptKey -> Int
hashWithSalt Int
_salt PlatformScriptKey' {Maybe Text
windows :: Maybe Text
linux :: Maybe Text
$sel:windows:PlatformScriptKey' :: PlatformScriptKey -> Maybe Text
$sel:linux:PlatformScriptKey' :: PlatformScriptKey -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
linux
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
windows
instance Prelude.NFData PlatformScriptKey where
rnf :: PlatformScriptKey -> ()
rnf PlatformScriptKey' {Maybe Text
windows :: Maybe Text
linux :: Maybe Text
$sel:windows:PlatformScriptKey' :: PlatformScriptKey -> Maybe Text
$sel:linux:PlatformScriptKey' :: PlatformScriptKey -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
linux seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
windows
instance Data.ToJSON PlatformScriptKey where
toJSON :: PlatformScriptKey -> Value
toJSON PlatformScriptKey' {Maybe Text
windows :: Maybe Text
linux :: Maybe Text
$sel:windows:PlatformScriptKey' :: PlatformScriptKey -> Maybe Text
$sel:linux:PlatformScriptKey' :: PlatformScriptKey -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"linux" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
linux,
(Key
"windows" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
windows
]
)