{-# 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.SlackConfiguration
-- 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.SlackConfiguration 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 Amazonka.Kendra.Types.DataSourceVpcConfiguration
import Amazonka.Kendra.Types.SlackEntity
import qualified Amazonka.Prelude as Prelude

-- | Provides the configuration information to connect to Slack as your data
-- source.
--
-- /See:/ 'newSlackConfiguration' smart constructor.
data SlackConfiguration = SlackConfiguration'
  { -- | @TRUE@ to index bot messages from your Slack workspace team.
    SlackConfiguration -> Maybe Bool
crawlBotMessage :: Prelude.Maybe Prelude.Bool,
    -- | @TRUE@ to exclude archived messages to index from your Slack workspace
    -- team.
    SlackConfiguration -> Maybe Bool
excludeArchived :: Prelude.Maybe Prelude.Bool,
    -- | A list of regular expression patterns to exclude certain attached files
    -- in your Slack workspace team. 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.
    SlackConfiguration -> Maybe [Text]
exclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | A list of @DataSourceToIndexFieldMapping@ objects that map Slack data
    -- source attributes or field names to Amazon Kendra index field names. To
    -- create custom fields, use the @UpdateIndex@ API before you map to Slack
    -- fields. For more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
    -- The Slack data source field names must exist in your Slack custom
    -- metadata.
    SlackConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
    -- | A list of regular expression patterns to include certain attached files
    -- in your Slack workspace team. 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.
    SlackConfiguration -> Maybe [Text]
inclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | The number of hours for change log to look back from when you last
    -- synchronized your data. You can look back up to 7 days or 168 hours.
    --
    -- Change log updates your index only if new content was added since you
    -- last synced your data. Updated or deleted content from before you last
    -- synced does not get updated in your index. To capture updated or deleted
    -- content before you last synced, set the @LookBackPeriod@ to the number
    -- of hours you want change log to look back.
    SlackConfiguration -> Maybe Natural
lookBackPeriod :: Prelude.Maybe Prelude.Natural,
    -- | The list of private channel names from your Slack workspace team. You
    -- use this if you want to index specific private channels, not all private
    -- channels. You can also use regular expression patterns to filter private
    -- channels.
    SlackConfiguration -> Maybe [Text]
privateChannelFilter :: Prelude.Maybe [Prelude.Text],
    -- | The list of public channel names to index from your Slack workspace
    -- team. You use this if you want to index specific public channels, not
    -- all public channels. You can also use regular expression patterns to
    -- filter public channels.
    SlackConfiguration -> Maybe [Text]
publicChannelFilter :: Prelude.Maybe [Prelude.Text],
    -- | @TRUE@ to use the Slack change log to determine which documents require
    -- updating in the index. Depending on the Slack change log\'s size, it may
    -- take longer for Amazon Kendra to use the change log than to scan all of
    -- your documents in Slack.
    SlackConfiguration -> Maybe Bool
useChangeLog :: Prelude.Maybe Prelude.Bool,
    -- | Configuration information for an Amazon Virtual Private Cloud to connect
    -- to your Slack. For more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/vpc-configuration.html Configuring a VPC>.
    SlackConfiguration -> Maybe DataSourceVpcConfiguration
vpcConfiguration :: Prelude.Maybe DataSourceVpcConfiguration,
    -- | The identifier of the team in the Slack workspace. For example,
    -- /T0123456789/.
    --
    -- You can find your team ID in the URL of the main page of your Slack
    -- workspace. When you log in to Slack via a browser, you are directed to
    -- the URL of the main page. For example,
    -- /https:\/\/app.slack.com\/client\/__T0123456789__\/.../.
    SlackConfiguration -> Text
teamId :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of an Secrets Manager secret that
    -- contains the key-value pairs required to connect to your Slack workspace
    -- team. The secret must contain a JSON structure with the following keys:
    --
    -- -   slackToken—The user or bot token created in Slack. For more
    --     information on creating a token in Slack, see
    --     <https://docs.aws.amazon.com/kendra/latest/dg/data-source-slack.html#slack-authentication Authentication for a Slack data source>.
    SlackConfiguration -> Text
secretArn :: Prelude.Text,
    -- | Specify whether to index public channels, private channels, group
    -- messages, and direct messages. You can specify one or more of these
    -- options.
    SlackConfiguration -> NonEmpty SlackEntity
slackEntityList :: Prelude.NonEmpty SlackEntity,
    -- | The date to start crawling your data from your Slack workspace team. The
    -- date must follow this format: @yyyy-mm-dd@.
    SlackConfiguration -> Text
sinceCrawlDate :: Prelude.Text
  }
  deriving (SlackConfiguration -> SlackConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlackConfiguration -> SlackConfiguration -> Bool
$c/= :: SlackConfiguration -> SlackConfiguration -> Bool
== :: SlackConfiguration -> SlackConfiguration -> Bool
$c== :: SlackConfiguration -> SlackConfiguration -> Bool
Prelude.Eq, ReadPrec [SlackConfiguration]
ReadPrec SlackConfiguration
Int -> ReadS SlackConfiguration
ReadS [SlackConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlackConfiguration]
$creadListPrec :: ReadPrec [SlackConfiguration]
readPrec :: ReadPrec SlackConfiguration
$creadPrec :: ReadPrec SlackConfiguration
readList :: ReadS [SlackConfiguration]
$creadList :: ReadS [SlackConfiguration]
readsPrec :: Int -> ReadS SlackConfiguration
$creadsPrec :: Int -> ReadS SlackConfiguration
Prelude.Read, Int -> SlackConfiguration -> ShowS
[SlackConfiguration] -> ShowS
SlackConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlackConfiguration] -> ShowS
$cshowList :: [SlackConfiguration] -> ShowS
show :: SlackConfiguration -> String
$cshow :: SlackConfiguration -> String
showsPrec :: Int -> SlackConfiguration -> ShowS
$cshowsPrec :: Int -> SlackConfiguration -> ShowS
Prelude.Show, forall x. Rep SlackConfiguration x -> SlackConfiguration
forall x. SlackConfiguration -> Rep SlackConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SlackConfiguration x -> SlackConfiguration
$cfrom :: forall x. SlackConfiguration -> Rep SlackConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'SlackConfiguration' 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:
--
-- 'crawlBotMessage', 'slackConfiguration_crawlBotMessage' - @TRUE@ to index bot messages from your Slack workspace team.
--
-- 'excludeArchived', 'slackConfiguration_excludeArchived' - @TRUE@ to exclude archived messages to index from your Slack workspace
-- team.
--
-- 'exclusionPatterns', 'slackConfiguration_exclusionPatterns' - A list of regular expression patterns to exclude certain attached files
-- in your Slack workspace team. 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', 'slackConfiguration_fieldMappings' - A list of @DataSourceToIndexFieldMapping@ objects that map Slack data
-- source attributes or field names to Amazon Kendra index field names. To
-- create custom fields, use the @UpdateIndex@ API before you map to Slack
-- fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The Slack data source field names must exist in your Slack custom
-- metadata.
--
-- 'inclusionPatterns', 'slackConfiguration_inclusionPatterns' - A list of regular expression patterns to include certain attached files
-- in your Slack workspace team. 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.
--
-- 'lookBackPeriod', 'slackConfiguration_lookBackPeriod' - The number of hours for change log to look back from when you last
-- synchronized your data. You can look back up to 7 days or 168 hours.
--
-- Change log updates your index only if new content was added since you
-- last synced your data. Updated or deleted content from before you last
-- synced does not get updated in your index. To capture updated or deleted
-- content before you last synced, set the @LookBackPeriod@ to the number
-- of hours you want change log to look back.
--
-- 'privateChannelFilter', 'slackConfiguration_privateChannelFilter' - The list of private channel names from your Slack workspace team. You
-- use this if you want to index specific private channels, not all private
-- channels. You can also use regular expression patterns to filter private
-- channels.
--
-- 'publicChannelFilter', 'slackConfiguration_publicChannelFilter' - The list of public channel names to index from your Slack workspace
-- team. You use this if you want to index specific public channels, not
-- all public channels. You can also use regular expression patterns to
-- filter public channels.
--
-- 'useChangeLog', 'slackConfiguration_useChangeLog' - @TRUE@ to use the Slack change log to determine which documents require
-- updating in the index. Depending on the Slack change log\'s size, it may
-- take longer for Amazon Kendra to use the change log than to scan all of
-- your documents in Slack.
--
-- 'vpcConfiguration', 'slackConfiguration_vpcConfiguration' - Configuration information for an Amazon Virtual Private Cloud to connect
-- to your Slack. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/vpc-configuration.html Configuring a VPC>.
--
-- 'teamId', 'slackConfiguration_teamId' - The identifier of the team in the Slack workspace. For example,
-- /T0123456789/.
--
-- You can find your team ID in the URL of the main page of your Slack
-- workspace. When you log in to Slack via a browser, you are directed to
-- the URL of the main page. For example,
-- /https:\/\/app.slack.com\/client\/__T0123456789__\/.../.
--
-- 'secretArn', 'slackConfiguration_secretArn' - The Amazon Resource Name (ARN) of an Secrets Manager secret that
-- contains the key-value pairs required to connect to your Slack workspace
-- team. The secret must contain a JSON structure with the following keys:
--
-- -   slackToken—The user or bot token created in Slack. For more
--     information on creating a token in Slack, see
--     <https://docs.aws.amazon.com/kendra/latest/dg/data-source-slack.html#slack-authentication Authentication for a Slack data source>.
--
-- 'slackEntityList', 'slackConfiguration_slackEntityList' - Specify whether to index public channels, private channels, group
-- messages, and direct messages. You can specify one or more of these
-- options.
--
-- 'sinceCrawlDate', 'slackConfiguration_sinceCrawlDate' - The date to start crawling your data from your Slack workspace team. The
-- date must follow this format: @yyyy-mm-dd@.
newSlackConfiguration ::
  -- | 'teamId'
  Prelude.Text ->
  -- | 'secretArn'
  Prelude.Text ->
  -- | 'slackEntityList'
  Prelude.NonEmpty SlackEntity ->
  -- | 'sinceCrawlDate'
  Prelude.Text ->
  SlackConfiguration
newSlackConfiguration :: Text -> Text -> NonEmpty SlackEntity -> Text -> SlackConfiguration
newSlackConfiguration
  Text
pTeamId_
  Text
pSecretArn_
  NonEmpty SlackEntity
pSlackEntityList_
  Text
pSinceCrawlDate_ =
    SlackConfiguration'
      { $sel:crawlBotMessage:SlackConfiguration' :: Maybe Bool
crawlBotMessage =
          forall a. Maybe a
Prelude.Nothing,
        $sel:excludeArchived:SlackConfiguration' :: Maybe Bool
excludeArchived = forall a. Maybe a
Prelude.Nothing,
        $sel:exclusionPatterns:SlackConfiguration' :: Maybe [Text]
exclusionPatterns = forall a. Maybe a
Prelude.Nothing,
        $sel:fieldMappings:SlackConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = forall a. Maybe a
Prelude.Nothing,
        $sel:inclusionPatterns:SlackConfiguration' :: Maybe [Text]
inclusionPatterns = forall a. Maybe a
Prelude.Nothing,
        $sel:lookBackPeriod:SlackConfiguration' :: Maybe Natural
lookBackPeriod = forall a. Maybe a
Prelude.Nothing,
        $sel:privateChannelFilter:SlackConfiguration' :: Maybe [Text]
privateChannelFilter = forall a. Maybe a
Prelude.Nothing,
        $sel:publicChannelFilter:SlackConfiguration' :: Maybe [Text]
publicChannelFilter = forall a. Maybe a
Prelude.Nothing,
        $sel:useChangeLog:SlackConfiguration' :: Maybe Bool
useChangeLog = forall a. Maybe a
Prelude.Nothing,
        $sel:vpcConfiguration:SlackConfiguration' :: Maybe DataSourceVpcConfiguration
vpcConfiguration = forall a. Maybe a
Prelude.Nothing,
        $sel:teamId:SlackConfiguration' :: Text
teamId = Text
pTeamId_,
        $sel:secretArn:SlackConfiguration' :: Text
secretArn = Text
pSecretArn_,
        $sel:slackEntityList:SlackConfiguration' :: NonEmpty SlackEntity
slackEntityList =
          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 SlackEntity
pSlackEntityList_,
        $sel:sinceCrawlDate:SlackConfiguration' :: Text
sinceCrawlDate = Text
pSinceCrawlDate_
      }

-- | @TRUE@ to index bot messages from your Slack workspace team.
slackConfiguration_crawlBotMessage :: Lens.Lens' SlackConfiguration (Prelude.Maybe Prelude.Bool)
slackConfiguration_crawlBotMessage :: Lens' SlackConfiguration (Maybe Bool)
slackConfiguration_crawlBotMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe Bool
crawlBotMessage :: Maybe Bool
$sel:crawlBotMessage:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
crawlBotMessage} -> Maybe Bool
crawlBotMessage) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe Bool
a -> SlackConfiguration
s {$sel:crawlBotMessage:SlackConfiguration' :: Maybe Bool
crawlBotMessage = Maybe Bool
a} :: SlackConfiguration)

