{-# 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.LexModels.Types.Slot
-- 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.LexModels.Types.Slot where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexModels.Types.ObfuscationSetting
import Amazonka.LexModels.Types.Prompt
import Amazonka.LexModels.Types.SlotConstraint
import Amazonka.LexModels.Types.SlotDefaultValueSpec
import qualified Amazonka.Prelude as Prelude

-- | Identifies the version of a specific slot.
--
-- /See:/ 'newSlot' smart constructor.
data Slot = Slot'
  { -- | A list of default values for the slot. Default values are used when
    -- Amazon Lex hasn\'t determined a value for a slot. You can specify
    -- default values from context variables, session attributes, and defined
    -- values.
    Slot -> Maybe SlotDefaultValueSpec
defaultValueSpec :: Prelude.Maybe SlotDefaultValueSpec,
    -- | A description of the slot.
    Slot -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Determines whether a slot is obfuscated in conversation logs and stored
    -- utterances. When you obfuscate a slot, the value is replaced by the slot
    -- name in curly braces ({}). For example, if the slot name is
    -- \"full_name\", obfuscated values are replaced with \"{full_name}\". For
    -- more information, see
    -- <https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html Slot Obfuscation>
    -- .
    Slot -> Maybe ObfuscationSetting
obfuscationSetting :: Prelude.Maybe ObfuscationSetting,
    -- | Directs Amazon Lex the order in which to elicit this slot value from the
    -- user. For example, if the intent has two slots with priorities 1 and 2,
    -- AWS Amazon Lex first elicits a value for the slot with priority 1.
    --
    -- If multiple slots share the same priority, the order in which Amazon Lex
    -- elicits values is arbitrary.
    Slot -> Maybe Natural
priority :: Prelude.Maybe Prelude.Natural,
    -- | A set of possible responses for the slot type used by text-based
    -- clients. A user chooses an option from the response card, instead of
    -- using text to reply.
    Slot -> Maybe Text
responseCard :: Prelude.Maybe Prelude.Text,
    -- | If you know a specific pattern with which users might respond to an
    -- Amazon Lex request for a slot value, you can provide those utterances to
    -- improve accuracy. This is optional. In most cases, Amazon Lex is capable
    -- of understanding user utterances.
    Slot -> Maybe [Text]
sampleUtterances :: Prelude.Maybe [Prelude.Text],
    -- | The type of the slot, either a custom slot type that you defined or one
    -- of the built-in slot types.
    Slot -> Maybe Text
slotType :: Prelude.Maybe Prelude.Text,
    -- | The version of the slot type.
    Slot -> Maybe Text
slotTypeVersion :: Prelude.Maybe Prelude.Text,
    -- | The prompt that Amazon Lex uses to elicit the slot value from the user.
    Slot -> Maybe Prompt
valueElicitationPrompt :: Prelude.Maybe Prompt,
    -- | The name of the slot.
    Slot -> Text
name :: Prelude.Text,
    -- | Specifies whether the slot is required or optional.
    Slot -> SlotConstraint
slotConstraint :: SlotConstraint
  }
  deriving (Slot -> Slot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Slot -> Slot -> Bool
$c/= :: Slot -> Slot -> Bool
== :: Slot -> Slot -> Bool
$c== :: Slot -> Slot -> Bool
Prelude.Eq, ReadPrec [Slot]
ReadPrec Slot
Int -> ReadS Slot
ReadS [Slot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Slot]
$creadListPrec :: ReadPrec [Slot]
readPrec :: ReadPrec Slot
$creadPrec :: ReadPrec Slot
readList :: ReadS [Slot]
$creadList :: ReadS [Slot]
readsPrec :: Int -> ReadS Slot
$creadsPrec :: Int -> ReadS Slot
Prelude.Read, Int -> Slot -> ShowS
[Slot] -> ShowS
Slot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Slot] -> ShowS
$cshowList :: [Slot] -> ShowS
show :: Slot -> String
$cshow :: Slot -> String
showsPrec :: Int -> Slot -> ShowS
$cshowsPrec :: Int -> Slot -> ShowS
Prelude.Show, forall x. Rep Slot x -> Slot
forall x. Slot -> Rep Slot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Slot x -> Slot
$cfrom :: forall x. Slot -> Rep Slot x
Prelude.Generic)

