{-# 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.ServiceNowServiceCatalogConfiguration
-- 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.ServiceNowServiceCatalogConfiguration 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 for crawling service catalog
-- items in the ServiceNow site
--
-- /See:/ 'newServiceNowServiceCatalogConfiguration' smart constructor.
data ServiceNowServiceCatalogConfiguration = ServiceNowServiceCatalogConfiguration'
  { -- | @TRUE@ to index attachments to service catalog items.
    ServiceNowServiceCatalogConfiguration -> Maybe Bool
crawlAttachments :: Prelude.Maybe Prelude.Bool,
    -- | The name of the ServiceNow field that is mapped to the index document
    -- title field.
    ServiceNowServiceCatalogConfiguration -> Maybe Text
documentTitleFieldName :: Prelude.Maybe Prelude.Text,
    -- | A list of regular expression patterns to exclude certain attachments of
    -- catalogs in your ServiceNow. Item that match the patterns are excluded
    -- from the index. Items that don\'t match the patterns are included in the
    -- index. If an item matches both an inclusion and exclusion pattern, the
    -- exclusion pattern takes precedence and the item isn\'t included in the
    -- index.
    --
    -- The regex is applied to the file name of the attachment.
    ServiceNowServiceCatalogConfiguration -> Maybe [Text]
excludeAttachmentFilePatterns :: Prelude.Maybe [Prelude.Text],
    -- | Maps attributes or field names of catalogs to Amazon Kendra index field
    -- names. To create custom fields, use the @UpdateIndex@ API before you map
    -- to ServiceNow fields. For more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
    -- The ServiceNow data source field names must exist in your ServiceNow
    -- custom metadata.
    ServiceNowServiceCatalogConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
    -- | A list of regular expression patterns to include certain attachments of
    -- catalogs in your ServiceNow. Item that match the patterns are included
    -- in the index. Items that don\'t match the patterns are excluded from the
    -- index. If an item matches both an inclusion and exclusion pattern, the
    -- exclusion pattern takes precedence and the item isn\'t included in the
    -- index.
    --
    -- The regex is applied to the file name of the attachment.
    ServiceNowServiceCatalogConfiguration -> Maybe [Text]
includeAttachmentFilePatterns :: Prelude.Maybe [Prelude.Text],
    -- | The name of the ServiceNow field that is mapped to the index document
    -- contents field in the Amazon Kendra index.
    ServiceNowServiceCatalogConfiguration -> Text
documentDataFieldName :: Prelude.Text
  }
  deriving (ServiceNowServiceCatalogConfiguration
-> ServiceNowServiceCatalogConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceNowServiceCatalogConfiguration
-> ServiceNowServiceCatalogConfiguration -> Bool
$c/= :: ServiceNowServiceCatalogConfiguration
-> ServiceNowServiceCatalogConfiguration -> Bool
== :: ServiceNowServiceCatalogConfiguration
-> ServiceNowServiceCatalogConfiguration -> Bool
$c== :: ServiceNowServiceCatalogConfiguration
-> ServiceNowServiceCatalogConfiguration -> Bool
Prelude.Eq, ReadPrec [ServiceNowServiceCatalogConfiguration]
ReadPrec ServiceNowServiceCatalogConfiguration
Int -> ReadS ServiceNowServiceCatalogConfiguration
ReadS [ServiceNowServiceCatalogConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceNowServiceCatalogConfiguration]
$creadListPrec :: ReadPrec [ServiceNowServiceCatalogConfiguration]
readPrec :: ReadPrec ServiceNowServiceCatalogConfiguration
$creadPrec :: ReadPrec ServiceNowServiceCatalogConfiguration
readList :: ReadS [ServiceNowServiceCatalogConfiguration]
$creadList :: ReadS [ServiceNowServiceCatalogConfiguration]
readsPrec :: Int -> ReadS ServiceNowServiceCatalogConfiguration
$creadsPrec :: Int -> ReadS ServiceNowServiceCatalogConfiguration
Prelude.Read, Int -> ServiceNowServiceCatalogConfiguration -> ShowS
[ServiceNowServiceCatalogConfiguration] -> ShowS
ServiceNowServiceCatalogConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceNowServiceCatalogConfiguration] -> ShowS
$cshowList :: [ServiceNowServiceCatalogConfiguration] -> ShowS
show :: ServiceNowServiceCatalogConfiguration -> String
$cshow :: ServiceNowServiceCatalogConfiguration -> String
showsPrec :: Int -> ServiceNowServiceCatalogConfiguration -> ShowS
$cshowsPrec :: Int -> ServiceNowServiceCatalogConfiguration -> ShowS
Prelude.Show, forall x.
Rep ServiceNowServiceCatalogConfiguration x
-> ServiceNowServiceCatalogConfiguration
forall x.
ServiceNowServiceCatalogConfiguration
-> Rep ServiceNowServiceCatalogConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ServiceNowServiceCatalogConfiguration x
-> ServiceNowServiceCatalogConfiguration
$cfrom :: forall x.
ServiceNowServiceCatalogConfiguration
-> Rep ServiceNowServiceCatalogConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ServiceNowServiceCatalogConfiguration' 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:
--
-- 'crawlAttachments', 'serviceNowServiceCatalogConfiguration_crawlAttachments' - @TRUE@ to index attachments to service catalog items.
--
-- 'documentTitleFieldName', 'serviceNowServiceCatalogConfiguration_documentTitleFieldName' - The name of the ServiceNow field that is mapped to the index document
-- title field.
--
-- 'excludeAttachmentFilePatterns', 'serviceNowServiceCatalogConfiguration_excludeAttachmentFilePatterns' - A list of regular expression patterns to exclude certain attachments of
-- catalogs in your ServiceNow. Item that match the patterns are excluded
-- from the index. Items that don\'t match the patterns are included in the
-- index. If an item matches both an inclusion and exclusion pattern, the
-- exclusion pattern takes precedence and the item isn\'t included in the
-- index.
--
-- The regex is applied to the file name of the attachment.
--
-- 'fieldMappings', 'serviceNowServiceCatalogConfiguration_fieldMappings' - Maps attributes or field names of catalogs to Amazon Kendra index field
-- names. To create custom fields, use the @UpdateIndex@ API before you map
-- to ServiceNow fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The ServiceNow data source field names must exist in your ServiceNow
-- custom metadata.
--
-- 'includeAttachmentFilePatterns', 'serviceNowServiceCatalogConfiguration_includeAttachmentFilePatterns' - A list of regular expression patterns to include certain attachments of
-- catalogs in your ServiceNow. Item that match the patterns are included
-- in the index. Items that don\'t match the patterns are excluded from the
-- index. If an item matches both an inclusion and exclusion pattern, the
-- exclusion pattern takes precedence and the item isn\'t included in the
-- index.
--
-- The regex is applied to the file name of the attachment.
--
-- 'documentDataFieldName', 'serviceNowServiceCatalogConfiguration_documentDataFieldName' - The name of the ServiceNow field that is mapped to the index document
-- contents field in the Amazon Kendra index.
newServiceNowServiceCatalogConfiguration ::
  -- | 'documentDataFieldName'
  Prelude.Text ->
  ServiceNowServiceCatalogConfiguration
newServiceNowServiceCatalogConfiguration :: Text -> ServiceNowServiceCatalogConfiguration
newServiceNowServiceCatalogConfiguration
  Text
pDocumentDataFieldName_ =
    ServiceNowServiceCatalogConfiguration'
      { $sel:crawlAttachments:ServiceNowServiceCatalogConfiguration' :: Maybe Bool
crawlAttachments =
          forall a. Maybe a
Prelude.Nothing,
        $sel:documentTitleFieldName:ServiceNowServiceCatalogConfiguration' :: Maybe Text
documentTitleFieldName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:excludeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: Maybe [Text]
excludeAttachmentFilePatterns =
          forall a. Maybe a
Prelude.Nothing,
        $sel:fieldMappings:ServiceNowServiceCatalogConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = forall a. Maybe a
Prelude.Nothing,
        $sel:includeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: Maybe [Text]
includeAttachmentFilePatterns =
          forall a. Maybe a
Prelude.Nothing,
        $sel:documentDataFieldName:ServiceNowServiceCatalogConfiguration' :: Text
documentDataFieldName =
          Text
pDocumentDataFieldName_
      }

-- | @TRUE@ to index attachments to service catalog items.
serviceNowServiceCatalogConfiguration_crawlAttachments :: Lens.Lens' ServiceNowServiceCatalogConfiguration (Prelude.Maybe Prelude.Bool)
serviceNowServiceCatalogConfiguration_crawlAttachments :: Lens' ServiceNowServiceCatalogConfiguration (Maybe Bool)
serviceNowServiceCatalogConfiguration_crawlAttachments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowServiceCatalogConfiguration' {Maybe Bool
crawlAttachments :: Maybe Bool
$sel:crawlAttachments:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe Bool
crawlAttachments} -> Maybe Bool
crawlAttachments) (\s :: ServiceNowServiceCatalogConfiguration
s@ServiceNowServiceCatalogConfiguration' {} Maybe Bool
a -> ServiceNowServiceCatalogConfiguration
s {$sel:crawlAttachments:ServiceNowServiceCatalogConfiguration' :: Maybe Bool
crawlAttachments = Maybe Bool
a} :: ServiceNowServiceCatalogConfiguration)