-- | @TRUE@ to exclude archived messages to index from your Slack workspace
-- team.
slackConfiguration_excludeArchived :: Lens.Lens' SlackConfiguration (Prelude.Maybe Prelude.Bool)
slackConfiguration_excludeArchived :: Lens' SlackConfiguration (Maybe Bool)
slackConfiguration_excludeArchived = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe Bool
excludeArchived :: Maybe Bool
$sel:excludeArchived:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
excludeArchived} -> Maybe Bool
excludeArchived) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe Bool
a -> SlackConfiguration
s {$sel:excludeArchived:SlackConfiguration' :: Maybe Bool
excludeArchived = Maybe Bool
a} :: SlackConfiguration)

-- | A list of regular expression patterns to exclude certain attached files
-- in your Slack workspace team. 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.
slackConfiguration_exclusionPatterns :: Lens.Lens' SlackConfiguration (Prelude.Maybe [Prelude.Text])
slackConfiguration_exclusionPatterns :: Lens' SlackConfiguration (Maybe [Text])
slackConfiguration_exclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe [Text]
exclusionPatterns :: Maybe [Text]
$sel:exclusionPatterns:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
exclusionPatterns} -> Maybe [Text]
exclusionPatterns) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe [Text]
a -> SlackConfiguration
s {$sel:exclusionPatterns:SlackConfiguration' :: Maybe [Text]
exclusionPatterns = Maybe [Text]
a} :: SlackConfiguration) 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 Slack data
-- source attributes or field names to Amazon Kendra index field names. To
-- create custom fields, use the @UpdateIndex@ API before you map to Slack
-- fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The Slack data source field names must exist in your Slack custom
-- metadata.
slackConfiguration_fieldMappings :: Lens.Lens' SlackConfiguration (Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping))
slackConfiguration_fieldMappings :: Lens'
  SlackConfiguration (Maybe (NonEmpty DataSourceToIndexFieldMapping))
