{-# 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.VoiceId.Types.AuthenticationResult
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The authentication result produced by Voice ID, processed against the
-- current session state and streamed audio of the speaker.
--
-- /See:/ 'newAuthenticationResult' smart constructor.
data AuthenticationResult = AuthenticationResult'
  { -- | The client-provided identifier for the speaker whose authentication
    -- result is produced. Only present if a @SpeakerId@ is provided for the
    -- session.
    AuthenticationResult -> Maybe (Sensitive Text)
customerSpeakerId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The authentication score for the speaker whose authentication result is
    -- produced. This value is only present if the authentication decision is
    -- either @ACCEPT@ or @REJECT@.
    AuthenticationResult -> Maybe Natural
score :: Prelude.Maybe Prelude.Natural,
    -- | The unique identifier for this authentication result. Because there can
    -- be multiple authentications for a given session, this field helps to
    -- identify if the returned result is from a previous streaming activity or
    -- a new result. Note that in absence of any new streaming activity,
    -- @AcceptanceThreshold@ changes, or @SpeakerId@ changes, Voice ID always
    -- returns cached Authentication Result for this API.
    AuthenticationResult -> Maybe Text
authenticationResultId :: Prelude.Maybe Prelude.Text,
    -- | The authentication decision produced by Voice ID, processed against the
    -- current session state and streamed audio of the speaker.
    AuthenticationResult -> Maybe AuthenticationDecision
decision :: Prelude.Maybe AuthenticationDecision,
    -- | The @AuthenticationConfiguration@ used to generate this authentication
    -- result.
    AuthenticationResult -> Maybe AuthenticationConfiguration
configuration :: Prelude.Maybe AuthenticationConfiguration,
    -- | A timestamp indicating when audio aggregation started for this
    -- authentication result.
    AuthenticationResult -> Maybe POSIX
audioAggregationStartedAt :: Prelude.Maybe Core.POSIX,
    -- | The service-generated identifier for the speaker whose authentication
    -- result is produced.
    AuthenticationResult -> Maybe Text
generatedSpeakerId :: Prelude.Maybe Prelude.Text,
    -- | A timestamp indicating when audio aggregation ended for this
    -- authentication result.
    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)

-- |
-- Create a value of 'AuthenticationResult' 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:
--
-- 'customerSpeakerId', 'authenticationResult_customerSpeakerId' - The client-provided identifier for the speaker whose authentication
-- result is produced. Only present if a @SpeakerId@ is provided for the
-- session.
--
-- 'score', 'authenticationResult_score' - The authentication score for the speaker whose authentication result is
-- produced. This value is only present if the authentication decision is
-- either @ACCEPT@ or @REJECT@.
--
-- 'authenticationResultId', 'authenticationResult_authenticationResultId' - The unique identifier for this authentication result. Because there can
-- be multiple authentications for a given session, this field helps to
-- identify if the returned result is from a previous streaming activity or
-- a new result. Note that in absence of any new streaming activity,
-- @AcceptanceThreshold@ changes, or @SpeakerId@ changes, Voice ID always
-- returns cached Authentication Result for this API.
--
-- 'decision', 'authenticationResult_decision' - The authentication decision produced by Voice ID, processed against the
-- current session state and streamed audio of the speaker.
--
-- 'configuration', 'authenticationResult_configuration' - The @AuthenticationConfiguration@ used to generate this authentication
-- result.
--
-- 'audioAggregationStartedAt', 'authenticationResult_audioAggregationStartedAt' - A timestamp indicating when audio aggregation started for this
-- authentication result.
--
-- 'generatedSpeakerId', 'authenticationResult_generatedSpeakerId' - The service-generated identifier for the speaker whose authentication
-- result is produced.
--
-- 'audioAggregationEndedAt', 'authenticationResult_audioAggregationEndedAt' - A timestamp indicating when audio aggregation ended for this
-- authentication result.
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
    }

-- | The client-provided identifier for the speaker whose authentication
-- result is produced. Only present if a @SpeakerId@ is provided for the
-- session.
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

-- | The authentication score for the speaker whose authentication result is
-- produced. This value is only present if the authentication decision is
-- either @ACCEPT@ or @REJECT@.
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)

-- | The unique identifier for this authentication result. Because there can
-- be multiple authentications for a given session, this field helps to
-- identify if the returned result is from a previous streaming activity or
-- a new result. Note that in absence of any new streaming activity,
-- @AcceptanceThreshold@ changes, or @SpeakerId@ changes, Voice ID always
-- returns cached Authentication Result for this API.
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)

-- | The authentication decision produced by Voice ID, processed against the
-- current session state and streamed audio of the speaker.
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)

-- | The @AuthenticationConfiguration@ used to generate this authentication
-- result.
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)

-- | A timestamp indicating when audio aggregation started for this
-- authentication result.
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

-- | The service-generated identifier for the speaker whose authentication
-- result is produced.
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)

-- | A timestamp indicating when audio aggregation ended for this
-- authentication result.
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