-- | The name of the ServiceNow field that is mapped to the index document
-- title field.
serviceNowServiceCatalogConfiguration_documentTitleFieldName :: Lens.Lens' ServiceNowServiceCatalogConfiguration (Prelude.Maybe Prelude.Text)
serviceNowServiceCatalogConfiguration_documentTitleFieldName :: Lens' ServiceNowServiceCatalogConfiguration (Maybe Text)
serviceNowServiceCatalogConfiguration_documentTitleFieldName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowServiceCatalogConfiguration' {Maybe Text
documentTitleFieldName :: Maybe Text
$sel:documentTitleFieldName:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe Text
documentTitleFieldName} -> Maybe Text
documentTitleFieldName) (\s :: ServiceNowServiceCatalogConfiguration
s@ServiceNowServiceCatalogConfiguration' {} Maybe Text
a -> ServiceNowServiceCatalogConfiguration
s {$sel:documentTitleFieldName:ServiceNowServiceCatalogConfiguration' :: Maybe Text
documentTitleFieldName = Maybe Text
a} :: ServiceNowServiceCatalogConfiguration)

-- | A list of regular expression patterns to exclude certain attachments of
-- catalogs in your ServiceNow. Item that match the patterns are excluded
-- from the index. Items that don\'t match the patterns are included in the
-- index. If an item matches both an inclusion and exclusion pattern, the
-- exclusion pattern takes precedence and the item isn\'t included in the
-- index.
--
-- The regex is applied to the file name of the attachment.
serviceNowServiceCatalogConfiguration_excludeAttachmentFilePatterns :: Lens.Lens' ServiceNowServiceCatalogConfiguration (Prelude.Maybe [Prelude.Text])
serviceNowServiceCatalogConfiguration_excludeAttachmentFilePatterns :: Lens' ServiceNowServiceCatalogConfiguration (Maybe [Text])
serviceNowServiceCatalogConfiguration_excludeAttachmentFilePatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowServiceCatalogConfiguration' {Maybe [Text]
excludeAttachmentFilePatterns :: Maybe [Text]
$sel:excludeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe [Text]
excludeAttachmentFilePatterns} -> Maybe [Text]
excludeAttachmentFilePatterns) (\s :: ServiceNowServiceCatalogConfiguration
s@ServiceNowServiceCatalogConfiguration' {} Maybe [Text]
a -> ServiceNowServiceCatalogConfiguration
s {$sel:excludeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: Maybe [Text]
excludeAttachmentFilePatterns = Maybe [Text]
a} :: ServiceNowServiceCatalogConfiguration) 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

