{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ServiceCatalog.Types.LaunchPath 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

-- | A launch path object.
--
-- /See:/ 'newLaunchPath' smart constructor.
data LaunchPath = LaunchPath'
  { -- | The identifier of the launch path.
    LaunchPath -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the launch path.
    LaunchPath -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (LaunchPath -> LaunchPath -> Bool
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]
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
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. 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:
--
-- 'id', 'launchPath_id' - The identifier of the launch path.
--
-- 'name', 'launchPath_name' - The name of the launch path.
newLaunchPath ::
  LaunchPath
newLaunchPath :: LaunchPath
newLaunchPath =
  LaunchPath'
    { $sel:id:LaunchPath' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:LaunchPath' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the launch path.
launchPath_id :: Lens.Lens' LaunchPath (Prelude.Maybe Prelude.Text)
launchPath_id :: Lens' LaunchPath (Maybe Text)
launchPath_id = 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)

-- | The name of the launch path.
launchPath_name :: Lens.Lens' LaunchPath (Prelude.Maybe Prelude.Text)
launchPath_name :: Lens' LaunchPath (Maybe Text)
launchPath_name = 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)

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

instance Prelude.Hashable LaunchPath where
  hashWithSalt :: Int -> LaunchPath -> Int
hashWithSalt Int
_salt LaunchPath' {Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:name:LaunchPath' :: LaunchPath -> Maybe Text
$sel:id:LaunchPath' :: LaunchPath -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData LaunchPath where
  rnf :: LaunchPath -> ()
rnf LaunchPath' {Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:name:LaunchPath' :: LaunchPath -> Maybe Text
$sel:id:LaunchPath' :: LaunchPath -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name