{-# 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.Kendra.Types.WorkDocsConfiguration
-- 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.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

-- | Provides the configuration information to connect to Amazon WorkDocs as
-- your data source.
--
-- Amazon WorkDocs connector is available in Oregon, North Virginia,
-- Sydney, Singapore and Ireland regions.
--
-- /See:/ 'newWorkDocsConfiguration' smart constructor.
data WorkDocsConfiguration = WorkDocsConfiguration'
  { -- | @TRUE@ to include comments on documents in your index. Including
    -- comments in your index means each comment is a document that can be
    -- searched on.
    --
    -- The default is set to @FALSE@.
    WorkDocsConfiguration -> Maybe Bool
crawlComments :: Prelude.Maybe Prelude.Bool,
    -- | A list of regular expression patterns to exclude certain files in your
    -- Amazon WorkDocs site repository. Files that match the patterns are
    -- excluded from the index. Files that don’t match the patterns are
    -- included in the index. If a file matches both an inclusion and exclusion
    -- pattern, the exclusion pattern takes precedence and the file isn\'t
    -- included in the index.
    WorkDocsConfiguration -> Maybe [Text]
exclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | A list of @DataSourceToIndexFieldMapping@ objects that map Amazon
    -- WorkDocs data source attributes or field names to Amazon Kendra index
    -- field names. To create custom fields, use the @UpdateIndex@ API before
    -- you map to Amazon WorkDocs fields. For more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
    -- The Amazon WorkDocs data source field names must exist in your Amazon
    -- WorkDocs custom metadata.
    WorkDocsConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
    -- | A list of regular expression patterns to include certain files in your
    -- Amazon WorkDocs site repository. Files that match the patterns are
    -- included in the index. Files that don\'t match the patterns are excluded
    -- from the index. If a file matches both an inclusion and exclusion
    -- pattern, the exclusion pattern takes precedence and the file isn\'t
    -- included in the index.
    WorkDocsConfiguration -> Maybe [Text]
inclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | @TRUE@ to use the Amazon WorkDocs change log to determine which
    -- documents require updating in the index. Depending on the change log\'s
    -- size, it may take longer for Amazon Kendra to use the change log than to
    -- scan all of your documents in Amazon WorkDocs.
    WorkDocsConfiguration -> Maybe Bool
useChangeLog :: Prelude.Maybe Prelude.Bool,
    -- | The identifier of the directory corresponding to your Amazon WorkDocs
    -- site repository.
    --
    -- You can find the organization ID in the
    -- <https://console.aws.amazon.com/directoryservicev2/ Directory Service>
    -- by going to __Active Directory__, then __Directories__. Your Amazon
    -- WorkDocs site directory has an ID, which is the organization ID. You can
    -- also set up a new Amazon WorkDocs directory in the Directory Service
    -- console and enable a Amazon WorkDocs site for the directory in the
    -- Amazon WorkDocs console.
    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)

-- |
-- Create a value of 'WorkDocsConfiguration' 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:
--
-- 'crawlComments', 'workDocsConfiguration_crawlComments' - @TRUE@ to include comments on documents in your index. Including
-- comments in your index means each comment is a document that can be
-- searched on.
--
-- The default is set to @FALSE@.
--
-- 'exclusionPatterns', 'workDocsConfiguration_exclusionPatterns' - A list of regular expression patterns to exclude certain files in your
-- Amazon WorkDocs site repository. Files that match the patterns are
-- excluded from the index. Files that don’t match the patterns are
-- included in the index. If a file matches both an inclusion and exclusion
-- pattern, the exclusion pattern takes precedence and the file isn\'t
-- included in the index.
--
-- 'fieldMappings', 'workDocsConfiguration_fieldMappings' - A list of @DataSourceToIndexFieldMapping@ objects that map Amazon
-- WorkDocs data source attributes or field names to Amazon Kendra index
-- field names. To create custom fields, use the @UpdateIndex@ API before
-- you map to Amazon WorkDocs fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The Amazon WorkDocs data source field names must exist in your Amazon
-- WorkDocs custom metadata.
--
-- 'inclusionPatterns', 'workDocsConfiguration_inclusionPatterns' - A list of regular expression patterns to include certain files in your
-- Amazon WorkDocs site repository. Files that match the patterns are
-- included in the index. Files that don\'t match the patterns are excluded
-- from the index. If a file matches both an inclusion and exclusion
-- pattern, the exclusion pattern takes precedence and the file isn\'t
-- included in the index.
--
-- 'useChangeLog', 'workDocsConfiguration_useChangeLog' - @TRUE@ to use the Amazon WorkDocs change log to determine which
-- documents require updating in the index. Depending on the change log\'s
-- size, it may take longer for Amazon Kendra to use the change log than to
-- scan all of your documents in Amazon WorkDocs.
--
-- 'organizationId', 'workDocsConfiguration_organizationId' - The identifier of the directory corresponding to your Amazon WorkDocs
-- site repository.
--
-- You can find the organization ID in the
-- <https://console.aws.amazon.com/directoryservicev2/ Directory Service>
-- by going to __Active Directory__, then __Directories__. Your Amazon
-- WorkDocs site directory has an ID, which is the organization ID. You can
-- also set up a new Amazon WorkDocs directory in the Directory Service
-- console and enable a Amazon WorkDocs site for the directory in the
-- Amazon WorkDocs console.
newWorkDocsConfiguration ::
  -- | 'organizationId'
  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_
    }

