{-# 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.AmplifyUiBuilder.Types.FieldInputConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AmplifyUiBuilder.Types.FieldInputConfig where

import Amazonka.AmplifyUiBuilder.Types.ValueMappings
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

-- | Describes the configuration for the default input values to display for
-- a field.
--
-- /See:/ 'newFieldInputConfig' smart constructor.
data FieldInputConfig = FieldInputConfig'
  { -- | Specifies whether a field has a default value.
    FieldInputConfig -> Maybe Bool
defaultChecked :: Prelude.Maybe Prelude.Bool,
    -- | The default country code for a phone number.
    FieldInputConfig -> Maybe Text
defaultCountryCode :: Prelude.Maybe Prelude.Text,
    -- | The default value for the field.
    FieldInputConfig -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | The text to display to describe the field.
    FieldInputConfig -> Maybe Text
descriptiveText :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to render the field as an array. This property is
    -- ignored if the @dataSourceType@ for the form is a Data Store.
    FieldInputConfig -> Maybe Bool
isArray :: Prelude.Maybe Prelude.Bool,
    -- | The maximum value to display for the field.
    FieldInputConfig -> Maybe Double
maxValue :: Prelude.Maybe Prelude.Double,
    -- | The minimum value to display for the field.
    FieldInputConfig -> Maybe Double
minValue :: Prelude.Maybe Prelude.Double,
    -- | The name of the field.
    FieldInputConfig -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The text to display as a placeholder for the field.
    FieldInputConfig -> Maybe Text
placeholder :: Prelude.Maybe Prelude.Text,
    -- | Specifies a read only field.
    FieldInputConfig -> Maybe Bool
readOnly :: Prelude.Maybe Prelude.Bool,
    -- | Specifies a field that requires input.
    FieldInputConfig -> Maybe Bool
required :: Prelude.Maybe Prelude.Bool,
    -- | The stepping increment for a numeric value in a field.
    FieldInputConfig -> Maybe Double
step :: Prelude.Maybe Prelude.Double,
    -- | The value for the field.
    FieldInputConfig -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
    -- | The information to use to customize the input fields with data at
    -- runtime.
    FieldInputConfig -> Maybe ValueMappings
valueMappings :: Prelude.Maybe ValueMappings,
    -- | The input type for the field.
    FieldInputConfig -> Text
type' :: Prelude.Text
  }
  deriving (FieldInputConfig -> FieldInputConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FieldInputConfig -> FieldInputConfig -> Bool
$c/= :: FieldInputConfig -> FieldInputConfig -> Bool
== :: FieldInputConfig -> FieldInputConfig -> Bool
$c== :: FieldInputConfig -> FieldInputConfig -> Bool
Prelude.Eq, ReadPrec [FieldInputConfig]
ReadPrec FieldInputConfig
Int -> ReadS FieldInputConfig
ReadS [FieldInputConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FieldInputConfig]
$creadListPrec :: ReadPrec [FieldInputConfig]
readPrec :: ReadPrec FieldInputConfig
$creadPrec :: ReadPrec FieldInputConfig
readList :: ReadS [FieldInputConfig]
$creadList :: ReadS [FieldInputConfig]
readsPrec :: Int -> ReadS FieldInputConfig
$creadsPrec :: Int -> ReadS FieldInputConfig
Prelude.Read, Int -> FieldInputConfig -> ShowS
[FieldInputConfig] -> ShowS
FieldInputConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FieldInputConfig] -> ShowS
$cshowList :: [FieldInputConfig] -> ShowS
show :: FieldInputConfig -> String
$cshow :: FieldInputConfig -> String
showsPrec :: Int -> FieldInputConfig -> ShowS
$cshowsPrec :: Int -> FieldInputConfig -> ShowS
Prelude.Show, forall x. Rep FieldInputConfig x -> FieldInputConfig
forall x. FieldInputConfig -> Rep FieldInputConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FieldInputConfig x -> FieldInputConfig
$cfrom :: forall x. FieldInputConfig -> Rep FieldInputConfig x
Prelude.Generic)