-- |
-- Create a value of 'Slot' 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:
--
-- 'defaultValueSpec', 'slot_defaultValueSpec' - A list of default values for the slot. Default values are used when
-- Amazon Lex hasn\'t determined a value for a slot. You can specify
-- default values from context variables, session attributes, and defined
-- values.
--
-- 'description', 'slot_description' - A description of the slot.
--
-- 'obfuscationSetting', 'slot_obfuscationSetting' - Determines whether a slot is obfuscated in conversation logs and stored
-- utterances. When you obfuscate a slot, the value is replaced by the slot
-- name in curly braces ({}). For example, if the slot name is
-- \"full_name\", obfuscated values are replaced with \"{full_name}\". For
-- more information, see
-- <https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html Slot Obfuscation>
-- .
--
-- 'priority', 'slot_priority' - Directs Amazon Lex the order in which to elicit this slot value from the
-- user. For example, if the intent has two slots with priorities 1 and 2,
-- AWS Amazon Lex first elicits a value for the slot with priority 1.
--
-- If multiple slots share the same priority, the order in which Amazon Lex
-- elicits values is arbitrary.
--
-- 'responseCard', 'slot_responseCard' - A set of possible responses for the slot type used by text-based
-- clients. A user chooses an option from the response card, instead of
-- using text to reply.
--
-- 'sampleUtterances', 'slot_sampleUtterances' - If you know a specific pattern with which users might respond to an
-- Amazon Lex request for a slot value, you can provide those utterances to
-- improve accuracy. This is optional. In most cases, Amazon Lex is capable
-- of understanding user utterances.
--
-- 'slotType', 'slot_slotType' - The type of the slot, either a custom slot type that you defined or one
-- of the built-in slot types.
--
-- 'slotTypeVersion', 'slot_slotTypeVersion' - The version of the slot type.
--
-- 'valueElicitationPrompt', 'slot_valueElicitationPrompt' - The prompt that Amazon Lex uses to elicit the slot value from the user.
--
-- 'name', 'slot_name' - The name of the slot.
--
-- 'slotConstraint', 'slot_slotConstraint' - Specifies whether the slot is required or optional.
newSlot ::
  -- | 'name'
  Prelude.Text ->
  -- | 'slotConstraint'
  SlotConstraint ->
  Slot
newSlot :: Text -> SlotConstraint -> Slot
newSlot Text
pName_ SlotConstraint
pSlotConstraint_ =
  Slot'
    { $sel:defaultValueSpec:Slot' :: Maybe SlotDefaultValueSpec
defaultValueSpec = forall a. Maybe a
Prelude.Nothing,
      $sel:description:Slot' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:obfuscationSetting:Slot' :: Maybe ObfuscationSetting
obfuscationSetting = forall a. Maybe a
Prelude.Nothing,
      $sel:priority:Slot' :: Maybe Natural
priority = forall a. Maybe a
Prelude.Nothing,
      $sel:responseCard:Slot' :: Maybe Text
responseCard = forall a. Maybe a
Prelude.Nothing,
      $sel:sampleUtterances:Slot' :: Maybe [Text]
sampleUtterances = forall a. Maybe a
Prelude.Nothing,
      $sel:slotType:Slot' :: Maybe Text
slotType = forall a. Maybe a
Prelude.Nothing,
      $sel:slotTypeVersion:Slot' :: Maybe Text
slotTypeVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:valueElicitationPrompt:Slot' :: Maybe Prompt
valueElicitationPrompt = forall a. Maybe a
Prelude.Nothing,
      $sel:name:Slot' :: Text
name = Text
pName_,
      $sel:slotConstraint:Slot' :: SlotConstraint
slotConstraint = SlotConstraint
pSlotConstraint_
    }

-- | A list of default values for the slot. Default values are used when
-- Amazon Lex hasn\'t determined a value for a slot. You can specify
-- default values from context variables, session attributes, and defined
-- values.
slot_defaultValueSpec :: Lens.Lens' Slot (Prelude.Maybe SlotDefaultValueSpec)
slot_defaultValueSpec :: Lens' Slot (Maybe SlotDefaultValueSpec)
slot_defaultValueSpec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe SlotDefaultValueSpec
defaultValueSpec :: Maybe SlotDefaultValueSpec
$sel:defaultValueSpec:Slot' :: Slot -> Maybe SlotDefaultValueSpec
defaultValueSpec} -> Maybe SlotDefaultValueSpec
defaultValueSpec) (\s :: Slot
s@Slot' {} Maybe SlotDefaultValueSpec
a -> Slot
s {$sel:defaultValueSpec:Slot' :: Maybe SlotDefaultValueSpec
defaultValueSpec = Maybe SlotDefaultValueSpec
a} :: Slot)

