{-# 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.LexV2Models.Types.AdvancedRecognitionSetting
-- 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.LexV2Models.Types.AdvancedRecognitionSetting where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.AudioRecognitionStrategy
import qualified Amazonka.Prelude as Prelude

-- | Provides settings that enable advanced recognition settings for slot
-- values.
--
-- /See:/ 'newAdvancedRecognitionSetting' smart constructor.
data AdvancedRecognitionSetting = AdvancedRecognitionSetting'
  { -- | Enables using the slot values as a custom vocabulary for recognizing
    -- user utterances.
    AdvancedRecognitionSetting -> Maybe AudioRecognitionStrategy
audioRecognitionStrategy :: Prelude.Maybe AudioRecognitionStrategy
  }
  deriving (AdvancedRecognitionSetting -> AdvancedRecognitionSetting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdvancedRecognitionSetting -> AdvancedRecognitionSetting -> Bool
$c/= :: AdvancedRecognitionSetting -> AdvancedRecognitionSetting -> Bool
== :: AdvancedRecognitionSetting -> AdvancedRecognitionSetting -> Bool
$c== :: AdvancedRecognitionSetting -> AdvancedRecognitionSetting -> Bool
Prelude.Eq, ReadPrec [AdvancedRecognitionSetting]
ReadPrec AdvancedRecognitionSetting
Int -> ReadS AdvancedRecognitionSetting
ReadS [AdvancedRecognitionSetting]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdvancedRecognitionSetting]
$creadListPrec :: ReadPrec [AdvancedRecognitionSetting]
readPrec :: ReadPrec AdvancedRecognitionSetting
$creadPrec :: ReadPrec AdvancedRecognitionSetting
readList :: ReadS [AdvancedRecognitionSetting]
$creadList :: ReadS [AdvancedRecognitionSetting]
readsPrec :: Int -> ReadS AdvancedRecognitionSetting
$creadsPrec :: Int -> ReadS AdvancedRecognitionSetting
Prelude.Read, Int -> AdvancedRecognitionSetting -> ShowS
[AdvancedRecognitionSetting] -> ShowS
AdvancedRecognitionSetting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdvancedRecognitionSetting] -> ShowS
$cshowList :: [AdvancedRecognitionSetting] -> ShowS
show :: AdvancedRecognitionSetting -> String
$cshow :: AdvancedRecognitionSetting -> String
showsPrec :: Int -> AdvancedRecognitionSetting -> ShowS
$cshowsPrec :: Int -> AdvancedRecognitionSetting -> ShowS
Prelude.Show, forall x.
Rep AdvancedRecognitionSetting x -> AdvancedRecognitionSetting
forall x.
AdvancedRecognitionSetting -> Rep AdvancedRecognitionSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdvancedRecognitionSetting x -> AdvancedRecognitionSetting
$cfrom :: forall x.
AdvancedRecognitionSetting -> Rep AdvancedRecognitionSetting x
Prelude.Generic)

-- |
-- Create a value of 'AdvancedRecognitionSetting' 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:
--
-- 'audioRecognitionStrategy', 'advancedRecognitionSetting_audioRecognitionStrategy' - Enables using the slot values as a custom vocabulary for recognizing
-- user utterances.
newAdvancedRecognitionSetting ::
  AdvancedRecognitionSetting
newAdvancedRecognitionSetting :: AdvancedRecognitionSetting
newAdvancedRecognitionSetting =
  AdvancedRecognitionSetting'
    { $sel:audioRecognitionStrategy:AdvancedRecognitionSetting' :: Maybe AudioRecognitionStrategy
audioRecognitionStrategy =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Enables using the slot values as a custom vocabulary for recognizing
-- user utterances.
advancedRecognitionSetting_audioRecognitionStrategy :: Lens.Lens' AdvancedRecognitionSetting (Prelude.Maybe AudioRecognitionStrategy)
advancedRecognitionSetting_audioRecognitionStrategy :: Lens' AdvancedRecognitionSetting (Maybe AudioRecognitionStrategy)
advancedRecognitionSetting_audioRecognitionStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedRecognitionSetting' {Maybe AudioRecognitionStrategy
audioRecognitionStrategy :: Maybe AudioRecognitionStrategy
$sel:audioRecognitionStrategy:AdvancedRecognitionSetting' :: AdvancedRecognitionSetting -> Maybe AudioRecognitionStrategy
audioRecognitionStrategy} -> Maybe AudioRecognitionStrategy
audioRecognitionStrategy) (\s :: AdvancedRecognitionSetting
s@AdvancedRecognitionSetting' {} Maybe AudioRecognitionStrategy
a -> AdvancedRecognitionSetting
s {$sel:audioRecognitionStrategy:AdvancedRecognitionSetting' :: Maybe AudioRecognitionStrategy
audioRecognitionStrategy = Maybe AudioRecognitionStrategy
a} :: AdvancedRecognitionSetting)

instance Data.FromJSON AdvancedRecognitionSetting where
  parseJSON :: Value -> Parser AdvancedRecognitionSetting
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AdvancedRecognitionSetting"
      ( \Object
x ->
          Maybe AudioRecognitionStrategy -> AdvancedRecognitionSetting
AdvancedRecognitionSetting'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"audioRecognitionStrategy")
      )

instance Prelude.Hashable AdvancedRecognitionSetting where
  hashWithSalt :: Int -> AdvancedRecognitionSetting -> Int
hashWithSalt Int
_salt AdvancedRecognitionSetting' {Maybe AudioRecognitionStrategy
audioRecognitionStrategy :: Maybe AudioRecognitionStrategy
$sel:audioRecognitionStrategy:AdvancedRecognitionSetting' :: AdvancedRecognitionSetting -> Maybe AudioRecognitionStrategy
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AudioRecognitionStrategy
audioRecognitionStrategy

instance Prelude.NFData AdvancedRecognitionSetting where
  rnf :: AdvancedRecognitionSetting -> ()
rnf AdvancedRecognitionSetting' {Maybe AudioRecognitionStrategy
audioRecognitionStrategy :: Maybe AudioRecognitionStrategy
$sel:audioRecognitionStrategy:AdvancedRecognitionSetting' :: AdvancedRecognitionSetting -> Maybe AudioRecognitionStrategy
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AudioRecognitionStrategy
audioRecognitionStrategy

instance Data.ToJSON AdvancedRecognitionSetting where
  toJSON :: AdvancedRecognitionSetting -> Value
toJSON AdvancedRecognitionSetting' {Maybe AudioRecognitionStrategy
audioRecognitionStrategy :: Maybe AudioRecognitionStrategy
$sel:audioRecognitionStrategy:AdvancedRecognitionSetting' :: AdvancedRecognitionSetting -> Maybe AudioRecognitionStrategy
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"audioRecognitionStrategy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioRecognitionStrategy
audioRecognitionStrategy
          ]
      )