{-# 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.SalesforceConfiguration
-- 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.SalesforceConfiguration 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.SalesforceChatterFeedConfiguration
import Amazonka.Kendra.Types.SalesforceKnowledgeArticleConfiguration
import Amazonka.Kendra.Types.SalesforceStandardObjectAttachmentConfiguration
import Amazonka.Kendra.Types.SalesforceStandardObjectConfiguration
import qualified Amazonka.Prelude as Prelude

-- | Provides the configuration information to connect to Salesforce as your
-- data source.
--
-- /See:/ 'newSalesforceConfiguration' smart constructor.
data SalesforceConfiguration = SalesforceConfiguration'
  { -- | Configuration information for Salesforce chatter feeds.
    SalesforceConfiguration -> Maybe SalesforceChatterFeedConfiguration
chatterFeedConfiguration :: Prelude.Maybe SalesforceChatterFeedConfiguration,
    -- | Indicates whether Amazon Kendra should index attachments to Salesforce
    -- objects.
    SalesforceConfiguration -> Maybe Bool
crawlAttachments :: Prelude.Maybe Prelude.Bool,
    -- | A list of regular expression patterns to exclude certain documents in
    -- your Salesforce. Documents that match the patterns are excluded from the
    -- index. Documents that don\'t match the patterns are included in the
    -- index. If a document matches both an inclusion and exclusion pattern,
    -- the exclusion pattern takes precedence and the document isn\'t included
    -- in the index.
    --
    -- The pattern is applied to the name of the attached file.
    SalesforceConfiguration -> Maybe [Text]
excludeAttachmentFilePatterns :: Prelude.Maybe [Prelude.Text],
    -- | A list of regular expression patterns to include certain documents in
    -- your Salesforce. Documents that match the patterns are included in the
    -- index. Documents that don\'t match the patterns are excluded from the
    -- index. If a document matches both an inclusion and exclusion pattern,
    -- the exclusion pattern takes precedence and the document isn\'t included
    -- in the index.
    --
    -- The pattern is applied to the name of the attached file.
    SalesforceConfiguration -> Maybe [Text]
includeAttachmentFilePatterns :: Prelude.Maybe [Prelude.Text],
    -- | Configuration information for the knowledge article types that Amazon
    -- Kendra indexes. Amazon Kendra indexes standard knowledge articles and
    -- the standard fields of knowledge articles, or the custom fields of
    -- custom knowledge articles, but not both.
    SalesforceConfiguration
-> Maybe SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration :: Prelude.Maybe SalesforceKnowledgeArticleConfiguration,
    -- | Configuration information for processing attachments to Salesforce
    -- standard objects.
    SalesforceConfiguration
-> Maybe SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration :: Prelude.Maybe SalesforceStandardObjectAttachmentConfiguration,
    -- | Configuration of the Salesforce standard objects that Amazon Kendra
    -- indexes.
    SalesforceConfiguration
-> Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectConfigurations :: Prelude.Maybe (Prelude.NonEmpty SalesforceStandardObjectConfiguration),
    -- | The instance URL for the Salesforce site that you want to index.
    SalesforceConfiguration -> Text
serverUrl :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of an Secrets Managersecret that contains
    -- the key\/value pairs required to connect to your Salesforce instance.
    -- The secret must contain a JSON structure with the following keys:
    --
    -- -   authenticationUrl - The OAUTH endpoint that Amazon Kendra connects
    --     to get an OAUTH token.
    --
    -- -   consumerKey - The application public key generated when you created
    --     your Salesforce application.
    --
    -- -   consumerSecret - The application private key generated when you
    --     created your Salesforce application.
    --
    -- -   password - The password associated with the user logging in to the
    --     Salesforce instance.
    --
    -- -   securityToken - The token associated with the user account logging
    --     in to the Salesforce instance.
    --
    -- -   username - The user name of the user logging in to the Salesforce
    --     instance.
    SalesforceConfiguration -> Text
secretArn :: Prelude.Text
  }
  deriving (SalesforceConfiguration -> SalesforceConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SalesforceConfiguration -> SalesforceConfiguration -> Bool
$c/= :: SalesforceConfiguration -> SalesforceConfiguration -> Bool
== :: SalesforceConfiguration -> SalesforceConfiguration -> Bool
$c== :: SalesforceConfiguration -> SalesforceConfiguration -> Bool
Prelude.Eq, ReadPrec [SalesforceConfiguration]
ReadPrec SalesforceConfiguration
Int -> ReadS SalesforceConfiguration
ReadS [SalesforceConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SalesforceConfiguration]
$creadListPrec :: ReadPrec [SalesforceConfiguration]
readPrec :: ReadPrec SalesforceConfiguration
$creadPrec :: ReadPrec SalesforceConfiguration
readList :: ReadS [SalesforceConfiguration]
$creadList :: ReadS [SalesforceConfiguration]
readsPrec :: Int -> ReadS SalesforceConfiguration
$creadsPrec :: Int -> ReadS SalesforceConfiguration
Prelude.Read, Int -> SalesforceConfiguration -> ShowS
[SalesforceConfiguration] -> ShowS
SalesforceConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SalesforceConfiguration] -> ShowS
$cshowList :: [SalesforceConfiguration] -> ShowS
show :: SalesforceConfiguration -> String
$cshow :: SalesforceConfiguration -> String
showsPrec :: Int -> SalesforceConfiguration -> ShowS
$cshowsPrec :: Int -> SalesforceConfiguration -> ShowS
Prelude.Show, forall x. Rep SalesforceConfiguration x -> SalesforceConfiguration
forall x. SalesforceConfiguration -> Rep SalesforceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SalesforceConfiguration x -> SalesforceConfiguration
$cfrom :: forall x. SalesforceConfiguration -> Rep SalesforceConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'SalesforceConfiguration' 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:
--
-- 'chatterFeedConfiguration', 'salesforceConfiguration_chatterFeedConfiguration' - Configuration information for Salesforce chatter feeds.
--
-- 'crawlAttachments', 'salesforceConfiguration_crawlAttachments' - Indicates whether Amazon Kendra should index attachments to Salesforce
-- objects.
--
-- 'excludeAttachmentFilePatterns', 'salesforceConfiguration_excludeAttachmentFilePatterns' - A list of regular expression patterns to exclude certain documents in
-- your Salesforce. Documents that match the patterns are excluded from the
-- index. Documents that don\'t match the patterns are included in the
-- index. If a document matches both an inclusion and exclusion pattern,
-- the exclusion pattern takes precedence and the document isn\'t included
-- in the index.
--
-- The pattern is applied to the name of the attached file.
--
-- 'includeAttachmentFilePatterns', 'salesforceConfiguration_includeAttachmentFilePatterns' - A list of regular expression patterns to include certain documents in
-- your Salesforce. Documents that match the patterns are included in the
-- index. Documents that don\'t match the patterns are excluded from the
-- index. If a document matches both an inclusion and exclusion pattern,
-- the exclusion pattern takes precedence and the document isn\'t included
-- in the index.
--
-- The pattern is applied to the name of the attached file.
--
-- 'knowledgeArticleConfiguration', 'salesforceConfiguration_knowledgeArticleConfiguration' - Configuration information for the knowledge article types that Amazon
-- Kendra indexes. Amazon Kendra indexes standard knowledge articles and
-- the standard fields of knowledge articles, or the custom fields of
-- custom knowledge articles, but not both.
--
-- 'standardObjectAttachmentConfiguration', 'salesforceConfiguration_standardObjectAttachmentConfiguration' - Configuration information for processing attachments to Salesforce
-- standard objects.
--
-- 'standardObjectConfigurations', 'salesforceConfiguration_standardObjectConfigurations' - Configuration of the Salesforce standard objects that Amazon Kendra
-- indexes.
--
-- 'serverUrl', 'salesforceConfiguration_serverUrl' - The instance URL for the Salesforce site that you want to index.
--
-- 'secretArn', 'salesforceConfiguration_secretArn' - The Amazon Resource Name (ARN) of an Secrets Managersecret that contains
-- the key\/value pairs required to connect to your Salesforce instance.
-- The secret must contain a JSON structure with the following keys:
--
-- -   authenticationUrl - The OAUTH endpoint that Amazon Kendra connects
--     to get an OAUTH token.
--
-- -   consumerKey - The application public key generated when you created
--     your Salesforce application.
--
-- -   consumerSecret - The application private key generated when you
--     created your Salesforce application.
--
-- -   password - The password associated with the user logging in to the
--     Salesforce instance.
--
-- -   securityToken - The token associated with the user account logging
--     in to the Salesforce instance.
--
-- -   username - The user name of the user logging in to the Salesforce
--     instance.
newSalesforceConfiguration ::
  -- | 'serverUrl'
  Prelude.Text ->
  -- | 'secretArn'
  Prelude.Text ->
  SalesforceConfiguration
newSalesforceConfiguration :: Text -> Text -> SalesforceConfiguration
newSalesforceConfiguration Text
pServerUrl_ Text
pSecretArn_ =
  SalesforceConfiguration'
    { $sel:chatterFeedConfiguration:SalesforceConfiguration' :: Maybe SalesforceChatterFeedConfiguration
chatterFeedConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:crawlAttachments:SalesforceConfiguration' :: Maybe Bool
crawlAttachments = forall a. Maybe a
Prelude.Nothing,
      $sel:excludeAttachmentFilePatterns:SalesforceConfiguration' :: Maybe [Text]
excludeAttachmentFilePatterns = forall a. Maybe a
Prelude.Nothing,
      $sel:includeAttachmentFilePatterns:SalesforceConfiguration' :: Maybe [Text]
includeAttachmentFilePatterns = forall a. Maybe a
Prelude.Nothing,
      $sel:knowledgeArticleConfiguration:SalesforceConfiguration' :: Maybe SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:standardObjectAttachmentConfiguration:SalesforceConfiguration' :: Maybe SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:standardObjectConfigurations:SalesforceConfiguration' :: Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectConfigurations = forall a. Maybe a
Prelude.Nothing,
      $sel:serverUrl:SalesforceConfiguration' :: Text
serverUrl = Text
pServerUrl_,
      $sel:secretArn:SalesforceConfiguration' :: Text
secretArn = Text
pSecretArn_
    }

-- | Configuration information for Salesforce chatter feeds.
salesforceConfiguration_chatterFeedConfiguration :: Lens.Lens' SalesforceConfiguration (Prelude.Maybe SalesforceChatterFeedConfiguration)
salesforceConfiguration_chatterFeedConfiguration :: Lens'
  SalesforceConfiguration (Maybe SalesforceChatterFeedConfiguration)
salesforceConfiguration_chatterFeedConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Maybe SalesforceChatterFeedConfiguration
chatterFeedConfiguration :: Maybe SalesforceChatterFeedConfiguration
$sel:chatterFeedConfiguration:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe SalesforceChatterFeedConfiguration
chatterFeedConfiguration} -> Maybe SalesforceChatterFeedConfiguration
chatterFeedConfiguration) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Maybe SalesforceChatterFeedConfiguration
a -> SalesforceConfiguration
s {$sel:chatterFeedConfiguration:SalesforceConfiguration' :: Maybe SalesforceChatterFeedConfiguration
chatterFeedConfiguration = Maybe SalesforceChatterFeedConfiguration
a} :: SalesforceConfiguration)

