previewTemplateWithHttpInfo method

Future<Response> previewTemplateWithHttpInfo(
  1. String templateType,
  2. String slug, {
  3. PreviewTemplateRequest? previewTemplateRequest,
})

Preview changes to a template

Returns a preview of a template for a given template_type, slug and body

Note: This method returns the HTTP Response.

Parameters:

  • String templateType (required): The type of template to preview

  • String slug (required): The slug of the template to preview

  • PreviewTemplateRequest previewTemplateRequest: Required parameters

Implementation

Future<http.Response> previewTemplateWithHttpInfo(
  String templateType,
  String slug, {
  PreviewTemplateRequest? previewTemplateRequest,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/templates/{template_type}/{slug}/preview'
      .replaceAll('{template_type}', templateType)
      .replaceAll('{slug}', slug);

  // ignore: prefer_final_locals
  Object? postBody = previewTemplateRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}