{-# 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.VoiceMessageContent
-- 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.VoiceMessageContent where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PinpointSMSVoice.Types.CallInstructionsMessageType
import Amazonka.PinpointSMSVoice.Types.PlainTextMessageType
import Amazonka.PinpointSMSVoice.Types.SSMLMessageType
import qualified Amazonka.Prelude as Prelude

-- | An object that contains a voice message and information about the
-- recipient that you want to send it to.
--
-- /See:/ 'newVoiceMessageContent' smart constructor.
data VoiceMessageContent = VoiceMessageContent'
  { VoiceMessageContent -> Maybe CallInstructionsMessageType
callInstructionsMessage :: Prelude.Maybe CallInstructionsMessageType,
    VoiceMessageContent -> Maybe SSMLMessageType
sSMLMessage :: Prelude.Maybe SSMLMessageType,
    VoiceMessageContent -> Maybe PlainTextMessageType
plainTextMessage :: Prelude.Maybe PlainTextMessageType
  }
  deriving (VoiceMessageContent -> VoiceMessageContent -> Bool
(VoiceMessageContent -> VoiceMessageContent -> Bool)
-> (VoiceMessageContent -> VoiceMessageContent -> Bool)
-> Eq VoiceMessageContent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VoiceMessageContent -> VoiceMessageContent -> Bool
$c/= :: VoiceMessageContent -> VoiceMessageContent -> Bool
== :: VoiceMessageContent -> VoiceMessageContent -> Bool
$c== :: VoiceMessageContent -> VoiceMessageContent -> Bool
Prelude.Eq, ReadPrec [VoiceMessageContent]
ReadPrec VoiceMessageContent
Int -> ReadS VoiceMessageContent
ReadS [VoiceMessageContent]
(Int -> ReadS VoiceMessageContent)
-> ReadS [VoiceMessageContent]
-> ReadPrec VoiceMessageContent
-> ReadPrec [VoiceMessageContent]
-> Read VoiceMessageContent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VoiceMessageContent]
$creadListPrec :: ReadPrec [VoiceMessageContent]
readPrec :: ReadPrec VoiceMessageContent
$creadPrec :: ReadPrec VoiceMessageContent
readList :: ReadS [VoiceMessageContent]
$creadList :: ReadS [VoiceMessageContent]
readsPrec :: Int -> ReadS VoiceMessageContent
$creadsPrec :: Int -> ReadS VoiceMessageContent
Prelude.Read, Int -> VoiceMessageContent -> ShowS
[VoiceMessageContent] -> ShowS
VoiceMessageContent -> String
(Int -> VoiceMessageContent -> ShowS)
-> (VoiceMessageContent -> String)
-> ([VoiceMessageContent] -> ShowS)
-> Show VoiceMessageContent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VoiceMessageContent] -> ShowS
$cshowList :: [VoiceMessageContent] -> ShowS
show :: VoiceMessageContent -> String
$cshow :: VoiceMessageContent -> String
showsPrec :: Int -> VoiceMessageContent -> ShowS
$cshowsPrec :: Int -> VoiceMessageContent -> ShowS
Prelude.Show, (forall x. VoiceMessageContent -> Rep VoiceMessageContent x)
-> (forall x. Rep VoiceMessageContent x -> VoiceMessageContent)
-> Generic VoiceMessageContent
forall x. Rep VoiceMessageContent x -> VoiceMessageContent
forall x. VoiceMessageContent -> Rep VoiceMessageContent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VoiceMessageContent x -> VoiceMessageContent
$cfrom :: forall x. VoiceMessageContent -> Rep VoiceMessageContent x
Prelude.Generic)

-- |
-- Create a value of 'VoiceMessageContent' 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:
--
-- 'callInstructionsMessage', 'voiceMessageContent_callInstructionsMessage' - Undocumented member.
--
-- 'sSMLMessage', 'voiceMessageContent_sSMLMessage' - Undocumented member.
--
-- 'plainTextMessage', 'voiceMessageContent_plainTextMessage' - Undocumented member.
newVoiceMessageContent ::
  VoiceMessageContent
newVoiceMessageContent :: VoiceMessageContent
newVoiceMessageContent =
  VoiceMessageContent' :: Maybe CallInstructionsMessageType
-> Maybe SSMLMessageType
-> Maybe PlainTextMessageType
-> VoiceMessageContent
VoiceMessageContent'
    { $sel:callInstructionsMessage:VoiceMessageContent' :: Maybe CallInstructionsMessageType
callInstructionsMessage =
        Maybe CallInstructionsMessageType
forall a. Maybe a
Prelude.Nothing,
      $sel:sSMLMessage:VoiceMessageContent' :: Maybe SSMLMessageType
sSMLMessage = Maybe SSMLMessageType
forall a. Maybe a
Prelude.Nothing,
      $sel:plainTextMessage:VoiceMessageContent' :: Maybe PlainTextMessageType
plainTextMessage = Maybe PlainTextMessageType
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
voiceMessageContent_callInstructionsMessage :: Lens.Lens' VoiceMessageContent (Prelude.Maybe CallInstructionsMessageType)
voiceMessageContent_callInstructionsMessage :: (Maybe CallInstructionsMessageType
 -> f (Maybe CallInstructionsMessageType))
-> VoiceMessageContent -> f VoiceMessageContent
voiceMessageContent_callInstructionsMessage = (VoiceMessageContent -> Maybe CallInstructionsMessageType)
-> (VoiceMessageContent
    -> Maybe CallInstructionsMessageType -> VoiceMessageContent)
-> Lens
     VoiceMessageContent
     VoiceMessageContent
     (Maybe CallInstructionsMessageType)
     (Maybe CallInstructionsMessageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceMessageContent' {Maybe CallInstructionsMessageType
callInstructionsMessage :: Maybe CallInstructionsMessageType
$sel:callInstructionsMessage:VoiceMessageContent' :: VoiceMessageContent -> Maybe CallInstructionsMessageType
callInstructionsMessage} -> Maybe CallInstructionsMessageType
callInstructionsMessage) (\s :: VoiceMessageContent
s@VoiceMessageContent' {} Maybe CallInstructionsMessageType
a -> VoiceMessageContent
s {$sel:callInstructionsMessage:VoiceMessageContent' :: Maybe CallInstructionsMessageType
callInstructionsMessage = Maybe CallInstructionsMessageType
a} :: VoiceMessageContent)

