{-# 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.CloudFormation.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]
allowedValues :: 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] -> ParameterConstraints
ParameterConstraints'
{ $sel:allowedValues:ParameterConstraints' :: Maybe [Text]
allowedValues =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
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
instance Core.FromXML ParameterConstraints where
parseXML :: [Node] -> Either String ParameterConstraints
parseXML [Node]
x =
Maybe [Text] -> ParameterConstraints
ParameterConstraints'
(Maybe [Text] -> ParameterConstraints)
-> Either String (Maybe [Text])
-> Either String ParameterConstraints
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AllowedValues" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
instance Prelude.Hashable ParameterConstraints
instance Prelude.NFData ParameterConstraints