slackConfiguration_fieldMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:fieldMappings:SlackConfiguration' :: SlackConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings} -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe (NonEmpty DataSourceToIndexFieldMapping)
a -> SlackConfiguration
s {$sel:fieldMappings:SlackConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = Maybe (NonEmpty DataSourceToIndexFieldMapping)
a} :: SlackConfiguration) 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 attached files
-- in your Slack workspace team. 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.
slackConfiguration_inclusionPatterns :: Lens.Lens' SlackConfiguration (Prelude.Maybe [Prelude.Text])
slackConfiguration_inclusionPatterns :: Lens' SlackConfiguration (Maybe [Text])
slackConfiguration_inclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe [Text]
inclusionPatterns :: Maybe [Text]
$sel:inclusionPatterns:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
inclusionPatterns} -> Maybe [Text]
inclusionPatterns) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe [Text]
a -> SlackConfiguration
s {$sel:inclusionPatterns:SlackConfiguration' :: Maybe [Text]
inclusionPatterns = Maybe [Text]
a} :: SlackConfiguration) 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 number of hours for change log to look back from when you last
-- synchronized your data. You can look back up to 7 days or 168 hours.
--
-- Change log updates your index only if new content was added since you
-- last synced your data. Updated or deleted content from before you last
-- synced does not get updated in your index. To capture updated or deleted
-- content before you last synced, set the @LookBackPeriod@ to the number
-- of hours you want change log to look back.
slackConfiguration_lookBackPeriod :: Lens.Lens' SlackConfiguration (Prelude.Maybe Prelude.Natural)
slackConfiguration_lookBackPeriod :: Lens' SlackConfiguration (Maybe Natural)
slackConfiguration_lookBackPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe Natural
lookBackPeriod :: Maybe Natural
$sel:lookBackPeriod:SlackConfiguration' :: SlackConfiguration -> Maybe Natural
lookBackPeriod} -> Maybe Natural
lookBackPeriod) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe Natural
a -> SlackConfiguration
s {$sel:lookBackPeriod:SlackConfiguration' :: Maybe Natural
lookBackPeriod = Maybe Natural
a} :: SlackConfiguration)

