{-# 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.WorkDocsConfiguration 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 WorkDocsConfiguration = WorkDocsConfiguration'
{
:: Prelude.Maybe Prelude.Bool,
WorkDocsConfiguration -> Maybe [Text]
exclusionPatterns :: Prelude.Maybe [Prelude.Text],
WorkDocsConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
WorkDocsConfiguration -> Maybe [Text]
inclusionPatterns :: Prelude.Maybe [Prelude.Text],
WorkDocsConfiguration -> Maybe Bool
useChangeLog :: Prelude.Maybe Prelude.Bool,
WorkDocsConfiguration -> Text
organizationId :: Prelude.Text
}
deriving (WorkDocsConfiguration -> WorkDocsConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkDocsConfiguration -> WorkDocsConfiguration -> Bool
$c/= :: WorkDocsConfiguration -> WorkDocsConfiguration -> Bool
== :: WorkDocsConfiguration -> WorkDocsConfiguration -> Bool
$c== :: WorkDocsConfiguration -> WorkDocsConfiguration -> Bool
Prelude.Eq, ReadPrec [WorkDocsConfiguration]
ReadPrec WorkDocsConfiguration
Int -> ReadS WorkDocsConfiguration
ReadS [WorkDocsConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkDocsConfiguration]
$creadListPrec :: ReadPrec [WorkDocsConfiguration]
readPrec :: ReadPrec WorkDocsConfiguration
$creadPrec :: ReadPrec WorkDocsConfiguration
readList :: ReadS [WorkDocsConfiguration]
$creadList :: ReadS [WorkDocsConfiguration]
readsPrec :: Int -> ReadS WorkDocsConfiguration
$creadsPrec :: Int -> ReadS WorkDocsConfiguration
Prelude.Read, Int -> WorkDocsConfiguration -> ShowS
[WorkDocsConfiguration] -> ShowS
WorkDocsConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkDocsConfiguration] -> ShowS
$cshowList :: [WorkDocsConfiguration] -> ShowS
show :: WorkDocsConfiguration -> String
$cshow :: WorkDocsConfiguration -> String
showsPrec :: Int -> WorkDocsConfiguration -> ShowS
$cshowsPrec :: Int -> WorkDocsConfiguration -> ShowS
Prelude.Show, forall x. Rep WorkDocsConfiguration x -> WorkDocsConfiguration
forall x. WorkDocsConfiguration -> Rep WorkDocsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkDocsConfiguration x -> WorkDocsConfiguration
$cfrom :: forall x. WorkDocsConfiguration -> Rep WorkDocsConfiguration x
Prelude.Generic)
newWorkDocsConfiguration ::
Prelude.Text ->
WorkDocsConfiguration
newWorkDocsConfiguration :: Text -> WorkDocsConfiguration
newWorkDocsConfiguration Text
pOrganizationId_ =
WorkDocsConfiguration'
{ $sel:crawlComments:WorkDocsConfiguration' :: Maybe Bool
crawlComments =
forall a. Maybe a
Prelude.Nothing,
$sel:exclusionPatterns:WorkDocsConfiguration' :: Maybe [Text]
exclusionPatterns = forall a. Maybe a
Prelude.Nothing,
$sel:fieldMappings:WorkDocsConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = forall a. Maybe a
Prelude.Nothing,
$sel:inclusionPatterns:WorkDocsConfiguration' :: Maybe [Text]
inclusionPatterns = forall a. Maybe a
Prelude.Nothing,
$sel:useChangeLog:WorkDocsConfiguration' :: Maybe Bool
useChangeLog = forall a. Maybe a
Prelude.Nothing,
$sel:organizationId:WorkDocsConfiguration' :: Text
organizationId = Text
pOrganizationId_
}
workDocsConfiguration_crawlComments :: Lens.Lens' WorkDocsConfiguration (Prelude.Maybe Prelude.Bool)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkDocsConfiguration' {Maybe Bool
crawlComments :: Maybe Bool
$sel:crawlComments:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe Bool
crawlComments} -> Maybe Bool
crawlComments) (\s :: WorkDocsConfiguration
s@WorkDocsConfiguration' {} Maybe Bool
a -> WorkDocsConfiguration
s {$sel:crawlComments:WorkDocsConfiguration' :: Maybe Bool
crawlComments = Maybe Bool
a} :: WorkDocsConfiguration)
workDocsConfiguration_exclusionPatterns :: Lens.Lens' WorkDocsConfiguration (Prelude.Maybe [Prelude.Text])
workDocsConfiguration_exclusionPatterns :: Lens' WorkDocsConfiguration (Maybe [Text])
workDocsConfiguration_exclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkDocsConfiguration' {Maybe [Text]
exclusionPatterns :: Maybe [Text]
$sel:exclusionPatterns:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe [Text]
exclusionPatterns} -> Maybe [Text]
exclusionPatterns) (\s :: WorkDocsConfiguration
s@WorkDocsConfiguration' {} Maybe [Text]
a -> WorkDocsConfiguration
s {$sel:exclusionPatterns:WorkDocsConfiguration' :: Maybe [Text]
exclusionPatterns = Maybe [Text]
a} :: WorkDocsConfiguration) 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
workDocsConfiguration_fieldMappings :: Lens.Lens' WorkDocsConfiguration (Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping))
workDocsConfiguration_fieldMappings :: Lens'
WorkDocsConfiguration
(Maybe (NonEmpty DataSourceToIndexFieldMapping))
workDocsConfiguration_fieldMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkDocsConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:fieldMappings:WorkDocsConfiguration' :: WorkDocsConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings} -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings) (\s :: WorkDocsConfiguration
s@WorkDocsConfiguration' {} Maybe (NonEmpty DataSourceToIndexFieldMapping)
a -> WorkDocsConfiguration
s {$sel:fieldMappings:WorkDocsConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = Maybe (NonEmpty DataSourceToIndexFieldMapping)
a} :: WorkDocsConfiguration) 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
workDocsConfiguration_inclusionPatterns :: Lens.Lens' WorkDocsConfiguration (Prelude.Maybe [Prelude.Text])
workDocsConfiguration_inclusionPatterns :: Lens' WorkDocsConfiguration (Maybe [Text])
workDocsConfiguration_inclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkDocsConfiguration' {Maybe [Text]
inclusionPatterns :: Maybe [Text]
$sel:inclusionPatterns:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe [Text]
inclusionPatterns} -> Maybe [Text]
inclusionPatterns) (\s :: WorkDocsConfiguration
s@WorkDocsConfiguration' {} Maybe [Text]
a -> WorkDocsConfiguration
s {$sel:inclusionPatterns:WorkDocsConfiguration' :: Maybe [Text]
inclusionPatterns = Maybe [Text]
a} :: WorkDocsConfiguration) 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
workDocsConfiguration_useChangeLog :: Lens.Lens' WorkDocsConfiguration (Prelude.Maybe Prelude.Bool)
workDocsConfiguration_useChangeLog :: Lens' WorkDocsConfiguration (Maybe Bool)
workDocsConfiguration_useChangeLog = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkDocsConfiguration' {Maybe Bool
useChangeLog :: Maybe Bool
$sel:useChangeLog:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe Bool
useChangeLog} -> Maybe Bool
useChangeLog) (\s :: WorkDocsConfiguration
s@WorkDocsConfiguration' {} Maybe Bool
a -> WorkDocsConfiguration
s {$sel:useChangeLog:WorkDocsConfiguration' :: Maybe Bool
useChangeLog = Maybe Bool
a} :: WorkDocsConfiguration)
workDocsConfiguration_organizationId :: Lens.Lens' WorkDocsConfiguration Prelude.Text
workDocsConfiguration_organizationId :: Lens' WorkDocsConfiguration Text
workDocsConfiguration_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkDocsConfiguration' {Text
organizationId :: Text
$sel:organizationId:WorkDocsConfiguration' :: WorkDocsConfiguration -> Text
organizationId} -> Text
organizationId) (\s :: WorkDocsConfiguration
s@WorkDocsConfiguration' {} Text
a -> WorkDocsConfiguration
s {$sel:organizationId:WorkDocsConfiguration' :: Text
organizationId = Text
a} :: WorkDocsConfiguration)
instance Data.FromJSON WorkDocsConfiguration where
parseJSON :: Value -> Parser WorkDocsConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"WorkDocsConfiguration"
( \Object
x ->
Maybe Bool
-> Maybe [Text]
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
-> Maybe [Text]
-> Maybe Bool
-> Text
-> WorkDocsConfiguration
WorkDocsConfiguration'
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
"CrawlComments")
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
"ExclusionPatterns"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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 (Maybe a)
Data..:? Key
"InclusionPatterns"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"UseChangeLog")
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
"OrganizationId")
)
instance Prelude.Hashable WorkDocsConfiguration where
hashWithSalt :: Int -> WorkDocsConfiguration -> Int
hashWithSalt Int
_salt WorkDocsConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
organizationId :: Text
useChangeLog :: Maybe Bool
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
crawlComments :: Maybe Bool
$sel:organizationId:WorkDocsConfiguration' :: WorkDocsConfiguration -> Text
$sel:useChangeLog:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe Bool
$sel:inclusionPatterns:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe [Text]
$sel:fieldMappings:WorkDocsConfiguration' :: WorkDocsConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe [Text]
$sel:crawlComments:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
crawlComments
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
exclusionPatterns
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
inclusionPatterns
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useChangeLog
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
instance Prelude.NFData WorkDocsConfiguration where
rnf :: WorkDocsConfiguration -> ()
rnf WorkDocsConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
organizationId :: Text
useChangeLog :: Maybe Bool
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
crawlComments :: Maybe Bool
$sel:organizationId:WorkDocsConfiguration' :: WorkDocsConfiguration -> Text
$sel:useChangeLog:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe Bool
$sel:inclusionPatterns:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe [Text]
$sel:fieldMappings:WorkDocsConfiguration' :: WorkDocsConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe [Text]
$sel:crawlComments:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
crawlComments
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
exclusionPatterns
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 Maybe [Text]
inclusionPatterns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
useChangeLog
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
instance Data.ToJSON WorkDocsConfiguration where
toJSON :: WorkDocsConfiguration -> Value
toJSON WorkDocsConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
organizationId :: Text
useChangeLog :: Maybe Bool
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
crawlComments :: Maybe Bool
$sel:organizationId:WorkDocsConfiguration' :: WorkDocsConfiguration -> Text
$sel:useChangeLog:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe Bool
$sel:inclusionPatterns:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe [Text]
$sel:fieldMappings:WorkDocsConfiguration' :: WorkDocsConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe [Text]
$sel:crawlComments:WorkDocsConfiguration' :: WorkDocsConfiguration -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CrawlComments" 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
crawlComments,
(Key
"ExclusionPatterns" 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]
exclusionPatterns,
(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,
(Key
"InclusionPatterns" 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]
inclusionPatterns,
(Key
"UseChangeLog" 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
useChangeLog,
forall a. a -> Maybe a
Prelude.Just
(Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId)
]
)