-- |
-- Create a value of 'FieldInputConfig' 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:
--
-- 'defaultChecked', 'fieldInputConfig_defaultChecked' - Specifies whether a field has a default value.
--
-- 'defaultCountryCode', 'fieldInputConfig_defaultCountryCode' - The default country code for a phone number.
--
-- 'defaultValue', 'fieldInputConfig_defaultValue' - The default value for the field.
--
-- 'descriptiveText', 'fieldInputConfig_descriptiveText' - The text to display to describe the field.
--
-- 'isArray', 'fieldInputConfig_isArray' - Specifies whether to render the field as an array. This property is
-- ignored if the @dataSourceType@ for the form is a Data Store.
--
-- 'maxValue', 'fieldInputConfig_maxValue' - The maximum value to display for the field.
--
-- 'minValue', 'fieldInputConfig_minValue' - The minimum value to display for the field.
--
-- 'name', 'fieldInputConfig_name' - The name of the field.
--
-- 'placeholder', 'fieldInputConfig_placeholder' - The text to display as a placeholder for the field.
--
-- 'readOnly', 'fieldInputConfig_readOnly' - Specifies a read only field.
--
-- 'required', 'fieldInputConfig_required' - Specifies a field that requires input.
--
-- 'step', 'fieldInputConfig_step' - The stepping increment for a numeric value in a field.
--
-- 'value', 'fieldInputConfig_value' - The value for the field.
--
-- 'valueMappings', 'fieldInputConfig_valueMappings' - The information to use to customize the input fields with data at
-- runtime.
--
-- 'type'', 'fieldInputConfig_type' - The input type for the field.
newFieldInputConfig ::
  -- | 'type''
  Prelude.Text ->
  FieldInputConfig
newFieldInputConfig :: Text -> FieldInputConfig
newFieldInputConfig Text
pType_ =
  FieldInputConfig'
    { $sel:defaultChecked:FieldInputConfig' :: Maybe Bool
defaultChecked = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultCountryCode:FieldInputConfig' :: Maybe Text
defaultCountryCode = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:FieldInputConfig' :: Maybe Text
defaultValue = forall a. Maybe a
Prelude.Nothing,
      $sel:descriptiveText:FieldInputConfig' :: Maybe Text
descriptiveText = forall a. Maybe a
Prelude.Nothing,
      $sel:isArray:FieldInputConfig' :: Maybe Bool
isArray = forall a. Maybe a
Prelude.Nothing,
      $sel:maxValue:FieldInputConfig' :: Maybe Double
maxValue = forall a. Maybe a
Prelude.Nothing,
      $sel:minValue:FieldInputConfig' :: Maybe Double
minValue = forall a. Maybe a
Prelude.Nothing,
      $sel:name:FieldInputConfig' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:placeholder:FieldInputConfig' :: Maybe Text
placeholder = forall a. Maybe a
Prelude.Nothing,
      $sel:readOnly:FieldInputConfig' :: Maybe Bool
readOnly = forall a. Maybe a
Prelude.Nothing,
      $sel:required:FieldInputConfig' :: Maybe Bool
required = forall a. Maybe a
Prelude.Nothing,
      $sel:step:FieldInputConfig' :: Maybe Double
step = forall a. Maybe a
Prelude.Nothing,
      $sel:value:FieldInputConfig' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing,
      $sel:valueMappings:FieldInputConfig' :: Maybe ValueMappings
valueMappings = forall a. Maybe a
Prelude.Nothing,
      $sel:type':FieldInputConfig' :: Text
type' = Text
pType_
    }

-- | Specifies whether a field has a default value.
fieldInputConfig_defaultChecked :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Bool)
fieldInputConfig_defaultChecked :: Lens' FieldInputConfig (Maybe Bool)
fieldInputConfig_defaultChecked = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Bool
defaultChecked :: Maybe Bool
$sel:defaultChecked:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
defaultChecked} -> Maybe Bool
defaultChecked) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Bool
a -> FieldInputConfig
s {$sel:defaultChecked:FieldInputConfig' :: Maybe Bool
defaultChecked = Maybe Bool
a} :: FieldInputConfig)

-- | The default country code for a phone number.
fieldInputConfig_defaultCountryCode :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Text)
fieldInputConfig_defaultCountryCode :: Lens' FieldInputConfig (Maybe Text)
fieldInputConfig_defaultCountryCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Text
defaultCountryCode :: Maybe Text
$sel:defaultCountryCode:FieldInputConfig' :: FieldInputConfig -> Maybe Text
defaultCountryCode} -> Maybe Text
defaultCountryCode) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Text
a -> FieldInputConfig
s {$sel:defaultCountryCode:FieldInputConfig' :: Maybe Text
defaultCountryCode = Maybe Text
a} :: FieldInputConfig)