-- | The list of private channel names from your Slack workspace team. You
-- use this if you want to index specific private channels, not all private
-- channels. You can also use regular expression patterns to filter private
-- channels.
slackConfiguration_privateChannelFilter :: Lens.Lens' SlackConfiguration (Prelude.Maybe [Prelude.Text])
slackConfiguration_privateChannelFilter :: Lens' SlackConfiguration (Maybe [Text])
slackConfiguration_privateChannelFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe [Text]
privateChannelFilter :: Maybe [Text]
$sel:privateChannelFilter:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
privateChannelFilter} -> Maybe [Text]
privateChannelFilter) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe [Text]
a -> SlackConfiguration
s {$sel:privateChannelFilter:SlackConfiguration' :: Maybe [Text]
privateChannelFilter = Maybe [Text]
a} :: SlackConfiguration) 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 list of public channel names to index from your Slack workspace
-- team. You use this if you want to index specific public channels, not
-- all public channels. You can also use regular expression patterns to
-- filter public channels.
slackConfiguration_publicChannelFilter :: Lens.Lens' SlackConfiguration (Prelude.Maybe [Prelude.Text])
slackConfiguration_publicChannelFilter :: Lens' SlackConfiguration (Maybe [Text])
slackConfiguration_publicChannelFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe [Text]
publicChannelFilter :: Maybe [Text]
$sel:publicChannelFilter:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
publicChannelFilter} -> Maybe [Text]
publicChannelFilter) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe [Text]
a -> SlackConfiguration
s {$sel:publicChannelFilter:SlackConfiguration' :: Maybe [Text]
publicChannelFilter = Maybe [Text]
a} :: SlackConfiguration) 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 Slack change log to determine which documents require
-- updating in the index. Depending on the Slack change log\'s size, it may
-- take longer for Amazon Kendra to use the change log than to scan all of
-- your documents in Slack.
slackConfiguration_useChangeLog :: Lens.Lens' SlackConfiguration (Prelude.Maybe Prelude.Bool)
slackConfiguration_useChangeLog :: Lens' SlackConfiguration (Maybe Bool)
slackConfiguration_useChangeLog = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe Bool
useChangeLog :: Maybe Bool
$sel:useChangeLog:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
useChangeLog} -> Maybe Bool
useChangeLog) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe Bool
a -> SlackConfiguration
s {$sel:useChangeLog:SlackConfiguration' :: Maybe Bool
useChangeLog = Maybe Bool
a} :: SlackConfiguration)

