modelFilesUploadSingleFile method

Future<FileUploadResult> modelFilesUploadSingleFile(
  1. String tenantId,
  2. String region,
  3. MultipartFile file,
  4. String assetName, {
  5. String segmentName,
  6. String revision,
  7. String status,
  8. int assetId,
  9. int modelId,
  10. String originalFilename,
})

A one-stop service for Uploading an IFC model file, creating an asset and Model as required, and initiating processing

Summary:A one-stop service for Uploading an IFC model file, creating an asset and Model as required, and initiating processing.
Uploads a model File, creating a new Asset and Model as required. The model is associated with the named asset. The Asset will be created if it does not exist.
On successful upload the model will be queued for processing..
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): A model file in the correct format (IFC / IFCZip / Zip)

  • String assetName (required): The name of the asset to associate the model upload with.

  • String segmentName: The name of the asset segment to associate the model with. The segment will be created if not present. Defaults to the Model Name if undefined

  • String revision: A version identifier for the model.

  • String status: A status identifier for the model

  • int assetId: The ID of the asset to associate the model upload with. If not defined, a new asset will be created.

  • int modelId: The ID of the model to be populated with the data. If not defined, a new model will be created.

  • String originalFilename: The original filename of the model, for zipped models

Implementation

Future<FileUploadResult> modelFilesUploadSingleFile(String tenantId, String region, MultipartFile file, String assetName, { String segmentName, String revision, String status, int assetId, int modelId, String originalFilename, }) async {
  final response = await modelFilesUploadSingleFileWithHttpInfo(tenantId, region, file, assetName,  segmentName: segmentName, revision: revision, status: status, assetId: assetId, modelId: modelId, originalFilename: originalFilename, );
  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();
}