{-# 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.ProvisionedProductPlanSummary
-- 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.ProvisionedProductPlanSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalog.Types.ProvisionedProductPlanType

-- | Summary information about a plan.
--
-- /See:/ 'newProvisionedProductPlanSummary' smart constructor.
data ProvisionedProductPlanSummary = ProvisionedProductPlanSummary'
  { -- | The product identifier.
    ProvisionedProductPlanSummary -> Maybe Text
provisionProductId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the provisioning artifact.
    ProvisionedProductPlanSummary -> Maybe Text
provisioningArtifactId :: Prelude.Maybe Prelude.Text,
    -- | The user-friendly name of the provisioned product.
    ProvisionedProductPlanSummary -> Maybe Text
provisionProductName :: Prelude.Maybe Prelude.Text,
    -- | The plan identifier.
    ProvisionedProductPlanSummary -> Maybe Text
planId :: Prelude.Maybe Prelude.Text,
    -- | The name of the plan.
    ProvisionedProductPlanSummary -> Maybe Text
planName :: Prelude.Maybe Prelude.Text,
    -- | The plan type.
    ProvisionedProductPlanSummary -> Maybe ProvisionedProductPlanType
planType :: Prelude.Maybe ProvisionedProductPlanType
  }
  deriving (ProvisionedProductPlanSummary
-> ProvisionedProductPlanSummary -> Bool
(ProvisionedProductPlanSummary
 -> ProvisionedProductPlanSummary -> Bool)
-> (ProvisionedProductPlanSummary
    -> ProvisionedProductPlanSummary -> Bool)
-> Eq ProvisionedProductPlanSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisionedProductPlanSummary
-> ProvisionedProductPlanSummary -> Bool
$c/= :: ProvisionedProductPlanSummary
-> ProvisionedProductPlanSummary -> Bool
== :: ProvisionedProductPlanSummary
-> ProvisionedProductPlanSummary -> Bool
$c== :: ProvisionedProductPlanSummary
-> ProvisionedProductPlanSummary -> Bool
Prelude.Eq, ReadPrec [ProvisionedProductPlanSummary]
ReadPrec ProvisionedProductPlanSummary
Int -> ReadS ProvisionedProductPlanSummary
ReadS [ProvisionedProductPlanSummary]
(Int -> ReadS ProvisionedProductPlanSummary)
-> ReadS [ProvisionedProductPlanSummary]
-> ReadPrec ProvisionedProductPlanSummary
-> ReadPrec [ProvisionedProductPlanSummary]
-> Read ProvisionedProductPlanSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisionedProductPlanSummary]
$creadListPrec :: ReadPrec [ProvisionedProductPlanSummary]
readPrec :: ReadPrec ProvisionedProductPlanSummary
$creadPrec :: ReadPrec ProvisionedProductPlanSummary
readList :: ReadS [ProvisionedProductPlanSummary]
$creadList :: ReadS [ProvisionedProductPlanSummary]
readsPrec :: Int -> ReadS ProvisionedProductPlanSummary
$creadsPrec :: Int -> ReadS ProvisionedProductPlanSummary
Prelude.Read, Int -> ProvisionedProductPlanSummary -> ShowS
[ProvisionedProductPlanSummary] -> ShowS
ProvisionedProductPlanSummary -> String
(Int -> ProvisionedProductPlanSummary -> ShowS)
-> (ProvisionedProductPlanSummary -> String)
-> ([ProvisionedProductPlanSummary] -> ShowS)
-> Show ProvisionedProductPlanSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisionedProductPlanSummary] -> ShowS
$cshowList :: [ProvisionedProductPlanSummary] -> ShowS
show :: ProvisionedProductPlanSummary -> String
$cshow :: ProvisionedProductPlanSummary -> String
showsPrec :: Int -> ProvisionedProductPlanSummary -> ShowS
$cshowsPrec :: Int -> ProvisionedProductPlanSummary -> ShowS
Prelude.Show, (forall x.
 ProvisionedProductPlanSummary
 -> Rep ProvisionedProductPlanSummary x)