-- | Configuration information for an Amazon Virtual Private Cloud to connect
-- to your Slack. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/vpc-configuration.html Configuring a VPC>.
slackConfiguration_vpcConfiguration :: Lens.Lens' SlackConfiguration (Prelude.Maybe DataSourceVpcConfiguration)
slackConfiguration_vpcConfiguration :: Lens' SlackConfiguration (Maybe DataSourceVpcConfiguration)
slackConfiguration_vpcConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Maybe DataSourceVpcConfiguration
vpcConfiguration :: Maybe DataSourceVpcConfiguration
$sel:vpcConfiguration:SlackConfiguration' :: SlackConfiguration -> Maybe DataSourceVpcConfiguration
vpcConfiguration} -> Maybe DataSourceVpcConfiguration
vpcConfiguration) (\s :: SlackConfiguration
s@SlackConfiguration' {} Maybe DataSourceVpcConfiguration
a -> SlackConfiguration
s {$sel:vpcConfiguration:SlackConfiguration' :: Maybe DataSourceVpcConfiguration
vpcConfiguration = Maybe DataSourceVpcConfiguration
a} :: SlackConfiguration)

-- | The identifier of the team in the Slack workspace. For example,
-- /T0123456789/.
--
-- You can find your team ID in the URL of the main page of your Slack
-- workspace. When you log in to Slack via a browser, you are directed to
-- the URL of the main page. For example,
-- /https:\/\/app.slack.com\/client\/__T0123456789__\/.../.
slackConfiguration_teamId :: Lens.Lens' SlackConfiguration Prelude.Text
slackConfiguration_teamId :: Lens' SlackConfiguration Text
slackConfiguration_teamId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Text
teamId :: Text
$sel:teamId:SlackConfiguration' :: SlackConfiguration -> Text
teamId} -> Text
teamId) (\s :: SlackConfiguration
s@SlackConfiguration' {} Text
a -> SlackConfiguration
s {$sel:teamId:SlackConfiguration' :: Text
teamId = Text
a} :: SlackConfiguration)

