rawSetDocumentAttachmentMultiWithHttpInfo method

Future<Response> rawSetDocumentAttachmentMultiWithHttpInfo(
  1. String documentId,
  2. MultipartFile attachment, {
  3. String? enckeys,
})

Creates a document's attachment

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> rawSetDocumentAttachmentMultiWithHttpInfo(String documentId, MultipartFile attachment, { String? enckeys, }) async {
  // ignore: prefer_const_declarations
  final path = r'/rest/v1/document/{documentId}/attachment/multipart'.replaceAll('{documentId}', documentId);

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

  if (enckeys != null) {
    queryParams.addAll(_queryParams('', 'enckeys', enckeys));
  }

  const authNames = <String>[r'basicSchema'];
  const contentTypes = <String>['multipart/form-data'];

  final mp = MultipartRequest('PUT', Uri.parse(path));
  mp.files.add(attachment);

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