{-# 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.SmsVoice.Types.PlainTextMessageType
-- 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.SmsVoice.Types.PlainTextMessageType where

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

-- | An object that defines a message that contains unformatted text.
--
-- /See:/ 'newPlainTextMessageType' smart constructor.
data PlainTextMessageType = PlainTextMessageType'
  { -- | The language to use when delivering the message. For a complete list of
    -- supported languages, see the Amazon Polly Developer Guide.
    PlainTextMessageType -> Maybe Text
languageCode :: Prelude.Maybe Prelude.Text,
    -- | The plain (not SSML-formatted) text to deliver to the recipient.
    PlainTextMessageType -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
    -- | The name of the voice that you want to use to deliver the message. For a
    -- complete list of supported voices, see the Amazon Polly Developer Guide.
    PlainTextMessageType -> Maybe Text
voiceId :: Prelude.Maybe Prelude.Text
  }
  deriving (PlainTextMessageType -> PlainTextMessageType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlainTextMessageType -> PlainTextMessageType -> Bool
$c/= :: PlainTextMessageType -> PlainTextMessageType -> Bool
== :: PlainTextMessageType -> PlainTextMessageType -> Bool
$c== :: PlainTextMessageType -> PlainTextMessageType -> Bool
Prelude.Eq, ReadPrec [PlainTextMessageType]
ReadPrec PlainTextMessageType
Int -> ReadS PlainTextMessageType
ReadS [PlainTextMessageType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlainTextMessageType]
$creadListPrec :: ReadPrec [PlainTextMessageType]
readPrec :: ReadPrec PlainTextMessageType
$creadPrec :: ReadPrec PlainTextMessageType
readList :: ReadS [PlainTextMessageType]
$creadList :: ReadS [PlainTextMessageType]
readsPrec :: Int -> ReadS PlainTextMessageType
$creadsPrec :: Int -> ReadS PlainTextMessageType
Prelude.Read, Int -> PlainTextMessageType -> ShowS
[PlainTextMessageType] -> ShowS
PlainTextMessageType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlainTextMessageType] -> ShowS
$cshowList :: [PlainTextMessageType] -> ShowS
show :: PlainTextMessageType -> String
$cshow :: PlainTextMessageType -> String
showsPrec :: Int -> PlainTextMessageType -> ShowS
$cshowsPrec :: Int -> PlainTextMessageType -> ShowS
Prelude.Show, forall x. Rep PlainTextMessageType x -> PlainTextMessageType
forall x. PlainTextMessageType -> Rep PlainTextMessageType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlainTextMessageType x -> PlainTextMessageType
$cfrom :: forall x. PlainTextMessageType -> Rep PlainTextMessageType x
Prelude.Generic)

-- |
-- Create a value of 'PlainTextMessageType' 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:
--
-- 'languageCode', 'plainTextMessageType_languageCode' - The language to use when delivering the message. For a complete list of
-- supported languages, see the Amazon Polly Developer Guide.
--
-- 'text', 'plainTextMessageType_text' - The plain (not SSML-formatted) text to deliver to the recipient.
--
-- 'voiceId', 'plainTextMessageType_voiceId' - The name of the voice that you want to use to deliver the message. For a
-- complete list of supported voices, see the Amazon Polly Developer Guide.
newPlainTextMessageType ::
  PlainTextMessageType
newPlainTextMessageType :: PlainTextMessageType
newPlainTextMessageType =
  PlainTextMessageType'
    { $sel:languageCode:PlainTextMessageType' :: Maybe Text
languageCode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:text:PlainTextMessageType' :: Maybe Text
text = forall a. Maybe a
Prelude.Nothing,
      $sel:voiceId:PlainTextMessageType' :: Maybe Text
voiceId = forall a. Maybe a
Prelude.Nothing
    }

-- | The language to use when delivering the message. For a complete list of
-- supported languages, see the Amazon Polly Developer Guide.
plainTextMessageType_languageCode :: Lens.Lens' PlainTextMessageType (Prelude.Maybe Prelude.Text)
plainTextMessageType_languageCode :: Lens' PlainTextMessageType (Maybe Text)
plainTextMessageType_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlainTextMessageType' {Maybe Text
languageCode :: Maybe Text
$sel:languageCode:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
languageCode} -> Maybe Text
languageCode) (\s :: PlainTextMessageType
s@PlainTextMessageType' {} Maybe Text
a -> PlainTextMessageType
s {$sel:languageCode:PlainTextMessageType' :: Maybe Text
languageCode = Maybe Text
a} :: PlainTextMessageType)

-- | The plain (not SSML-formatted) text to deliver to the recipient.
plainTextMessageType_text :: Lens.Lens' PlainTextMessageType (Prelude.Maybe Prelude.Text)
plainTextMessageType_text :: Lens' PlainTextMessageType (Maybe Text)
plainTextMessageType_text = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlainTextMessageType' {Maybe Text
text :: Maybe Text
$sel:text:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
text} -> Maybe Text
text) (\s :: PlainTextMessageType
s@PlainTextMessageType' {} Maybe Text
a -> PlainTextMessageType
s {$sel:text:PlainTextMessageType' :: Maybe Text
text = Maybe Text
a} :: PlainTextMessageType)

-- | The name of the voice that you want to use to deliver the message. For a
-- complete list of supported voices, see the Amazon Polly Developer Guide.
plainTextMessageType_voiceId :: Lens.Lens' PlainTextMessageType (Prelude.Maybe Prelude.Text)
plainTextMessageType_voiceId :: Lens' PlainTextMessageType (Maybe Text)
plainTextMessageType_voiceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlainTextMessageType' {Maybe Text
voiceId :: Maybe Text
$sel:voiceId:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
voiceId} -> Maybe Text
voiceId) (\s :: PlainTextMessageType
s@PlainTextMessageType' {} Maybe Text
a -> PlainTextMessageType
s {$sel:voiceId:PlainTextMessageType' :: Maybe Text
voiceId = Maybe Text
a} :: PlainTextMessageType)

instance Prelude.Hashable PlainTextMessageType where
  hashWithSalt :: Int -> PlainTextMessageType -> Int
hashWithSalt Int
_salt PlainTextMessageType' {Maybe Text
voiceId :: Maybe Text
text :: Maybe Text
languageCode :: Maybe Text
$sel:voiceId:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
$sel:text:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
$sel:languageCode:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
languageCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
text
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
voiceId

instance Prelude.NFData PlainTextMessageType where
  rnf :: PlainTextMessageType -> ()
rnf PlainTextMessageType' {Maybe Text
voiceId :: Maybe Text
text :: Maybe Text
languageCode :: Maybe Text
$sel:voiceId:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
$sel:text:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
$sel:languageCode:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
languageCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
text
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
voiceId

instance Data.ToJSON PlainTextMessageType where
  toJSON :: PlainTextMessageType -> Value
toJSON PlainTextMessageType' {Maybe Text
voiceId :: Maybe Text
text :: Maybe Text
languageCode :: Maybe Text
$sel:voiceId:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
$sel:text:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
$sel:languageCode:PlainTextMessageType' :: PlainTextMessageType -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"LanguageCode" 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
languageCode,
            (Key
"Text" 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
text,
            (Key
"VoiceId" 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
voiceId
          ]
      )