-- | Indicates whether Amazon Kendra should index attachments to Salesforce
-- objects.
salesforceConfiguration_crawlAttachments :: Lens.Lens' SalesforceConfiguration (Prelude.Maybe Prelude.Bool)
salesforceConfiguration_crawlAttachments :: Lens' SalesforceConfiguration (Maybe Bool)
salesforceConfiguration_crawlAttachments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Maybe Bool
crawlAttachments :: Maybe Bool
$sel:crawlAttachments:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe Bool
crawlAttachments} -> Maybe Bool
crawlAttachments) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Maybe Bool
a -> SalesforceConfiguration
s {$sel:crawlAttachments:SalesforceConfiguration' :: Maybe Bool
crawlAttachments = Maybe Bool
a} :: SalesforceConfiguration)

-- | A list of regular expression patterns to exclude certain documents in
-- your Salesforce. Documents that match the patterns are excluded from the
-- index. Documents that don\'t match the patterns are included in the
-- index. If a document matches both an inclusion and exclusion pattern,
-- the exclusion pattern takes precedence and the document isn\'t included
-- in the index.
--
-- The pattern is applied to the name of the attached file.
salesforceConfiguration_excludeAttachmentFilePatterns :: Lens.Lens' SalesforceConfiguration (Prelude.Maybe [Prelude.Text])
salesforceConfiguration_excludeAttachmentFilePatterns :: Lens' SalesforceConfiguration (Maybe [Text])
salesforceConfiguration_excludeAttachmentFilePatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Maybe [Text]
excludeAttachmentFilePatterns :: Maybe [Text]
$sel:excludeAttachmentFilePatterns:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe [Text]
excludeAttachmentFilePatterns} -> Maybe [Text]
excludeAttachmentFilePatterns) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Maybe [Text]
a -> SalesforceConfiguration
s {$sel:excludeAttachmentFilePatterns:SalesforceConfiguration' :: Maybe [Text]
excludeAttachmentFilePatterns = Maybe [Text]
a} :: SalesforceConfiguration) 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 documents in
-- your Salesforce. Documents that match the patterns are included in the
-- index. Documents that don\'t match the patterns are excluded from the
-- index. If a document matches both an inclusion and exclusion pattern,
-- the exclusion pattern takes precedence and the document isn\'t included
-- in the index.
--
-- The pattern is applied to the name of the attached file.
salesforceConfiguration_includeAttachmentFilePatterns :: Lens.Lens' SalesforceConfiguration (Prelude.Maybe [Prelude.Text])
salesforceConfiguration_includeAttachmentFilePatterns :: Lens' SalesforceConfiguration (Maybe [Text])
salesforceConfiguration_includeAttachmentFilePatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Maybe [Text]
includeAttachmentFilePatterns :: Maybe [Text]
$sel:includeAttachmentFilePatterns:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe [Text]
includeAttachmentFilePatterns} -> Maybe [Text]
includeAttachmentFilePatterns) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Maybe [Text]
a -> SalesforceConfiguration
s {$sel:includeAttachmentFilePatterns:SalesforceConfiguration' :: Maybe [Text]
includeAttachmentFilePatterns = Maybe [Text]
a} :: SalesforceConfiguration) 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

