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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(PlainTextMessageType -> PlainTextMessageType -> Bool)
-> (PlainTextMessageType -> PlainTextMessageType -> Bool)
-> Eq PlainTextMessageType
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]
(Int -> ReadS PlainTextMessageType)
-> ReadS [PlainTextMessageType]
-> ReadPrec PlainTextMessageType
-> ReadPrec [PlainTextMessageType]
-> Read 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
(Int -> PlainTextMessageType -> ShowS)
-> (PlainTextMessageType -> String)
-> ([PlainTextMessageType] -> ShowS)
-> Show PlainTextMessageType
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. PlainTextMessageType -> Rep PlainTextMessageType x)
-> (forall x. Rep PlainTextMessageType x -> PlainTextMessageType)
-> Generic PlainTextMessageType
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' :: Maybe Text -> Maybe Text -> Maybe Text -> PlainTextMessageType
PlainTextMessageType'
    { $sel:languageCode:PlainTextMessageType' :: Maybe Text
languageCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:text:PlainTextMessageType' :: Maybe Text
text = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:voiceId:PlainTextMessageType' :: Maybe Text
voiceId = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> PlainTextMessageType -> f PlainTextMessageType
plainTextMessageType_languageCode = (PlainTextMessageType -> Maybe Text)
-> (PlainTextMessageType -> Maybe Text -> PlainTextMessageType)
-> Lens
     PlainTextMessageType PlainTextMessageType (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> PlainTextMessageType -> f PlainTextMessageType
plainTextMessageType_text = (PlainTextMessageType -> Maybe Text)
-> (PlainTextMessageType -> Maybe Text -> PlainTextMessageType)
-> Lens
     PlainTextMessageType PlainTextMessageType (Maybe Text) (Maybe 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 :: (Maybe Text -> f (Maybe Text))
-> PlainTextMessageType -> f PlainTextMessageType
plainTextMessageType_voiceId = (PlainTextMessageType -> Maybe Text)
-> (PlainTextMessageType -> Maybe Text -> PlainTextMessageType)
-> Lens
     PlainTextMessageType PlainTextMessageType (Maybe Text) (Maybe Text)
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

instance Prelude.NFData PlainTextMessageType

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LanguageCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
languageCode,
            (Text
"Text" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
text,
            (Text
"VoiceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
voiceId
          ]
      )