{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Nimble.Types.LaunchProfileInitializationScript
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Nimble.Types.LaunchProfileInitializationScript where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- |
--
-- /See:/ 'newLaunchProfileInitializationScript' smart constructor.
data LaunchProfileInitializationScript = LaunchProfileInitializationScript'
  { -- | The initialization script.
    LaunchProfileInitializationScript -> Maybe Text
script :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for a studio component resource.
    LaunchProfileInitializationScript -> Maybe Text
studioComponentId :: Prelude.Maybe Prelude.Text,
    -- | The name for the studio component.
    LaunchProfileInitializationScript -> Maybe Text
studioComponentName :: Prelude.Maybe Prelude.Text
  }
  deriving (LaunchProfileInitializationScript
-> LaunchProfileInitializationScript -> Bool
(LaunchProfileInitializationScript
 -> LaunchProfileInitializationScript -> Bool)
-> (LaunchProfileInitializationScript
    -> LaunchProfileInitializationScript -> Bool)
-> Eq LaunchProfileInitializationScript
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchProfileInitializationScript
-> LaunchProfileInitializationScript -> Bool
$c/= :: LaunchProfileInitializationScript
-> LaunchProfileInitializationScript -> Bool
== :: LaunchProfileInitializationScript
-> LaunchProfileInitializationScript -> Bool
$c== :: LaunchProfileInitializationScript
-> LaunchProfileInitializationScript -> Bool
Prelude.Eq, ReadPrec [LaunchProfileInitializationScript]
ReadPrec LaunchProfileInitializationScript
Int -> ReadS LaunchProfileInitializationScript
ReadS [LaunchProfileInitializationScript]
(Int -> ReadS LaunchProfileInitializationScript)
-> ReadS [LaunchProfileInitializationScript]
-> ReadPrec LaunchProfileInitializationScript
-> ReadPrec [LaunchProfileInitializationScript]
-> Read LaunchProfileInitializationScript
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchProfileInitializationScript]
$creadListPrec :: ReadPrec [LaunchProfileInitializationScript]
readPrec :: ReadPrec LaunchProfileInitializationScript
$creadPrec :: ReadPrec LaunchProfileInitializationScript
readList :: ReadS [LaunchProfileInitializationScript]
$creadList :: ReadS [LaunchProfileInitializationScript]
readsPrec :: Int -> ReadS LaunchProfileInitializationScript
$creadsPrec :: Int -> ReadS LaunchProfileInitializationScript
Prelude.Read, Int -> LaunchProfileInitializationScript -> ShowS
[LaunchProfileInitializationScript] -> ShowS
LaunchProfileInitializationScript -> String
(Int -> LaunchProfileInitializationScript -> ShowS)
-> (LaunchProfileInitializationScript -> String)
-> ([LaunchProfileInitializationScript] -> ShowS)
-> Show LaunchProfileInitializationScript
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchProfileInitializationScript] -> ShowS
$cshowList :: [LaunchProfileInitializationScript] -> ShowS
show :: LaunchProfileInitializationScript -> String
$cshow :: LaunchProfileInitializationScript -> String
showsPrec :: Int -> LaunchProfileInitializationScript -> ShowS
$cshowsPrec :: Int -> LaunchProfileInitializationScript -> ShowS
Prelude.Show, (forall x.
 LaunchProfileInitializationScript
 -> Rep LaunchProfileInitializationScript x)
-> (forall x.
    Rep LaunchProfileInitializationScript x
    -> LaunchProfileInitializationScript)
-> Generic LaunchProfileInitializationScript
forall x.
Rep LaunchProfileInitializationScript x
-> LaunchProfileInitializationScript
forall x.
LaunchProfileInitializationScript
-> Rep LaunchProfileInitializationScript x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LaunchProfileInitializationScript x
-> LaunchProfileInitializationScript
$cfrom :: forall x.
LaunchProfileInitializationScript
-> Rep LaunchProfileInitializationScript x
Prelude.Generic)

-- |
-- Create a value of 'LaunchProfileInitializationScript' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'script', 'launchProfileInitializationScript_script' - The initialization script.
--
-- 'studioComponentId', 'launchProfileInitializationScript_studioComponentId' - The unique identifier for a studio component resource.
--
-- 'studioComponentName', 'launchProfileInitializationScript_studioComponentName' - The name for the studio component.
newLaunchProfileInitializationScript ::
  LaunchProfileInitializationScript
newLaunchProfileInitializationScript :: LaunchProfileInitializationScript
newLaunchProfileInitializationScript =
  LaunchProfileInitializationScript' :: Maybe Text