-- | Configuration information for the knowledge article types that Amazon
-- Kendra indexes. Amazon Kendra indexes standard knowledge articles and
-- the standard fields of knowledge articles, or the custom fields of
-- custom knowledge articles, but not both.
salesforceConfiguration_knowledgeArticleConfiguration :: Lens.Lens' SalesforceConfiguration (Prelude.Maybe SalesforceKnowledgeArticleConfiguration)
salesforceConfiguration_knowledgeArticleConfiguration :: Lens'
  SalesforceConfiguration
  (Maybe SalesforceKnowledgeArticleConfiguration)
salesforceConfiguration_knowledgeArticleConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Maybe SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration :: Maybe SalesforceKnowledgeArticleConfiguration
$sel:knowledgeArticleConfiguration:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration} -> Maybe SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Maybe SalesforceKnowledgeArticleConfiguration
a -> SalesforceConfiguration
s {$sel:knowledgeArticleConfiguration:SalesforceConfiguration' :: Maybe SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration = Maybe SalesforceKnowledgeArticleConfiguration
a} :: SalesforceConfiguration)

-- | Configuration information for processing attachments to Salesforce
-- standard objects.
salesforceConfiguration_standardObjectAttachmentConfiguration :: Lens.Lens' SalesforceConfiguration (Prelude.Maybe SalesforceStandardObjectAttachmentConfiguration)
salesforceConfiguration_standardObjectAttachmentConfiguration :: Lens'
  SalesforceConfiguration
  (Maybe SalesforceStandardObjectAttachmentConfiguration)
