{-# 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.ServiceCatalog.Types.LaunchPath
-- 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.ServiceCatalog.Types.LaunchPath where

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

-- | A launch path object.
--
-- /See:/ 'newLaunchPath' smart constructor.
data LaunchPath = LaunchPath'
  { -- | The name of the launch path.
    LaunchPath -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the launch path.
    LaunchPath -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (LaunchPath -> LaunchPath -> Bool
(LaunchPath -> LaunchPath -> Bool)
-> (LaunchPath -> LaunchPath -> Bool) -> Eq LaunchPath
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchPath -> LaunchPath -> Bool
$c/= :: LaunchPath -> LaunchPath -> Bool
== :: LaunchPath -> LaunchPath -> Bool
$c== :: LaunchPath -> LaunchPath -> Bool
Prelude.Eq, ReadPrec [LaunchPath]
ReadPrec LaunchPath
Int -> ReadS LaunchPath
ReadS [LaunchPath]
(Int -> ReadS LaunchPath)
-> ReadS [LaunchPath]
-> ReadPrec LaunchPath
-> ReadPrec [LaunchPath]
-> Read LaunchPath
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchPath]
$creadListPrec :: ReadPrec [LaunchPath]
readPrec :: ReadPrec LaunchPath
$creadPrec :: ReadPrec LaunchPath
readList :: ReadS [LaunchPath]
$creadList :: ReadS [LaunchPath]
readsPrec :: Int -> ReadS LaunchPath
$creadsPrec :: Int -> ReadS LaunchPath
Prelude.Read, Int -> LaunchPath -> ShowS
[LaunchPath] -> ShowS
LaunchPath -> String
(Int -> LaunchPath -> ShowS)
-> (LaunchPath -> String)
-> ([LaunchPath] -> ShowS)
-> Show LaunchPath
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchPath] -> ShowS
$cshowList :: [LaunchPath] -> ShowS
show :: LaunchPath -> String
$cshow :: LaunchPath -> String
showsPrec :: Int -> LaunchPath -> ShowS
$cshowsPrec :: Int -> LaunchPath -> ShowS
Prelude.Show, (forall x. LaunchPath -> Rep LaunchPath x)
-> (forall x. Rep LaunchPath x -> LaunchPath) -> Generic LaunchPath
forall x. Rep LaunchPath x -> LaunchPath
forall x. LaunchPath -> Rep LaunchPath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LaunchPath x -> LaunchPath
$cfrom :: forall x. LaunchPath -> Rep LaunchPath x
Prelude.Generic)

-- |
-- Create a value of 'LaunchPath' 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:
--
-- 'name', 'launchPath_name' - The name of the launch path.
--
-- 'id', 'launchPath_id' - The identifier of the launch path.
newLaunchPath ::
  LaunchPath
newLaunchPath :: LaunchPath
newLaunchPath =
  LaunchPath' :: Maybe Text -> Maybe Text -> LaunchPath
LaunchPath'
    { $sel:name:LaunchPath' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:LaunchPath' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the launch path.
launchPath_name :: Lens.Lens' LaunchPath (Prelude.Maybe Prelude.Text)
launchPath_name :: (Maybe Text -> f (Maybe Text)) -> LaunchPath -> f LaunchPath
launchPath_name = (LaunchPath -> Maybe Text)
-> (LaunchPath -> Maybe Text -> LaunchPath)
-> Lens LaunchPath LaunchPath (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchPath' {Maybe Text
name :: Maybe Text
$sel:name:LaunchPath' :: LaunchPath -> Maybe Text
name} -> Maybe Text
name) (\s :: LaunchPath
s@LaunchPath' {} Maybe Text
a -> LaunchPath
s {$sel:name:LaunchPath' :: Maybe Text
name = Maybe Text
a} :: LaunchPath)

-- | The identifier of the launch path.
launchPath_id :: Lens.Lens' LaunchPath (Prelude.Maybe Prelude.Text)
launchPath_id :: (Maybe Text -> f (Maybe Text)) -> LaunchPath -> f LaunchPath
launchPath_id = (LaunchPath -> Maybe Text)
-> (LaunchPath -> Maybe Text -> LaunchPath)
-> Lens LaunchPath LaunchPath (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchPath' {Maybe Text
id :: Maybe Text
$sel:id:LaunchPath' :: LaunchPath -> Maybe Text
id} -> Maybe Text
id) (\s :: LaunchPath
s@LaunchPath' {} Maybe Text
a -> LaunchPath
s {$sel:id:LaunchPath' :: Maybe Text
id = Maybe Text
a} :: LaunchPath)

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

instance Prelude.Hashable LaunchPath

instance Prelude.NFData LaunchPath