-- | A description of the slot.
slot_description :: Lens.Lens' Slot (Prelude.Maybe Prelude.Text)
slot_description :: Lens' Slot (Maybe Text)
slot_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe Text
description :: Maybe Text
$sel:description:Slot' :: Slot -> Maybe Text
description} -> Maybe Text
description) (\s :: Slot
s@Slot' {} Maybe Text
a -> Slot
s {$sel:description:Slot' :: Maybe Text
description = Maybe Text
a} :: Slot)

-- | Determines whether a slot is obfuscated in conversation logs and stored
-- utterances. When you obfuscate a slot, the value is replaced by the slot
-- name in curly braces ({}). For example, if the slot name is
-- \"full_name\", obfuscated values are replaced with \"{full_name}\". For
-- more information, see
-- <https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html Slot Obfuscation>
-- .
slot_obfuscationSetting :: Lens.Lens' Slot (Prelude.Maybe ObfuscationSetting)
slot_obfuscationSetting :: Lens' Slot (Maybe ObfuscationSetting)
slot_obfuscationSetting = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe ObfuscationSetting
obfuscationSetting :: Maybe ObfuscationSetting
$sel:obfuscationSetting:Slot' :: Slot -> Maybe ObfuscationSetting
obfuscationSetting} -> Maybe ObfuscationSetting
obfuscationSetting) (\s :: Slot
s@Slot' {} Maybe ObfuscationSetting
a -> Slot
s {$sel:obfuscationSetting:Slot' :: Maybe ObfuscationSetting
obfuscationSetting = Maybe ObfuscationSetting
a} :: Slot)

-- | Directs Amazon Lex the order in which to elicit this slot value from the
-- user. For example, if the intent has two slots with priorities 1 and 2,
-- AWS Amazon Lex first elicits a value for the slot with priority 1.
--
-- If multiple slots share the same priority, the order in which Amazon Lex
-- elicits values is arbitrary.
slot_priority :: Lens.Lens' Slot (Prelude.Maybe Prelude.Natural)
slot_priority :: Lens' Slot (Maybe Natural)
slot_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe Natural
priority :: Maybe Natural
$sel:priority:Slot' :: Slot -> Maybe Natural
priority} -> Maybe Natural
priority) (\s :: Slot
s@Slot' {} Maybe Natural
a -> Slot
s {$sel:priority:Slot' :: Maybe Natural
priority = Maybe Natural
a} :: Slot)

-- | A set of possible responses for the slot type used by text-based
-- clients. A user chooses an option from the response card, instead of
-- using text to reply.
slot_responseCard :: Lens.Lens' Slot (Prelude.Maybe Prelude.Text)
slot_responseCard :: Lens' Slot (Maybe Text)
slot_responseCard = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe Text
responseCard :: Maybe Text
$sel:responseCard:Slot' :: Slot -> Maybe Text
responseCard} -> Maybe Text
responseCard) (\s :: Slot
s@Slot' {} Maybe Text
a -> Slot
s {$sel:responseCard:Slot' :: Maybe Text
responseCard = Maybe Text
a} :: Slot)

-- | If you know a specific pattern with which users might respond to an
-- Amazon Lex request for a slot value, you can provide those utterances to
-- improve accuracy. This is optional. In most cases, Amazon Lex is capable
-- of understanding user utterances.
slot_sampleUtterances :: Lens.Lens' Slot (Prelude.Maybe [Prelude.Text])
slot_sampleUtterances :: Lens' Slot (Maybe [Text])
slot_sampleUtterances = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe [Text]
sampleUtterances :: Maybe [Text]
$sel:sampleUtterances:Slot' :: Slot -> Maybe [Text]
sampleUtterances} -> Maybe [Text]
sampleUtterances) (\s :: Slot
s@Slot' {} Maybe [Text]
a -> Slot
s {$sel:sampleUtterances:Slot' :: Maybe [Text]
sampleUtterances = Maybe [Text]
a} :: Slot) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of the slot, either a custom slot type that you defined or one
-- of the built-in slot types.
slot_slotType :: Lens.Lens' Slot (Prelude.Maybe Prelude.Text)
slot_slotType :: Lens' Slot (Maybe Text)
slot_slotType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe Text
slotType :: Maybe Text
$sel:slotType:Slot' :: Slot -> Maybe Text
slotType} -> Maybe Text
slotType) (\s :: Slot
s@Slot' {} Maybe Text
a -> Slot
s {$sel:slotType:Slot' :: Maybe Text
slotType = Maybe Text
a} :: Slot)

