func (r *{{resource_name}}Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
	{% if delete_operation %}
	var data *{{resource_name}}ResourceModel

	resp.Diagnostics.Append(req.State.Get(ctx, &data)...)
	if resp.Diagnostics.HasError() {
		return
	}

	{% for var in delete_vars %}
    {{ var }}
    {% endfor %}

	request := {{resource_name | lower }}.{{delete_operation}}Request{
		{% for param in delete_parameters -%}
		{{param | capitalize }}: {{param}},
		{% endfor %}
	}
	res, err := r.client.{{delete_method_name}}(ctx, request)
	if err != nil {
		resp.Diagnostics.AddError("failure to invoke API", err.Error())
		if res != nil && res.RawResponse != nil {
			resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse))
		}
		return
	}
	if res == nil {
		resp.Diagnostics.AddError("unexpected response from API", fmt.Sprintf("%v", res))
		return
	}
	{% else %}
	// Delete function is not implemented or supported
	{% endif %}
}
