{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Wisdom.Types
-- 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.Wisdom.Types
  ( -- * Service Configuration
    defaultService,

    -- * Errors
    _AccessDeniedException,
    _ConflictException,
    _PreconditionFailedException,
    _ResourceNotFoundException,
    _ServiceQuotaExceededException,
    _TooManyTagsException,
    _ValidationException,

    -- * AssistantStatus
    AssistantStatus (..),

    -- * AssistantType
    AssistantType (..),

    -- * AssociationType
    AssociationType (..),

    -- * ContentStatus
    ContentStatus (..),

    -- * FilterField
    FilterField (..),

    -- * FilterOperator
    FilterOperator (..),

    -- * KnowledgeBaseStatus
    KnowledgeBaseStatus (..),

    -- * KnowledgeBaseType
    KnowledgeBaseType (..),

    -- * RecommendationSourceType
    RecommendationSourceType (..),

    -- * RecommendationTriggerType
    RecommendationTriggerType (..),

    -- * RecommendationType
    RecommendationType (..),

    -- * RelevanceLevel
    RelevanceLevel (..),

    -- * AppIntegrationsConfiguration
    AppIntegrationsConfiguration (..),
    newAppIntegrationsConfiguration,
    appIntegrationsConfiguration_appIntegrationArn,
    appIntegrationsConfiguration_objectFields,

    -- * AssistantAssociationData
    AssistantAssociationData (..),
    newAssistantAssociationData,
    assistantAssociationData_tags,
    assistantAssociationData_assistantArn,
    assistantAssociationData_assistantAssociationArn,
    assistantAssociationData_assistantAssociationId,
    assistantAssociationData_assistantId,
    assistantAssociationData_associationData,
    assistantAssociationData_associationType,

    -- * AssistantAssociationInputData
    AssistantAssociationInputData (..),
    newAssistantAssociationInputData,
    assistantAssociationInputData_knowledgeBaseId,

    -- * AssistantAssociationOutputData
    AssistantAssociationOutputData (..),
    newAssistantAssociationOutputData,
    assistantAssociationOutputData_knowledgeBaseAssociation,

    -- * AssistantAssociationSummary
    AssistantAssociationSummary (..),
    newAssistantAssociationSummary,
    assistantAssociationSummary_tags,
    assistantAssociationSummary_assistantArn,
    assistantAssociationSummary_assistantAssociationArn,
    assistantAssociationSummary_assistantAssociationId,
    assistantAssociationSummary_assistantId,
    assistantAssociationSummary_associationData,
    assistantAssociationSummary_associationType,

    -- * AssistantData
    AssistantData (..),
    newAssistantData,
    assistantData_description,
    assistantData_serverSideEncryptionConfiguration,
    assistantData_tags,
    assistantData_assistantArn,
    assistantData_assistantId,
    assistantData_name,
    assistantData_status,
    assistantData_type,

    -- * AssistantSummary
    AssistantSummary (..),
    newAssistantSummary,
    assistantSummary_description,
    assistantSummary_serverSideEncryptionConfiguration,
    assistantSummary_tags,
    assistantSummary_assistantArn,
    assistantSummary_assistantId,
    assistantSummary_name,
    assistantSummary_status,
    assistantSummary_type,

    -- * ContentData
    ContentData (..),
    newContentData,
    contentData_linkOutUri,
    contentData_tags,
    contentData_contentArn,
    contentData_contentId,
    contentData_contentType,
    contentData_knowledgeBaseArn,
    contentData_knowledgeBaseId,
    contentData_metadata,
    contentData_name,
    contentData_revisionId,
    contentData_status,
    contentData_title,
    contentData_url,
    contentData_urlExpiry,

    -- * ContentReference
    ContentReference (..),
    newContentReference,
    contentReference_contentArn,
    contentReference_contentId,
    contentReference_knowledgeBaseArn,
    contentReference_knowledgeBaseId,

    -- * ContentSummary
    ContentSummary (..),
    newContentSummary,
    contentSummary_tags,
    contentSummary_contentArn,
    contentSummary_contentId,
    contentSummary_contentType,
    contentSummary_knowledgeBaseArn,
    contentSummary_knowledgeBaseId,
    contentSummary_metadata,
    contentSummary_name,
    contentSummary_revisionId,
    contentSummary_status,
    contentSummary_title,

    -- * Document
    Document (..),
    newDocument,
    document_excerpt,
    document_title,
    document_contentReference,

    -- * DocumentText
    DocumentText (..),
    newDocumentText,
    documentText_highlights,
    documentText_text,

    -- * Filter
    Filter (..),
    newFilter,
    filter_field,
    filter_operator,
    filter_value,

    -- * Highlight
    Highlight (..),
    newHighlight,
    highlight_beginOffsetInclusive,
    highlight_endOffsetExclusive,

    -- * KnowledgeBaseAssociationData
    KnowledgeBaseAssociationData (..),
    newKnowledgeBaseAssociationData,
    knowledgeBaseAssociationData_knowledgeBaseArn,
    knowledgeBaseAssociationData_knowledgeBaseId,

    -- * KnowledgeBaseData
    KnowledgeBaseData (..),
    newKnowledgeBaseData,
    knowledgeBaseData_description,
    knowledgeBaseData_lastContentModificationTime,
    knowledgeBaseData_renderingConfiguration,
    knowledgeBaseData_serverSideEncryptionConfiguration,
    knowledgeBaseData_sourceConfiguration,
    knowledgeBaseData_tags,
    knowledgeBaseData_knowledgeBaseArn,
    knowledgeBaseData_knowledgeBaseId,
    knowledgeBaseData_knowledgeBaseType,
    knowledgeBaseData_name,
    knowledgeBaseData_status,

    -- * KnowledgeBaseSummary
    KnowledgeBaseSummary (..),
    newKnowledgeBaseSummary,
    knowledgeBaseSummary_description,
    knowledgeBaseSummary_renderingConfiguration,
    knowledgeBaseSummary_serverSideEncryptionConfiguration,
    knowledgeBaseSummary_sourceConfiguration,
    knowledgeBaseSummary_tags,
    knowledgeBaseSummary_knowledgeBaseArn,
    knowledgeBaseSummary_knowledgeBaseId,
    knowledgeBaseSummary_knowledgeBaseType,
    knowledgeBaseSummary_name,
    knowledgeBaseSummary_status,

    -- * NotifyRecommendationsReceivedError
    NotifyRecommendationsReceivedError (..),
    newNotifyRecommendationsReceivedError,
    notifyRecommendationsReceivedError_message,
    notifyRecommendationsReceivedError_recommendationId,

    -- * QueryRecommendationTriggerData
    QueryRecommendationTriggerData (..),
    newQueryRecommendationTriggerData,
    queryRecommendationTriggerData_text,

    -- * RecommendationData
    RecommendationData (..),
    newRecommendationData,
    recommendationData_relevanceLevel,
    recommendationData_relevanceScore,
    recommendationData_type,
    recommendationData_document,
    recommendationData_recommendationId,

    -- * RecommendationTrigger
    RecommendationTrigger (..),
    newRecommendationTrigger,
    recommendationTrigger_data,
    recommendationTrigger_id,
    recommendationTrigger_recommendationIds,
    recommendationTrigger_source,
    recommendationTrigger_type,

    -- * RecommendationTriggerData
    RecommendationTriggerData (..),
    newRecommendationTriggerData,
    recommendationTriggerData_query,

    -- * RenderingConfiguration
    RenderingConfiguration (..),
    newRenderingConfiguration,
    renderingConfiguration_templateUri,

    -- * ResultData
    ResultData (..),
    newResultData,
    resultData_relevanceScore,
    resultData_document,
    resultData_resultId,

    -- * SearchExpression
    SearchExpression (..),
    newSearchExpression,
    searchExpression_filters,

    -- * ServerSideEncryptionConfiguration
    ServerSideEncryptionConfiguration (..),
    newServerSideEncryptionConfiguration,
    serverSideEncryptionConfiguration_kmsKeyId,

    -- * SessionData
    SessionData (..),
    newSessionData,
    sessionData_description,
    sessionData_tags,
    sessionData_name,
    sessionData_sessionArn,
    sessionData_sessionId,

    -- * SessionSummary
    SessionSummary (..),
    newSessionSummary,
    sessionSummary_assistantArn,
    sessionSummary_assistantId,
    sessionSummary_sessionArn,
    sessionSummary_sessionId,

    -- * SourceConfiguration
    SourceConfiguration (..),
    newSourceConfiguration,
    sourceConfiguration_appIntegrations,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Sign.V4 as Sign
import Amazonka.Wisdom.Types.AppIntegrationsConfiguration
import Amazonka.Wisdom.Types.AssistantAssociationData
import Amazonka.Wisdom.Types.AssistantAssociationInputData
import Amazonka.Wisdom.Types.AssistantAssociationOutputData
import Amazonka.Wisdom.Types.AssistantAssociationSummary
import Amazonka.Wisdom.Types.AssistantData
import Amazonka.Wisdom.Types.AssistantStatus
import Amazonka.Wisdom.Types.AssistantSummary
import Amazonka.Wisdom.Types.AssistantType
import Amazonka.Wisdom.Types.AssociationType
import Amazonka.Wisdom.Types.ContentData
import Amazonka.Wisdom.Types.ContentReference
import Amazonka.Wisdom.Types.ContentStatus
import Amazonka.Wisdom.Types.ContentSummary
import Amazonka.Wisdom.Types.Document
import Amazonka.Wisdom.Types.DocumentText
import Amazonka.Wisdom.Types.Filter
import Amazonka.Wisdom.Types.FilterField
import Amazonka.Wisdom.Types.FilterOperator
import Amazonka.Wisdom.Types.Highlight
import Amazonka.Wisdom.Types.KnowledgeBaseAssociationData
import Amazonka.Wisdom.Types.KnowledgeBaseData
import Amazonka.Wisdom.Types.KnowledgeBaseStatus
import Amazonka.Wisdom.Types.KnowledgeBaseSummary
import Amazonka.Wisdom.Types.KnowledgeBaseType
import Amazonka.Wisdom.Types.NotifyRecommendationsReceivedError
import Amazonka.Wisdom.Types.QueryRecommendationTriggerData
import Amazonka.Wisdom.Types.RecommendationData
import Amazonka.Wisdom.Types.RecommendationSourceType
import Amazonka.Wisdom.Types.RecommendationTrigger
import Amazonka.Wisdom.Types.RecommendationTriggerData
import Amazonka.Wisdom.Types.RecommendationTriggerType
import Amazonka.Wisdom.Types.RecommendationType
import Amazonka.Wisdom.Types.RelevanceLevel
import Amazonka.Wisdom.Types.RenderingConfiguration
import Amazonka.Wisdom.Types.ResultData
import Amazonka.Wisdom.Types.SearchExpression
import Amazonka.Wisdom.Types.ServerSideEncryptionConfiguration
import Amazonka.Wisdom.Types.SessionData
import Amazonka.Wisdom.Types.SessionSummary
import Amazonka.Wisdom.Types.SourceConfiguration

-- | API version @2020-10-19@ of the Amazon Connect Wisdom Service SDK configuration.
defaultService :: Core.Service
defaultService :: Service
defaultService =
  Core.Service
    { $sel:abbrev:Service :: Abbrev
Core.abbrev = Abbrev
"Wisdom",
      $sel:signer:Service :: Signer
Core.signer = Signer
Sign.v4,
      $sel:endpointPrefix:Service :: ByteString
Core.endpointPrefix = ByteString
"wisdom",
      $sel:signingName:Service :: ByteString
Core.signingName = ByteString
"wisdom",
      $sel:version:Service :: ByteString
Core.version = ByteString
"2020-10-19",
      $sel:s3AddressingStyle:Service :: S3AddressingStyle
Core.s3AddressingStyle = S3AddressingStyle
Core.S3AddressingStyleAuto,
      $sel:endpoint:Service :: Region -> Endpoint
Core.endpoint = Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
      $sel:timeout:Service :: Maybe Seconds
Core.timeout = forall a. a -> Maybe a
Prelude.Just Seconds
70,
      $sel:check:Service :: Status -> Bool
Core.check = Status -> Bool
Core.statusSuccess,
      $sel:error:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core.error = Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"Wisdom",
      $sel:retry:Service :: Retry
Core.retry = Retry
retry
    }
  where
    retry :: Retry
retry =
      Core.Exponential
        { $sel:base:Exponential :: Double
Core.base = Double
5.0e-2,
          $sel:growth:Exponential :: Int
Core.growth = Int
2,
          $sel:attempts:Exponential :: Int
Core.attempts = Int
5,
          $sel:check:Exponential :: ServiceError -> Maybe Text
Core.check = forall {a}. IsString a => ServiceError -> Maybe a
check
        }
    check :: ServiceError -> Maybe a
check ServiceError
e
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"throttling"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
              ErrorCode
"ProvisionedThroughputExceededException"
              forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
      | forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
          forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
      | Bool
Prelude.otherwise = forall a. Maybe a
Prelude.Nothing

-- | You do not have sufficient access to perform this action.
_AccessDeniedException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_AccessDeniedException :: forall a. AsError a => Fold a ServiceError
_AccessDeniedException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"AccessDeniedException"
    forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
403

-- | The request could not be processed because of conflict in the current
-- state of the resource. For example, if you\'re using a @Create@ API
-- (such as @CreateAssistant@) that accepts name, a conflicting resource
-- (usually with the same name) is being created or mutated.
_ConflictException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ConflictException :: forall a. AsError a => Fold a ServiceError
_ConflictException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"ConflictException"
    forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
409

-- | The provided @revisionId@ does not match, indicating the content has
-- been modified since it was last read.
_PreconditionFailedException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_PreconditionFailedException :: forall a. AsError a => Fold a ServiceError
_PreconditionFailedException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"PreconditionFailedException"
    forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
412

-- | The specified resource does not exist.
_ResourceNotFoundException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ResourceNotFoundException :: forall a. AsError a => Fold a ServiceError
_ResourceNotFoundException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"ResourceNotFoundException"
    forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
404

-- | You\'ve exceeded your service quota. To perform the requested action,
-- remove some of the relevant resources, or use service quotas to request
-- a service quota increase.
_ServiceQuotaExceededException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ServiceQuotaExceededException :: forall a. AsError a => Fold a ServiceError
_ServiceQuotaExceededException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"ServiceQuotaExceededException"
    forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
402

-- | Amazon Connect Wisdom throws this exception if you have too many tags in
-- your tag set.
_TooManyTagsException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_TooManyTagsException :: forall a. AsError a => Fold a ServiceError
_TooManyTagsException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"TooManyTagsException"
    forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400

-- | The input fails to satisfy the constraints specified by a service.
_ValidationException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ValidationException :: forall a. AsError a => Fold a ServiceError
_ValidationException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"ValidationException"
    forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400