-> (forall x.
    Rep ProvisionedProductPlanSummary x
    -> ProvisionedProductPlanSummary)
-> Generic ProvisionedProductPlanSummary
forall x.
Rep ProvisionedProductPlanSummary x
-> ProvisionedProductPlanSummary
forall x.
ProvisionedProductPlanSummary
-> Rep ProvisionedProductPlanSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisionedProductPlanSummary x
-> ProvisionedProductPlanSummary
$cfrom :: forall x.
ProvisionedProductPlanSummary
-> Rep ProvisionedProductPlanSummary x
Prelude.Generic)

-- |
-- Create a value of 'ProvisionedProductPlanSummary' 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:
--
-- 'provisionProductId', 'provisionedProductPlanSummary_provisionProductId' - The product identifier.
--
-- 'provisioningArtifactId', 'provisionedProductPlanSummary_provisioningArtifactId' - The identifier of the provisioning artifact.
--
-- 'provisionProductName', 'provisionedProductPlanSummary_provisionProductName' - The user-friendly name of the provisioned product.
--
-- 'planId', 'provisionedProductPlanSummary_planId' - The plan identifier.
--
-- 'planName', 'provisionedProductPlanSummary_planName' - The name of the plan.
--
-- 'planType', 'provisionedProductPlanSummary_planType' - The plan type.
newProvisionedProductPlanSummary ::
  ProvisionedProductPlanSummary
newProvisionedProductPlanSummary :: ProvisionedProductPlanSummary
newProvisionedProductPlanSummary =
  ProvisionedProductPlanSummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ProvisionedProductPlanType
-> ProvisionedProductPlanSummary
ProvisionedProductPlanSummary'
    { $sel:provisionProductId:ProvisionedProductPlanSummary' :: Maybe Text
provisionProductId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:provisioningArtifactId:ProvisionedProductPlanSummary' :: Maybe Text
provisioningArtifactId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:provisionProductName:ProvisionedProductPlanSummary' :: Maybe Text
provisionProductName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:planId:ProvisionedProductPlanSummary' :: Maybe Text
planId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:planName:ProvisionedProductPlanSummary' :: Maybe Text
planName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:planType:ProvisionedProductPlanSummary' :: Maybe ProvisionedProductPlanType
planType = Maybe ProvisionedProductPlanType
forall a. Maybe a
Prelude.Nothing
    }

-- | The product identifier.
provisionedProductPlanSummary_provisionProductId :: Lens.Lens' ProvisionedProductPlanSummary (Prelude.Maybe Prelude.Text)
provisionedProductPlanSummary_provisionProductId :: (Maybe Text -> f (Maybe Text))
-> ProvisionedProductPlanSummary -> f ProvisionedProductPlanSummary
provisionedProductPlanSummary_provisionProductId = (ProvisionedProductPlanSummary -> Maybe Text)
-> (ProvisionedProductPlanSummary
    -> Maybe Text -> ProvisionedProductPlanSummary)
-> Lens
     ProvisionedProductPlanSummary
     ProvisionedProductPlanSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedProductPlanSummary' {Maybe Text
provisionProductId :: Maybe Text
$sel:provisionProductId:ProvisionedProductPlanSummary' :: ProvisionedProductPlanSummary -> Maybe Text
provisionProductId} -> Maybe Text
provisionProductId) (\s :: ProvisionedProductPlanSummary
s@ProvisionedProductPlanSummary' {} Maybe Text
a -> ProvisionedProductPlanSummary
s {$sel:provisionProductId:ProvisionedProductPlanSummary' :: Maybe Text
provisionProductId = Maybe Text
a} :: ProvisionedProductPlanSummary)

-- | The identifier of the provisioning artifact.
provisionedProductPlanSummary_provisioningArtifactId :: Lens.Lens' ProvisionedProductPlanSummary (Prelude.Maybe Prelude.Text)
provisionedProductPlanSummary_provisioningArtifactId :: (Maybe Text -> f (Maybe Text))
-> ProvisionedProductPlanSummary -> f ProvisionedProductPlanSummary
provisionedProductPlanSummary_provisioningArtifactId = (ProvisionedProductPlanSummary -> Maybe Text)
-> (ProvisionedProductPlanSummary
    -> Maybe Text -> ProvisionedProductPlanSummary)
