{-# 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.BuiltinSlotTypeMetadata
-- 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.BuiltinSlotTypeMetadata 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.Locale
import qualified Amazonka.Prelude as Prelude

-- | Provides information about a built in slot type.
--
-- /See:/ 'newBuiltinSlotTypeMetadata' smart constructor.
data BuiltinSlotTypeMetadata = BuiltinSlotTypeMetadata'
  { -- | A unique identifier for the built-in slot type. To find the signature
    -- for a slot type, see
    -- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference Slot Type Reference>
    -- in the /Alexa Skills Kit/.
    BuiltinSlotTypeMetadata -> Maybe Text
signature :: Prelude.Maybe Prelude.Text,
    -- | A list of target locales for the slot.
    BuiltinSlotTypeMetadata -> Maybe [Locale]
supportedLocales :: Prelude.Maybe [Locale]
  }
  deriving (BuiltinSlotTypeMetadata -> BuiltinSlotTypeMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuiltinSlotTypeMetadata -> BuiltinSlotTypeMetadata -> Bool
$c/= :: BuiltinSlotTypeMetadata -> BuiltinSlotTypeMetadata -> Bool
== :: BuiltinSlotTypeMetadata -> BuiltinSlotTypeMetadata -> Bool
$c== :: BuiltinSlotTypeMetadata -> BuiltinSlotTypeMetadata -> Bool
Prelude.Eq, ReadPrec [BuiltinSlotTypeMetadata]
ReadPrec BuiltinSlotTypeMetadata
Int -> ReadS BuiltinSlotTypeMetadata
ReadS [BuiltinSlotTypeMetadata]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BuiltinSlotTypeMetadata]
$creadListPrec :: ReadPrec [BuiltinSlotTypeMetadata]
readPrec :: ReadPrec BuiltinSlotTypeMetadata
$creadPrec :: ReadPrec BuiltinSlotTypeMetadata
readList :: ReadS [BuiltinSlotTypeMetadata]
$creadList :: ReadS [BuiltinSlotTypeMetadata]
readsPrec :: Int -> ReadS BuiltinSlotTypeMetadata
$creadsPrec :: Int -> ReadS BuiltinSlotTypeMetadata
Prelude.Read, Int -> BuiltinSlotTypeMetadata -> ShowS
[BuiltinSlotTypeMetadata] -> ShowS
BuiltinSlotTypeMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BuiltinSlotTypeMetadata] -> ShowS
$cshowList :: [BuiltinSlotTypeMetadata] -> ShowS
show :: BuiltinSlotTypeMetadata -> String
$cshow :: BuiltinSlotTypeMetadata -> String
showsPrec :: Int -> BuiltinSlotTypeMetadata -> ShowS
$cshowsPrec :: Int -> BuiltinSlotTypeMetadata -> ShowS
Prelude.Show, forall x. Rep BuiltinSlotTypeMetadata x -> BuiltinSlotTypeMetadata
forall x. BuiltinSlotTypeMetadata -> Rep BuiltinSlotTypeMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BuiltinSlotTypeMetadata x -> BuiltinSlotTypeMetadata
$cfrom :: forall x. BuiltinSlotTypeMetadata -> Rep BuiltinSlotTypeMetadata x
Prelude.Generic)

-- |
-- Create a value of 'BuiltinSlotTypeMetadata' 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:
--
-- 'signature', 'builtinSlotTypeMetadata_signature' - A unique identifier for the built-in slot type. To find the signature
-- for a slot type, see
-- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference Slot Type Reference>
-- in the /Alexa Skills Kit/.
--
-- 'supportedLocales', 'builtinSlotTypeMetadata_supportedLocales' - A list of target locales for the slot.
newBuiltinSlotTypeMetadata ::
  BuiltinSlotTypeMetadata
