{-# 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.ServerlessApplicationRepository.Types.ParameterDefinition
-- 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.ServerlessApplicationRepository.Types.ParameterDefinition where

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

-- | Parameters supported by the application.
--
-- /See:/ 'newParameterDefinition' smart constructor.
data ParameterDefinition = ParameterDefinition'
  { -- | A numeric value that determines the largest numeric value that you want
    -- to allow for Number types.
    ParameterDefinition -> Maybe Int
maxValue :: Prelude.Maybe Prelude.Int,
    -- | An integer value that determines the largest number of characters that
    -- you want to allow for String types.
    ParameterDefinition -> Maybe Int
maxLength :: Prelude.Maybe Prelude.Int,
    -- | A string that explains a constraint when the constraint is violated. For
    -- example, without a constraint description, a parameter that has an
    -- allowed pattern of [A-Za-z0-9]+ displays the following error message
    -- when the user specifies an invalid value:
    --
    -- Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+
    --
    -- By adding a constraint description, such as \"must contain only
    -- uppercase and lowercase letters and numbers,\" you can display the
    -- following customized error message:
    --
    -- Malformed input-Parameter MyParameter must contain only uppercase and
    -- lowercase letters and numbers.
    ParameterDefinition -> Maybe Text
constraintDescription :: Prelude.Maybe Prelude.Text,
    -- | An integer value that determines the smallest number of characters that
    -- you want to allow for String types.
    ParameterDefinition -> Maybe Int
minLength :: Prelude.Maybe Prelude.Int,
    -- | A value of the appropriate type for the template to use if no value is
    -- specified when a stack is created. If you define constraints for the
    -- parameter, you must specify a value that adheres to those constraints.
    ParameterDefinition -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | A regular expression that represents the patterns to allow for String
    -- types.
    ParameterDefinition -> Maybe Text
allowedPattern :: Prelude.Maybe Prelude.Text,
    -- | Whether to mask the parameter value whenever anyone makes a call that
    -- describes the stack. If you set the value to true, the parameter value
    -- is masked with asterisks (*****).
    ParameterDefinition -> Maybe Bool
noEcho :: Prelude.Maybe Prelude.Bool,
    -- | The type of the parameter.
    --
    -- Valid values: String | Number | List\<Number> | CommaDelimitedList
    --
    -- String: A literal string.
    --
    -- For example, users can specify \"MyUserName\".
    --
    -- Number: An integer or float. AWS CloudFormation validates the parameter
    -- value as a number. However, when you use the parameter elsewhere in your
    -- template (for example, by using the Ref intrinsic function), the
    -- parameter value becomes a string.
    --
    -- For example, users might specify \"8888\".
    --
    -- List\<Number>: An array of integers or floats that are separated by
    -- commas. AWS CloudFormation validates the parameter value as numbers.
    -- However, when you use the parameter elsewhere in your template (for
    -- example, by using the Ref intrinsic function), the parameter value
    -- becomes a list of strings.
    --
    -- For example, users might specify \"80,20\", and then Ref results in
    -- [\"80\",\"20\"].
    --
    -- CommaDelimitedList: An array of literal strings that are separated by
    -- commas. The total number of strings should be one more than the total
    -- number of commas. Also, each member string is space-trimmed.
    --
    -- For example, users might specify \"test,dev,prod\", and then Ref results
    -- in [\"test\",\"dev\",\"prod\"].
    ParameterDefinition -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | An array containing the list of values allowed for the parameter.
    ParameterDefinition -> Maybe [Text]
allowedValues :: Prelude.Maybe [Prelude.Text],
    -- | A string of up to 4,000 characters that describes the parameter.
    ParameterDefinition -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A numeric value that determines the smallest numeric value that you want
    -- to allow for Number types.
    ParameterDefinition -> Maybe Int
minValue :: Prelude.Maybe Prelude.Int,
    -- | A list of AWS SAM resources that use this parameter.
    ParameterDefinition -> [Text]
referencedByResources :: [Prelude.Text],
    -- | The name of the parameter.
    ParameterDefinition -> Text
name :: Prelude.Text
  }
  deriving (ParameterDefinition -> ParameterDefinition -> Bool
(ParameterDefinition -> ParameterDefinition -> Bool)
-> (ParameterDefinition -> ParameterDefinition -> Bool)
-> Eq ParameterDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterDefinition -> ParameterDefinition -> Bool
$c/= :: ParameterDefinition -> ParameterDefinition -> Bool
== :: ParameterDefinition -> ParameterDefinition -> Bool
$c== :: ParameterDefinition -> ParameterDefinition -> Bool
Prelude.Eq, ReadPrec [ParameterDefinition]
ReadPrec ParameterDefinition
Int -> ReadS ParameterDefinition
ReadS [ParameterDefinition]
(Int -> ReadS ParameterDefinition)
-> ReadS [ParameterDefinition]
-> ReadPrec ParameterDefinition
-> ReadPrec [ParameterDefinition]
-> Read ParameterDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterDefinition]
$creadListPrec :: ReadPrec [ParameterDefinition]
readPrec :: ReadPrec ParameterDefinition
$creadPrec :: ReadPrec ParameterDefinition
readList :: ReadS [ParameterDefinition]
$creadList :: ReadS [ParameterDefinition]
readsPrec :: Int -> ReadS ParameterDefinition
$creadsPrec :: Int -> ReadS ParameterDefinition
Prelude.Read, Int -> ParameterDefinition -> ShowS
[ParameterDefinition] -> ShowS
ParameterDefinition -> String
(Int -> ParameterDefinition -> ShowS)
-> (ParameterDefinition -> String)
-> ([ParameterDefinition] -> ShowS)
-> Show ParameterDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterDefinition] -> ShowS
$cshowList :: [ParameterDefinition] -> ShowS
show :: ParameterDefinition -> String
$cshow :: ParameterDefinition -> String
showsPrec :: Int -> ParameterDefinition -> ShowS
$cshowsPrec :: Int -> ParameterDefinition -> ShowS
Prelude.Show, (forall x. ParameterDefinition -> Rep ParameterDefinition x)
-> (forall x. Rep ParameterDefinition x -> ParameterDefinition)
-> Generic ParameterDefinition
forall x. Rep ParameterDefinition x -> ParameterDefinition
forall x. ParameterDefinition -> Rep ParameterDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterDefinition x -> ParameterDefinition
$cfrom :: forall x. ParameterDefinition -> Rep ParameterDefinition x
Prelude.Generic)

-- |
-- Create a value of 'ParameterDefinition' 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:
--
-- 'maxValue', 'parameterDefinition_maxValue' - A numeric value that determines the largest numeric value that you want
-- to allow for Number types.
--
-- 'maxLength', 'parameterDefinition_maxLength' - An integer value that determines the largest number of characters that
-- you want to allow for String types.
--
-- 'constraintDescription', 'parameterDefinition_constraintDescription' - A string that explains a constraint when the constraint is violated. For
-- example, without a constraint description, a parameter that has an
-- allowed pattern of [A-Za-z0-9]+ displays the following error message
-- when the user specifies an invalid value:
--
-- Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+
--
-- By adding a constraint description, such as \"must contain only
-- uppercase and lowercase letters and numbers,\" you can display the
-- following customized error message:
--
-- Malformed input-Parameter MyParameter must contain only uppercase and
-- lowercase letters and numbers.
--
-- 'minLength', 'parameterDefinition_minLength' - An integer value that determines the smallest number of characters that
-- you want to allow for String types.
--
-- 'defaultValue', 'parameterDefinition_defaultValue' - A value of the appropriate type for the template to use if no value is
-- specified when a stack is created. If you define constraints for the
-- parameter, you must specify a value that adheres to those constraints.
--
-- 'allowedPattern', 'parameterDefinition_allowedPattern' - A regular expression that represents the patterns to allow for String
-- types.
--
-- 'noEcho', 'parameterDefinition_noEcho' - Whether to mask the parameter value whenever anyone makes a call that
-- describes the stack. If you set the value to true, the parameter value
-- is masked with asterisks (*****).
--
-- 'type'', 'parameterDefinition_type' - The type of the parameter.
--
-- Valid values: String | Number | List\<Number> | CommaDelimitedList
--
-- String: A literal string.
--
-- For example, users can specify \"MyUserName\".
--
-- Number: An integer or float. AWS CloudFormation validates the parameter
-- value as a number. However, when you use the parameter elsewhere in your
-- template (for example, by using the Ref intrinsic function), the
-- parameter value becomes a string.
--
-- For example, users might specify \"8888\".
--
-- List\<Number>: An array of integers or floats that are separated by
-- commas. AWS CloudFormation validates the parameter value as numbers.
-- However, when you use the parameter elsewhere in your template (for
-- example, by using the Ref intrinsic function), the parameter value
-- becomes a list of strings.
--
-- For example, users might specify \"80,20\", and then Ref results in
-- [\"80\",\"20\"].
--
-- CommaDelimitedList: An array of literal strings that are separated by
-- commas. The total number of strings should be one more than the total
-- number of commas. Also, each member string is space-trimmed.
--
-- For example, users might specify \"test,dev,prod\", and then Ref results
-- in [\"test\",\"dev\",\"prod\"].
--
-- 'allowedValues', 'parameterDefinition_allowedValues' - An array containing the list of values allowed for the parameter.
--
-- 'description', 'parameterDefinition_description' - A string of up to 4,000 characters that describes the parameter.
--
-- 'minValue', 'parameterDefinition_minValue' - A numeric value that determines the smallest numeric value that you want
-- to allow for Number types.
--
-- 'referencedByResources', 'parameterDefinition_referencedByResources' - A list of AWS SAM resources that use this parameter.
--
-- 'name', 'parameterDefinition_name' - The name of the parameter.
newParameterDefinition ::
  -- | 'name'
  Prelude.Text ->
  ParameterDefinition
newParameterDefinition :: Text -> ParameterDefinition
newParameterDefinition Text
pName_ =
  ParameterDefinition' :: Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> [Text]
-> Text
-> ParameterDefinition
ParameterDefinition'
    { $sel:maxValue:ParameterDefinition' :: Maybe Int
maxValue = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:maxLength:ParameterDefinition' :: Maybe Int
maxLength = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:constraintDescription:ParameterDefinition' :: Maybe Text
constraintDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:minLength:ParameterDefinition' :: Maybe Int
minLength = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:ParameterDefinition' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedPattern:ParameterDefinition' :: Maybe Text
allowedPattern = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:noEcho:ParameterDefinition' :: Maybe Bool
noEcho = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ParameterDefinition' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedValues:ParameterDefinition' :: Maybe [Text]
allowedValues = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ParameterDefinition' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:minValue:ParameterDefinition' :: Maybe Int
minValue = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:referencedByResources:ParameterDefinition' :: [Text]
referencedByResources = [Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:name:ParameterDefinition' :: Text
name = Text
pName_
    }

-- | A numeric value that determines the largest numeric value that you want
-- to allow for Number types.
parameterDefinition_maxValue :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Int)
parameterDefinition_maxValue :: (Maybe Int -> f (Maybe Int))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_maxValue = (ParameterDefinition -> Maybe Int)
-> (ParameterDefinition -> Maybe Int -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Int
maxValue :: Maybe Int
$sel:maxValue:ParameterDefinition' :: ParameterDefinition -> Maybe Int
maxValue} -> Maybe Int
maxValue) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Int
a -> ParameterDefinition
s {$sel:maxValue:ParameterDefinition' :: Maybe Int
maxValue = Maybe Int
a} :: ParameterDefinition)

-- | An integer value that determines the largest number of characters that
-- you want to allow for String types.
parameterDefinition_maxLength :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Int)
parameterDefinition_maxLength :: (Maybe Int -> f (Maybe Int))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_maxLength = (ParameterDefinition -> Maybe Int)
-> (ParameterDefinition -> Maybe Int -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Int
maxLength :: Maybe Int
$sel:maxLength:ParameterDefinition' :: ParameterDefinition -> Maybe Int
maxLength} -> Maybe Int
maxLength) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Int
a -> ParameterDefinition
s {$sel:maxLength:ParameterDefinition' :: Maybe Int
maxLength = Maybe Int
a} :: ParameterDefinition)

