documentFilesUploadSingleFile method

Future<FileUploadResult> documentFilesUploadSingleFile(
  1. String tenantId,
  2. String region,
  3. MultipartFile file,
  4. String documentName,
  5. int assetId,
  6. int modelId, {
  7. String externalId,
})

Uploads a document file related to a specific model

Summary:Uploads a document file related to a specific model.
The document will be associated with the asset and model provided in the Form data parameters.
Return Type: FileUploadResult

Parameters:

  • String tenantId (required): The unique Tenant ID (UUID or Identifier string)

  • String region (required): The data center region the data resides in

  • MultipartFile file (required): An arbitrary document which will get associated to the model or its parts.

  • String documentName (required): The name of the Document

  • int assetId (required): Asset which should contain the document

  • int modelId (required): Asset model which should contain the document

  • String externalId: External identity of the document. This will be used for versioning.

Implementation

Future<FileUploadResult> documentFilesUploadSingleFile(String tenantId, String region, MultipartFile file, String documentName, int assetId, int modelId, { String externalId, }) async {
  final response = await documentFilesUploadSingleFileWithHttpInfo(tenantId, region, file, documentName, assetId, modelId,  externalId: externalId, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body != null && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'FileUploadResult',) as FileUploadResult;

  }
  return Future<FileUploadResult>.value();
}