-- | Maps attributes or field names of catalogs to Amazon Kendra index field
-- names. To create custom fields, use the @UpdateIndex@ API before you map
-- to ServiceNow fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The ServiceNow data source field names must exist in your ServiceNow
-- custom metadata.
serviceNowServiceCatalogConfiguration_fieldMappings :: Lens.Lens' ServiceNowServiceCatalogConfiguration (Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping))
serviceNowServiceCatalogConfiguration_fieldMappings :: Lens'
  ServiceNowServiceCatalogConfiguration
  (Maybe (NonEmpty DataSourceToIndexFieldMapping))
serviceNowServiceCatalogConfiguration_fieldMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowServiceCatalogConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:fieldMappings:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings} -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings) (\s :: ServiceNowServiceCatalogConfiguration
s@ServiceNowServiceCatalogConfiguration' {} Maybe (NonEmpty DataSourceToIndexFieldMapping)
a -> ServiceNowServiceCatalogConfiguration
s {$sel:fieldMappings:ServiceNowServiceCatalogConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = Maybe (NonEmpty DataSourceToIndexFieldMapping)
a} :: ServiceNowServiceCatalogConfiguration) 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 attachments of
-- catalogs in your ServiceNow. Item that match the patterns are included
-- in the index. Items that don\'t match the patterns are excluded from the
-- index. If an item matches both an inclusion and exclusion pattern, the
-- exclusion pattern takes precedence and the item isn\'t included in the
-- index.
--
-- The regex is applied to the file name of the attachment.
serviceNowServiceCatalogConfiguration_includeAttachmentFilePatterns :: Lens.Lens' ServiceNowServiceCatalogConfiguration (Prelude.Maybe [Prelude.Text])
serviceNowServiceCatalogConfiguration_includeAttachmentFilePatterns :: Lens' ServiceNowServiceCatalogConfiguration (Maybe [Text])
serviceNowServiceCatalogConfiguration_includeAttachmentFilePatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowServiceCatalogConfiguration' {Maybe [Text]
includeAttachmentFilePatterns :: Maybe [Text]
$sel:includeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe [Text]
includeAttachmentFilePatterns} -> Maybe [Text]
includeAttachmentFilePatterns) (\s :: ServiceNowServiceCatalogConfiguration
s@ServiceNowServiceCatalogConfiguration' {} Maybe [Text]
a -> ServiceNowServiceCatalogConfiguration
s {$sel:includeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: Maybe [Text]
includeAttachmentFilePatterns = Maybe [Text]
a} :: ServiceNowServiceCatalogConfiguration) 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

