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

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

-- | Provides information about a slot used in a built-in intent.
--
-- /See:/ 'newBuiltinIntentSlot' smart constructor.
data BuiltinIntentSlot = BuiltinIntentSlot'
  { -- | A list of the slots defined for the intent.
    BuiltinIntentSlot -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (BuiltinIntentSlot -> BuiltinIntentSlot -> Bool
(BuiltinIntentSlot -> BuiltinIntentSlot -> Bool)
-> (BuiltinIntentSlot -> BuiltinIntentSlot -> Bool)
-> Eq BuiltinIntentSlot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuiltinIntentSlot -> BuiltinIntentSlot -> Bool
$c/= :: BuiltinIntentSlot -> BuiltinIntentSlot -> Bool
== :: BuiltinIntentSlot -> BuiltinIntentSlot -> Bool
$c== :: BuiltinIntentSlot -> BuiltinIntentSlot -> Bool
Prelude.Eq, ReadPrec [BuiltinIntentSlot]
ReadPrec BuiltinIntentSlot
Int -> ReadS BuiltinIntentSlot
ReadS [BuiltinIntentSlot]
(Int -> ReadS BuiltinIntentSlot)
-> ReadS [BuiltinIntentSlot]
-> ReadPrec BuiltinIntentSlot
-> ReadPrec [BuiltinIntentSlot]
-> Read BuiltinIntentSlot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BuiltinIntentSlot]
$creadListPrec :: ReadPrec [BuiltinIntentSlot]
readPrec :: ReadPrec BuiltinIntentSlot
$creadPrec :: ReadPrec BuiltinIntentSlot
readList :: ReadS [BuiltinIntentSlot]
$creadList :: ReadS [BuiltinIntentSlot]
readsPrec :: Int -> ReadS BuiltinIntentSlot
$creadsPrec :: Int -> ReadS BuiltinIntentSlot
Prelude.Read, Int -> BuiltinIntentSlot -> ShowS
[BuiltinIntentSlot] -> ShowS
BuiltinIntentSlot -> String
(Int -> BuiltinIntentSlot -> ShowS)
-> (BuiltinIntentSlot -> String)
-> ([BuiltinIntentSlot] -> ShowS)
-> Show BuiltinIntentSlot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BuiltinIntentSlot] -> ShowS
$cshowList :: [BuiltinIntentSlot] -> ShowS
show :: BuiltinIntentSlot -> String
$cshow :: BuiltinIntentSlot -> String
showsPrec :: Int -> BuiltinIntentSlot -> ShowS
$cshowsPrec :: Int -> BuiltinIntentSlot -> ShowS
Prelude.Show, (forall x. BuiltinIntentSlot -> Rep BuiltinIntentSlot x)
-> (forall x. Rep BuiltinIntentSlot x -> BuiltinIntentSlot)
-> Generic BuiltinIntentSlot
forall x. Rep BuiltinIntentSlot x -> BuiltinIntentSlot
forall x. BuiltinIntentSlot -> Rep BuiltinIntentSlot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BuiltinIntentSlot x -> BuiltinIntentSlot
$cfrom :: forall x. BuiltinIntentSlot -> Rep BuiltinIntentSlot x
Prelude.Generic)

-- |
-- Create a value of 'BuiltinIntentSlot' 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:
--
-- 'name', 'builtinIntentSlot_name' - A list of the slots defined for the intent.
newBuiltinIntentSlot ::
  BuiltinIntentSlot
newBuiltinIntentSlot :: BuiltinIntentSlot
newBuiltinIntentSlot =
  BuiltinIntentSlot' :: Maybe Text -> BuiltinIntentSlot
BuiltinIntentSlot' {$sel:name:BuiltinIntentSlot' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | A list of the slots defined for the intent.
builtinIntentSlot_name :: Lens.Lens' BuiltinIntentSlot (Prelude.Maybe Prelude.Text)
builtinIntentSlot_name :: (Maybe Text -> f (Maybe Text))
-> BuiltinIntentSlot -> f BuiltinIntentSlot
builtinIntentSlot_name = (BuiltinIntentSlot -> Maybe Text)
-> (BuiltinIntentSlot -> Maybe Text -> BuiltinIntentSlot)
-> Lens
     BuiltinIntentSlot BuiltinIntentSlot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuiltinIntentSlot' {Maybe Text
name :: Maybe Text
$sel:name:BuiltinIntentSlot' :: BuiltinIntentSlot -> Maybe Text
name} -> Maybe Text
name) (\s :: BuiltinIntentSlot
s@BuiltinIntentSlot' {} Maybe Text
a -> BuiltinIntentSlot
s {$sel:name:BuiltinIntentSlot' :: Maybe Text
name = Maybe Text
a} :: BuiltinIntentSlot)

instance Core.FromJSON BuiltinIntentSlot where
  parseJSON :: Value -> Parser BuiltinIntentSlot
parseJSON =
    String
-> (Object -> Parser BuiltinIntentSlot)
-> Value
-> Parser BuiltinIntentSlot
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BuiltinIntentSlot"
      ( \Object
x ->
          Maybe Text -> BuiltinIntentSlot
BuiltinIntentSlot' (Maybe Text -> BuiltinIntentSlot)
-> Parser (Maybe Text) -> Parser BuiltinIntentSlot
forall (f :: * -> *) a b. Functor 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
"name")
      )

instance Prelude.Hashable BuiltinIntentSlot

instance Prelude.NFData BuiltinIntentSlot