{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.SendVoiceMessage
-- 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)
--
-- Create a new voice message and send it to a recipient\'s phone number.
module Amazonka.PinpointSMSVoice.SendVoiceMessage
  ( -- * Creating a Request
    SendVoiceMessage (..),
    newSendVoiceMessage,

    -- * Request Lenses
    sendVoiceMessage_configurationSetName,
    sendVoiceMessage_callerId,
    sendVoiceMessage_originationPhoneNumber,
    sendVoiceMessage_content,
    sendVoiceMessage_destinationPhoneNumber,

    -- * Destructuring the Response
    SendVoiceMessageResponse (..),
    newSendVoiceMessageResponse,

    -- * Response Lenses
    sendVoiceMessageResponse_messageId,
    sendVoiceMessageResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PinpointSMSVoice.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | SendVoiceMessageRequest
--
-- /See:/ 'newSendVoiceMessage' smart constructor.
data SendVoiceMessage = SendVoiceMessage'
  { -- | The name of the configuration set that you want to use to send the
    -- message.
    SendVoiceMessage -> Maybe Text
configurationSetName :: Prelude.Maybe Prelude.Text,
    -- | The phone number that appears on recipients\' devices when they receive
    -- the message.
    SendVoiceMessage -> Maybe Text
callerId :: Prelude.Maybe Prelude.Text,
    -- | The phone number that Amazon Pinpoint should use to send the voice
    -- message. This isn\'t necessarily the phone number that appears on
    -- recipients\' devices when they receive the message, because you can
    -- specify a CallerId parameter in the request.
    SendVoiceMessage -> Maybe Text
originationPhoneNumber :: Prelude.Maybe Prelude.Text,
    SendVoiceMessage -> Maybe VoiceMessageContent
content :: Prelude.Maybe VoiceMessageContent,
    -- | The phone number that you want to send the voice message to.
    SendVoiceMessage -> Maybe Text
destinationPhoneNumber :: Prelude.Maybe Prelude.Text
  }
  deriving (SendVoiceMessage -> SendVoiceMessage -> Bool
(SendVoiceMessage -> SendVoiceMessage -> Bool)
-> (SendVoiceMessage -> SendVoiceMessage -> Bool)
-> Eq SendVoiceMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendVoiceMessage -> SendVoiceMessage -> Bool
$c/= :: SendVoiceMessage -> SendVoiceMessage -> Bool
== :: SendVoiceMessage -> SendVoiceMessage -> Bool
$c== :: SendVoiceMessage -> SendVoiceMessage -> Bool
Prelude.Eq, ReadPrec [SendVoiceMessage]
ReadPrec SendVoiceMessage
Int -> ReadS SendVoiceMessage
ReadS [SendVoiceMessage]
(Int -> ReadS SendVoiceMessage)
-> ReadS [SendVoiceMessage]
-> ReadPrec SendVoiceMessage
-> ReadPrec [SendVoiceMessage]
-> Read SendVoiceMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendVoiceMessage]
$creadListPrec :: ReadPrec [SendVoiceMessage]
readPrec :: ReadPrec SendVoiceMessage
$creadPrec :: ReadPrec SendVoiceMessage
readList :: ReadS [SendVoiceMessage]
$creadList :: ReadS [SendVoiceMessage]
readsPrec :: Int -> ReadS SendVoiceMessage
$creadsPrec :: Int -> ReadS SendVoiceMessage
Prelude.Read, Int -> SendVoiceMessage -> ShowS
[SendVoiceMessage] -> ShowS
SendVoiceMessage -> String
(Int -> SendVoiceMessage -> ShowS)
-> (SendVoiceMessage -> String)
-> ([SendVoiceMessage] -> ShowS)
-> Show SendVoiceMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendVoiceMessage] -> ShowS
$cshowList :: [SendVoiceMessage] -> ShowS
show :: SendVoiceMessage -> String
$cshow :: SendVoiceMessage -> String
showsPrec :: Int -> SendVoiceMessage -> ShowS
$cshowsPrec :: Int -> SendVoiceMessage -> ShowS
Prelude.Show, (forall x. SendVoiceMessage -> Rep SendVoiceMessage x)
-> (forall x. Rep SendVoiceMessage x -> SendVoiceMessage)
-> Generic SendVoiceMessage
forall x. Rep SendVoiceMessage x -> SendVoiceMessage
forall x. SendVoiceMessage -> Rep SendVoiceMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendVoiceMessage x -> SendVoiceMessage
$cfrom :: forall x. SendVoiceMessage -> Rep SendVoiceMessage x
Prelude.Generic)

