{-# 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.BuiltinIntentMetadata
-- 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.BuiltinIntentMetadata 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 metadata for a built-in intent.
--
-- /See:/ 'newBuiltinIntentMetadata' smart constructor.
data BuiltinIntentMetadata = BuiltinIntentMetadata'
  { -- | A unique identifier for the built-in intent. To find the signature for
    -- an intent, see
    -- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents Standard Built-in Intents>
    -- in the /Alexa Skills Kit/.
    BuiltinIntentMetadata -> Maybe Text
signature :: Prelude.Maybe Prelude.Text,
    -- | A list of identifiers for the locales that the intent supports.
    BuiltinIntentMetadata -> Maybe [Locale]
supportedLocales :: Prelude.Maybe [Locale]
  }
  deriving (BuiltinIntentMetadata -> BuiltinIntentMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuiltinIntentMetadata -> BuiltinIntentMetadata -> Bool
$c/= :: BuiltinIntentMetadata -> BuiltinIntentMetadata -> Bool
== :: BuiltinIntentMetadata -> BuiltinIntentMetadata -> Bool
$c== :: BuiltinIntentMetadata -> BuiltinIntentMetadata -> Bool
Prelude.Eq, ReadPrec [BuiltinIntentMetadata]
ReadPrec BuiltinIntentMetadata
Int -> ReadS BuiltinIntentMetadata
ReadS [BuiltinIntentMetadata]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BuiltinIntentMetadata]
$creadListPrec :: ReadPrec [BuiltinIntentMetadata]
readPrec :: ReadPrec BuiltinIntentMetadata
$creadPrec :: ReadPrec BuiltinIntentMetadata
readList :: ReadS [BuiltinIntentMetadata]
$creadList :: ReadS [BuiltinIntentMetadata]
readsPrec :: Int -> ReadS BuiltinIntentMetadata
$creadsPrec :: Int -> ReadS BuiltinIntentMetadata
Prelude.Read, Int -> BuiltinIntentMetadata -> ShowS
[BuiltinIntentMetadata] -> ShowS
BuiltinIntentMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BuiltinIntentMetadata] -> ShowS
$cshowList :: [BuiltinIntentMetadata] -> ShowS
show :: BuiltinIntentMetadata -> String
$cshow :: BuiltinIntentMetadata -> String
showsPrec :: Int -> BuiltinIntentMetadata -> ShowS
$cshowsPrec :: Int -> BuiltinIntentMetadata -> ShowS
Prelude.Show, forall x. Rep BuiltinIntentMetadata x -> BuiltinIntentMetadata
forall x. BuiltinIntentMetadata -> Rep BuiltinIntentMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BuiltinIntentMetadata x -> BuiltinIntentMetadata
$cfrom :: forall x. BuiltinIntentMetadata -> Rep BuiltinIntentMetadata x
Prelude.Generic)

-- |
-- Create a value of 'BuiltinIntentMetadata' 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', 'builtinIntentMetadata_signature' - A unique identifier for the built-in intent. To find the signature for
-- an intent, see
-- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents Standard Built-in Intents>
-- in the /Alexa Skills Kit/.
--
-- 'supportedLocales', 'builtinIntentMetadata_supportedLocales' - A list of identifiers for the locales that the intent supports.
newBuiltinIntentMetadata ::
  BuiltinIntentMetadata
newBuiltinIntentMetadata :: BuiltinIntentMetadata
newBuiltinIntentMetadata =
  BuiltinIntentMetadata'
    { $sel:signature:BuiltinIntentMetadata' :: Maybe Text
signature = forall a. Maybe a
Prelude.Nothing,
      $sel:supportedLocales:BuiltinIntentMetadata' :: Maybe [Locale]
supportedLocales = forall a. Maybe a
Prelude.Nothing
    }

-- | A unique identifier for the built-in intent. To find the signature for
-- an intent, see
-- <https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents Standard Built-in Intents>
-- in the /Alexa Skills Kit/.
builtinIntentMetadata_signature :: Lens.Lens' BuiltinIntentMetadata (Prelude.Maybe Prelude.Text)
builtinIntentMetadata_signature :: Lens' BuiltinIntentMetadata (Maybe Text)
builtinIntentMetadata_signature = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuiltinIntentMetadata' {Maybe Text
signature :: Maybe Text
$sel:signature:BuiltinIntentMetadata' :: BuiltinIntentMetadata -> Maybe Text
signature} -> Maybe Text
signature) (\s :: BuiltinIntentMetadata
s@BuiltinIntentMetadata' {} Maybe Text
a -> BuiltinIntentMetadata
s {$sel:signature:BuiltinIntentMetadata' :: Maybe Text
signature = Maybe Text
a} :: BuiltinIntentMetadata)

-- | A list of identifiers for the locales that the intent supports.
builtinIntentMetadata_supportedLocales :: Lens.Lens' BuiltinIntentMetadata (Prelude.Maybe [Locale])
builtinIntentMetadata_supportedLocales :: Lens' BuiltinIntentMetadata (Maybe [Locale])
builtinIntentMetadata_supportedLocales = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuiltinIntentMetadata' {Maybe [Locale]
supportedLocales :: Maybe [Locale]
$sel:supportedLocales:BuiltinIntentMetadata' :: BuiltinIntentMetadata -> Maybe [Locale]
supportedLocales} -> Maybe [Locale]
supportedLocales) (\s :: BuiltinIntentMetadata
s@BuiltinIntentMetadata' {} Maybe [Locale]
a -> BuiltinIntentMetadata
s {$sel:supportedLocales:BuiltinIntentMetadata' :: Maybe [Locale]
supportedLocales = Maybe [Locale]
a} :: BuiltinIntentMetadata) 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 BuiltinIntentMetadata where
  parseJSON :: Value -> Parser BuiltinIntentMetadata
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BuiltinIntentMetadata"
      ( \Object
x ->
          Maybe Text -> Maybe [Locale] -> BuiltinIntentMetadata
BuiltinIntentMetadata'
            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 BuiltinIntentMetadata where
  hashWithSalt :: Int -> BuiltinIntentMetadata -> Int
hashWithSalt Int
_salt BuiltinIntentMetadata' {Maybe [Locale]
Maybe Text
supportedLocales :: Maybe [Locale]
signature :: Maybe Text
$sel:supportedLocales:BuiltinIntentMetadata' :: BuiltinIntentMetadata -> Maybe [Locale]
$sel:signature:BuiltinIntentMetadata' :: BuiltinIntentMetadata -> 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 BuiltinIntentMetadata where
  rnf :: BuiltinIntentMetadata -> ()
rnf BuiltinIntentMetadata' {Maybe [Locale]
Maybe Text
supportedLocales :: Maybe [Locale]
signature :: Maybe Text
$sel:supportedLocales:BuiltinIntentMetadata' :: BuiltinIntentMetadata -> Maybe [Locale]
$sel:signature:BuiltinIntentMetadata' :: BuiltinIntentMetadata -> 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