module Stratosphere.Kendra.DataSource.DataSourceToIndexFieldMappingProperty (
        DataSourceToIndexFieldMappingProperty(..),
        mkDataSourceToIndexFieldMappingProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data DataSourceToIndexFieldMappingProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-datasourcetoindexfieldmapping.html>
    DataSourceToIndexFieldMappingProperty {DataSourceToIndexFieldMappingProperty -> ()
haddock_workaround_ :: (),
                                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-datasourcetoindexfieldmapping.html#cfn-kendra-datasource-datasourcetoindexfieldmapping-datasourcefieldname>
                                           DataSourceToIndexFieldMappingProperty -> Value Text
dataSourceFieldName :: (Value Prelude.Text),
                                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-datasourcetoindexfieldmapping.html#cfn-kendra-datasource-datasourcetoindexfieldmapping-datefieldformat>
                                           DataSourceToIndexFieldMappingProperty -> Maybe (Value Text)
dateFieldFormat :: (Prelude.Maybe (Value Prelude.Text)),
                                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-datasourcetoindexfieldmapping.html#cfn-kendra-datasource-datasourcetoindexfieldmapping-indexfieldname>
                                           DataSourceToIndexFieldMappingProperty -> Value Text
indexFieldName :: (Value Prelude.Text)}
  deriving stock (DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty -> Bool
(DataSourceToIndexFieldMappingProperty
 -> DataSourceToIndexFieldMappingProperty -> Bool)
-> (DataSourceToIndexFieldMappingProperty
    -> DataSourceToIndexFieldMappingProperty -> Bool)
-> Eq DataSourceToIndexFieldMappingProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty -> Bool
== :: DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty -> Bool
$c/= :: DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty -> Bool
/= :: DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty -> Bool
Prelude.Eq, Int -> DataSourceToIndexFieldMappingProperty -> ShowS
[DataSourceToIndexFieldMappingProperty] -> ShowS
DataSourceToIndexFieldMappingProperty -> String
(Int -> DataSourceToIndexFieldMappingProperty -> ShowS)
-> (DataSourceToIndexFieldMappingProperty -> String)
-> ([DataSourceToIndexFieldMappingProperty] -> ShowS)
-> Show DataSourceToIndexFieldMappingProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DataSourceToIndexFieldMappingProperty -> ShowS
showsPrec :: Int -> DataSourceToIndexFieldMappingProperty -> ShowS
$cshow :: DataSourceToIndexFieldMappingProperty -> String
show :: DataSourceToIndexFieldMappingProperty -> String
$cshowList :: [DataSourceToIndexFieldMappingProperty] -> ShowS
showList :: [DataSourceToIndexFieldMappingProperty] -> ShowS
Prelude.Show)
mkDataSourceToIndexFieldMappingProperty ::
  Value Prelude.Text
  -> Value Prelude.Text -> DataSourceToIndexFieldMappingProperty
mkDataSourceToIndexFieldMappingProperty :: Value Text -> Value Text -> DataSourceToIndexFieldMappingProperty
mkDataSourceToIndexFieldMappingProperty
  Value Text
dataSourceFieldName
  Value Text
indexFieldName
  = DataSourceToIndexFieldMappingProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       dataSourceFieldName :: Value Text
dataSourceFieldName = Value Text
dataSourceFieldName,
       indexFieldName :: Value Text
indexFieldName = Value Text
indexFieldName, dateFieldFormat :: Maybe (Value Text)
dateFieldFormat = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DataSourceToIndexFieldMappingProperty where
  toResourceProperties :: DataSourceToIndexFieldMappingProperty -> ResourceProperties
toResourceProperties DataSourceToIndexFieldMappingProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DataSourceToIndexFieldMappingProperty -> ()
dataSourceFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
dateFieldFormat :: DataSourceToIndexFieldMappingProperty -> Maybe (Value Text)
indexFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
dateFieldFormat :: Maybe (Value Text)
indexFieldName :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Kendra::DataSource.DataSourceToIndexFieldMapping",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"DataSourceFieldName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
dataSourceFieldName,
                            Key
"IndexFieldName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
indexFieldName]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DateFieldFormat" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
dateFieldFormat]))}
instance JSON.ToJSON DataSourceToIndexFieldMappingProperty where
  toJSON :: DataSourceToIndexFieldMappingProperty -> Value
toJSON DataSourceToIndexFieldMappingProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DataSourceToIndexFieldMappingProperty -> ()
dataSourceFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
dateFieldFormat :: DataSourceToIndexFieldMappingProperty -> Maybe (Value Text)
indexFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
dateFieldFormat :: Maybe (Value Text)
indexFieldName :: Value Text
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"DataSourceFieldName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
dataSourceFieldName,
               Key
"IndexFieldName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
indexFieldName]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DateFieldFormat" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
dateFieldFormat])))
instance Property "DataSourceFieldName" DataSourceToIndexFieldMappingProperty where
  type PropertyType "DataSourceFieldName" DataSourceToIndexFieldMappingProperty = Value Prelude.Text
  set :: PropertyType
  "DataSourceFieldName" DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty
set PropertyType
  "DataSourceFieldName" DataSourceToIndexFieldMappingProperty
newValue DataSourceToIndexFieldMappingProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DataSourceToIndexFieldMappingProperty -> ()
dataSourceFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
dateFieldFormat :: DataSourceToIndexFieldMappingProperty -> Maybe (Value Text)
indexFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
dateFieldFormat :: Maybe (Value Text)
indexFieldName :: Value Text
..}
    = DataSourceToIndexFieldMappingProperty
        {dataSourceFieldName :: Value Text
dataSourceFieldName = PropertyType
  "DataSourceFieldName" DataSourceToIndexFieldMappingProperty
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
dateFieldFormat :: Maybe (Value Text)
indexFieldName :: Value Text
haddock_workaround_ :: ()
dateFieldFormat :: Maybe (Value Text)
indexFieldName :: Value Text
..}
instance Property "DateFieldFormat" DataSourceToIndexFieldMappingProperty where
  type PropertyType "DateFieldFormat" DataSourceToIndexFieldMappingProperty = Value Prelude.Text
  set :: PropertyType
  "DateFieldFormat" DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty
set PropertyType
  "DateFieldFormat" DataSourceToIndexFieldMappingProperty
newValue DataSourceToIndexFieldMappingProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DataSourceToIndexFieldMappingProperty -> ()
dataSourceFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
dateFieldFormat :: DataSourceToIndexFieldMappingProperty -> Maybe (Value Text)
indexFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
dateFieldFormat :: Maybe (Value Text)
indexFieldName :: Value Text
..}
    = DataSourceToIndexFieldMappingProperty
        {dateFieldFormat :: Maybe (Value Text)
dateFieldFormat = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType
  "DateFieldFormat" DataSourceToIndexFieldMappingProperty
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
indexFieldName :: Value Text
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
indexFieldName :: Value Text
..}
instance Property "IndexFieldName" DataSourceToIndexFieldMappingProperty where
  type PropertyType "IndexFieldName" DataSourceToIndexFieldMappingProperty = Value Prelude.Text
  set :: PropertyType "IndexFieldName" DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty
-> DataSourceToIndexFieldMappingProperty
set PropertyType "IndexFieldName" DataSourceToIndexFieldMappingProperty
newValue DataSourceToIndexFieldMappingProperty {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: DataSourceToIndexFieldMappingProperty -> ()
dataSourceFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
dateFieldFormat :: DataSourceToIndexFieldMappingProperty -> Maybe (Value Text)
indexFieldName :: DataSourceToIndexFieldMappingProperty -> Value Text
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
dateFieldFormat :: Maybe (Value Text)
indexFieldName :: Value Text
..}
    = DataSourceToIndexFieldMappingProperty
        {indexFieldName :: Value Text
indexFieldName = PropertyType "IndexFieldName" DataSourceToIndexFieldMappingProperty
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
dateFieldFormat :: Maybe (Value Text)
haddock_workaround_ :: ()
dataSourceFieldName :: Value Text
dateFieldFormat :: Maybe (Value Text)
..}