-- |
-- Create a value of 'SendVoiceMessage' 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:
--
-- 'configurationSetName', 'sendVoiceMessage_configurationSetName' - The name of the configuration set that you want to use to send the
-- message.
--
-- 'callerId', 'sendVoiceMessage_callerId' - The phone number that appears on recipients\' devices when they receive
-- the message.
--
-- 'originationPhoneNumber', 'sendVoiceMessage_originationPhoneNumber' - The phone number that Amazon Pinpoint should use to send the voice
-- message. This isn\'t necessarily the phone number that appears on
-- recipients\' devices when they receive the message, because you can
-- specify a CallerId parameter in the request.
--
-- 'content', 'sendVoiceMessage_content' - Undocumented member.
--
-- 'destinationPhoneNumber', 'sendVoiceMessage_destinationPhoneNumber' - The phone number that you want to send the voice message to.
newSendVoiceMessage ::
  SendVoiceMessage
newSendVoiceMessage :: SendVoiceMessage
newSendVoiceMessage =
  SendVoiceMessage' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VoiceMessageContent
-> Maybe Text
-> SendVoiceMessage
SendVoiceMessage'
    { $sel:configurationSetName:SendVoiceMessage' :: Maybe Text
configurationSetName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:callerId:SendVoiceMessage' :: Maybe Text
callerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:originationPhoneNumber:SendVoiceMessage' :: Maybe Text
originationPhoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:content:SendVoiceMessage' :: Maybe VoiceMessageContent
content = Maybe VoiceMessageContent
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationPhoneNumber:SendVoiceMessage' :: Maybe Text
destinationPhoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the configuration set that you want to use to send the
-- message.
sendVoiceMessage_configurationSetName :: Lens.Lens' SendVoiceMessage (Prelude.Maybe Prelude.Text)
sendVoiceMessage_configurationSetName :: (Maybe Text -> f (Maybe Text))
-> SendVoiceMessage -> f SendVoiceMessage
sendVoiceMessage_configurationSetName = (SendVoiceMessage -> Maybe Text)
-> (SendVoiceMessage -> Maybe Text -> SendVoiceMessage)
-> Lens SendVoiceMessage SendVoiceMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendVoiceMessage' {Maybe Text
configurationSetName :: Maybe Text
$sel:configurationSetName:SendVoiceMessage' :: SendVoiceMessage -> Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: SendVoiceMessage
s@SendVoiceMessage' {} Maybe Text
a -> SendVoiceMessage
s {$sel:configurationSetName:SendVoiceMessage' :: Maybe Text
configurationSetName = Maybe Text
a} :: SendVoiceMessage)

-- | The phone number that appears on recipients\' devices when they receive
-- the message.
sendVoiceMessage_callerId :: Lens.Lens' SendVoiceMessage (Prelude.Maybe Prelude.Text)
sendVoiceMessage_callerId :: (Maybe Text -> f (Maybe Text))
-> SendVoiceMessage -> f SendVoiceMessage
sendVoiceMessage_callerId = (SendVoiceMessage -> Maybe Text)
-> (SendVoiceMessage -> Maybe Text -> SendVoiceMessage)
-> Lens SendVoiceMessage SendVoiceMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendVoiceMessage' {Maybe Text
callerId :: Maybe Text
$sel:callerId:SendVoiceMessage' :: SendVoiceMessage -> Maybe Text
callerId} -> Maybe Text
callerId) (\s :: SendVoiceMessage
s@SendVoiceMessage' {} Maybe Text
a -> SendVoiceMessage
s {$sel:callerId:SendVoiceMessage' :: Maybe Text
callerId = Maybe Text
a} :: SendVoiceMessage)

