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

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

-- | Information about a parameter used to provision a product.
--
-- /See:/ 'newProvisioningArtifactParameter' smart constructor.
data ProvisioningArtifactParameter = ProvisioningArtifactParameter'
  { -- | If this value is true, the value for this parameter is obfuscated from
    -- view when the parameter is retrieved. This parameter is used to hide
    -- sensitive information.
    ProvisioningArtifactParameter -> Maybe Bool
isNoEcho :: Prelude.Maybe Prelude.Bool,
    -- | The parameter key.
    ProvisioningArtifactParameter -> Maybe Text
parameterKey :: Prelude.Maybe Prelude.Text,
    -- | The parameter type.
    ProvisioningArtifactParameter -> Maybe Text
parameterType :: Prelude.Maybe Prelude.Text,
    -- | Constraints that the administrator has put on a parameter.
    ProvisioningArtifactParameter -> Maybe ParameterConstraints
parameterConstraints :: Prelude.Maybe ParameterConstraints,
    -- | The default value.
    ProvisioningArtifactParameter -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | The description of the parameter.
    ProvisioningArtifactParameter -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ProvisioningArtifactParameter
-> ProvisioningArtifactParameter -> Bool
(ProvisioningArtifactParameter
 -> ProvisioningArtifactParameter -> Bool)
-> (ProvisioningArtifactParameter
    -> ProvisioningArtifactParameter -> Bool)
-> Eq ProvisioningArtifactParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningArtifactParameter
-> ProvisioningArtifactParameter -> Bool
$c/= :: ProvisioningArtifactParameter
-> ProvisioningArtifactParameter -> Bool
== :: ProvisioningArtifactParameter
-> ProvisioningArtifactParameter -> Bool
$c== :: ProvisioningArtifactParameter
-> ProvisioningArtifactParameter -> Bool
Prelude.Eq, ReadPrec [ProvisioningArtifactParameter]
ReadPrec ProvisioningArtifactParameter
Int -> ReadS ProvisioningArtifactParameter
ReadS [ProvisioningArtifactParameter]
(Int -> ReadS ProvisioningArtifactParameter)
-> ReadS [ProvisioningArtifactParameter]
-> ReadPrec ProvisioningArtifactParameter
-> ReadPrec [ProvisioningArtifactParameter]
-> Read ProvisioningArtifactParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningArtifactParameter]
$creadListPrec :: ReadPrec [ProvisioningArtifactParameter]
readPrec :: ReadPrec ProvisioningArtifactParameter
$creadPrec :: ReadPrec ProvisioningArtifactParameter
readList :: ReadS [ProvisioningArtifactParameter]
$creadList :: ReadS [ProvisioningArtifactParameter]
readsPrec :: Int -> ReadS ProvisioningArtifactParameter
$creadsPrec :: Int -> ReadS ProvisioningArtifactParameter
Prelude.Read, Int -> ProvisioningArtifactParameter -> ShowS
[ProvisioningArtifactParameter] -> ShowS
ProvisioningArtifactParameter -> String
(Int -> ProvisioningArtifactParameter -> ShowS)
-> (ProvisioningArtifactParameter -> String)
-> ([ProvisioningArtifactParameter] -> ShowS)
-> Show ProvisioningArtifactParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningArtifactParameter] -> ShowS
$cshowList :: [ProvisioningArtifactParameter] -> ShowS
show :: ProvisioningArtifactParameter -> String
$cshow :: ProvisioningArtifactParameter -> String
showsPrec :: Int -> ProvisioningArtifactParameter -> ShowS
$cshowsPrec :: Int -> ProvisioningArtifactParameter -> ShowS
Prelude.Show, (forall x.
 ProvisioningArtifactParameter
 -> Rep ProvisioningArtifactParameter x)
-> (forall x.
    Rep ProvisioningArtifactParameter x
    -> ProvisioningArtifactParameter)
-> Generic ProvisioningArtifactParameter
forall x.
Rep ProvisioningArtifactParameter x
-> ProvisioningArtifactParameter
forall x.
ProvisioningArtifactParameter
-> Rep ProvisioningArtifactParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisioningArtifactParameter x
-> ProvisioningArtifactParameter
$cfrom :: forall x.
ProvisioningArtifactParameter
-> Rep ProvisioningArtifactParameter x
Prelude.Generic)

-- |
-- Create a value of 'ProvisioningArtifactParameter' 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:
--
-- 'isNoEcho', 'provisioningArtifactParameter_isNoEcho' - If this value is true, the value for this parameter is obfuscated from
-- view when the parameter is retrieved. This parameter is used to hide
-- sensitive information.
--
-- 'parameterKey', 'provisioningArtifactParameter_parameterKey' - The parameter key.
--
-- 'parameterType', 'provisioningArtifactParameter_parameterType' - The parameter type.
--
-- 'parameterConstraints', 'provisioningArtifactParameter_parameterConstraints' - Constraints that the administrator has put on a parameter.
--
-- 'defaultValue', 'provisioningArtifactParameter_defaultValue' - The default value.
--
-- 'description', 'provisioningArtifactParameter_description' - The description of the parameter.
newProvisioningArtifactParameter ::
  ProvisioningArtifactParameter