salesforceConfiguration_standardObjectAttachmentConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Maybe SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration :: Maybe SalesforceStandardObjectAttachmentConfiguration
$sel:standardObjectAttachmentConfiguration:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration} -> Maybe SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Maybe SalesforceStandardObjectAttachmentConfiguration
a -> SalesforceConfiguration
s {$sel:standardObjectAttachmentConfiguration:SalesforceConfiguration' :: Maybe SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration = Maybe SalesforceStandardObjectAttachmentConfiguration
a} :: SalesforceConfiguration)

-- | Configuration of the Salesforce standard objects that Amazon Kendra
-- indexes.
salesforceConfiguration_standardObjectConfigurations :: Lens.Lens' SalesforceConfiguration (Prelude.Maybe (Prelude.NonEmpty SalesforceStandardObjectConfiguration))
salesforceConfiguration_standardObjectConfigurations :: Lens'
  SalesforceConfiguration
  (Maybe (NonEmpty SalesforceStandardObjectConfiguration))
salesforceConfiguration_standardObjectConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectConfigurations :: Maybe (NonEmpty SalesforceStandardObjectConfiguration)
$sel:standardObjectConfigurations:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectConfigurations} -> Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectConfigurations) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Maybe (NonEmpty SalesforceStandardObjectConfiguration)
a -> SalesforceConfiguration
s {$sel:standardObjectConfigurations:SalesforceConfiguration' :: Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectConfigurations = Maybe (NonEmpty SalesforceStandardObjectConfiguration)
a} :: SalesforceConfiguration) 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 instance URL for the Salesforce site that you want to index.
salesforceConfiguration_serverUrl :: Lens.Lens' SalesforceConfiguration Prelude.Text
salesforceConfiguration_serverUrl :: Lens' SalesforceConfiguration Text
salesforceConfiguration_serverUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Text
serverUrl :: Text
$sel:serverUrl:SalesforceConfiguration' :: SalesforceConfiguration -> Text
serverUrl} -> Text
serverUrl) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Text
a -> SalesforceConfiguration
s {$sel:serverUrl:SalesforceConfiguration' :: Text
serverUrl = Text
a} :: SalesforceConfiguration)

