{-# 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.AuthenticationConfiguration
-- 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.AuthenticationConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration used to authenticate a speaker during a session.
--
-- /See:/ 'newAuthenticationConfiguration' smart constructor.
data AuthenticationConfiguration = AuthenticationConfiguration'
  { -- | The minimum threshold needed to successfully authenticate a speaker.
    AuthenticationConfiguration -> Natural
acceptanceThreshold :: Prelude.Natural
  }
  deriving (AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
(AuthenticationConfiguration
 -> AuthenticationConfiguration -> Bool)
-> (AuthenticationConfiguration
    -> AuthenticationConfiguration -> Bool)
-> Eq AuthenticationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
$c/= :: AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
== :: AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
$c== :: AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
Prelude.Eq, ReadPrec [AuthenticationConfiguration]
ReadPrec AuthenticationConfiguration
Int -> ReadS AuthenticationConfiguration
ReadS [AuthenticationConfiguration]
(Int -> ReadS AuthenticationConfiguration)
-> ReadS [AuthenticationConfiguration]
-> ReadPrec AuthenticationConfiguration
-> ReadPrec [AuthenticationConfiguration]
-> Read AuthenticationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthenticationConfiguration]
$creadListPrec :: ReadPrec [AuthenticationConfiguration]
readPrec :: ReadPrec AuthenticationConfiguration
$creadPrec :: ReadPrec AuthenticationConfiguration
readList :: ReadS [AuthenticationConfiguration]
$creadList :: ReadS [AuthenticationConfiguration]
readsPrec :: Int -> ReadS AuthenticationConfiguration
$creadsPrec :: Int -> ReadS AuthenticationConfiguration
Prelude.Read, Int -> AuthenticationConfiguration -> ShowS
[AuthenticationConfiguration] -> ShowS
AuthenticationConfiguration -> String
(Int -> AuthenticationConfiguration -> ShowS)
-> (AuthenticationConfiguration -> String)
-> ([AuthenticationConfiguration] -> ShowS)
-> Show AuthenticationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthenticationConfiguration] -> ShowS
$cshowList :: [AuthenticationConfiguration] -> ShowS
show :: AuthenticationConfiguration -> String
$cshow :: AuthenticationConfiguration -> String
showsPrec :: Int -> AuthenticationConfiguration -> ShowS
$cshowsPrec :: Int -> AuthenticationConfiguration -> ShowS
Prelude.Show, (forall x.
 AuthenticationConfiguration -> Rep AuthenticationConfiguration x)
-> (forall x.
    Rep AuthenticationConfiguration x -> AuthenticationConfiguration)
-> Generic AuthenticationConfiguration
forall x.
Rep AuthenticationConfiguration x -> AuthenticationConfiguration
forall x.
AuthenticationConfiguration -> Rep AuthenticationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AuthenticationConfiguration x -> AuthenticationConfiguration
$cfrom :: forall x.
AuthenticationConfiguration -> Rep AuthenticationConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AuthenticationConfiguration' 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:
--
-- 'acceptanceThreshold', 'authenticationConfiguration_acceptanceThreshold' - The minimum threshold needed to successfully authenticate a speaker.
newAuthenticationConfiguration ::
  -- | 'acceptanceThreshold'
  Prelude.Natural ->
  AuthenticationConfiguration
newAuthenticationConfiguration :: Natural -> AuthenticationConfiguration
newAuthenticationConfiguration Natural
pAcceptanceThreshold_ =
  AuthenticationConfiguration' :: Natural -> AuthenticationConfiguration
AuthenticationConfiguration'
    { $sel:acceptanceThreshold:AuthenticationConfiguration' :: Natural
acceptanceThreshold =
        Natural
pAcceptanceThreshold_
    }

-- | The minimum threshold needed to successfully authenticate a speaker.
authenticationConfiguration_acceptanceThreshold :: Lens.Lens' AuthenticationConfiguration Prelude.Natural
authenticationConfiguration_acceptanceThreshold :: (Natural -> f Natural)
-> AuthenticationConfiguration -> f AuthenticationConfiguration
authenticationConfiguration_acceptanceThreshold = (AuthenticationConfiguration -> Natural)
-> (AuthenticationConfiguration
    -> Natural -> AuthenticationConfiguration)
-> Lens
     AuthenticationConfiguration
     AuthenticationConfiguration
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationConfiguration' {Natural
acceptanceThreshold :: Natural
$sel:acceptanceThreshold:AuthenticationConfiguration' :: AuthenticationConfiguration -> Natural
acceptanceThreshold} -> Natural
acceptanceThreshold) (\s :: AuthenticationConfiguration
s@AuthenticationConfiguration' {} Natural
a -> AuthenticationConfiguration
s {$sel:acceptanceThreshold:AuthenticationConfiguration' :: Natural
acceptanceThreshold = Natural
a} :: AuthenticationConfiguration)

instance Core.FromJSON AuthenticationConfiguration where
  parseJSON :: Value -> Parser AuthenticationConfiguration
parseJSON =
    String
-> (Object -> Parser AuthenticationConfiguration)
-> Value
-> Parser AuthenticationConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AuthenticationConfiguration"
      ( \Object
x ->
          Natural -> AuthenticationConfiguration
AuthenticationConfiguration'
            (Natural -> AuthenticationConfiguration)
-> Parser Natural -> Parser AuthenticationConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AcceptanceThreshold")
      )

instance Prelude.Hashable AuthenticationConfiguration

instance Prelude.NFData AuthenticationConfiguration