{-# 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.CallInstructionsMessageType
-- 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.CallInstructionsMessageType 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 text formatted using
-- Amazon Pinpoint Voice Instructions markup.
--
-- /See:/ 'newCallInstructionsMessageType' smart constructor.
data CallInstructionsMessageType = CallInstructionsMessageType'
  { -- | The language to use when delivering the message. For a complete list of
    -- supported languages, see the Amazon Polly Developer Guide.
    CallInstructionsMessageType -> Maybe Text
text :: Prelude.Maybe Prelude.Text
  }
  deriving (CallInstructionsMessageType -> CallInstructionsMessageType -> Bool
(CallInstructionsMessageType
 -> CallInstructionsMessageType -> Bool)
-> (CallInstructionsMessageType
    -> CallInstructionsMessageType -> Bool)
-> Eq CallInstructionsMessageType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallInstructionsMessageType -> CallInstructionsMessageType -> Bool
$c/= :: CallInstructionsMessageType -> CallInstructionsMessageType -> Bool
== :: CallInstructionsMessageType -> CallInstructionsMessageType -> Bool
$c== :: CallInstructionsMessageType -> CallInstructionsMessageType -> Bool
Prelude.Eq, ReadPrec [CallInstructionsMessageType]
ReadPrec CallInstructionsMessageType
Int -> ReadS CallInstructionsMessageType
ReadS [CallInstructionsMessageType]
(Int -> ReadS CallInstructionsMessageType)
-> ReadS [CallInstructionsMessageType]
-> ReadPrec CallInstructionsMessageType
-> ReadPrec [CallInstructionsMessageType]
-> Read CallInstructionsMessageType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CallInstructionsMessageType]
$creadListPrec :: ReadPrec [CallInstructionsMessageType]
readPrec :: ReadPrec CallInstructionsMessageType
$creadPrec :: ReadPrec CallInstructionsMessageType
readList :: ReadS [CallInstructionsMessageType]
$creadList :: ReadS [CallInstructionsMessageType]
readsPrec :: Int -> ReadS CallInstructionsMessageType
$creadsPrec :: Int -> ReadS CallInstructionsMessageType
Prelude.Read, Int -> CallInstructionsMessageType -> ShowS
[CallInstructionsMessageType] -> ShowS
CallInstructionsMessageType -> String
(Int -> CallInstructionsMessageType -> ShowS)
-> (CallInstructionsMessageType -> String)
-> ([CallInstructionsMessageType] -> ShowS)
-> Show CallInstructionsMessageType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallInstructionsMessageType] -> ShowS
$cshowList :: [CallInstructionsMessageType] -> ShowS
show :: CallInstructionsMessageType -> String
$cshow :: CallInstructionsMessageType -> String
showsPrec :: Int -> CallInstructionsMessageType -> ShowS
$cshowsPrec :: Int -> CallInstructionsMessageType -> ShowS
Prelude.Show, (forall x.
 CallInstructionsMessageType -> Rep CallInstructionsMessageType x)
-> (forall x.
    Rep CallInstructionsMessageType x -> CallInstructionsMessageType)
-> Generic CallInstructionsMessageType
forall x.
Rep CallInstructionsMessageType x -> CallInstructionsMessageType
forall x.
CallInstructionsMessageType -> Rep CallInstructionsMessageType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CallInstructionsMessageType x -> CallInstructionsMessageType
$cfrom :: forall x.
CallInstructionsMessageType -> Rep CallInstructionsMessageType x
Prelude.Generic)

-- |
-- Create a value of 'CallInstructionsMessageType' 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:
--
-- 'text', 'callInstructionsMessageType_text' - The language to use when delivering the message. For a complete list of
-- supported languages, see the Amazon Polly Developer Guide.
newCallInstructionsMessageType ::
  CallInstructionsMessageType
newCallInstructionsMessageType :: CallInstructionsMessageType
newCallInstructionsMessageType =
  CallInstructionsMessageType' :: Maybe Text -> CallInstructionsMessageType
CallInstructionsMessageType'
    { $sel:text:CallInstructionsMessageType' :: Maybe Text
text =
        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.
callInstructionsMessageType_text :: Lens.Lens' CallInstructionsMessageType (Prelude.Maybe Prelude.Text)
callInstructionsMessageType_text :: (Maybe Text -> f (Maybe Text))
-> CallInstructionsMessageType -> f CallInstructionsMessageType
callInstructionsMessageType_text = (CallInstructionsMessageType -> Maybe Text)
-> (CallInstructionsMessageType
    -> Maybe Text -> CallInstructionsMessageType)
-> Lens
     CallInstructionsMessageType
     CallInstructionsMessageType
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CallInstructionsMessageType' {Maybe Text
text :: Maybe Text
$sel:text:CallInstructionsMessageType' :: CallInstructionsMessageType -> Maybe Text
text} -> Maybe Text
text) (\s :: CallInstructionsMessageType
s@CallInstructionsMessageType' {} Maybe Text
a -> CallInstructionsMessageType
s {$sel:text:CallInstructionsMessageType' :: Maybe Text
text = Maybe Text
a} :: CallInstructionsMessageType)

instance Prelude.Hashable CallInstructionsMessageType

instance Prelude.NFData CallInstructionsMessageType

instance Core.ToJSON CallInstructionsMessageType where
  toJSON :: CallInstructionsMessageType -> Value
toJSON CallInstructionsMessageType' {Maybe Text
text :: Maybe Text
$sel:text:CallInstructionsMessageType' :: CallInstructionsMessageType -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(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]
      )