deleteWhatsAppMessageTemplate method

Future<void> deleteWhatsAppMessageTemplate({
  1. required String id,
  2. required String templateName,
  3. bool? deleteAllLanguages,
  4. String? metaTemplateId,
})

Deletes a WhatsApp message template.

May throw AccessDeniedByMetaException. May throw DependencyException. May throw InternalServiceException. May throw InvalidParametersException. May throw ResourceNotFoundException. May throw ThrottledRequestException.

Parameter id : The ID of the WhatsApp Business Account associated with this template.

Parameter templateName : The name of the template to delete.

Parameter deleteAllLanguages : If true, deletes all language versions of the template.

Parameter metaTemplateId : The numeric ID of the template assigned by Meta.

Implementation

Future<void> deleteWhatsAppMessageTemplate({
  required String id,
  required String templateName,
  bool? deleteAllLanguages,
  String? metaTemplateId,
}) async {
  final $query = <String, List<String>>{
    'id': [id],
    'templateName': [templateName],
    if (deleteAllLanguages != null)
      'deleteAllTemplates': [deleteAllLanguages.toString()],
    if (metaTemplateId != null) 'metaTemplateId': [metaTemplateId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/v1/whatsapp/template',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}