-- | The Amazon Resource Name (ARN) of an Secrets Manager secret that
-- contains the key-value pairs required to connect to your Slack workspace
-- team. The secret must contain a JSON structure with the following keys:
--
-- -   slackToken—The user or bot token created in Slack. For more
--     information on creating a token in Slack, see
--     <https://docs.aws.amazon.com/kendra/latest/dg/data-source-slack.html#slack-authentication Authentication for a Slack data source>.
slackConfiguration_secretArn :: Lens.Lens' SlackConfiguration Prelude.Text
slackConfiguration_secretArn :: Lens' SlackConfiguration Text
slackConfiguration_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Text
secretArn :: Text
$sel:secretArn:SlackConfiguration' :: SlackConfiguration -> Text
secretArn} -> Text
secretArn) (\s :: SlackConfiguration
s@SlackConfiguration' {} Text
a -> SlackConfiguration
s {$sel:secretArn:SlackConfiguration' :: Text
secretArn = Text
a} :: SlackConfiguration)

-- | Specify whether to index public channels, private channels, group
-- messages, and direct messages. You can specify one or more of these
-- options.
slackConfiguration_slackEntityList :: Lens.Lens' SlackConfiguration (Prelude.NonEmpty SlackEntity)
slackConfiguration_slackEntityList :: Lens' SlackConfiguration (NonEmpty SlackEntity)
slackConfiguration_slackEntityList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {NonEmpty SlackEntity
slackEntityList :: NonEmpty SlackEntity
$sel:slackEntityList:SlackConfiguration' :: SlackConfiguration -> NonEmpty SlackEntity
slackEntityList} -> NonEmpty SlackEntity
slackEntityList) (\s :: SlackConfiguration
s@SlackConfiguration' {} NonEmpty SlackEntity
a -> SlackConfiguration
s {$sel:slackEntityList:SlackConfiguration' :: NonEmpty SlackEntity
slackEntityList = NonEmpty SlackEntity
a} :: SlackConfiguration) 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

