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