-- | The Amazon Resource Name (ARN) of an Secrets Managersecret that contains
-- the key\/value pairs required to connect to your Salesforce instance.
-- The secret must contain a JSON structure with the following keys:
--
-- -   authenticationUrl - The OAUTH endpoint that Amazon Kendra connects
--     to get an OAUTH token.
--
-- -   consumerKey - The application public key generated when you created
--     your Salesforce application.
--
-- -   consumerSecret - The application private key generated when you
--     created your Salesforce application.
--
-- -   password - The password associated with the user logging in to the
--     Salesforce instance.
--
-- -   securityToken - The token associated with the user account logging
--     in to the Salesforce instance.
--
-- -   username - The user name of the user logging in to the Salesforce
--     instance.
salesforceConfiguration_secretArn :: Lens.Lens' SalesforceConfiguration Prelude.Text
salesforceConfiguration_secretArn :: Lens' SalesforceConfiguration Text
salesforceConfiguration_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceConfiguration' {Text
secretArn :: Text
$sel:secretArn:SalesforceConfiguration' :: SalesforceConfiguration -> Text
secretArn} -> Text
secretArn) (\s :: SalesforceConfiguration
s@SalesforceConfiguration' {} Text
a -> SalesforceConfiguration
s {$sel:secretArn:SalesforceConfiguration' :: Text
secretArn = Text
a} :: SalesforceConfiguration)

