Creates a message template for messages that are sent through the voice channel.
Parameters:
-
template_name
(__string)
–
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.
Raises:
Source code in docs_src/capo_pinpoint/_services/async_pinpoint.py
| async def create_voice_template(
self,
template_name: "capo_pinpoint.types.__string.__string",
*,
config_overrides: Optional[AsyncPinpointClientConfig] = None,
voice_template_request: Optional[
"capo_pinpoint.types.voice_template_request.VoiceTemplateRequest"
] = None,
) -> (
"capo_pinpoint.types.create_voice_template_response.CreateVoiceTemplateResponse"
):
"""<p>Creates a message template for messages that are sent through the voice channel.</p>
Args:
template_name: <p>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.</p>
Raises:
capo_pinpoint.errors.bad_request_exception.BadRequestException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.forbidden_exception.ForbiddenException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.internal_server_error_exception.InternalServerErrorException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.method_not_allowed_exception.MethodNotAllowedException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.too_many_requests_exception.TooManyRequestsException: <p>Provides information about an API request or response.</p>
capo_pinpoint.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_pinpoint.types.create_voice_template_request.CreateVoiceTemplateRequest]",
) -> AsyncOperationResponse[
"capo_pinpoint.types.create_voice_template_response.CreateVoiceTemplateResponse"
]:
import capo_pinpoint._operations.pinpoint.create_voice_template
(
output,
http_response,
) = await capo_pinpoint._operations.pinpoint.create_voice_template.async_create_voice_template(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateVoiceTemplate")
)
input_: capo_pinpoint.types.create_voice_template_request.CreateVoiceTemplateRequest = {
"template_name": template_name
}
if voice_template_request is not None:
input_["voice_template_request"] = voice_template_request
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|