-- | Undocumented member.
voiceMessageContent_sSMLMessage :: Lens.Lens' VoiceMessageContent (Prelude.Maybe SSMLMessageType)
voiceMessageContent_sSMLMessage :: (Maybe SSMLMessageType -> f (Maybe SSMLMessageType))
-> VoiceMessageContent -> f VoiceMessageContent
voiceMessageContent_sSMLMessage = (VoiceMessageContent -> Maybe SSMLMessageType)
-> (VoiceMessageContent
    -> Maybe SSMLMessageType -> VoiceMessageContent)
-> Lens
     VoiceMessageContent
     VoiceMessageContent
     (Maybe SSMLMessageType)
     (Maybe SSMLMessageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceMessageContent' {Maybe SSMLMessageType
sSMLMessage :: Maybe SSMLMessageType
$sel:sSMLMessage:VoiceMessageContent' :: VoiceMessageContent -> Maybe SSMLMessageType
sSMLMessage} -> Maybe SSMLMessageType
sSMLMessage) (\s :: VoiceMessageContent
s@VoiceMessageContent' {} Maybe SSMLMessageType
a -> VoiceMessageContent
s {$sel:sSMLMessage:VoiceMessageContent' :: Maybe SSMLMessageType
sSMLMessage = Maybe SSMLMessageType
a} :: VoiceMessageContent)

-- | Undocumented member.
voiceMessageContent_plainTextMessage :: Lens.Lens' VoiceMessageContent (Prelude.Maybe PlainTextMessageType)
voiceMessageContent_plainTextMessage :: (Maybe PlainTextMessageType -> f (Maybe PlainTextMessageType))
-> VoiceMessageContent -> f VoiceMessageContent
voiceMessageContent_plainTextMessage = (VoiceMessageContent -> Maybe PlainTextMessageType)
-> (VoiceMessageContent
    -> Maybe PlainTextMessageType -> VoiceMessageContent)
-> Lens
     VoiceMessageContent
     VoiceMessageContent
     (Maybe PlainTextMessageType)
     (Maybe PlainTextMessageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceMessageContent' {Maybe PlainTextMessageType
plainTextMessage :: Maybe PlainTextMessageType
$sel:plainTextMessage:VoiceMessageContent' :: VoiceMessageContent -> Maybe PlainTextMessageType
plainTextMessage} -> Maybe PlainTextMessageType
plainTextMessage) (\s :: VoiceMessageContent
s@VoiceMessageContent' {} Maybe PlainTextMessageType
a -> VoiceMessageContent
s {$sel:plainTextMessage:VoiceMessageContent' :: Maybe PlainTextMessageType
plainTextMessage = Maybe PlainTextMessageType
a} :: VoiceMessageContent)

instance Prelude.Hashable VoiceMessageContent

instance Prelude.NFData VoiceMessageContent

instance Core.ToJSON VoiceMessageContent where
  toJSON :: VoiceMessageContent -> Value
toJSON VoiceMessageContent' {Maybe CallInstructionsMessageType
Maybe PlainTextMessageType
Maybe SSMLMessageType
plainTextMessage :: Maybe PlainTextMessageType
sSMLMessage :: Maybe SSMLMessageType
callInstructionsMessage :: Maybe CallInstructionsMessageType
$sel:plainTextMessage:VoiceMessageContent' :: VoiceMessageContent -> Maybe PlainTextMessageType
$sel:sSMLMessage:VoiceMessageContent' :: VoiceMessageContent -> Maybe SSMLMessageType
$sel:callInstructionsMessage:VoiceMessageContent' :: VoiceMessageContent -> Maybe CallInstructionsMessageType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CallInstructionsMessage" Text -> CallInstructionsMessageType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CallInstructionsMessageType -> Pair)
-> Maybe CallInstructionsMessageType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CallInstructionsMessageType
callInstructionsMessage,
            (Text
"SSMLMessage" Text -> SSMLMessageType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SSMLMessageType -> Pair) -> Maybe SSMLMessageType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SSMLMessageType
sSMLMessage,
            (Text
"PlainTextMessage" Text -> PlainTextMessageType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PlainTextMessageType -> Pair)
-> Maybe PlainTextMessageType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PlainTextMessageType
plainTextMessage
          ]
      )