{-# 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.Kendra.Types.ColumnConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types.DataSourceToIndexFieldMapping
import qualified Amazonka.Prelude as Prelude
data ColumnConfiguration = ColumnConfiguration'
{
ColumnConfiguration -> Maybe Text
documentTitleColumnName :: Prelude.Maybe Prelude.Text,
ColumnConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
ColumnConfiguration -> Text
documentIdColumnName :: Prelude.Text,
ColumnConfiguration -> Text
documentDataColumnName :: Prelude.Text,
ColumnConfiguration -> NonEmpty Text
changeDetectingColumns :: Prelude.NonEmpty Prelude.Text
}
deriving (ColumnConfiguration -> ColumnConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColumnConfiguration -> ColumnConfiguration -> Bool
$c/= :: ColumnConfiguration -> ColumnConfiguration -> Bool
== :: ColumnConfiguration -> ColumnConfiguration -> Bool
$c== :: ColumnConfiguration -> ColumnConfiguration -> Bool
Prelude.Eq, ReadPrec [ColumnConfiguration]
ReadPrec ColumnConfiguration
Int -> ReadS ColumnConfiguration
ReadS [ColumnConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColumnConfiguration]
$creadListPrec :: ReadPrec [ColumnConfiguration]
readPrec :: ReadPrec ColumnConfiguration
$creadPrec :: ReadPrec ColumnConfiguration
readList :: ReadS [ColumnConfiguration]
$creadList :: ReadS [ColumnConfiguration]
readsPrec :: Int -> ReadS ColumnConfiguration
$creadsPrec :: Int -> ReadS ColumnConfiguration
Prelude.Read, Int -> ColumnConfiguration -> ShowS
[ColumnConfiguration] -> ShowS
ColumnConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColumnConfiguration] -> ShowS
$cshowList :: [ColumnConfiguration] -> ShowS
show :: ColumnConfiguration -> String
$cshow :: ColumnConfiguration -> String
showsPrec :: Int -> ColumnConfiguration -> ShowS
$cshowsPrec :: Int -> ColumnConfiguration -> ShowS
Prelude.Show, forall x. Rep ColumnConfiguration x -> ColumnConfiguration
forall x. ColumnConfiguration -> Rep ColumnConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ColumnConfiguration x -> ColumnConfiguration
$cfrom :: forall x. ColumnConfiguration -> Rep ColumnConfiguration x
Prelude.Generic)
newColumnConfiguration ::
Prelude.Text ->
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
ColumnConfiguration
newColumnConfiguration :: Text -> Text -> NonEmpty Text -> ColumnConfiguration
newColumnConfiguration
Text
pDocumentIdColumnName_
Text
pDocumentDataColumnName_
NonEmpty Text
pChangeDetectingColumns_ =
ColumnConfiguration'
{ $sel:documentTitleColumnName:ColumnConfiguration' :: Maybe Text
documentTitleColumnName =
forall a. Maybe a
Prelude.Nothing,
$sel:fieldMappings:ColumnConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = forall a. Maybe a
Prelude.Nothing,
$sel:documentIdColumnName:ColumnConfiguration' :: Text
documentIdColumnName = Text
pDocumentIdColumnName_,
$sel:documentDataColumnName:ColumnConfiguration' :: Text
documentDataColumnName = Text
pDocumentDataColumnName_,
$sel:changeDetectingColumns:ColumnConfiguration' :: NonEmpty Text
changeDetectingColumns =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pChangeDetectingColumns_
}
columnConfiguration_documentTitleColumnName :: Lens.Lens' ColumnConfiguration (Prelude.Maybe Prelude.Text)
columnConfiguration_documentTitleColumnName :: Lens' ColumnConfiguration (Maybe Text)
columnConfiguration_documentTitleColumnName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnConfiguration' {Maybe Text
documentTitleColumnName :: Maybe Text
$sel:documentTitleColumnName:ColumnConfiguration' :: ColumnConfiguration -> Maybe Text
documentTitleColumnName} -> Maybe Text
documentTitleColumnName) (\s :: ColumnConfiguration
s@ColumnConfiguration' {} Maybe Text
a -> ColumnConfiguration
s {$sel:documentTitleColumnName:ColumnConfiguration' :: Maybe Text
documentTitleColumnName = Maybe Text
a} :: ColumnConfiguration)
columnConfiguration_fieldMappings :: Lens.Lens' ColumnConfiguration (Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping))
columnConfiguration_fieldMappings :: Lens'
ColumnConfiguration
(Maybe (NonEmpty DataSourceToIndexFieldMapping))
columnConfiguration_fieldMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:fieldMappings:ColumnConfiguration' :: ColumnConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings} -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings) (\s :: ColumnConfiguration
s@ColumnConfiguration' {} Maybe (NonEmpty DataSourceToIndexFieldMapping)
a -> ColumnConfiguration
s {$sel:fieldMappings:ColumnConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = Maybe (NonEmpty DataSourceToIndexFieldMapping)
a} :: ColumnConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
columnConfiguration_documentIdColumnName :: Lens.Lens' ColumnConfiguration Prelude.Text
columnConfiguration_documentIdColumnName :: Lens' ColumnConfiguration Text
columnConfiguration_documentIdColumnName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnConfiguration' {Text
documentIdColumnName :: Text
$sel:documentIdColumnName:ColumnConfiguration' :: ColumnConfiguration -> Text
documentIdColumnName} -> Text
documentIdColumnName) (\s :: ColumnConfiguration
s@ColumnConfiguration' {} Text
a -> ColumnConfiguration
s {$sel:documentIdColumnName:ColumnConfiguration' :: Text
documentIdColumnName = Text
a} :: ColumnConfiguration)
columnConfiguration_documentDataColumnName :: Lens.Lens' ColumnConfiguration Prelude.Text
columnConfiguration_documentDataColumnName :: Lens' ColumnConfiguration Text
columnConfiguration_documentDataColumnName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnConfiguration' {Text
documentDataColumnName :: Text
$sel:documentDataColumnName:ColumnConfiguration' :: ColumnConfiguration -> Text
documentDataColumnName} -> Text
documentDataColumnName) (\s :: ColumnConfiguration
s@ColumnConfiguration' {} Text
a -> ColumnConfiguration
s {$sel:documentDataColumnName:ColumnConfiguration' :: Text
documentDataColumnName = Text
a} :: ColumnConfiguration)
columnConfiguration_changeDetectingColumns :: Lens.Lens' ColumnConfiguration (Prelude.NonEmpty Prelude.Text)
columnConfiguration_changeDetectingColumns :: Lens' ColumnConfiguration (NonEmpty Text)
columnConfiguration_changeDetectingColumns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnConfiguration' {NonEmpty Text
changeDetectingColumns :: NonEmpty Text
$sel:changeDetectingColumns:ColumnConfiguration' :: ColumnConfiguration -> NonEmpty Text
changeDetectingColumns} -> NonEmpty Text
changeDetectingColumns) (\s :: ColumnConfiguration
s@ColumnConfiguration' {} NonEmpty Text
a -> ColumnConfiguration
s {$sel:changeDetectingColumns:ColumnConfiguration' :: NonEmpty Text
changeDetectingColumns = NonEmpty Text
a} :: ColumnConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ColumnConfiguration where
parseJSON :: Value -> Parser ColumnConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ColumnConfiguration"
( \Object
x ->
Maybe Text
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
-> Text
-> Text
-> NonEmpty Text
-> ColumnConfiguration
ColumnConfiguration'
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
"DocumentTitleColumnName")
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
"FieldMappings")
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
"DocumentIdColumnName")
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
"DocumentDataColumnName")
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
"ChangeDetectingColumns")
)
instance Prelude.Hashable ColumnConfiguration where
hashWithSalt :: Int -> ColumnConfiguration -> Int
hashWithSalt Int
_salt ColumnConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
NonEmpty Text
Text
changeDetectingColumns :: NonEmpty Text
documentDataColumnName :: Text
documentIdColumnName :: Text
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
documentTitleColumnName :: Maybe Text
$sel:changeDetectingColumns:ColumnConfiguration' :: ColumnConfiguration -> NonEmpty Text
$sel:documentDataColumnName:ColumnConfiguration' :: ColumnConfiguration -> Text
$sel:documentIdColumnName:ColumnConfiguration' :: ColumnConfiguration -> Text
$sel:fieldMappings:ColumnConfiguration' :: ColumnConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:documentTitleColumnName:ColumnConfiguration' :: ColumnConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentTitleColumnName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
documentIdColumnName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
documentDataColumnName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
changeDetectingColumns
instance Prelude.NFData ColumnConfiguration where
rnf :: ColumnConfiguration -> ()
rnf ColumnConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
NonEmpty Text
Text
changeDetectingColumns :: NonEmpty Text
documentDataColumnName :: Text
documentIdColumnName :: Text
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
documentTitleColumnName :: Maybe Text
$sel:changeDetectingColumns:ColumnConfiguration' :: ColumnConfiguration -> NonEmpty Text
$sel:documentDataColumnName:ColumnConfiguration' :: ColumnConfiguration -> Text
$sel:documentIdColumnName:ColumnConfiguration' :: ColumnConfiguration -> Text
$sel:fieldMappings:ColumnConfiguration' :: ColumnConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:documentTitleColumnName:ColumnConfiguration' :: ColumnConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentTitleColumnName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
documentIdColumnName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
documentDataColumnName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
changeDetectingColumns
instance Data.ToJSON ColumnConfiguration where
toJSON :: ColumnConfiguration -> Value
toJSON ColumnConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
NonEmpty Text
Text
changeDetectingColumns :: NonEmpty Text
documentDataColumnName :: Text
documentIdColumnName :: Text
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
documentTitleColumnName :: Maybe Text
$sel:changeDetectingColumns:ColumnConfiguration' :: ColumnConfiguration -> NonEmpty Text
$sel:documentDataColumnName:ColumnConfiguration' :: ColumnConfiguration -> Text
$sel:documentIdColumnName:ColumnConfiguration' :: ColumnConfiguration -> Text
$sel:fieldMappings:ColumnConfiguration' :: ColumnConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:documentTitleColumnName:ColumnConfiguration' :: ColumnConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DocumentTitleColumnName" 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
documentTitleColumnName,
(Key
"FieldMappings" 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 (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings,
forall a. a -> Maybe a
Prelude.Just
( Key
"DocumentIdColumnName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
documentIdColumnName
),
forall a. a -> Maybe a
Prelude.Just
( Key
"DocumentDataColumnName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
documentDataColumnName
),
forall a. a -> Maybe a
Prelude.Just
( Key
"ChangeDetectingColumns"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
changeDetectingColumns
)
]
)