instance Data.FromJSON SalesforceConfiguration where
  parseJSON :: Value -> Parser SalesforceConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SalesforceConfiguration"
      ( \Object
x ->
          Maybe SalesforceChatterFeedConfiguration
-> Maybe Bool
-> Maybe [Text]
-> Maybe [Text]
-> Maybe SalesforceKnowledgeArticleConfiguration
-> Maybe SalesforceStandardObjectAttachmentConfiguration
-> Maybe (NonEmpty SalesforceStandardObjectConfiguration)
-> Text
-> Text
-> SalesforceConfiguration
SalesforceConfiguration'
            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
"ChatterFeedConfiguration")
            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
"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
"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
"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 (Maybe a)
Data..:? Key
"KnowledgeArticleConfiguration")
            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
"StandardObjectAttachmentConfiguration")
            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
"StandardObjectConfigurations")
            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
"ServerUrl")
            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")
      )

instance Prelude.Hashable SalesforceConfiguration where
  hashWithSalt :: Int -> SalesforceConfiguration -> Int
hashWithSalt Int
_salt SalesforceConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty SalesforceStandardObjectConfiguration)
Maybe SalesforceChatterFeedConfiguration
Maybe SalesforceKnowledgeArticleConfiguration
Maybe SalesforceStandardObjectAttachmentConfiguration
Text
secretArn :: Text
serverUrl :: Text
standardObjectConfigurations :: Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectAttachmentConfiguration :: Maybe SalesforceStandardObjectAttachmentConfiguration
knowledgeArticleConfiguration :: Maybe SalesforceKnowledgeArticleConfiguration
includeAttachmentFilePatterns :: Maybe [Text]
excludeAttachmentFilePatterns :: Maybe [Text]
crawlAttachments :: Maybe Bool
chatterFeedConfiguration :: Maybe SalesforceChatterFeedConfiguration
$sel:secretArn:SalesforceConfiguration' :: SalesforceConfiguration -> Text
$sel:serverUrl:SalesforceConfiguration' :: SalesforceConfiguration -> Text
$sel:standardObjectConfigurations:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe (NonEmpty SalesforceStandardObjectConfiguration)
$sel:standardObjectAttachmentConfiguration:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe SalesforceStandardObjectAttachmentConfiguration
$sel:knowledgeArticleConfiguration:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe SalesforceKnowledgeArticleConfiguration
$sel:includeAttachmentFilePatterns:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe [Text]
$sel:excludeAttachmentFilePatterns:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe [Text]
$sel:crawlAttachments:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe Bool
$sel:chatterFeedConfiguration:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe SalesforceChatterFeedConfiguration
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SalesforceChatterFeedConfiguration
chatterFeedConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
crawlAttachments
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
excludeAttachmentFilePatterns
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
includeAttachmentFilePatterns
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectConfigurations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serverUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
secretArn

instance Prelude.NFData SalesforceConfiguration where
  rnf :: SalesforceConfiguration -> ()