-- | A string that explains a constraint when the constraint is violated. For
-- example, without a constraint description, a parameter that has an
-- allowed pattern of [A-Za-z0-9]+ displays the following error message
-- when the user specifies an invalid value:
--
-- Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+
--
-- By adding a constraint description, such as \"must contain only
-- uppercase and lowercase letters and numbers,\" you can display the
-- following customized error message:
--
-- Malformed input-Parameter MyParameter must contain only uppercase and
-- lowercase letters and numbers.
parameterDefinition_constraintDescription :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Text)
parameterDefinition_constraintDescription :: (Maybe Text -> f (Maybe Text))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_constraintDescription = (ParameterDefinition -> Maybe Text)
-> (ParameterDefinition -> Maybe Text -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Text
constraintDescription :: Maybe Text
$sel:constraintDescription:ParameterDefinition' :: ParameterDefinition -> Maybe Text
constraintDescription} -> Maybe Text
constraintDescription) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Text
a -> ParameterDefinition
s {$sel:constraintDescription:ParameterDefinition' :: Maybe Text
constraintDescription = Maybe Text
a} :: ParameterDefinition)

-- | An integer value that determines the smallest number of characters that
-- you want to allow for String types.
parameterDefinition_minLength :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Int)
parameterDefinition_minLength :: (Maybe Int -> f (Maybe Int))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_minLength = (ParameterDefinition -> Maybe Int)
-> (ParameterDefinition -> Maybe Int -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Int
minLength :: Maybe Int
$sel:minLength:ParameterDefinition' :: ParameterDefinition -> Maybe Int
minLength} -> Maybe Int
minLength) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Int
a -> ParameterDefinition
s {$sel:minLength:ParameterDefinition' :: Maybe Int
minLength = Maybe Int
a} :: ParameterDefinition)