-> Lens
     ProvisionedProductPlanSummary
     ProvisionedProductPlanSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedProductPlanSummary' {Maybe Text
provisioningArtifactId :: Maybe Text
$sel:provisioningArtifactId:ProvisionedProductPlanSummary' :: ProvisionedProductPlanSummary -> Maybe Text
provisioningArtifactId} -> Maybe Text
provisioningArtifactId) (\s :: ProvisionedProductPlanSummary
s@ProvisionedProductPlanSummary' {} Maybe Text
a -> ProvisionedProductPlanSummary
s {$sel:provisioningArtifactId:ProvisionedProductPlanSummary' :: Maybe Text
provisioningArtifactId = Maybe Text
a} :: ProvisionedProductPlanSummary)

-- | The user-friendly name of the provisioned product.
provisionedProductPlanSummary_provisionProductName :: Lens.Lens' ProvisionedProductPlanSummary (Prelude.Maybe Prelude.Text)
provisionedProductPlanSummary_provisionProductName :: (Maybe Text -> f (Maybe Text))
-> ProvisionedProductPlanSummary -> f ProvisionedProductPlanSummary
provisionedProductPlanSummary_provisionProductName = (ProvisionedProductPlanSummary -> Maybe Text)
-> (ProvisionedProductPlanSummary
    -> Maybe Text -> ProvisionedProductPlanSummary)
-> Lens
     ProvisionedProductPlanSummary
     ProvisionedProductPlanSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedProductPlanSummary' {Maybe Text
provisionProductName :: Maybe Text
$sel:provisionProductName:ProvisionedProductPlanSummary' :: ProvisionedProductPlanSummary -> Maybe Text
provisionProductName} -> Maybe Text
provisionProductName) (\s :: ProvisionedProductPlanSummary
s@ProvisionedProductPlanSummary' {} Maybe Text
a -> ProvisionedProductPlanSummary
s {$sel:provisionProductName:ProvisionedProductPlanSummary' :: Maybe Text
provisionProductName = Maybe Text
a} :: ProvisionedProductPlanSummary)

-- | The plan identifier.
provisionedProductPlanSummary_planId :: Lens.Lens' ProvisionedProductPlanSummary (Prelude.Maybe Prelude.Text)
provisionedProductPlanSummary_planId :: (Maybe Text -> f (Maybe Text))
-> ProvisionedProductPlanSummary -> f ProvisionedProductPlanSummary
provisionedProductPlanSummary_planId = (ProvisionedProductPlanSummary -> Maybe Text)
-> (ProvisionedProductPlanSummary
    -> Maybe Text -> ProvisionedProductPlanSummary)
-> Lens
     ProvisionedProductPlanSummary
     ProvisionedProductPlanSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedProductPlanSummary' {Maybe Text
planId :: Maybe Text
$sel:planId:ProvisionedProductPlanSummary' :: ProvisionedProductPlanSummary -> Maybe Text
planId} -> Maybe Text
planId) (\s :: ProvisionedProductPlanSummary
s@ProvisionedProductPlanSummary' {} Maybe Text
a -> ProvisionedProductPlanSummary
s {$sel:planId:ProvisionedProductPlanSummary' :: Maybe Text
planId = Maybe Text
a} :: ProvisionedProductPlanSummary)

-- | The name of the plan.
provisionedProductPlanSummary_planName :: Lens.Lens' ProvisionedProductPlanSummary (Prelude.Maybe Prelude.Text)
provisionedProductPlanSummary_planName :: (Maybe Text -> f (Maybe Text))
-> ProvisionedProductPlanSummary -> f ProvisionedProductPlanSummary
provisionedProductPlanSummary_planName = (ProvisionedProductPlanSummary -> Maybe Text)
-> (ProvisionedProductPlanSummary
    -> Maybe Text -> ProvisionedProductPlanSummary)
