{-# 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 #-}
module Amazonka.VoiceId.Types.AuthenticationResult where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.VoiceId.Types.AuthenticationConfiguration
import Amazonka.VoiceId.Types.AuthenticationDecision
data AuthenticationResult = AuthenticationResult'
{
AuthenticationResult -> Maybe (Sensitive Text)
customerSpeakerId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
AuthenticationResult -> Maybe Natural
score :: Prelude.Maybe Prelude.Natural,
AuthenticationResult -> Maybe Text
authenticationResultId :: Prelude.Maybe Prelude.Text,
AuthenticationResult -> Maybe AuthenticationDecision
decision :: Prelude.Maybe AuthenticationDecision,
AuthenticationResult -> Maybe AuthenticationConfiguration
configuration :: Prelude.Maybe AuthenticationConfiguration,
AuthenticationResult -> Maybe POSIX
audioAggregationStartedAt :: Prelude.Maybe Core.POSIX,
AuthenticationResult -> Maybe Text
generatedSpeakerId :: Prelude.Maybe Prelude.Text,
AuthenticationResult -> Maybe POSIX
audioAggregationEndedAt :: Prelude.Maybe Core.POSIX
}
deriving (AuthenticationResult -> AuthenticationResult -> Bool
(AuthenticationResult -> AuthenticationResult -> Bool)
-> (AuthenticationResult -> AuthenticationResult -> Bool)
-> Eq AuthenticationResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthenticationResult -> AuthenticationResult -> Bool
$c/= :: AuthenticationResult -> AuthenticationResult -> Bool
== :: AuthenticationResult -> AuthenticationResult -> Bool
$c== :: AuthenticationResult -> AuthenticationResult -> Bool
Prelude.Eq, Int -> AuthenticationResult -> ShowS
[AuthenticationResult] -> ShowS
AuthenticationResult -> String
(Int -> AuthenticationResult -> ShowS)
-> (AuthenticationResult -> String)
-> ([AuthenticationResult] -> ShowS)
-> Show AuthenticationResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthenticationResult] -> ShowS
$cshowList :: [AuthenticationResult] -> ShowS
show :: AuthenticationResult -> String
$cshow :: AuthenticationResult -> String
showsPrec :: Int -> AuthenticationResult -> ShowS
$cshowsPrec :: Int -> AuthenticationResult -> ShowS
Prelude.Show, (forall x. AuthenticationResult -> Rep AuthenticationResult x)
-> (forall x. Rep AuthenticationResult x -> AuthenticationResult)
-> Generic AuthenticationResult
forall x. Rep AuthenticationResult x -> AuthenticationResult
forall x. AuthenticationResult -> Rep AuthenticationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuthenticationResult x -> AuthenticationResult
$cfrom :: forall x. AuthenticationResult -> Rep AuthenticationResult x
Prelude.Generic)
newAuthenticationResult ::
AuthenticationResult
newAuthenticationResult :: AuthenticationResult
newAuthenticationResult =
AuthenticationResult' :: Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Text
-> Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult
AuthenticationResult'
{ $sel:customerSpeakerId:AuthenticationResult' :: Maybe (Sensitive Text)
customerSpeakerId =
Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:score:AuthenticationResult' :: Maybe Natural
score = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:authenticationResultId:AuthenticationResult' :: Maybe Text
authenticationResultId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:decision:AuthenticationResult' :: Maybe AuthenticationDecision
decision = Maybe AuthenticationDecision
forall a. Maybe a
Prelude.Nothing,
$sel:configuration:AuthenticationResult' :: Maybe AuthenticationConfiguration
configuration = Maybe AuthenticationConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:audioAggregationStartedAt:AuthenticationResult' :: Maybe POSIX
audioAggregationStartedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:generatedSpeakerId:AuthenticationResult' :: Maybe Text
generatedSpeakerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:audioAggregationEndedAt:AuthenticationResult' :: Maybe POSIX
audioAggregationEndedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
authenticationResult_customerSpeakerId :: Lens.Lens' AuthenticationResult (Prelude.Maybe Prelude.Text)
authenticationResult_customerSpeakerId :: (Maybe Text -> f (Maybe Text))
-> AuthenticationResult -> f AuthenticationResult
authenticationResult_customerSpeakerId = (AuthenticationResult -> Maybe (Sensitive Text))
-> (AuthenticationResult
-> Maybe (Sensitive Text) -> AuthenticationResult)
-> Lens
AuthenticationResult
AuthenticationResult
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResult' {Maybe (Sensitive Text)
customerSpeakerId :: Maybe (Sensitive Text)
$sel:customerSpeakerId:AuthenticationResult' :: AuthenticationResult -> Maybe (Sensitive Text)
customerSpeakerId} -> Maybe (Sensitive Text)
customerSpeakerId) (\s :: AuthenticationResult
s@AuthenticationResult' {} Maybe (Sensitive Text)
a -> AuthenticationResult
s {$sel:customerSpeakerId:AuthenticationResult' :: Maybe (Sensitive Text)
customerSpeakerId = Maybe (Sensitive Text)
a} :: AuthenticationResult) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> AuthenticationResult -> f AuthenticationResult)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AuthenticationResult
-> f AuthenticationResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
authenticationResult_score :: Lens.Lens' AuthenticationResult (Prelude.Maybe Prelude.Natural)
authenticationResult_score :: (Maybe Natural -> f (Maybe Natural))
-> AuthenticationResult -> f AuthenticationResult
authenticationResult_score = (AuthenticationResult -> Maybe Natural)
-> (AuthenticationResult -> Maybe Natural -> AuthenticationResult)
-> Lens
AuthenticationResult
AuthenticationResult
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResult' {Maybe Natural
score :: Maybe Natural
$sel:score:AuthenticationResult' :: AuthenticationResult -> Maybe Natural
score} -> Maybe Natural
score) (\s :: AuthenticationResult
s@AuthenticationResult' {} Maybe Natural
a -> AuthenticationResult
s {$sel:score:AuthenticationResult' :: Maybe Natural
score = Maybe Natural
a} :: AuthenticationResult)
authenticationResult_authenticationResultId :: Lens.Lens' AuthenticationResult (Prelude.Maybe Prelude.Text)
authenticationResult_authenticationResultId :: (Maybe Text -> f (Maybe Text))
-> AuthenticationResult -> f AuthenticationResult
authenticationResult_authenticationResultId = (AuthenticationResult -> Maybe Text)
-> (AuthenticationResult -> Maybe Text -> AuthenticationResult)
-> Lens
AuthenticationResult AuthenticationResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResult' {Maybe Text
authenticationResultId :: Maybe Text
$sel:authenticationResultId:AuthenticationResult' :: AuthenticationResult -> Maybe Text
authenticationResultId} -> Maybe Text
authenticationResultId) (\s :: AuthenticationResult
s@AuthenticationResult' {} Maybe Text
a -> AuthenticationResult
s {$sel:authenticationResultId:AuthenticationResult' :: Maybe Text
authenticationResultId = Maybe Text
a} :: AuthenticationResult)
authenticationResult_decision :: Lens.Lens' AuthenticationResult (Prelude.Maybe AuthenticationDecision)
authenticationResult_decision :: (Maybe AuthenticationDecision -> f (Maybe AuthenticationDecision))
-> AuthenticationResult -> f AuthenticationResult
authenticationResult_decision = (AuthenticationResult -> Maybe AuthenticationDecision)
-> (AuthenticationResult
-> Maybe AuthenticationDecision -> AuthenticationResult)
-> Lens
AuthenticationResult
AuthenticationResult
(Maybe AuthenticationDecision)
(Maybe AuthenticationDecision)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResult' {Maybe AuthenticationDecision
decision :: Maybe AuthenticationDecision
$sel:decision:AuthenticationResult' :: AuthenticationResult -> Maybe AuthenticationDecision
decision} -> Maybe AuthenticationDecision
decision) (\s :: AuthenticationResult
s@AuthenticationResult' {} Maybe AuthenticationDecision
a -> AuthenticationResult
s {$sel:decision:AuthenticationResult' :: Maybe AuthenticationDecision
decision = Maybe AuthenticationDecision
a} :: AuthenticationResult)
authenticationResult_configuration :: Lens.Lens' AuthenticationResult (Prelude.Maybe AuthenticationConfiguration)
authenticationResult_configuration :: (Maybe AuthenticationConfiguration
-> f (Maybe AuthenticationConfiguration))
-> AuthenticationResult -> f AuthenticationResult
authenticationResult_configuration = (AuthenticationResult -> Maybe AuthenticationConfiguration)
-> (AuthenticationResult
-> Maybe AuthenticationConfiguration -> AuthenticationResult)
-> Lens
AuthenticationResult
AuthenticationResult
(Maybe AuthenticationConfiguration)
(Maybe AuthenticationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResult' {Maybe AuthenticationConfiguration
configuration :: Maybe AuthenticationConfiguration
$sel:configuration:AuthenticationResult' :: AuthenticationResult -> Maybe AuthenticationConfiguration
configuration} -> Maybe AuthenticationConfiguration
configuration) (\s :: AuthenticationResult
s@AuthenticationResult' {} Maybe AuthenticationConfiguration
a -> AuthenticationResult
s {$sel:configuration:AuthenticationResult' :: Maybe AuthenticationConfiguration
configuration = Maybe AuthenticationConfiguration
a} :: AuthenticationResult)
authenticationResult_audioAggregationStartedAt :: Lens.Lens' AuthenticationResult (Prelude.Maybe Prelude.UTCTime)
authenticationResult_audioAggregationStartedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AuthenticationResult -> f AuthenticationResult
authenticationResult_audioAggregationStartedAt = (AuthenticationResult -> Maybe POSIX)
-> (AuthenticationResult -> Maybe POSIX -> AuthenticationResult)
-> Lens
AuthenticationResult
AuthenticationResult
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResult' {Maybe POSIX
audioAggregationStartedAt :: Maybe POSIX
$sel:audioAggregationStartedAt:AuthenticationResult' :: AuthenticationResult -> Maybe POSIX
audioAggregationStartedAt} -> Maybe POSIX
audioAggregationStartedAt) (\s :: AuthenticationResult
s@AuthenticationResult' {} Maybe POSIX
a -> AuthenticationResult
s {$sel:audioAggregationStartedAt:AuthenticationResult' :: Maybe POSIX
audioAggregationStartedAt = Maybe POSIX
a} :: AuthenticationResult) ((Maybe POSIX -> f (Maybe POSIX))
-> AuthenticationResult -> f AuthenticationResult)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AuthenticationResult
-> f AuthenticationResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
authenticationResult_generatedSpeakerId :: Lens.Lens' AuthenticationResult (Prelude.Maybe Prelude.Text)
authenticationResult_generatedSpeakerId :: (Maybe Text -> f (Maybe Text))
-> AuthenticationResult -> f AuthenticationResult
authenticationResult_generatedSpeakerId = (AuthenticationResult -> Maybe Text)
-> (AuthenticationResult -> Maybe Text -> AuthenticationResult)
-> Lens
AuthenticationResult AuthenticationResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResult' {Maybe Text
generatedSpeakerId :: Maybe Text
$sel:generatedSpeakerId:AuthenticationResult' :: AuthenticationResult -> Maybe Text
generatedSpeakerId} -> Maybe Text
generatedSpeakerId) (\s :: AuthenticationResult
s@AuthenticationResult' {} Maybe Text
a -> AuthenticationResult
s {$sel:generatedSpeakerId:AuthenticationResult' :: Maybe Text
generatedSpeakerId = Maybe Text
a} :: AuthenticationResult)
authenticationResult_audioAggregationEndedAt :: Lens.Lens' AuthenticationResult (Prelude.Maybe Prelude.UTCTime)
authenticationResult_audioAggregationEndedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AuthenticationResult -> f AuthenticationResult
authenticationResult_audioAggregationEndedAt = (AuthenticationResult -> Maybe POSIX)
-> (AuthenticationResult -> Maybe POSIX -> AuthenticationResult)
-> Lens
AuthenticationResult
AuthenticationResult
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationResult' {Maybe POSIX
audioAggregationEndedAt :: Maybe POSIX
$sel:audioAggregationEndedAt:AuthenticationResult' :: AuthenticationResult -> Maybe POSIX
audioAggregationEndedAt} -> Maybe POSIX
audioAggregationEndedAt) (\s :: AuthenticationResult
s@AuthenticationResult' {} Maybe POSIX
a -> AuthenticationResult
s {$sel:audioAggregationEndedAt:AuthenticationResult' :: Maybe POSIX
audioAggregationEndedAt = Maybe POSIX
a} :: AuthenticationResult) ((Maybe POSIX -> f (Maybe POSIX))
-> AuthenticationResult -> f AuthenticationResult)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AuthenticationResult
-> f AuthenticationResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON AuthenticationResult where
parseJSON :: Value -> Parser AuthenticationResult
parseJSON =
String
-> (Object -> Parser AuthenticationResult)
-> Value
-> Parser AuthenticationResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AuthenticationResult"
( \Object
x ->
Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Text
-> Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult
AuthenticationResult'
(Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Text
-> Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe Natural
-> Maybe Text
-> Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomerSpeakerId")
Parser
(Maybe Natural
-> Maybe Text
-> Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Score")
Parser
(Maybe Text
-> Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
-> Parser (Maybe Text)
-> Parser
(Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AuthenticationResultId")
Parser
(Maybe AuthenticationDecision
-> Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
-> Parser (Maybe AuthenticationDecision)
-> Parser
(Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AuthenticationDecision)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Decision")
Parser
(Maybe AuthenticationConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> AuthenticationResult)
-> Parser (Maybe AuthenticationConfiguration)
-> Parser
(Maybe POSIX -> Maybe Text -> Maybe POSIX -> AuthenticationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AuthenticationConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configuration")
Parser
(Maybe POSIX -> Maybe Text -> Maybe POSIX -> AuthenticationResult)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe POSIX -> AuthenticationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AudioAggregationStartedAt")
Parser (Maybe Text -> Maybe POSIX -> AuthenticationResult)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> AuthenticationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GeneratedSpeakerId")
Parser (Maybe POSIX -> AuthenticationResult)
-> Parser (Maybe POSIX) -> Parser AuthenticationResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AudioAggregationEndedAt")
)
instance Prelude.Hashable AuthenticationResult
instance Prelude.NFData AuthenticationResult