-- | The date to start crawling your data from your Slack workspace team. The
-- date must follow this format: @yyyy-mm-dd@.
slackConfiguration_sinceCrawlDate :: Lens.Lens' SlackConfiguration Prelude.Text
slackConfiguration_sinceCrawlDate :: Lens' SlackConfiguration Text
slackConfiguration_sinceCrawlDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConfiguration' {Text
sinceCrawlDate :: Text
$sel:sinceCrawlDate:SlackConfiguration' :: SlackConfiguration -> Text
sinceCrawlDate} -> Text
sinceCrawlDate) (\s :: SlackConfiguration
s@SlackConfiguration' {} Text
a -> SlackConfiguration
s {$sel:sinceCrawlDate:SlackConfiguration' :: Text
sinceCrawlDate = Text
a} :: SlackConfiguration)

instance Data.FromJSON SlackConfiguration where
  parseJSON :: Value -> Parser SlackConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SlackConfiguration"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe [Text]
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
-> Maybe [Text]
-> Maybe Natural
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Bool
-> Maybe DataSourceVpcConfiguration
-> Text
-> Text
-> NonEmpty SlackEntity
-> Text
-> SlackConfiguration
SlackConfiguration'
            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
"CrawlBotMessage")
            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
"ExcludeArchived")
            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
"LookBackPeriod")
            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
"PrivateChannelFilter"
                            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
"PublicChannelFilter"
                            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 (Maybe a)
Data..:? Key
"VpcConfiguration")
            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
"TeamId")
            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
"SecretArn")
            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
"SlackEntityList")
            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
"SinceCrawlDate")
      )

instance Prelude.Hashable SlackConfiguration where
  hashWithSalt :: Int -> SlackConfiguration -> Int
hashWithSalt Int
_salt SlackConfiguration' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe DataSourceVpcConfiguration
NonEmpty SlackEntity
Text
sinceCrawlDate :: Text
slackEntityList :: NonEmpty SlackEntity
secretArn :: Text
teamId :: Text
vpcConfiguration :: Maybe DataSourceVpcConfiguration
useChangeLog :: Maybe Bool
publicChannelFilter :: Maybe [Text]
privateChannelFilter :: Maybe [Text]
lookBackPeriod :: Maybe Natural
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
excludeArchived :: Maybe Bool
crawlBotMessage :: Maybe Bool
$sel:sinceCrawlDate:SlackConfiguration' :: SlackConfiguration -> Text
$sel:slackEntityList:SlackConfiguration' :: SlackConfiguration -> NonEmpty SlackEntity
$sel:secretArn:SlackConfiguration' :: SlackConfiguration -> Text
$sel:teamId:SlackConfiguration' :: SlackConfiguration -> Text
$sel:vpcConfiguration:SlackConfiguration' :: SlackConfiguration -> Maybe DataSourceVpcConfiguration
$sel:useChangeLog:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
$sel:publicChannelFilter:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:privateChannelFilter:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:lookBackPeriod:SlackConfiguration' :: SlackConfiguration -> Maybe Natural
$sel:inclusionPatterns:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:fieldMappings:SlackConfiguration' :: SlackConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:excludeArchived:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
$sel:crawlBotMessage:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
crawlBotMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
excludeArchived
      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 Natural
lookBackPeriod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
privateChannelFilter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
publicChannelFilter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
useChangeLog
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataSourceVpcConfiguration
vpcConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
teamId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
secretArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty SlackEntity
slackEntityList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sinceCrawlDate

instance Prelude.NFData SlackConfiguration where
  rnf :: SlackConfiguration -> ()
