{-# 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.ApiGatewayV2.Types.ParameterConstraints 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
data ParameterConstraints = ParameterConstraints'
{
ParameterConstraints -> Maybe Bool
required :: Prelude.Maybe Prelude.Bool
}
deriving (ParameterConstraints -> ParameterConstraints -> Bool
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]
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
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. 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' {$sel:required:ParameterConstraints' :: Maybe Bool
required = forall a. Maybe a
Prelude.Nothing}
parameterConstraints_required :: Lens.Lens' ParameterConstraints (Prelude.Maybe Prelude.Bool)
parameterConstraints_required :: Lens' ParameterConstraints (Maybe Bool)
parameterConstraints_required = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterConstraints' {Maybe Bool
required :: Maybe Bool
$sel:required:ParameterConstraints' :: ParameterConstraints -> Maybe Bool
required} -> Maybe Bool
required) (\s :: ParameterConstraints
s@ParameterConstraints' {} Maybe Bool
a -> ParameterConstraints
s {$sel:required:ParameterConstraints' :: Maybe Bool
required = Maybe Bool
a} :: ParameterConstraints)
instance Data.FromJSON ParameterConstraints where
parseJSON :: Value -> Parser ParameterConstraints
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ParameterConstraints"
( \Object
x ->
Maybe Bool -> ParameterConstraints
ParameterConstraints'
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
"required")
)
instance Prelude.Hashable ParameterConstraints where
hashWithSalt :: Int -> ParameterConstraints -> Int
hashWithSalt Int
_salt ParameterConstraints' {Maybe Bool
required :: Maybe Bool
$sel:required:ParameterConstraints' :: ParameterConstraints -> Maybe Bool
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
required
instance Prelude.NFData ParameterConstraints where
rnf :: ParameterConstraints -> ()
rnf ParameterConstraints' {Maybe Bool
required :: Maybe Bool
$sel:required:ParameterConstraints' :: ParameterConstraints -> Maybe Bool
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
required
instance Data.ToJSON ParameterConstraints where
toJSON :: ParameterConstraints -> Value
toJSON ParameterConstraints' {Maybe Bool
required :: Maybe Bool
$sel:required:ParameterConstraints' :: ParameterConstraints -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"required" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
required]
)