-- | A value of the appropriate type for the template to use if no value is
-- specified when a stack is created. If you define constraints for the
-- parameter, you must specify a value that adheres to those constraints.
parameterDefinition_defaultValue :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Text)
parameterDefinition_defaultValue :: (Maybe Text -> f (Maybe Text))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_defaultValue = (ParameterDefinition -> Maybe Text)
-> (ParameterDefinition -> Maybe Text -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:ParameterDefinition' :: ParameterDefinition -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Text
a -> ParameterDefinition
s {$sel:defaultValue:ParameterDefinition' :: Maybe Text
defaultValue = Maybe Text
a} :: ParameterDefinition)

-- | A regular expression that represents the patterns to allow for String
-- types.
parameterDefinition_allowedPattern :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Text)
parameterDefinition_allowedPattern :: (Maybe Text -> f (Maybe Text))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_allowedPattern = (ParameterDefinition -> Maybe Text)
-> (ParameterDefinition -> Maybe Text -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Text
allowedPattern :: Maybe Text
$sel:allowedPattern:ParameterDefinition' :: ParameterDefinition -> Maybe Text
allowedPattern} -> Maybe Text
allowedPattern) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Text
a -> ParameterDefinition
s {$sel:allowedPattern:ParameterDefinition' :: Maybe Text
allowedPattern = Maybe Text
a} :: ParameterDefinition)