rnf SalesforceConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty SalesforceStandardObjectConfiguration)
Maybe SalesforceChatterFeedConfiguration
Maybe SalesforceKnowledgeArticleConfiguration
Maybe SalesforceStandardObjectAttachmentConfiguration
Text
secretArn :: Text
serverUrl :: Text
standardObjectConfigurations :: Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectAttachmentConfiguration :: Maybe SalesforceStandardObjectAttachmentConfiguration
knowledgeArticleConfiguration :: Maybe SalesforceKnowledgeArticleConfiguration
includeAttachmentFilePatterns :: Maybe [Text]
excludeAttachmentFilePatterns :: Maybe [Text]
crawlAttachments :: Maybe Bool
chatterFeedConfiguration :: Maybe SalesforceChatterFeedConfiguration
$sel:secretArn:SalesforceConfiguration' :: SalesforceConfiguration -> Text
$sel:serverUrl:SalesforceConfiguration' :: SalesforceConfiguration -> Text
$sel:standardObjectConfigurations:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe (NonEmpty SalesforceStandardObjectConfiguration)
$sel:standardObjectAttachmentConfiguration:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe SalesforceStandardObjectAttachmentConfiguration
$sel:knowledgeArticleConfiguration:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe SalesforceKnowledgeArticleConfiguration
$sel:includeAttachmentFilePatterns:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe [Text]
$sel:excludeAttachmentFilePatterns:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe [Text]
$sel:crawlAttachments:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe Bool
$sel:chatterFeedConfiguration:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe SalesforceChatterFeedConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SalesforceChatterFeedConfiguration
chatterFeedConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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]
excludeAttachmentFilePatterns
      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 Maybe SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectConfigurations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serverUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
secretArn

instance Data.ToJSON SalesforceConfiguration where
  toJSON :: SalesforceConfiguration -> Value
toJSON SalesforceConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty SalesforceStandardObjectConfiguration)
Maybe SalesforceChatterFeedConfiguration
Maybe SalesforceKnowledgeArticleConfiguration
Maybe SalesforceStandardObjectAttachmentConfiguration
Text
secretArn :: Text
serverUrl :: Text
standardObjectConfigurations :: Maybe (NonEmpty SalesforceStandardObjectConfiguration)
standardObjectAttachmentConfiguration :: Maybe SalesforceStandardObjectAttachmentConfiguration
knowledgeArticleConfiguration :: Maybe SalesforceKnowledgeArticleConfiguration
includeAttachmentFilePatterns :: Maybe [Text]
excludeAttachmentFilePatterns :: Maybe [Text]
crawlAttachments :: Maybe Bool
chatterFeedConfiguration :: Maybe SalesforceChatterFeedConfiguration
$sel:secretArn:SalesforceConfiguration' :: SalesforceConfiguration -> Text
$sel:serverUrl:SalesforceConfiguration' :: SalesforceConfiguration -> Text
$sel:standardObjectConfigurations:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe (NonEmpty SalesforceStandardObjectConfiguration)
$sel:standardObjectAttachmentConfiguration:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe SalesforceStandardObjectAttachmentConfiguration
$sel:knowledgeArticleConfiguration:SalesforceConfiguration' :: SalesforceConfiguration
-> Maybe SalesforceKnowledgeArticleConfiguration
$sel:includeAttachmentFilePatterns:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe [Text]
$sel:excludeAttachmentFilePatterns:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe [Text]
$sel:crawlAttachments:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe Bool
$sel:chatterFeedConfiguration:SalesforceConfiguration' :: SalesforceConfiguration -> Maybe SalesforceChatterFeedConfiguration
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ChatterFeedConfiguration" 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 SalesforceChatterFeedConfiguration
chatterFeedConfiguration,
            (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
"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
"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,
            (Key
"KnowledgeArticleConfiguration" 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 SalesforceKnowledgeArticleConfiguration
knowledgeArticleConfiguration,
            (Key
"StandardObjectAttachmentConfiguration" 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 SalesforceStandardObjectAttachmentConfiguration
standardObjectAttachmentConfiguration,
            (Key
"StandardObjectConfigurations" 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 SalesforceStandardObjectConfiguration)
standardObjectConfigurations,
            forall a. a -> Maybe a
Prelude.Just (Key
"ServerUrl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serverUrl),
            forall a. a -> Maybe a
Prelude.Just (Key
"SecretArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secretArn)
          ]
      )