rnf SlackConfiguration' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe DataSourceVpcConfiguration
NonEmpty SlackEntity
Text
sinceCrawlDate :: Text
slackEntityList :: NonEmpty SlackEntity
secretArn :: Text
teamId :: Text
vpcConfiguration :: Maybe DataSourceVpcConfiguration
useChangeLog :: Maybe Bool
publicChannelFilter :: Maybe [Text]
privateChannelFilter :: Maybe [Text]
lookBackPeriod :: Maybe Natural
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
excludeArchived :: Maybe Bool
crawlBotMessage :: Maybe Bool
$sel:sinceCrawlDate:SlackConfiguration' :: SlackConfiguration -> Text
$sel:slackEntityList:SlackConfiguration' :: SlackConfiguration -> NonEmpty SlackEntity
$sel:secretArn:SlackConfiguration' :: SlackConfiguration -> Text
$sel:teamId:SlackConfiguration' :: SlackConfiguration -> Text
$sel:vpcConfiguration:SlackConfiguration' :: SlackConfiguration -> Maybe DataSourceVpcConfiguration
$sel:useChangeLog:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
$sel:publicChannelFilter:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:privateChannelFilter:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:lookBackPeriod:SlackConfiguration' :: SlackConfiguration -> Maybe Natural
$sel:inclusionPatterns:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:fieldMappings:SlackConfiguration' :: SlackConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:excludeArchived:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
$sel:crawlBotMessage:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
crawlBotMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
excludeArchived
      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 Natural
lookBackPeriod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
privateChannelFilter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
publicChannelFilter
      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 Maybe DataSourceVpcConfiguration
vpcConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
teamId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
secretArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty SlackEntity
slackEntityList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sinceCrawlDate

instance Data.ToJSON SlackConfiguration where
  toJSON :: SlackConfiguration -> Value
toJSON SlackConfiguration' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe DataSourceVpcConfiguration
NonEmpty SlackEntity
Text
sinceCrawlDate :: Text
slackEntityList :: NonEmpty SlackEntity
secretArn :: Text
teamId :: Text
vpcConfiguration :: Maybe DataSourceVpcConfiguration
useChangeLog :: Maybe Bool
publicChannelFilter :: Maybe [Text]
privateChannelFilter :: Maybe [Text]
lookBackPeriod :: Maybe Natural
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
excludeArchived :: Maybe Bool
crawlBotMessage :: Maybe Bool
$sel:sinceCrawlDate:SlackConfiguration' :: SlackConfiguration -> Text
$sel:slackEntityList:SlackConfiguration' :: SlackConfiguration -> NonEmpty SlackEntity
$sel:secretArn:SlackConfiguration' :: SlackConfiguration -> Text
$sel:teamId:SlackConfiguration' :: SlackConfiguration -> Text
$sel:vpcConfiguration:SlackConfiguration' :: SlackConfiguration -> Maybe DataSourceVpcConfiguration
$sel:useChangeLog:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
$sel:publicChannelFilter:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:privateChannelFilter:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:lookBackPeriod:SlackConfiguration' :: SlackConfiguration -> Maybe Natural
$sel:inclusionPatterns:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:fieldMappings:SlackConfiguration' :: SlackConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:SlackConfiguration' :: SlackConfiguration -> Maybe [Text]
$sel:excludeArchived:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
$sel:crawlBotMessage:SlackConfiguration' :: SlackConfiguration -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CrawlBotMessage" 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
crawlBotMessage,
            (Key
"ExcludeArchived" 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
excludeArchived,
            (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
"LookBackPeriod" 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 Natural
lookBackPeriod,
            (Key
"PrivateChannelFilter" 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]
privateChannelFilter,
            (Key
"PublicChannelFilter" 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]
publicChannelFilter,
            (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,
            (Key
"VpcConfiguration" 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 DataSourceVpcConfiguration
vpcConfiguration,
            forall a. a -> Maybe a
Prelude.Just (Key
"TeamId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
teamId),
            forall a. a -> Maybe a
Prelude.Just (Key
"SecretArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secretArn),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"SlackEntityList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty SlackEntity
slackEntityList),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"SinceCrawlDate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sinceCrawlDate)
          ]
      )