-> Lens
     ProvisionedProductPlanSummary
     ProvisionedProductPlanSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedProductPlanSummary' {Maybe Text
planName :: Maybe Text
$sel:planName:ProvisionedProductPlanSummary' :: ProvisionedProductPlanSummary -> Maybe Text
planName} -> Maybe Text
planName) (\s :: ProvisionedProductPlanSummary
s@ProvisionedProductPlanSummary' {} Maybe Text
a -> ProvisionedProductPlanSummary
s {$sel:planName:ProvisionedProductPlanSummary' :: Maybe Text
planName = Maybe Text
a} :: ProvisionedProductPlanSummary)

-- | The plan type.
provisionedProductPlanSummary_planType :: Lens.Lens' ProvisionedProductPlanSummary (Prelude.Maybe ProvisionedProductPlanType)
provisionedProductPlanSummary_planType :: (Maybe ProvisionedProductPlanType
 -> f (Maybe ProvisionedProductPlanType))
-> ProvisionedProductPlanSummary -> f ProvisionedProductPlanSummary
provisionedProductPlanSummary_planType = (ProvisionedProductPlanSummary -> Maybe ProvisionedProductPlanType)
-> (ProvisionedProductPlanSummary
    -> Maybe ProvisionedProductPlanType
    -> ProvisionedProductPlanSummary)
-> Lens
     ProvisionedProductPlanSummary
     ProvisionedProductPlanSummary
     (Maybe ProvisionedProductPlanType)
     (Maybe ProvisionedProductPlanType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisionedProductPlanSummary' {Maybe ProvisionedProductPlanType
planType :: Maybe ProvisionedProductPlanType
$sel:planType:ProvisionedProductPlanSummary' :: ProvisionedProductPlanSummary -> Maybe ProvisionedProductPlanType
planType} -> Maybe ProvisionedProductPlanType
planType) (\s :: ProvisionedProductPlanSummary
s@ProvisionedProductPlanSummary' {} Maybe ProvisionedProductPlanType
a -> ProvisionedProductPlanSummary
s {$sel:planType:ProvisionedProductPlanSummary' :: Maybe ProvisionedProductPlanType
planType = Maybe ProvisionedProductPlanType
a} :: ProvisionedProductPlanSummary)

instance Core.FromJSON ProvisionedProductPlanSummary where
  parseJSON :: Value -> Parser ProvisionedProductPlanSummary
parseJSON =
    String
-> (Object -> Parser ProvisionedProductPlanSummary)
-> Value
-> Parser ProvisionedProductPlanSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProvisionedProductPlanSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ProvisionedProductPlanType
-> ProvisionedProductPlanSummary
ProvisionedProductPlanSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ProvisionedProductPlanType
 -> ProvisionedProductPlanSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProvisionedProductPlanType
      -> ProvisionedProductPlanSummary)
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
"ProvisionProductId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProvisionedProductPlanType
   -> ProvisionedProductPlanSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProvisionedProductPlanType
      -> ProvisionedProductPlanSummary)
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
"ProvisioningArtifactId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProvisionedProductPlanType
   -> ProvisionedProductPlanSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ProvisionedProductPlanType
      -> ProvisionedProductPlanSummary)
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
"ProvisionProductName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ProvisionedProductPlanType
   -> ProvisionedProductPlanSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ProvisionedProductPlanType
      -> ProvisionedProductPlanSummary)
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
"PlanId")
            Parser
  (Maybe Text
   -> Maybe ProvisionedProductPlanType
   -> ProvisionedProductPlanSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ProvisionedProductPlanType -> ProvisionedProductPlanSummary)
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
"PlanName")
            Parser
  (Maybe ProvisionedProductPlanType -> ProvisionedProductPlanSummary)
-> Parser (Maybe ProvisionedProductPlanType)
-> Parser ProvisionedProductPlanSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProvisionedProductPlanType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlanType")
      )

instance
  Prelude.Hashable
    ProvisionedProductPlanSummary

instance Prelude.NFData ProvisionedProductPlanSummary