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

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

-- | Provisioning artifact output.
--
-- /See:/ 'newProvisioningArtifactOutput' smart constructor.
data ProvisioningArtifactOutput = ProvisioningArtifactOutput'
  { -- | The provisioning artifact output key.
    ProvisioningArtifactOutput -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
    -- | Description of the provisioning artifact output key.
    ProvisioningArtifactOutput -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ProvisioningArtifactOutput -> ProvisioningArtifactOutput -> Bool
(ProvisioningArtifactOutput -> ProvisioningArtifactOutput -> Bool)
-> (ProvisioningArtifactOutput
    -> ProvisioningArtifactOutput -> Bool)
-> Eq ProvisioningArtifactOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningArtifactOutput -> ProvisioningArtifactOutput -> Bool
$c/= :: ProvisioningArtifactOutput -> ProvisioningArtifactOutput -> Bool
== :: ProvisioningArtifactOutput -> ProvisioningArtifactOutput -> Bool
$c== :: ProvisioningArtifactOutput -> ProvisioningArtifactOutput -> Bool
Prelude.Eq, ReadPrec [ProvisioningArtifactOutput]
ReadPrec ProvisioningArtifactOutput
Int -> ReadS ProvisioningArtifactOutput
ReadS [ProvisioningArtifactOutput]
(Int -> ReadS ProvisioningArtifactOutput)
-> ReadS [ProvisioningArtifactOutput]
-> ReadPrec ProvisioningArtifactOutput
-> ReadPrec [ProvisioningArtifactOutput]
-> Read ProvisioningArtifactOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningArtifactOutput]
$creadListPrec :: ReadPrec [ProvisioningArtifactOutput]
readPrec :: ReadPrec ProvisioningArtifactOutput
$creadPrec :: ReadPrec ProvisioningArtifactOutput
readList :: ReadS [ProvisioningArtifactOutput]
$creadList :: ReadS [ProvisioningArtifactOutput]
readsPrec :: Int -> ReadS ProvisioningArtifactOutput
$creadsPrec :: Int -> ReadS ProvisioningArtifactOutput
Prelude.Read, Int -> ProvisioningArtifactOutput -> ShowS
[ProvisioningArtifactOutput] -> ShowS
ProvisioningArtifactOutput -> String
(Int -> ProvisioningArtifactOutput -> ShowS)
-> (ProvisioningArtifactOutput -> String)
-> ([ProvisioningArtifactOutput] -> ShowS)
-> Show ProvisioningArtifactOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningArtifactOutput] -> ShowS
$cshowList :: [ProvisioningArtifactOutput] -> ShowS
show :: ProvisioningArtifactOutput -> String
$cshow :: ProvisioningArtifactOutput -> String
showsPrec :: Int -> ProvisioningArtifactOutput -> ShowS
$cshowsPrec :: Int -> ProvisioningArtifactOutput -> ShowS
Prelude.Show, (forall x.
 ProvisioningArtifactOutput -> Rep ProvisioningArtifactOutput x)
-> (forall x.
    Rep ProvisioningArtifactOutput x -> ProvisioningArtifactOutput)
-> Generic ProvisioningArtifactOutput
forall x.
Rep ProvisioningArtifactOutput x -> ProvisioningArtifactOutput
forall x.
ProvisioningArtifactOutput -> Rep ProvisioningArtifactOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisioningArtifactOutput x -> ProvisioningArtifactOutput
$cfrom :: forall x.
ProvisioningArtifactOutput -> Rep ProvisioningArtifactOutput x
Prelude.Generic)

-- |
-- Create a value of 'ProvisioningArtifactOutput' 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:
--
-- 'key', 'provisioningArtifactOutput_key' - The provisioning artifact output key.
--
-- 'description', 'provisioningArtifactOutput_description' - Description of the provisioning artifact output key.
newProvisioningArtifactOutput ::
  ProvisioningArtifactOutput
newProvisioningArtifactOutput :: ProvisioningArtifactOutput
newProvisioningArtifactOutput =
  ProvisioningArtifactOutput' :: Maybe Text -> Maybe Text -> ProvisioningArtifactOutput
ProvisioningArtifactOutput'
    { $sel:key:ProvisioningArtifactOutput' :: Maybe Text
key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ProvisioningArtifactOutput' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The provisioning artifact output key.
provisioningArtifactOutput_key :: Lens.Lens' ProvisioningArtifactOutput (Prelude.Maybe Prelude.Text)
provisioningArtifactOutput_key :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactOutput -> f ProvisioningArtifactOutput
provisioningArtifactOutput_key = (ProvisioningArtifactOutput -> Maybe Text)
-> (ProvisioningArtifactOutput
    -> Maybe Text -> ProvisioningArtifactOutput)
-> Lens
     ProvisioningArtifactOutput
     ProvisioningArtifactOutput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactOutput' {Maybe Text
key :: Maybe Text
$sel:key:ProvisioningArtifactOutput' :: ProvisioningArtifactOutput -> Maybe Text
key} -> Maybe Text
key) (\s :: ProvisioningArtifactOutput
s@ProvisioningArtifactOutput' {} Maybe Text
a -> ProvisioningArtifactOutput
s {$sel:key:ProvisioningArtifactOutput' :: Maybe Text
key = Maybe Text
a} :: ProvisioningArtifactOutput)

-- | Description of the provisioning artifact output key.
provisioningArtifactOutput_description :: Lens.Lens' ProvisioningArtifactOutput (Prelude.Maybe Prelude.Text)
provisioningArtifactOutput_description :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactOutput -> f ProvisioningArtifactOutput
provisioningArtifactOutput_description = (ProvisioningArtifactOutput -> Maybe Text)
-> (ProvisioningArtifactOutput
    -> Maybe Text -> ProvisioningArtifactOutput)
-> Lens
     ProvisioningArtifactOutput
     ProvisioningArtifactOutput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactOutput' {Maybe Text
description :: Maybe Text
$sel:description:ProvisioningArtifactOutput' :: ProvisioningArtifactOutput -> Maybe Text
description} -> Maybe Text
description) (\s :: ProvisioningArtifactOutput
s@ProvisioningArtifactOutput' {} Maybe Text
a -> ProvisioningArtifactOutput
s {$sel:description:ProvisioningArtifactOutput' :: Maybe Text
description = Maybe Text
a} :: ProvisioningArtifactOutput)

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

instance Prelude.Hashable ProvisioningArtifactOutput

instance Prelude.NFData ProvisioningArtifactOutput