{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.VoiceId.Types
(
defaultService,
_ValidationException,
_AccessDeniedException,
_ConflictException,
_ServiceQuotaExceededException,
_ThrottlingException,
_InternalServerException,
_ResourceNotFoundException,
AuthenticationDecision (..),
DomainStatus (..),
DuplicateRegistrationAction (..),
ExistingEnrollmentAction (..),
FraudDetectionAction (..),
FraudDetectionDecision (..),
FraudDetectionReason (..),
FraudsterRegistrationJobStatus (..),
SpeakerEnrollmentJobStatus (..),
SpeakerStatus (..),
StreamingStatus (..),
AuthenticationConfiguration (..),
newAuthenticationConfiguration,
authenticationConfiguration_acceptanceThreshold,
AuthenticationResult (..),
newAuthenticationResult,
authenticationResult_customerSpeakerId,
authenticationResult_score,
authenticationResult_authenticationResultId,
authenticationResult_decision,
authenticationResult_configuration,
authenticationResult_audioAggregationStartedAt,
authenticationResult_generatedSpeakerId,
authenticationResult_audioAggregationEndedAt,
Domain (..),
newDomain,
domain_domainStatus,
domain_arn,
domain_createdAt,
domain_name,
domain_domainId,
domain_updatedAt,
domain_description,
domain_serverSideEncryptionConfiguration,
DomainSummary (..),
newDomainSummary,
domainSummary_domainStatus,
domainSummary_arn,
domainSummary_createdAt,
domainSummary_name,
domainSummary_domainId,
domainSummary_updatedAt,
domainSummary_description,
domainSummary_serverSideEncryptionConfiguration,
EnrollmentConfig (..),
newEnrollmentConfig,
enrollmentConfig_fraudDetectionConfig,
enrollmentConfig_existingEnrollmentAction,
EnrollmentJobFraudDetectionConfig (..),
newEnrollmentJobFraudDetectionConfig,
enrollmentJobFraudDetectionConfig_riskThreshold,
enrollmentJobFraudDetectionConfig_fraudDetectionAction,
FailureDetails (..),
newFailureDetails,
failureDetails_message,
failureDetails_statusCode,
FraudDetectionConfiguration (..),
newFraudDetectionConfiguration,
fraudDetectionConfiguration_riskThreshold,
FraudDetectionResult (..),
newFraudDetectionResult,
fraudDetectionResult_reasons,
fraudDetectionResult_riskDetails,
fraudDetectionResult_fraudDetectionResultId,
fraudDetectionResult_decision,
fraudDetectionResult_configuration,
fraudDetectionResult_audioAggregationStartedAt,
fraudDetectionResult_audioAggregationEndedAt,
FraudRiskDetails (..),
newFraudRiskDetails,
fraudRiskDetails_knownFraudsterRisk,
Fraudster (..),
newFraudster,
fraudster_createdAt,
fraudster_generatedFraudsterId,
fraudster_domainId,
FraudsterRegistrationJob (..),
newFraudsterRegistrationJob,
fraudsterRegistrationJob_failureDetails,
fraudsterRegistrationJob_jobId,
fraudsterRegistrationJob_createdAt,
fraudsterRegistrationJob_jobName,
fraudsterRegistrationJob_endedAt,
fraudsterRegistrationJob_inputDataConfig,
fraudsterRegistrationJob_jobProgress,
fraudsterRegistrationJob_outputDataConfig,
fraudsterRegistrationJob_dataAccessRoleArn,
fraudsterRegistrationJob_domainId,
fraudsterRegistrationJob_jobStatus,
fraudsterRegistrationJob_registrationConfig,
FraudsterRegistrationJobSummary (..),
newFraudsterRegistrationJobSummary,
fraudsterRegistrationJobSummary_failureDetails,
fraudsterRegistrationJobSummary_jobId,
fraudsterRegistrationJobSummary_createdAt,
fraudsterRegistrationJobSummary_jobName,
fraudsterRegistrationJobSummary_endedAt,
fraudsterRegistrationJobSummary_jobProgress,
fraudsterRegistrationJobSummary_domainId,
fraudsterRegistrationJobSummary_jobStatus,
InputDataConfig (..),
newInputDataConfig,
inputDataConfig_s3Uri,
JobProgress (..),
newJobProgress,
jobProgress_percentComplete,
KnownFraudsterRisk (..),
newKnownFraudsterRisk,
knownFraudsterRisk_generatedFraudsterId,
knownFraudsterRisk_riskScore,
OutputDataConfig (..),
newOutputDataConfig,
outputDataConfig_kmsKeyId,
outputDataConfig_s3Uri,
RegistrationConfig (..),
newRegistrationConfig,
registrationConfig_duplicateRegistrationAction,
registrationConfig_fraudsterSimilarityThreshold,
ServerSideEncryptionConfiguration (..),
newServerSideEncryptionConfiguration,
serverSideEncryptionConfiguration_kmsKeyId,
Speaker (..),
newSpeaker,
speaker_status,
speaker_customerSpeakerId,
speaker_createdAt,
speaker_domainId,
speaker_updatedAt,
speaker_generatedSpeakerId,
SpeakerEnrollmentJob (..),
newSpeakerEnrollmentJob,
speakerEnrollmentJob_failureDetails,
speakerEnrollmentJob_jobId,
speakerEnrollmentJob_createdAt,
speakerEnrollmentJob_jobName,
speakerEnrollmentJob_endedAt,
speakerEnrollmentJob_enrollmentConfig,
speakerEnrollmentJob_inputDataConfig,
speakerEnrollmentJob_jobProgress,
speakerEnrollmentJob_outputDataConfig,
speakerEnrollmentJob_dataAccessRoleArn,
speakerEnrollmentJob_domainId,
speakerEnrollmentJob_jobStatus,
SpeakerEnrollmentJobSummary (..),
newSpeakerEnrollmentJobSummary,
speakerEnrollmentJobSummary_failureDetails,
speakerEnrollmentJobSummary_jobId,
speakerEnrollmentJobSummary_createdAt,
speakerEnrollmentJobSummary_jobName,
speakerEnrollmentJobSummary_endedAt,
speakerEnrollmentJobSummary_jobProgress,
speakerEnrollmentJobSummary_domainId,
speakerEnrollmentJobSummary_jobStatus,
SpeakerSummary (..),
newSpeakerSummary,
speakerSummary_status,
speakerSummary_customerSpeakerId,
speakerSummary_createdAt,
speakerSummary_domainId,
speakerSummary_updatedAt,
speakerSummary_generatedSpeakerId,
Tag (..),
newTag,
tag_key,
tag_value,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens 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.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
defaultService :: Core.Service
defaultService :: Service
defaultService =
Service :: Abbrev
-> Signer
-> ByteString
-> ByteString
-> ByteString
-> (Region -> Endpoint)
-> Maybe Seconds
-> (Status -> Bool)
-> (Status -> [Header] -> ByteStringLazy -> Error)
-> Retry
-> Service
Core.Service
{ $sel:_serviceAbbrev:Service :: Abbrev
Core._serviceAbbrev = Abbrev
"VoiceId",
$sel:_serviceSigner:Service :: Signer
Core._serviceSigner = Signer
Sign.v4,
$sel:_serviceEndpointPrefix:Service :: ByteString
Core._serviceEndpointPrefix = ByteString
"voiceid",
$sel:_serviceSigningName:Service :: ByteString
Core._serviceSigningName = ByteString
"voiceid",
$sel:_serviceVersion:Service :: ByteString
Core._serviceVersion = ByteString
"2021-09-27",
$sel:_serviceEndpoint:Service :: Region -> Endpoint
Core._serviceEndpoint =
Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
$sel:_serviceTimeout:Service :: Maybe Seconds
Core._serviceTimeout = Seconds -> Maybe Seconds
forall a. a -> Maybe a
Prelude.Just Seconds
70,
$sel:_serviceCheck:Service :: Status -> Bool
Core._serviceCheck = Status -> Bool
Core.statusSuccess,
$sel:_serviceError:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core._serviceError = Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"VoiceId",
$sel:_serviceRetry:Service :: Retry
Core._serviceRetry = Retry
retry
}
where
retry :: Retry
retry =
Exponential :: Double -> Int -> Int -> (ServiceError -> Maybe Text) -> Retry
Core.Exponential
{ $sel:_retryBase:Exponential :: Double
Core._retryBase = Double
5.0e-2,
$sel:_retryGrowth:Exponential :: Int
Core._retryGrowth = Int
2,
$sel:_retryAttempts:Exponential :: Int
Core._retryAttempts = Int
5,
$sel:_retryCheck:Exponential :: ServiceError -> Maybe Text
Core._retryCheck = ServiceError -> Maybe Text
forall a. IsString a => ServiceError -> Maybe a
check
}
check :: ServiceError -> Maybe a
check ServiceError
e
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttling"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
ErrorCode
"ProvisionedThroughputExceededException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
| Bool
Prelude.otherwise = Maybe a
forall a. Maybe a
Prelude.Nothing
_ValidationException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ValidationException :: Getting (First ServiceError) a ServiceError
_ValidationException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ValidationException"
_AccessDeniedException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_AccessDeniedException :: Getting (First ServiceError) a ServiceError
_AccessDeniedException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"AccessDeniedException"
_ConflictException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ConflictException :: Getting (First ServiceError) a ServiceError
_ConflictException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ConflictException"
_ServiceQuotaExceededException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ServiceQuotaExceededException :: Getting (First ServiceError) a ServiceError
_ServiceQuotaExceededException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ServiceQuotaExceededException"
_ThrottlingException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ThrottlingException :: Getting (First ServiceError) a ServiceError
_ThrottlingException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ThrottlingException"
_InternalServerException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InternalServerException :: Getting (First ServiceError) a ServiceError
_InternalServerException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InternalServerException"
_ResourceNotFoundException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ResourceNotFoundException :: Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ResourceNotFoundException"