-- | The version of the slot type.
slot_slotTypeVersion :: Lens.Lens' Slot (Prelude.Maybe Prelude.Text)
slot_slotTypeVersion :: Lens' Slot (Maybe Text)
slot_slotTypeVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe Text
slotTypeVersion :: Maybe Text
$sel:slotTypeVersion:Slot' :: Slot -> Maybe Text
slotTypeVersion} -> Maybe Text
slotTypeVersion) (\s :: Slot
s@Slot' {} Maybe Text
a -> Slot
s {$sel:slotTypeVersion:Slot' :: Maybe Text
slotTypeVersion = Maybe Text
a} :: Slot)

-- | The prompt that Amazon Lex uses to elicit the slot value from the user.
slot_valueElicitationPrompt :: Lens.Lens' Slot (Prelude.Maybe Prompt)
slot_valueElicitationPrompt :: Lens' Slot (Maybe Prompt)
slot_valueElicitationPrompt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Maybe Prompt
valueElicitationPrompt :: Maybe Prompt
$sel:valueElicitationPrompt:Slot' :: Slot -> Maybe Prompt
valueElicitationPrompt} -> Maybe Prompt
valueElicitationPrompt) (\s :: Slot
s@Slot' {} Maybe Prompt
a -> Slot
s {$sel:valueElicitationPrompt:Slot' :: Maybe Prompt
valueElicitationPrompt = Maybe Prompt
a} :: Slot)

-- | The name of the slot.
slot_name :: Lens.Lens' Slot Prelude.Text
slot_name :: Lens' Slot Text
slot_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {Text
name :: Text
$sel:name:Slot' :: Slot -> Text
name} -> Text
name) (\s :: Slot
s@Slot' {} Text
a -> Slot
s {$sel:name:Slot' :: Text
name = Text
a} :: Slot)

-- | Specifies whether the slot is required or optional.
slot_slotConstraint :: Lens.Lens' Slot SlotConstraint
slot_slotConstraint :: Lens' Slot SlotConstraint
slot_slotConstraint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Slot' {SlotConstraint
slotConstraint :: SlotConstraint
$sel:slotConstraint:Slot' :: Slot -> SlotConstraint
slotConstraint} -> SlotConstraint
slotConstraint) (\s :: Slot
s@Slot' {} SlotConstraint
a -> Slot
s {$sel:slotConstraint:Slot' :: SlotConstraint
slotConstraint = SlotConstraint
a} :: Slot)

instance Data.FromJSON Slot where
  parseJSON :: Value -> Parser Slot
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Slot"
      ( \Object
x ->
          Maybe SlotDefaultValueSpec
-> Maybe Text
-> Maybe ObfuscationSetting
-> Maybe Natural
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Prompt
-> Text
-> SlotConstraint
-> Slot
Slot'
            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
"defaultValueSpec")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"obfuscationSetting")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"priority")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"responseCard")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sampleUtterances"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"slotType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"slotTypeVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"valueElicitationPrompt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"slotConstraint")
      )

instance Prelude.Hashable Slot where
  hashWithSalt :: Int -> Slot -> Int
hashWithSalt Int
_salt Slot' {Maybe Natural
Maybe [Text]
Maybe Text
Maybe ObfuscationSetting
Maybe Prompt
Maybe SlotDefaultValueSpec
Text
SlotConstraint
slotConstraint :: SlotConstraint
name :: Text
valueElicitationPrompt :: Maybe Prompt
slotTypeVersion :: Maybe Text
slotType :: Maybe Text
sampleUtterances :: Maybe [Text]
responseCard :: Maybe Text
priority :: Maybe Natural
obfuscationSetting :: Maybe ObfuscationSetting
description :: Maybe Text
defaultValueSpec :: Maybe SlotDefaultValueSpec
$sel:slotConstraint:Slot' :: Slot -> SlotConstraint
$sel:name:Slot' :: Slot -> Text
$sel:valueElicitationPrompt:Slot' :: Slot -> Maybe Prompt
$sel:slotTypeVersion:Slot' :: Slot -> Maybe Text
$sel:slotType:Slot' :: Slot -> Maybe Text
$sel:sampleUtterances:Slot' :: Slot -> Maybe [Text]
$sel:responseCard:Slot' :: Slot -> Maybe Text
$sel:priority:Slot' :: Slot -> Maybe Natural
$sel:obfuscationSetting:Slot' :: Slot -> Maybe ObfuscationSetting
$sel:description:Slot' :: Slot -> Maybe Text
$sel:defaultValueSpec:Slot' :: Slot -> Maybe SlotDefaultValueSpec
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SlotDefaultValueSpec
defaultValueSpec
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ObfuscationSetting
obfuscationSetting
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
priority
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
responseCard
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
sampleUtterances
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
slotType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
slotTypeVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Prompt
valueElicitationPrompt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SlotConstraint
slotConstraint