-- | @TRUE@ to include comments on documents in your index. Including
-- comments in your index means each comment is a document that can be
-- searched on.
--
-- The default is set to @FALSE@.
workDocsConfiguration_crawlComments :: Lens.Lens' WorkDocsConfiguration (Prelude.Maybe Prelude.Bool)
workDocsConfiguration_crawlComments :: Lens' WorkDocsConfiguration (Maybe Bool)
workDocsConfiguration_crawlComments = 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)

-- | A list of regular expression patterns to exclude certain files in your
-- Amazon WorkDocs site repository. Files that match the patterns are
-- excluded from the index. Files that don’t match the patterns are
-- included in the index. If a file matches both an inclusion and exclusion
-- pattern, the exclusion pattern takes precedence and the file isn\'t
-- included in the index.
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

-- | A list of @DataSourceToIndexFieldMapping@ objects that map Amazon
-- WorkDocs data source attributes or field names to Amazon Kendra index
-- field names. To create custom fields, use the @UpdateIndex@ API before
-- you map to Amazon WorkDocs fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The Amazon WorkDocs data source field names must exist in your Amazon
-- WorkDocs custom metadata.
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

-- | A list of regular expression patterns to include certain files in your
-- Amazon WorkDocs site repository. Files that match the patterns are
-- included in the index. Files that don\'t match the patterns are excluded
-- from the index. If a file matches both an inclusion and exclusion
-- pattern, the exclusion pattern takes precedence and the file isn\'t
-- included in the index.
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

-- | @TRUE@ to use the Amazon WorkDocs change log to determine which
-- documents require updating in the index. Depending on the change log\'s
-- size, it may take longer for Amazon Kendra to use the change log than to
-- scan all of your documents in Amazon WorkDocs.
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)

-- | The identifier of the directory corresponding to your Amazon WorkDocs
-- site repository.
--
-- You can find the organization ID in the
-- <https://console.aws.amazon.com/directoryservicev2/ Directory Service>
-- by going to __Active Directory__, then __Directories__. Your Amazon
-- WorkDocs site directory has an ID, which is the organization ID. You can
-- also set up a new Amazon WorkDocs directory in the Directory Service
-- console and enable a Amazon WorkDocs site for the directory in the
-- Amazon WorkDocs console.
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)
          ]
      )