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

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

-- | The output for the product created as the result of a request. For
-- example, the output for a CloudFormation-backed product that creates an
-- S3 bucket would include the S3 bucket URL.
--
-- /See:/ 'newRecordOutput' smart constructor.
data RecordOutput = RecordOutput'
  { -- | The output value.
    RecordOutput -> Maybe Text
outputValue :: Prelude.Maybe Prelude.Text,
    -- | The output key.
    RecordOutput -> Maybe Text
outputKey :: Prelude.Maybe Prelude.Text,
    -- | The description of the output.
    RecordOutput -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (RecordOutput -> RecordOutput -> Bool
(RecordOutput -> RecordOutput -> Bool)
-> (RecordOutput -> RecordOutput -> Bool) -> Eq RecordOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecordOutput -> RecordOutput -> Bool
$c/= :: RecordOutput -> RecordOutput -> Bool
== :: RecordOutput -> RecordOutput -> Bool
$c== :: RecordOutput -> RecordOutput -> Bool
Prelude.Eq, ReadPrec [RecordOutput]
ReadPrec RecordOutput
Int -> ReadS RecordOutput
ReadS [RecordOutput]
(Int -> ReadS RecordOutput)
-> ReadS [RecordOutput]
-> ReadPrec RecordOutput
-> ReadPrec [RecordOutput]
-> Read RecordOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecordOutput]
$creadListPrec :: ReadPrec [RecordOutput]
readPrec :: ReadPrec RecordOutput
$creadPrec :: ReadPrec RecordOutput
readList :: ReadS [RecordOutput]
$creadList :: ReadS [RecordOutput]
readsPrec :: Int -> ReadS RecordOutput
$creadsPrec :: Int -> ReadS RecordOutput
Prelude.Read, Int -> RecordOutput -> ShowS
[RecordOutput] -> ShowS
RecordOutput -> String
(Int -> RecordOutput -> ShowS)
-> (RecordOutput -> String)
-> ([RecordOutput] -> ShowS)
-> Show RecordOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecordOutput] -> ShowS
$cshowList :: [RecordOutput] -> ShowS
show :: RecordOutput -> String
$cshow :: RecordOutput -> String
showsPrec :: Int -> RecordOutput -> ShowS
$cshowsPrec :: Int -> RecordOutput -> ShowS
Prelude.Show, (forall x. RecordOutput -> Rep RecordOutput x)
-> (forall x. Rep RecordOutput x -> RecordOutput)
-> Generic RecordOutput
forall x. Rep RecordOutput x -> RecordOutput
forall x. RecordOutput -> Rep RecordOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RecordOutput x -> RecordOutput
$cfrom :: forall x. RecordOutput -> Rep RecordOutput x
Prelude.Generic)

-- |
-- Create a value of 'RecordOutput' 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:
--
-- 'outputValue', 'recordOutput_outputValue' - The output value.
--
-- 'outputKey', 'recordOutput_outputKey' - The output key.
--
-- 'description', 'recordOutput_description' - The description of the output.
newRecordOutput ::
  RecordOutput
newRecordOutput :: RecordOutput
newRecordOutput =
  RecordOutput' :: Maybe Text -> Maybe Text -> Maybe Text -> RecordOutput
RecordOutput'
    { $sel:outputValue:RecordOutput' :: Maybe Text
outputValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outputKey:RecordOutput' :: Maybe Text
outputKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:RecordOutput' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The output value.
recordOutput_outputValue :: Lens.Lens' RecordOutput (Prelude.Maybe Prelude.Text)
recordOutput_outputValue :: (Maybe Text -> f (Maybe Text)) -> RecordOutput -> f RecordOutput
recordOutput_outputValue = (RecordOutput -> Maybe Text)
-> (RecordOutput -> Maybe Text -> RecordOutput)
-> Lens RecordOutput RecordOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordOutput' {Maybe Text
outputValue :: Maybe Text
$sel:outputValue:RecordOutput' :: RecordOutput -> Maybe Text
outputValue} -> Maybe Text
outputValue) (\s :: RecordOutput
s@RecordOutput' {} Maybe Text
a -> RecordOutput
s {$sel:outputValue:RecordOutput' :: Maybe Text
outputValue = Maybe Text
a} :: RecordOutput)

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

-- | The description of the output.
recordOutput_description :: Lens.Lens' RecordOutput (Prelude.Maybe Prelude.Text)
recordOutput_description :: (Maybe Text -> f (Maybe Text)) -> RecordOutput -> f RecordOutput
recordOutput_description = (RecordOutput -> Maybe Text)
-> (RecordOutput -> Maybe Text -> RecordOutput)
-> Lens RecordOutput RecordOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordOutput' {Maybe Text
description :: Maybe Text
$sel:description:RecordOutput' :: RecordOutput -> Maybe Text
description} -> Maybe Text
description) (\s :: RecordOutput
s@RecordOutput' {} Maybe Text
a -> RecordOutput
s {$sel:description:RecordOutput' :: Maybe Text
description = Maybe Text
a} :: RecordOutput)

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

instance Prelude.NFData RecordOutput