-- | The phone number that Amazon Pinpoint should use to send the voice
-- message. This isn\'t necessarily the phone number that appears on
-- recipients\' devices when they receive the message, because you can
-- specify a CallerId parameter in the request.
sendVoiceMessage_originationPhoneNumber :: Lens.Lens' SendVoiceMessage (Prelude.Maybe Prelude.Text)
sendVoiceMessage_originationPhoneNumber :: (Maybe Text -> f (Maybe Text))
-> SendVoiceMessage -> f SendVoiceMessage
sendVoiceMessage_originationPhoneNumber = (SendVoiceMessage -> Maybe Text)
-> (SendVoiceMessage -> Maybe Text -> SendVoiceMessage)
-> Lens SendVoiceMessage SendVoiceMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendVoiceMessage' {Maybe Text
originationPhoneNumber :: Maybe Text
$sel:originationPhoneNumber:SendVoiceMessage' :: SendVoiceMessage -> Maybe Text
originationPhoneNumber} -> Maybe Text
originationPhoneNumber) (\s :: SendVoiceMessage
s@SendVoiceMessage' {} Maybe Text
a -> SendVoiceMessage
s {$sel:originationPhoneNumber:SendVoiceMessage' :: Maybe Text
originationPhoneNumber = Maybe Text
a} :: SendVoiceMessage)

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

-- | The phone number that you want to send the voice message to.
sendVoiceMessage_destinationPhoneNumber :: Lens.Lens' SendVoiceMessage (Prelude.Maybe Prelude.Text)
sendVoiceMessage_destinationPhoneNumber :: (Maybe Text -> f (Maybe Text))
-> SendVoiceMessage -> f SendVoiceMessage
sendVoiceMessage_destinationPhoneNumber = (SendVoiceMessage -> Maybe Text)
-> (SendVoiceMessage -> Maybe Text -> SendVoiceMessage)
-> Lens SendVoiceMessage SendVoiceMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendVoiceMessage' {Maybe Text
destinationPhoneNumber :: Maybe Text
$sel:destinationPhoneNumber:SendVoiceMessage' :: SendVoiceMessage -> Maybe Text
destinationPhoneNumber} -> Maybe Text
destinationPhoneNumber) (\s :: SendVoiceMessage
s@SendVoiceMessage' {} Maybe Text
a -> SendVoiceMessage
s {$sel:destinationPhoneNumber:SendVoiceMessage' :: Maybe Text
destinationPhoneNumber = Maybe Text
a} :: SendVoiceMessage)

instance Core.AWSRequest SendVoiceMessage where
  type
    AWSResponse SendVoiceMessage =
      SendVoiceMessageResponse
  request :: SendVoiceMessage -> Request SendVoiceMessage
