publishLegacyDraft method

Future<Content> publishLegacyDraft({
  1. required String draftId,
  2. String? status,
  3. List<String>? expand,
  4. required ContentBlueprintDraft body,
})

Publishes a legacy draft of a page created from a blueprint. Legacy drafts will eventually be removed in favor of shared drafts. For now, this method works the same as Publish shared draft.

By default, the following objects are expanded: body.storage, history, space, version, ancestors.

Permissions required: Permission to view the draft and 'Add' permission for the space that the content will be created in.

Implementation

Future<Content> publishLegacyDraft(
    {required String draftId,
    String? status,
    List<String>? expand,
    required ContentBlueprintDraft body}) async {
  return Content.fromJson(await _client.send(
    'post',
    'wiki/rest/api/content/blueprint/instance/{draftId}',
    pathParameters: {
      'draftId': draftId,
    },
    queryParameters: {
      if (status != null) 'status': status,
      if (expand != null) 'expand': expand.map((e) => e).join(','),
    },
    body: body.toJson(),
  ));
}