{-# 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.CallInstructionsMessageType
-- 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.CallInstructionsMessageType 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 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
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]
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
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.
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'
    { $sel:text:CallInstructionsMessageType' :: Maybe Text
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 :: Lens' CallInstructionsMessageType (Maybe Text)
callInstructionsMessageType_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 where
  hashWithSalt :: Int -> CallInstructionsMessageType -> Int
hashWithSalt Int
_salt CallInstructionsMessageType' {Maybe Text
text :: Maybe Text
$sel:text:CallInstructionsMessageType' :: CallInstructionsMessageType -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
text

instance Prelude.NFData CallInstructionsMessageType where
  rnf :: CallInstructionsMessageType -> ()
rnf CallInstructionsMessageType' {Maybe Text
text :: Maybe Text
$sel:text:CallInstructionsMessageType' :: CallInstructionsMessageType -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
text

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