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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalog.Types.ProductViewSummary
import Amazonka.ServiceCatalog.Types.ProvisioningArtifact

-- | An object that contains summary information about a product view and a
-- provisioning artifact.
--
-- /See:/ 'newProvisioningArtifactView' smart constructor.
data ProvisioningArtifactView = ProvisioningArtifactView'
  { -- | Summary information about a product view.
    ProvisioningArtifactView -> Maybe ProductViewSummary
productViewSummary :: Prelude.Maybe ProductViewSummary,
    -- | Information about a provisioning artifact. A provisioning artifact is
    -- also known as a product version.
    ProvisioningArtifactView -> Maybe ProvisioningArtifact
provisioningArtifact :: Prelude.Maybe ProvisioningArtifact
  }
  deriving (ProvisioningArtifactView -> ProvisioningArtifactView -> Bool
(ProvisioningArtifactView -> ProvisioningArtifactView -> Bool)
-> (ProvisioningArtifactView -> ProvisioningArtifactView -> Bool)
-> Eq ProvisioningArtifactView
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningArtifactView -> ProvisioningArtifactView -> Bool
$c/= :: ProvisioningArtifactView -> ProvisioningArtifactView -> Bool
== :: ProvisioningArtifactView -> ProvisioningArtifactView -> Bool
$c== :: ProvisioningArtifactView -> ProvisioningArtifactView -> Bool
Prelude.Eq, ReadPrec [ProvisioningArtifactView]
ReadPrec ProvisioningArtifactView
Int -> ReadS ProvisioningArtifactView
ReadS [ProvisioningArtifactView]
(Int -> ReadS ProvisioningArtifactView)
-> ReadS [ProvisioningArtifactView]
-> ReadPrec ProvisioningArtifactView
-> ReadPrec [ProvisioningArtifactView]
-> Read ProvisioningArtifactView
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningArtifactView]
$creadListPrec :: ReadPrec [ProvisioningArtifactView]
readPrec :: ReadPrec ProvisioningArtifactView
$creadPrec :: ReadPrec ProvisioningArtifactView
readList :: ReadS [ProvisioningArtifactView]
$creadList :: ReadS [ProvisioningArtifactView]
readsPrec :: Int -> ReadS ProvisioningArtifactView
$creadsPrec :: Int -> ReadS ProvisioningArtifactView
Prelude.Read, Int -> ProvisioningArtifactView -> ShowS
[ProvisioningArtifactView] -> ShowS
ProvisioningArtifactView -> String
(Int -> ProvisioningArtifactView -> ShowS)
-> (ProvisioningArtifactView -> String)
-> ([ProvisioningArtifactView] -> ShowS)
-> Show ProvisioningArtifactView
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningArtifactView] -> ShowS
$cshowList :: [ProvisioningArtifactView] -> ShowS
show :: ProvisioningArtifactView -> String
$cshow :: ProvisioningArtifactView -> String
showsPrec :: Int -> ProvisioningArtifactView -> ShowS
$cshowsPrec :: Int -> ProvisioningArtifactView -> ShowS
Prelude.Show, (forall x.
 ProvisioningArtifactView -> Rep ProvisioningArtifactView x)
-> (forall x.
    Rep ProvisioningArtifactView x -> ProvisioningArtifactView)
-> Generic ProvisioningArtifactView
forall x.
Rep ProvisioningArtifactView x -> ProvisioningArtifactView
forall x.
ProvisioningArtifactView -> Rep ProvisioningArtifactView x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisioningArtifactView x -> ProvisioningArtifactView
$cfrom :: forall x.
ProvisioningArtifactView -> Rep ProvisioningArtifactView x
Prelude.Generic)

-- |
-- Create a value of 'ProvisioningArtifactView' 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:
--
-- 'productViewSummary', 'provisioningArtifactView_productViewSummary' - Summary information about a product view.
--
-- 'provisioningArtifact', 'provisioningArtifactView_provisioningArtifact' - Information about a provisioning artifact. A provisioning artifact is
-- also known as a product version.
newProvisioningArtifactView ::
  ProvisioningArtifactView
newProvisioningArtifactView :: ProvisioningArtifactView
newProvisioningArtifactView =
  ProvisioningArtifactView' :: Maybe ProductViewSummary