-- | Whether to mask the parameter value whenever anyone makes a call that
-- describes the stack. If you set the value to true, the parameter value
-- is masked with asterisks (*****).
parameterDefinition_noEcho :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Bool)
parameterDefinition_noEcho :: (Maybe Bool -> f (Maybe Bool))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_noEcho = (ParameterDefinition -> Maybe Bool)
-> (ParameterDefinition -> Maybe Bool -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Bool
noEcho :: Maybe Bool
$sel:noEcho:ParameterDefinition' :: ParameterDefinition -> Maybe Bool
noEcho} -> Maybe Bool
noEcho) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Bool
a -> ParameterDefinition
s {$sel:noEcho:ParameterDefinition' :: Maybe Bool
noEcho = Maybe Bool
a} :: ParameterDefinition)

-- | The type of the parameter.
--
-- Valid values: String | Number | List\<Number> | CommaDelimitedList
--
-- String: A literal string.
--
-- For example, users can specify \"MyUserName\".
--
-- Number: An integer or float. AWS CloudFormation validates the parameter
-- value as a number. However, when you use the parameter elsewhere in your
-- template (for example, by using the Ref intrinsic function), the
-- parameter value becomes a string.
--
-- For example, users might specify \"8888\".
--
-- List\<Number>: An array of integers or floats that are separated by
-- commas. AWS CloudFormation validates the parameter value as numbers.
-- However, when you use the parameter elsewhere in your template (for
-- example, by using the Ref intrinsic function), the parameter value
-- becomes a list of strings.
--
-- For example, users might specify \"80,20\", and then Ref results in
-- [\"80\",\"20\"].
--
-- CommaDelimitedList: An array of literal strings that are separated by
-- commas. The total number of strings should be one more than the total
-- number of commas. Also, each member string is space-trimmed.
--
-- For example, users might specify \"test,dev,prod\", and then Ref results
-- in [\"test\",\"dev\",\"prod\"].
parameterDefinition_type :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Text)
parameterDefinition_type :: (Maybe Text -> f (Maybe Text))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_type = (ParameterDefinition -> Maybe Text)
-> (ParameterDefinition -> Maybe Text -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Text
type' :: Maybe Text
$sel:type':ParameterDefinition' :: ParameterDefinition -> Maybe Text
type'} -> Maybe Text
type') (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Text
a -> ParameterDefinition
s {$sel:type':ParameterDefinition' :: Maybe Text
type' = Maybe Text
a} :: ParameterDefinition)

-- | An array containing the list of values allowed for the parameter.
parameterDefinition_allowedValues :: Lens.Lens' ParameterDefinition (Prelude.Maybe [Prelude.Text])
parameterDefinition_allowedValues :: (Maybe [Text] -> f (Maybe [Text]))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_allowedValues = (ParameterDefinition -> Maybe [Text])
-> (ParameterDefinition -> Maybe [Text] -> ParameterDefinition)
-> Lens
     ParameterDefinition
     ParameterDefinition
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe [Text]
allowedValues :: Maybe [Text]
$sel:allowedValues:ParameterDefinition' :: ParameterDefinition -> Maybe [Text]
allowedValues} -> Maybe [Text]
allowedValues) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe [Text]
a -> ParameterDefinition
s {$sel:allowedValues:ParameterDefinition' :: Maybe [Text]
allowedValues = Maybe [Text]
a} :: ParameterDefinition) ((Maybe [Text] -> f (Maybe [Text]))
 -> ParameterDefinition -> f ParameterDefinition)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ParameterDefinition