-> Maybe Text -> Maybe Text -> LaunchProfileInitializationScript
LaunchProfileInitializationScript'
    { $sel:script:LaunchProfileInitializationScript' :: Maybe Text
script =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:studioComponentId:LaunchProfileInitializationScript' :: Maybe Text
studioComponentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:studioComponentName:LaunchProfileInitializationScript' :: Maybe Text
studioComponentName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The initialization script.
launchProfileInitializationScript_script :: Lens.Lens' LaunchProfileInitializationScript (Prelude.Maybe Prelude.Text)
launchProfileInitializationScript_script :: (Maybe Text -> f (Maybe Text))
-> LaunchProfileInitializationScript
-> f LaunchProfileInitializationScript
launchProfileInitializationScript_script = (LaunchProfileInitializationScript -> Maybe Text)
-> (LaunchProfileInitializationScript
    -> Maybe Text -> LaunchProfileInitializationScript)
-> Lens
     LaunchProfileInitializationScript
     LaunchProfileInitializationScript
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchProfileInitializationScript' {Maybe Text
script :: Maybe Text
$sel:script:LaunchProfileInitializationScript' :: LaunchProfileInitializationScript -> Maybe Text
script} -> Maybe Text
script) (\s :: LaunchProfileInitializationScript
s@LaunchProfileInitializationScript' {} Maybe Text
a -> LaunchProfileInitializationScript
s {$sel:script:LaunchProfileInitializationScript' :: Maybe Text
script = Maybe Text
a} :: LaunchProfileInitializationScript)

-- | The unique identifier for a studio component resource.
launchProfileInitializationScript_studioComponentId :: Lens.Lens' LaunchProfileInitializationScript (Prelude.Maybe Prelude.Text)
launchProfileInitializationScript_studioComponentId :: (Maybe Text -> f (Maybe Text))
-> LaunchProfileInitializationScript
-> f LaunchProfileInitializationScript
launchProfileInitializationScript_studioComponentId = (LaunchProfileInitializationScript -> Maybe Text)
-> (LaunchProfileInitializationScript
    -> Maybe Text -> LaunchProfileInitializationScript)
-> Lens
     LaunchProfileInitializationScript
     LaunchProfileInitializationScript
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchProfileInitializationScript' {Maybe Text
studioComponentId :: Maybe Text
$sel:studioComponentId:LaunchProfileInitializationScript' :: LaunchProfileInitializationScript -> Maybe Text
studioComponentId} -> Maybe Text
studioComponentId) (\s :: LaunchProfileInitializationScript
s@LaunchProfileInitializationScript' {} Maybe Text
a -> LaunchProfileInitializationScript
s {$sel:studioComponentId:LaunchProfileInitializationScript' :: Maybe Text
studioComponentId = Maybe Text
a} :: LaunchProfileInitializationScript)

-- | The name for the studio component.
launchProfileInitializationScript_studioComponentName :: Lens.Lens' LaunchProfileInitializationScript (Prelude.Maybe Prelude.Text)
launchProfileInitializationScript_studioComponentName :: (Maybe Text -> f (Maybe Text))
-> LaunchProfileInitializationScript
-> f LaunchProfileInitializationScript
launchProfileInitializationScript_studioComponentName = (LaunchProfileInitializationScript -> Maybe Text)
-> (LaunchProfileInitializationScript
    -> Maybe Text -> LaunchProfileInitializationScript)
-> Lens
     LaunchProfileInitializationScript
     LaunchProfileInitializationScript
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchProfileInitializationScript' {Maybe Text
studioComponentName :: Maybe Text
$sel:studioComponentName:LaunchProfileInitializationScript' :: LaunchProfileInitializationScript -> Maybe Text
studioComponentName} -> Maybe Text
studioComponentName) (\s :: LaunchProfileInitializationScript
s@LaunchProfileInitializationScript' {} Maybe Text
a -> LaunchProfileInitializationScript
s {$sel:studioComponentName:LaunchProfileInitializationScript' :: Maybe Text
studioComponentName = Maybe Text
a} :: LaunchProfileInitializationScript)

instance
  Core.FromJSON
    LaunchProfileInitializationScript
  where
  parseJSON :: Value -> Parser LaunchProfileInitializationScript
parseJSON =
    String
-> (Object -> Parser LaunchProfileInitializationScript)
-> Value
-> Parser LaunchProfileInitializationScript
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LaunchProfileInitializationScript"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> LaunchProfileInitializationScript
LaunchProfileInitializationScript'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> LaunchProfileInitializationScript)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> LaunchProfileInitializationScript)
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 Text -> Maybe Text -> LaunchProfileInitializationScript)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> LaunchProfileInitializationScript)
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
"studioComponentId")
            Parser (Maybe Text -> LaunchProfileInitializationScript)
-> Parser (Maybe Text) -> Parser LaunchProfileInitializationScript
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
"studioComponentName")
      )

instance
  Prelude.Hashable
    LaunchProfileInitializationScript

instance
  Prelude.NFData
    LaunchProfileInitializationScript