{-# 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.AlexaBusiness.Types.Ssml
-- 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.AlexaBusiness.Types.Ssml where

import Amazonka.AlexaBusiness.Types.Locale
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The SSML message. For more information, see
-- <https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html SSML Reference>.
--
-- /See:/ 'newSsml' smart constructor.
data Ssml = Ssml'
  { -- | The locale of the SSML message. Currently, en-US is supported.
    Ssml -> Locale
locale :: Locale,
    -- | The value of the SSML message in the correct SSML format. The audio tag
    -- is not supported.
    Ssml -> Text
value :: Prelude.Text
  }
  deriving (Ssml -> Ssml -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ssml -> Ssml -> Bool
$c/= :: Ssml -> Ssml -> Bool
== :: Ssml -> Ssml -> Bool
$c== :: Ssml -> Ssml -> Bool
Prelude.Eq, ReadPrec [Ssml]
ReadPrec Ssml
Int -> ReadS Ssml
ReadS [Ssml]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ssml]
$creadListPrec :: ReadPrec [Ssml]
readPrec :: ReadPrec Ssml
$creadPrec :: ReadPrec Ssml
readList :: ReadS [Ssml]
$creadList :: ReadS [Ssml]
readsPrec :: Int -> ReadS Ssml
$creadsPrec :: Int -> ReadS Ssml
Prelude.Read, Int -> Ssml -> ShowS
[Ssml] -> ShowS
Ssml -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ssml] -> ShowS
$cshowList :: [Ssml] -> ShowS
show :: Ssml -> String
$cshow :: Ssml -> String
showsPrec :: Int -> Ssml -> ShowS
$cshowsPrec :: Int -> Ssml -> ShowS
Prelude.Show, forall x. Rep Ssml x -> Ssml
forall x. Ssml -> Rep Ssml x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ssml x -> Ssml
$cfrom :: forall x. Ssml -> Rep Ssml x
Prelude.Generic)

-- |
-- Create a value of 'Ssml' 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:
--
-- 'locale', 'ssml_locale' - The locale of the SSML message. Currently, en-US is supported.
--
-- 'value', 'ssml_value' - The value of the SSML message in the correct SSML format. The audio tag
-- is not supported.
newSsml ::
  -- | 'locale'
  Locale ->
  -- | 'value'
  Prelude.Text ->
  Ssml
newSsml :: Locale -> Text -> Ssml
newSsml Locale
pLocale_ Text
pValue_ =
  Ssml' {$sel:locale:Ssml' :: Locale
locale = Locale
pLocale_, $sel:value:Ssml' :: Text
value = Text
pValue_}

-- | The locale of the SSML message. Currently, en-US is supported.
ssml_locale :: Lens.Lens' Ssml Locale
ssml_locale :: Lens' Ssml Locale
ssml_locale = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ssml' {Locale
locale :: Locale
$sel:locale:Ssml' :: Ssml -> Locale
locale} -> Locale
locale) (\s :: Ssml
s@Ssml' {} Locale
a -> Ssml
s {$sel:locale:Ssml' :: Locale
locale = Locale
a} :: Ssml)

-- | The value of the SSML message in the correct SSML format. The audio tag
-- is not supported.
ssml_value :: Lens.Lens' Ssml Prelude.Text
ssml_value :: Lens' Ssml Text
ssml_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ssml' {Text
value :: Text
$sel:value:Ssml' :: Ssml -> Text
value} -> Text
value) (\s :: Ssml
s@Ssml' {} Text
a -> Ssml
s {$sel:value:Ssml' :: Text
value = Text
a} :: Ssml)

instance Prelude.Hashable Ssml where
  hashWithSalt :: Int -> Ssml -> Int
hashWithSalt Int
_salt Ssml' {Text
Locale
value :: Text
locale :: Locale
$sel:value:Ssml' :: Ssml -> Text
$sel:locale:Ssml' :: Ssml -> Locale
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Locale
locale
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value

instance Prelude.NFData Ssml where
  rnf :: Ssml -> ()
rnf Ssml' {Text
Locale
value :: Text
locale :: Locale
$sel:value:Ssml' :: Ssml -> Text
$sel:locale:Ssml' :: Ssml -> Locale
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Locale
locale seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
value

instance Data.ToJSON Ssml where
  toJSON :: Ssml -> Value
toJSON Ssml' {Text
Locale
value :: Text
locale :: Locale
$sel:value:Ssml' :: Ssml -> Text
$sel:locale:Ssml' :: Ssml -> Locale
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"Locale" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Locale
locale),
            forall a. a -> Maybe a
Prelude.Just (Key
"Value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
value)
          ]
      )