request = Service -> SendVoiceMessage -> Request SendVoiceMessage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SendVoiceMessage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendVoiceMessage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SendVoiceMessage))
-> Logger
-> Service
-> Proxy SendVoiceMessage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendVoiceMessage)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> SendVoiceMessageResponse
SendVoiceMessageResponse'
            (Maybe Text -> Int -> SendVoiceMessageResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SendVoiceMessageResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MessageId")
            Either String (Int -> SendVoiceMessageResponse)
-> Either String Int -> Either String SendVoiceMessageResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable SendVoiceMessage

instance Prelude.NFData SendVoiceMessage

instance Core.ToHeaders SendVoiceMessage where
  toHeaders :: SendVoiceMessage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SendVoiceMessage -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON SendVoiceMessage where
  toJSON :: SendVoiceMessage -> Value
toJSON SendVoiceMessage' {Maybe Text
Maybe VoiceMessageContent
destinationPhoneNumber :: Maybe Text
content :: Maybe VoiceMessageContent
originationPhoneNumber :: Maybe Text
callerId :: Maybe Text
configurationSetName :: Maybe Text
$sel:destinationPhoneNumber:SendVoiceMessage' :: SendVoiceMessage -> Maybe Text
$sel:content:SendVoiceMessage' :: SendVoiceMessage -> Maybe VoiceMessageContent
$sel:originationPhoneNumber:SendVoiceMessage' :: SendVoiceMessage -> Maybe Text
$sel:callerId:SendVoiceMessage' :: SendVoiceMessage -> Maybe Text
$sel:configurationSetName:SendVoiceMessage' :: SendVoiceMessage -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ConfigurationSetName" 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
configurationSetName,
            (Text
"CallerId" 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
callerId,
            (Text
"OriginationPhoneNumber" 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
originationPhoneNumber,
            (Text
"Content" Text -> VoiceMessageContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VoiceMessageContent -> Pair)
-> Maybe VoiceMessageContent -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VoiceMessageContent
content,
            (Text
"DestinationPhoneNumber" 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
destinationPhoneNumber
          ]
      )

instance Core.ToPath SendVoiceMessage where
  toPath :: SendVoiceMessage -> ByteString
toPath = ByteString -> SendVoiceMessage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/sms-voice/voice/message"

instance Core.ToQuery SendVoiceMessage where
  toQuery :: SendVoiceMessage -> QueryString
toQuery = QueryString -> SendVoiceMessage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | An object that that contains the Message ID of a Voice message that was
-- sent successfully.
--
-- /See:/ 'newSendVoiceMessageResponse' smart constructor.
data SendVoiceMessageResponse = SendVoiceMessageResponse'
  { -- | A unique identifier for the voice message.
    SendVoiceMessageResponse -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    SendVoiceMessageResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SendVoiceMessageResponse -> SendVoiceMessageResponse -> Bool
(SendVoiceMessageResponse -> SendVoiceMessageResponse -> Bool)
-> (SendVoiceMessageResponse -> SendVoiceMessageResponse -> Bool)
-> Eq SendVoiceMessageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendVoiceMessageResponse -> SendVoiceMessageResponse -> Bool
$c/= :: SendVoiceMessageResponse -> SendVoiceMessageResponse -> Bool
== :: SendVoiceMessageResponse -> SendVoiceMessageResponse -> Bool
$c== :: SendVoiceMessageResponse -> SendVoiceMessageResponse -> Bool
Prelude.Eq, ReadPrec [SendVoiceMessageResponse]
ReadPrec SendVoiceMessageResponse
Int -> ReadS SendVoiceMessageResponse
ReadS [SendVoiceMessageResponse]
(Int -> ReadS SendVoiceMessageResponse)
-> ReadS [SendVoiceMessageResponse]
-> ReadPrec SendVoiceMessageResponse
-> ReadPrec [SendVoiceMessageResponse]
-> Read SendVoiceMessageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendVoiceMessageResponse]
$creadListPrec :: ReadPrec [SendVoiceMessageResponse]
readPrec :: ReadPrec SendVoiceMessageResponse
$creadPrec :: ReadPrec SendVoiceMessageResponse
readList :: ReadS [SendVoiceMessageResponse]
$creadList :: ReadS [SendVoiceMessageResponse]
readsPrec :: Int -> ReadS SendVoiceMessageResponse
$creadsPrec :: Int -> ReadS SendVoiceMessageResponse
Prelude.Read, Int -> SendVoiceMessageResponse -> ShowS
[SendVoiceMessageResponse] -> ShowS
SendVoiceMessageResponse -> String
(Int -> SendVoiceMessageResponse -> ShowS)
-> (SendVoiceMessageResponse -> String)
-> ([SendVoiceMessageResponse] -> ShowS)
-> Show SendVoiceMessageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendVoiceMessageResponse] -> ShowS
$cshowList :: [SendVoiceMessageResponse] -> ShowS
show :: SendVoiceMessageResponse -> String
$cshow :: SendVoiceMessageResponse -> String
showsPrec :: Int -> SendVoiceMessageResponse -> ShowS
$cshowsPrec :: Int -> SendVoiceMessageResponse -> ShowS
Prelude.Show, (forall x.
 SendVoiceMessageResponse -> Rep SendVoiceMessageResponse x)
-> (forall x.
    Rep SendVoiceMessageResponse x -> SendVoiceMessageResponse)
-> Generic SendVoiceMessageResponse
forall x.
Rep SendVoiceMessageResponse x -> SendVoiceMessageResponse
forall x.
SendVoiceMessageResponse -> Rep SendVoiceMessageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendVoiceMessageResponse x -> SendVoiceMessageResponse
$cfrom :: forall x.
SendVoiceMessageResponse -> Rep SendVoiceMessageResponse x
Prelude.Generic)

