{-# 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.VoiceId.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.VoiceId.Types
  ( -- * Service Configuration
    defaultService,

    -- * Errors
    _AccessDeniedException,
    _ConflictException,
    _InternalServerException,
    _ResourceNotFoundException,
    _ServiceQuotaExceededException,
    _ThrottlingException,
    _ValidationException,

    -- * AuthenticationDecision
    AuthenticationDecision (..),

    -- * DomainStatus
    DomainStatus (..),

    -- * DuplicateRegistrationAction
    DuplicateRegistrationAction (..),

    -- * ExistingEnrollmentAction
    ExistingEnrollmentAction (..),

    -- * FraudDetectionAction
    FraudDetectionAction (..),

    -- * FraudDetectionDecision
    FraudDetectionDecision (..),

    -- * FraudDetectionReason
    FraudDetectionReason (..),

    -- * FraudsterRegistrationJobStatus
    FraudsterRegistrationJobStatus (..),

    -- * ServerSideEncryptionUpdateStatus
    ServerSideEncryptionUpdateStatus (..),

    -- * SpeakerEnrollmentJobStatus
    SpeakerEnrollmentJobStatus (..),

    -- * SpeakerStatus
    SpeakerStatus (..),

    -- * StreamingStatus
    StreamingStatus (..),

    -- * AuthenticationConfiguration
    AuthenticationConfiguration (..),
    newAuthenticationConfiguration,
    authenticationConfiguration_acceptanceThreshold,

    -- * AuthenticationResult
    AuthenticationResult (..),
    newAuthenticationResult,
    authenticationResult_audioAggregationEndedAt,
    authenticationResult_audioAggregationStartedAt,
    authenticationResult_authenticationResultId,
    authenticationResult_configuration,
    authenticationResult_customerSpeakerId,
    authenticationResult_decision,
    authenticationResult_generatedSpeakerId,
    authenticationResult_score,

    -- * Domain
    Domain (..),
    newDomain,
    domain_arn,
    domain_createdAt,
    domain_description,
    domain_domainId,
    domain_domainStatus,
    domain_name,
    domain_serverSideEncryptionConfiguration,
    domain_serverSideEncryptionUpdateDetails,
    domain_updatedAt,

    -- * DomainSummary
    DomainSummary (..),
    newDomainSummary,
    domainSummary_arn,
    domainSummary_createdAt,
    domainSummary_description,
    domainSummary_domainId,
    domainSummary_domainStatus,
    domainSummary_name,
    domainSummary_serverSideEncryptionConfiguration,
    domainSummary_serverSideEncryptionUpdateDetails,
    domainSummary_updatedAt,

    -- * EnrollmentConfig
    EnrollmentConfig (..),
    newEnrollmentConfig,
    enrollmentConfig_existingEnrollmentAction,
    enrollmentConfig_fraudDetectionConfig,

    -- * EnrollmentJobFraudDetectionConfig
    EnrollmentJobFraudDetectionConfig (..),
    newEnrollmentJobFraudDetectionConfig,
    enrollmentJobFraudDetectionConfig_fraudDetectionAction,
    enrollmentJobFraudDetectionConfig_riskThreshold,

    -- * FailureDetails
    FailureDetails (..),
    newFailureDetails,
    failureDetails_message,
    failureDetails_statusCode,

    -- * FraudDetectionConfiguration
    FraudDetectionConfiguration (..),
    newFraudDetectionConfiguration,
    fraudDetectionConfiguration_riskThreshold,

    -- * FraudDetectionResult
    FraudDetectionResult (..),
    newFraudDetectionResult,
    fraudDetectionResult_audioAggregationEndedAt,
    fraudDetectionResult_audioAggregationStartedAt,
    fraudDetectionResult_configuration,
    fraudDetectionResult_decision,
    fraudDetectionResult_fraudDetectionResultId,
    fraudDetectionResult_reasons,
    fraudDetectionResult_riskDetails,

    -- * FraudRiskDetails
    FraudRiskDetails (..),
    newFraudRiskDetails,
    fraudRiskDetails_knownFraudsterRisk,
    fraudRiskDetails_voiceSpoofingRisk,

    -- * Fraudster
    Fraudster (..),
    newFraudster,
    fraudster_createdAt,
    fraudster_domainId,
    fraudster_generatedFraudsterId,

    -- * FraudsterRegistrationJob
    FraudsterRegistrationJob (..),
    newFraudsterRegistrationJob,
    fraudsterRegistrationJob_createdAt,
    fraudsterRegistrationJob_dataAccessRoleArn,
    fraudsterRegistrationJob_domainId,
    fraudsterRegistrationJob_endedAt,
    fraudsterRegistrationJob_failureDetails,
    fraudsterRegistrationJob_inputDataConfig,
    fraudsterRegistrationJob_jobId,
    fraudsterRegistrationJob_jobName,
    fraudsterRegistrationJob_jobProgress,
    fraudsterRegistrationJob_jobStatus,
    fraudsterRegistrationJob_outputDataConfig,
    fraudsterRegistrationJob_registrationConfig,

    -- * FraudsterRegistrationJobSummary
    FraudsterRegistrationJobSummary (..),
    newFraudsterRegistrationJobSummary,
    fraudsterRegistrationJobSummary_createdAt,
    fraudsterRegistrationJobSummary_domainId,
    fraudsterRegistrationJobSummary_endedAt,
    fraudsterRegistrationJobSummary_failureDetails,
    fraudsterRegistrationJobSummary_jobId,
    fraudsterRegistrationJobSummary_jobName,
    fraudsterRegistrationJobSummary_jobProgress,
    fraudsterRegistrationJobSummary_jobStatus,

    -- * InputDataConfig
    InputDataConfig (..),
    newInputDataConfig,
    inputDataConfig_s3Uri,

    -- * JobProgress
    JobProgress (..),
    newJobProgress,
    jobProgress_percentComplete,

    -- * KnownFraudsterRisk
    KnownFraudsterRisk (..),
    newKnownFraudsterRisk,
    knownFraudsterRisk_generatedFraudsterId,
    knownFraudsterRisk_riskScore,

    -- * OutputDataConfig
    OutputDataConfig (..),
    newOutputDataConfig,
    outputDataConfig_kmsKeyId,
    outputDataConfig_s3Uri,

    -- * RegistrationConfig
    RegistrationConfig (..),
    newRegistrationConfig,
    registrationConfig_duplicateRegistrationAction,
    registrationConfig_fraudsterSimilarityThreshold,

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

    -- * ServerSideEncryptionUpdateDetails
    ServerSideEncryptionUpdateDetails (..),
    newServerSideEncryptionUpdateDetails,
    serverSideEncryptionUpdateDetails_message,
    serverSideEncryptionUpdateDetails_oldKmsKeyId,
    serverSideEncryptionUpdateDetails_updateStatus,

    -- * Speaker
    Speaker (..),
    newSpeaker,
    speaker_createdAt,
    speaker_customerSpeakerId,
    speaker_domainId,
    speaker_generatedSpeakerId,
    speaker_lastAccessedAt,
    speaker_status,
    speaker_updatedAt,

    -- * SpeakerEnrollmentJob
    SpeakerEnrollmentJob (..),
    newSpeakerEnrollmentJob,
    speakerEnrollmentJob_createdAt,
    speakerEnrollmentJob_dataAccessRoleArn,
    speakerEnrollmentJob_domainId,
    speakerEnrollmentJob_endedAt,
    speakerEnrollmentJob_enrollmentConfig,
    speakerEnrollmentJob_failureDetails,
    speakerEnrollmentJob_inputDataConfig,
    speakerEnrollmentJob_jobId,
    speakerEnrollmentJob_jobName,
    speakerEnrollmentJob_jobProgress,
    speakerEnrollmentJob_jobStatus,
    speakerEnrollmentJob_outputDataConfig,

    -- * SpeakerEnrollmentJobSummary
    SpeakerEnrollmentJobSummary (..),
    newSpeakerEnrollmentJobSummary,
    speakerEnrollmentJobSummary_createdAt,
    speakerEnrollmentJobSummary_domainId,
    speakerEnrollmentJobSummary_endedAt,
    speakerEnrollmentJobSummary_failureDetails,
    speakerEnrollmentJobSummary_jobId,
    speakerEnrollmentJobSummary_jobName,
    speakerEnrollmentJobSummary_jobProgress,
    speakerEnrollmentJobSummary_jobStatus,

    -- * SpeakerSummary
    SpeakerSummary (..),
    newSpeakerSummary,
    speakerSummary_createdAt,
    speakerSummary_customerSpeakerId,
    speakerSummary_domainId,
    speakerSummary_generatedSpeakerId,
    speakerSummary_lastAccessedAt,
    speakerSummary_status,
    speakerSummary_updatedAt,

    -- * Tag
    Tag (..),
    newTag,
    tag_key,
    tag_value,

    -- * VoiceSpoofingRisk
    VoiceSpoofingRisk (..),
    newVoiceSpoofingRisk,
    voiceSpoofingRisk_riskScore,
  )
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.VoiceId.Types.AuthenticationConfiguration
import Amazonka.VoiceId.Types.AuthenticationDecision
import Amazonka.VoiceId.Types.AuthenticationResult
import Amazonka.VoiceId.Types.Domain
import Amazonka.VoiceId.Types.DomainStatus
import Amazonka.VoiceId.Types.DomainSummary
import Amazonka.VoiceId.Types.DuplicateRegistrationAction
import Amazonka.VoiceId.Types.EnrollmentConfig
import Amazonka.VoiceId.Types.EnrollmentJobFraudDetectionConfig
import Amazonka.VoiceId.Types.ExistingEnrollmentAction
import Amazonka.VoiceId.Types.FailureDetails
import Amazonka.VoiceId.Types.FraudDetectionAction
import Amazonka.VoiceId.Types.FraudDetectionConfiguration
import Amazonka.VoiceId.Types.FraudDetectionDecision
import Amazonka.VoiceId.Types.FraudDetectionReason
import Amazonka.VoiceId.Types.FraudDetectionResult
import Amazonka.VoiceId.Types.FraudRiskDetails
import Amazonka.VoiceId.Types.Fraudster
import Amazonka.VoiceId.Types.FraudsterRegistrationJob
import Amazonka.VoiceId.Types.FraudsterRegistrationJobStatus
import Amazonka.VoiceId.Types.FraudsterRegistrationJobSummary
import Amazonka.VoiceId.Types.InputDataConfig
import Amazonka.VoiceId.Types.JobProgress
import Amazonka.VoiceId.Types.KnownFraudsterRisk
import Amazonka.VoiceId.Types.OutputDataConfig
import Amazonka.VoiceId.Types.RegistrationConfig
import Amazonka.VoiceId.Types.ServerSideEncryptionConfiguration
import Amazonka.VoiceId.Types.ServerSideEncryptionUpdateDetails
import Amazonka.VoiceId.Types.ServerSideEncryptionUpdateStatus
import Amazonka.VoiceId.Types.Speaker
import Amazonka.VoiceId.Types.SpeakerEnrollmentJob
import Amazonka.VoiceId.Types.SpeakerEnrollmentJobStatus
import Amazonka.VoiceId.Types.SpeakerEnrollmentJobSummary
import Amazonka.VoiceId.Types.SpeakerStatus
import Amazonka.VoiceId.Types.SpeakerSummary
import Amazonka.VoiceId.Types.StreamingStatus
import Amazonka.VoiceId.Types.Tag
import Amazonka.VoiceId.Types.VoiceSpoofingRisk

-- | API version @2021-09-27@ of the Amazon Voice ID SDK configuration.
defaultService :: Core.Service
defaultService :: Service
defaultService =
  Core.Service
    { $sel:abbrev:Service :: Abbrev
Core.abbrev = Abbrev
"VoiceId",
      $sel:signer:Service :: Signer
Core.signer = Signer
Sign.v4,
      $sel:endpointPrefix:Service :: ByteString
Core.endpointPrefix = ByteString
"voiceid",
      $sel:signingName:Service :: ByteString
Core.signingName = ByteString
"voiceid",
      $sel:version:Service :: ByteString
Core.version = ByteString
"2021-09-27",
      $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
"VoiceId",
      $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 permissions to perform this action. Check the
-- error message and try again.
_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"

-- | The request failed due to a conflict. Check the @ConflictType@ and error
-- message for more details.
_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"

-- | The request failed due to an unknown error on the server side.
_InternalServerException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_InternalServerException :: forall a. AsError a => Fold a ServiceError
_InternalServerException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"InternalServerException"

-- | The specified resource cannot be found. Check the @ResourceType@ and
-- error message for more details.
_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"

-- | The request exceeded the service quota. Refer to
-- <https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#voiceid-quotas Voice ID Service Quotas>
-- and try your request again.
_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"

-- | The request was denied due to request throttling. Please slow down your
-- request rate. Refer to
-- <https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html##voiceid-api-quotas Amazon Connect Voice ID Service API throttling quotas>
-- and try your request again.
_ThrottlingException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ThrottlingException :: forall a. AsError a => Fold a ServiceError
_ThrottlingException =
  forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"ThrottlingException"

-- | The request failed one or more validations; check the error message for
-- more details.
_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"