toolsOzoneCommunicationUpdateTemplate function

Future<XRPCResponse<TemplateView>> toolsOzoneCommunicationUpdateTemplate({
  1. required String id,
  2. String? name,
  3. String? lang,
  4. String? contentMarkdown,
  5. String? subject,
  6. String? updatedBy,
  7. bool? disabled,
  8. required ServiceContext $ctx,
  9. Map<String, String>? $headers,
  10. Map<String, String>? $unknown,
})

Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.

Implementation

Future<XRPCResponse<TemplateView>> toolsOzoneCommunicationUpdateTemplate({
  required String id,
  String? name,
  String? lang,
  String? contentMarkdown,
  String? subject,
  String? updatedBy,
  bool? disabled,
  required ServiceContext $ctx,
  Map<String, String>? $headers,
  Map<String, String>? $unknown,
}) async => await $ctx.post(
  ns.toolsOzoneCommunicationUpdateTemplate,
  headers: {'Content-type': 'application/json', ...?$headers},
  body: {
    ...?$unknown,
    'id': id,
    if (name != null) 'name': name,
    if (lang != null) 'lang': lang,
    if (contentMarkdown != null) 'contentMarkdown': contentMarkdown,
    if (subject != null) 'subject': subject,
    if (updatedBy != null) 'updatedBy': updatedBy,
    if (disabled != null) 'disabled': disabled,
  },
  to: const TemplateViewConverter().fromJson,
);