newBuiltinSlotTypeMetadata :: BuiltinSlotTypeMetadata
newBuiltinSlotTypeMetadata =
  BuiltinSlotTypeMetadata'
    { $sel:signature:BuiltinSlotTypeMetadata' :: Maybe Text
signature =
        forall a. Maybe a
Prelude.Nothing,
      $sel:supportedLocales:BuiltinSlotTypeMetadata' :: Maybe [Locale]
supportedLocales = forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier for the built-in slot type. To find the signature
-- for a slot type, see
-- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference Slot Type Reference>
-- in the /Alexa Skills Kit/.
builtinSlotTypeMetadata_signature :: Lens.Lens' BuiltinSlotTypeMetadata (Prelude.Maybe Prelude.Text)
builtinSlotTypeMetadata_signature :: Lens' BuiltinSlotTypeMetadata (Maybe Text)
builtinSlotTypeMetadata_signature = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuiltinSlotTypeMetadata' {Maybe Text
signature :: Maybe Text
$sel:signature:BuiltinSlotTypeMetadata' :: BuiltinSlotTypeMetadata -> Maybe Text
signature} -> Maybe Text
signature) (\s :: BuiltinSlotTypeMetadata
s@BuiltinSlotTypeMetadata' {} Maybe Text
a -> BuiltinSlotTypeMetadata
s {$sel:signature:BuiltinSlotTypeMetadata' :: Maybe Text
signature = Maybe Text
a} :: BuiltinSlotTypeMetadata)

-- | A list of target locales for the slot.
builtinSlotTypeMetadata_supportedLocales :: Lens.Lens' BuiltinSlotTypeMetadata (Prelude.Maybe [Locale])
builtinSlotTypeMetadata_supportedLocales :: Lens' BuiltinSlotTypeMetadata (Maybe [Locale])
builtinSlotTypeMetadata_supportedLocales = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuiltinSlotTypeMetadata' {Maybe [Locale]
supportedLocales :: Maybe [Locale]
$sel:supportedLocales:BuiltinSlotTypeMetadata' :: BuiltinSlotTypeMetadata -> Maybe [Locale]
supportedLocales} -> Maybe [Locale]
supportedLocales) (\s :: BuiltinSlotTypeMetadata
s@BuiltinSlotTypeMetadata' {} Maybe [Locale]
a -> BuiltinSlotTypeMetadata
s {$sel:supportedLocales:BuiltinSlotTypeMetadata' :: Maybe [Locale]
supportedLocales = Maybe [Locale]
a} :: BuiltinSlotTypeMetadata) 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

instance Data.FromJSON BuiltinSlotTypeMetadata where
  parseJSON :: Value -> Parser BuiltinSlotTypeMetadata
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BuiltinSlotTypeMetadata"
      ( \Object
x ->
          Maybe Text -> Maybe [Locale] -> BuiltinSlotTypeMetadata
BuiltinSlotTypeMetadata'
            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
"signature")
            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
"supportedLocales"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable BuiltinSlotTypeMetadata where
  hashWithSalt :: Int -> BuiltinSlotTypeMetadata -> Int
hashWithSalt Int
_salt BuiltinSlotTypeMetadata' {Maybe [Locale]
Maybe Text
supportedLocales :: Maybe [Locale]
signature :: Maybe Text
$sel:supportedLocales:BuiltinSlotTypeMetadata' :: BuiltinSlotTypeMetadata -> Maybe [Locale]
$sel:signature:BuiltinSlotTypeMetadata' :: BuiltinSlotTypeMetadata -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
signature
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Locale]
supportedLocales

instance Prelude.NFData BuiltinSlotTypeMetadata where
  rnf :: BuiltinSlotTypeMetadata -> ()
rnf BuiltinSlotTypeMetadata' {Maybe [Locale]
Maybe Text
supportedLocales :: Maybe [Locale]
signature :: Maybe Text
$sel:supportedLocales:BuiltinSlotTypeMetadata' :: BuiltinSlotTypeMetadata -> Maybe [Locale]
$sel:signature:BuiltinSlotTypeMetadata' :: BuiltinSlotTypeMetadata -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
signature
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Locale]
supportedLocales