getBarcodeRecognize method
Future<BarcodeResponseList>
getBarcodeRecognize(
- String name, {
- String? type,
- List<
DecodeBarcodeType> ? types, - String? checksumValidation,
- bool? detectEncoding,
- String? preset,
- int? rectX,
- int? rectY,
- int? rectWidth,
- int? rectHeight,
- bool? stripFNC,
- int? timeout,
- int? medianSmoothingWindowSize,
- bool? allowMedianSmoothing,
- bool? allowComplexBackground,
- bool? allowDatamatrixIndustrialBarcodes,
- bool? allowDecreasedImage,
- bool? allowDetectScanGap,
- bool? allowIncorrectBarcodes,
- bool? allowInvertImage,
- bool? allowMicroWhiteSpotsRemoving,
- bool? allowOneDFastBarcodesDetector,
- bool? allowOneDWipedBarsRestoration,
- bool? allowQRMicroQrRestoration,
- bool? allowRegularImage,
- bool? allowSaltAndPepperFiltering,
- bool? allowWhiteSpotsRemoving,
- bool? checkMore1DVariants,
- bool? fastScanOnly,
- bool? allowAdditionalRestorations,
- double? regionLikelihoodThresholdPercent,
- List<
int> ? scanWindowSizes, - double? similarity,
- bool? skipDiagonalSearch,
- bool? readTinyBarcodes,
- String? australianPostEncodingTable,
- bool? ignoreEndingFillingPatternsForCTable,
- String? storage,
- String? folder,
Recognize barcode from a file on server.
Implementation
Future<BarcodeResponseList> getBarcodeRecognize(String name,
{String? type,
List<DecodeBarcodeType>? types,
String? checksumValidation,
bool? detectEncoding,
String? preset,
int? rectX,
int? rectY,
int? rectWidth,
int? rectHeight,
bool? stripFNC,
int? timeout,
int? medianSmoothingWindowSize,
bool? allowMedianSmoothing,
bool? allowComplexBackground,
bool? allowDatamatrixIndustrialBarcodes,
bool? allowDecreasedImage,
bool? allowDetectScanGap,
bool? allowIncorrectBarcodes,
bool? allowInvertImage,
bool? allowMicroWhiteSpotsRemoving,
bool? allowOneDFastBarcodesDetector,
bool? allowOneDWipedBarsRestoration,
bool? allowQRMicroQrRestoration,
bool? allowRegularImage,
bool? allowSaltAndPepperFiltering,
bool? allowWhiteSpotsRemoving,
bool? checkMore1DVariants,
bool? fastScanOnly,
bool? allowAdditionalRestorations,
double? regionLikelihoodThresholdPercent,
List<int>? scanWindowSizes,
double? similarity,
bool? skipDiagonalSearch,
bool? readTinyBarcodes,
String? australianPostEncodingTable,
bool? ignoreEndingFillingPatternsForCTable,
String? storage,
String? folder}) async {
// ignore: prefer_final_locals
Object? postBody;
// create path and map variables
final String requestPath = "/barcode/{name}/recognize"
.replaceAll("{format}", "json")
.replaceAll("{name}", name);
// query params
final List<QueryParam> queryParams = [];
final Map<String, String> headerParams = {};
final Map<String, String> formParams = {};
if (type != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "Type", type));
}
if (types != null) {
queryParams.addAll(
convertParametersForCollectionFormat("multi", "Types", types));
}
if (checksumValidation != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "ChecksumValidation", checksumValidation));
}
if (detectEncoding != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "DetectEncoding", detectEncoding));
}
if (preset != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "Preset", preset));
}
if (rectX != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "RectX", rectX));
}
if (rectY != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "RectY", rectY));
}
if (rectWidth != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "RectWidth", rectWidth));
}
if (rectHeight != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "RectHeight", rectHeight));
}
if (stripFNC != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "StripFNC", stripFNC));
}
if (timeout != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "Timeout", timeout));
}
if (medianSmoothingWindowSize != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "MedianSmoothingWindowSize", medianSmoothingWindowSize));
}
if (allowMedianSmoothing != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowMedianSmoothing", allowMedianSmoothing));
}
if (allowComplexBackground != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowComplexBackground", allowComplexBackground));
}
if (allowDatamatrixIndustrialBarcodes != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"",
"AllowDatamatrixIndustrialBarcodes",
allowDatamatrixIndustrialBarcodes));
}
if (allowDecreasedImage != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowDecreasedImage", allowDecreasedImage));
}
if (allowDetectScanGap != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowDetectScanGap", allowDetectScanGap));
}
if (allowIncorrectBarcodes != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowIncorrectBarcodes", allowIncorrectBarcodes));
}
if (allowInvertImage != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowInvertImage", allowInvertImage));
}
if (allowMicroWhiteSpotsRemoving != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowMicroWhiteSpotsRemoving", allowMicroWhiteSpotsRemoving));
}
if (allowOneDFastBarcodesDetector != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowOneDFastBarcodesDetector", allowOneDFastBarcodesDetector));
}
if (allowOneDWipedBarsRestoration != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowOneDWipedBarsRestoration", allowOneDWipedBarsRestoration));
}
if (allowQRMicroQrRestoration != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowQRMicroQrRestoration", allowQRMicroQrRestoration));
}
if (allowRegularImage != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowRegularImage", allowRegularImage));
}
if (allowSaltAndPepperFiltering != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowSaltAndPepperFiltering", allowSaltAndPepperFiltering));
}
if (allowWhiteSpotsRemoving != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowWhiteSpotsRemoving", allowWhiteSpotsRemoving));
}
if (checkMore1DVariants != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "CheckMore1DVariants", checkMore1DVariants));
}
if (fastScanOnly != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "FastScanOnly", fastScanOnly));
}
if (allowAdditionalRestorations != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AllowAdditionalRestorations", allowAdditionalRestorations));
}
if (regionLikelihoodThresholdPercent != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"",
"RegionLikelihoodThresholdPercent",
regionLikelihoodThresholdPercent));
}
if (scanWindowSizes != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"multi", "ScanWindowSizes", scanWindowSizes));
}
if (similarity != null) {
queryParams.addAll(
convertParametersForCollectionFormat("", "Similarity", similarity));
}
if (skipDiagonalSearch != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "SkipDiagonalSearch", skipDiagonalSearch));
}
if (readTinyBarcodes != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "ReadTinyBarcodes", readTinyBarcodes));
}
if (australianPostEncodingTable != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"", "AustralianPostEncodingTable", australianPostEncodingTable));
}
if (ignoreEndingFillingPatternsForCTable != null) {
queryParams.addAll(convertParametersForCollectionFormat(
"",
"IgnoreEndingFillingPatternsForCTable",
ignoreEndingFillingPatternsForCTable));
}
if (storage != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "storage", storage));
}
if (folder != null) {
queryParams
.addAll(convertParametersForCollectionFormat("", "folder", folder));
}
final List<String> contentTypes = ["application/json"];
final String contentType =
contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
final List<String> authNames = ["JWT"];
final response = await _apiClient.invokeAPI(requestPath, 'GET', queryParams,
postBody, headerParams, formParams, contentType, authNames);
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else {
return _apiClient.deserialize(response.body, 'BarcodeResponseList')
as BarcodeResponseList;
}
}