-- | The default value for the field.
fieldInputConfig_defaultValue :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Text)
fieldInputConfig_defaultValue :: Lens' FieldInputConfig (Maybe Text)
fieldInputConfig_defaultValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:FieldInputConfig' :: FieldInputConfig -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Text
a -> FieldInputConfig
s {$sel:defaultValue:FieldInputConfig' :: Maybe Text
defaultValue = Maybe Text
a} :: FieldInputConfig)

-- | The text to display to describe the field.
fieldInputConfig_descriptiveText :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Text)
fieldInputConfig_descriptiveText :: Lens' FieldInputConfig (Maybe Text)
fieldInputConfig_descriptiveText = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Text
descriptiveText :: Maybe Text
$sel:descriptiveText:FieldInputConfig' :: FieldInputConfig -> Maybe Text
descriptiveText} -> Maybe Text
descriptiveText) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Text
a -> FieldInputConfig
s {$sel:descriptiveText:FieldInputConfig' :: Maybe Text
descriptiveText = Maybe Text
a} :: FieldInputConfig)

-- | Specifies whether to render the field as an array. This property is
-- ignored if the @dataSourceType@ for the form is a Data Store.
fieldInputConfig_isArray :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Bool)
fieldInputConfig_isArray :: Lens' FieldInputConfig (Maybe Bool)
fieldInputConfig_isArray = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Bool
isArray :: Maybe Bool
$sel:isArray:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
isArray} -> Maybe Bool
isArray) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Bool
a -> FieldInputConfig
s {$sel:isArray:FieldInputConfig' :: Maybe Bool
isArray = Maybe Bool
a} :: FieldInputConfig)

-- | The maximum value to display for the field.
fieldInputConfig_maxValue :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Double)
fieldInputConfig_maxValue :: Lens' FieldInputConfig (Maybe Double)
fieldInputConfig_maxValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Double
maxValue :: Maybe Double
$sel:maxValue:FieldInputConfig' :: FieldInputConfig -> Maybe Double
maxValue} -> Maybe Double
maxValue) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Double
a -> FieldInputConfig
s {$sel:maxValue:FieldInputConfig' :: Maybe Double
maxValue = Maybe Double
a} :: FieldInputConfig)

-- | The minimum value to display for the field.
fieldInputConfig_minValue :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Double)
fieldInputConfig_minValue :: Lens' FieldInputConfig (Maybe Double)
fieldInputConfig_minValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Double
minValue :: Maybe Double
$sel:minValue:FieldInputConfig' :: FieldInputConfig -> Maybe Double
minValue} -> Maybe Double
minValue) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Double
a -> FieldInputConfig
s {$sel:minValue:FieldInputConfig' :: Maybe Double
minValue = Maybe Double
a} :: FieldInputConfig)

-- | The name of the field.
fieldInputConfig_name :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Text)
fieldInputConfig_name :: Lens' FieldInputConfig (Maybe Text)
fieldInputConfig_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Text
name :: Maybe Text
$sel:name:FieldInputConfig' :: FieldInputConfig -> Maybe Text
name} -> Maybe Text
name) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Text
a -> FieldInputConfig
s {$sel:name:FieldInputConfig' :: Maybe Text
name = Maybe Text
a} :: FieldInputConfig)

-- | The text to display as a placeholder for the field.
fieldInputConfig_placeholder :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Text)
fieldInputConfig_placeholder :: Lens' FieldInputConfig (Maybe Text)
fieldInputConfig_placeholder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Text
placeholder :: Maybe Text
$sel:placeholder:FieldInputConfig' :: FieldInputConfig -> Maybe Text
placeholder} -> Maybe Text
placeholder) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Text
a -> FieldInputConfig
s {$sel:placeholder:FieldInputConfig' :: Maybe Text
placeholder = Maybe Text
a} :: FieldInputConfig)