-> f ParameterDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A string of up to 4,000 characters that describes the parameter.
parameterDefinition_description :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Text)
parameterDefinition_description :: (Maybe Text -> f (Maybe Text))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_description = (ParameterDefinition -> Maybe Text)
-> (ParameterDefinition -> Maybe Text -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Text
description :: Maybe Text
$sel:description:ParameterDefinition' :: ParameterDefinition -> Maybe Text
description} -> Maybe Text
description) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Text
a -> ParameterDefinition
s {$sel:description:ParameterDefinition' :: Maybe Text
description = Maybe Text
a} :: ParameterDefinition)

-- | A numeric value that determines the smallest numeric value that you want
-- to allow for Number types.
parameterDefinition_minValue :: Lens.Lens' ParameterDefinition (Prelude.Maybe Prelude.Int)
parameterDefinition_minValue :: (Maybe Int -> f (Maybe Int))
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_minValue = (ParameterDefinition -> Maybe Int)
-> (ParameterDefinition -> Maybe Int -> ParameterDefinition)
-> Lens
     ParameterDefinition ParameterDefinition (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {Maybe Int
minValue :: Maybe Int
$sel:minValue:ParameterDefinition' :: ParameterDefinition -> Maybe Int
minValue} -> Maybe Int
minValue) (\s :: ParameterDefinition
s@ParameterDefinition' {} Maybe Int
a -> ParameterDefinition
s {$sel:minValue:ParameterDefinition' :: Maybe Int
minValue = Maybe Int
a} :: ParameterDefinition)

