attributesChangeDataTypeByAssetmodelidAndDefinitionidAndTenantid method
Change the underlying data type for the attribute, migrating any existing data where possible
Summary:Change the underlying data type for the attribute, migrating any existing data where possible.
This operation will attempt to generate new typed data values from the current value. Note this may result in an empty value if no conversion can be made - however the original values will be kept allowing the process to be reversed, so this is not permanently lossy.
E.g. converting Text value '15' to a Real or Integer will produce expected results, but an original value of 'FIVE' would fail to parse.
Equally, some conversions make little sense, such as Logical converting to Date, and will be rejected..
Return Type: ODataResponseOfBoolean
For more information about OData responses link.
Parameters:
Implementation
Future<ODataResponseOfBoolean> attributesChangeDataTypeByAssetmodelidAndDefinitionidAndTenantid(int assetModelId, int definitionId, String dataType, String tenantId, String region,) async {
final response = await attributesChangeDataTypeByAssetmodelidAndDefinitionidAndTenantidWithHttpInfo(assetModelId, definitionId, dataType, tenantId, region,);
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), 'ODataResponseOfBoolean',) as ODataResponseOfBoolean;
}
return Future<ODataResponseOfBoolean>.value();
}