-- | Specifies a read only field.
fieldInputConfig_readOnly :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Bool)
fieldInputConfig_readOnly :: Lens' FieldInputConfig (Maybe Bool)
fieldInputConfig_readOnly = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Bool
readOnly :: Maybe Bool
$sel:readOnly:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
readOnly} -> Maybe Bool
readOnly) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Bool
a -> FieldInputConfig
s {$sel:readOnly:FieldInputConfig' :: Maybe Bool
readOnly = Maybe Bool
a} :: FieldInputConfig)

-- | Specifies a field that requires input.
fieldInputConfig_required :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Bool)
fieldInputConfig_required :: Lens' FieldInputConfig (Maybe Bool)
fieldInputConfig_required = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Bool
required :: Maybe Bool
$sel:required:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
required} -> Maybe Bool
required) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Bool
a -> FieldInputConfig
s {$sel:required:FieldInputConfig' :: Maybe Bool
required = Maybe Bool
a} :: FieldInputConfig)

-- | The stepping increment for a numeric value in a field.
fieldInputConfig_step :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Double)
fieldInputConfig_step :: Lens' FieldInputConfig (Maybe Double)
fieldInputConfig_step = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Double
step :: Maybe Double
$sel:step:FieldInputConfig' :: FieldInputConfig -> Maybe Double
step} -> Maybe Double
step) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Double
a -> FieldInputConfig
s {$sel:step:FieldInputConfig' :: Maybe Double
step = Maybe Double
a} :: FieldInputConfig)

-- | The value for the field.
fieldInputConfig_value :: Lens.Lens' FieldInputConfig (Prelude.Maybe Prelude.Text)
fieldInputConfig_value :: Lens' FieldInputConfig (Maybe Text)
fieldInputConfig_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe Text
value :: Maybe Text
$sel:value:FieldInputConfig' :: FieldInputConfig -> Maybe Text
value} -> Maybe Text
value) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe Text
a -> FieldInputConfig
s {$sel:value:FieldInputConfig' :: Maybe Text
value = Maybe Text
a} :: FieldInputConfig)

-- | The information to use to customize the input fields with data at
-- runtime.
fieldInputConfig_valueMappings :: Lens.Lens' FieldInputConfig (Prelude.Maybe ValueMappings)
fieldInputConfig_valueMappings :: Lens' FieldInputConfig (Maybe ValueMappings)
fieldInputConfig_valueMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Maybe ValueMappings
valueMappings :: Maybe ValueMappings
$sel:valueMappings:FieldInputConfig' :: FieldInputConfig -> Maybe ValueMappings
valueMappings} -> Maybe ValueMappings
valueMappings) (\s :: FieldInputConfig
s@FieldInputConfig' {} Maybe ValueMappings
a -> FieldInputConfig
s {$sel:valueMappings:FieldInputConfig' :: Maybe ValueMappings
valueMappings = Maybe ValueMappings
a} :: FieldInputConfig)

-- | The input type for the field.
fieldInputConfig_type :: Lens.Lens' FieldInputConfig Prelude.Text
fieldInputConfig_type :: Lens' FieldInputConfig Text
fieldInputConfig_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldInputConfig' {Text
type' :: Text
$sel:type':FieldInputConfig' :: FieldInputConfig -> Text
type'} -> Text
type') (\s :: FieldInputConfig
s@FieldInputConfig' {} Text
a -> FieldInputConfig
s {$sel:type':FieldInputConfig' :: Text
type' = Text
a} :: FieldInputConfig)

instance Data.FromJSON FieldInputConfig where
  parseJSON :: Value -> Parser FieldInputConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FieldInputConfig"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Double
-> Maybe Double
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Double
-> Maybe Text
-> Maybe ValueMappings
-> Text
-> FieldInputConfig
FieldInputConfig'
            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
"defaultChecked")
            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
"defaultCountryCode")
            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
"defaultValue")
            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
"descriptiveText")
            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
"isArray")
            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
"maxValue")
            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
"minValue")
            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
"name")
            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
"placeholder")
            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
"readOnly")
            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
"required")
            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
"step")
            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
"value")
            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
"valueMappings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"type")
      )

instance Prelude.Hashable FieldInputConfig where
  hashWithSalt :: Int -> FieldInputConfig -> Int
