Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Creates a new text message and sends it to a recipient's phone number.
SMS throughput limits are measured in Message Parts per Second (MPS). Your MPS limit depends on the destination country of your messages, as well as the type of phone number (origination number) that you use to send the message. For more information, see Message Parts per Second (MPS) limits in the Amazon Pinpoint User Guide.
Synopsis
- data SendTextMessage = SendTextMessage' {
- configurationSetName :: Maybe Text
- context :: Maybe (HashMap Text Text)
- destinationCountryParameters :: Maybe (HashMap DestinationCountryParameterKey Text)
- dryRun :: Maybe Bool
- keyword :: Maybe Text
- maxPrice :: Maybe Text
- messageBody :: Maybe Text
- messageType :: Maybe MessageType
- originationIdentity :: Maybe Text
- timeToLive :: Maybe Natural
- destinationPhoneNumber :: Text
- newSendTextMessage :: Text -> SendTextMessage
- sendTextMessage_configurationSetName :: Lens' SendTextMessage (Maybe Text)
- sendTextMessage_context :: Lens' SendTextMessage (Maybe (HashMap Text Text))
- sendTextMessage_destinationCountryParameters :: Lens' SendTextMessage (Maybe (HashMap DestinationCountryParameterKey Text))
- sendTextMessage_dryRun :: Lens' SendTextMessage (Maybe Bool)
- sendTextMessage_keyword :: Lens' SendTextMessage (Maybe Text)
- sendTextMessage_maxPrice :: Lens' SendTextMessage (Maybe Text)
- sendTextMessage_messageBody :: Lens' SendTextMessage (Maybe Text)
- sendTextMessage_messageType :: Lens' SendTextMessage (Maybe MessageType)
- sendTextMessage_originationIdentity :: Lens' SendTextMessage (Maybe Text)
- sendTextMessage_timeToLive :: Lens' SendTextMessage (Maybe Natural)
- sendTextMessage_destinationPhoneNumber :: Lens' SendTextMessage Text
- data SendTextMessageResponse = SendTextMessageResponse' {
- messageId :: Maybe Text
- httpStatus :: Int
- newSendTextMessageResponse :: Int -> SendTextMessageResponse
- sendTextMessageResponse_messageId :: Lens' SendTextMessageResponse (Maybe Text)
- sendTextMessageResponse_httpStatus :: Lens' SendTextMessageResponse Int
Creating a Request
data SendTextMessage Source #
See: newSendTextMessage
smart constructor.
SendTextMessage' | |
|
Instances
Create a value of SendTextMessage
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
SendTextMessage
, sendTextMessage_configurationSetName
- The name of the configuration set to use. This can be either the
ConfigurationSetName or ConfigurationSetArn.
$sel:context:SendTextMessage'
, sendTextMessage_context
- You can specify custom data in this field. If you do, that data is
logged to the event destination.
$sel:destinationCountryParameters:SendTextMessage'
, sendTextMessage_destinationCountryParameters
- This field is used for any country-specific registration requirements.
Currently, this setting is only used when you send messages to
recipients in India using a sender ID. For more information see
Special requirements for sending SMS messages to recipients in India.
$sel:dryRun:SendTextMessage'
, sendTextMessage_dryRun
- When set to true, the message is checked and validated, but isn't sent
to the end recipient.
SendTextMessage
, sendTextMessage_keyword
- When you register a short code in the US, you must specify a program
name. If you don’t have a US short code, omit this attribute.
$sel:maxPrice:SendTextMessage'
, sendTextMessage_maxPrice
- The maximum amount that you want to spend, in US dollars, per each text
message part. A text message can contain multiple parts.
$sel:messageBody:SendTextMessage'
, sendTextMessage_messageBody
- The body of the text message.
SendTextMessage
, sendTextMessage_messageType
- The type of message. Valid values are TRANSACTIONAL for messages that
are critical or time-sensitive and PROMOTIONAL for messages that aren't
critical or time-sensitive.
SendTextMessage
, sendTextMessage_originationIdentity
- The origination identity of the message. This can be either the
PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn,
PoolId, or PoolArn.
$sel:timeToLive:SendTextMessage'
, sendTextMessage_timeToLive
- How long the text message is valid for. By default this is 72 hours.
$sel:destinationPhoneNumber:SendTextMessage'
, sendTextMessage_destinationPhoneNumber
- The destination phone number in E.164 format.
Request Lenses
sendTextMessage_configurationSetName :: Lens' SendTextMessage (Maybe Text) Source #
The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
sendTextMessage_context :: Lens' SendTextMessage (Maybe (HashMap Text Text)) Source #
You can specify custom data in this field. If you do, that data is logged to the event destination.
sendTextMessage_destinationCountryParameters :: Lens' SendTextMessage (Maybe (HashMap DestinationCountryParameterKey Text)) Source #
This field is used for any country-specific registration requirements. Currently, this setting is only used when you send messages to recipients in India using a sender ID. For more information see Special requirements for sending SMS messages to recipients in India.
sendTextMessage_dryRun :: Lens' SendTextMessage (Maybe Bool) Source #
When set to true, the message is checked and validated, but isn't sent to the end recipient.
sendTextMessage_keyword :: Lens' SendTextMessage (Maybe Text) Source #
When you register a short code in the US, you must specify a program name. If you don’t have a US short code, omit this attribute.
sendTextMessage_maxPrice :: Lens' SendTextMessage (Maybe Text) Source #
The maximum amount that you want to spend, in US dollars, per each text message part. A text message can contain multiple parts.
sendTextMessage_messageBody :: Lens' SendTextMessage (Maybe Text) Source #
The body of the text message.
sendTextMessage_messageType :: Lens' SendTextMessage (Maybe MessageType) Source #
The type of message. Valid values are TRANSACTIONAL for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.
sendTextMessage_originationIdentity :: Lens' SendTextMessage (Maybe Text) Source #
The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.
sendTextMessage_timeToLive :: Lens' SendTextMessage (Maybe Natural) Source #
How long the text message is valid for. By default this is 72 hours.
sendTextMessage_destinationPhoneNumber :: Lens' SendTextMessage Text Source #
The destination phone number in E.164 format.
Destructuring the Response
data SendTextMessageResponse Source #
See: newSendTextMessageResponse
smart constructor.
SendTextMessageResponse' | |
|
Instances
newSendTextMessageResponse Source #
Create a value of SendTextMessageResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:messageId:SendTextMessageResponse'
, sendTextMessageResponse_messageId
- The unique identifier for the message.
$sel:httpStatus:SendTextMessageResponse'
, sendTextMessageResponse_httpStatus
- The response's http status code.
Response Lenses
sendTextMessageResponse_messageId :: Lens' SendTextMessageResponse (Maybe Text) Source #
The unique identifier for the message.
sendTextMessageResponse_httpStatus :: Lens' SendTextMessageResponse Int Source #
The response's http status code.