instance Prelude.NFData Slot where
  rnf :: Slot -> ()
rnf Slot' {Maybe Natural
Maybe [Text]
Maybe Text
Maybe ObfuscationSetting
Maybe Prompt
Maybe SlotDefaultValueSpec
Text
SlotConstraint
slotConstraint :: SlotConstraint
name :: Text
valueElicitationPrompt :: Maybe Prompt
slotTypeVersion :: Maybe Text
slotType :: Maybe Text
sampleUtterances :: Maybe [Text]
responseCard :: Maybe Text
priority :: Maybe Natural
obfuscationSetting :: Maybe ObfuscationSetting
description :: Maybe Text
defaultValueSpec :: Maybe SlotDefaultValueSpec
$sel:slotConstraint:Slot' :: Slot -> SlotConstraint
$sel:name:Slot' :: Slot -> Text
$sel:valueElicitationPrompt:Slot' :: Slot -> Maybe Prompt
$sel:slotTypeVersion:Slot' :: Slot -> Maybe Text
$sel:slotType:Slot' :: Slot -> Maybe Text
$sel:sampleUtterances:Slot' :: Slot -> Maybe [Text]
$sel:responseCard:Slot' :: Slot -> Maybe Text
$sel:priority:Slot' :: Slot -> Maybe Natural
$sel:obfuscationSetting:Slot' :: Slot -> Maybe ObfuscationSetting
$sel:description:Slot' :: Slot -> Maybe Text
$sel:defaultValueSpec:Slot' :: Slot -> Maybe SlotDefaultValueSpec
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SlotDefaultValueSpec
defaultValueSpec
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ObfuscationSetting
obfuscationSetting
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
priority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
responseCard
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
sampleUtterances
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
slotType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
slotTypeVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Prompt
valueElicitationPrompt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SlotConstraint
slotConstraint

instance Data.ToJSON Slot where
  toJSON :: Slot -> Value
toJSON Slot' {Maybe Natural
Maybe [Text]
Maybe Text
Maybe ObfuscationSetting
Maybe Prompt
Maybe SlotDefaultValueSpec
Text
SlotConstraint
slotConstraint :: SlotConstraint
name :: Text
valueElicitationPrompt :: Maybe Prompt
slotTypeVersion :: Maybe Text
slotType :: Maybe Text
sampleUtterances :: Maybe [Text]
responseCard :: Maybe Text
priority :: Maybe Natural
obfuscationSetting :: Maybe ObfuscationSetting
description :: Maybe Text
defaultValueSpec :: Maybe SlotDefaultValueSpec
$sel:slotConstraint:Slot' :: Slot -> SlotConstraint
$sel:name:Slot' :: Slot -> Text
$sel:valueElicitationPrompt:Slot' :: Slot -> Maybe Prompt
$sel:slotTypeVersion:Slot' :: Slot -> Maybe Text
$sel:slotType:Slot' :: Slot -> Maybe Text
$sel:sampleUtterances:Slot' :: Slot -> Maybe [Text]
$sel:responseCard:Slot' :: Slot -> Maybe Text
$sel:priority:Slot' :: Slot -> Maybe Natural
$sel:obfuscationSetting:Slot' :: Slot -> Maybe ObfuscationSetting
$sel:description:Slot' :: Slot -> Maybe Text
$sel:defaultValueSpec:Slot' :: Slot -> Maybe SlotDefaultValueSpec
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"defaultValueSpec" 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 SlotDefaultValueSpec
defaultValueSpec,
            (Key
"description" 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 Text
description,
            (Key
"obfuscationSetting" 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 ObfuscationSetting
obfuscationSetting,
            (Key
"priority" 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 Natural
priority,
            (Key
"responseCard" 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 Text
responseCard,
            (Key
"sampleUtterances" 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 [Text]
sampleUtterances,
            (Key
"slotType" 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 Text
slotType,
            (Key
"slotTypeVersion" 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 Text
slotTypeVersion,
            (Key
"valueElicitationPrompt" 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 Prompt
valueElicitationPrompt,
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"slotConstraint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SlotConstraint
slotConstraint)
          ]
      )