newProvisioningArtifactParameter :: ProvisioningArtifactParameter
newProvisioningArtifactParameter =
  ProvisioningArtifactParameter' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ParameterConstraints
-> Maybe Text
-> Maybe Text
-> ProvisioningArtifactParameter
ProvisioningArtifactParameter'
    { $sel:isNoEcho:ProvisioningArtifactParameter' :: Maybe Bool
isNoEcho =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterKey:ProvisioningArtifactParameter' :: Maybe Text
parameterKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterType:ProvisioningArtifactParameter' :: Maybe Text
parameterType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterConstraints:ProvisioningArtifactParameter' :: Maybe ParameterConstraints
parameterConstraints = Maybe ParameterConstraints
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:ProvisioningArtifactParameter' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ProvisioningArtifactParameter' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | If this value is true, the value for this parameter is obfuscated from
-- view when the parameter is retrieved. This parameter is used to hide
-- sensitive information.
provisioningArtifactParameter_isNoEcho :: Lens.Lens' ProvisioningArtifactParameter (Prelude.Maybe Prelude.Bool)
provisioningArtifactParameter_isNoEcho :: (Maybe Bool -> f (Maybe Bool))
-> ProvisioningArtifactParameter -> f ProvisioningArtifactParameter
provisioningArtifactParameter_isNoEcho = (ProvisioningArtifactParameter -> Maybe Bool)
-> (ProvisioningArtifactParameter
    -> Maybe Bool -> ProvisioningArtifactParameter)
-> Lens
     ProvisioningArtifactParameter
     ProvisioningArtifactParameter
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactParameter' {Maybe Bool
isNoEcho :: Maybe Bool
$sel:isNoEcho:ProvisioningArtifactParameter' :: ProvisioningArtifactParameter -> Maybe Bool
isNoEcho} -> Maybe Bool
isNoEcho) (\s :: ProvisioningArtifactParameter
s@ProvisioningArtifactParameter' {} Maybe Bool
a -> ProvisioningArtifactParameter
s {$sel:isNoEcho:ProvisioningArtifactParameter' :: Maybe Bool
isNoEcho = Maybe Bool
a} :: ProvisioningArtifactParameter)

-- | The parameter key.
provisioningArtifactParameter_parameterKey :: Lens.Lens' ProvisioningArtifactParameter (Prelude.Maybe Prelude.Text)
provisioningArtifactParameter_parameterKey :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactParameter -> f ProvisioningArtifactParameter
provisioningArtifactParameter_parameterKey = (ProvisioningArtifactParameter -> Maybe Text)
-> (ProvisioningArtifactParameter
    -> Maybe Text -> ProvisioningArtifactParameter)
-> Lens
     ProvisioningArtifactParameter
     ProvisioningArtifactParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactParameter' {Maybe Text
parameterKey :: Maybe Text
$sel:parameterKey:ProvisioningArtifactParameter' :: ProvisioningArtifactParameter -> Maybe Text
parameterKey} -> Maybe Text
parameterKey) (\s :: ProvisioningArtifactParameter
s@ProvisioningArtifactParameter' {} Maybe Text
a -> ProvisioningArtifactParameter
s {$sel:parameterKey:ProvisioningArtifactParameter' :: Maybe Text
parameterKey = Maybe Text
a} :: ProvisioningArtifactParameter)

-- | The parameter type.
provisioningArtifactParameter_parameterType :: Lens.Lens' ProvisioningArtifactParameter (Prelude.Maybe Prelude.Text)
provisioningArtifactParameter_parameterType :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactParameter -> f ProvisioningArtifactParameter
provisioningArtifactParameter_parameterType = (ProvisioningArtifactParameter -> Maybe Text)
-> (ProvisioningArtifactParameter
    -> Maybe Text -> ProvisioningArtifactParameter)
-> Lens
     ProvisioningArtifactParameter
     ProvisioningArtifactParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactParameter' {Maybe Text
parameterType :: Maybe Text
$sel:parameterType:ProvisioningArtifactParameter' :: ProvisioningArtifactParameter -> Maybe Text
parameterType} -> Maybe Text
parameterType) (\s :: ProvisioningArtifactParameter
s@ProvisioningArtifactParameter' {} Maybe Text
a -> ProvisioningArtifactParameter
s {$sel:parameterType:ProvisioningArtifactParameter' :: Maybe Text
parameterType = Maybe Text
a} :: ProvisioningArtifactParameter)

