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

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

-- | The description of the output.
recordOutput_description :: Lens.Lens' RecordOutput (Prelude.Maybe Prelude.Text)
recordOutput_description :: Lens' RecordOutput (Maybe Text)
recordOutput_description = 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)

-- | The output key.
recordOutput_outputKey :: Lens.Lens' RecordOutput (Prelude.Maybe Prelude.Text)
recordOutput_outputKey :: Lens' RecordOutput (Maybe Text)
recordOutput_outputKey = 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 output value.
recordOutput_outputValue :: Lens.Lens' RecordOutput (Prelude.Maybe Prelude.Text)
recordOutput_outputValue :: Lens' RecordOutput (Maybe Text)
recordOutput_outputValue = 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)

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

instance Prelude.Hashable RecordOutput where
  hashWithSalt :: Int -> RecordOutput -> Int
hashWithSalt Int
_salt RecordOutput' {Maybe Text
outputValue :: Maybe Text
outputKey :: Maybe Text
description :: Maybe Text
$sel:outputValue:RecordOutput' :: RecordOutput -> Maybe Text
$sel:outputKey:RecordOutput' :: RecordOutput -> Maybe Text
$sel:description:RecordOutput' :: RecordOutput -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outputValue

instance Prelude.NFData RecordOutput where
  rnf :: RecordOutput -> ()
rnf RecordOutput' {Maybe Text
outputValue :: Maybe Text
outputKey :: Maybe Text
description :: Maybe Text
$sel:outputValue:RecordOutput' :: RecordOutput -> Maybe Text
$sel:outputKey:RecordOutput' :: RecordOutput -> Maybe Text
$sel:description:RecordOutput' :: RecordOutput -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outputValue