hashWithSalt Int
_salt FieldInputConfig' {Maybe Bool
Maybe Double
Maybe Text
Maybe ValueMappings
Text
type' :: Text
valueMappings :: Maybe ValueMappings
value :: Maybe Text
step :: Maybe Double
required :: Maybe Bool
readOnly :: Maybe Bool
placeholder :: Maybe Text
name :: Maybe Text
minValue :: Maybe Double
maxValue :: Maybe Double
isArray :: Maybe Bool
descriptiveText :: Maybe Text
defaultValue :: Maybe Text
defaultCountryCode :: Maybe Text
defaultChecked :: Maybe Bool
$sel:type':FieldInputConfig' :: FieldInputConfig -> Text
$sel:valueMappings:FieldInputConfig' :: FieldInputConfig -> Maybe ValueMappings
$sel:value:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:step:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:required:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:readOnly:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:placeholder:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:name:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:minValue:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:maxValue:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:isArray:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:descriptiveText:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultValue:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultCountryCode:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultChecked:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
defaultChecked
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultCountryCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
descriptiveText
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isArray
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
maxValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
minValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
placeholder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
readOnly
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
required
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
step
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ValueMappings
valueMappings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
type'

instance Prelude.NFData FieldInputConfig where
  rnf :: FieldInputConfig -> ()
rnf FieldInputConfig' {Maybe Bool
Maybe Double
Maybe Text
Maybe ValueMappings
Text
type' :: Text
valueMappings :: Maybe ValueMappings
value :: Maybe Text
step :: Maybe Double
required :: Maybe Bool
readOnly :: Maybe Bool
placeholder :: Maybe Text
name :: Maybe Text
minValue :: Maybe Double
maxValue :: Maybe Double
isArray :: Maybe Bool
descriptiveText :: Maybe Text
defaultValue :: Maybe Text
defaultCountryCode :: Maybe Text
defaultChecked :: Maybe Bool
$sel:type':FieldInputConfig' :: FieldInputConfig -> Text
$sel:valueMappings:FieldInputConfig' :: FieldInputConfig -> Maybe ValueMappings
$sel:value:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:step:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:required:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:readOnly:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:placeholder:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:name:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:minValue:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:maxValue:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:isArray:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:descriptiveText:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultValue:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultCountryCode:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultChecked:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
defaultChecked
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultCountryCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
descriptiveText
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isArray
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
maxValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
minValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
placeholder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
readOnly
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
required
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
step
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ValueMappings
valueMappings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
type'

instance Data.ToJSON FieldInputConfig where
  toJSON :: FieldInputConfig -> Value
toJSON FieldInputConfig' {Maybe Bool
Maybe Double
Maybe Text
Maybe ValueMappings
Text
type' :: Text
valueMappings :: Maybe ValueMappings
value :: Maybe Text
step :: Maybe Double
required :: Maybe Bool
readOnly :: Maybe Bool
placeholder :: Maybe Text
name :: Maybe Text
minValue :: Maybe Double
maxValue :: Maybe Double
isArray :: Maybe Bool
descriptiveText :: Maybe Text
defaultValue :: Maybe Text
defaultCountryCode :: Maybe Text
defaultChecked :: Maybe Bool
$sel:type':FieldInputConfig' :: FieldInputConfig -> Text
$sel:valueMappings:FieldInputConfig' :: FieldInputConfig -> Maybe ValueMappings
$sel:value:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:step:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:required:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:readOnly:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:placeholder:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:name:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:minValue:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:maxValue:FieldInputConfig' :: FieldInputConfig -> Maybe Double
$sel:isArray:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
$sel:descriptiveText:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultValue:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultCountryCode:FieldInputConfig' :: FieldInputConfig -> Maybe Text
$sel:defaultChecked:FieldInputConfig' :: FieldInputConfig -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"defaultChecked" 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
defaultChecked,
            (Key
"defaultCountryCode" 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 Text
defaultCountryCode,
            (Key
"defaultValue" 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 Text
defaultValue,
            (Key
"descriptiveText" 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 Text
descriptiveText,
            (Key
"isArray" 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
isArray,
            (Key
"maxValue" 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 Double
maxValue,
            (Key
"minValue" 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 Double
minValue,
            (Key
"name" 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 Text
name,
            (Key
"placeholder" 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 Text
placeholder,
            (Key
"readOnly" 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
readOnly,
            (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,
            (Key
"step" 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 Double
step,
            (Key
"value" 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 Text
value,
            (Key
"valueMappings" 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 ValueMappings
valueMappings,
            forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
type')
          ]
      )