-- | Constraints that the administrator has put on a parameter.
provisioningArtifactParameter_parameterConstraints :: Lens.Lens' ProvisioningArtifactParameter (Prelude.Maybe ParameterConstraints)
provisioningArtifactParameter_parameterConstraints :: (Maybe ParameterConstraints -> f (Maybe ParameterConstraints))
-> ProvisioningArtifactParameter -> f ProvisioningArtifactParameter
provisioningArtifactParameter_parameterConstraints = (ProvisioningArtifactParameter -> Maybe ParameterConstraints)
-> (ProvisioningArtifactParameter
    -> Maybe ParameterConstraints -> ProvisioningArtifactParameter)
-> Lens
     ProvisioningArtifactParameter
     ProvisioningArtifactParameter
     (Maybe ParameterConstraints)
     (Maybe ParameterConstraints)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactParameter' {Maybe ParameterConstraints
parameterConstraints :: Maybe ParameterConstraints
$sel:parameterConstraints:ProvisioningArtifactParameter' :: ProvisioningArtifactParameter -> Maybe ParameterConstraints
parameterConstraints} -> Maybe ParameterConstraints
parameterConstraints) (\s :: ProvisioningArtifactParameter
s@ProvisioningArtifactParameter' {} Maybe ParameterConstraints
a -> ProvisioningArtifactParameter
s {$sel:parameterConstraints:ProvisioningArtifactParameter' :: Maybe ParameterConstraints
parameterConstraints = Maybe ParameterConstraints
a} :: ProvisioningArtifactParameter)

-- | The default value.
provisioningArtifactParameter_defaultValue :: Lens.Lens' ProvisioningArtifactParameter (Prelude.Maybe Prelude.Text)
provisioningArtifactParameter_defaultValue :: (Maybe Text -> f (Maybe Text))
-> ProvisioningArtifactParameter -> f ProvisioningArtifactParameter
provisioningArtifactParameter_defaultValue = (ProvisioningArtifactParameter -> Maybe Text)
-> (ProvisioningArtifactParameter
    -> Maybe Text -> ProvisioningArtifactParameter)
-> Lens
     ProvisioningArtifactParameter
     ProvisioningArtifactParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningArtifactParameter' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:ProvisioningArtifactParameter' :: ProvisioningArtifactParameter -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: ProvisioningArtifactParameter
s@ProvisioningArtifactParameter' {} Maybe Text
a -> ProvisioningArtifactParameter
s {$sel:defaultValue:ProvisioningArtifactParameter' :: Maybe Text
defaultValue = Maybe Text
a} :: ProvisioningArtifactParameter)

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

instance Core.FromJSON ProvisioningArtifactParameter where
  parseJSON :: Value -> Parser ProvisioningArtifactParameter
parseJSON =
    String
-> (Object -> Parser ProvisioningArtifactParameter)
-> Value
-> Parser ProvisioningArtifactParameter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProvisioningArtifactParameter"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ParameterConstraints
-> Maybe Text
-> Maybe Text
-> ProvisioningArtifactParameter
ProvisioningArtifactParameter'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe ParameterConstraints
 -> Maybe Text
 -> Maybe Text
 -> ProvisioningArtifactParameter)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ParameterConstraints
      -> Maybe Text
      -> Maybe Text
      -> ProvisioningArtifactParameter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsNoEcho")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ParameterConstraints
   -> Maybe Text
   -> Maybe Text
   -> ProvisioningArtifactParameter)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ParameterConstraints
      -> Maybe Text
      -> Maybe Text
      -> ProvisioningArtifactParameter)
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
"ParameterKey")
            Parser
  (Maybe Text
   -> Maybe ParameterConstraints
   -> Maybe Text
   -> Maybe Text
   -> ProvisioningArtifactParameter)
-> Parser (Maybe Text)
-> Parser
     (Maybe ParameterConstraints
      -> Maybe Text -> Maybe Text -> ProvisioningArtifactParameter)
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
"ParameterType")
            Parser
  (Maybe ParameterConstraints
   -> Maybe Text -> Maybe Text -> ProvisioningArtifactParameter)
-> Parser (Maybe ParameterConstraints)
-> Parser
     (Maybe Text -> Maybe Text -> ProvisioningArtifactParameter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ParameterConstraints)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParameterConstraints")
            Parser (Maybe Text -> Maybe Text -> ProvisioningArtifactParameter)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ProvisioningArtifactParameter)
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
"DefaultValue")
            Parser (Maybe Text -> ProvisioningArtifactParameter)
-> Parser (Maybe Text) -> Parser ProvisioningArtifactParameter
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
    ProvisioningArtifactParameter

instance Prelude.NFData ProvisioningArtifactParameter