-- | The name of the ServiceNow field that is mapped to the index document
-- contents field in the Amazon Kendra index.
serviceNowServiceCatalogConfiguration_documentDataFieldName :: Lens.Lens' ServiceNowServiceCatalogConfiguration Prelude.Text
serviceNowServiceCatalogConfiguration_documentDataFieldName :: Lens' ServiceNowServiceCatalogConfiguration Text
serviceNowServiceCatalogConfiguration_documentDataFieldName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowServiceCatalogConfiguration' {Text
documentDataFieldName :: Text
$sel:documentDataFieldName:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Text
documentDataFieldName} -> Text
documentDataFieldName) (\s :: ServiceNowServiceCatalogConfiguration
s@ServiceNowServiceCatalogConfiguration' {} Text
a -> ServiceNowServiceCatalogConfiguration
s {$sel:documentDataFieldName:ServiceNowServiceCatalogConfiguration' :: Text
documentDataFieldName = Text
a} :: ServiceNowServiceCatalogConfiguration)

instance
  Data.FromJSON
    ServiceNowServiceCatalogConfiguration
  where
  parseJSON :: Value -> Parser ServiceNowServiceCatalogConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ServiceNowServiceCatalogConfiguration"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
-> Maybe [Text]
-> Text
-> ServiceNowServiceCatalogConfiguration
ServiceNowServiceCatalogConfiguration'
            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
"CrawlAttachments")
            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
"DocumentTitleFieldName")
            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
"ExcludeAttachmentFilePatterns"
                            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
"IncludeAttachmentFilePatterns"
                            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 a
Data..: Key
"DocumentDataFieldName")
      )

instance
  Prelude.Hashable
    ServiceNowServiceCatalogConfiguration
  where
  hashWithSalt :: Int -> ServiceNowServiceCatalogConfiguration -> Int
hashWithSalt
    Int
_salt
    ServiceNowServiceCatalogConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
Text
documentDataFieldName :: Text
includeAttachmentFilePatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
excludeAttachmentFilePatterns :: Maybe [Text]
documentTitleFieldName :: Maybe Text
crawlAttachments :: Maybe Bool
$sel:documentDataFieldName:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Text
$sel:includeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe [Text]
$sel:fieldMappings:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:excludeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe [Text]
$sel:documentTitleFieldName:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe Text
$sel:crawlAttachments:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
crawlAttachments
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentTitleFieldName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
excludeAttachmentFilePatterns
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
includeAttachmentFilePatterns
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
documentDataFieldName

instance
  Prelude.NFData
    ServiceNowServiceCatalogConfiguration
  where
  rnf :: ServiceNowServiceCatalogConfiguration -> ()
rnf ServiceNowServiceCatalogConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
Text
documentDataFieldName :: Text
includeAttachmentFilePatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
excludeAttachmentFilePatterns :: Maybe [Text]
documentTitleFieldName :: Maybe Text
crawlAttachments :: Maybe Bool
$sel:documentDataFieldName:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Text
$sel:includeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe [Text]
$sel:fieldMappings:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:excludeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe [Text]
$sel:documentTitleFieldName:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe Text
$sel:crawlAttachments:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
crawlAttachments
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentTitleFieldName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
excludeAttachmentFilePatterns
      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]
includeAttachmentFilePatterns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
documentDataFieldName

instance
  Data.ToJSON
    ServiceNowServiceCatalogConfiguration
  where
  toJSON :: ServiceNowServiceCatalogConfiguration -> Value
toJSON ServiceNowServiceCatalogConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
Text
documentDataFieldName :: Text
includeAttachmentFilePatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
excludeAttachmentFilePatterns :: Maybe [Text]
documentTitleFieldName :: Maybe Text
crawlAttachments :: Maybe Bool
$sel:documentDataFieldName:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Text
$sel:includeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe [Text]
$sel:fieldMappings:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:excludeAttachmentFilePatterns:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe [Text]
$sel:documentTitleFieldName:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe Text
$sel:crawlAttachments:ServiceNowServiceCatalogConfiguration' :: ServiceNowServiceCatalogConfiguration -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CrawlAttachments" 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
crawlAttachments,
            (Key
"DocumentTitleFieldName" 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
documentTitleFieldName,
            (Key
"ExcludeAttachmentFilePatterns" 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]
excludeAttachmentFilePatterns,
            (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
"IncludeAttachmentFilePatterns" 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]
includeAttachmentFilePatterns,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"DocumentDataFieldName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
documentDataFieldName
              )
          ]
      )