createSmsTemplate method

Future<CreateSmsTemplateResponse> createSmsTemplate({
  1. required SMSTemplateRequest sMSTemplateRequest,
  2. required String templateName,
})

Creates a message template for messages that are sent through the SMS channel.

May throw MethodNotAllowedException. May throw TooManyRequestsException. May throw BadRequestException. May throw InternalServerErrorException. May throw ForbiddenException.

Parameter templateName : The name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.

Implementation

Future<CreateSmsTemplateResponse> createSmsTemplate({
  required SMSTemplateRequest sMSTemplateRequest,
  required String templateName,
}) async {
  ArgumentError.checkNotNull(sMSTemplateRequest, 'sMSTemplateRequest');
  ArgumentError.checkNotNull(templateName, 'templateName');
  final response = await _protocol.sendRaw(
    payload: sMSTemplateRequest,
    method: 'POST',
    requestUri: '/v1/templates/${Uri.encodeComponent(templateName)}/sms',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return CreateSmsTemplateResponse(
    createTemplateMessageBody: CreateTemplateMessageBody.fromJson($json),
  );
}