-- | A list of AWS SAM resources that use this parameter.
parameterDefinition_referencedByResources :: Lens.Lens' ParameterDefinition [Prelude.Text]
parameterDefinition_referencedByResources :: ([Text] -> f [Text])
-> ParameterDefinition -> f ParameterDefinition
parameterDefinition_referencedByResources = (ParameterDefinition -> [Text])
-> (ParameterDefinition -> [Text] -> ParameterDefinition)
-> Lens ParameterDefinition ParameterDefinition [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterDefinition' {[Text]
referencedByResources :: [Text]
$sel:referencedByResources:ParameterDefinition' :: ParameterDefinition -> [Text]
referencedByResources} -> [Text]
referencedByResources) (\s :: ParameterDefinition
s@ParameterDefinition' {} [Text]
a -> ParameterDefinition
s {$sel:referencedByResources:ParameterDefinition' :: [Text]
referencedByResources = [Text]
a} :: ParameterDefinition) (([Text] -> f [Text])
 -> ParameterDefinition -> f ParameterDefinition)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ParameterDefinition
-> f ParameterDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Core.FromJSON ParameterDefinition where
  parseJSON :: Value -> Parser ParameterDefinition
parseJSON =
    String
-> (Object -> Parser ParameterDefinition)
-> Value
-> Parser ParameterDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ParameterDefinition"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> [Text]
-> Text
-> ParameterDefinition
ParameterDefinition'
            (Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Int
 -> [Text]
 -> Text
 -> ParameterDefinition)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Int
      -> [Text]
      -> Text
      -> ParameterDefinition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxValue")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Int
   -> [Text]
   -> Text
   -> ParameterDefinition)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Int
      -> [Text]
      -> Text
      -> ParameterDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxLength")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Int
   -> [Text]
   -> Text
   -> ParameterDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Int
      -> [Text]
      -> Text
      -> ParameterDefinition)
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
"constraintDescription")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Int
   -> [Text]
   -> Text
   -> ParameterDefinition)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Int
      -> [Text]
      -> Text
      -> ParameterDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"minLength")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Int
   -> [Text]
   -> Text
   -> ParameterDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Int
      -> [Text]
      -> Text
      -> ParameterDefinition)
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
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Int
   -> [Text]
   -> Text
   -> ParameterDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Int
      -> [Text]
      -> Text
      -> ParameterDefinition)
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
"allowedPattern")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Int
   -> [Text]
   -> Text
   -> ParameterDefinition)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Int
      -> [Text]
      -> Text
      -> ParameterDefinition)
forall (f :: * -> *) a b. Applicative f => 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
"noEcho")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Int
   -> [Text]
   -> Text
   -> ParameterDefinition)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Int
      -> [Text]
      -> Text
      -> ParameterDefinition)
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
"type")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Int
   -> [Text]
   -> Text
   -> ParameterDefinition)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text -> Maybe Int -> [Text] -> Text -> ParameterDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"allowedValues" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text -> Maybe Int -> [Text] -> Text -> ParameterDefinition)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> [Text] -> Text -> ParameterDefinition)
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")
            Parser (Maybe Int -> [Text] -> Text -> ParameterDefinition)
-> Parser (Maybe Int)
-> Parser ([Text] -> Text -> ParameterDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"minValue")
            Parser ([Text] -> Text -> ParameterDefinition)
-> Parser [Text] -> Parser (Text -> ParameterDefinition)
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
"referencedByResources"
                            Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Text -> ParameterDefinition)
-> Parser Text -> Parser ParameterDefinition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
      )

instance Prelude.Hashable ParameterDefinition

instance Prelude.NFData ParameterDefinition