-- |
-- Create a value of 'SendVoiceMessageResponse' 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:
--
-- 'messageId', 'sendVoiceMessageResponse_messageId' - A unique identifier for the voice message.
--
-- 'httpStatus', 'sendVoiceMessageResponse_httpStatus' - The response's http status code.
newSendVoiceMessageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SendVoiceMessageResponse
newSendVoiceMessageResponse :: Int -> SendVoiceMessageResponse
newSendVoiceMessageResponse Int
pHttpStatus_ =
  SendVoiceMessageResponse' :: Maybe Text -> Int -> SendVoiceMessageResponse
SendVoiceMessageResponse'
    { $sel:messageId:SendVoiceMessageResponse' :: Maybe Text
messageId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SendVoiceMessageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A unique identifier for the voice message.
sendVoiceMessageResponse_messageId :: Lens.Lens' SendVoiceMessageResponse (Prelude.Maybe Prelude.Text)
sendVoiceMessageResponse_messageId :: (Maybe Text -> f (Maybe Text))
-> SendVoiceMessageResponse -> f SendVoiceMessageResponse
sendVoiceMessageResponse_messageId = (SendVoiceMessageResponse -> Maybe Text)
-> (SendVoiceMessageResponse
    -> Maybe Text -> SendVoiceMessageResponse)
-> Lens
     SendVoiceMessageResponse
     SendVoiceMessageResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendVoiceMessageResponse' {Maybe Text
messageId :: Maybe Text
$sel:messageId:SendVoiceMessageResponse' :: SendVoiceMessageResponse -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: SendVoiceMessageResponse
s@SendVoiceMessageResponse' {} Maybe Text
a -> SendVoiceMessageResponse
s {$sel:messageId:SendVoiceMessageResponse' :: Maybe Text
messageId = Maybe Text
a} :: SendVoiceMessageResponse)

-- | The response's http status code.
sendVoiceMessageResponse_httpStatus :: Lens.Lens' SendVoiceMessageResponse Prelude.Int
sendVoiceMessageResponse_httpStatus :: (Int -> f Int)
-> SendVoiceMessageResponse -> f SendVoiceMessageResponse
sendVoiceMessageResponse_httpStatus = (SendVoiceMessageResponse -> Int)
-> (SendVoiceMessageResponse -> Int -> SendVoiceMessageResponse)
-> Lens SendVoiceMessageResponse SendVoiceMessageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendVoiceMessageResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendVoiceMessageResponse' :: SendVoiceMessageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendVoiceMessageResponse
s@SendVoiceMessageResponse' {} Int
a -> SendVoiceMessageResponse
s {$sel:httpStatus:SendVoiceMessageResponse' :: Int
httpStatus = Int
a} :: SendVoiceMessageResponse)

instance Prelude.NFData SendVoiceMessageResponse