{-# 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.LaunchPathSummary
-- 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.LaunchPathSummary 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
import Amazonka.ServiceCatalog.Types.ConstraintSummary
import Amazonka.ServiceCatalog.Types.Tag

-- | Summary information about a product path for a user.
--
-- /See:/ 'newLaunchPathSummary' smart constructor.
data LaunchPathSummary = LaunchPathSummary'
  { -- | The constraints on the portfolio-product relationship.
    LaunchPathSummary -> Maybe [ConstraintSummary]
constraintSummaries :: Prelude.Maybe [ConstraintSummary],
    -- | The identifier of the product path.
    LaunchPathSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the portfolio that contains the product.
    LaunchPathSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The tags associated with this product path.
    LaunchPathSummary -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (LaunchPathSummary -> LaunchPathSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchPathSummary -> LaunchPathSummary -> Bool
$c/= :: LaunchPathSummary -> LaunchPathSummary -> Bool
== :: LaunchPathSummary -> LaunchPathSummary -> Bool
$c== :: LaunchPathSummary -> LaunchPathSummary -> Bool
Prelude.Eq, ReadPrec [LaunchPathSummary]
ReadPrec LaunchPathSummary
Int -> ReadS LaunchPathSummary
ReadS [LaunchPathSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchPathSummary]
$creadListPrec :: ReadPrec [LaunchPathSummary]
readPrec :: ReadPrec LaunchPathSummary
$creadPrec :: ReadPrec LaunchPathSummary
readList :: ReadS [LaunchPathSummary]
$creadList :: ReadS [LaunchPathSummary]
readsPrec :: Int -> ReadS LaunchPathSummary
$creadsPrec :: Int -> ReadS LaunchPathSummary
Prelude.Read, Int -> LaunchPathSummary -> ShowS
[LaunchPathSummary] -> ShowS
LaunchPathSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchPathSummary] -> ShowS
$cshowList :: [LaunchPathSummary] -> ShowS
show :: LaunchPathSummary -> String
$cshow :: LaunchPathSummary -> String
showsPrec :: Int -> LaunchPathSummary -> ShowS
$cshowsPrec :: Int -> LaunchPathSummary -> ShowS
Prelude.Show, forall x. Rep LaunchPathSummary x -> LaunchPathSummary
forall x. LaunchPathSummary -> Rep LaunchPathSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LaunchPathSummary x -> LaunchPathSummary
$cfrom :: forall x. LaunchPathSummary -> Rep LaunchPathSummary x
Prelude.Generic)

-- |
-- Create a value of 'LaunchPathSummary' 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:
--
-- 'constraintSummaries', 'launchPathSummary_constraintSummaries' - The constraints on the portfolio-product relationship.
--
-- 'id', 'launchPathSummary_id' - The identifier of the product path.
--
-- 'name', 'launchPathSummary_name' - The name of the portfolio that contains the product.
--
-- 'tags', 'launchPathSummary_tags' - The tags associated with this product path.
newLaunchPathSummary ::
  LaunchPathSummary
newLaunchPathSummary :: LaunchPathSummary
newLaunchPathSummary =
  LaunchPathSummary'
    { $sel:constraintSummaries:LaunchPathSummary' :: Maybe [ConstraintSummary]
constraintSummaries =
        forall a. Maybe a
Prelude.Nothing,
      $sel:id:LaunchPathSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:LaunchPathSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:LaunchPathSummary' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The constraints on the portfolio-product relationship.
launchPathSummary_constraintSummaries :: Lens.Lens' LaunchPathSummary (Prelude.Maybe [ConstraintSummary])
launchPathSummary_constraintSummaries :: Lens' LaunchPathSummary (Maybe [ConstraintSummary])
launchPathSummary_constraintSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchPathSummary' {Maybe [ConstraintSummary]
constraintSummaries :: Maybe [ConstraintSummary]
$sel:constraintSummaries:LaunchPathSummary' :: LaunchPathSummary -> Maybe [ConstraintSummary]
constraintSummaries} -> Maybe [ConstraintSummary]
constraintSummaries) (\s :: LaunchPathSummary
s@LaunchPathSummary' {} Maybe [ConstraintSummary]
a -> LaunchPathSummary
s {$sel:constraintSummaries:LaunchPathSummary' :: Maybe [ConstraintSummary]
constraintSummaries = Maybe [ConstraintSummary]
a} :: LaunchPathSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The name of the portfolio that contains the product.
launchPathSummary_name :: Lens.Lens' LaunchPathSummary (Prelude.Maybe Prelude.Text)
launchPathSummary_name :: Lens' LaunchPathSummary (Maybe Text)
launchPathSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchPathSummary' {Maybe Text
name :: Maybe Text
$sel:name:LaunchPathSummary' :: LaunchPathSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: LaunchPathSummary
s@LaunchPathSummary' {} Maybe Text
a -> LaunchPathSummary
s {$sel:name:LaunchPathSummary' :: Maybe Text
name = Maybe Text
a} :: LaunchPathSummary)

-- | The tags associated with this product path.
launchPathSummary_tags :: Lens.Lens' LaunchPathSummary (Prelude.Maybe [Tag])
launchPathSummary_tags :: Lens' LaunchPathSummary (Maybe [Tag])
launchPathSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchPathSummary' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:LaunchPathSummary' :: LaunchPathSummary -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: LaunchPathSummary
s@LaunchPathSummary' {} Maybe [Tag]
a -> LaunchPathSummary
s {$sel:tags:LaunchPathSummary' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: LaunchPathSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON LaunchPathSummary where
  parseJSON :: Value -> Parser LaunchPathSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LaunchPathSummary"
      ( \Object
x ->
          Maybe [ConstraintSummary]
-> Maybe Text -> Maybe Text -> Maybe [Tag] -> LaunchPathSummary
LaunchPathSummary'
            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
"ConstraintSummaries"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"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")
            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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable LaunchPathSummary where
  hashWithSalt :: Int -> LaunchPathSummary -> Int
hashWithSalt Int
_salt LaunchPathSummary' {Maybe [ConstraintSummary]
Maybe [Tag]
Maybe Text
tags :: Maybe [Tag]
name :: Maybe Text
id :: Maybe Text
constraintSummaries :: Maybe [ConstraintSummary]
$sel:tags:LaunchPathSummary' :: LaunchPathSummary -> Maybe [Tag]
$sel:name:LaunchPathSummary' :: LaunchPathSummary -> Maybe Text
$sel:id:LaunchPathSummary' :: LaunchPathSummary -> Maybe Text
$sel:constraintSummaries:LaunchPathSummary' :: LaunchPathSummary -> Maybe [ConstraintSummary]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ConstraintSummary]
constraintSummaries
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags

instance Prelude.NFData LaunchPathSummary where
  rnf :: LaunchPathSummary -> ()
rnf LaunchPathSummary' {Maybe [ConstraintSummary]
Maybe [Tag]
Maybe Text
tags :: Maybe [Tag]
name :: Maybe Text
id :: Maybe Text
constraintSummaries :: Maybe [ConstraintSummary]
$sel:tags:LaunchPathSummary' :: LaunchPathSummary -> Maybe [Tag]
$sel:name:LaunchPathSummary' :: LaunchPathSummary -> Maybe Text
$sel:id:LaunchPathSummary' :: LaunchPathSummary -> Maybe Text
$sel:constraintSummaries:LaunchPathSummary' :: LaunchPathSummary -> Maybe [ConstraintSummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConstraintSummary]
constraintSummaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags