asyncConvertContentBodyRequest method

Future<AsyncId> asyncConvertContentBodyRequest({
  1. required String to,
  2. List<String>? expand,
  3. String? spaceKeyContext,
  4. String? contentIdContext,
  5. bool? allowCache,
  6. String? embeddedContentRender,
  7. required ContentBodyCreate body,
})

Converts a content body from one format to another format asynchronously. Returns the asyncId for the asynchronous task.

Supported conversions:

  • storage: export_view

No other conversions are supported at the moment. Once a conversion is completed, it will be available for 5 minutes at the result endpoint.

Permissions required: If request specifies 'contentIdContext', 'View' permission for the space, and permission to view the content.

Implementation

Future<AsyncId> asyncConvertContentBodyRequest(
    {required String to,
    List<String>? expand,
    String? spaceKeyContext,
    String? contentIdContext,
    bool? allowCache,
    String? embeddedContentRender,
    required ContentBodyCreate body}) async {
  return AsyncId.fromJson(await _client.send(
    'post',
    'wiki/rest/api/contentbody/convert/async/{to}',
    pathParameters: {
      'to': to,
    },
    queryParameters: {
      if (expand != null) 'expand': expand.map((e) => e).join(','),
      if (spaceKeyContext != null) 'spaceKeyContext': spaceKeyContext,
      if (contentIdContext != null) 'contentIdContext': contentIdContext,
      if (allowCache != null) 'allowCache': '$allowCache',
      if (embeddedContentRender != null)
        'embeddedContentRender': embeddedContentRender,
    },
    body: body.toJson(),
  ));
}