{-# 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.AmplifyUiBuilder.Types.FormStyle where
import Amazonka.AmplifyUiBuilder.Types.FormStyleConfig
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 FormStyle = FormStyle'
{
FormStyle -> Maybe FormStyleConfig
horizontalGap :: Prelude.Maybe FormStyleConfig,
FormStyle -> Maybe FormStyleConfig
outerPadding :: Prelude.Maybe FormStyleConfig,
FormStyle -> Maybe FormStyleConfig
verticalGap :: Prelude.Maybe FormStyleConfig
}
deriving (FormStyle -> FormStyle -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FormStyle -> FormStyle -> Bool
$c/= :: FormStyle -> FormStyle -> Bool
== :: FormStyle -> FormStyle -> Bool
$c== :: FormStyle -> FormStyle -> Bool
Prelude.Eq, ReadPrec [FormStyle]
ReadPrec FormStyle
Int -> ReadS FormStyle
ReadS [FormStyle]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FormStyle]
$creadListPrec :: ReadPrec [FormStyle]
readPrec :: ReadPrec FormStyle
$creadPrec :: ReadPrec FormStyle
readList :: ReadS [FormStyle]
$creadList :: ReadS [FormStyle]
readsPrec :: Int -> ReadS FormStyle
$creadsPrec :: Int -> ReadS FormStyle
Prelude.Read, Int -> FormStyle -> ShowS
[FormStyle] -> ShowS
FormStyle -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FormStyle] -> ShowS
$cshowList :: [FormStyle] -> ShowS
show :: FormStyle -> String
$cshow :: FormStyle -> String
showsPrec :: Int -> FormStyle -> ShowS
$cshowsPrec :: Int -> FormStyle -> ShowS
Prelude.Show, forall x. Rep FormStyle x -> FormStyle
forall x. FormStyle -> Rep FormStyle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FormStyle x -> FormStyle
$cfrom :: forall x. FormStyle -> Rep FormStyle x
Prelude.Generic)
newFormStyle ::
FormStyle
newFormStyle :: FormStyle
newFormStyle =
FormStyle'
{ $sel:horizontalGap:FormStyle' :: Maybe FormStyleConfig
horizontalGap = forall a. Maybe a
Prelude.Nothing,
$sel:outerPadding:FormStyle' :: Maybe FormStyleConfig
outerPadding = forall a. Maybe a
Prelude.Nothing,
$sel:verticalGap:FormStyle' :: Maybe FormStyleConfig
verticalGap = forall a. Maybe a
Prelude.Nothing
}
formStyle_horizontalGap :: Lens.Lens' FormStyle (Prelude.Maybe FormStyleConfig)
formStyle_horizontalGap :: Lens' FormStyle (Maybe FormStyleConfig)
formStyle_horizontalGap = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FormStyle' {Maybe FormStyleConfig
horizontalGap :: Maybe FormStyleConfig
$sel:horizontalGap:FormStyle' :: FormStyle -> Maybe FormStyleConfig
horizontalGap} -> Maybe FormStyleConfig
horizontalGap) (\s :: FormStyle
s@FormStyle' {} Maybe FormStyleConfig
a -> FormStyle
s {$sel:horizontalGap:FormStyle' :: Maybe FormStyleConfig
horizontalGap = Maybe FormStyleConfig
a} :: FormStyle)
formStyle_outerPadding :: Lens.Lens' FormStyle (Prelude.Maybe FormStyleConfig)
formStyle_outerPadding :: Lens' FormStyle (Maybe FormStyleConfig)
formStyle_outerPadding = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FormStyle' {Maybe FormStyleConfig
outerPadding :: Maybe FormStyleConfig
$sel:outerPadding:FormStyle' :: FormStyle -> Maybe FormStyleConfig
outerPadding} -> Maybe FormStyleConfig
outerPadding) (\s :: FormStyle
s@FormStyle' {} Maybe FormStyleConfig
a -> FormStyle
s {$sel:outerPadding:FormStyle' :: Maybe FormStyleConfig
outerPadding = Maybe FormStyleConfig
a} :: FormStyle)
formStyle_verticalGap :: Lens.Lens' FormStyle (Prelude.Maybe FormStyleConfig)
formStyle_verticalGap :: Lens' FormStyle (Maybe FormStyleConfig)
formStyle_verticalGap = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FormStyle' {Maybe FormStyleConfig
verticalGap :: Maybe FormStyleConfig
$sel:verticalGap:FormStyle' :: FormStyle -> Maybe FormStyleConfig
verticalGap} -> Maybe FormStyleConfig
verticalGap) (\s :: FormStyle
s@FormStyle' {} Maybe FormStyleConfig
a -> FormStyle
s {$sel:verticalGap:FormStyle' :: Maybe FormStyleConfig
verticalGap = Maybe FormStyleConfig
a} :: FormStyle)
instance Data.FromJSON FormStyle where
parseJSON :: Value -> Parser FormStyle
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FormStyle"
( \Object
x ->
Maybe FormStyleConfig
-> Maybe FormStyleConfig -> Maybe FormStyleConfig -> FormStyle
FormStyle'
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
"horizontalGap")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"outerPadding")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"verticalGap")
)
instance Prelude.Hashable FormStyle where
hashWithSalt :: Int -> FormStyle -> Int
hashWithSalt Int
_salt FormStyle' {Maybe FormStyleConfig
verticalGap :: Maybe FormStyleConfig
outerPadding :: Maybe FormStyleConfig
horizontalGap :: Maybe FormStyleConfig
$sel:verticalGap:FormStyle' :: FormStyle -> Maybe FormStyleConfig
$sel:outerPadding:FormStyle' :: FormStyle -> Maybe FormStyleConfig
$sel:horizontalGap:FormStyle' :: FormStyle -> Maybe FormStyleConfig
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FormStyleConfig
horizontalGap
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FormStyleConfig
outerPadding
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FormStyleConfig
verticalGap
instance Prelude.NFData FormStyle where
rnf :: FormStyle -> ()
rnf FormStyle' {Maybe FormStyleConfig
verticalGap :: Maybe FormStyleConfig
outerPadding :: Maybe FormStyleConfig
horizontalGap :: Maybe FormStyleConfig
$sel:verticalGap:FormStyle' :: FormStyle -> Maybe FormStyleConfig
$sel:outerPadding:FormStyle' :: FormStyle -> Maybe FormStyleConfig
$sel:horizontalGap:FormStyle' :: FormStyle -> Maybe FormStyleConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe FormStyleConfig
horizontalGap
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FormStyleConfig
outerPadding
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FormStyleConfig
verticalGap
instance Data.ToJSON FormStyle where
toJSON :: FormStyle -> Value
toJSON FormStyle' {Maybe FormStyleConfig
verticalGap :: Maybe FormStyleConfig
outerPadding :: Maybe FormStyleConfig
horizontalGap :: Maybe FormStyleConfig
$sel:verticalGap:FormStyle' :: FormStyle -> Maybe FormStyleConfig
$sel:outerPadding:FormStyle' :: FormStyle -> Maybe FormStyleConfig
$sel:horizontalGap:FormStyle' :: FormStyle -> Maybe FormStyleConfig
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"horizontalGap" 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 FormStyleConfig
horizontalGap,
(Key
"outerPadding" 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 FormStyleConfig
outerPadding,
(Key
"verticalGap" 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 FormStyleConfig
verticalGap
]
)