-> Maybe ProvisioningArtifact -> ProvisioningArtifactView
ProvisioningArtifactView'
    { $sel:productViewSummary:ProvisioningArtifactView' :: Maybe ProductViewSummary
productViewSummary =
        Maybe ProductViewSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:provisioningArtifact:ProvisioningArtifactView' :: Maybe ProvisioningArtifact
provisioningArtifact = Maybe ProvisioningArtifact
forall a. Maybe a
Prelude.Nothing
    }

-- | Summary information about a product view.
provisioningArtifactView_productViewSummary :: Lens.Lens' ProvisioningArtifactView (Prelude.Maybe ProductViewSummary)
provisioningArtifactView_productViewSummary :: (Maybe ProductViewSummary -> f (Maybe ProductViewSummary))
-> ProvisioningArtifactView -> f ProvisioningArtifactView
provisioningArtifactView_productViewSummary = (ProvisioningArtifactView -> Maybe ProductViewSummary)
-> (ProvisioningArtifactView
    -> Maybe ProductViewSummary -> ProvisioningArtifactView)
-> Lens
     ProvisioningArtifactView
     ProvisioningArtifactView
     (Maybe ProductViewSummary)
     (Maybe ProductViewSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactView' {Maybe ProductViewSummary
productViewSummary :: Maybe ProductViewSummary
$sel:productViewSummary:ProvisioningArtifactView' :: ProvisioningArtifactView -> Maybe ProductViewSummary
productViewSummary} -> Maybe ProductViewSummary
productViewSummary) (\s :: ProvisioningArtifactView
s@ProvisioningArtifactView' {} Maybe ProductViewSummary
a -> ProvisioningArtifactView
s {$sel:productViewSummary:ProvisioningArtifactView' :: Maybe ProductViewSummary
productViewSummary = Maybe ProductViewSummary
a} :: ProvisioningArtifactView)

-- | Information about a provisioning artifact. A provisioning artifact is
-- also known as a product version.
provisioningArtifactView_provisioningArtifact :: Lens.Lens' ProvisioningArtifactView (Prelude.Maybe ProvisioningArtifact)
provisioningArtifactView_provisioningArtifact :: (Maybe ProvisioningArtifact -> f (Maybe ProvisioningArtifact))
-> ProvisioningArtifactView -> f ProvisioningArtifactView
provisioningArtifactView_provisioningArtifact = (ProvisioningArtifactView -> Maybe ProvisioningArtifact)
-> (ProvisioningArtifactView
    -> Maybe ProvisioningArtifact -> ProvisioningArtifactView)
-> Lens
     ProvisioningArtifactView
     ProvisioningArtifactView
     (Maybe ProvisioningArtifact)
     (Maybe ProvisioningArtifact)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactView' {Maybe ProvisioningArtifact
provisioningArtifact :: Maybe ProvisioningArtifact
$sel:provisioningArtifact:ProvisioningArtifactView' :: ProvisioningArtifactView -> Maybe ProvisioningArtifact
provisioningArtifact} -> Maybe ProvisioningArtifact
provisioningArtifact) (\s :: ProvisioningArtifactView
s@ProvisioningArtifactView' {} Maybe ProvisioningArtifact
a -> ProvisioningArtifactView
s {$sel:provisioningArtifact:ProvisioningArtifactView' :: Maybe ProvisioningArtifact
provisioningArtifact = Maybe ProvisioningArtifact
a} :: ProvisioningArtifactView)

instance Core.FromJSON ProvisioningArtifactView where
  parseJSON :: Value -> Parser ProvisioningArtifactView
parseJSON =
    String
-> (Object -> Parser ProvisioningArtifactView)
-> Value
-> Parser ProvisioningArtifactView
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProvisioningArtifactView"
      ( \Object
x ->
          Maybe ProductViewSummary
-> Maybe ProvisioningArtifact -> ProvisioningArtifactView
ProvisioningArtifactView'
            (Maybe ProductViewSummary
 -> Maybe ProvisioningArtifact -> ProvisioningArtifactView)
-> Parser (Maybe ProductViewSummary)
-> Parser (Maybe ProvisioningArtifact -> ProvisioningArtifactView)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ProductViewSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProductViewSummary")
            Parser (Maybe ProvisioningArtifact -> ProvisioningArtifactView)
-> Parser (Maybe ProvisioningArtifact)
-> Parser ProvisioningArtifactView
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProvisioningArtifact)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProvisioningArtifact")
      )

instance Prelude.Hashable ProvisioningArtifactView

instance Prelude.NFData ProvisioningArtifactView