updateTemplate method

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

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

https://atprotodart.com/docs/lexicons/tools/ozone/communication/updateTemplate

Implementation

Future<XRPCResponse<TemplateView>> updateTemplate({
  required String id,
  String? name,
  String? lang,
  String? contentMarkdown,
  String? subject,
  String? updatedBy,
  bool? disabled,
  Map<String, String>? $unknown,
  Map<String, String>? $headers,
  PostClient? $client,
}) async =>
    await _ctx.post<TemplateView>(
      ns.toolsOzoneCommunicationUpdateTemplate,
      headers: $headers,
      body: {
        '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,
        ...?$unknown,
      },
      to: const TemplateViewConverter().fromJson,
      client: $client,
    );