{-# 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 #-}
module Amazonka.ServiceCatalog.Types.ParameterConstraints where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ParameterConstraints = ParameterConstraints'
{
ParameterConstraints -> Maybe Text
maxValue :: Prelude.Maybe Prelude.Text,
ParameterConstraints -> Maybe Text
maxLength :: Prelude.Maybe Prelude.Text,
ParameterConstraints -> Maybe Text
constraintDescription :: Prelude.Maybe Prelude.Text,
ParameterConstraints -> Maybe Text
minLength :: Prelude.Maybe Prelude.Text,
ParameterConstraints -> Maybe Text
allowedPattern :: Prelude.Maybe Prelude.Text,
ParameterConstraints -> Maybe [Text]
allowedValues :: Prelude.Maybe [Prelude.Text],
ParameterConstraints -> Maybe Text
minValue :: Prelude.Maybe Prelude.Text
}
deriving (ParameterConstraints -> ParameterConstraints -> Bool
(ParameterConstraints -> ParameterConstraints -> Bool)
-> (ParameterConstraints -> ParameterConstraints -> Bool)
-> Eq ParameterConstraints
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterConstraints -> ParameterConstraints -> Bool
$c/= :: ParameterConstraints -> ParameterConstraints -> Bool
== :: ParameterConstraints -> ParameterConstraints -> Bool
$c== :: ParameterConstraints -> ParameterConstraints -> Bool
Prelude.Eq, ReadPrec [ParameterConstraints]
ReadPrec ParameterConstraints
Int -> ReadS ParameterConstraints
ReadS [ParameterConstraints]
(Int -> ReadS ParameterConstraints)
-> ReadS [ParameterConstraints]
-> ReadPrec ParameterConstraints
-> ReadPrec [ParameterConstraints]
-> Read ParameterConstraints
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterConstraints]
$creadListPrec :: ReadPrec [ParameterConstraints]
readPrec :: ReadPrec ParameterConstraints
$creadPrec :: ReadPrec ParameterConstraints
readList :: ReadS [ParameterConstraints]
$creadList :: ReadS [ParameterConstraints]
readsPrec :: Int -> ReadS ParameterConstraints
$creadsPrec :: Int -> ReadS ParameterConstraints
Prelude.Read, Int -> ParameterConstraints -> ShowS
[ParameterConstraints] -> ShowS
ParameterConstraints -> String
(Int -> ParameterConstraints -> ShowS)
-> (ParameterConstraints -> String)
-> ([ParameterConstraints] -> ShowS)
-> Show ParameterConstraints
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterConstraints] -> ShowS
$cshowList :: [ParameterConstraints] -> ShowS
show :: ParameterConstraints -> String
$cshow :: ParameterConstraints -> String
showsPrec :: Int -> ParameterConstraints -> ShowS
$cshowsPrec :: Int -> ParameterConstraints -> ShowS
Prelude.Show, (forall x. ParameterConstraints -> Rep ParameterConstraints x)
-> (forall x. Rep ParameterConstraints x -> ParameterConstraints)
-> Generic ParameterConstraints
forall x. Rep ParameterConstraints x -> ParameterConstraints
forall x. ParameterConstraints -> Rep ParameterConstraints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterConstraints x -> ParameterConstraints
$cfrom :: forall x. ParameterConstraints -> Rep ParameterConstraints x
Prelude.Generic)
newParameterConstraints ::
ParameterConstraints
newParameterConstraints :: ParameterConstraints
newParameterConstraints =
ParameterConstraints' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints
ParameterConstraints'
{ $sel:maxValue:ParameterConstraints' :: Maybe Text
maxValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxLength:ParameterConstraints' :: Maybe Text
maxLength = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:constraintDescription:ParameterConstraints' :: Maybe Text
constraintDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:minLength:ParameterConstraints' :: Maybe Text
minLength = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:allowedPattern:ParameterConstraints' :: Maybe Text
allowedPattern = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:allowedValues:ParameterConstraints' :: Maybe [Text]
allowedValues = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:minValue:ParameterConstraints' :: Maybe Text
minValue = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
parameterConstraints_maxValue :: Lens.Lens' ParameterConstraints (Prelude.Maybe Prelude.Text)
parameterConstraints_maxValue :: (Maybe Text -> f (Maybe Text))
-> ParameterConstraints -> f ParameterConstraints
parameterConstraints_maxValue = (ParameterConstraints -> Maybe Text)
-> (ParameterConstraints -> Maybe Text -> ParameterConstraints)
-> Lens
ParameterConstraints ParameterConstraints (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterConstraints' {Maybe Text
maxValue :: Maybe Text
$sel:maxValue:ParameterConstraints' :: ParameterConstraints -> Maybe Text
maxValue} -> Maybe Text
maxValue) (\s :: ParameterConstraints
s@ParameterConstraints' {} Maybe Text
a -> ParameterConstraints
s {$sel:maxValue:ParameterConstraints' :: Maybe Text
maxValue = Maybe Text
a} :: ParameterConstraints)
parameterConstraints_maxLength :: Lens.Lens' ParameterConstraints (Prelude.Maybe Prelude.Text)
parameterConstraints_maxLength :: (Maybe Text -> f (Maybe Text))
-> ParameterConstraints -> f ParameterConstraints
parameterConstraints_maxLength = (ParameterConstraints -> Maybe Text)
-> (ParameterConstraints -> Maybe Text -> ParameterConstraints)
-> Lens
ParameterConstraints ParameterConstraints (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterConstraints' {Maybe Text
maxLength :: Maybe Text
$sel:maxLength:ParameterConstraints' :: ParameterConstraints -> Maybe Text
maxLength} -> Maybe Text
maxLength) (\s :: ParameterConstraints
s@ParameterConstraints' {} Maybe Text
a -> ParameterConstraints
s {$sel:maxLength:ParameterConstraints' :: Maybe Text
maxLength = Maybe Text
a} :: ParameterConstraints)
parameterConstraints_constraintDescription :: Lens.Lens' ParameterConstraints (Prelude.Maybe Prelude.Text)
parameterConstraints_constraintDescription :: (Maybe Text -> f (Maybe Text))
-> ParameterConstraints -> f ParameterConstraints
parameterConstraints_constraintDescription = (ParameterConstraints -> Maybe Text)
-> (ParameterConstraints -> Maybe Text -> ParameterConstraints)
-> Lens
ParameterConstraints ParameterConstraints (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterConstraints' {Maybe Text
constraintDescription :: Maybe Text
$sel:constraintDescription:ParameterConstraints' :: ParameterConstraints -> Maybe Text
constraintDescription} -> Maybe Text
constraintDescription) (\s :: ParameterConstraints
s@ParameterConstraints' {} Maybe Text
a -> ParameterConstraints
s {$sel:constraintDescription:ParameterConstraints' :: Maybe Text
constraintDescription = Maybe Text
a} :: ParameterConstraints)
parameterConstraints_minLength :: Lens.Lens' ParameterConstraints (Prelude.Maybe Prelude.Text)
parameterConstraints_minLength :: (Maybe Text -> f (Maybe Text))
-> ParameterConstraints -> f ParameterConstraints
parameterConstraints_minLength = (ParameterConstraints -> Maybe Text)
-> (ParameterConstraints -> Maybe Text -> ParameterConstraints)
-> Lens
ParameterConstraints ParameterConstraints (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterConstraints' {Maybe Text
minLength :: Maybe Text
$sel:minLength:ParameterConstraints' :: ParameterConstraints -> Maybe Text
minLength} -> Maybe Text
minLength) (\s :: ParameterConstraints
s@ParameterConstraints' {} Maybe Text
a -> ParameterConstraints
s {$sel:minLength:ParameterConstraints' :: Maybe Text
minLength = Maybe Text
a} :: ParameterConstraints)
parameterConstraints_allowedPattern :: Lens.Lens' ParameterConstraints (Prelude.Maybe Prelude.Text)
parameterConstraints_allowedPattern :: (Maybe Text -> f (Maybe Text))
-> ParameterConstraints -> f ParameterConstraints
parameterConstraints_allowedPattern = (ParameterConstraints -> Maybe Text)
-> (ParameterConstraints -> Maybe Text -> ParameterConstraints)
-> Lens
ParameterConstraints ParameterConstraints (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterConstraints' {Maybe Text
allowedPattern :: Maybe Text
$sel:allowedPattern:ParameterConstraints' :: ParameterConstraints -> Maybe Text
allowedPattern} -> Maybe Text
allowedPattern) (\s :: ParameterConstraints
s@ParameterConstraints' {} Maybe Text
a -> ParameterConstraints
s {$sel:allowedPattern:ParameterConstraints' :: Maybe Text
allowedPattern = Maybe Text
a} :: ParameterConstraints)
parameterConstraints_allowedValues :: Lens.Lens' ParameterConstraints (Prelude.Maybe [Prelude.Text])
parameterConstraints_allowedValues :: (Maybe [Text] -> f (Maybe [Text]))
-> ParameterConstraints -> f ParameterConstraints
parameterConstraints_allowedValues = (ParameterConstraints -> Maybe [Text])
-> (ParameterConstraints -> Maybe [Text] -> ParameterConstraints)
-> Lens
ParameterConstraints
ParameterConstraints
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterConstraints' {Maybe [Text]
allowedValues :: Maybe [Text]
$sel:allowedValues:ParameterConstraints' :: ParameterConstraints -> Maybe [Text]
allowedValues} -> Maybe [Text]
allowedValues) (\s :: ParameterConstraints
s@ParameterConstraints' {} Maybe [Text]
a -> ParameterConstraints
s {$sel:allowedValues:ParameterConstraints' :: Maybe [Text]
allowedValues = Maybe [Text]
a} :: ParameterConstraints) ((Maybe [Text] -> f (Maybe [Text]))
-> ParameterConstraints -> f ParameterConstraints)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ParameterConstraints
-> f ParameterConstraints
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
parameterConstraints_minValue :: Lens.Lens' ParameterConstraints (Prelude.Maybe Prelude.Text)
parameterConstraints_minValue :: (Maybe Text -> f (Maybe Text))
-> ParameterConstraints -> f ParameterConstraints
parameterConstraints_minValue = (ParameterConstraints -> Maybe Text)
-> (ParameterConstraints -> Maybe Text -> ParameterConstraints)
-> Lens
ParameterConstraints ParameterConstraints (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterConstraints' {Maybe Text
minValue :: Maybe Text
$sel:minValue:ParameterConstraints' :: ParameterConstraints -> Maybe Text
minValue} -> Maybe Text
minValue) (\s :: ParameterConstraints
s@ParameterConstraints' {} Maybe Text
a -> ParameterConstraints
s {$sel:minValue:ParameterConstraints' :: Maybe Text
minValue = Maybe Text
a} :: ParameterConstraints)
instance Core.FromJSON ParameterConstraints where
parseJSON :: Value -> Parser ParameterConstraints
parseJSON =
String
-> (Object -> Parser ParameterConstraints)
-> Value
-> Parser ParameterConstraints
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ParameterConstraints"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints
ParameterConstraints'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints)
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
"MaxValue")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints)
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
"MaxLength")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints)
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 Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> ParameterConstraints)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe [Text] -> Maybe Text -> ParameterConstraints)
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
"MinLength")
Parser
(Maybe Text -> Maybe [Text] -> Maybe Text -> ParameterConstraints)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> ParameterConstraints)
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 [Text] -> Maybe Text -> ParameterConstraints)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> ParameterConstraints)
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 -> ParameterConstraints)
-> Parser (Maybe Text) -> Parser ParameterConstraints
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
"MinValue")
)
instance Prelude.Hashable ParameterConstraints
instance Prelude.NFData ParameterConstraints